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