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