50837721 |
1 | /************************************************************************** |
2 | * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
3 | * * |
4 | * Author: The ALICE Off-line Project. * |
5 | * Contributors are mentioned in the code where appropriate. * |
6 | * * |
7 | * Permission to use, copy, modify and distribute this software and its * |
8 | * documentation strictly for non-commercial purposes is hereby granted * |
9 | * without fee, provided that the above copyright notice appears in all * |
10 | * copies and that both the copyright notice and this permission notice * |
11 | * appear in the supporting documentation. The authors make no claims * |
12 | * about the suitability of this software for any purpose. It is * |
13 | * provided "as is" without express or implied warranty. * |
14 | **************************************************************************/ |
15 | |
16 | /* $Id$ */ |
6309cf6e |
17 | |
6309cf6e |
18 | //Root includes |
1a1cdff8 |
19 | #include "TNamed.h" |
6309cf6e |
20 | //AliRoot includes |
1a1cdff8 |
21 | #include "AliLoader.h" |
22 | #include "AliMUONConstants.h" |
6309cf6e |
23 | #include "AliMUONData.h" |
24 | #include "AliMUONDigit.h" |
25 | #include "AliMUONHit.h" |
26 | #include "AliMUONLocalTrigger.h" |
27 | #include "AliMUONGlobalTrigger.h" |
28 | #include "AliMUONRawCluster.h" |
dcd2690d |
29 | #include "AliMUONTrack.h" |
6309cf6e |
30 | |
31 | ClassImp(AliMUONData) |
32 | |
33 | //_____________________________________________________________________________ |
34 | AliMUONData::AliMUONData():TNamed() |
35 | { |
36 | fLoader = 0x0; |
37 | fHits = 0x0; // One event in treeH per primary track |
38 | fDigits = 0x0; // One event in treeH per detection plane |
ce3f5e87 |
39 | fNdigits = 0x0; |
6309cf6e |
40 | fRawClusters = 0x0; //One event in TreeR/RawclusterBranch per tracking detection plane |
41 | fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch |
dcd2690d |
42 | fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch |
43 | fRecTracks = 0x0; |
6309cf6e |
44 | //default constructor |
45 | } |
46 | //_____________________________________________________________________________ |
47 | AliMUONData::AliMUONData(AliLoader * loader, const char* name, const char* title): |
48 | TNamed(name,title) |
49 | { |
50 | fLoader = loader; |
b1c7d777 |
51 | fHits = 0x0; // One event in treeH per primary track |
52 | fDigits = 0x0; // One event in treeH per detection plane |
53 | fNdigits = 0x0; |
54 | fRawClusters = 0x0; //One event in TreeR/RawclusterBranch per tracking detection plane |
55 | fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch |
56 | fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch |
57 | fRecTracks = 0x0; |
6309cf6e |
58 | fNhits = 0; |
6309cf6e |
59 | fNglobaltrigger =0; |
6309cf6e |
60 | fNlocaltrigger = 0; |
b1c7d777 |
61 | fNrectracks = 0; |
62 | // fHits = new TClonesArray("AliMUONHit",1000); |
63 | // fNhits = 0; |
64 | // fDigits = new TObjArray(AliMUONConstants::NCh()); |
65 | // fNdigits = new Int_t[AliMUONConstants::NCh()]; |
66 | // for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) { |
67 | // fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),iDetectionPlane); |
68 | // fNdigits[iDetectionPlane]=0; |
69 | // } |
70 | // fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh()); |
71 | // fNrawclusters = new Int_t[AliMUONConstants::NTrackingCh()]; |
72 | // for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NTrackingCh();iDetectionPlane++) { |
73 | // fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),iDetectionPlane); |
74 | // fNrawclusters[iDetectionPlane]=0; |
75 | // } |
76 | // fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1); |
77 | // fNglobaltrigger =0; |
78 | // fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234); |
79 | // fNlocaltrigger = 0; |
80 | // fRecTracks = new TClonesArray("AliMUONTrack", 10); |
81 | // fNrectracks = 0; // really needed or GetEntriesFast sufficient ???? |
82 | |
83 | |
6309cf6e |
84 | //default constructor |
85 | } |
86 | //_____________________________________________________________________________ |
87 | AliMUONData::AliMUONData(const AliMUONData& rMUONData):TNamed(rMUONData) |
88 | { |
89 | // Dummy copy constructor |
90 | ; |
91 | } |
92 | //_____________________________________________________________________________ |
93 | AliMUONData::~AliMUONData() |
94 | { |
95 | if (fHits) { |
96 | fHits->Delete(); |
97 | delete fHits; |
98 | } |
99 | if (fDigits) { |
100 | fDigits->Delete(); |
101 | delete fDigits; |
102 | } |
103 | if (fRawClusters) { |
104 | fRawClusters->Delete(); |
105 | delete fRawClusters; |
106 | } |
107 | if (fGlobalTrigger){ |
108 | fGlobalTrigger->Delete(); |
109 | delete fGlobalTrigger; |
110 | } |
111 | if (fLocalTrigger){ |
112 | fLocalTrigger->Delete(); |
113 | delete fLocalTrigger; |
114 | } |
dcd2690d |
115 | if (fRecTracks){ |
116 | fRecTracks->Delete(); |
117 | delete fRecTracks; |
118 | } |
6309cf6e |
119 | //detructor |
120 | } |
121 | //_____________________________________________________________________________ |
122 | void AliMUONData::AddDigit(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits) |
123 | { |
124 | // |
125 | // Add a MUON digit to the list of Digits of the detection plane id |
126 | // |
1a1cdff8 |
127 | TClonesArray &ldigits = * Digits(id) ; |
6309cf6e |
128 | new(ldigits[fNdigits[id]++]) AliMUONDigit(tracks,charges,digits); |
129 | } |
130 | //_____________________________________________________________________________ |
131 | void AliMUONData::AddGlobalTrigger(Int_t *singlePlus, Int_t *singleMinus, |
132 | Int_t *singleUndef, |
133 | Int_t *pairUnlike, Int_t *pairLike) |
134 | { |
135 | // add a MUON Global Trigger to the list (only one GlobalTrigger per event !) |
136 | TClonesArray &globalTrigger = *fGlobalTrigger; |
137 | new(globalTrigger[fNglobaltrigger++]) |
138 | AliMUONGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike); |
139 | } |
140 | //_____________________________________________________________________________ |
141 | void AliMUONData::AddHit(Int_t fIshunt, Int_t track, Int_t iChamber, |
142 | Int_t idpart, Float_t X, Float_t Y, Float_t Z, |
143 | Float_t tof, Float_t momentum, Float_t theta, |
144 | Float_t phi, Float_t length, Float_t destep) |
145 | { |
146 | TClonesArray &lhits = *fHits; |
147 | new(lhits[fNhits++]) AliMUONHit(fIshunt, track, iChamber, |
148 | idpart, X, Y, Z, |
149 | tof, momentum, theta, |
150 | phi, length, destep); |
151 | } |
152 | //____________________________________________________________________________ |
153 | void AliMUONData::AddLocalTrigger(Int_t *localtr) |
154 | { |
155 | // add a MUON Local Trigger to the list |
156 | TClonesArray &localTrigger = *fLocalTrigger; |
157 | new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(localtr); |
158 | } |
159 | //_____________________________________________________________________________ |
160 | void AliMUONData::AddRawCluster(Int_t id, const AliMUONRawCluster& c) |
161 | { |
162 | // |
163 | // Add a MUON rawcluster to the list in the detection plane id |
164 | // |
165 | TClonesArray &lrawcl = *((TClonesArray*) fRawClusters->At(id)); |
166 | new(lrawcl[fNrawclusters[id]++]) AliMUONRawCluster(c); |
167 | } |
dcd2690d |
168 | //_____________________________________________________________________________ |
169 | void AliMUONData::AddRecTrack(const AliMUONTrack& track) |
170 | { |
171 | // |
172 | // Add a MUON rectrack |
173 | // |
174 | TClonesArray &lrectracks = *fRecTracks; |
175 | new(lrectracks[fNrectracks++]) AliMUONTrack(track); |
176 | } |
ce3f5e87 |
177 | //____________________________________________________________________________ |
c1d45bdf |
178 | Bool_t AliMUONData::IsRawClusterBranchesInTree() |
179 | { |
180 | if (TreeR()==0x0) { |
181 | Error("TreeR","No treeR in memory"); |
182 | return kFALSE; |
183 | } |
184 | else { |
185 | char branchname[30]; |
186 | sprintf(branchname,"%sRawClusters1",GetName()); |
187 | TBranch * branch = 0x0; |
188 | branch = TreeR()->GetBranch(branchname); |
189 | if (branch) return kTRUE; |
190 | else return kFALSE; |
191 | } |
192 | } |
193 | //____________________________________________________________________________ |
194 | Bool_t AliMUONData::IsTriggerBranchesInTree() |
195 | { |
196 | if (TreeR()==0x0) { |
197 | Error("TreeR","No treeR in memory"); |
198 | return kFALSE; |
199 | } |
200 | else { |
201 | char branchname[30]; |
202 | sprintf(branchname,"%sLocalTrigger",GetName()); |
203 | TBranch * branch = 0x0; |
204 | branch = TreeR()->GetBranch(branchname); |
205 | if (branch) return kTRUE; |
206 | else return kFALSE; |
207 | } |
208 | } |
209 | //____________________________________________________________________________ |
1a1cdff8 |
210 | void AliMUONData::Fill(Option_t* option) |
211 | { |
212 | // Method to fill the trees |
213 | const char *cH = strstr(option,"H"); |
214 | const char *cD = strstr(option,"D"); // Digits branches in TreeD |
215 | const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR |
216 | const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR |
217 | const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT |
218 | //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP |
219 | |
220 | char branchname[30]; |
221 | TBranch * branch = 0x0; |
222 | |
223 | // |
224 | // Filling TreeH |
225 | if ( TreeH() && cH ) { |
226 | TreeH()->Fill(); |
227 | } |
228 | // |
229 | // Filling TreeD |
230 | if ( TreeD() && cD) { |
231 | TreeD()->Fill(); |
232 | } |
c1d45bdf |
233 | |
1a1cdff8 |
234 | // |
235 | // filling rawclusters |
c1d45bdf |
236 | if ( TreeR() && cRC ) { |
237 | if ( IsTriggerBranchesInTree() ) { |
238 | // Branch per branch filling |
239 | for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) { |
240 | sprintf(branchname,"%sRawClusters%d",GetName(),i+1); |
241 | branch = TreeR()->GetBranch(branchname); |
242 | branch->Fill(); |
243 | } |
244 | } |
245 | else TreeR()->Fill(); |
1a1cdff8 |
246 | } |
c1d45bdf |
247 | |
1a1cdff8 |
248 | // |
249 | // filling trigger |
250 | if ( TreeR() && cGLT) { |
346357f4 |
251 | if (IsRawClusterBranchesInTree()) { |
c1d45bdf |
252 | // Branch per branch filling |
253 | sprintf(branchname,"%sLocalTrigger",GetName()); |
254 | branch = TreeR()->GetBranch(branchname); |
255 | branch->Fill(); |
256 | sprintf(branchname,"%sGlobalTrigger",GetName()); |
257 | branch = TreeR()->GetBranch(branchname); |
258 | branch->Fill(); |
259 | } |
260 | else TreeR()->Fill(); |
1a1cdff8 |
261 | } |
262 | // |
263 | // filling tracks |
264 | if ( TreeT() && cRT ) { |
265 | sprintf(branchname,"%sTrack",GetName()); |
266 | branch = TreeT()->GetBranch(branchname); |
267 | branch->Fill(); |
268 | } |
269 | } |
270 | //_____________________________________________________________________________ |
6309cf6e |
271 | void AliMUONData::MakeBranch(Option_t* option) |
272 | { |
273 | // |
274 | // Create Tree branches for the MUON. |
275 | // |
276 | const Int_t kBufferSize = 4000; |
277 | char branchname[30]; |
278 | |
279 | const char *cH = strstr(option,"H"); |
280 | const char *cD = strstr(option,"D"); // Digits branches in TreeD |
281 | const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR |
282 | const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR |
283 | const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT |
284 | const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP |
285 | |
286 | TBranch * branch = 0x0; |
287 | |
288 | // Creating Branches for Hits |
289 | if (TreeH() && cH) { |
290 | if (fHits == 0x0) fHits = new TClonesArray("AliMUONHit",1000); |
291 | fNhits = 0; |
292 | sprintf(branchname,"%sHits",GetName()); |
293 | branch = TreeH()->GetBranch(branchname); |
294 | if (branch) { |
295 | Info("MakeBranch","Branch %s is already in tree.",GetName()); |
296 | return ; |
297 | } |
298 | branch = TreeH()->Branch(branchname,&fHits,kBufferSize); |
299 | Info("MakeBranch","Making Branch %s for hits \n",branchname); |
300 | } |
301 | |
302 | //Creating Branches for Digits |
303 | if (TreeD() && cD ) { |
304 | // one branch for digits per chamber |
305 | if (fDigits == 0x0) { |
ce3f5e87 |
306 | fDigits = new TObjArray(AliMUONConstants::NCh()); |
6309cf6e |
307 | for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) { |
308 | fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),iDetectionPlane); |
ce3f5e87 |
309 | } |
310 | } |
311 | if (fNdigits == 0x0) { |
312 | fNdigits = new Int_t[AliMUONConstants::NCh()]; |
313 | for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) { |
6309cf6e |
314 | fNdigits[iDetectionPlane]=0; |
315 | } |
316 | } |
317 | for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) { |
318 | sprintf(branchname,"%sDigits%d",GetName(),iDetectionPlane+1); |
319 | branch = 0x0; |
320 | branch = TreeD()->GetBranch(branchname); |
321 | if (branch) { |
322 | Info("MakeBranch","Branch %s is already in tree.",GetName()); |
323 | return; |
324 | } |
1a1cdff8 |
325 | TClonesArray * digits = Digits(iDetectionPlane); |
ce3f5e87 |
326 | branch = TreeD()->Branch(branchname, &digits, kBufferSize); |
6309cf6e |
327 | Info("MakeBranch","Making Branch %s for digits in detection plane %d\n",branchname,iDetectionPlane+1); |
328 | } |
329 | } |
330 | |
331 | if (TreeR() && cRC ) { |
332 | // one branch for raw clusters per tracking detection plane |
333 | // |
334 | Int_t i; |
335 | if (fRawClusters == 0x0) { |
336 | fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh()); |
6309cf6e |
337 | for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) { |
338 | fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),i); |
ce3f5e87 |
339 | } |
340 | } |
341 | |
342 | if (fNrawclusters == 0x0) { |
343 | fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()]; |
344 | for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) { |
6309cf6e |
345 | fNrawclusters[i]=0; |
346 | } |
347 | } |
348 | |
349 | for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) { |
350 | sprintf(branchname,"%sRawClusters%d",GetName(),i+1); |
351 | branch = 0x0; |
352 | branch = TreeR()->GetBranch(branchname); |
353 | if (branch) { |
354 | Info("MakeBranch","Branch %s is already in tree.",GetName()); |
355 | return; |
356 | } |
357 | branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize); |
358 | Info("MakeBranch","Making Branch %s for rawcluster in detection plane %d\n",branchname,i+1); |
359 | } |
360 | } |
361 | |
362 | if (TreeR() && cGLT ) { |
363 | // |
364 | // one branch for global trigger |
365 | // |
366 | sprintf(branchname,"%sGlobalTrigger",GetName()); |
367 | branch = 0x0; |
368 | |
369 | if (fGlobalTrigger == 0x0) { |
370 | fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1); |
371 | fNglobaltrigger = 0; |
372 | } |
373 | branch = TreeR()->GetBranch(branchname); |
374 | if (branch) { |
375 | Info("MakeBranch","Branch %s is already in tree.",GetName()); |
376 | return ; |
377 | } |
378 | branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize); |
379 | Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname); |
380 | |
381 | // |
382 | // one branch for local trigger |
383 | // |
384 | sprintf(branchname,"%sLocalTrigger",GetName()); |
385 | branch = 0x0; |
386 | |
387 | if (fLocalTrigger == 0x0) { |
388 | fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234); |
389 | fNlocaltrigger = 0; |
390 | } |
391 | branch = TreeR()->GetBranch(branchname); |
392 | if (branch) { |
393 | Info("MakeBranch","Branch %s is already in tree.",GetName()); |
394 | return; |
395 | } |
396 | branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize); |
397 | Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname); |
398 | } |
399 | |
dcd2690d |
400 | if (TreeT() && cRT ) { |
401 | if (fRecTracks == 0x0) fRecTracks = new TClonesArray("AliMUONTrack",10); |
402 | fNrectracks = 0; |
403 | sprintf(branchname,"%sTrack",GetName()); |
404 | branch = TreeT()->GetBranch(branchname); |
405 | if (branch) { |
406 | Info("MakeBranch","Branch %s is already in tree.",GetName()); |
407 | return ; |
408 | } |
409 | branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize); |
410 | Info("MakeBranch","Making Branch %s for tracks \n",branchname); |
411 | } |
412 | |
413 | if (TreeP() && cRP ) { |
6309cf6e |
414 | Info("MakeBranch","Making Branch for TreeP is not yet ready. \n"); |
415 | } |
416 | } |
417 | |
418 | //____________________________________________________________________________ |
419 | void AliMUONData::ResetDigits() |
420 | { |
421 | // |
422 | // Reset number of digits and the digits array for this detector |
423 | // |
424 | if (fDigits == 0x0) return; |
425 | for ( int i=0;i<AliMUONConstants::NCh();i++ ) { |
426 | if ((*fDigits)[i]) ((TClonesArray*)fDigits->At(i))->Clear(); |
427 | if (fNdigits) fNdigits[i]=0; |
428 | } |
429 | } |
430 | //______________________________________________________________________________ |
431 | void AliMUONData::ResetHits() |
432 | { |
433 | // Reset number of clusters and the cluster array for this detector |
434 | fNhits = 0; |
435 | if (fHits) fHits->Clear(); |
436 | } |
437 | //_______________________________________________________________________________ |
438 | void AliMUONData::ResetRawClusters() |
439 | { |
440 | // Reset number of raw clusters and the raw clust array for this detector |
441 | // |
442 | for ( int i=0;i<AliMUONConstants::NTrackingCh();i++ ) { |
443 | if ((*fRawClusters)[i]) ((TClonesArray*)fRawClusters->At(i))->Clear(); |
444 | if (fNrawclusters) fNrawclusters[i]=0; |
445 | } |
446 | } |
447 | //_______________________________________________________________________________ |
448 | void AliMUONData::ResetTrigger() |
449 | { |
450 | // Reset Local and Global Trigger |
451 | fNglobaltrigger = 0; |
452 | if (fGlobalTrigger) fGlobalTrigger->Clear(); |
453 | fNlocaltrigger = 0; |
454 | if (fLocalTrigger) fLocalTrigger->Clear(); |
455 | } |
dcd2690d |
456 | //____________________________________________________________________________ |
457 | void AliMUONData::ResetRecTracks() |
458 | { |
459 | // Reset tracks information |
460 | fNrectracks = 0; |
461 | if (fRecTracks) fRecTracks->Clear(); |
462 | } |
6309cf6e |
463 | //_____________________________________________________________________________ |
ce3f5e87 |
464 | void AliMUONData::SetTreeAddress(Option_t* option) |
6309cf6e |
465 | { |
ce3f5e87 |
466 | const char *cH = strstr(option,"H"); |
467 | const char *cD = strstr(option,"D"); // Digits branches in TreeD |
468 | const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR |
469 | const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR |
dcd2690d |
470 | const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT |
ce3f5e87 |
471 | //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP |
472 | |
6309cf6e |
473 | // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree. |
474 | char branchname[30]; |
475 | TBranch * branch = 0x0; |
476 | |
477 | // |
478 | // Branch address for hit tree |
ce3f5e87 |
479 | if ( TreeH() && cH ) { |
6309cf6e |
480 | if (fHits == 0x0) fHits = new TClonesArray("AliMUONHit",1000); |
481 | fNhits =0; |
482 | } |
ce3f5e87 |
483 | if (TreeH() && fHits && cH) { |
6309cf6e |
484 | sprintf(branchname,"%sHits",GetName()); |
485 | branch = TreeH()->GetBranch(branchname); |
486 | if (branch) { |
487 | Info("SetTreeAddress","(%s) Setting for Hits",GetName()); |
488 | branch->SetAddress(&fHits); |
489 | } |
490 | else { //can be invoked before branch creation |
491 | Warning("SetTreeAddress","(%s) Failed for Hits. Can not find branch in tree.",GetName()); |
492 | } |
493 | } |
494 | |
495 | // |
496 | // Branch address for digit tree |
ce3f5e87 |
497 | if ( TreeD() && cD) { |
6309cf6e |
498 | if (fDigits == 0x0) { |
499 | fDigits = new TObjArray(AliMUONConstants::NCh()); |
500 | fNdigits= new Int_t[AliMUONConstants::NCh()]; |
501 | for (Int_t i=0; i<AliMUONConstants::NCh() ;i++) { |
502 | fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),i); |
503 | fNdigits[i]=0; |
504 | } |
505 | } |
506 | } |
507 | |
ce3f5e87 |
508 | if (TreeD() && fDigits && cD) { |
6309cf6e |
509 | for (int i=0; i<AliMUONConstants::NCh(); i++) { |
510 | sprintf(branchname,"%sDigits%d",GetName(),i+1); |
511 | branch = TreeD()->GetBranch(branchname); |
1a1cdff8 |
512 | TClonesArray * digits = Digits(i); |
ce3f5e87 |
513 | if (branch) branch->SetAddress( &digits ); |
6309cf6e |
514 | else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i); |
515 | } |
516 | } |
517 | |
518 | // |
519 | // Branch address for rawclusters, globaltrigger and local trigger tree |
520 | if (TreeR() ) { |
ce3f5e87 |
521 | if (fRawClusters == 0x0 && cRC) { |
6309cf6e |
522 | fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh()); |
523 | fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()]; |
524 | for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) { |
525 | fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),i); |
526 | fNrawclusters[i]=0; |
527 | } |
528 | } |
ce3f5e87 |
529 | if (fLocalTrigger == 0x0 && cGLT) { |
6309cf6e |
530 | fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234); |
531 | } |
ce3f5e87 |
532 | if (fGlobalTrigger== 0x0 && cGLT) { |
6309cf6e |
533 | fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1); |
534 | } |
535 | |
536 | } |
ce3f5e87 |
537 | if ( TreeR() && fRawClusters && cRC) { |
6309cf6e |
538 | for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) { |
539 | sprintf(branchname,"%sRawClusters%d",GetName(),i+1); |
540 | if (fRawClusters) { |
541 | branch = TreeR()->GetBranch(branchname); |
542 | if (branch) branch->SetAddress(&((*fRawClusters)[i])); |
543 | else Warning("SetTreeAddress","(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i); |
544 | } |
545 | } |
546 | } |
ce3f5e87 |
547 | if ( TreeR() && fLocalTrigger && cGLT) { |
6309cf6e |
548 | sprintf(branchname,"%sLocalTrigger",GetName()); |
549 | branch = TreeR()->GetBranch(branchname); |
550 | if (branch) branch->SetAddress(&fLocalTrigger); |
551 | else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName()); |
552 | } |
ce3f5e87 |
553 | if ( TreeR() && fGlobalTrigger && cGLT) { |
6309cf6e |
554 | sprintf(branchname,"%sGlobalTrigger",GetName()); |
555 | branch = TreeR()->GetBranch(branchname); |
556 | if (branch) branch->SetAddress(&fGlobalTrigger); |
557 | else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName()); |
558 | } |
dcd2690d |
559 | |
560 | if ( TreeT() && fRecTracks && cRT ) { |
561 | sprintf(branchname,"%sTrack",GetName()); |
562 | branch = TreeT()->GetBranch(branchname); |
563 | if (branch) branch->SetAddress(&fRecTracks); |
564 | else Warning("SetTreeAddress","(%s) Failed for Tracks. Can not find branch in tree.",GetName()); |
565 | } |
6309cf6e |
566 | } |
567 | //_____________________________________________________________________________ |