7 |
* Default constructor |
* Default constructor |
8 |
*/ |
*/ |
9 |
PamTrack::PamTrack(){ |
PamTrack::PamTrack(){ |
10 |
trk_track = this->TrkTrack::GetTrkTrack(); |
trk_track = 0; |
11 |
calo_track = this->CaloTrkVar::GetCaloTrkVar(); |
calo_track = 0; |
12 |
tof_track = this->ToFTrkVar::GetToFTrkVar(); |
tof_track = 0; |
13 |
|
candeleteobj = 0; |
14 |
}; |
}; |
15 |
//-------------------------------------- |
//-------------------------------------- |
16 |
// |
// |
20 |
* Constructor |
* Constructor |
21 |
*/ |
*/ |
22 |
PamTrack::PamTrack(TrkTrack* t, CaloTrkVar* c, ToFTrkVar* o){ |
PamTrack::PamTrack(TrkTrack* t, CaloTrkVar* c, ToFTrkVar* o){ |
23 |
trk_track = this->TrkTrack::GetTrkTrack(); |
|
24 |
calo_track = this->CaloTrkVar::GetCaloTrkVar(); |
trk_track = 0; |
25 |
tof_track = this->ToFTrkVar::GetToFTrkVar(); |
calo_track = 0; |
26 |
if(t) *trk_track = *t; |
tof_track = 0; |
27 |
if(c) *calo_track = *c; |
// if(t)trk_track = new TrkTrack(*t); |
28 |
if(o) *tof_track = *o; |
// if(c)calo_track = new CaloTrkVar(*c); |
29 |
|
// if(o)tof_track = new ToFTrkVar(*o); |
30 |
|
if(t)trk_track = t; |
31 |
|
if(c)calo_track = c; |
32 |
|
if(o)tof_track = o; |
33 |
|
candeleteobj = 0; |
34 |
|
|
35 |
}; |
}; |
36 |
|
PamTrack::PamTrack(const PamTrack& track){ |
37 |
|
|
38 |
|
TrkTrack *t = track.trk_track; |
39 |
|
CaloTrkVar *c = track.calo_track; |
40 |
|
ToFTrkVar *o = track.tof_track; |
41 |
|
|
42 |
|
trk_track = 0; |
43 |
|
calo_track = 0; |
44 |
|
tof_track = 0; |
45 |
|
if(t)trk_track = new TrkTrack(*t); |
46 |
|
if(c)calo_track = new CaloTrkVar(*c); |
47 |
|
if(o)tof_track = new ToFTrkVar(*o); |
48 |
|
candeleteobj = 1; |
49 |
|
|
50 |
|
} |
51 |
|
void PamTrack::Clear(){ |
52 |
|
|
53 |
|
// cout << "PamTrack::Clear() "<<candeleteobj<<endl; |
54 |
|
if(candeleteobj){ |
55 |
|
if(trk_track) trk_track->TrkTrack::Clear(); |
56 |
|
if(calo_track) calo_track->CaloTrkVar::Clear();//??? |
57 |
|
if(tof_track) tof_track->ToFTrkVar::Clear();//??? |
58 |
|
}else{ |
59 |
|
trk_track = 0; |
60 |
|
calo_track = 0; |
61 |
|
tof_track = 0; |
62 |
|
} |
63 |
|
} |
64 |
|
void PamTrack::Delete(){ |
65 |
|
// cout << "PamTrack::Delete() "<<candeleteobj<<endl; |
66 |
|
if(candeleteobj){ |
67 |
|
if(trk_track) { |
68 |
|
trk_track->TrkTrack::Clear(); |
69 |
|
delete trk_track; |
70 |
|
} |
71 |
|
if(calo_track){ |
72 |
|
calo_track->CaloTrkVar::Clear();//??? |
73 |
|
delete calo_track; |
74 |
|
} |
75 |
|
if(tof_track){ |
76 |
|
tof_track->ToFTrkVar::Clear();//??? |
77 |
|
delete tof_track; |
78 |
|
} |
79 |
|
}else{ |
80 |
|
Clear(); |
81 |
|
} |
82 |
|
} |
83 |
//-------------------------------------- |
//-------------------------------------- |
84 |
// |
// |
85 |
// |
// |
89 |
*/ |
*/ |
90 |
PamLevel2::PamLevel2(){ |
PamLevel2::PamLevel2(){ |
91 |
|
|
92 |
trk2_obj = TrkLevel2::GetTrkLevel2(); |
// trk2_obj = TrkLevel2::GetTrkLevel2(); |
93 |
trk1_obj = TrkLevel1::GetTrkLevel1(); |
// trk1_obj = TrkLevel1::GetTrkLevel1(); |
94 |
trkh_obj = TrkHough::GetTrkHough(); |
// trkh_obj = TrkHough::GetTrkHough(); |
95 |
calo1_obj = CaloLevel1::GetCaloLevel1(); |
// calo1_obj = CaloLevel1::GetCaloLevel1(); |
96 |
calo2_obj = CaloLevel2::GetCaloLevel2(); |
// calo2_obj = CaloLevel2::GetCaloLevel2(); |
97 |
tof_obj = ToFLevel2::GetToFLevel2(); |
// tof_obj = ToFLevel2::GetToFLevel2(); |
98 |
trig_obj = TrigLevel2::GetTrigLevel2(); |
// trig_obj = TrigLevel2::GetTrigLevel2(); |
99 |
s4_obj = S4Level2::GetS4Level2(); |
// s4_obj = S4Level2::GetS4Level2(); |
100 |
nd_obj = NDLevel2::GetNDLevel2(); |
// nd_obj = NDLevel2::GetNDLevel2(); |
101 |
ac_obj = AcLevel2::GetAcLevel2(); |
// ac_obj = AcLevel2::GetAcLevel2(); |
102 |
orb_obj = OrbitalInfo::GetOrbitalInfo(); |
// orb_obj = OrbitalInfo::GetOrbitalInfo(); |
103 |
|
trk2_obj = 0; |
104 |
run_obj = new GL_RUN(); |
trk1_obj = 0; |
105 |
|
trkh_obj = 0; |
106 |
// trk1_clone = 0; |
calo1_obj = 0; |
107 |
// trk2_clone = 0; |
calo2_obj = 0; |
108 |
// trkh_clone = 0; |
tof_obj = 0; |
109 |
// calo1_clone = 0; |
trig_obj = 0; |
110 |
// calo2_clone = 0; |
s4_obj = 0; |
111 |
// tof_clone = 0; |
nd_obj = 0; |
112 |
// trig_clone = 0; |
ac_obj = 0; |
113 |
// s4_clone = 0; |
orb_obj = 0; |
114 |
// nd_clone = 0; |
|
115 |
// ac_clone = 0; |
run_obj = 0;//new GL_RUN(); |
116 |
// orb_clone = 0; |
|
|
|
|
|
// T_clone = 0; |
|
|
// C_clone = 0; |
|
|
// O_clone = 0; |
|
|
// R_clone = 0; |
|
|
// S_clone = 0; |
|
|
// N_clone = 0; |
|
|
// A_clone = 0; |
|
|
// B_clone = 0; |
|
117 |
|
|
118 |
for(Int_t i=0; i<8; i++ )tree_clone[i]=NULL; |
for(Int_t i=0; i<8; i++ )tree_clone[i]=NULL; |
119 |
|
|
120 |
sorted_tracks = new TRefArray(); |
// sorted_tracks = 0;//new TRefArray(); |
121 |
|
|
122 |
CAL1 = true; |
CAL1 = true; |
123 |
CAL2 = true; |
CAL2 = true; |
133 |
|
|
134 |
RUN = true; |
RUN = true; |
135 |
|
|
136 |
|
tsorted=0; |
137 |
|
timage=0; |
138 |
|
|
139 |
}; |
}; |
140 |
/** |
/** |
141 |
* Destructor |
* Delete the event (act as Dtor) |
142 |
*/ |
*/ |
143 |
PamLevel2::~PamLevel2(){ |
void PamLevel2::Delete(){ |
144 |
delete run_obj; |
|
145 |
Clear(); |
if(run_obj)delete run_obj; |
146 |
|
|
147 |
|
// cout << "void PamLevel2::Clear()"<<endl; |
148 |
|
if(trk1_obj) delete trk1_obj; |
149 |
|
if(trk2_obj) delete trk2_obj; |
150 |
|
if(trkh_obj) delete trkh_obj; |
151 |
|
if(calo1_obj)delete calo1_obj; |
152 |
|
if(calo2_obj)delete calo2_obj; |
153 |
|
if(tof_obj) delete tof_obj; |
154 |
|
if(trig_obj) delete trig_obj; |
155 |
|
if(s4_obj) delete s4_obj; |
156 |
|
if(nd_obj) delete nd_obj; |
157 |
|
if(ac_obj) delete ac_obj; |
158 |
|
if(orb_obj) delete orb_obj; |
159 |
|
|
160 |
|
if(tsorted){ |
161 |
|
tsorted->Delete(); |
162 |
|
delete tsorted; |
163 |
|
} |
164 |
|
if(timage){ |
165 |
|
timage->Delete(); |
166 |
|
delete timage; |
167 |
|
} |
168 |
}; |
}; |
169 |
|
|
170 |
/** |
/** |
171 |
* Clear the event |
* Clear the event (NB! does not deallocate objects) |
172 |
*/ |
*/ |
173 |
void PamLevel2::Clear(){ |
void PamLevel2::Clear(){ |
174 |
|
|
175 |
TrkLevel1::Clear(); |
// cout << "void PamLevel2::Clear()"<<endl; |
176 |
|
if(run_obj)delete run_obj; |
177 |
TrkLevel2::Clear(); |
|
178 |
CaloLevel2::Clear(); |
if(trk1_obj) trk1_obj->Clear(); |
179 |
ToFLevel2::Clear(); |
if(trk2_obj) trk2_obj->Clear(); |
180 |
TrigLevel2::Clear(); |
if(trkh_obj) trkh_obj->Clear(); |
181 |
S4Level2::Clear(); |
if(calo1_obj)calo1_obj->Clear(); |
182 |
NDLevel2::Clear(); |
if(calo2_obj)calo2_obj->Clear(); |
183 |
AcLevel2::Clear(); |
if(tof_obj) tof_obj->Clear(); |
184 |
OrbitalInfo::Clear(); |
if(trig_obj) trig_obj->Clear(); |
185 |
|
if(s4_obj) s4_obj->Clear(); |
186 |
// if(trk1_clone)trk1_clone->Clear(); |
if(nd_obj) nd_obj->Clear(); |
187 |
// if(trk2_clone)trk2_clone->Clear(); |
if(ac_obj) ac_obj->Clear(); |
188 |
// if(trkh_clone)trkh_clone->Clear(); |
if(orb_obj) orb_obj->Clear(); |
|
// if(calo1_clone)calo1_clone->Clear(); |
|
|
// if(calo2_clone)calo2_clone->Clear(); |
|
|
// if(tof_clone)tof_clone->Clear(); |
|
|
// if(trig_clone)trig_clone->Clear(); |
|
|
// if(s4_clone)s4_clone->Clear(); |
|
|
// if(nd_clone)nd_clone->Clear(); |
|
|
// if(ac_clone)ac_clone->Clear(); |
|
|
// if(orb_clone)orb_clone->Clear(); |
|
189 |
|
|
190 |
sorted_tracks->Delete(); // clean the reference array |
// if(sorted_tracks)sorted_tracks->Clear(); |
191 |
|
// sorted_tracks.Clear(); |
192 |
|
|
193 |
|
if(tsorted){ |
194 |
|
tsorted->Delete(); |
195 |
|
} |
196 |
|
if(timage){ |
197 |
|
timage->Delete(); |
198 |
|
} |
199 |
|
|
200 |
}; |
}; |
201 |
|
|
207 |
void *PamLevel2::GetPointerTo(const char* c ){ |
void *PamLevel2::GetPointerTo(const char* c ){ |
208 |
|
|
209 |
TString objname = c; |
TString objname = c; |
210 |
if(!objname.CompareTo("TrkLevel1"))return &trk1_obj; |
|
211 |
if(!objname.CompareTo("TrkLevel2"))return &trk2_obj; |
if(!objname.CompareTo("TrkLevel1")) { |
212 |
if(!objname.CompareTo("TrkHough"))return &trkh_obj; |
if(!trk1_obj) trk1_obj = new TrkLevel1(); |
213 |
if(!objname.CompareTo("CaloLevel1"))return &calo1_obj; |
return &trk1_obj; |
214 |
if(!objname.CompareTo("CaloLevel2"))return &calo2_obj; |
}; |
215 |
if(!objname.CompareTo("ToFLevel2"))return &tof_obj; |
if(!objname.CompareTo("TrkLevel2")) { |
216 |
if(!objname.CompareTo("TrigLevel2"))return &trig_obj; |
if(!trk2_obj) trk2_obj = new TrkLevel2(); |
217 |
if(!objname.CompareTo("S4Level2"))return &s4_obj; |
return &trk2_obj; |
218 |
if(!objname.CompareTo("NDLevel2"))return &nd_obj; |
}; |
219 |
if(!objname.CompareTo("AcLevel2"))return &ac_obj; |
if(!objname.CompareTo("TrkHough")) { |
220 |
if(!objname.CompareTo("OrbitalInfo"))return &orb_obj; |
if(!trkh_obj) trkh_obj = new TrkHough(); |
221 |
|
return &trkh_obj; |
222 |
|
}; |
223 |
|
if(!objname.CompareTo("CaloLevel1")) { |
224 |
|
if(!calo1_obj) calo1_obj = new CaloLevel1(); |
225 |
|
return &calo1_obj; |
226 |
|
}; |
227 |
|
if(!objname.CompareTo("CaloLevel2")) { |
228 |
|
if(!calo2_obj) calo2_obj = new CaloLevel2(); |
229 |
|
return &calo2_obj; |
230 |
|
}; |
231 |
|
if(!objname.CompareTo("ToFLevel2")) { |
232 |
|
if(!tof_obj) tof_obj = new ToFLevel2(); |
233 |
|
return &tof_obj; |
234 |
|
}; |
235 |
|
if(!objname.CompareTo("TrigLevel2")) { |
236 |
|
if(!trig_obj) trig_obj = new TrigLevel2(); |
237 |
|
return &trig_obj; |
238 |
|
}; |
239 |
|
if(!objname.CompareTo("S4Level2")) { |
240 |
|
if(!s4_obj) s4_obj = new S4Level2(); |
241 |
|
return &s4_obj; |
242 |
|
}; |
243 |
|
if(!objname.CompareTo("NDLevel2")) { |
244 |
|
if(!nd_obj) nd_obj = new NDLevel2(); |
245 |
|
return &nd_obj; |
246 |
|
}; |
247 |
|
if(!objname.CompareTo("AcLevel2")) { |
248 |
|
if(!ac_obj) ac_obj = new AcLevel2(); |
249 |
|
return &ac_obj; |
250 |
|
}; |
251 |
|
if(!objname.CompareTo("OrbitalInfo")){ |
252 |
|
if(!orb_obj) orb_obj = new OrbitalInfo(); |
253 |
|
return &orb_obj; |
254 |
|
}; |
255 |
|
|
256 |
if(!objname.CompareTo("RunInfo"))return &run_obj; |
if(!objname.CompareTo("RunInfo"))return &run_obj; |
257 |
return NULL; |
return NULL; |
258 |
}; |
}; |
265 |
* (If seqno = -1 retrieves the self-trigger calorimeter track) |
* (If seqno = -1 retrieves the self-trigger calorimeter track) |
266 |
*/ |
*/ |
267 |
CaloTrkVar *PamLevel2::GetCaloStoredTrack(int seqno){ |
CaloTrkVar *PamLevel2::GetCaloStoredTrack(int seqno){ |
268 |
|
|
269 |
if( CaloLevel2::ntrk()==0 ){ |
if( !calo2_obj )return 0; |
270 |
|
|
271 |
|
if( calo2_obj->CaloLevel2::ntrk()==0 ){ |
272 |
cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo "<< seqno <<" but no Calorimeter tracks are stored"<<endl; |
cout << "PamLevel2::GetCaloStoredTrack(int) : requested tracker SeqNo "<< seqno <<" but no Calorimeter tracks are stored"<<endl; |
273 |
return NULL; |
return NULL; |
274 |
}; |
}; |
277 |
Int_t it_calo=0; |
Int_t it_calo=0; |
278 |
|
|
279 |
do{ |
do{ |
280 |
c = CaloLevel2::GetCaloTrkVar(it_calo); |
c = calo2_obj->CaloLevel2::GetCaloTrkVar(it_calo); |
281 |
it_calo++; |
it_calo++; |
282 |
} while( c && seqno != c->trkseqno && it_calo < CaloLevel2::ntrk()); |
} while( c && seqno != c->trkseqno && it_calo < calo2_obj->CaloLevel2::ntrk()); |
283 |
|
|
284 |
if(!c || seqno != c->trkseqno){ |
if(!c || seqno != c->trkseqno){ |
285 |
c = 0; |
c = 0; |
298 |
*/ |
*/ |
299 |
ToFTrkVar *PamLevel2::GetToFStoredTrack(int seqno){ |
ToFTrkVar *PamLevel2::GetToFStoredTrack(int seqno){ |
300 |
|
|
301 |
if( ToFLevel2::ntrk()==0 ){ |
if( !tof_obj )return 0; |
302 |
|
|
303 |
|
if( tof_obj->ToFLevel2::ntrk()==0 ){ |
304 |
cout << "PamLevel2::GetToFStoredTrack(int) : requested tracker SeqNo "<< seqno <<" but no ToF tracks are stored"<<endl; |
cout << "PamLevel2::GetToFStoredTrack(int) : requested tracker SeqNo "<< seqno <<" but no ToF tracks are stored"<<endl; |
305 |
return NULL; |
return NULL; |
306 |
}; |
}; |
309 |
Int_t it_tof=0; |
Int_t it_tof=0; |
310 |
|
|
311 |
do{ |
do{ |
312 |
c = ToFLevel2::GetToFTrkVar(it_tof); |
c = tof_obj->ToFLevel2::GetToFTrkVar(it_tof); |
313 |
it_tof++; |
it_tof++; |
314 |
} while( c && seqno != c->trkseqno && it_tof < ToFLevel2::ntrk()); |
} while( c && seqno != c->trkseqno && it_tof < tof_obj->ToFLevel2::ntrk()); |
315 |
|
|
316 |
if(!c || seqno != c->trkseqno){ |
if(!c || seqno != c->trkseqno){ |
317 |
c = 0; |
c = 0; |
329 |
* Give the pamela track associated to a tracker track, retrieving related calorimeter and tof track information. |
* Give the pamela track associated to a tracker track, retrieving related calorimeter and tof track information. |
330 |
*/ |
*/ |
331 |
PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t){ |
PamTrack* PamLevel2::GetPamTrackAlong(TrkTrack* t){ |
332 |
|
|
333 |
|
cout <<"PamLevel2::GetPamTrackAlong(TrkTrack* t) **obsolete** "<<endl; |
334 |
|
cout <<"(if you use it, remember to delete the PamTrack object)"<<endl; |
335 |
|
|
336 |
CaloTrkVar *c = 0; |
CaloTrkVar *c = 0; |
337 |
ToFTrkVar *o = 0; |
ToFTrkVar *o = 0; |
338 |
|
|
357 |
|
|
358 |
PamTrack* PamLevel2::GetStoredTrack(Int_t itrk){ |
PamTrack* PamLevel2::GetStoredTrack(Int_t itrk){ |
359 |
|
|
360 |
|
cout <<"PamLevel2::GetStoredTrack(Int_t itrk) **to-be-updated** "<<endl; |
361 |
|
cout <<"for the moment, better use separately the methods: TrkLevel2::GetStoredTrack(seqno) CaloLevel2::GetCaloTrkVar(Int_t notrack) ToFLevel2::GetToFTrkVar(Int_t notrack)"<<endl; |
362 |
|
cout <<"(if you use it, remember to delete the PamTrack object)"<<endl; |
363 |
PamTrack *track = 0; |
PamTrack *track = 0; |
364 |
|
|
365 |
if( itrk >=0 && itrk < TrkLevel2::ntrk() ){ |
if( itrk >=0 && itrk < trk2_obj->TrkLevel2::ntrk() ){ |
366 |
|
|
367 |
TrkTrack *t = TrkLevel2::GetStoredTrack(itrk); |
TrkTrack *t = trk2_obj->TrkLevel2::GetStoredTrack(itrk); |
368 |
track = GetPamTrackAlong(t); |
track = GetPamTrackAlong(t); |
369 |
|
|
370 |
|
|
371 |
|
|
372 |
}else{ |
}else{ |
373 |
cout << "PamLevel2::GetStoredTrack(int) : tracker track SeqNo "<< itrk <<" does not exist (GetNTracks() = "<<TrkLevel2::GetNTracks()<<")"<<endl; |
cout << "PamLevel2::GetStoredTrack(int) : tracker track SeqNo "<< itrk <<" does not exist (GetNTracks() = "<<trk2_obj->TrkLevel2::GetNTracks()<<")"<<endl; |
374 |
}; |
}; |
375 |
|
|
376 |
return track; |
return track; |
393 |
*/ |
*/ |
394 |
void PamLevel2::SortTracks(TString how){ |
void PamLevel2::SortTracks(TString how){ |
395 |
|
|
396 |
|
// cout <<" PamLevel2::SortTracks(TString how) "<<endl; |
397 |
|
if( !trk2_obj ){ |
398 |
|
cout << "void PamLevel2::SortTracks(TString how): TrkLevel2 not loaded !!!"; |
399 |
|
return; |
400 |
|
}; |
401 |
// cout << "call SortTracs() "<<endl; |
// cout << "call SortTracs() "<<endl; |
402 |
//Save current Object count |
//Save current Object count |
403 |
Int_t ObjectNumber = TProcessID::GetObjectCount(); |
Int_t ObjectNumber = TProcessID::GetObjectCount(); |
404 |
|
|
405 |
// cout << "ObjectNumber "<<ObjectNumber <<endl; |
// cout << "ObjectNumber "<<ObjectNumber <<endl; |
406 |
|
|
407 |
sorted_tracks->Delete(); //temporaneo??? |
// if(!sorted_tracks)sorted_tracks = new TRefArray(); |
408 |
|
// sorted_tracks->Clear(); |
409 |
|
// sorted_tracks.Clear(); |
410 |
|
|
411 |
|
if(!tsorted)tsorted = new TClonesArray("PamTrack",trk2_obj->GetNTracks()); |
412 |
|
tsorted->Delete(); |
413 |
|
TClonesArray &ttsorted = *tsorted; |
414 |
|
if(!timage)timage = new TClonesArray("PamTrack",trk2_obj->GetNTracks()); |
415 |
|
timage->Delete(); |
416 |
|
TClonesArray &ttimage = *timage; |
417 |
|
|
418 |
|
|
419 |
// loop over the tracks sorted by the tracker |
// loop over the tracks sorted by the tracker |
420 |
Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); |
Bool_t use_TRK = how.Contains("TRK", TString::kIgnoreCase); |
421 |
Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); |
Bool_t use_CAL = how.Contains("CAL", TString::kIgnoreCase); |
431 |
|
|
432 |
// cout << "use_CAL "<<use_CAL<<" use_TOF "<<use_TOF<<" use_TRK "<<use_TRK <<endl; |
// cout << "use_CAL "<<use_CAL<<" use_TOF "<<use_TOF<<" use_TRK "<<use_TRK <<endl; |
433 |
|
|
434 |
for(Int_t i=0; i < TrkLevel2::GetNTracks(); i++){ |
for(Int_t i=0; i < trk2_obj->TrkLevel2::GetNTracks(); i++){ |
435 |
|
|
436 |
TrkTrack *ts = 0; |
TrkTrack *ts = 0; |
437 |
|
CaloTrkVar *cs = 0; |
438 |
|
ToFTrkVar *os = 0; |
439 |
|
|
440 |
// get tracker tracks |
// get tracker tracks |
441 |
TrkTrack *tp = TrkLevel2::GetTrack(i); //tracker |
TrkTrack *tp = trk2_obj->TrkLevel2::GetTrack(i); //tracker |
442 |
CaloTrkVar *cp = 0; |
CaloTrkVar *cp = GetCaloStoredTrack(tp->GetSeqNo()); |
443 |
ToFTrkVar *op = 0; |
ToFTrkVar *op = GetToFStoredTrack(tp->GetSeqNo()); |
444 |
|
|
445 |
|
TrkTrack *ti = 0; //tracker (image) |
446 |
|
CaloTrkVar *ci = 0; |
447 |
|
ToFTrkVar *oi = 0; |
448 |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
// cout << "trk track n. "<<i << " "<<hex<< tp <<dec<< endl; |
449 |
// if track has an image, check image selection |
// if track has an image, check image selection |
450 |
if(tp->HasImage()){ |
if(tp->HasImage()){ |
451 |
|
|
452 |
TrkTrack *ti = TrkLevel2::GetTrackImage(i); //tracker (image) |
ti = trk2_obj->TrkLevel2::GetTrackImage(i); //tracker (image) |
453 |
CaloTrkVar *ci = 0; |
ci = GetCaloStoredTrack(ti->GetSeqNo()); |
454 |
ToFTrkVar *oi = 0; |
oi = GetToFStoredTrack(ti->GetSeqNo()); |
455 |
|
|
456 |
// cout << "its image "<<i << " "<<hex<< ti <<dec<< endl; |
// cout << "its image "<<i << " "<<hex<< ti <<dec<< endl; |
457 |
|
|
464 |
// ------------------------ |
// ------------------------ |
465 |
// check the Y spatial residual on the first calorimeter plane |
// check the Y spatial residual on the first calorimeter plane |
466 |
// (cut on calorimeter variables from Emiliano) |
// (cut on calorimeter variables from Emiliano) |
467 |
|
if( use_CAL && !calo2_obj ){ |
468 |
|
cout << "void PamLevel2::SortTracks(TString how): how= "<<how<<" but CaloLevel2 not loaded !!!"; |
469 |
|
return; |
470 |
|
}; |
471 |
if( |
if( |
472 |
use_CAL && |
use_CAL && |
473 |
npcfit[1] > 15 && //no. of fit planes on Y view |
calo2_obj->npcfit[1] > 15 && //no. of fit planes on Y view |
474 |
varcfit[1] < 1000. && //fit variance on Y view |
calo2_obj->varcfit[1] < 1000. && //fit variance on Y view |
475 |
true){ |
true){ |
476 |
|
|
|
cp = GetCaloStoredTrack(tp->GetSeqNo()); |
|
|
ci = GetCaloStoredTrack(ti->GetSeqNo()); |
|
477 |
|
|
478 |
Float_t resy_p = cp->tbar[0][1] - cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; |
Float_t resy_p = cp->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_p < 0)resy_p= - resy_p; |
479 |
Float_t resy_i = ci->tbar[0][1] - cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; |
Float_t resy_i = ci->tbar[0][1] - calo2_obj->cbar[0][1]; if(resy_i < 0)resy_i= - resy_i; |
480 |
|
|
481 |
if(resy_p <= resy_i) tp_score++; |
if(resy_p <= resy_i) tp_score++; |
482 |
else ti_score++; |
else ti_score++; |
489 |
// ------------------------ |
// ------------------------ |
490 |
// check the number of hit pmts along the track |
// check the number of hit pmts along the track |
491 |
// on S12 S21 and S32, where paddles are parallel to Y axis |
// on S12 S21 and S32, where paddles are parallel to Y axis |
492 |
|
if( use_TOF && !tof_obj ){ |
493 |
|
cout << "void PamLevel2::SortTracks(TString how): how= "<<how<<" but ToFLevel2 not loaded !!!"; |
494 |
|
return; |
495 |
|
}; |
496 |
if( use_TOF ){ |
if( use_TOF ){ |
497 |
|
|
498 |
Int_t nphit_p =0; |
Int_t nphit_p =0; |
499 |
Int_t nphit_i =0; |
Int_t nphit_i =0; |
500 |
|
|
|
op = GetToFStoredTrack(tp->GetSeqNo()); |
|
|
oi = GetToFStoredTrack(ti->GetSeqNo()); |
|
501 |
|
|
502 |
/* cout << "track: npmtadc "<< op->npmtadc << endl; |
/* cout << "track: npmtadc "<< op->npmtadc << endl; |
503 |
cout << "track: npmttdc "<< op->npmttdc << endl; |
cout << "track: npmttdc "<< op->npmttdc << endl; |
505 |
cout << "image: npmttdc "<< oi->npmttdc << endl;*/ |
cout << "image: npmttdc "<< oi->npmttdc << endl;*/ |
506 |
|
|
507 |
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
for (Int_t ih=0; ih < op->npmtadc; ih++){ |
508 |
Int_t pl = GetPlaneIndex( (op->pmtadc).At(ih) ); |
Int_t pl = tof_obj->GetPlaneIndex( (op->pmtadc).At(ih) ); |
509 |
if(pl == 1 || pl == 2 || pl == 5)nphit_p++; |
if(pl == 1 || pl == 2 || pl == 5)nphit_p++; |
510 |
}; |
}; |
511 |
|
|
512 |
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
for (Int_t ih=0; ih < oi->npmtadc; ih++){ |
513 |
Int_t pl = GetPlaneIndex( (oi->pmtadc).At(ih) ); |
Int_t pl = tof_obj->GetPlaneIndex( (oi->pmtadc).At(ih) ); |
514 |
if(pl == 1 || pl == 2 || pl == 5)nphit_i++; |
if(pl == 1 || pl == 2 || pl == 5)nphit_i++; |
515 |
}; |
}; |
516 |
|
|
540 |
// ------------------------ |
// ------------------------ |
541 |
// the winner is.... |
// the winner is.... |
542 |
// ------------------------ |
// ------------------------ |
543 |
if (tp_score > ti_score) ts = tp;//the track sorted by the tracker!! |
if (tp_score > ti_score) { |
544 |
else if (tp_score < ti_score) ts = ti;//its image!! |
// ts = tp;//the track sorted by the tracker!! |
545 |
else { |
// cs = cp; |
546 |
ts = tp; |
// os = op; |
547 |
|
}else if (tp_score < ti_score) { |
548 |
|
ts = ti;//its image!! |
549 |
|
cs = ci; |
550 |
|
os = oi; |
551 |
|
|
552 |
|
ti = tp;//its image!! |
553 |
|
ci = cp; |
554 |
|
oi = op; |
555 |
|
|
556 |
|
tp = ts;//its image!! |
557 |
|
cp = cs; |
558 |
|
op = os; |
559 |
|
|
560 |
|
|
561 |
|
}else { |
562 |
|
// ts = tp; |
563 |
|
// cs = cp; |
564 |
|
// os = op; |
565 |
// cout << "Warning - track image ambiguity not solved" << endl; |
// cout << "Warning - track image ambiguity not solved" << endl; |
566 |
// cout << ts->GetNtot() << " "<< ts->chi2 << " " << npcfit[1] << " "<< nphit_p << endl; |
// cout << ts->GetNtot() << " "<< ts->chi2 << " " << npcfit[1] << " "<< nphit_p << endl; |
567 |
}; |
}; |
568 |
|
|
569 |
}else{ |
}else{ |
570 |
ts = tp; |
// ts = tp; |
571 |
|
// cs = cp; |
572 |
|
// os = op; |
573 |
}; |
}; |
574 |
|
|
575 |
// cout <<" SortTracks() "<<i<<" -- "<<ts<<endl; |
// cout <<" SortTracks() "<<i<<" -- "<<ts<<endl; |
576 |
sorted_tracks->Add(ts);//save the track in the sorted array |
// sorted_tracks->Add(ts);//save the track in the sorted array |
577 |
|
// sorted_tracks.Add(ts);//save the track in the sorted array |
578 |
|
// sorted_tracks.Add(tp);//save the track in the sorted array |
579 |
// cout << "SortTracks:: sorted_tracks->Add(it) "<<i<<" "<<ts<<endl; |
// cout << "SortTracks:: sorted_tracks->Add(it) "<<i<<" "<<ts<<endl; |
580 |
|
// cout<<"o "<<tp<<endl; |
581 |
|
// cout<<"o "<<cp<<endl; |
582 |
|
// cout<<"o "<<op<<endl; |
583 |
|
new(ttsorted[i]) PamTrack(tp,cp,op); |
584 |
|
new(ttimage[i]) PamTrack(ti,ci,oi); |
585 |
}; |
}; |
586 |
|
|
587 |
|
if( tsorted->GetEntries() != trk2_obj->GetNTracks() ){ |
588 |
|
cout << "void PamLevel2::SortTracks(TString how): tsorted->GetEntries() "<<tsorted->GetEntries()<<" != trk2_obj->GetNTracks() = "<<trk2_obj->GetNTracks() <<endl; |
589 |
|
tsorted->Delete(); tsorted=0; |
590 |
|
timage->Delete(); timage=0; |
591 |
|
} |
592 |
|
|
593 |
//Restore Object count |
//Restore Object count |
594 |
//To save space in the table keeping track of all referenced objects |
//To save space in the table keeping track of all referenced objects |
595 |
//we assume that our events do not address each other. We reset the |
//We reset the object count to what it was at the beginning of the event. |
|
//object count to what it was at the beginning of the event. |
|
596 |
TProcessID::SetObjectCount(ObjectNumber); |
TProcessID::SetObjectCount(ObjectNumber); |
597 |
|
|
598 |
}; |
}; |
604 |
* This method overrides TrkLevel2::GetTracks(), where sorting is done by decreasing number of fit points and increasing chi^2. |
* This method overrides TrkLevel2::GetTracks(), where sorting is done by decreasing number of fit points and increasing chi^2. |
605 |
* PamLevel2::GetTracks() keeps the same track order given by TrkLevel2::GetTracks(), but checks image selection by using calorimeter and ToF tracking information. |
* PamLevel2::GetTracks() keeps the same track order given by TrkLevel2::GetTracks(), but checks image selection by using calorimeter and ToF tracking information. |
606 |
*/ |
*/ |
607 |
TRefArray *PamLevel2::GetTracks(){ |
// TRefArray *PamLevel2::GetTracks(){ |
608 |
|
|
609 |
|
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
610 |
|
// SortTracks("+CAL+TOF"); |
611 |
|
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
612 |
|
|
613 |
|
// // return sorted_tracks; |
614 |
|
// return &sorted_tracks; |
615 |
|
|
616 |
|
// }; |
617 |
|
TClonesArray *PamLevel2::GetTracks(){ |
618 |
|
|
619 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
620 |
SortTracks("+CAL+TOF"); |
SortTracks("+CAL+TOF"); |
621 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
622 |
|
|
623 |
return sorted_tracks; |
return tsorted; |
624 |
|
|
625 |
}; |
}; |
626 |
//-------------------------------------- |
//-------------------------------------- |
627 |
// |
// |
633 |
* @param it Track number, ranging from 0 to GetNTracks(). |
* @param it Track number, ranging from 0 to GetNTracks(). |
634 |
*/ |
*/ |
635 |
PamTrack *PamLevel2::GetTrack(int it){ |
PamTrack *PamLevel2::GetTrack(int it){ |
636 |
|
|
637 |
|
// if(!trk2_obj) return 0; |
638 |
|
|
639 |
|
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
640 |
|
// SortTracks("+CAL+TOF"); |
641 |
|
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
642 |
|
// // if(!sorted_tracks)return 0; |
643 |
|
// if(sorted_tracks.IsEmpty())return 0; |
644 |
|
|
645 |
|
// PamTrack *track = 0; |
646 |
|
|
647 |
|
// if( it >=0 && it < trk2_obj->TrkLevel2::GetNTracks() && it<sorted_tracks.GetEntriesFast() ){ |
648 |
|
// TrkTrack *t = (TrkTrack*)sorted_tracks.At(it); |
649 |
|
// track = GetPamTrackAlong(t); |
650 |
|
// }else{ |
651 |
|
// cout << "PamLevel2::GetTrack(int) : tracker track SeqNo "<< it <<" does not exist (GetNTracks() = "<<trk2_obj->TrkLevel2::GetNTracks()<<")"<<endl; |
652 |
|
// }; |
653 |
|
|
654 |
|
// return track; |
655 |
|
|
656 |
|
// cout << "PamLevel2::GetTrack(int it) "<<endl; |
657 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
658 |
SortTracks("+CAL+TOF"); |
SortTracks("+CAL+TOF"); |
659 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
660 |
|
if(!tsorted)return 0; |
661 |
|
if(!tsorted->GetEntries())return 0; |
662 |
|
|
663 |
PamTrack *track = 0; |
PamTrack *track = 0; |
664 |
|
|
665 |
if( it >=0 && it < TrkLevel2::GetNTracks() && it<sorted_tracks->GetEntriesFast() ){ |
if( it >=0 && it < trk2_obj->TrkLevel2::GetNTracks()){ |
666 |
TrkTrack *t = (TrkTrack*)sorted_tracks->At(it); |
// TrkTrack *t = (TrkTrack*)sorted_tracks.At(it); |
667 |
track = GetPamTrackAlong(t); |
// track = GetPamTrackAlong(t); |
668 |
|
TClonesArray &t = *(tsorted); |
669 |
|
track = (PamTrack*)t[it]; |
670 |
|
|
671 |
}else{ |
}else{ |
672 |
cout << "PamLevel2::GetTrack(int) : tracker track SeqNo "<< it <<" does not exist (GetNTracks() = "<<TrkLevel2::GetNTracks()<<")"<<endl; |
cout << "PamLevel2::GetTrack(int) : tracker track SeqNo "<< it <<" does not exist (GetNTracks() = "<<trk2_obj->TrkLevel2::GetNTracks()<<")"<<endl; |
673 |
}; |
}; |
674 |
|
|
675 |
return track; |
return track; |
686 |
*/ |
*/ |
687 |
PamTrack *PamLevel2::GetTrackImage(int it){ |
PamTrack *PamLevel2::GetTrackImage(int it){ |
688 |
|
|
689 |
|
// if(!trk2_obj) return 0; |
690 |
|
|
691 |
|
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
692 |
|
// SortTracks("+CAL+TOF"); |
693 |
|
// // *-*-*-*-*-*-*-*-*-*-*-*-* |
694 |
|
// // if(!sorted_tracks)return 0; |
695 |
|
// if(sorted_tracks.IsEmpty())return 0; |
696 |
|
|
697 |
|
// PamTrack *image = 0; |
698 |
|
|
699 |
|
// if( it >=0 && it < trk2_obj->TrkLevel2::GetNTracks() ){ |
700 |
|
// TrkTrack *temp = (TrkTrack*)sorted_tracks.At(it); |
701 |
|
// if( temp->HasImage() ){ |
702 |
|
// TrkTrack *t = trk2_obj->TrkLevel2::GetStoredTrack(temp->GetImageSeqNo()); |
703 |
|
// image = GetPamTrackAlong(t); |
704 |
|
// }else{ |
705 |
|
// cout <<"PamLevel2::GetTrackImage(int) : Track SeqNo "<<it<<" does not have image"<<endl; |
706 |
|
// }; |
707 |
|
// }else{ |
708 |
|
// cout << "PamLevel2::GetTrackImage(int) : Tracker track SeqNo "<< it <<" does not exist (GetNTracks() = "<<trk2_obj->TrkLevel2::GetNTracks()<<")"<<endl; |
709 |
|
// }; |
710 |
|
|
711 |
|
// return image; |
712 |
|
|
713 |
|
|
714 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
715 |
SortTracks("+CAL+TOF"); |
SortTracks("+CAL+TOF"); |
716 |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
// *-*-*-*-*-*-*-*-*-*-*-*-* |
717 |
|
if(!timage)return 0; |
718 |
|
if(!timage->GetEntries())return 0; |
719 |
|
|
720 |
PamTrack *image = 0; |
PamTrack *image = 0; |
721 |
|
|
722 |
if( it >=0 && it < TrkLevel2::GetNTracks() ){ |
if( it >=0 && it < trk2_obj->TrkLevel2::GetNTracks() ){ |
723 |
TrkTrack *temp = (TrkTrack*)sorted_tracks->At(it); |
TClonesArray &t = *(tsorted); |
724 |
if( temp->HasImage() ){ |
PamTrack *temp = (PamTrack*)t[it]; |
725 |
TrkTrack *t = TrkLevel2::GetStoredTrack(temp->GetImageSeqNo()); |
if( temp->GetTrkTrack()->HasImage() ){ |
726 |
image = GetPamTrackAlong(t); |
TClonesArray &t = *(timage); |
727 |
|
image = (PamTrack*)t[it]; |
728 |
}else{ |
}else{ |
729 |
cout <<"PamLevel2::GetTrackImage(int) : Track SeqNo "<<it<<" does not have image"<<endl; |
// cout <<"PamLevel2::GetTrackImage(int) : Track SeqNo "<<it<<" does not have image"<<endl; |
730 |
}; |
}; |
731 |
}else{ |
}else{ |
732 |
cout << "PamLevel2::GetTrackImage(int) : Tracker track SeqNo "<< it <<" does not exist (GetNTracks() = "<<TrkLevel2::GetNTracks()<<")"<<endl; |
cout << "PamLevel2::GetTrackImage(int) : Tracker track SeqNo "<< it <<" does not exist (GetNTracks() = "<<trk2_obj->TrkLevel2::GetNTracks()<<")"<<endl; |
733 |
}; |
}; |
734 |
|
|
735 |
return image; |
return image; |
989 |
// if( !detlist.IsNull() )SetWhichTrees(detlist); |
// if( !detlist.IsNull() )SetWhichTrees(detlist); |
990 |
SetWhichTrees(detlist); |
SetWhichTrees(detlist); |
991 |
|
|
992 |
cout<< "GetPamTree(TList*,TString): detector list --> "; |
cout<< "GetPamTree(TList*,TString): input detector list --> "; |
993 |
if(TRK1)cout<<"TRK1 "; |
if(TRK1)cout<<"TRK1 "; |
994 |
if(TRK2)cout<<"TRK2 "; |
if(TRK2)cout<<"TRK2 "; |
995 |
if(TRKh)cout<<"TRKH "; |
if(TRKh)cout<<"TRKH "; |
1003 |
if(ORB)cout<<"ORB "; |
if(ORB)cout<<"ORB "; |
1004 |
cout << endl; |
cout << endl; |
1005 |
|
|
|
|
|
|
|
|
1006 |
TChain *T = 0; |
TChain *T = 0; |
1007 |
TChain *C = 0; |
TChain *C = 0; |
1008 |
TChain *O = 0; |
TChain *O = 0; |
1026 |
TSystemFile *questo = 0; |
TSystemFile *questo = 0; |
1027 |
while ( (questo = (TSystemFile*) next()) ) { |
while ( (questo = (TSystemFile*) next()) ) { |
1028 |
TString name = questo->GetName(); |
TString name = questo->GetName(); |
1029 |
// cout << "File: "<< name << endl; |
cout << "File: "<< name << endl; |
1030 |
if( CheckLevel2File(name) ){ |
if( CheckLevel2File(name) ){ |
1031 |
if(TRK2||TRK1||TRKh) T->Add(name); |
if(TRK2||TRK1||TRKh) T->Add(name); |
1032 |
if(CAL1||CAL2) C->Add(name); |
if(CAL1||CAL2) C->Add(name); |
1498 |
*/ |
*/ |
1499 |
void PamLevel2::GetWhichTrees(TFile* f){ |
void PamLevel2::GetWhichTrees(TFile* f){ |
1500 |
|
|
|
|
|
1501 |
// ----------- |
// ----------- |
1502 |
// reset flags |
// reset flags |
1503 |
// ----------- |
// ----------- |
1623 |
|
|
1624 |
}; |
}; |
1625 |
|
|
1626 |
lk->Delete(); |
delete lk; |
1627 |
|
|
1628 |
// cout<< "Get detector list from input file --> "; |
// cout<< "Get detector list from input file --> "; |
1629 |
// if(TRK1)cout<<"TRK1 "; |
// if(TRK1)cout<<"TRK1 "; |
1826 |
// cout << endl; |
// cout << endl; |
1827 |
|
|
1828 |
|
|
1829 |
|
if(TRK2 && TRK1__ok)TRK1=1; |
1830 |
|
// ---------------------------------------------------------------------------- |
1831 |
|
// NOTA |
1832 |
|
// se c'e` il level1, lo devo necessarimente leggere. |
1833 |
|
// infatti (non ho capito perche`) i cluster vengono letti e allocati in memoria |
1834 |
|
// comunque, ma non vengono disallocati da PamLevel2::Clear() |
1835 |
|
// ---------------------------------------------------------------------------- |
1836 |
|
|
1837 |
|
|
1838 |
if(!RUN__ok) { |
if(!RUN__ok) { |
1839 |
cout << "File: "<< f->GetName() <<" *WARNING* ---- Missing RunInfo tree"<< endl; |
cout << "File: "<< f->GetName() <<" *WARNING* ---- Missing RunInfo tree"<< endl; |
1840 |
// return false; |
// return false; |
1887 |
}; |
}; |
1888 |
|
|
1889 |
|
|
1890 |
lk->Delete(); |
// lk->Delete(); |
1891 |
|
// delete lk; |
1892 |
f->Close(); |
f->Close(); |
1893 |
|
|
1894 |
// cout<< "CheckLevel2File(TString): detector list --> "; |
// cout<< "CheckLevel2File(TString): detector list --> "; |
1941 |
cout << tree_clone[i]->GetName() << endl; |
cout << tree_clone[i]->GetName() << endl; |
1942 |
i++; |
i++; |
1943 |
} |
} |
1944 |
|
|
1945 |
|
delete li; |
1946 |
|
|
1947 |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
1948 |
|
|
2038 |
|
|
2039 |
} |
} |
2040 |
|
|
|
// /** |
|
|
// * Create clone-trees |
|
|
// */ |
|
|
// void PamLevel2::CreateCloneTrees(){ |
|
|
|
|
|
// cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
|
|
// cout << "Create new PAMELA trees "<<endl; |
|
|
|
|
|
// if(TRK1||TRK2||TRKh){ |
|
|
// T_clone = new TTree("Tracker_clone","PAMELA tracker level2 data "); |
|
|
// if(TRK1) { |
|
|
// trk1_clone = new TrkLevel1(); |
|
|
// T_clone->Branch("TrkLevel1","TrkLevel1", &trk1_clone); |
|
|
// T_clone->BranchRef(); |
|
|
// cout << "Tracker : branch TrkLevel1"<<endl; |
|
|
// }; |
|
|
// if(TRK2) { |
|
|
// trk2_clone = new TrkLevel2(); |
|
|
// T_clone->Branch("TrkLevel2", "TrkLevel2",&trk2_clone); |
|
|
// cout << "Tracker : branch TrkLevel2"<<endl; |
|
|
// }; |
|
|
// if(TRKh) { |
|
|
// trkh_clone = new TrkHough(); |
|
|
// T_clone->Branch("TrkHough","TrkHough", &trkh_clone); |
|
|
// cout << "Tracker : branch TrkHough"<<endl; |
|
|
// }; |
|
|
// cout << hex << T_clone << dec << endl; |
|
|
// } |
|
|
|
|
|
// // Calorimeter |
|
|
// if(CAL1||CAL2){ |
|
|
// C_clone = new TTree("Calorimeter_clone","PAMELA calorimeter level2 data "); |
|
|
// if(CAL1) { |
|
|
// calo1_clone = new CaloLevel1(); |
|
|
// C_clone->Branch("CaloLevel1", "CaloLevel1", &calo1_clone); |
|
|
// cout << "Calorimeter : branch CaloLevel1"<<endl; |
|
|
// }; |
|
|
// if(CAL2) { |
|
|
// calo2_clone = new CaloLevel2(); |
|
|
// C_clone->Branch("CaloLevel2","CaloLevel2", &calo2_clone); |
|
|
// cout << "Calorimeter : branch CaloLevel2"<<endl; |
|
|
// }; |
|
|
// } |
|
|
|
|
|
// // ToF |
|
|
// if(TOF) { |
|
|
// O_clone = new TTree("ToF_clone","PAMELA ToF level2 data "); |
|
|
// tof_clone = new ToFLevel2(); |
|
|
// O_clone->Branch("ToFLevel2","ToFLevel2", &tof_clone); |
|
|
// cout << "ToF : branch ToFLevel2"<<endl; |
|
|
// }; |
|
|
// // Trigger |
|
|
// if(TRG) { |
|
|
// R_clone = new TTree("Trigger_clone","PAMELA trigger level2 data "); |
|
|
// trig_clone = new TrigLevel2(); |
|
|
// R_clone->Branch("TrigLevel2","TrigLevel2", &trig_clone); |
|
|
// cout << "Trigger : branch TrigLevel2"<<endl; |
|
|
// }; |
|
|
// // S4 |
|
|
// if(S4) { |
|
|
// S_clone = new TTree("S4_clone","PAMELA S4 level2 data "); |
|
|
// s4_clone = new S4Level2(); |
|
|
// S_clone->Branch("S4Level2","S4Level2", &s4_clone); |
|
|
// cout << "S4 : branch S4Level2"<<endl; |
|
|
// }; |
|
|
// // Neutron Detector |
|
|
// if(ND) { |
|
|
// N_clone = new TTree("NeutronD_clone","PAMELA neutron detector level2 data "); |
|
|
// nd_clone = new NDLevel2(); |
|
|
// N_clone->Branch("NDLevel2","NDLevel2", &nd_clone); |
|
|
// cout << "NeutronD : branch NDLevel2"<<endl; |
|
|
// }; |
|
|
// // Anticounters |
|
|
// if(AC) { |
|
|
// A_clone = new TTree("Anticounter_clone","PAMELA anticounter detector level2 data "); |
|
|
// ac_clone = new AcLevel2(); |
|
|
// A_clone->Branch("AcLevel2","AcLevel2", &ac_clone); |
|
|
// cout << "Anticounter : branch AcLevel2"<<endl; |
|
|
// }; |
|
|
// // OrbitalInfo |
|
|
// if(ORB) { |
|
|
// B_clone = new TTree("OrbitalInfo_clone","PAMELA oribital info "); |
|
|
// orb_clone = new OrbitalInfo(); |
|
|
// B_clone->Branch("OrbitalInfo","OrbitalInfo", &orb_clone); |
|
|
// cout << "OrbitalInfo : branch OrbitalInfo"<<endl; |
|
|
// }; |
|
|
// cout << "+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+" <<endl; |
|
|
|
|
|
// } |
|
2041 |
|
|
2042 |
/** |
/** |
2043 |
* Fill tree (created with CreateCloneTrees) |
* Fill tree (created with CreateCloneTrees) |
2046 |
//void PamLevel2::FillNewPamTree(TTree *T){ |
//void PamLevel2::FillNewPamTree(TTree *T){ |
2047 |
void PamLevel2::FillCloneTrees(){ |
void PamLevel2::FillCloneTrees(){ |
2048 |
|
|
|
// // -------------------------------------- |
|
|
// // copy the event |
|
|
// // -------------------------------------- |
|
|
// if(trk1_clone) *trk1_clone = *trk1_obj; |
|
|
// if(trk2_clone){ |
|
|
// trk2_clone->Clear(); |
|
|
// trk2_obj->Copy(*trk2_clone); |
|
|
// // *trk2_clone = *trk2_obj; |
|
|
// } |
|
|
// if(trkh_clone) *trkh_clone = *trkh_obj; |
|
|
// if(calo1_clone){ |
|
|
// // *calo1_clone = *calo1_obj; |
|
|
// calo1_clone->Clear(); |
|
|
// calo1_obj->Copy(*calo1_clone); |
|
|
// } |
|
|
// if(calo2_clone){ |
|
|
// // *calo2_clone = *calo2_obj; |
|
|
// calo2_clone->Clear(); |
|
|
// calo2_obj->Copy(*calo2_clone); |
|
|
// } |
|
|
// if(tof_clone) *tof_clone = *tof_obj; |
|
|
// if(trig_clone) *trig_clone = *trig_obj; |
|
|
// if(s4_clone) *s4_clone = *s4_obj; |
|
|
// if(nd_clone) *nd_clone = *nd_obj; |
|
|
// if(ac_clone) *ac_clone = *ac_obj; |
|
|
// if(orb_clone) *orb_clone = *orb_obj; |
|
|
|
|
|
// if(T_clone)T_clone->Fill(); |
|
|
// if(C_clone)C_clone->Fill(); |
|
|
// if(O_clone)O_clone->Fill(); |
|
|
// if(R_clone)R_clone->Fill(); |
|
|
// if(S_clone)S_clone->Fill(); |
|
|
// if(N_clone)N_clone->Fill(); |
|
|
// if(A_clone)A_clone->Fill(); |
|
|
// if(O_clone)O_clone->Fill(); |
|
|
|
|
2049 |
for(Int_t i=0; i<8; i++){ |
for(Int_t i=0; i<8; i++){ |
2050 |
if(tree_clone[i])tree_clone[i]->Fill(); |
if(tree_clone[i])tree_clone[i]->Fill(); |
2051 |
} |
} |