9 |
|
|
10 |
#include <TRefArray.h> |
#include <TRefArray.h> |
11 |
|
|
12 |
|
#include <TrkStruct.h> |
13 |
|
#include <TrkParams.h> |
14 |
|
#include <TrkLevel0.h> |
15 |
#include <TrkLevel1.h> |
#include <TrkLevel1.h> |
16 |
#include <TrkLevel2.h> |
#include <TrkLevel2.h> |
17 |
#include <TrkHough.h> |
#include <TrkHough.h> |
35 |
#include <TKey.h> |
#include <TKey.h> |
36 |
#include <TSystemFile.h> |
#include <TSystemFile.h> |
37 |
#include <TSystemDirectory.h> |
#include <TSystemDirectory.h> |
38 |
|
#include <TSQLServer.h> |
39 |
|
|
40 |
#include <iostream> |
#include <iostream> |
41 |
|
|
42 |
|
#define NCLONES 10 |
43 |
|
|
44 |
using namespace std; |
using namespace std; |
45 |
|
|
46 |
/** |
/** |
91 |
class PamLevel2 : public TObject { |
class PamLevel2 : public TObject { |
92 |
|
|
93 |
private: |
private: |
|
public: |
|
94 |
|
|
95 |
|
// ------------------------------ |
96 |
|
// variables to retrieve run info |
97 |
|
// ------------------------------ |
98 |
|
Int_t irun; //current run entry, relative to the TChain |
99 |
|
ULong64_t runfirstentry; //first entry of run, relative to the TChain |
100 |
|
ULong64_t runlastentry; //last entry of run, relative to the TChain |
101 |
|
Int_t irunentry; //position of current entry, relative to the run |
102 |
|
TChain* run_tree; |
103 |
|
TTree* run_tree_clone; |
104 |
|
TChain* sel_tree; |
105 |
|
TTree* sel_tree_clone; |
106 |
|
|
107 |
|
// --------------------------------- |
108 |
|
// variables to retrieve level0 info |
109 |
|
// --------------------------------- |
110 |
|
TFile* l0_file; |
111 |
|
TTree* l0_tree; |
112 |
|
Int_t iroot; |
113 |
|
// -------------------------------------------- |
114 |
|
// variables to store Level0 info (if required) |
115 |
|
// -------------------------------------------- |
116 |
|
EventHeader* h0_obj; |
117 |
|
TrkLevel0* trk0_obj; |
118 |
|
|
119 |
|
// --------------------------- |
120 |
|
// variables to connect the DB |
121 |
|
// --------------------------- |
122 |
|
TSQLServer* dbc; |
123 |
|
TString host; |
124 |
|
TString user; |
125 |
|
TString psw; |
126 |
|
|
127 |
|
// --------------------------------------------- |
128 |
|
// variables to retrieve and clone level1-2 info |
129 |
|
// --------------------------------------------- |
130 |
|
TChain* pam_tree; |
131 |
|
TTree* pam_tree_clone[NCLONES]; |
132 |
|
// -------------------------------------------- |
133 |
|
// variables to store Level0 info (if required) |
134 |
|
// -------------------------------------------- |
135 |
TrkLevel1* trk1_obj; |
TrkLevel1* trk1_obj; |
136 |
TrkLevel2* trk2_obj; |
TrkLevel2* trk2_obj; |
137 |
TrkHough* trkh_obj; |
TrkHough* trkh_obj; |
|
|
|
138 |
CaloLevel1* calo1_obj; |
CaloLevel1* calo1_obj; |
139 |
CaloLevel2* calo2_obj; |
CaloLevel2* calo2_obj; |
|
|
|
140 |
ToFLevel2* tof_obj; |
ToFLevel2* tof_obj; |
141 |
TrigLevel2* trig_obj; |
TrigLevel2* trig_obj; |
142 |
S4Level2* s4_obj; |
S4Level2* s4_obj; |
143 |
NDLevel2* nd_obj; |
NDLevel2* nd_obj; |
144 |
AcLevel2* ac_obj; |
AcLevel2* ac_obj; |
145 |
OrbitalInfo* orb_obj; |
OrbitalInfo* orb_obj; |
|
|
|
146 |
GL_RUN* run_obj; |
GL_RUN* run_obj; |
147 |
SoftInfo* soft_obj; // Emiliano |
SoftInfo* soft_obj; // Emiliano |
|
|
|
|
TTree* tree_clone[8]; |
|
|
|
|
|
// TRefArray* sorted_tracks; |
|
|
// TRefArray sorted_tracks; |
|
148 |
|
|
149 |
|
// ----------------------------------- |
150 |
|
// variables to sort the track |
151 |
|
// ----------------------------------- |
152 |
TClonesArray *tsorted; |
TClonesArray *tsorted; |
153 |
TClonesArray *timage; |
TClonesArray *timage; |
|
|
|
|
|
|
154 |
PamTrack *track; //store the last required |
PamTrack *track; //store the last required |
155 |
|
|
156 |
|
|
157 |
|
// ----- |
158 |
|
// flags |
159 |
|
// ----- |
160 |
Bool_t CAL2; //level2 branch |
Bool_t CAL2; //level2 branch |
161 |
Bool_t CAL1; //level1 branch |
Bool_t CAL1; //level1 branch |
162 |
|
Bool_t CAL0; //yoda |
163 |
|
|
164 |
Bool_t TRK2; //level2 branch |
Bool_t TRK2; //level2 branch |
165 |
Bool_t TRK1; //level1 branch |
Bool_t TRK1; //level1 branch |
166 |
Bool_t TRKh; //hough branch |
Bool_t TRKh; //hough branch |
167 |
|
Bool_t TRK0; //yoda |
168 |
|
|
|
Bool_t TRG; |
|
169 |
Bool_t TOF; |
Bool_t TOF; |
170 |
|
Bool_t TOF0; |
171 |
|
|
172 |
|
Bool_t TRG; |
173 |
Bool_t S4; |
Bool_t S4; |
174 |
Bool_t ND; |
Bool_t ND; |
175 |
Bool_t AC; |
Bool_t AC; |
176 |
Bool_t ORB; |
Bool_t ORB; |
177 |
|
|
178 |
Bool_t RUN; |
Bool_t RUN; |
179 |
|
|
180 |
|
Int_t SELLI; //trees of selected events (there is a selection list) |
181 |
|
|
182 |
|
|
183 |
|
public: |
184 |
|
|
185 |
PamLevel2(); |
PamLevel2(); |
186 |
~PamLevel2(){Delete();}; |
~PamLevel2(){Delete();}; |
188 |
void Clear(); |
void Clear(); |
189 |
void Delete(); |
void Delete(); |
190 |
|
|
191 |
|
|
192 |
// ========================================= |
// ============================================= |
193 |
// methods needed to read/write Level2 trees |
// methods needed to read/write Level0-1-2 trees |
194 |
// ========================================= |
// ============================================= |
195 |
void SetWhichTrees(TString); |
void SetWhichTrees(TString); |
196 |
void GetWhichTrees(TFile*); |
void GetWhichTrees(TFile*); |
197 |
|
|
206 |
|
|
207 |
TTree* GetRunTree(TFile*); |
TTree* GetRunTree(TFile*); |
208 |
TChain* GetRunTree(TList*); |
TChain* GetRunTree(TList*); |
209 |
|
TChain* GetRunTree(TString ddir,TString list){ return GetRunTree(GetListOfLevel2Files(ddir,list)); }; |
210 |
|
Bool_t UpdateRunInfo(TTree *,ULong64_t); |
211 |
|
Bool_t UpdateRunInfo(TChain *,ULong64_t); |
212 |
|
|
213 |
void CreateCloneTrees0(TChain *fChain, TFile* file); |
void CreateCloneTrees0(TChain *fChain, TFile* file); |
214 |
void CreateCloneTrees(TFile* file); |
void CreateCloneTrees(TFile* file); |
219 |
void SetBranchAddress(TTree *); |
void SetBranchAddress(TTree *); |
220 |
void SetBranchAddress(TChain *); |
void SetBranchAddress(TChain *); |
221 |
|
|
222 |
|
Int_t GetEntry(Int_t); |
223 |
|
Int_t GetYodaEntry(); |
224 |
|
|
225 |
|
TChain* GetPamTree(){return pam_tree;}; |
226 |
|
TChain* GetRunTree(){return run_tree;}; |
227 |
|
TTree* GetYodaTree(); |
228 |
|
|
229 |
|
// ============= |
230 |
|
// DB connection |
231 |
|
// ============= |
232 |
|
void SetDBHost(TString str){host=str;}; |
233 |
|
void SetDBUser(TString str){user=str;}; |
234 |
|
void SetDBPsw(TString str){psw=str;}; |
235 |
|
|
236 |
|
|
237 |
// ======================================================== |
// ======================================================== |
238 |
// methods needed to retrieve subdetector general variables |
// methods needed to retrieve subdetector general variables |
239 |
// ======================================================== |
// ======================================================== |
240 |
void* GetPointerTo(const char*); |
void* GetPointerTo(const char*); |
241 |
TrkLevel1 *GetTrkLevel1() { return trk1_obj;}; |
EventHeader *GetEventHeader() { return h0_obj; }; |
242 |
TrkLevel2 *GetTrkLevel2() { return trk2_obj;}; |
TrkLevel0 *GetTrkLevel0() { return trk0_obj; }; |
243 |
TrkHough *GetTrkHough() { return trkh_obj;}; |
|
244 |
|
TrkLevel1 *GetTrkLevel1() { return trk1_obj; }; |
245 |
|
TrkLevel2 *GetTrkLevel2() { return trk2_obj; }; |
246 |
|
TrkHough *GetTrkHough() { return trkh_obj; }; |
247 |
CaloLevel1 *GetCaloLevel1() { return calo1_obj;}; |
CaloLevel1 *GetCaloLevel1() { return calo1_obj;}; |
248 |
CaloLevel2 *GetCaloLevel2() { return calo2_obj;}; |
CaloLevel2 *GetCaloLevel2() { return calo2_obj;}; |
249 |
ToFLevel2 *GetToFLevel2() { return tof_obj;}; |
ToFLevel2 *GetToFLevel2() { return tof_obj; }; |
250 |
TrigLevel2 *GetTrigLevel2() { return trig_obj;}; |
TrigLevel2 *GetTrigLevel2() { return trig_obj; }; |
251 |
S4Level2 *GetS4Level2() { return s4_obj;}; |
S4Level2 *GetS4Level2() { return s4_obj; }; |
252 |
NDLevel2 *GetNDLevel2() { return nd_obj;}; |
NDLevel2 *GetNDLevel2() { return nd_obj; }; |
253 |
AcLevel2 *GetAcLevel2() { return ac_obj;}; |
AcLevel2 *GetAcLevel2() { return ac_obj; }; |
254 |
OrbitalInfo *GetOrbitalInfo(){ return orb_obj;}; |
OrbitalInfo *GetOrbitalInfo(){ return orb_obj; }; |
255 |
GL_RUN *GetRunInfo() { return run_obj; }; |
GL_RUN *GetRunInfo() { return run_obj; }; |
256 |
SoftInfo *GetSoftInfo() { return soft_obj; }; // Emiliano |
SoftInfo *GetSoftInfo() { return soft_obj; }; // Emiliano |
257 |
|
|
258 |
// ============================================== |
// ============================================== |
282 |
// ================================= |
// ================================= |
283 |
// Int_t ntrk(){ return trk2_obj->TrkLevel2::ntrk(); }; |
// Int_t ntrk(){ return trk2_obj->TrkLevel2::ntrk(); }; |
284 |
|
|
285 |
|
// ----- |
286 |
|
// flags methods |
287 |
|
// ----- |
288 |
|
Bool_t IsCAL2(){return CAL2;}; //level2 branch |
289 |
|
Bool_t IsCAL1(){return CAL1;}; //level1 branch |
290 |
|
Bool_t IsCAL0(){return CAL0;}; //yoda |
291 |
|
|
292 |
|
Bool_t IsTRK2(){return TRK2;}; //level2 branch |
293 |
|
Bool_t IsTRK1(){return TRK1;}; //level1 branch |
294 |
|
Bool_t IsTRKh(){return TRKh;}; //hough branch |
295 |
|
Bool_t IsTRK0(){return TRK0;}; //yoda |
296 |
|
|
297 |
|
Bool_t IsTOF(){return TOF;}; |
298 |
|
Bool_t IsTOF0(){return TOF0;}; |
299 |
|
|
300 |
|
Bool_t IsTRG(){return TRG;}; |
301 |
|
Bool_t IsS4(){return S4;}; |
302 |
|
Bool_t IsND(){return ND;}; |
303 |
|
Bool_t IsAC(){return AC;}; |
304 |
|
Bool_t IsORB(){return ORB;}; |
305 |
|
|
306 |
|
Bool_t IsRUN(){return RUN;}; |
307 |
|
|
308 |
|
Int_t IsSELLI(){return SELLI;}; //trees of selected events (there is a selection list) |
309 |
|
|
310 |
ClassDef(PamLevel2,1); |
ClassDef(PamLevel2,1); |
311 |
}; |
}; |