BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
Trigger/Trigger/Trigger-00-01-05/Trigger/BesTrigL1.h
Go to the documentation of this file.
1#ifndef BesTrigL1_h
2#define BesTrigL1_h 1
3
4// from Gaudi
5#include "GaudiKernel/Algorithm.h"
6#include "GaudiKernel/NTuple.h"
7#include "GaudiKernel/INTuple.h"
8#include "GaudiKernel/INTupleSvc.h"
9#include "GaudiKernel/ITHistSvc.h"
10#include <fstream>
11#include "RawDataProviderSvc/IRawDataProviderSvc.h"
12#include "MdcGeomSvc/IMdcGeomSvc.h"
13#include "Trigger/MdcTSF.h"
14#include "Trigger/TofHitCount.h"
15#include "Trigger/EmcTCFinder.h"
16#include "Trigger/MucTrigHit.h"
17
18#include "RealizationSvc/RealizationSvc.h"
19#include "RealizationSvc/IRealizationSvc.h"
20#include "EmcCalibConstSvc/IEmcCalibConstSvc.h"
21
22#include "TROOT.h"
23#include "TObjArray.h"
24#include "TH1F.h"
25#include "TProfile.h"
26
27using namespace std;
28
31class TrigTOFT;
32class TrigEACC;
33class EmcWaveform;
34
35class BesTrigL1 : public Algorithm {
36public:
37 /// Standard constructor
38 BesTrigL1( const std::string& name, ISvcLocator* pSvcLocator );
39 virtual ~BesTrigL1(){ }; ///< Destructor
40
41 virtual StatusCode initialize(); ///< Algorithm initialization
42 virtual StatusCode execute (); ///< Algorithm execution
43 virtual StatusCode finalize (); ///< Algorithm finalization
44 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,
45 double& stime, double& etime);
46
47 void runAclock_mdc(int iclock, double stime, multimap<int,uint32_t,less<int> > mdc_hitmap);
48 void runAclock_tof(int iclock, double stime, int& idle_status, std::multimap<int,int,less<int> > tof_hitmap);
49 void runAclock_emc(int iclock, double stime, std::multimap<int,uint32_t,less<int> > emc_TC, EmcWaveform* blockWave);
50 void getEmcAnalogSig(EmcDigiCol* emcDigiCol, EmcWaveform (&blockWave)[16], multimap<int,uint32_t,less<int> >& emc_TC);
51 void findEmcPeakTime(double& peak_time, EmcWaveform* blockWave);
52
53 void stretchTrgCond(int nclock, int** & trgcond);
54 void trgSAFDelay(int nclock, int** & trgcond);
55 void trgGTLDelay(int nclock, int** & trgcond);
56
57private:
58 //define and initialize variables for output mdchit infor.
59 double hit9[76], hit10[76], hit11[88], hit12[88]; //super layer 3
60 double hit13[100], hit14[100], hit15[112], hit16[112]; //super layer 4
61 double hit17[128], hit18[128], hit19[140], hit20[140]; //super layer 5
62 double hit37[256], hit38[256], hit39[256], hit40[256]; //super layer 10
63
64 BesGlobalTrigSvc* m_pIBGT;
65 IBesGlobalTrigSvc* m_tmpSvc;
66
67 IRawDataProviderSvc* m_rawDataProviderSvc;
68 IMdcGeomSvc* m_MdcGeomSvc;
69
70 // Reference to RealizationSvc
71 RealizationSvc* m_RealizationSvc;
72 IEmcCalibConstSvc *emcCalibConstSvc;
73
74 MdcTSF* m_MdcTSF;
75 TofHitCount* m_TofHitCount;
76 EmcTCFinder* m_emcDigi;
77 MucTrigHit* m_mucDigi;
78
79 ifstream readin;
80 ofstream readout;
81 ifstream mdc_hit;
82 std::string input;
83 std::string output;
84 std::string outEvtId;
85 std::string indexfile;
86 bool mTrigRootFlag;
87 int m_runMode;
88
89 bool ifpass;
90 int passNo;
91 int writeFile;
92 int ifoutEvtId;
93
94 int totalEvent;
95 int totalTracks;
96
97 int clock_shift;
98
99 NTuple::Tuple* m_tuple;
100 NTuple::Item<float> m_wire_x;
101 NTuple::Item<float> m_wire_y;
102 NTuple::Item<long> m_wire_evtId;
103 NTuple::Item<long> m_delta_tdc;
104
105 NTuple::Tuple* m_tuple1;
106 NTuple::Item<long> m_RunId;
107 NTuple::Item<long> m_EventId;
108 NTuple::Item<float> m_mc_totE_all;
109 NTuple::Item<float> m_data_totE_all;
110 NTuple::Item<float> m_wetotE;
111 NTuple::Item<float> m_eetotE;
112 NTuple::Item<long> m_data_wetotE;
113 NTuple::Item<long> m_data_eetotE;
114 NTuple::Item<long> m_index_btc;
115 NTuple::Array<float> m_btc_e;
116 NTuple::Array<long> m_data_btc;
117 NTuple::Item<long> m_cond_id;
118 NTuple::Array<long> m_mc_cond;
119 NTuple::Array<long> m_data_cond;
120 NTuple::Item<long> m_block_id;
121 NTuple::Array<float> m_mc_blockE;
122 NTuple::Array<float> m_data_blockE;
123 NTuple::Array<float> m_R_blockE;
124
125 NTuple::Tuple* m_tuple2;
126 NTuple::Item<long> m_index2;
127 NTuple::Array<long> m_fireLayer;
128
129 NTuple::Item<long> m_index3;
130 NTuple::Array<long> m_hitLayer;
131
132 NTuple::Item<long> m_index4;
133 NTuple::Array<long> m_hitSeg;
134
135 NTuple::Item<long> m_index5;
136 NTuple::Array<float> m_costheta;
137 NTuple::Array<float> m_phi;
138 NTuple::Array<float> m_p;
139 NTuple::Array<float> m_pdgcode;
140
141 NTuple::Item<long> m_index6;
142 NTuple::Array<float> m_hitphi;
143
144 NTuple::Item<long> m_nlayerEE;
145 NTuple::Item<long> m_nlayerBR;
146 NTuple::Item<long> m_nlayerWE;
147 NTuple::Item<long> m_nlayerTotal;
148
149 NTuple::Item<long> m_nhitEE;
150 NTuple::Item<long> m_nhitWE;
151 NTuple::Item<long> m_nhitBR;
152 NTuple::Item<long> m_nhitTotal;
153
154 NTuple::Item<float> m_mumcostheta;
155 NTuple::Item<float> m_mumphi;
156
157 NTuple::Item<long> m_trackfindall;
158 NTuple::Item<long> m_trackfind3l;
159 NTuple::Item<long> m_trackb;
160 NTuple::Item<long> m_tracke;
161 NTuple::Item<long> m_ntrack1;
162 NTuple::Item<long> m_ntrack2;
163 NTuple::Item<long> m_ntrack3;
164 NTuple::Item<long> m_ngoodevent;
165 NTuple::Item<long> m_ngoodtrack;
166
167 NTuple::Tuple* m_tuple3;
168 NTuple::Item<long> m_evtId;
169 NTuple::Item<long> m_condNOne[48];
170 NTuple::Item<long> m_condNZero[48];
171 int nEvent;
172
173 // get a handle on the Hist/TTree registration service
174 ITHistSvc *m_thistsvc;
175 TH1F *m_trigCondi_MC;
176 TH1F *m_trigCondi_Data;
177
178 TrigTOFT* toftrig;
179 //TrigEACC* eacctrig;
180};
181#endif
void runAclock_emc(int iclock, double stime, std::multimap< int, uint32_t, less< int > > emc_TC, EmcWaveform *blockWave)
void findEmcPeakTime(double &peak_time, EmcWaveform *blockWave)
BesTrigL1(const std::string &name, ISvcLocator *pSvcLocator)
Standard constructor.
virtual StatusCode execute()
Algorithm execution.
void runAclock_tof(int iclock, double stime, int &idle_status, std::multimap< int, int, less< int > > tof_hitmap)
void getEmcAnalogSig(EmcDigiCol *emcDigiCol, EmcWaveform(&blockWave)[16], multimap< int, uint32_t, less< int > > &emc_TC)
virtual StatusCode initialize()
Destructor.
void trgGTLDelay(int nclock, int **&trgcond)
virtual StatusCode finalize()
Algorithm finalization.
void trgSAFDelay(int nclock, int **&trgcond)
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, double &stime, double &etime)
void stretchTrgCond(int nclock, int **&trgcond)
void runAclock_mdc(int iclock, double stime, multimap< int, uint32_t, less< int > > mdc_hitmap)