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
26 #include "AliLoader.h"
27 #include "AliMUONConstants.h"
28 #include "AliMUONData.h"
29 #include "AliMUONDigit.h"
30 #include "AliMUONHit.h"
31 #include "AliMUONLocalTrigger.h"
32 #include "AliMUONGlobalTrigger.h"
33 #include "AliMUONRawCluster.h"
34 #include "AliMUONTrack.h"
35 #include "AliMUONTriggerTrack.h"
38 //_____________________________________________________________________________
39 AliMUONData::AliMUONData():TNamed()
41 // Default constructor
43 fHits = 0x0; // One event in treeH per primary track
44 fDigits = 0x0; // One event in treeH per detection plane
46 fRawClusters = 0x0; //One event in TreeR/RawclusterBranch per tracking detection plane
47 fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch
48 fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch
50 fRecTriggerTracks = 0x0;
54 //_____________________________________________________________________________
55 AliMUONData::AliMUONData(AliLoader * loader, const char* name, const char* title):
58 // Constructor for AliMUONData
60 fHits = 0x0; // One event in treeH per primary track
61 fDigits = 0x0; // One event in treeH per detection plane
63 fRawClusters = 0x0; //One event in TreeR/RawclusterBranch per tracking detection plane
64 fGlobalTrigger = 0x0; //! List of Global Trigger 1st event in TreeR/GlobalTriggerBranch
65 fLocalTrigger = 0x0; //! List of Local Trigger, 1st event in TreeR/LocalTriggerBranch
67 fRecTriggerTracks = 0x0;
72 fNrectriggertracks = 0;
74 // fHits = new TClonesArray("AliMUONHit",1000);
76 // fDigits = new TObjArray(AliMUONConstants::NCh());
77 // fNdigits = new Int_t[AliMUONConstants::NCh()];
78 // for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
79 // fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),iDetectionPlane);
80 // fNdigits[iDetectionPlane]=0;
82 // fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
83 // fNrawclusters = new Int_t[AliMUONConstants::NTrackingCh()];
84 // for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NTrackingCh();iDetectionPlane++) {
85 // fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),iDetectionPlane);
86 // fNrawclusters[iDetectionPlane]=0;
88 // fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
89 // fNglobaltrigger =0;
90 // fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
91 // fNlocaltrigger = 0;
92 // fRecTracks = new TClonesArray("AliMUONTrack", 100);
93 // fNrectracks = 0; // really needed or GetEntriesFast sufficient ????
98 //_____________________________________________________________________________
99 AliMUONData::AliMUONData(const AliMUONData& rMUONData):TNamed(rMUONData)
101 // Dummy copy constructor
104 //_____________________________________________________________________________
105 AliMUONData::~AliMUONData()
107 // Destructor for AliMUONData
117 fRawClusters->Delete();
121 fGlobalTrigger->Delete();
122 delete fGlobalTrigger;
125 fLocalTrigger->Delete();
126 delete fLocalTrigger;
129 fRecTracks->Delete();
132 if (fRecTriggerTracks){
133 fRecTriggerTracks->Delete();
134 delete fRecTriggerTracks;
138 //_____________________________________________________________________________
139 void AliMUONData::AddDigit(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits)
142 // Add a MUON digit to the list of Digits of the detection plane id
144 TClonesArray &ldigits = * Digits(id) ;
145 new(ldigits[fNdigits[id]++]) AliMUONDigit(tracks,charges,digits);
147 //_____________________________________________________________________________
148 void AliMUONData::AddDigit(Int_t id, const AliMUONDigit& digit)
151 // Add a MUON digit to the list of Digits of the detection plane id
153 TClonesArray &ldigits = * Digits(id) ;
154 new(ldigits[fNdigits[id]++]) AliMUONDigit(digit);
156 //_____________________________________________________________________________
157 void AliMUONData::AddGlobalTrigger(Int_t *singlePlus, Int_t *singleMinus,
159 Int_t *pairUnlike, Int_t *pairLike)
161 // add a MUON Global Trigger to the list (only one GlobalTrigger per event !)
162 TClonesArray &globalTrigger = *fGlobalTrigger;
163 new(globalTrigger[fNglobaltrigger++])
164 AliMUONGlobalTrigger(singlePlus, singleMinus, singleUndef, pairUnlike, pairLike);
166 //_____________________________________________________________________________
167 void AliMUONData::AddGlobalTrigger(const AliMUONGlobalTrigger& trigger )
169 // add a MUON Global Trigger to the list (only one GlobalTrigger per event !)
170 TClonesArray &globalTrigger = *fGlobalTrigger;
171 new(globalTrigger[fNglobaltrigger++]) AliMUONGlobalTrigger(trigger);
173 //_____________________________________________________________________________
174 void AliMUONData::AddHit(Int_t fIshunt, Int_t track, Int_t iChamber,
175 Int_t idpart, Float_t X, Float_t Y, Float_t Z,
176 Float_t tof, Float_t momentum, Float_t theta,
177 Float_t phi, Float_t length, Float_t destep)
179 // Add new hit to the hit list
180 TClonesArray &lhits = *fHits;
181 new(lhits[fNhits++]) AliMUONHit(fIshunt, track, iChamber,
183 tof, momentum, theta,
184 phi, length, destep);
186 //____________________________________________________________________________
187 void AliMUONData::AddHit(Int_t fIshunt, Int_t track, Int_t iChamber,
188 Int_t idpart, Float_t X, Float_t Y, Float_t Z,
189 Float_t tof, Float_t momentum, Float_t theta,
190 Float_t phi, Float_t length, Float_t destep,
191 Float_t Xref,Float_t Yref,Float_t Zref)
193 // Add new hit to the hit list
194 TClonesArray &lhits = *fHits;
195 new(lhits[fNhits++]) AliMUONHit(fIshunt, track, iChamber,
197 tof, momentum, theta,
201 //____________________________________________________________________________
202 void AliMUONData::AddHit(const AliMUONHit& hit)
204 TClonesArray &lhits = *fHits;
205 new(lhits[fNhits++]) AliMUONHit(hit);
207 //____________________________________________________________________________
208 void AliMUONData::AddLocalTrigger(Int_t *localtr)
210 // add a MUON Local Trigger to the list
211 TClonesArray &localTrigger = *fLocalTrigger;
212 new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(localtr);
214 //____________________________________________________________________________
215 void AliMUONData::AddLocalTrigger(const AliMUONLocalTrigger& trigger)
217 // add a MUON Local Trigger to the list
218 TClonesArray &localTrigger = *fLocalTrigger;
219 new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(trigger);
221 //_____________________________________________________________________________
222 void AliMUONData::AddRawCluster(Int_t id, const AliMUONRawCluster& c)
225 // Add a MUON rawcluster to the list in the detection plane id
227 TClonesArray &lrawcl = *((TClonesArray*) fRawClusters->At(id));
228 new(lrawcl[fNrawclusters[id]++]) AliMUONRawCluster(c);
230 //_____________________________________________________________________________
231 void AliMUONData::AddRecTrack(const AliMUONTrack& track)
234 // Add a MUON rectrack
236 TClonesArray &lrectracks = *fRecTracks;
237 new(lrectracks[fNrectracks++]) AliMUONTrack(track);
238 // printf("TTTTTT %d ,\n",((AliMUONTrack*)fRecTracks->At(fNrectracks-1))->GetNTrackHits());
240 //_____________________________________________________________________________
241 void AliMUONData::AddRecTriggerTrack(const AliMUONTriggerTrack& triggertrack)
244 // Add a MUON triggerrectrack
246 TClonesArray &lrectriggertracks = *fRecTriggerTracks;
247 new(lrectriggertracks[fNrectriggertracks++]) AliMUONTriggerTrack(triggertrack);
248 // printf("TTTTTT %d ,\n",((AliMUONTrack*)fRecTracks->At(fNrectracks-1))->GetNTrackHits());
251 //____________________________________________________________________________
252 TClonesArray* AliMUONData::Digits(Int_t DetectionPlane)
254 //Getting List of Digits
256 return ( (TClonesArray*) fDigits->At(DetectionPlane) );
260 //____________________________________________________________________________
261 Bool_t AliMUONData::IsRawClusterBranchesInTree()
263 // Checking if there are RawCluster Branches In TreeR
265 Error("TreeR","No treeR in memory");
270 sprintf(branchname,"%sRawClusters1",GetName());
271 TBranch * branch = 0x0;
272 branch = TreeR()->GetBranch(branchname);
273 if (branch) return kTRUE;
277 //____________________________________________________________________________
278 Bool_t AliMUONData::IsTriggerBranchesInTree()
280 // Checking if there are Trigger Branches In TreeR
282 Error("TreeR","No treeR in memory");
287 sprintf(branchname,"%sLocalTrigger",GetName());
288 TBranch * branch = 0x0;
289 branch = TreeR()->GetBranch(branchname);
290 if (branch) return kTRUE;
294 //____________________________________________________________________________
295 Bool_t AliMUONData::IsTrackBranchesInTree()
297 // Checking if there are Track Branches In TreeT
299 Error("TreeT","No treeT in memory");
304 sprintf(branchname,"%sTrack",GetName());
305 TBranch * branch = 0x0;
306 branch = TreeT()->GetBranch(branchname);
307 if (branch) return kTRUE;
311 //____________________________________________________________________________
312 Bool_t AliMUONData::IsTriggerTrackBranchesInTree()
314 // Checking if there are TriggerTrack Branches In TreeT
316 Error("TreeT","No treeT in memory");
321 sprintf(branchname,"%sTriggerTrack",GetName());
322 TBranch * branch = 0x0;
323 branch = TreeT()->GetBranch(branchname);
324 if (branch) return kTRUE;
328 //____________________________________________________________________________
329 void AliMUONData::Fill(Option_t* option)
331 // Method to fill the trees
332 const char *cH = strstr(option,"H");
333 const char *cD = strstr(option,"D"); // Digits branches in TreeD
334 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
335 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR
336 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
337 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
339 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
342 TBranch * branch = 0x0;
346 if ( TreeH() && cH ) {
351 if ( TreeD() && cD) {
356 // filling rawclusters
357 if ( TreeR() && cRC ) {
358 if ( IsTriggerBranchesInTree() ) {
359 // Branch per branch filling
360 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
361 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
362 branch = TreeR()->GetBranch(branchname);
366 else TreeR()->Fill();
371 if ( TreeR() && cGLT) {
372 if (IsRawClusterBranchesInTree()) {
373 // Branch per branch filling
374 sprintf(branchname,"%sLocalTrigger",GetName());
375 branch = TreeR()->GetBranch(branchname);
377 sprintf(branchname,"%sGlobalTrigger",GetName());
378 branch = TreeR()->GetBranch(branchname);
381 else TreeR()->Fill();
385 if ( TreeT() && cRT ) {
386 if (IsTriggerTrackBranchesInTree()) {
387 sprintf(branchname,"%sTrack",GetName());
388 branch = TreeT()->GetBranch(branchname);
391 else TreeT()->Fill();
393 // filling trigger tracks
394 if ( TreeT() && cRL ) {
395 if (IsTrackBranchesInTree()) {
396 sprintf(branchname,"%sTriggerTrack",GetName());
397 branch = TreeT()->GetBranch(branchname);
400 else TreeT()->Fill();
402 // if ( TreeT() && cRL ) {
403 // sprintf(branchname,"%sTrackTrig",GetName());
407 //_____________________________________________________________________________
408 void AliMUONData::MakeBranch(Option_t* option)
411 // Create Tree branches for the MUON.
413 const Int_t kBufferSize = 4000;
417 const char *cH = strstr(option,"H");
418 const char *cD = strstr(option,"D"); // Digits branches in TreeD
419 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
420 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR
421 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
422 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
423 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
425 TBranch * branch = 0x0;
427 // Creating Branches for Hits
429 if (fHits == 0x0) fHits = new TClonesArray("AliMUONHit",1000);
431 sprintf(branchname,"%sHits",GetName());
432 branch = TreeH()->GetBranch(branchname);
434 Info("MakeBranch","Branch %s is already in tree.",GetName());
437 branch = TreeH()->Branch(branchname,&fHits,kBufferSize);
438 //Info("MakeBranch","Making Branch %s for hits \n",branchname);
441 //Creating Branches for Digits
442 if (TreeD() && cD ) {
443 // one branch for digits per chamber
444 if (fDigits == 0x0) {
445 fDigits = new TObjArray(AliMUONConstants::NCh());
446 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
447 fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),iDetectionPlane);
450 if (fNdigits == 0x0) {
451 fNdigits = new Int_t[AliMUONConstants::NCh()];
452 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
453 fNdigits[iDetectionPlane]=0;
456 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
457 sprintf(branchname,"%sDigits%d",GetName(),iDetectionPlane+1);
459 branch = TreeD()->GetBranch(branchname);
461 Info("MakeBranch","Branch %s is already in tree.",GetName());
464 TClonesArray * digits = Digits(iDetectionPlane);
465 branch = TreeD()->Branch(branchname, &digits, kBufferSize,1);
466 //Info("MakeBranch","Making Branch %s for digits in detection plane %d\n",branchname,iDetectionPlane+1);
470 if (TreeR() && cRC ) {
471 // one branch for raw clusters per tracking detection plane
474 if (fRawClusters == 0x0) {
475 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
476 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
477 fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",1000),i);
481 if (fNrawclusters == 0x0) {
482 fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
483 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
488 for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
489 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
491 branch = TreeR()->GetBranch(branchname);
493 Info("MakeBranch","Branch %s is already in tree.",GetName());
496 branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize);
497 //Info("MakeBranch","Making Branch %s for rawcluster in detection plane %d\n",branchname,i+1);
501 if (TreeR() && cGLT ) {
503 // one branch for global trigger
505 sprintf(branchname,"%sGlobalTrigger",GetName());
508 if (fGlobalTrigger == 0x0) {
509 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger");
512 branch = TreeR()->GetBranch(branchname);
514 Info("MakeBranch","Branch %s is already in tree.",GetName());
517 branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize);
518 //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
521 // one branch for local trigger
523 sprintf(branchname,"%sLocalTrigger",GetName());
526 if (fLocalTrigger == 0x0) {
527 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
530 branch = TreeR()->GetBranch(branchname);
532 Info("MakeBranch","Branch %s is already in tree.",GetName());
535 branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize);
536 //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
539 if (TreeT() && cRT ) {
540 if (fRecTracks == 0x0) fRecTracks = new TClonesArray("AliMUONTrack",100);
542 sprintf(branchname,"%sTrack",GetName());
543 branch = TreeT()->GetBranch(branchname);
545 Info("MakeBranch","Branch %s is already in tree.",GetName());
548 branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize);
549 //Info("MakeBranch","Making Branch %s for tracks \n",branchname);
552 if (TreeT() && cRL ) {
553 if (fRecTriggerTracks == 0x0) fRecTriggerTracks = new TClonesArray("AliMUONTriggerTrack",100);
554 fNrectriggertracks = 0;
555 sprintf(branchname,"%sTriggerTrack",GetName());
556 branch = TreeT()->GetBranch(branchname);
558 Info("MakeBranch","Branch %s is already in tree.",GetName());
561 branch = TreeT()->Branch(branchname,&fRecTriggerTracks,kBufferSize);
562 //Info("MakeBranch","Making Branch %s for trigger tracks \n",branchname);
565 //____________________________________________________________________________
566 TClonesArray* AliMUONData::RawClusters(Int_t DetectionPlane)
568 // Getting Raw Clusters
570 return ( (TClonesArray*) fRawClusters->At(DetectionPlane) );
574 //____________________________________________________________________________
575 TClonesArray* AliMUONData::LocalTrigger()
577 // Getting Local Trigger
579 return ( (TClonesArray*) fLocalTrigger );
583 //____________________________________________________________________________
584 TClonesArray* AliMUONData::GlobalTrigger()
586 // Getting Global Trigger
588 return ( (TClonesArray*) fGlobalTrigger );
592 //____________________________________________________________________________
593 void AliMUONData::ResetDigits()
596 // Reset number of digits and the digits array for this detector
598 if (fDigits == 0x0) return;
599 for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
600 if ((*fDigits)[i]) ((TClonesArray*)fDigits->At(i))->Clear();
601 if (fNdigits) fNdigits[i]=0;
604 //______________________________________________________________________________
605 void AliMUONData::ResetHits()
607 // Reset number of clusters and the cluster array for this detector
609 if (fHits) fHits->Clear();
611 //_______________________________________________________________________________
612 void AliMUONData::ResetRawClusters()
614 // Reset number of raw clusters and the raw clust array for this detector
616 for ( int i=0;i<AliMUONConstants::NTrackingCh();i++ ) {
617 if ((*fRawClusters)[i]) ((TClonesArray*)fRawClusters->At(i))->Clear();
618 if (fNrawclusters) fNrawclusters[i]=0;
621 //_______________________________________________________________________________
622 void AliMUONData::ResetTrigger()
624 // Reset Local and Global Trigger
626 if (fGlobalTrigger) fGlobalTrigger->Clear();
628 if (fLocalTrigger) fLocalTrigger->Clear();
630 //____________________________________________________________________________
631 void AliMUONData::ResetRecTracks()
633 // Reset tracks information
635 if (fRecTracks) fRecTracks->Clear();
637 //____________________________________________________________________________
638 void AliMUONData::ResetRecTriggerTracks()
640 // Reset tracks information
641 fNrectriggertracks = 0;
642 if (fRecTriggerTracks) fRecTriggerTracks->Clear();
644 //_____________________________________________________________________________
645 void AliMUONData::SetTreeAddress(Option_t* option)
647 //Setting Addresses to the events trees
648 const char *cH = strstr(option,"H");
649 const char *cD = strstr(option,"D"); // Digits branches in TreeD
650 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
651 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeR
652 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
653 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
654 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
656 // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree.
658 TBranch * branch = 0x0;
661 // Branch address for hit tree
662 if ( TreeH() && cH ) {
663 if (fHits == 0x0) fHits = new TClonesArray("AliMUONHit",1000);
666 if (TreeH() && fHits && cH) {
667 sprintf(branchname,"%sHits",GetName());
668 branch = TreeH()->GetBranch(branchname);
670 // Info("SetTreeAddress","(%s) Setting for Hits",GetName());
671 branch->SetAddress(&fHits);
673 else { //can be invoked before branch creation
674 Warning("SetTreeAddress","(%s) Failed for Hits. Can not find branch in tree.",GetName());
679 // Branch address for digit tree
680 if ( TreeD() && cD) {
681 if (fDigits == 0x0) {
682 fDigits = new TObjArray(AliMUONConstants::NCh());
683 fNdigits= new Int_t[AliMUONConstants::NCh()];
684 for (Int_t i=0; i<AliMUONConstants::NCh() ;i++) {
685 fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),i);
691 if (TreeD() && fDigits && cD) {
692 for (int i=0; i<AliMUONConstants::NCh(); i++) {
693 sprintf(branchname,"%sDigits%d",GetName(),i+1);
695 branch = TreeD()->GetBranch(branchname);
696 TClonesArray * digits = Digits(i);
697 if (branch) branch->SetAddress( &digits );
698 else Warning("SetTreeAddress","(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i);
704 // Branch address for rawclusters, globaltrigger and local trigger tree
706 if (fRawClusters == 0x0 && cRC) {
707 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
708 fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
709 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
710 fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),i);
714 if (fLocalTrigger == 0x0 && cGLT) {
715 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
717 if (fGlobalTrigger== 0x0 && cGLT) {
718 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
722 if ( TreeR() && fRawClusters && cRC) {
723 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
724 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
726 branch = TreeR()->GetBranch(branchname);
727 if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
728 else Warning("SetTreeAddress","(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i);
732 if ( TreeR() && fLocalTrigger && cGLT) {
733 sprintf(branchname,"%sLocalTrigger",GetName());
734 branch = TreeR()->GetBranch(branchname);
735 if (branch) branch->SetAddress(&fLocalTrigger);
736 else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName());
738 if ( TreeR() && fGlobalTrigger && cGLT) {
739 sprintf(branchname,"%sGlobalTrigger",GetName());
740 branch = TreeR()->GetBranch(branchname);
741 if (branch) branch->SetAddress(&fGlobalTrigger);
742 else Warning("SetTreeAddress","(%s) Failed for LocalTrigger. Can not find branch in tree.",GetName());
746 if (fRecTracks == 0x0 && cRT) {
747 fRecTracks = new TClonesArray("AliMUONTrack",100);
751 if ( TreeT() && fRecTracks && cRT ) {
752 sprintf(branchname,"%sTrack",GetName());
753 branch = TreeT()->GetBranch(branchname);
754 if (branch) branch->SetAddress(&fRecTracks);
755 else Warning("SetTreeAddress","(%s) Failed for Tracks. Can not find branch in tree.",GetName());
759 if (fRecTriggerTracks == 0x0 && cRL) {
760 fRecTriggerTracks = new TClonesArray("AliMUONTriggerTrack",100);
764 if ( TreeT() && fRecTriggerTracks && cRL ) {
765 sprintf(branchname,"%sTriggerTrack",GetName());
766 branch = TreeT()->GetBranch(branchname);
767 if (branch) branch->SetAddress(&fRecTriggerTracks);
768 else Warning("SetTreeAddress","(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName());
773 //_____________________________________________________________________________