Removing warning if MUON hit branch is not present as required by Federico (Gines)
[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$ */
f0945e46 17
18/// AliMUONData class
19///
20/// Class containing MUON data: hits, digits, rawclusters, globaltrigger, localtrigger, etc ..
21/// The classe makes the lik between the MUON data lists and the event trees from loaders
22///
23/// Gines Martinez, Subatech, September 2003
24///
9140dcef 25
6309cf6e 26#include "AliMUONData.h"
c82862d3 27
28#include "AliLog.h"
29#include "AliMUONConstants.h"
47dc4ee7 30#include "AliMUONHit.h"
6309cf6e 31#include "AliMUONDigit.h"
c82862d3 32#include "AliMUONGlobalTrigger.h"
6309cf6e 33#include "AliMUONLocalTrigger.h"
47dc4ee7 34#include "AliMUONRegionalTrigger.h"
6309cf6e 35#include "AliMUONRawCluster.h"
dcd2690d 36#include "AliMUONTrack.h"
276c44b7 37#include "AliMUONTriggerTrack.h"
f0945e46 38#include "AliRunLoader.h"
39#include "TArrayI.h"
c82862d3 40#include "TString.h"
30178c30 41
5398f946 42/// \cond CLASSIMP
6309cf6e 43ClassImp(AliMUONData)
5398f946 44/// \endcond
6309cf6e 45
46//_____________________________________________________________________________
1017e5bf 47 AliMUONData::AliMUONData():
48 TNamed(),
49 fLoader(0x0),
50 fHits(0x0),
51 fDigits(0x0),
52 fSDigits(0x0),
53 fRawClusters(0x0),
54 fGlobalTrigger(0x0),
55 fLocalTrigger(0x0),
47dc4ee7 56 fRegionalTrigger(0x0),
1017e5bf 57 fRecTracks(0x0),
58 fRecTriggerTracks(0x0),
59 fNhits(0),
60 fNdigits(0x0),
61 fNSdigits(0x0),
62 fNrawclusters(0x0),
63 fNglobaltrigger(0),
64 fNlocaltrigger(0),
47dc4ee7 65 fNregionaltrigger(0),
1017e5bf 66 fNrectracks(0),
67 fNrectriggertracks(0),
f0945e46 68 fSplitLevel(0),
69 fCurrentEvent(-1)
6309cf6e 70{
9140dcef 71 // Default constructor
6309cf6e 72}
73//_____________________________________________________________________________
74AliMUONData::AliMUONData(AliLoader * loader, const char* name, const char* title):
1017e5bf 75 TNamed(name,title),
76 fLoader(loader),
77 fHits(0x0),
78 fDigits(0x0),
79 fSDigits(0x0),
80 fRawClusters(0x0),
81 fGlobalTrigger(0x0),
82 fLocalTrigger(0x0),
47dc4ee7 83 fRegionalTrigger(0x0),
1017e5bf 84 fRecTracks(0x0),
85 fRecTriggerTracks(0x0),
86 fNhits(0),
87 fNdigits(0x0),
88 fNSdigits(0x0),
89 fNrawclusters(0x0),
90 fNglobaltrigger(0),
91 fNlocaltrigger(0),
47dc4ee7 92 fNregionaltrigger(0),
1017e5bf 93 fNrectracks(0),
94 fNrectriggertracks(0),
f0945e46 95 fSplitLevel(0),
96 fCurrentEvent(-1)
6309cf6e 97{
5398f946 98/// Standard constructor
6309cf6e 99}
e3ea1889 100
6309cf6e 101//_____________________________________________________________________________
102AliMUONData::~AliMUONData()
103{
5398f946 104/// Destructor for AliMUONData
6309cf6e 105 if (fHits) {
106 fHits->Delete();
107 delete fHits;
108 }
c82862d3 109
6309cf6e 110 if (fDigits) {
111 fDigits->Delete();
112 delete fDigits;
113 }
d1775029 114 if (fSDigits) {
115 fSDigits->Delete();
116 delete fSDigits;
117 }
6309cf6e 118 if (fRawClusters) {
119 fRawClusters->Delete();
120 delete fRawClusters;
121 }
122 if (fGlobalTrigger){
123 fGlobalTrigger->Delete();
124 delete fGlobalTrigger;
125 }
47dc4ee7 126 if (fRegionalTrigger){
127 fRegionalTrigger->Delete();
128 delete fRegionalTrigger;
129 }
6309cf6e 130 if (fLocalTrigger){
131 fLocalTrigger->Delete();
132 delete fLocalTrigger;
133 }
dcd2690d 134 if (fRecTracks){
135 fRecTracks->Delete();
136 delete fRecTracks;
137 }
276c44b7 138 if (fRecTriggerTracks){
139 fRecTriggerTracks->Delete();
140 delete fRecTriggerTracks;
141 }
6309cf6e 142}
47dc4ee7 143//____________________________________________________________________________
f1348c21 144void AliMUONData::AddHit(Int_t fIshunt, Int_t track, Int_t detElemId,
47dc4ee7 145 Int_t idpart, Float_t X, Float_t Y, Float_t Z,
146 Float_t tof, Float_t momentum, Float_t theta,
147 Float_t phi, Float_t length, Float_t destep,
148 Float_t Xref,Float_t Yref,Float_t Zref)
149{
150 // Add new hit to the hit list
e3ea1889 151
47dc4ee7 152 TClonesArray &lhits = *fHits;
153 new(lhits[fNhits++]) AliMUONHit(fIshunt, track, detElemId,
154 idpart, X, Y, Z,
155 tof, momentum, theta,
156 phi, length, destep,
f1348c21 157 Xref,Yref,Zref);
47dc4ee7 158}
6309cf6e 159//_____________________________________________________________________________
160void AliMUONData::AddDigit(Int_t id, Int_t *tracks, Int_t *charges, Int_t *digits)
161{
5398f946 162/// Add a MUON digit to the list of Digits of the detection plane id
163
1a1cdff8 164 TClonesArray &ldigits = * Digits(id) ;
6309cf6e 165 new(ldigits[fNdigits[id]++]) AliMUONDigit(tracks,charges,digits);
166}
167//_____________________________________________________________________________
61adb9bd 168void AliMUONData::AddDigit(Int_t id, const AliMUONDigit& digit)
169{
5398f946 170/// Add a MUON digit to the list of Digits of the detection plane id
171
61adb9bd 172 TClonesArray &ldigits = * Digits(id) ;
173 new(ldigits[fNdigits[id]++]) AliMUONDigit(digit);
174}
175//_____________________________________________________________________________
30178c30 176void AliMUONData::AddSDigit(Int_t id, Int_t *tracks, Int_t *charges, Int_t *sdigits)
d1775029 177{
5398f946 178/// Add a MUON Sdigit to the list of SDigits of the detection plane id
179
d1775029 180 TClonesArray &lSdigits = * SDigits(id) ;
30178c30 181 new(lSdigits[fNSdigits[id]++]) AliMUONDigit(tracks,charges,sdigits);
d1775029 182}
183//_____________________________________________________________________________
184void AliMUONData::AddSDigit(Int_t id, const AliMUONDigit& Sdigit)
185{
5398f946 186/// Add a MUON Sdigit to the list of SDigits of the detection plane id
187
d1775029 188 TClonesArray &lSdigits = * SDigits(id) ;
189 new(lSdigits[fNSdigits[id]++]) AliMUONDigit(Sdigit);
190}
2cf44ef3 191
6309cf6e 192//_____________________________________________________________________________
61adb9bd 193void AliMUONData::AddGlobalTrigger(const AliMUONGlobalTrigger& trigger )
194{
5398f946 195/// Add a MUON Global Trigger to the list (only one GlobalTrigger per event !);
196
61adb9bd 197 TClonesArray &globalTrigger = *fGlobalTrigger;
198 new(globalTrigger[fNglobaltrigger++]) AliMUONGlobalTrigger(trigger);
199}
5398f946 200
6309cf6e 201//____________________________________________________________________________
47dc4ee7 202void AliMUONData::AddRegionalTrigger(const AliMUONRegionalTrigger& trigger)
1391e633 203{
47dc4ee7 204/// add a MUON regional Trigger to the list
205 TClonesArray &regionalTrigger = *fRegionalTrigger;
206 new(regionalTrigger[fNregionaltrigger++]) AliMUONRegionalTrigger(trigger);
61adb9bd 207}
208//____________________________________________________________________________
61adb9bd 209void AliMUONData::AddLocalTrigger(const AliMUONLocalTrigger& trigger)
210{
5398f946 211/// add a MUON Local Trigger to the list
212
61adb9bd 213 TClonesArray &localTrigger = *fLocalTrigger;
214 new(localTrigger[fNlocaltrigger++]) AliMUONLocalTrigger(trigger);
215}
47dc4ee7 216
6309cf6e 217//_____________________________________________________________________________
218void AliMUONData::AddRawCluster(Int_t id, const AliMUONRawCluster& c)
219{
5398f946 220/// Add a MUON rawcluster to the list in the detection plane id
221
6309cf6e 222 TClonesArray &lrawcl = *((TClonesArray*) fRawClusters->At(id));
223 new(lrawcl[fNrawclusters[id]++]) AliMUONRawCluster(c);
224}
dcd2690d 225//_____________________________________________________________________________
226void AliMUONData::AddRecTrack(const AliMUONTrack& track)
227{
5398f946 228/// Add a MUON rectrack
229
dcd2690d 230 TClonesArray &lrectracks = *fRecTracks;
231 new(lrectracks[fNrectracks++]) AliMUONTrack(track);
232}
276c44b7 233//_____________________________________________________________________________
234void AliMUONData::AddRecTriggerTrack(const AliMUONTriggerTrack& triggertrack)
235{
5398f946 236/// Add a MUON triggerrectrack
237
276c44b7 238 TClonesArray &lrectriggertracks = *fRecTriggerTracks;
239 new(lrectriggertracks[fNrectriggertracks++]) AliMUONTriggerTrack(triggertrack);
276c44b7 240}
ce3f5e87 241//____________________________________________________________________________
c82862d3 242TClonesArray* AliMUONData::Digits(Int_t DetectionPlane) const
1eccde20 243{
5398f946 244/// Getting List of Digits
245
1eccde20 246 if (fDigits)
247 return ( (TClonesArray*) fDigits->At(DetectionPlane) );
248 else
249 return NULL;
250}
251//____________________________________________________________________________
c82862d3 252TClonesArray* AliMUONData::SDigits(Int_t DetectionPlane) const
d1775029 253{
5398f946 254/// Getting List of SDigits
255
d1775029 256 if (fSDigits)
257 return ( (TClonesArray*) fSDigits->At(DetectionPlane) );
258 else
259 return NULL;
260}
261//____________________________________________________________________________
c1d45bdf 262Bool_t AliMUONData::IsRawClusterBranchesInTree()
263{
5398f946 264/// Checking if there are RawCluster Branches In TreeR
265
c1d45bdf 266 if (TreeR()==0x0) {
8c343c7c 267 AliError("No treeR in memory");
c1d45bdf 268 return kFALSE;
269 }
270 else {
271 char branchname[30];
272 sprintf(branchname,"%sRawClusters1",GetName());
273 TBranch * branch = 0x0;
274 branch = TreeR()->GetBranch(branchname);
275 if (branch) return kTRUE;
276 else return kFALSE;
277 }
278}
279//____________________________________________________________________________
ce3e25a8 280Bool_t AliMUONData::IsDigitsBranchesInTree()
281{
5398f946 282/// Checking if there are RawCluster Branches In TreeR
283
ce3e25a8 284 if (TreeD()==0x0) {
8c343c7c 285 AliError("No treeD in memory");
ce3e25a8 286 return kFALSE;
287 }
288 else {
289 char branchname[30];
290 sprintf(branchname,"%sDigits1",GetName());
291 TBranch * branch = 0x0;
292 branch = TreeD()->GetBranch(branchname);
293 if (branch) return kTRUE;
294 else return kFALSE;
295 }
296}
297//____________________________________________________________________________
c1d45bdf 298Bool_t AliMUONData::IsTriggerBranchesInTree()
299{
5398f946 300/// Checking if there are Trigger Branches In TreeR
c1d45bdf 301 if (TreeR()==0x0) {
8c343c7c 302 AliError("No treeR in memory");
c1d45bdf 303 return kFALSE;
304 }
305 else {
306 char branchname[30];
307 sprintf(branchname,"%sLocalTrigger",GetName());
308 TBranch * branch = 0x0;
309 branch = TreeR()->GetBranch(branchname);
310 if (branch) return kTRUE;
311 else return kFALSE;
312 }
313}
ce3e25a8 314//____________________________________________________________________________
315Bool_t AliMUONData::IsTriggerBranchesInTreeD()
316{
5398f946 317/// Checking if there are Trigger Branches In TreeR
ce3e25a8 318 if (TreeD()==0x0) {
8c343c7c 319 AliError("No treeD in memory");
ce3e25a8 320 return kFALSE;
321 }
322 else {
323 char branchname[30];
324 sprintf(branchname,"%sLocalTrigger",GetName());
325 TBranch * branch = 0x0;
326 branch = TreeD()->GetBranch(branchname);
327 if (branch) return kTRUE;
328 else return kFALSE;
329 }
330}
331
c1d45bdf 332//____________________________________________________________________________
276c44b7 333Bool_t AliMUONData::IsTrackBranchesInTree()
334{
5398f946 335/// Checking if there are Track Branches In TreeT
276c44b7 336 if (TreeT()==0x0) {
8c343c7c 337 AliError("No treeT in memory");
276c44b7 338 return kFALSE;
339 }
340 else {
341 char branchname[30];
342 sprintf(branchname,"%sTrack",GetName());
343 TBranch * branch = 0x0;
344 branch = TreeT()->GetBranch(branchname);
345 if (branch) return kTRUE;
346 else return kFALSE;
347 }
348}
349//____________________________________________________________________________
350Bool_t AliMUONData::IsTriggerTrackBranchesInTree()
351{
5398f946 352/// Checking if there are TriggerTrack Branches In TreeT
276c44b7 353 if (TreeT()==0x0) {
8c343c7c 354 AliError("No treeT in memory");
276c44b7 355 return kFALSE;
356 }
357 else {
358 char branchname[30];
359 sprintf(branchname,"%sTriggerTrack",GetName());
360 TBranch * branch = 0x0;
361 branch = TreeT()->GetBranch(branchname);
362 if (branch) return kTRUE;
363 else return kFALSE;
364 }
365}
366//____________________________________________________________________________
1a1cdff8 367void AliMUONData::Fill(Option_t* option)
368{
5398f946 369/// Method to fill the trees
1a1cdff8 370 const char *cH = strstr(option,"H");
371 const char *cD = strstr(option,"D"); // Digits branches in TreeD
d1775029 372 const char *cS = strstr(option,"S"); // SDigits branches in TreeS
1a1cdff8 373 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
ce3e25a8 374 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeD
375 const char *cTC = strstr(option,"TC"); // global and local Trigger branches Copy in TreeR
1a1cdff8 376 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
ce3e25a8 377 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
61adb9bd 378
1a1cdff8 379 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
380
381 char branchname[30];
382 TBranch * branch = 0x0;
383
1a1cdff8 384 // Filling TreeH
f0945e46 385 if ( TreeH() && cH )
386 {
1a1cdff8 387 TreeH()->Fill();
388 }
ce3e25a8 389
1a1cdff8 390 // Filling TreeD
ce3e25a8 391
c82862d3 392 if ( TreeD() && cD && cGLT )
393 {
f0945e46 394 // Writing digits and (global+local) trigger at once.
c82862d3 395 TreeD()->Fill();
396 }
f0945e46 397 else
398 {
399 if ( TreeD() && cD )
400 {
401 if ( IsTriggerBranchesInTreeD() )
402 {
403 for (int i=0; i<AliMUONConstants::NCh(); i++)
404 {
405 sprintf(branchname,"%sDigits%d",GetName(),i+1);
406 branch = TreeD()->GetBranch(branchname);
407 branch->Fill();
408 }
409 }
410 else
411 {
412 TreeD()->Fill();
ce3e25a8 413 }
f0945e46 414 }
415
416 if ( TreeD() && cGLT )
417 {
418 if ( IsDigitsBranchesInTree() )
419 {
420 sprintf(branchname,"%sLocalTrigger",GetName());
421 branch = TreeD()->GetBranch(branchname);
422 branch->Fill();
47dc4ee7 423 sprintf(branchname,"%sRegionalTrigger",GetName());
424 branch = TreeD()->GetBranch(branchname);
425 branch->Fill();
f0945e46 426 sprintf(branchname,"%sGlobalTrigger",GetName());
427 branch = TreeD()->GetBranch(branchname);
428 branch->Fill();
47dc4ee7 429
f0945e46 430 }
431 else
432 {
433 TreeD()->Fill();
434 }
435 }
436 } // end of TreeD() handling.
ce3e25a8 437
d1775029 438 // Filling TreeS
f0945e46 439 if ( TreeS() && cS)
440 {
d1775029 441 TreeS()->Fill();
442 }
c1d45bdf 443
f0945e46 444 // Filling TreeR
445
446 if ( TreeR() && cRC && cTC )
447 {
448 TreeR()->Fill();
449 }
450 else
451 {
452 if ( TreeR() && cRC )
453 {
454 if ( IsTriggerBranchesInTree() )
455 {
c1d45bdf 456 // Branch per branch filling
f0945e46 457 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++)
458 {
459 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
460 branch = TreeR()->GetBranch(branchname);
461 branch->Fill();
462 }
463 }
464 else
465 {
466 TreeR()->Fill();
467 }
468 }
469
470 if ( TreeR() && cTC)
471 {
472 if (IsRawClusterBranchesInTree())
473 {
474 // Branch per branch filling
475 sprintf(branchname,"%sLocalTrigger",GetName());
476 branch = TreeR()->GetBranch(branchname);
477 branch->Fill();
47dc4ee7 478 sprintf(branchname,"%sRegionalTrigger",GetName());
479 branch = TreeR()->GetBranch(branchname);
480 branch->Fill();
f0945e46 481 sprintf(branchname,"%sGlobalTrigger",GetName());
482 branch = TreeR()->GetBranch(branchname);
483 branch->Fill();
484 }
485 else
486 {
487 TreeR()->Fill();
c1d45bdf 488 }
489 }
1a1cdff8 490 }
f0945e46 491
492 // Filling TreeT
c1d45bdf 493
f0945e46 494 if ( TreeT() && cRT && cRL )
495 {
496 TreeT()->Fill();
1a1cdff8 497 }
f0945e46 498 else
499 {
500 if ( TreeT() && cRT )
501 {
502 if (IsTriggerTrackBranchesInTree())
503 {
504 sprintf(branchname,"%sTrack",GetName());
505 branch = TreeT()->GetBranch(branchname);
506 branch->Fill();
507 }
508 else
509 {
510 TreeT()->Fill();
511 }
512 }
513
514 if ( TreeT() && cRL )
515 {
516 if (IsTrackBranchesInTree())
517 {
518 sprintf(branchname,"%sTriggerTrack",GetName());
519 branch = TreeT()->GetBranch(branchname);
520 branch->Fill();
521 }
522 else
523 {
524 TreeT()->Fill();
525 }
276c44b7 526 }
1a1cdff8 527 }
528}
c82862d3 529
1a1cdff8 530//_____________________________________________________________________________
6309cf6e 531void AliMUONData::MakeBranch(Option_t* option)
532{
5398f946 533/// Create Tree branches for the MUON.
534
6309cf6e 535 const Int_t kBufferSize = 4000;
536 char branchname[30];
537
c82862d3 538
6309cf6e 539 const char *cH = strstr(option,"H");
540 const char *cD = strstr(option,"D"); // Digits branches in TreeD
d1775029 541 const char *cS = strstr(option,"S"); // Digits branches in TreeS
6309cf6e 542 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
ce3e25a8 543 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeD
47dc4ee7 544 const char *cTC = strstr(option,"TC"); // global and local Trigger branches Copy in TreeR
6309cf6e 545 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
276c44b7 546 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
c82862d3 547 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
548
6309cf6e 549 TBranch * branch = 0x0;
550
551 // Creating Branches for Hits
552 if (TreeH() && cH) {
c82862d3 553
1988766a 554 if (fHits == 0x0) {
c82862d3 555 fHits = new TClonesArray("AliMUONHit",1000);
556 // if (gAlice->GetMCApp())
557 // gAlice->GetMCApp()->AddHitList (fHits);
1988766a 558 }
c82862d3 559
6309cf6e 560 fNhits = 0;
561 sprintf(branchname,"%sHits",GetName());
562 branch = TreeH()->GetBranch(branchname);
563 if (branch) {
f0945e46 564 AliInfo(Form("MakeBranch","Branch %s is already in tree.",branchname));
6309cf6e 565 return ;
566 }
c6ce342a 567 branch = TreeH()->Branch(branchname,&fHits,kBufferSize);
cba99c31 568 //Info("MakeBranch","Making Branch %s for hits \n",branchname);
6309cf6e 569 }
570
571 //Creating Branches for Digits
c82862d3 572 TTree* treeD = 0x0;
573 if ( cD || cGLT )
574 {
575 treeD = TreeD();
576 }
577
578 if ( treeD && cD )
579 {
6309cf6e 580 // one branch for digits per chamber
c82862d3 581 if (fDigits == 0x0)
582 {
ce3f5e87 583 fDigits = new TObjArray(AliMUONConstants::NCh());
c82862d3 584 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++)
585 {
586 TClonesArray * tca = new TClonesArray("AliMUONDigit",10000);
587 tca->SetOwner();
588 fDigits->AddAt(tca,iDetectionPlane);
ce3f5e87 589 }
590 }
c82862d3 591 if (fNdigits == 0x0)
592 {
ce3f5e87 593 fNdigits = new Int_t[AliMUONConstants::NCh()];
c82862d3 594 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++)
595 {
596 fNdigits[iDetectionPlane]=0;
6309cf6e 597 }
598 }
c82862d3 599 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++)
600 {
6309cf6e 601 sprintf(branchname,"%sDigits%d",GetName(),iDetectionPlane+1);
c82862d3 602 branch = treeD->GetBranch(branchname);
603 if (branch)
604 {
f0945e46 605 AliInfo(Form("Branch %s is already in tree.",branchname));
c82862d3 606 return;
6309cf6e 607 }
1a1cdff8 608 TClonesArray * digits = Digits(iDetectionPlane);
c82862d3 609 branch = treeD->Branch(branchname, &digits, kBufferSize,1);
610 }
6309cf6e 611 }
c82862d3 612
613 if ( treeD && cGLT )
614 {
ce3e25a8 615 //
616 // one branch for global trigger
617 //
618 sprintf(branchname,"%sGlobalTrigger",GetName());
ce3e25a8 619
c82862d3 620 if (fGlobalTrigger == 0x0)
621 {
ce3e25a8 622 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger");
623 fNglobaltrigger = 0;
624 }
c82862d3 625 branch = treeD->GetBranch(branchname);
626 if (branch)
627 {
8c343c7c 628 AliInfo(Form("Branch GlobalTrigger is already in treeD."));
ce3e25a8 629 return ;
630 }
c82862d3 631 branch = treeD->Branch(branchname, &fGlobalTrigger, kBufferSize);
632
47dc4ee7 633 //
634 // one branch for regional trigger
635 //
636 sprintf(branchname,"%sRegionalTrigger",GetName());
637 branch = 0x0;
638
639 if (fRegionalTrigger == 0x0)
640 {
641 fRegionalTrigger = new TClonesArray("AliMUONRegionalTrigger",16);
642 fNregionaltrigger = 0;
643 }
644 branch = treeD->GetBranch(branchname);
645 if (branch)
646 {
647 AliInfo(Form("Branch RegionalTrigger is already in treeD."));
648 return;
649 }
650 branch = treeD->Branch(branchname, &fRegionalTrigger, kBufferSize);
651
652
ce3e25a8 653 //
654 // one branch for local trigger
655 //
656 sprintf(branchname,"%sLocalTrigger",GetName());
657 branch = 0x0;
658
c82862d3 659 if (fLocalTrigger == 0x0)
660 {
ce3e25a8 661 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
662 fNlocaltrigger = 0;
663 }
c82862d3 664 branch = treeD->GetBranch(branchname);
665 if (branch)
666 {
8c343c7c 667 AliInfo(Form("Branch LocalTrigger is already in treeD."));
ce3e25a8 668 return;
669 }
c82862d3 670 branch = treeD->Branch(branchname, &fLocalTrigger, kBufferSize);
ce3e25a8 671 }
c82862d3 672
d1775029 673 //Creating Branches for SDigits
674 if (TreeS() && cS ) {
675 // one branch for Sdigits per chamber
676 if (fSDigits == 0x0) {
677 fSDigits = new TObjArray(AliMUONConstants::NCh());
678 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
c82862d3 679 TClonesArray * tca = new TClonesArray("AliMUONDigit",10000);
680 tca->SetOwner();
681 fSDigits->AddAt(tca,iDetectionPlane);
d1775029 682 }
683 }
684 if (fNSdigits == 0x0) {
685 fNSdigits = new Int_t[AliMUONConstants::NCh()];
686 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
c82862d3 687 fNSdigits[iDetectionPlane]=0;
d1775029 688 }
689 }
690 for (Int_t iDetectionPlane=0; iDetectionPlane<AliMUONConstants::NCh() ;iDetectionPlane++) {
691 sprintf(branchname,"%sSDigits%d",GetName(),iDetectionPlane+1);
692 branch = 0x0;
693 branch = TreeS()->GetBranch(branchname);
694 if (branch) {
f0945e46 695 AliInfo(Form("Branch %s is already in tree.",branchname));
c82862d3 696 return;
d1775029 697 }
30178c30 698 TClonesArray * sdigits = SDigits(iDetectionPlane);
699 branch = TreeS()->Branch(branchname, &sdigits, kBufferSize,1);
700 //Info("MakeBranch","Making Branch %s for sdigits in detection plane %d\n",branchname,iDetectionPlane+1);
c82862d3 701 }
d1775029 702 }
c82862d3 703
6309cf6e 704 if (TreeR() && cRC ) {
705 // one branch for raw clusters per tracking detection plane
706 //
707 Int_t i;
708 if (fRawClusters == 0x0) {
709 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
6309cf6e 710 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
c82862d3 711 TClonesArray * tca = new TClonesArray("AliMUONRawCluster",1000);
712 tca->SetOwner();
713 fRawClusters->AddAt(tca,i);
ce3f5e87 714 }
715 }
c82862d3 716
ce3f5e87 717 if (fNrawclusters == 0x0) {
718 fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
719 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
c82862d3 720 fNrawclusters[i]=0;
6309cf6e 721 }
722 }
723
724 for (i=0; i<AliMUONConstants::NTrackingCh() ;i++) {
725 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
726 branch = 0x0;
727 branch = TreeR()->GetBranch(branchname);
728 if (branch) {
f0945e46 729 AliInfo(Form("Branch %s is already in tree.",branchname));
c82862d3 730 return;
6309cf6e 731 }
c6ce342a 732 branch = TreeR()->Branch(branchname, &((*fRawClusters)[i]),kBufferSize);
cba99c31 733 //Info("MakeBranch","Making Branch %s for rawcluster in detection plane %d\n",branchname,i+1);
6309cf6e 734 }
735 }
c82862d3 736
ce3e25a8 737 if (TreeR() && cTC ) {
6309cf6e 738 //
739 // one branch for global trigger
740 //
741 sprintf(branchname,"%sGlobalTrigger",GetName());
742 branch = 0x0;
743
744 if (fGlobalTrigger == 0x0) {
c6ce342a 745 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger");
6309cf6e 746 fNglobaltrigger = 0;
747 }
748 branch = TreeR()->GetBranch(branchname);
749 if (branch) {
8c343c7c 750 AliInfo(Form("Branch GlobalTrigger is already in treeR."));
6309cf6e 751 return ;
752 }
c6ce342a 753 branch = TreeR()->Branch(branchname, &fGlobalTrigger, kBufferSize);
cba99c31 754 //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
47dc4ee7 755
756 //
757 // one branch for regional trigger
758 //
759 sprintf(branchname,"%sRegionalTrigger",GetName());
760 branch = 0x0;
6309cf6e 761
47dc4ee7 762 if (fRegionalTrigger == 0x0) {
763 fRegionalTrigger = new TClonesArray("AliMUONRegionalTrigger",16);
764 fNregionaltrigger = 0;
765 }
766 branch = TreeR()->GetBranch(branchname);
767 if (branch) {
768 AliInfo(Form("Branch RegionalTrigger is already in treeR."));
769 return;
770 }
771 branch = TreeR()->Branch(branchname, &fRegionalTrigger, kBufferSize);
772
6309cf6e 773 //
774 // one branch for local trigger
775 //
776 sprintf(branchname,"%sLocalTrigger",GetName());
777 branch = 0x0;
778
779 if (fLocalTrigger == 0x0) {
780 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
781 fNlocaltrigger = 0;
782 }
783 branch = TreeR()->GetBranch(branchname);
784 if (branch) {
8c343c7c 785 AliInfo(Form("Branch LocalTrigger is already in treeR."));
6309cf6e 786 return;
787 }
c6ce342a 788 branch = TreeR()->Branch(branchname, &fLocalTrigger, kBufferSize);
cba99c31 789 //Info("MakeBranch", "Making Branch %s for Global Trigger\n",branchname);
6309cf6e 790 }
791
dcd2690d 792 if (TreeT() && cRT ) {
374ebd7d 793 if (fRecTracks == 0x0) fRecTracks = new TClonesArray("AliMUONTrack",100);
dcd2690d 794 fNrectracks = 0;
795 sprintf(branchname,"%sTrack",GetName());
796 branch = TreeT()->GetBranch(branchname);
797 if (branch) {
8c343c7c 798 AliInfo(Form("Branch %s is already in tree.",GetName()));
dcd2690d 799 return ;
800 }
801 branch = TreeT()->Branch(branchname,&fRecTracks,kBufferSize);
cba99c31 802 //Info("MakeBranch","Making Branch %s for tracks \n",branchname);
dcd2690d 803 }
c82862d3 804 // trigger tracks
276c44b7 805 if (TreeT() && cRL ) {
806 if (fRecTriggerTracks == 0x0) fRecTriggerTracks = new TClonesArray("AliMUONTriggerTrack",100);
807 fNrectriggertracks = 0;
808 sprintf(branchname,"%sTriggerTrack",GetName());
809 branch = TreeT()->GetBranch(branchname);
810 if (branch) {
8c343c7c 811 AliInfo(Form("Branch %s is already in tree.",GetName()));
276c44b7 812 return ;
813 }
814 branch = TreeT()->Branch(branchname,&fRecTriggerTracks,kBufferSize);
cba99c31 815 //Info("MakeBranch","Making Branch %s for trigger tracks \n",branchname);
276c44b7 816 }
6309cf6e 817}
1eccde20 818//____________________________________________________________________________
819TClonesArray* AliMUONData::RawClusters(Int_t DetectionPlane)
820{
5398f946 821/// Getting Raw Clusters
822
1eccde20 823 if (fRawClusters)
824 return ( (TClonesArray*) fRawClusters->At(DetectionPlane) );
825 else
826 return NULL;
827}
f0945e46 828
6309cf6e 829//____________________________________________________________________________
f0945e46 830TClonesArray*
831AliMUONData::LocalTrigger() const
276c44b7 832{
5398f946 833/// Getting local trigger
834
f0945e46 835 return fLocalTrigger;
276c44b7 836}
f0945e46 837
1a46cb76 838//____________________________________________________________________________
839TClonesArray*
840AliMUONData::RegionalTrigger() const
841{
842/// Getting regional trigger
843
844 return fRegionalTrigger;
845}
846
276c44b7 847//____________________________________________________________________________
f0945e46 848void
849AliMUONData::GetDigits() const
276c44b7 850{
5398f946 851/// Load the digits from TreeD for the current event.
852
f0945e46 853 Int_t event = fLoader->GetRunLoader()->GetEventNumber();
854 if ( fCurrentEvent != event )
855 {
698b2e52 856 if (fLoader->TreeD()) {
857 fLoader->TreeD()->GetEvent(0);
858 fCurrentEvent = event;
859 }
f0945e46 860 }
276c44b7 861}
f0945e46 862
863//____________________________________________________________________________
864TClonesArray*
865AliMUONData::GlobalTrigger() const
866{
5398f946 867/// Return the global trigger
868
f0945e46 869 return fGlobalTrigger;
870}
871
276c44b7 872//____________________________________________________________________________
6309cf6e 873void AliMUONData::ResetDigits()
874{
5398f946 875/// Reset number of digits and the digits array for this detector
876
6309cf6e 877 if (fDigits == 0x0) return;
878 for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
f68d0cf6 879 if ((*fDigits)[i]) ((TClonesArray*)fDigits->At(i))->Clear("C");
6309cf6e 880 if (fNdigits) fNdigits[i]=0;
881 }
882}
d1775029 883//____________________________________________________________________________
884void AliMUONData::ResetSDigits()
885{
5398f946 886/// Reset number of Sdigits and the Sdigits array for this detector
887
d1775029 888 if (fSDigits == 0x0) return;
889 for ( int i=0;i<AliMUONConstants::NCh();i++ ) {
890 if ((*fSDigits)[i]) ((TClonesArray*)fSDigits->At(i))->Clear();
891 if (fNSdigits) fNSdigits[i]=0;
892 }
893}
6309cf6e 894//______________________________________________________________________________
895void AliMUONData::ResetHits()
896{
5398f946 897/// Reset number of clusters and the cluster array for this detector
898
6309cf6e 899 fNhits = 0;
900 if (fHits) fHits->Clear();
901}
902//_______________________________________________________________________________
903void AliMUONData::ResetRawClusters()
904{
5398f946 905/// Reset number of raw clusters and the raw clust array for this detector
906
6309cf6e 907 for ( int i=0;i<AliMUONConstants::NTrackingCh();i++ ) {
908 if ((*fRawClusters)[i]) ((TClonesArray*)fRawClusters->At(i))->Clear();
909 if (fNrawclusters) fNrawclusters[i]=0;
910 }
911}
912//_______________________________________________________________________________
913void AliMUONData::ResetTrigger()
914{
5398f946 915/// Reset Local and Global Trigger
916
6309cf6e 917 fNglobaltrigger = 0;
918 if (fGlobalTrigger) fGlobalTrigger->Clear();
47dc4ee7 919 fNregionaltrigger = 0;
920 if (fRegionalTrigger) fRegionalTrigger->Clear();
6309cf6e 921 fNlocaltrigger = 0;
922 if (fLocalTrigger) fLocalTrigger->Clear();
47dc4ee7 923
6309cf6e 924}
dcd2690d 925//____________________________________________________________________________
926void AliMUONData::ResetRecTracks()
927{
5398f946 928/// Reset tracks information
929
dcd2690d 930 fNrectracks = 0;
34f1bfa0 931 if (fRecTracks) fRecTracks->Delete(); // necessary to delete in case of memory allocation
dcd2690d 932}
276c44b7 933//____________________________________________________________________________
934void AliMUONData::ResetRecTriggerTracks()
935{
5398f946 936/// Reset tracks information
937
276c44b7 938 fNrectriggertracks = 0;
34f1bfa0 939 if (fRecTriggerTracks) fRecTriggerTracks->Delete(); // necessary to delete in case of memory allocation
276c44b7 940}
6309cf6e 941//_____________________________________________________________________________
ce3f5e87 942void AliMUONData::SetTreeAddress(Option_t* option)
6309cf6e 943{
5398f946 944/// Setting Addresses to the events trees
945
ce3f5e87 946 const char *cH = strstr(option,"H");
947 const char *cD = strstr(option,"D"); // Digits branches in TreeD
d1775029 948 const char *cS = strstr(option,"S"); // SDigits branches in TreeS
ce3f5e87 949 const char *cRC = strstr(option,"RC"); // RawCluster branches in TreeR
ce3e25a8 950 const char *cGLT = strstr(option,"GLT"); // Global and Local Trigger branches in TreeD
951 const char *cTC = strstr(option,"TC"); // global and local Trigger branches Copy in TreeR
dcd2690d 952 const char *cRT = strstr(option,"RT"); // Reconstructed Track in TreeT
276c44b7 953 const char *cRL = strstr(option,"RL"); // Reconstructed Trigger Track in TreeT
c82862d3 954 //const char *cRP = strstr(option,"RP"); // Reconstructed Particle in TreeP
ce3f5e87 955
6309cf6e 956 // Set branch address for the Hits, Digits, RawClusters, GlobalTrigger and LocalTrigger Tree.
957 char branchname[30];
958 TBranch * branch = 0x0;
c82862d3 959
960 AliDebug(1,Form("option=%s",option));
6309cf6e 961 //
962 // Branch address for hit tree
ce3f5e87 963 if ( TreeH() && cH ) {
c82862d3 964 if (fHits == 0x0) {
965 fHits = new TClonesArray("AliMUONHit",1000);
966 // if (gAlice->GetMCApp())
967 // gAlice->GetMCApp()->AddHitList (fHits); Moved to AliMUON
88cf591d 968 }
6309cf6e 969 fNhits =0;
970 }
ce3f5e87 971 if (TreeH() && fHits && cH) {
6309cf6e 972 sprintf(branchname,"%sHits",GetName());
973 branch = TreeH()->GetBranch(branchname);
974 if (branch) {
d652f85c 975 // Info("SetTreeAddress","(%s) Setting for Hits",GetName());
6309cf6e 976 branch->SetAddress(&fHits);
977 }
978 else { //can be invoked before branch creation
bbcdca4c 979 //AliWarning(Form("(%s) Failed for Hits. Can not find branch in tree.",GetName()));
6309cf6e 980 }
981 }
982
983 //
984 // Branch address for digit tree
95e68a13 985 if ( TreeD() ) {
986 if (fDigits == 0x0 && cD) {
6309cf6e 987 fDigits = new TObjArray(AliMUONConstants::NCh());
988 fNdigits= new Int_t[AliMUONConstants::NCh()];
989 for (Int_t i=0; i<AliMUONConstants::NCh() ;i++) {
c82862d3 990 fDigits->AddAt(new TClonesArray("AliMUONDigit",10000),i);
991 fNdigits[i]=0;
6309cf6e 992 }
993 }
ce3e25a8 994 if (fLocalTrigger == 0x0 && cGLT) {
995 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
996 }
47dc4ee7 997 if (fRegionalTrigger == 0x0 && cGLT) {
998 fRegionalTrigger = new TClonesArray("AliMUONRegionalTrigger",16);
999 }
ce3e25a8 1000 if (fGlobalTrigger== 0x0 && cGLT) {
c82862d3 1001 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
ce3e25a8 1002 }
6309cf6e 1003 }
c82862d3 1004
ce3f5e87 1005 if (TreeD() && fDigits && cD) {
6309cf6e 1006 for (int i=0; i<AliMUONConstants::NCh(); i++) {
1007 sprintf(branchname,"%sDigits%d",GetName(),i+1);
d652f85c 1008 if (fDigits) {
c82862d3 1009 branch = TreeD()->GetBranch(branchname);
1010 TClonesArray * digits = Digits(i);
1011 if (branch) {
1012 branch->SetAddress( &digits );
1013 }
1014 else AliWarning(Form("(%s) Failed for Digits Detection plane %d. Can not find branch in tree.",GetName(),i));
d652f85c 1015 }
6309cf6e 1016 }
1017 }
ce3e25a8 1018 if ( TreeD() && fLocalTrigger && cGLT) {
1019 sprintf(branchname,"%sLocalTrigger",GetName());
1020 branch = TreeD()->GetBranch(branchname);
1021 if (branch) branch->SetAddress(&fLocalTrigger);
8c343c7c 1022 else AliWarning(Form("(%s) Failed for LocalTrigger. Can not find branch in treeD.",GetName()));
ce3e25a8 1023 }
47dc4ee7 1024 if ( TreeD() && fRegionalTrigger && cGLT) {
1025 sprintf(branchname,"%sRegionalTrigger",GetName());
1026 branch = TreeD()->GetBranch(branchname);
1027 if (branch) branch->SetAddress(&fRegionalTrigger);
1028 else AliWarning(Form("(%s) Failed for RegionalTrigger. Can not find branch in treeD.",GetName()));
1029 }
ce3e25a8 1030 if ( TreeD() && fGlobalTrigger && cGLT) {
1031 sprintf(branchname,"%sGlobalTrigger",GetName());
1032 branch = TreeD()->GetBranch(branchname);
1033 if (branch) branch->SetAddress(&fGlobalTrigger);
8c343c7c 1034 else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeD.",GetName()));
ce3e25a8 1035 }
c82862d3 1036
d1775029 1037 //
1038 // Branch address for Sdigit tree
c82862d3 1039 if ( TreeS() && cS)
1040 {
1041 if (fSDigits == 0x0)
1042 {
1043 AliDebug(1,"Creating fSDigits TObjArray");
d1775029 1044 fSDigits = new TObjArray(AliMUONConstants::NCh());
1045 fNSdigits= new Int_t[AliMUONConstants::NCh()];
c82862d3 1046 for (Int_t i=0; i<AliMUONConstants::NCh() ;i++)
1047 {
1048 TClonesArray* a = new TClonesArray("AliMUONDigit",10000);
1049 fSDigits->AddAt(a,i);
1050 AliDebug(1,Form("fSDigits[%d]=%p",i,a));
1051 fNSdigits[i]=0;
d1775029 1052 }
1053 }
c82862d3 1054 else
1055 {
1056 AliDebug(1,Form("fSDigits already there = %p",fSDigits));
1057 }
d1775029 1058 }
c82862d3 1059
d1775029 1060 if (TreeS() && fSDigits && cS) {
c82862d3 1061 AliDebug(1,"Setting branch addresses");
d1775029 1062 for (int i=0; i<AliMUONConstants::NCh(); i++) {
1063 sprintf(branchname,"%sSDigits%d",GetName(),i+1);
1064 if (fSDigits) {
c82862d3 1065 AliDebug(1,Form("TreeS=%p for ich=%d branchname=%s",
1066 TreeS(),i,branchname));
1067 branch = TreeS()->GetBranch(branchname);
1068 TClonesArray * sdigits = SDigits(i);
1069 if (branch) branch->SetAddress( &sdigits );
1070 else AliWarning(Form("(%s) Failed for SDigits Detection plane %d. Can not find branch in tree.",GetName(),i));
d1775029 1071 }
1072 }
1073 }
6309cf6e 1074
1075 //
1076 // Branch address for rawclusters, globaltrigger and local trigger tree
1077 if (TreeR() ) {
ce3f5e87 1078 if (fRawClusters == 0x0 && cRC) {
6309cf6e 1079 fRawClusters = new TObjArray(AliMUONConstants::NTrackingCh());
1080 fNrawclusters= new Int_t[AliMUONConstants::NTrackingCh()];
1081 for (Int_t i=0; i<AliMUONConstants::NTrackingCh();i++) {
c82862d3 1082 fRawClusters->AddAt(new TClonesArray("AliMUONRawCluster",10000),i);
1083 fNrawclusters[i]=0;
6309cf6e 1084 }
1085 }
ce3e25a8 1086 if (fLocalTrigger == 0x0 && cTC) {
6309cf6e 1087 fLocalTrigger = new TClonesArray("AliMUONLocalTrigger",234);
1088 }
47dc4ee7 1089 if (fRegionalTrigger == 0x0 && cTC) {
1090 fRegionalTrigger = new TClonesArray("AliMUONRegionalTrigger",16);
1091 }
ce3e25a8 1092 if (fGlobalTrigger== 0x0 && cTC) {
c82862d3 1093 fGlobalTrigger = new TClonesArray("AliMUONGlobalTrigger",1);
6309cf6e 1094 }
c82862d3 1095
6309cf6e 1096 }
cc87ebcd 1097 if ( TreeR() && fRawClusters && cRC && !strstr(cRC,"RCC")) {
6309cf6e 1098 for (int i=0; i<AliMUONConstants::NTrackingCh(); i++) {
1099 sprintf(branchname,"%sRawClusters%d",GetName(),i+1);
1100 if (fRawClusters) {
c82862d3 1101 branch = TreeR()->GetBranch(branchname);
1102 if (branch) branch->SetAddress( &((*fRawClusters)[i]) );
1103 else AliWarning(Form("(%s) Failed for RawClusters Detection plane %d. Can not find branch in tree.",GetName(),i));
6309cf6e 1104 }
1105 }
1106 }
ce3e25a8 1107 if ( TreeR() && fLocalTrigger && cTC) {
6309cf6e 1108 sprintf(branchname,"%sLocalTrigger",GetName());
1109 branch = TreeR()->GetBranch(branchname);
1110 if (branch) branch->SetAddress(&fLocalTrigger);
8c343c7c 1111 else AliWarning(Form("(%s) Failed for LocalTrigger. Can not find branch in treeR.",GetName()));
6309cf6e 1112 }
47dc4ee7 1113
1114 if ( TreeR() && fRegionalTrigger && cTC) {
1115 sprintf(branchname,"%sRegionalTrigger",GetName());
1116 branch = TreeR()->GetBranch(branchname);
1117 if (branch) branch->SetAddress(&fRegionalTrigger);
1118 else AliWarning(Form("(%s) Failed for RegionalTrigger. Can not find branch in treeR.",GetName()));
1119 }
1120
ce3e25a8 1121 if ( TreeR() && fGlobalTrigger && cTC) {
6309cf6e 1122 sprintf(branchname,"%sGlobalTrigger",GetName());
1123 branch = TreeR()->GetBranch(branchname);
1124 if (branch) branch->SetAddress(&fGlobalTrigger);
8c343c7c 1125 else AliWarning(Form("(%s) Failed for GlobalTrigger. Can not find branch in treeR.",GetName()));
6309cf6e 1126 }
c82862d3 1127
8547965d 1128 if ( TreeT() ) {
61adb9bd 1129 if (fRecTracks == 0x0 && cRT) {
8547965d 1130 fRecTracks = new TClonesArray("AliMUONTrack",100);
1131 }
c82862d3 1132
8547965d 1133 }
dcd2690d 1134 if ( TreeT() && fRecTracks && cRT ) {
1135 sprintf(branchname,"%sTrack",GetName());
1136 branch = TreeT()->GetBranch(branchname);
1137 if (branch) branch->SetAddress(&fRecTracks);
8c343c7c 1138 else AliWarning(Form("(%s) Failed for Tracks. Can not find branch in tree.",GetName()));
dcd2690d 1139 }
c82862d3 1140 // trigger tracks
276c44b7 1141 if ( TreeT() ) {
1142 if (fRecTriggerTracks == 0x0 && cRL) {
1143 fRecTriggerTracks = new TClonesArray("AliMUONTriggerTrack",100);
1144 }
c82862d3 1145
276c44b7 1146 }
1147 if ( TreeT() && fRecTriggerTracks && cRL ) {
1148 sprintf(branchname,"%sTriggerTrack",GetName());
1149 branch = TreeT()->GetBranch(branchname);
1150 if (branch) branch->SetAddress(&fRecTriggerTracks);
8c343c7c 1151 else AliWarning(Form("(%s) Failed for Trigger Tracks. Can not find branch in tree.",GetName()));
276c44b7 1152 }
c82862d3 1153
1154
6309cf6e 1155}
c82862d3 1156
6309cf6e 1157//_____________________________________________________________________________
c82862d3 1158void
1159AliMUONData::Print(Option_t* opt) const
1160{
5398f946 1161/// Dump object on screen
1162
c82862d3 1163 TString options(opt);
1164 options.ToUpper();
1165
1166 if ( options.Contains("D") )
1167 {
1168 for ( Int_t ich = 0; ich < AliMUONConstants::NCh(); ++ich)
1169 {
1170 TClonesArray* digits = Digits(ich);
1171 Int_t ndigits = digits->GetEntriesFast();
1172 for ( Int_t id = 0; id < ndigits; ++id )
1173 {
1174 AliMUONDigit* digit =
1175 static_cast<AliMUONDigit*>(digits->UncheckedAt(id));
1176 digit->Print();
1177 }
1178 }
1179 }
1180
1181 if ( options.Contains("S") )
1182 {
1183 for ( Int_t ich = 0; ich < AliMUONConstants::NCh(); ++ich)
1184 {
1185 TClonesArray* digits = SDigits(ich);
1186 Int_t ndigits = digits->GetEntriesFast();
1187 for ( Int_t id = 0; id < ndigits; ++id )
1188 {
1189 AliMUONDigit* digit =
1190 static_cast<AliMUONDigit*>(digits->UncheckedAt(id));
1191 digit->Print();
1192 }
1193 }
1194 }
1195
3cdccc77 1196}