/home/bes3soft/bes3soft/Boss/7.0.2/dist/7.0.2/Trigger/Trigger/Trigger-00-01-05/Trigger/BesTrigL1.h

Go to the documentation of this file.
00001 #ifndef BesTrigL1_h
00002 #define BesTrigL1_h 1
00003 
00004 // from Gaudi
00005 #include "GaudiKernel/Algorithm.h"
00006 #include "GaudiKernel/NTuple.h"
00007 #include "GaudiKernel/INTuple.h"
00008 #include "GaudiKernel/INTupleSvc.h"
00009 #include "GaudiKernel/ITHistSvc.h"
00010 #include <fstream>
00011 #include "RawDataProviderSvc/IRawDataProviderSvc.h"
00012 #include "MdcGeomSvc/IMdcGeomSvc.h"
00013 #include "Trigger/MdcTSF.h"
00014 #include "Trigger/TofHitCount.h"
00015 #include "Trigger/EmcTCFinder.h"
00016 #include "Trigger/MucTrigHit.h"
00017 
00018 #include "RealizationSvc/RealizationSvc.h"
00019 #include "RealizationSvc/IRealizationSvc.h"
00020 #include "EmcCalibConstSvc/IEmcCalibConstSvc.h"
00021 
00022 #include "TROOT.h"
00023 #include "TObjArray.h"
00024 #include "TH1F.h"
00025 #include "TProfile.h"
00026 
00027 using namespace std;
00028 
00029 class IBesGlobalTrigSvc;
00030 class BesGlobalTrigSvc;
00031 class TrigTOFT;
00032 class TrigEACC;
00033 class EmcWaveform;
00034 
00035 class BesTrigL1 : public Algorithm {
00036 public:
00038   BesTrigL1( const std::string& name, ISvcLocator* pSvcLocator );
00039   virtual ~BesTrigL1(){ }; 
00040   
00041   virtual StatusCode initialize();    
00042   virtual StatusCode execute   ();    
00043   virtual StatusCode finalize  ();    
00044   void    findSETime(multimap<int,uint32_t,less<int> > mdc_hitmap, multimap<int,int,less<int> > tof_hitmap, multimap<int,uint32_t,less<int> > emc_TC,
00045                            double& stime, double& etime);
00046 
00047   void runAclock_mdc(int iclock, double stime, multimap<int,uint32_t,less<int> > mdc_hitmap); 
00048   void runAclock_tof(int iclock, double stime, int& idle_status, std::multimap<int,int,less<int> > tof_hitmap); 
00049   void runAclock_emc(int iclock, double stime, std::multimap<int,uint32_t,less<int> > emc_TC, EmcWaveform* blockWave);
00050   void getEmcAnalogSig(EmcDigiCol* emcDigiCol, EmcWaveform (&blockWave)[16], multimap<int,uint32_t,less<int> >& emc_TC);
00051   void findEmcPeakTime(double& peak_time, EmcWaveform* blockWave);
00052 
00053   void stretchTrgCond(int nclock, int** & trgcond);
00054   void trgSAFDelay(int nclock, int** & trgcond);
00055   void trgGTLDelay(int nclock, int** & trgcond);
00056 
00057 private:
00058   //define and initialize variables for output mdchit infor.
00059   double hit9[76], hit10[76], hit11[88], hit12[88]; //super layer 3
00060   double hit13[100], hit14[100], hit15[112], hit16[112]; //super layer 4
00061   double hit17[128], hit18[128], hit19[140], hit20[140]; //super layer 5
00062   double hit37[256], hit38[256], hit39[256], hit40[256]; //super layer 10
00063 
00064   BesGlobalTrigSvc* m_pIBGT;
00065   IBesGlobalTrigSvc* m_tmpSvc;
00066 
00067   IRawDataProviderSvc* m_rawDataProviderSvc;
00068   IMdcGeomSvc* m_MdcGeomSvc;
00069 
00070   // Reference to RealizationSvc
00071   RealizationSvc* m_RealizationSvc;
00072   IEmcCalibConstSvc *emcCalibConstSvc;
00073 
00074   MdcTSF* m_MdcTSF;
00075   TofHitCount* m_TofHitCount;
00076   EmcTCFinder* m_emcDigi;
00077   MucTrigHit* m_mucDigi;
00078 
00079   ifstream readin;
00080   ofstream readout;
00081   ifstream mdc_hit;
00082   std::string input;
00083   std::string output;
00084   std::string outEvtId;
00085   std::string indexfile;
00086   bool mTrigRootFlag;
00087   int m_runMode;
00088 
00089   bool ifpass;
00090   int passNo;
00091   int writeFile;
00092   int ifoutEvtId;
00093 
00094   int totalEvent;
00095   int totalTracks;
00096   
00097   int clock_shift;
00098 
00099   NTuple::Tuple*  m_tuple;
00100   NTuple::Item<float> m_wire_x;
00101   NTuple::Item<float> m_wire_y;
00102   NTuple::Item<long> m_wire_evtId;
00103   NTuple::Item<long> m_delta_tdc;
00104 
00105   NTuple::Tuple*  m_tuple1;
00106   NTuple::Item<long> m_RunId;
00107   NTuple::Item<long> m_EventId;
00108   NTuple::Item<float> m_mc_totE_all;
00109   NTuple::Item<float> m_data_totE_all;
00110   NTuple::Item<float> m_wetotE;
00111   NTuple::Item<float> m_eetotE;
00112   NTuple::Item<long> m_data_wetotE;
00113   NTuple::Item<long> m_data_eetotE;
00114   NTuple::Item<long> m_index_btc;
00115   NTuple::Array<float> m_btc_e;
00116   NTuple::Array<long> m_data_btc;
00117   NTuple::Item<long> m_cond_id;
00118   NTuple::Array<long> m_mc_cond;
00119   NTuple::Array<long> m_data_cond;
00120   NTuple::Item<long> m_block_id;
00121   NTuple::Array<float> m_mc_blockE;
00122   NTuple::Array<float> m_data_blockE;
00123   NTuple::Array<float> m_R_blockE;
00124 
00125   NTuple::Tuple* m_tuple2;
00126   NTuple::Item<long> m_index2;
00127   NTuple::Array<long> m_fireLayer;
00128 
00129   NTuple::Item<long> m_index3;
00130   NTuple::Array<long> m_hitLayer;
00131 
00132   NTuple::Item<long> m_index4;
00133   NTuple::Array<long> m_hitSeg;
00134 
00135   NTuple::Item<long> m_index5;
00136   NTuple::Array<float> m_costheta;
00137   NTuple::Array<float> m_phi;
00138   NTuple::Array<float> m_p;
00139   NTuple::Array<float> m_pdgcode;
00140 
00141   NTuple::Item<long> m_index6;
00142   NTuple::Array<float> m_hitphi;
00143 
00144   NTuple::Item<long> m_nlayerEE;
00145   NTuple::Item<long> m_nlayerBR;
00146   NTuple::Item<long> m_nlayerWE;
00147   NTuple::Item<long> m_nlayerTotal;
00148 
00149   NTuple::Item<long> m_nhitEE;
00150   NTuple::Item<long> m_nhitWE;
00151   NTuple::Item<long> m_nhitBR;
00152   NTuple::Item<long> m_nhitTotal;
00153   
00154   NTuple::Item<float> m_mumcostheta;
00155   NTuple::Item<float> m_mumphi;
00156 
00157   NTuple::Item<long> m_trackfindall;
00158   NTuple::Item<long> m_trackfind3l;
00159   NTuple::Item<long> m_trackb;
00160   NTuple::Item<long> m_tracke;
00161   NTuple::Item<long> m_ntrack1;
00162   NTuple::Item<long> m_ntrack2;
00163   NTuple::Item<long> m_ntrack3;
00164   NTuple::Item<long> m_ngoodevent;
00165   NTuple::Item<long> m_ngoodtrack;
00166 
00167   NTuple::Tuple* m_tuple3;
00168   NTuple::Item<long>  m_evtId;
00169   NTuple::Item<long> m_condNOne[48];
00170   NTuple::Item<long> m_condNZero[48];
00171   int nEvent;
00172 
00173   // get a handle on the Hist/TTree registration service
00174   ITHistSvc *m_thistsvc;
00175   TH1F *m_trigCondi_MC;
00176   TH1F *m_trigCondi_Data;
00177 
00178   TrigTOFT* toftrig;
00179   //TrigEACC* eacctrig;
00180 };
00181 #endif

Generated on Tue Nov 29 23:14:40 2016 for BOSS_7.0.2 by  doxygen 1.4.7