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
183 TClonesArray &lhits = *fHits;
184 new(lhits[fNhits++]) AliMUONHit(fIshunt, track, iChamber,
186 tof, momentum, theta,
187 phi, length, destep);
189 //____________________________________________________________________________
190 void AliMUONData::AddHit(Int_t fIshunt, Int_t track, Int_t iChamber,
191 Int_t idpart, Float_t X, Float_t Y, Float_t Z,
192 Float_t tof, Float_t momentum, Float_t theta,
193 Float_t phi, Float_t length, Float_t destep,
194 Float_t Xref,Float_t Yref,Float_t Zref)
196 // Add new hit to the hit list
197 TClonesArray &lhits = *fHits;
198 new(lhits[fNhits++]) AliMUONHit(fIshunt, track, iChamber,
200 tof, momentum, theta,
204 //____________________________________________________________________________
205 void AliMUONData::AddHit(const AliMUONHit& hit)
207 TClonesArray &lhits = *fHits;
208 new(lhits[fNhits++]) AliMUONHit(hit);
210 //____________________________________________________________________________
211 void AliMUONData::AddLocalTrigger(Int_t *localtr)
213 // add a MUON Local Trigger to the list
214 TClonesArray &localTrigger = *fLocalTrigger;
215 new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(localtr);
217 //____________________________________________________________________________
218 void AliMUONData::AddLocalTrigger(const AliMUONLocalTrigger& trigger)
220 // add a MUON Local Trigger to the list
221 TClonesArray &localTrigger = *fLocalTrigger;
222 new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(trigger);
224 //_____________________________________________________________________________
225 void AliMUONData::AddRawCluster(Int_t id, const AliMUONRawCluster& c)
228 // Add a MUON rawcluster to the list in the detection plane id
230 TClonesArray &lrawcl = *((TClonesArray*) fRawClusters->At(id));
231 new(lrawcl[fNrawclusters[id]++]) AliMUONRawCluster(c);
233 //_____________________________________________________________________________
234 void AliMUONData::AddRecTrack(const AliMUONTrack& track)
237 // Add a MUON rectrack
239 TClonesArray &lrectracks = *fRecTracks;
240 new(lrectracks[fNrectracks++]) AliMUONTrack(track);
241 // printf("TTTTTT %d ,\n",((AliMUONTrack*)fRecTracks->At(fNrectracks-1))->GetNTrackHits());
243 //_____________________________________________________________________________
244 void AliMUONData::AddRecTriggerTrack(const AliMUONTriggerTrack& triggertrack)
247 // Add a MUON triggerrectrack
249 TClonesArray &lrectriggertracks = *fRecTriggerTracks;
250 new(lrectriggertracks[fNrectriggertracks++]) AliMUONTriggerTrack(triggertrack);
251 // printf("TTTTTT %d ,\n",((AliMUONTrack*)fRecTracks->At(fNrectracks-1))->GetNTrackHits());
254 //____________________________________________________________________________
255 TClonesArray* AliMUONData::Digits(Int_t DetectionPlane)
257 //Getting List of Digits
259 return ( (TClonesArray*) fDigits->At(DetectionPlane) );
263 //____________________________________________________________________________
264 Bool_t AliMUONData::IsRawClusterBranchesInTree()
266 // Checking if there are RawCluster Branches In TreeR
268 Error("TreeR","No treeR in memory");
273 sprintf(branchname,"%sRawClusters1",GetName());
274 TBranch * branch = 0x0;
275 branch = TreeR()->GetBranch(branchname);
276 if (branch) return kTRUE;
280 //____________________________________________________________________________
281 Bool_t AliMUONData::IsTriggerBranchesInTree()
283 // Checking if there are Trigger Branches In TreeR
285 Error("TreeR","No treeR in memory");
290 sprintf(branchname,"%sLocalTrigger",GetName());
291 TBranch * branch = 0x0;
292 branch = TreeR()->GetBranch(branchname);
293 if (branch) return kTRUE;
297 //____________________________________________________________________________
298 Bool_t AliMUONData::IsTrackBranchesInTree()
300 // Checking if there are Track Branches In TreeT
302 Error("TreeT","No treeT in memory");
307 sprintf(branchname,"%sTrack",GetName());
308 TBranch * branch = 0x0;
309 branch = TreeT()->GetBranch(branchname);
310 if (branch) return kTRUE;
314 //____________________________________________________________________________
315 Bool_t AliMUONData::IsTriggerTrackBranchesInTree()
317 // Checking if there are TriggerTrack Branches In TreeT
319 Error("TreeT","No treeT in memory");
324 sprintf(branchname,"%sTriggerTrack",GetName());
325 TBranch * branch = 0x0;
326 branch = TreeT()->GetBranch(branchname);
327 if (branch) return kTRUE;
331 //____________________________________________________________________________
332 void AliMUONData::Fill(Option_t* option)
334 // Method to fill the trees
335 const char *cH = strstr(option,"H");
336 const char *cD = strstr(option,"D"); // Digits branches in TreeD
337 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
338 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR
339 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
340 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
342 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
345 TBranch * branch = 0x0;
349 if ( TreeH() && cH ) {
354 if ( TreeD() && cD) {
359 // filling rawclusters
360 if ( TreeR() && cRC ) {
361 if ( IsTriggerBranchesInTree() ) {
362 // Branch per branch filling
363 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
364 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
365 branch = TreeR()->GetBranch(branchname);
369 else TreeR()->Fill();
374 if ( TreeR() && cGLT) {
375 if (IsRawClusterBranchesInTree()) {
376 // Branch per branch filling
377 sprintf(branchname,"%sLocalTrigger",GetName());
378 branch = TreeR()->GetBranch(branchname);
380 sprintf(branchname,"%sGlobalTrigger",GetName());
381 branch = TreeR()->GetBranch(branchname);
384 else TreeR()->Fill();
388 if ( TreeT() && cRT ) {
389 if (IsTriggerTrackBranchesInTree()) {
390 sprintf(branchname,"%sTrack",GetName());
391 branch = TreeT()->GetBranch(branchname);
394 else TreeT()->Fill();
396 // filling trigger tracks
397 if ( TreeT() && cRL ) {
398 if (IsTrackBranchesInTree()) {
399 sprintf(branchname,"%sTriggerTrack",GetName());
400 branch = TreeT()->GetBranch(branchname);
403 else TreeT()->Fill();
405 // if ( TreeT() && cRL ) {
406 // sprintf(branchname,"%sTrackTrig",GetName());
410 //_____________________________________________________________________________
411 void AliMUONData::MakeBranch(Option_t* option)
414 // Create Tree branches for the MUON.
416 const Int_t kBufferSize = 4000;
420 const char *cH = strstr(option,"H");
421 const char *cD = strstr(option,"D"); // Digits branches in TreeD
422 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
423 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR
424 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
425 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
426 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
428 TBranch * branch = 0x0;
430 // Creating Branches for Hits
434 fHits = new TClonesArray("AliMUONHit",1000);
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 ) {
671 if (fHits == 0x0) fHits = new TClonesArray("AliMUONHit",1000);
674 if (TreeH() && fHits && cH) {
675 sprintf(branchname,"%sHits",GetName());
676 branch = TreeH()->GetBranch(branchname);
678 // Info("SetTreeAddress","(%s) Setting for Hits",GetName());
679 branch->SetAddress(&fHits);
681 else { //can be invoked before branch creation
682 Warning("SetTreeAddress","(%s) Failed for Hits. Can not find branch in tree.",GetName());
687 // Branch address for digit tree
688 if ( TreeD() && cD) {
689 if (fDigits == 0x0) {
690 fDigits = new TObjArray(AliMUONConstants::NCh());
691 fNdigits= new Int_t[AliMUONConstants::NCh()];
692 for (Int_t i=0; i<AliMUONConstants::NCh() ;i++) {
693 fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),i);
699 if (TreeD() && fDigits && cD) {
700 for (int i=0; i<AliMUONConstants::NCh(); i++) {
701 sprintf(branchname,"%sDigits%d",GetName(),i+1);
703 branch = TreeD()->GetBranch(branchname);
704 TClonesArray * digits = Digits(i);
705 if (branch) branch->SetAddress( &digits );
706 else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i);
712 // Branch address for rawclusters, globaltrigger and local trigger tree
714 if (fRawClusters == 0x0 && cRC) {
715 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
716 fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
717 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
718 fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),i);
722 if (fLocalTrigger == 0x0 && cGLT) {
723 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
725 if (fGlobalTrigger== 0x0 && cGLT) {
726 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
730 if ( TreeR() && fRawClusters && cRC) {
731 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
732 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
734 branch = TreeR()->GetBranch(branchname);
735 if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
736 else Warning("SetTreeAddress","(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i);
740 if ( TreeR() && fLocalTrigger && cGLT) {
741 sprintf(branchname,"%sLocalTrigger",GetName());
742 branch = TreeR()->GetBranch(branchname);
743 if (branch) branch->SetAddress(&fLocalTrigger);
744 else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName());
746 if ( TreeR() && fGlobalTrigger && cGLT) {
747 sprintf(branchname,"%sGlobalTrigger",GetName());
748 branch = TreeR()->GetBranch(branchname);
749 if (branch) branch->SetAddress(&fGlobalTrigger);
750 else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName());
754 if (fRecTracks == 0x0 && cRT) {
755 fRecTracks = new TClonesArray("AliMUONTrack",100);
759 if ( TreeT() && fRecTracks && cRT ) {
760 sprintf(branchname,"%sTrack",GetName());
761 branch = TreeT()->GetBranch(branchname);
762 if (branch) branch->SetAddress(&fRecTracks);
763 else Warning("SetTreeAddress","(%s) Failed for Tracks. Can not find branch in tree.",GetName());
767 if (fRecTriggerTracks == 0x0 && cRL) {
768 fRecTriggerTracks = new TClonesArray("AliMUONTriggerTrack",100);
772 if ( TreeT() && fRecTriggerTracks && cRL ) {
773 sprintf(branchname,"%sTriggerTrack",GetName());
774 branch = TreeT()->GetBranch(branchname);
775 if (branch) branch->SetAddress(&fRecTriggerTracks);
776 else Warning("SetTreeAddress","(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName());
781 //_____________________________________________________________________________