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 **************************************************************************/
18 //_________________________________________________________________________
19 // A singleton. This class should be used in the analysis stage to get
20 // reconstructed objects: Digits, RecPoints, TrackSegments and RecParticles,
21 // instead of directly reading them from galice.root file. This container
22 // ensures, that one reads Digits, made of these particular digits, RecPoints,
23 // made of these particular RecPoints, TrackSegments and RecParticles.
24 // This becomes non trivial if there are several identical branches, produced with
25 // different set of parameters.
27 // An example of how to use (see also class AliEMCALAnalyser):
28 // AliEMCALGetter * gime = AliEMCALGetter::GetInstance("galice.root","test") ;
29 // for(Int_t irecp = 0; irecp < gime->NRecParticles() ; irecp++)
30 // AliEMCALRecParticle * part = gime->RecParticle(1) ;
32 // gime->Event(event) ; // reads new event from galice.root
34 //*-- Author: Yves Schutz (SUBATECH) & Dmitri Peressounko (RRC KI & SUBATECH)
35 //*-- Completely redesigned by Dmitri Peressounko March 2001
37 //*-- YS June 2001 : renamed the original AliEMCALIndexToObject and make
38 //*-- systematic usage of TFolders without changing the interface
39 //////////////////////////////////////////////////////////////////////////////
41 // --- ROOT system ---
48 //#include <TCanvas.h>
51 // --- Standard library ---
53 // --- AliRoot header files ---
56 #include "AliEMCALGetter.h"
57 #include "AliEMCALLoader.h"
58 #include "AliHeader.h"
60 #include "AliRunLoader.h"
62 #include "AliEMCALRawStream.h"
63 #include "AliRawReaderFile.h"
65 ClassImp(AliEMCALGetter)
67 AliEMCALGetter * AliEMCALGetter::fgObjGetter = 0 ;
68 AliEMCALLoader * AliEMCALGetter::fgEmcalLoader = 0;
69 Int_t AliEMCALGetter::fgDebug = 0;
71 // TFile * AliEMCALGetter::fgFile = 0 ;
73 //____________________________________________________________________________
74 AliEMCALGetter::AliEMCALGetter(const char* headerFile, const char* version, Option_t * openingOption) {
75 AliRunLoader* rl = AliRunLoader::GetRunLoader(version) ;
77 rl = AliRunLoader::Open(headerFile, version, openingOption);
79 Fatal("AliEMCALGetter", "Could not find the Run Loader for %s - %s",headerFile, version) ;
82 if (rl->GetAliRun() == 0x0) {
84 gAlice = rl->GetAliRun(); // should be removed
87 fgEmcalLoader = dynamic_cast<AliEMCALLoader*>(rl->GetLoader("EMCALLoader"));
89 Error("AliEMCALGetter", "Could not find EMCALLoader") ;
91 fgEmcalLoader->SetTitle(version);
93 // initialize data members
99 //____________________________________________________________________________
100 AliEMCALGetter::~AliEMCALGetter()
103 delete fgEmcalLoader;
110 //____________________________________________________________________________
111 void AliEMCALGetter::Reset()
113 // resets things in case the getter is called consecutively with different files
114 // the EMCAL Loader is already deleted by the Run Loader
120 //____________________________________________________________________________
121 AliEMCALClusterizer * AliEMCALGetter::Clusterizer()
123 // return pointer to Clusterizer Tree
124 AliEMCALClusterizer * rv ;
125 rv = dynamic_cast<AliEMCALClusterizer *>(EmcalLoader()->Reconstructioner()) ;
128 rv = dynamic_cast<AliEMCALClusterizer*>(EmcalLoader()->Reconstructioner()) ;
134 //____________________________________________________________________________
135 TClonesArray * AliEMCALGetter::Digits() const
137 // asks the Loader to return the Digits container
139 TClonesArray * rv = 0 ;
140 rv = EmcalLoader()->Digits() ;
143 EmcalLoader()->MakeDigitsArray() ;
144 rv = EmcalLoader()->Digits() ;
149 //____________________________________________________________________________
150 AliEMCALDigitizer * AliEMCALGetter::Digitizer()
152 // return pointer to Digitizer Tree
153 AliEMCALDigitizer * rv ;
154 rv = dynamic_cast<AliEMCALDigitizer *>(EmcalLoader()->Digitizer()) ;
157 rv = dynamic_cast<AliEMCALDigitizer *>(EmcalLoader()->Digitizer()) ;
162 //____________________________________________________________________________
163 TObjArray * AliEMCALGetter::ECARecPoints() const
165 // asks the Loader to return the EMC RecPoints container
169 rv = EmcalLoader()->ECARecPoints() ;
171 EmcalLoader()->MakeRecPointsArray() ;
172 rv = EmcalLoader()->ECARecPoints() ;
177 //____________________________________________________________________________
178 TClonesArray * AliEMCALGetter::TrackSegments() const
180 // asks the Loader to return the TrackSegments container
182 TClonesArray * rv = 0 ;
184 rv = EmcalLoader()->TrackSegments() ;
186 EmcalLoader()->MakeTrackSegmentsArray() ;
187 rv = EmcalLoader()->TrackSegments() ;
192 //____________________________________________________________________________
193 AliEMCALTrackSegmentMaker * AliEMCALGetter::TrackSegmentMaker()
195 // return pointer to TrackSegmentMaker Tree
196 AliEMCALTrackSegmentMaker * rv ;
197 rv = dynamic_cast<AliEMCALTrackSegmentMaker *>(EmcalLoader()->TrackSegmentMaker()) ;
200 rv = dynamic_cast<AliEMCALTrackSegmentMaker *>(EmcalLoader()->TrackSegmentMaker()) ;
205 //____________________________________________________________________________
206 TClonesArray * AliEMCALGetter::RecParticles() const
208 // asks the Loader to return the TrackSegments container
210 TClonesArray * rv = 0 ;
212 rv = EmcalLoader()->RecParticles() ;
214 EmcalLoader()->MakeRecParticlesArray() ;
215 rv = EmcalLoader()->RecParticles() ;
219 //____________________________________________________________________________
220 void AliEMCALGetter::Event(Int_t event, const char* opt)
222 // Reads the content of all Tree's S, D and R
224 // if ( event >= MaxEvent() ) {
225 // Error("Event", "%d not found in TreeE !", event) ;
229 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
230 // checks if we are dealing with test-beam data
231 // TBranch * btb = rl->TreeE()->GetBranch("AliEMCALBeamTestEvent") ;
234 // fBTE = new AliEMCALBeamTestEvent() ;
235 // btb->SetAddress(&fBTE) ;
236 // btb->GetEntry(event) ;
245 // Loads the type of object(s) requested
247 rl->GetEvent(event) ;
249 if( strstr(opt,"X") || (strcmp(opt,"")==0) )
258 if( strstr(opt,"D") )
261 if( strstr(opt,"R") )
264 if( strstr(opt,"T") )
267 if( strstr(opt,"P") )
270 if( strstr(opt,"W") )
276 //____________________________________________________________________________
277 Int_t AliEMCALGetter::EventNumber() const
279 // return the current event number
280 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
281 return static_cast<Int_t>(rl->GetEventNumber()) ;
284 //____________________________________________________________________________
285 TClonesArray * AliEMCALGetter::Hits() const
287 // asks the loader to return the Hits container
289 TClonesArray * rv = 0 ;
291 rv = EmcalLoader()->Hits() ;
293 EmcalLoader()->LoadHits("read");
294 rv = EmcalLoader()->Hits() ;
299 //____________________________________________________________________________
300 AliEMCALGetter * AliEMCALGetter::Instance(const char* alirunFileName, const char* version, Option_t * openingOption)
302 // Creates and returns the pointer of the unique instance
303 // Must be called only when the environment has changed
305 if(!fgObjGetter){ // first time the getter is called
306 fgObjGetter = new AliEMCALGetter(alirunFileName, version, openingOption) ;
308 else { // the getter has been called previously
309 AliRunLoader * rl = AliRunLoader::GetRunLoader(fgEmcalLoader->GetTitle());
310 if ( rl->GetFileName() == alirunFileName ) {// the alirunFile has the same name
311 // check if the file is already open
312 TFile * galiceFile = dynamic_cast<TFile *>(gROOT->FindObject(rl->GetFileName()) ) ;
315 fgObjGetter = new AliEMCALGetter(alirunFileName, version, openingOption);
317 else { // the file is already open check the version name
318 TString currentVersionName = rl->GetEventFolder()->GetName() ;
319 TString newVersionName(version) ;
320 if (currentVersionName == newVersionName)
322 ::Warning( "Instance", "Files with version %s already open", currentVersionName.Data() ) ;
324 fgObjGetter = new AliEMCALGetter(alirunFileName, version, openingOption) ;
329 AliRunLoader * rl = AliRunLoader::GetRunLoader(fgEmcalLoader->GetTitle());
330 if ( strstr(version, AliConfig::GetDefaultEventFolderName()) ) // false in case of merging
332 fgObjGetter = new AliEMCALGetter(alirunFileName, version, openingOption) ;
336 ::Error("AliEMCALGetter::Instance", "Failed to create the EMCAL Getter object") ;
344 //____________________________________________________________________________
345 AliEMCALGetter * AliEMCALGetter::Instance()
347 // Returns the pointer of the unique instance already defined
349 if(!fgObjGetter && fgDebug)
350 ::Warning("AliEMCALGetter::Instance", "Getter not initialized") ;
356 //____________________________________________________________________________
357 Int_t AliEMCALGetter::MaxEvent() const
359 // returns the number of events in the run (from TE)
361 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
362 return static_cast<Int_t>(rl->GetNumberOfEvents()) ;
365 //____________________________________________________________________________
366 TParticle * AliEMCALGetter::Primary(Int_t index) const
368 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
369 return rl->Stack()->Particle(index) ;
372 //____________________________________________________________________________
373 Int_t AliEMCALGetter::NPrimaries() const
375 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
376 return (rl->GetHeader())->GetNtrack();
379 //____________________________________________________________________________
380 AliEMCAL * AliEMCALGetter:: EMCAL() const
382 // returns the EMCAL object
383 AliEMCALLoader * loader = 0;
384 static AliEMCALLoader * oldloader = 0;
385 static AliEMCAL * emcal = 0;
387 loader = EmcalLoader();
389 if (loader != oldloader ) {
390 emcal = dynamic_cast<AliEMCAL*>(loader->GetModulesFolder()->FindObject("EMCAL")) ;
395 Warning("EMCAL", "EMCAL module not found in module folders: %s", EmcalLoader()->GetModulesFolder()->GetName() ) ;
401 //____________________________________________________________________________
402 AliEMCALPID * AliEMCALGetter::PID()
404 // return pointer to PID Tree
406 rv = dynamic_cast<AliEMCALPID *>(EmcalLoader()->PIDTask()) ;
409 rv = dynamic_cast<AliEMCALPID *>(EmcalLoader()->PIDTask()) ;
414 //____________________________________________________________________________
415 AliEMCALGeometry * AliEMCALGetter::EMCALGeometry() const
417 // Returns EMCAL geometry
419 AliEMCALGeometry * rv = 0 ;
421 rv = EMCAL()->GetGeometry() ;
425 //____________________________________________________________________________
426 void AliEMCALGetter::Print()
428 // Print usefull information about the getter
430 AliRunLoader * rl = AliRunLoader::GetRunLoader(fgEmcalLoader->GetTitle());
431 ::Info("Print", "gAlice file is %s -- version name is %s", (rl->GetFileName()).Data(), rl->GetEventFolder()->GetName() ) ;
434 //____________________________________________________________________________
435 void AliEMCALGetter::ReadPrimaries()
437 // Read Primaries from Kinematics.root
439 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
441 // gets kine tree from the root file (Kinematics.root)
442 if ( ! rl->TreeK() ) // load treeK the first time
443 rl->LoadKinematics() ;
446 Info("ReadTreeK", "Found %d particles in event # %d", NPrimaries(), EventNumber() ) ;
449 //____________________________________________________________________________
450 void AliEMCALGetter::FitRaw(Bool_t lowGainFlag, TGraph * gLowGain, TGraph * gHighGain, TF1* signalF, Int_t & amp, Double_t & time)
452 // Fits the raw signal time distribution
454 const Int_t kNoiseThreshold = 0 ;
455 Double_t timezero1 = 0., timezero2 = 0., timemax = 0. ;
456 Double_t signal = 0., signalmax = 0. ;
457 Double_t energy = time = 0. ;
460 timezero1 = timezero2 = signalmax = timemax = 0. ;
461 signalF->FixParameter(0, EMCAL()->GetRawFormatLowCharge()) ;
462 signalF->FixParameter(1, EMCAL()->GetRawFormatLowGain()) ;
464 for (index = 0; index < EMCAL()->GetRawFormatTimeBins(); index++) {
465 gLowGain->GetPoint(index, time, signal) ;
466 if (signal > kNoiseThreshold && timezero1 == 0.)
468 if (signal <= kNoiseThreshold && timezero1 > 0. && timezero2 == 0.)
470 if (signal > signalmax) {
475 signalmax /= EMCAL()->RawResponseFunctionMax(EMCAL()->GetRawFormatLowCharge(),
476 EMCAL()->GetRawFormatLowGain()) ;
477 if ( timezero1 + EMCAL()->GetRawFormatTimePeak() < EMCAL()->GetRawFormatTimeMax() * 0.4 ) { // else its noise
478 signalF->SetParameter(2, signalmax) ;
479 signalF->SetParameter(3, timezero1) ;
480 gLowGain->Fit(signalF, "QRON", "", 0., timezero2); //, "QRON") ;
481 energy = signalF->GetParameter(2) ;
482 time = signalF->GetMaximumX() - EMCAL()->GetRawFormatTimePeak() - EMCAL()->GetRawFormatTimeTrigger() ;
485 timezero1 = timezero2 = signalmax = timemax = 0. ;
486 signalF->FixParameter(0, EMCAL()->GetRawFormatHighCharge()) ;
487 signalF->FixParameter(1, EMCAL()->GetRawFormatHighGain()) ;
489 for (index = 0; index < EMCAL()->GetRawFormatTimeBins(); index++) {
490 gHighGain->GetPoint(index, time, signal) ;
491 if (signal > kNoiseThreshold && timezero1 == 0.)
493 if (signal <= kNoiseThreshold && timezero1 > 0. && timezero2 == 0.)
495 if (signal > signalmax) {
500 signalmax /= EMCAL()->RawResponseFunctionMax(EMCAL()->GetRawFormatHighCharge(),
501 EMCAL()->GetRawFormatHighGain()) ;;
502 if ( timezero1 + EMCAL()->GetRawFormatTimePeak() < EMCAL()->GetRawFormatTimeMax() * 0.4 ) { // else its noise
503 signalF->SetParameter(2, signalmax) ;
504 signalF->SetParameter(3, timezero1) ;
505 gHighGain->Fit(signalF, "QRON", "", 0., timezero2) ;
506 energy = signalF->GetParameter(2) ;
507 time = signalF->GetMaximumX() - EMCAL()->GetRawFormatTimePeak() - EMCAL()->GetRawFormatTimeTrigger() ;
511 if (time == 0. && energy == 0.)
514 AliEMCALDigitizer * digitizer = Digitizer() ;
515 amp = static_cast<Int_t>( (energy - digitizer->GetECApedestal()) / digitizer->GetECAchannel() + 0.5 ) ;
518 // TCanvas * c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500);
519 // c1->SetFillColor(42);
521 // gLowGain->SetLineColor(2);
522 // gLowGain->SetLineWidth(4);
523 // gLowGain->SetMarkerColor(4);
524 // gLowGain->SetMarkerStyle(21);
525 // gLowGain->SetTitle("Lowgain");
526 // gLowGain->GetXaxis()->SetTitle("X title");
527 // gLowGain->GetYaxis()->SetTitle("Y title");
528 // gLowGain->Draw("ACP");
531 // c1->GetFrame()->SetFillColor(21);
532 // c1->GetFrame()->SetBorderSize(12);
535 // TCanvas * c2 = new TCanvas("c2","A Simple Graph Example",200,10,700,500);
536 // c2->SetFillColor(42);
538 // gHighGain->SetLineColor(2);
539 // gHighGain->SetLineWidth(4);
540 // gHighGain->SetMarkerColor(4);
541 // gHighGain->SetMarkerStyle(21);
542 // gHighGain->SetTitle("Highgain");
543 // gHighGain->GetXaxis()->SetTitle("X title");
544 // gHighGain->GetYaxis()->SetTitle("Y title");
545 // gHighGain->Draw("ACP");
548 // c2->GetFrame()->SetFillColor(21);
549 // c2->GetFrame()->SetBorderSize(12);
553 //____________________________________________________________________________
554 Int_t AliEMCALGetter::ReadRaw(Int_t event)
556 // reads the raw format data, converts it into digits format and store digits in Digits()
559 AliRawReaderFile rawReader(event) ;
560 AliEMCALRawStream in(&rawReader);
562 Bool_t first = kTRUE ;
564 TF1 * signalF = new TF1("signal", AliEMCAL::RawResponseFunction, 0, EMCAL()->GetRawFormatTimeMax(), 4);
565 signalF->SetParNames("Charge", "Gain", "Amplitude", "TimeZero") ;
569 Bool_t lowGainFlag = kFALSE ;
571 TClonesArray * digits = Digits() ;
577 TGraph * gLowGain = new TGraph(EMCAL()->GetRawFormatTimeBins()) ;
578 TGraph * gHighGain= new TGraph(EMCAL()->GetRawFormatTimeBins()) ;
580 while ( in.Next() ) { // EMCAL entries loop
581 if ( in.IsNewId() ) {
583 FitRaw(lowGainFlag, gLowGain, gHighGain, signalF, amp, time) ;
585 new((*digits)[idigit]) AliEMCALDigit( -1, -1, id, amp, time) ;
589 for (index = 0; index < EMCAL()->GetRawFormatTimeBins(); index++) {
590 gLowGain->SetPoint(index, index * EMCAL()->GetRawFormatTimeMax() / EMCAL()->GetRawFormatTimeBins(), 0) ;
591 gHighGain->SetPoint(index, index * EMCAL()->GetRawFormatTimeMax() / EMCAL()->GetRawFormatTimeBins(), 0) ;
596 if (in.GetModule() == EMCAL()->GetRawFormatLowGainOffset() )
597 lowGainFlag = kTRUE ;
599 lowGainFlag = kFALSE ;
602 gLowGain->SetPoint(in.GetTime(),
603 in.GetTime()* EMCAL()->GetRawFormatTimeMax() / EMCAL()->GetRawFormatTimeBins(),
606 gHighGain->SetPoint(in.GetTime(),
607 in.GetTime() * EMCAL()->GetRawFormatTimeMax() / EMCAL()->GetRawFormatTimeBins(),
610 } // EMCAL entries loop
617 return Digits()->GetEntriesFast() ;
620 //____________________________________________________________________________
621 Int_t AliEMCALGetter::ReadTreeD()
625 EmcalLoader()->CleanDigits() ;
626 EmcalLoader()->LoadDigits("UPDATE") ;
627 EmcalLoader()->LoadDigitizer("UPDATE") ;
628 return Digits()->GetEntries() ;
631 //____________________________________________________________________________
632 Int_t AliEMCALGetter::ReadTreeH()
635 EmcalLoader()->CleanHits() ;
636 // gets TreeH from the root file (EMCAL.Hit.root)
637 //if ( !IsLoaded("H") ) {
638 EmcalLoader()->LoadHits("UPDATE") ;
641 return Hits()->GetEntries() ;
644 //____________________________________________________________________________
645 Int_t AliEMCALGetter::ReadTreeR()
647 // Read the RecPoints
649 EmcalLoader()->CleanRecPoints() ;
650 // gets TreeR from the root file (EMCAL.RecPoints.root)
651 //if ( !IsLoaded("R") ) {
652 EmcalLoader()->LoadRecPoints("UPDATE") ;
653 EmcalLoader()->LoadClusterizer("UPDATE") ;
657 return ECARecPoints()->GetEntries() ;
660 //____________________________________________________________________________
661 Int_t AliEMCALGetter::ReadTreeT()
663 // Read the TrackSegments
665 EmcalLoader()->CleanTracks() ;
666 // gets TreeT from the root file (EMCAL.TrackSegments.root)
667 //if ( !IsLoaded("T") ) {
668 EmcalLoader()->LoadTracks("UPDATE") ;
669 EmcalLoader()->LoadTrackSegmentMaker("UPDATE") ;
673 return TrackSegments()->GetEntries() ;
675 //____________________________________________________________________________
676 Int_t AliEMCALGetter::ReadTreeP()
678 // Read the RecParticles
680 EmcalLoader()->CleanRecParticles() ;
681 // gets TreeP from the root file (EMCAL.RecParticles.root)
682 // if ( !IsLoaded("P") ) {
683 EmcalLoader()->LoadRecParticles("UPDATE") ;
684 EmcalLoader()->LoadPID("UPDATE") ;
688 return RecParticles()->GetEntries() ;
690 //____________________________________________________________________________
691 Int_t AliEMCALGetter::ReadTreeS()
695 // EmcalLoader()->CleanSDigits() ;
696 // gets TreeS from the root file (EMCAL.SDigits.root)
697 // if ( !IsLoaded("S") ) {
698 EmcalLoader()->LoadSDigits("READ") ;
699 EmcalLoader()->LoadSDigitizer("READ") ;
703 return SDigits()->GetEntries() ;
706 //____________________________________________________________________________
707 TClonesArray * AliEMCALGetter::SDigits() const
709 // asks the Loader to return the Digits container
711 TClonesArray * rv = 0 ;
713 rv = EmcalLoader()->SDigits() ;
715 EmcalLoader()->MakeSDigitsArray() ;
716 rv = EmcalLoader()->SDigits() ;
721 //____________________________________________________________________________
722 AliEMCALSDigitizer * AliEMCALGetter::SDigitizer()
724 // Return pointer to SDigitizer task
725 AliEMCALSDigitizer * rv ;
726 rv = dynamic_cast<AliEMCALSDigitizer *>(EmcalLoader()->SDigitizer()) ;
729 rv = dynamic_cast<AliEMCALSDigitizer *>(EmcalLoader()->SDigitizer()) ;
734 //____________________________________________________________________________
735 TParticle * AliEMCALGetter::Secondary(const TParticle* p, Int_t index) const
737 // Return first (index=1) or second (index=2) secondary particle of primary particle p
745 Int_t daughterIndex = p->GetDaughter(index-1) ;
746 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
747 return rl->GetAliRun()->GetMCApp()->Particle(daughterIndex) ;
753 //____________________________________________________________________________
754 void AliEMCALGetter::Track(Int_t itrack)
756 // Read the first entry of EMCAL branch in hit tree gAlice->TreeH()
758 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
760 if( !TreeH() ) // load treeH the first time
763 // first time create the container
764 TClonesArray * hits = Hits() ;
768 TBranch * emcalbranch = dynamic_cast<TBranch*>(TreeH()->GetBranch("EMCAL")) ;
769 emcalbranch->SetAddress(&hits) ;
770 emcalbranch->GetEntry(itrack) ;
773 //____________________________________________________________________________
774 TTree * AliEMCALGetter::TreeD() const
776 // return pointer to Digits Tree
778 rv = EmcalLoader()->TreeD() ;
780 EmcalLoader()->MakeTree("D");
781 rv = EmcalLoader()->TreeD() ;
787 //____________________________________________________________________________
788 TTree * AliEMCALGetter::TreeH() const
790 // return pointer to Hits Tree
792 rv = EmcalLoader()->TreeH() ;
794 EmcalLoader()->MakeTree("H");
795 rv = EmcalLoader()->TreeH() ;
801 //____________________________________________________________________________
802 TTree * AliEMCALGetter::TreeR() const
804 // return pointer to RecPoints Tree
807 rv = EmcalLoader()->TreeR() ;
809 EmcalLoader()->MakeTree("R");
810 rv = EmcalLoader()->TreeR() ;
816 //____________________________________________________________________________
817 TTree * AliEMCALGetter::TreeT() const
819 // return pointer to TrackSegments Tree
821 rv = EmcalLoader()->TreeT() ;
823 EmcalLoader()->MakeTree("T");
824 rv = EmcalLoader()->TreeT() ;
829 //____________________________________________________________________________
830 TTree * AliEMCALGetter::TreeP() const
832 // return pointer to RecParticles Tree
834 rv = EmcalLoader()->TreeP() ;
836 EmcalLoader()->MakeTree("P");
837 rv = EmcalLoader()->TreeP() ;
843 //____________________________________________________________________________
844 TTree * AliEMCALGetter::TreeS() const
846 // return pointer to SDigits Tree
848 rv = EmcalLoader()->TreeS() ;
850 EmcalLoader()->MakeTree("S");
851 rv = EmcalLoader()->TreeS() ;
857 //____________________________________________________________________________
858 Bool_t AliEMCALGetter::VersionExists(TString & opt) const
860 // checks if the version with the present name already exists in the same directory
864 AliRunLoader * rl = AliRunLoader::GetRunLoader(EmcalLoader()->GetTitle());
865 TString version( rl->GetEventFolder()->GetName() ) ;
869 if ( opt == "sdigits") {
870 // add the version name to the root file name
871 TString fileName( EmcalLoader()->GetSDigitsFileName() ) ;
872 if (version != AliConfig::GetDefaultEventFolderName()) // only if not the default folder name
873 fileName = fileName.ReplaceAll(".root", "") + "_" + version + ".root" ;
874 if ( !(gSystem->AccessPathName(fileName)) ) {
875 Warning("VersionExists", "The file %s already exists", fileName.Data()) ;
878 EmcalLoader()->SetSDigitsFileName(fileName) ;
881 if ( opt == "digits") {
882 // add the version name to the root file name
883 TString fileName( EmcalLoader()->GetDigitsFileName() ) ;
884 if (version != AliConfig::GetDefaultEventFolderName()) // only if not the default folder name
885 fileName = fileName.ReplaceAll(".root", "") + "_" + version + ".root" ;
886 if ( !(gSystem->AccessPathName(fileName)) ) {
887 Warning("VersionExists", "The file %s already exists", fileName.Data()) ;
896 //____________________________________________________________________________
897 UShort_t AliEMCALGetter::EventPattern(void) const
899 // Return the pattern (trigger bit register) of the beam-test event
901 // return fBTE->GetPattern() ;
905 //____________________________________________________________________________
906 Float_t AliEMCALGetter::BeamEnergy(void) const
908 // Return the beam energy of the beam-test event
910 // return fBTE->GetBeamEnergy() ;