1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
17 // AliMUONData classes
18 // Class containing MUON data: hits, digits, rawclusters, globaltrigger, localtrigger, etc ..
19 // The classe makes the lik between the MUON data lists and the event trees from loaders
20 // Gines Martinez, Subatech, September 2003
28 #include "AliLoader.h"
29 #include "AliMUONConstants.h"
30 #include "AliMUONData.h"
31 #include "AliMUONDigit.h"
32 #include "AliMUONHit.h"
33 #include "AliMUONLocalTrigger.h"
34 #include "AliMUONGlobalTrigger.h"
35 #include "AliMUONRawCluster.h"
36 #include "AliMUONTrack.h"
37 #include "AliMUONTriggerTrack.h"
40 //_____________________________________________________________________________
41 AliMUONData::AliMUONData():TNamed()
43 // Default constructor
45 fHits = 0x0; // One event in treeH per primary track
46 fDigits = 0x0; // One event in treeH per detection plane
48 fRawClusters = 0x0; //One event in TreeR/RawclusterBranch per tracking detection plane
49 fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch
50 fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch
52 fRecTriggerTracks = 0x0;
56 //_____________________________________________________________________________
57 AliMUONData::AliMUONData(AliLoader * loader, const char* name, const char* title):
60 // Constructor for AliMUONData
62 fHits = 0x0; // One event in treeH per primary track
63 fDigits = 0x0; // One event in treeH per detection plane
65 fRawClusters = 0x0; //One event in TreeR/RawclusterBranch per tracking detection plane
66 fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch
67 fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch
69 fRecTriggerTracks = 0x0;
74 fNrectriggertracks = 0;
76 // fHits = new TClonesArray("AliMUONHit",1000);
78 // fDigits = new TObjArray(AliMUONConstants::NCh());
79 // fNdigits = new Int_t[AliMUONConstants::NCh()];
80 // for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
81 // fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),iDetectionPlane);
82 // fNdigits[iDetectionPlane]=0;
84 // fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
85 // fNrawclusters = new Int_t[AliMUONConstants::NTrackingCh()];
86 // for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NTrackingCh();iDetectionPlane++) {
87 // fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),iDetectionPlane);
88 // fNrawclusters[iDetectionPlane]=0;
90 // fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
91 // fNglobaltrigger =0;
92 // fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
93 // fNlocaltrigger = 0;
94 // fRecTracks = new TClonesArray("AliMUONTrack", 100);
95 // fNrectracks = 0; // really needed or GetEntriesFast sufficient ????
100 //_____________________________________________________________________________
101 AliMUONData::AliMUONData(const AliMUONData& rMUONData):TNamed(rMUONData)
103 // Dummy copy constructor
106 //_____________________________________________________________________________
107 AliMUONData::~AliMUONData()
109 // Destructor for AliMUONData
119 fRawClusters->Delete();
123 fGlobalTrigger->Delete();
124 delete fGlobalTrigger;
127 fLocalTrigger->Delete();
128 delete fLocalTrigger;
131 fRecTracks->Delete();
134 if (fRecTriggerTracks){
135 fRecTriggerTracks->Delete();
136 delete fRecTriggerTracks;
140 //_____________________________________________________________________________
141 void AliMUONData::AddDigit(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits)
144 // Add a MUON digit to the list of Digits of the detection plane id
146 TClonesArray &ldigits = * Digits(id) ;
147 new(ldigits[fNdigits[id]++]) AliMUONDigit(tracks,charges,digits);
149 //_____________________________________________________________________________
150 void AliMUONData::AddDigit(Int_t id, const AliMUONDigit& digit)
153 // Add a MUON digit to the list of Digits of the detection plane id
155 TClonesArray &ldigits = * Digits(id) ;
156 new(ldigits[fNdigits[id]++]) AliMUONDigit(digit);
158 //_____________________________________________________________________________
159 void AliMUONData::AddGlobalTrigger(Int_t *singlePlus, Int_t *singleMinus,
161 Int_t *pairUnlike, Int_t *pairLike)
163 // add a MUON Global Trigger to the list (only one GlobalTrigger per event !)
164 TClonesArray &globalTrigger = *fGlobalTrigger;
165 new(globalTrigger[fNglobaltrigger++])
166 AliMUONGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike);
168 //_____________________________________________________________________________
169 void AliMUONData::AddGlobalTrigger(const AliMUONGlobalTrigger& trigger )
171 // add a MUON Global Trigger to the list (only one GlobalTrigger per event !)
172 TClonesArray &globalTrigger = *fGlobalTrigger;
173 new(globalTrigger[fNglobaltrigger++]) AliMUONGlobalTrigger(trigger);
175 //_____________________________________________________________________________
176 void AliMUONData::AddHit(Int_t fIshunt, Int_t track, Int_t iChamber,
177 Int_t idpart, Float_t X, Float_t Y, Float_t Z,
178 Float_t tof, Float_t momentum, Float_t theta,
179 Float_t phi, Float_t length, Float_t destep)
181 // Add new hit to the hit list
182 TClonesArray &lhits = *fHits;
183 new(lhits[fNhits++]) AliMUONHit(fIshunt, track, iChamber,
185 tof, momentum, theta,
186 phi, length, destep);
188 //____________________________________________________________________________
189 void AliMUONData::AddHit(Int_t fIshunt, Int_t track, Int_t iChamber,
190 Int_t idpart, Float_t X, Float_t Y, Float_t Z,
191 Float_t tof, Float_t momentum, Float_t theta,
192 Float_t phi, Float_t length, Float_t destep,
193 Float_t Xref,Float_t Yref,Float_t Zref)
195 // Add new hit to the hit list
196 TClonesArray &lhits = *fHits;
197 new(lhits[fNhits++]) AliMUONHit(fIshunt, track, iChamber,
199 tof, momentum, theta,
203 //____________________________________________________________________________
204 void AliMUONData::AddHit(const AliMUONHit& hit)
206 TClonesArray &lhits = *fHits;
207 new(lhits[fNhits++]) AliMUONHit(hit);
209 //____________________________________________________________________________
210 void AliMUONData::AddLocalTrigger(Int_t *localtr)
212 // add a MUON Local Trigger to the list
213 TClonesArray &localTrigger = *fLocalTrigger;
214 new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(localtr);
216 //____________________________________________________________________________
217 void AliMUONData::AddLocalTrigger(const AliMUONLocalTrigger& trigger)
219 // add a MUON Local Trigger to the list
220 TClonesArray &localTrigger = *fLocalTrigger;
221 new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(trigger);
223 //_____________________________________________________________________________
224 void AliMUONData::AddRawCluster(Int_t id, const AliMUONRawCluster& c)
227 // Add a MUON rawcluster to the list in the detection plane id
229 TClonesArray &lrawcl = *((TClonesArray*) fRawClusters->At(id));
230 new(lrawcl[fNrawclusters[id]++]) AliMUONRawCluster(c);
232 //_____________________________________________________________________________
233 void AliMUONData::AddRecTrack(const AliMUONTrack& track)
236 // Add a MUON rectrack
238 TClonesArray &lrectracks = *fRecTracks;
239 new(lrectracks[fNrectracks++]) AliMUONTrack(track);
240 // printf("TTTTTT %d ,\n",((AliMUONTrack*)fRecTracks->At(fNrectracks-1))->GetNTrackHits());
242 //_____________________________________________________________________________
243 void AliMUONData::AddRecTriggerTrack(const AliMUONTriggerTrack& triggertrack)
246 // Add a MUON triggerrectrack
248 TClonesArray &lrectriggertracks = *fRecTriggerTracks;
249 new(lrectriggertracks[fNrectriggertracks++]) AliMUONTriggerTrack(triggertrack);
250 // printf("TTTTTT %d ,\n",((AliMUONTrack*)fRecTracks->At(fNrectracks-1))->GetNTrackHits());
253 //____________________________________________________________________________
254 TClonesArray* AliMUONData::Digits(Int_t DetectionPlane)
256 //Getting List of Digits
258 return ( (TClonesArray*) fDigits->At(DetectionPlane) );
262 //____________________________________________________________________________
263 Bool_t AliMUONData::IsRawClusterBranchesInTree()
265 // Checking if there are RawCluster Branches In TreeR
267 Error("TreeR","No treeR in memory");
272 sprintf(branchname,"%sRawClusters1",GetName());
273 TBranch * branch = 0x0;
274 branch = TreeR()->GetBranch(branchname);
275 if (branch) return kTRUE;
279 //____________________________________________________________________________
280 Bool_t AliMUONData::IsTriggerBranchesInTree()
282 // Checking if there are Trigger Branches In TreeR
284 Error("TreeR","No treeR in memory");
289 sprintf(branchname,"%sLocalTrigger",GetName());
290 TBranch * branch = 0x0;
291 branch = TreeR()->GetBranch(branchname);
292 if (branch) return kTRUE;
296 //____________________________________________________________________________
297 Bool_t AliMUONData::IsTrackBranchesInTree()
299 // Checking if there are Track Branches In TreeT
301 Error("TreeT","No treeT in memory");
306 sprintf(branchname,"%sTrack",GetName());
307 TBranch * branch = 0x0;
308 branch = TreeT()->GetBranch(branchname);
309 if (branch) return kTRUE;
313 //____________________________________________________________________________
314 Bool_t AliMUONData::IsTriggerTrackBranchesInTree()
316 // Checking if there are TriggerTrack Branches In TreeT
318 Error("TreeT","No treeT in memory");
323 sprintf(branchname,"%sTriggerTrack",GetName());
324 TBranch * branch = 0x0;
325 branch = TreeT()->GetBranch(branchname);
326 if (branch) return kTRUE;
330 //____________________________________________________________________________
331 void AliMUONData::Fill(Option_t* option)
333 // Method to fill the trees
334 const char *cH = strstr(option,"H");
335 const char *cD = strstr(option,"D"); // Digits branches in TreeD
336 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
337 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR
338 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
339 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
341 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
344 TBranch * branch = 0x0;
348 if ( TreeH() && cH ) {
353 if ( TreeD() && cD) {
358 // filling rawclusters
359 if ( TreeR() && cRC ) {
360 if ( IsTriggerBranchesInTree() ) {
361 // Branch per branch filling
362 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
363 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
364 branch = TreeR()->GetBranch(branchname);
368 else TreeR()->Fill();
373 if ( TreeR() && cGLT) {
374 if (IsRawClusterBranchesInTree()) {
375 // Branch per branch filling
376 sprintf(branchname,"%sLocalTrigger",GetName());
377 branch = TreeR()->GetBranch(branchname);
379 sprintf(branchname,"%sGlobalTrigger",GetName());
380 branch = TreeR()->GetBranch(branchname);
383 else TreeR()->Fill();
387 if ( TreeT() && cRT ) {
388 if (IsTriggerTrackBranchesInTree()) {
389 sprintf(branchname,"%sTrack",GetName());
390 branch = TreeT()->GetBranch(branchname);
393 else TreeT()->Fill();
395 // filling trigger tracks
396 if ( TreeT() && cRL ) {
397 if (IsTrackBranchesInTree()) {
398 sprintf(branchname,"%sTriggerTrack",GetName());
399 branch = TreeT()->GetBranch(branchname);
402 else TreeT()->Fill();
404 // if ( TreeT() && cRL ) {
405 // sprintf(branchname,"%sTrackTrig",GetName());
409 //_____________________________________________________________________________
410 void AliMUONData::MakeBranch(Option_t* option)
413 // Create Tree branches for the MUON.
415 const Int_t kBufferSize = 4000;
419 const char *cH = strstr(option,"H");
420 const char *cD = strstr(option,"D"); // Digits branches in TreeD
421 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
422 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR
423 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
424 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
425 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
427 TBranch * branch = 0x0;
429 // Creating Branches for Hits
433 fHits = new TClonesArray("AliMUONHit",1000);
434 // if (gAlice->GetMCApp())
435 // gAlice->GetMCApp()->AddHitList (fHits);
439 sprintf(branchname,"%sHits",GetName());
440 branch = TreeH()->GetBranch(branchname);
442 Info("MakeBranch","Branch %s is already in tree.",GetName());
445 branch = TreeH()->Branch(branchname,&fHits,kBufferSize);
446 //Info("MakeBranch","Making Branch %s for hits \n",branchname);
449 //Creating Branches for Digits
450 if (TreeD() && cD ) {
451 // one branch for digits per chamber
452 if (fDigits == 0x0) {
453 fDigits = new TObjArray(AliMUONConstants::NCh());
454 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
455 fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),iDetectionPlane);
458 if (fNdigits == 0x0) {
459 fNdigits = new Int_t[AliMUONConstants::NCh()];
460 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
461 fNdigits[iDetectionPlane]=0;
464 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
465 sprintf(branchname,"%sDigits%d",GetName(),iDetectionPlane+1);
467 branch = TreeD()->GetBranch(branchname);
469 Info("MakeBranch","Branch %s is already in tree.",GetName());
472 TClonesArray * digits = Digits(iDetectionPlane);
473 branch = TreeD()->Branch(branchname, &digits, kBufferSize,1);
474 //Info("MakeBranch","Making Branch %s for digits in detection plane %d\n",branchname,iDetectionPlane+1);
478 if (TreeR() && cRC ) {
479 // one branch for raw clusters per tracking detection plane
482 if (fRawClusters == 0x0) {
483 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
484 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
485 fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",1000),i);
489 if (fNrawclusters == 0x0) {
490 fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
491 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
496 for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
497 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
499 branch = TreeR()->GetBranch(branchname);
501 Info("MakeBranch","Branch %s is already in tree.",GetName());
504 branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize);
505 //Info("MakeBranch","Making Branch %s for rawcluster in detection plane %d\n",branchname,i+1);
509 if (TreeR() && cGLT ) {
511 // one branch for global trigger
513 sprintf(branchname,"%sGlobalTrigger",GetName());
516 if (fGlobalTrigger == 0x0) {
517 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger");
520 branch = TreeR()->GetBranch(branchname);
522 Info("MakeBranch","Branch %s is already in tree.",GetName());
525 branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize);
526 //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
529 // one branch for local trigger
531 sprintf(branchname,"%sLocalTrigger",GetName());
534 if (fLocalTrigger == 0x0) {
535 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
538 branch = TreeR()->GetBranch(branchname);
540 Info("MakeBranch","Branch %s is already in tree.",GetName());
543 branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize);
544 //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
547 if (TreeT() && cRT ) {
548 if (fRecTracks == 0x0) fRecTracks = new TClonesArray("AliMUONTrack",100);
550 sprintf(branchname,"%sTrack",GetName());
551 branch = TreeT()->GetBranch(branchname);
553 Info("MakeBranch","Branch %s is already in tree.",GetName());
556 branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize);
557 //Info("MakeBranch","Making Branch %s for tracks \n",branchname);
560 if (TreeT() && cRL ) {
561 if (fRecTriggerTracks == 0x0) fRecTriggerTracks = new TClonesArray("AliMUONTriggerTrack",100);
562 fNrectriggertracks = 0;
563 sprintf(branchname,"%sTriggerTrack",GetName());
564 branch = TreeT()->GetBranch(branchname);
566 Info("MakeBranch","Branch %s is already in tree.",GetName());
569 branch = TreeT()->Branch(branchname,&fRecTriggerTracks,kBufferSize);
570 //Info("MakeBranch","Making Branch %s for trigger tracks \n",branchname);
573 //____________________________________________________________________________
574 TClonesArray* AliMUONData::RawClusters(Int_t DetectionPlane)
576 // Getting Raw Clusters
578 return ( (TClonesArray*) fRawClusters->At(DetectionPlane) );
582 //____________________________________________________________________________
583 TClonesArray* AliMUONData::LocalTrigger()
585 // Getting Local Trigger
587 return ( (TClonesArray*) fLocalTrigger );
591 //____________________________________________________________________________
592 TClonesArray* AliMUONData::GlobalTrigger()
594 // Getting Global Trigger
596 return ( (TClonesArray*) fGlobalTrigger );
600 //____________________________________________________________________________
601 void AliMUONData::ResetDigits()
604 // Reset number of digits and the digits array for this detector
606 if (fDigits == 0x0) return;
607 for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
608 if ((*fDigits)[i]) ((TClonesArray*)fDigits->At(i))->Clear();
609 if (fNdigits) fNdigits[i]=0;
612 //______________________________________________________________________________
613 void AliMUONData::ResetHits()
615 // Reset number of clusters and the cluster array for this detector
617 if (fHits) fHits->Clear();
619 //_______________________________________________________________________________
620 void AliMUONData::ResetRawClusters()
622 // Reset number of raw clusters and the raw clust array for this detector
624 for ( int i=0;i<AliMUONConstants::NTrackingCh();i++ ) {
625 if ((*fRawClusters)[i]) ((TClonesArray*)fRawClusters->At(i))->Clear();
626 if (fNrawclusters) fNrawclusters[i]=0;
629 //_______________________________________________________________________________
630 void AliMUONData::ResetTrigger()
632 // Reset Local and Global Trigger
634 if (fGlobalTrigger) fGlobalTrigger->Clear();
636 if (fLocalTrigger) fLocalTrigger->Clear();
638 //____________________________________________________________________________
639 void AliMUONData::ResetRecTracks()
641 // Reset tracks information
643 if (fRecTracks) fRecTracks->Clear();
645 //____________________________________________________________________________
646 void AliMUONData::ResetRecTriggerTracks()
648 // Reset tracks information
649 fNrectriggertracks = 0;
650 if (fRecTriggerTracks) fRecTriggerTracks->Clear();
652 //_____________________________________________________________________________
653 void AliMUONData::SetTreeAddress(Option_t* option)
655 //Setting Addresses to the events trees
656 const char *cH = strstr(option,"H");
657 const char *cD = strstr(option,"D"); // Digits branches in TreeD
658 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
659 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR
660 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
661 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
662 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
664 // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree.
666 TBranch * branch = 0x0;
669 // Branch address for hit tree
670 if ( TreeH() && cH ) {
672 fHits = new TClonesArray("AliMUONHit",1000);
673 if (gAlice->GetMCApp())
674 gAlice->GetMCApp()->AddHitList (fHits);
678 if (TreeH() && fHits && cH) {
679 sprintf(branchname,"%sHits",GetName());
680 branch = TreeH()->GetBranch(branchname);
682 // Info("SetTreeAddress","(%s) Setting for Hits",GetName());
683 branch->SetAddress(&fHits);
685 else { //can be invoked before branch creation
686 Warning("SetTreeAddress","(%s) Failed for Hits. Can not find branch in tree.",GetName());
691 // Branch address for digit tree
692 if ( TreeD() && cD) {
693 if (fDigits == 0x0) {
694 fDigits = new TObjArray(AliMUONConstants::NCh());
695 fNdigits= new Int_t[AliMUONConstants::NCh()];
696 for (Int_t i=0; i<AliMUONConstants::NCh() ;i++) {
697 fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),i);
703 if (TreeD() && fDigits && cD) {
704 for (int i=0; i<AliMUONConstants::NCh(); i++) {
705 sprintf(branchname,"%sDigits%d",GetName(),i+1);
707 branch = TreeD()->GetBranch(branchname);
708 TClonesArray * digits = Digits(i);
709 if (branch) branch->SetAddress( &digits );
710 else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i);
716 // Branch address for rawclusters, globaltrigger and local trigger tree
718 if (fRawClusters == 0x0 && cRC) {
719 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
720 fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
721 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
722 fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),i);
726 if (fLocalTrigger == 0x0 && cGLT) {
727 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
729 if (fGlobalTrigger== 0x0 && cGLT) {
730 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
734 if ( TreeR() && fRawClusters && cRC) {
735 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
736 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
738 branch = TreeR()->GetBranch(branchname);
739 if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
740 else Warning("SetTreeAddress","(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i);
744 if ( TreeR() && fLocalTrigger && cGLT) {
745 sprintf(branchname,"%sLocalTrigger",GetName());
746 branch = TreeR()->GetBranch(branchname);
747 if (branch) branch->SetAddress(&fLocalTrigger);
748 else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName());
750 if ( TreeR() && fGlobalTrigger && cGLT) {
751 sprintf(branchname,"%sGlobalTrigger",GetName());
752 branch = TreeR()->GetBranch(branchname);
753 if (branch) branch->SetAddress(&fGlobalTrigger);
754 else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName());
758 if (fRecTracks == 0x0 && cRT) {
759 fRecTracks = new TClonesArray("AliMUONTrack",100);
763 if ( TreeT() && fRecTracks && cRT ) {
764 sprintf(branchname,"%sTrack",GetName());
765 branch = TreeT()->GetBranch(branchname);
766 if (branch) branch->SetAddress(&fRecTracks);
767 else Warning("SetTreeAddress","(%s) Failed for Tracks. Can not find branch in tree.",GetName());
771 if (fRecTriggerTracks == 0x0 && cRL) {
772 fRecTriggerTracks = new TClonesArray("AliMUONTriggerTrack",100);
776 if ( TreeT() && fRecTriggerTracks && cRL ) {
777 sprintf(branchname,"%sTriggerTrack",GetName());
778 branch = TreeT()->GetBranch(branchname);
779 if (branch) branch->SetAddress(&fRecTriggerTracks);
780 else Warning("SetTreeAddress","(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName());
785 //_____________________________________________________________________________