From 66f895c88a8a5c9b25507f4a57bb4b417991616b Mon Sep 17 00:00:00 2001 From: schutz Date: Wed, 29 Sep 2004 09:41:43 +0000 Subject: [PATCH] Methods made virtual to allow On-Flight reconstruction with Light version of getter --- PHOS/AliPHOSGetter.cxx | 280 ++++++++++++----------------------------- PHOS/AliPHOSGetter.h | 188 ++++++++++++++------------- 2 files changed, 179 insertions(+), 289 deletions(-) diff --git a/PHOS/AliPHOSGetter.cxx b/PHOS/AliPHOSGetter.cxx index 2356e29b257..1745d603502 100644 --- a/PHOS/AliPHOSGetter.cxx +++ b/PHOS/AliPHOSGetter.cxx @@ -97,6 +97,7 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* version, Option else fgPhosLoader->SetTitle(version); + printf("Got PHOSLoader \n") ; // initialize data members SetDebug(0) ; @@ -105,27 +106,36 @@ AliPHOSGetter::AliPHOSGetter(const char* headerFile, const char* version, Option fLoadingStatus = "" ; fESDFileName = rl->GetFileName() ; // this should be the galice.root file + printf("File Name \n") ; fESDFileName.ReplaceAll("galice.root", "AliESDs.root") ; fESDFile = 0 ; fESD = 0 ; fESDTree = 0 ; + fRawDigits = kFALSE ; } //____________________________________________________________________________ AliPHOSGetter::~AliPHOSGetter() { // dtor - delete fgPhosLoader ; - fgPhosLoader = 0 ; - delete fBTE ; - fBTE = 0 ; - fPrimaries->Delete() ; - delete fPrimaries ; - fgObjGetter = 0; + if(fgPhosLoader){ + delete fgPhosLoader ; + fgPhosLoader = 0 ; + } + if(fBTE){ + delete fBTE ; + fBTE = 0 ; + } + if(fPrimaries){ + fPrimaries->Delete() ; + delete fPrimaries ; + } if (fESD) delete fESD ; if (fESDTree) - delete fESDTree ; + delete fESDTree ; + + // fgObjGetter = 0; } //____________________________________________________________________________ @@ -261,62 +271,72 @@ void AliPHOSGetter::Event(Int_t event, const char* opt) { // Reads the content of all Tree's S, D and R - if ( event >= MaxEvent() ) { - Error("Event", "%d not found in TreeE !", event) ; - return ; - } +// if ( event >= MaxEvent() ) { +// Error("Event", "%d not found in TreeE !", event) ; +// return ; +// } AliRunLoader * rl = AliRunLoader::GetRunLoader(PhosLoader()->GetTitle()); - // checks if we are dealing with test-beam data - TBranch * btb = rl->TreeE()->GetBranch("AliPHOSBeamTestEvent") ; - if(btb){ - if(!fBTE) - fBTE = new AliPHOSBeamTestEvent() ; - btb->SetAddress(&fBTE) ; - btb->GetEntry(event) ; - } - else{ - if(fBTE){ - delete fBTE ; - fBTE = 0 ; - } - } +// // checks if we are dealing with test-beam data +// TBranch * btb = rl->TreeE()->GetBranch("AliPHOSBeamTestEvent") ; +// if(btb){ +// if(!fBTE) +// fBTE = new AliPHOSBeamTestEvent() ; +// btb->SetAddress(&fBTE) ; +// btb->GetEntry(event) ; +// } +// else{ +// if(fBTE){ +// delete fBTE ; +// fBTE = 0 ; +// } +// } // Loads the type of object(s) requested rl->GetEvent(event) ; - if( strstr(opt,"X") || (strcmp(opt,"")==0) ) + if(strstr(opt,"X") || (strcmp(opt,"")==0)){ ReadPrimaries() ; - - if(strstr(opt,"H") ) + } + + if(strstr(opt,"H") ){ ReadTreeH(); - - if(strstr(opt,"S") ) + } + + if(strstr(opt,"S") ){ ReadTreeS() ; - - if( strstr(opt,"D") ) + } + + if(strstr(opt,"D") ){ ReadTreeD() ; - - if( strstr(opt,"R") ) + } + + if(strstr(opt,"R") ){ ReadTreeR() ; + } - if( strstr(opt,"T") ) + if( strstr(opt,"T") ){ ReadTreeT() ; + } - if( strstr(opt,"P") ) + if( strstr(opt,"P") ){ ReadTreeP() ; + } - if( strstr(opt,"E") ) + if( strstr(opt,"E") ){ ReadTreeE(event) ; + } - if( strstr(opt,"W") ) +if( strstr(opt,"W") ){ ReadRaw(event) ; + } -// if( strstr(opt,"Q") ) +// if( strstr(opt,"Q") && (fCurentEvent[9]!=event) ) // ReadTreeQA() ; +// } } @@ -532,111 +552,6 @@ Bool_t AliPHOSGetter::OpenESDFile() return rv ; } - -//____________________________________________________________________________ -void AliPHOSGetter::FitRaw(Bool_t lowGainFlag, TGraph * gLowGain, TGraph * gHighGain, TF1* signalF, Int_t & amp, Double_t & time) -{ - // Fits the raw signal time distribution - - const Int_t kNoiseThreshold = 0 ; - Double_t timezero1 = 0., timezero2 = 0., timemax = 0. ; - Double_t signal = 0., signalmax = 0. ; - Double_t energy = time = 0. ; - - if (lowGainFlag) { - timezero1 = timezero2 = signalmax = timemax = 0. ; - signalF->FixParameter(0, PHOS()->GetRawFormatLowCharge()) ; - signalF->FixParameter(1, PHOS()->GetRawFormatLowGain()) ; - Int_t index ; - for (index = 0; index < PHOS()->GetRawFormatTimeBins(); index++) { - gLowGain->GetPoint(index, time, signal) ; - if (signal > kNoiseThreshold && timezero1 == 0.) - timezero1 = time ; - if (signal <= kNoiseThreshold && timezero1 > 0. && timezero2 == 0.) - timezero2 = time ; - if (signal > signalmax) { - signalmax = signal ; - timemax = time ; - } - } - signalmax /= PHOS()->RawResponseFunctionMax(PHOS()->GetRawFormatLowCharge(), - PHOS()->GetRawFormatLowGain()) ; - if ( timezero1 + PHOS()->GetRawFormatTimePeak() < PHOS()->GetRawFormatTimeMax() * 0.4 ) { // else its noise - signalF->SetParameter(2, signalmax) ; - signalF->SetParameter(3, timezero1) ; - gLowGain->Fit(signalF, "QRON", "", 0., timezero2); //, "QRON") ; - energy = signalF->GetParameter(2) ; - time = signalF->GetMaximumX() - PHOS()->GetRawFormatTimePeak() - PHOS()->GetRawFormatTimeTrigger() ; - } - } else { - timezero1 = timezero2 = signalmax = timemax = 0. ; - signalF->FixParameter(0, PHOS()->GetRawFormatHighCharge()) ; - signalF->FixParameter(1, PHOS()->GetRawFormatHighGain()) ; - Int_t index ; - for (index = 0; index < PHOS()->GetRawFormatTimeBins(); index++) { - gHighGain->GetPoint(index, time, signal) ; - if (signal > kNoiseThreshold && timezero1 == 0.) - timezero1 = time ; - if (signal <= kNoiseThreshold && timezero1 > 0. && timezero2 == 0.) - timezero2 = time ; - if (signal > signalmax) { - signalmax = signal ; - timemax = time ; - } - } - signalmax /= PHOS()->RawResponseFunctionMax(PHOS()->GetRawFormatHighCharge(), - PHOS()->GetRawFormatHighGain()) ;; - if ( timezero1 + PHOS()->GetRawFormatTimePeak() < PHOS()->GetRawFormatTimeMax() * 0.4 ) { // else its noise - signalF->SetParameter(2, signalmax) ; - signalF->SetParameter(3, timezero1) ; - gHighGain->Fit(signalF, "QRON", "", 0., timezero2) ; - energy = signalF->GetParameter(2) ; - time = signalF->GetMaximumX() - PHOS()->GetRawFormatTimePeak() - PHOS()->GetRawFormatTimeTrigger() ; - } - } - - if (time == 0. && energy == 0.) - amp = 0 ; - else { - AliPHOSDigitizer * digitizer = Digitizer() ; - amp = static_cast( (energy - digitizer->GetEMCpedestal()) / digitizer->GetEMCchannel() + 0.5 ) ; - } - // dessin -// TCanvas * c1 = new TCanvas("c1","A Simple Graph Example",200,10,700,500); -// c1->SetFillColor(42); -// c1->SetGrid(); -// gLowGain->SetLineColor(2); -// gLowGain->SetLineWidth(4); -// gLowGain->SetMarkerColor(4); -// gLowGain->SetMarkerStyle(21); -// gLowGain->SetTitle("Lowgain"); -// gLowGain->GetXaxis()->SetTitle("X title"); -// gLowGain->GetYaxis()->SetTitle("Y title"); -// gLowGain->Draw("ACP"); - -// c1->Update(); -// c1->GetFrame()->SetFillColor(21); -// c1->GetFrame()->SetBorderSize(12); -// c1->Modified(); - -// TCanvas * c2 = new TCanvas("c2","A Simple Graph Example",200,10,700,500); -// c2->SetFillColor(42); -// c2->SetGrid(); -// gHighGain->SetLineColor(2); -// gHighGain->SetLineWidth(4); -// gHighGain->SetMarkerColor(4); -// gHighGain->SetMarkerStyle(21); -// gHighGain->SetTitle("Highgain"); -// gHighGain->GetXaxis()->SetTitle("X title"); -// gHighGain->GetYaxis()->SetTitle("Y title"); -// gHighGain->Draw("ACP"); - -// c2->Update(); -// c2->GetFrame()->SetFillColor(21); -// c2->GetFrame()->SetBorderSize(12); -// c2->Modified(); -} - //____________________________________________________________________________ Int_t AliPHOSGetter::ReadRaw(Int_t event) { @@ -645,74 +560,37 @@ Int_t AliPHOSGetter::ReadRaw(Int_t event) AliRawReaderFile rawReader(event) ; AliPHOSRawStream in(&rawReader); - - Bool_t first = kTRUE ; - - TF1 * signalF = new TF1("signal", AliPHOS::RawResponseFunction, 0, PHOS()->GetRawFormatTimeMax(), 4); - signalF->SetParNames("Charge", "Gain", "Amplitude", "TimeZero") ; - - Int_t relId[4], id ; - Bool_t lowGainFlag = kFALSE ; TClonesArray * digits = Digits() ; digits->Clear() ; Int_t idigit = 0 ; - Int_t amp = 0 ; - Double_t time = 0. ; - - TGraph * gLowGain = new TGraph(PHOS()->GetRawFormatTimeBins()) ; - TGraph * gHighGain= new TGraph(PHOS()->GetRawFormatTimeBins()) ; while ( in.Next() ) { // PHOS entries loop - if ( (in.IsNewRow() || in.IsNewColumn() || in.IsNewModule()) ) { - if (!first) { - FitRaw(lowGainFlag, gLowGain, gHighGain, signalF, amp, time) ; - if (amp > 0) { - new((*digits)[idigit]) AliPHOSDigit( -1, id, amp, time) ; - idigit++ ; - } - Int_t index ; - for (index = 0; index < PHOS()->GetRawFormatTimeBins(); index++) { - gLowGain->SetPoint(index, index * PHOS()->GetRawFormatTimeMax() / PHOS()->GetRawFormatTimeBins(), 0) ; - gHighGain->SetPoint(index, index * PHOS()->GetRawFormatTimeMax() / PHOS()->GetRawFormatTimeBins(), 0) ; - } - } - first = kFALSE ; - relId[0] = in.GetModule() ; - if ( relId[0] >= PHOS()->GetRawFormatLowGainOffset() ) { - relId[0] -= PHOS()->GetRawFormatLowGainOffset() ; - lowGainFlag = kTRUE ; - } else - lowGainFlag = kFALSE ; - relId[1] = 0 ; - relId[2] = in.GetRow() ; - relId[3] = in.GetColumn() ; - PHOSGeometry()->RelToAbsNumbering(relId, id) ; - } - if (lowGainFlag) - gLowGain->SetPoint(in.GetTime(), - in.GetTime()* PHOS()->GetRawFormatTimeMax() / PHOS()->GetRawFormatTimeBins(), - in.GetSignal()) ; - else - gHighGain->SetPoint(in.GetTime(), - in.GetTime() * PHOS()->GetRawFormatTimeMax() / PHOS()->GetRawFormatTimeBins(), - in.GetSignal() ) ; + + Int_t amp = in.GetSignal() ; + Double_t time = in.GetTime() ; + Int_t relId[4], id ; + relId[0] = in.GetModule() ; + if ( relId[0] >= PHOS()->GetRawFormatLowGainOffset() ) { + relId[0] -= PHOS()->GetRawFormatLowGainOffset() ; + } + relId[1] = 0 ; + relId[2] = in.GetRow() ; + relId[3] = in.GetColumn() ; + PHOSGeometry()->RelToAbsNumbering(relId, id) ; + + if (amp > 0 && id >=0 ) { + new((*digits)[idigit]) AliPHOSDigit( -1, id, amp, time) ; + idigit++ ; + } + } // PHOS entries loop - - FitRaw(lowGainFlag, gLowGain, gHighGain, signalF, amp, time) ; - if (amp > 0 ) { - new((*digits)[idigit]) AliPHOSDigit( -1, id, amp, time) ; - idigit++ ; - } + digits->Sort() ; - - delete signalF ; - delete gLowGain, gHighGain ; return digits->GetEntriesFast() ; } - //____________________________________________________________________________ Int_t AliPHOSGetter::ReadTreeD() { diff --git a/PHOS/AliPHOSGetter.h b/PHOS/AliPHOSGetter.h index fafad386b8a..8a93d8052b6 100644 --- a/PHOS/AliPHOSGetter.h +++ b/PHOS/AliPHOSGetter.h @@ -20,8 +20,6 @@ #include "TObject.h" class TParticle ; class TTree ; -class TGraph ; -class TF1 ; // --- Standard library --- @@ -50,6 +48,16 @@ public: AliPHOSGetter(){ // ctor: this is a singleton, the ctor should never be called but cint needs it as public Fatal("ctor", "AliPHOSGetter is a singleton default ctor not callable") ; } +protected : + AliPHOSGetter(Int_t /*i*/){ // special constructor for onflight + + } +private: + AliPHOSGetter(const char* headerFile, + const char* version = AliConfig::GetDefaultEventFolderName(), + Option_t * openingOption = "READ") ; + +public: AliPHOSGetter(const AliPHOSGetter & obj) : TObject(obj) { // cpy ctor requested by Coding Convention Fatal("cpy ctor", "not implemented") ; @@ -71,132 +79,133 @@ public: static void Print() ; //=========== General information about run ============== - Bool_t IsLoaded(TString tree) const { return fLoadingStatus.Contains(tree) ; } - void SetLoaded(TString tree) { fLoadingStatus += tree ; } + virtual Bool_t IsLoaded(TString tree) const { return fLoadingStatus.Contains(tree) ; } + virtual void SetLoaded(TString tree) { fLoadingStatus += tree ; } - Int_t MaxEvent() const ; - Int_t EventNumber() const ; - Bool_t VersionExists(TString & opt) const ; - UShort_t EventPattern(void) const ; - Float_t BeamEnergy(void) const ; + virtual Int_t MaxEvent() const ; + virtual Int_t EventNumber() const ; + virtual Bool_t VersionExists(TString & opt) const ; + virtual UShort_t EventPattern(void) const ; + virtual Float_t BeamEnergy(void) const ; //========== PHOSGeometry and PHOS ============= - AliPHOS * PHOS() const ; - AliPHOSGeometry * PHOSGeometry() const ; + virtual AliPHOS * PHOS() const ; + virtual AliPHOSGeometry * PHOSGeometry() const ; //========== Methods to read something from file ========== - void Event(Int_t event, const char * opt = "HSDRTP") ; - void Track(Int_t itrack) ; + virtual void Event(Int_t event, const char * opt = "HSDRTP") ; + virtual void Track(Int_t itrack) ; + //-----------------now getter's data-------------------------------------- - // AliPHOSCalibrationDB * CalibrationDB(){return fcdb; } - // void ReadCalibrationDB(const char * name, const char * filename) ; + virtual AliPHOSCalibrationDB * CalibrationDB(){return fcdb; } + virtual void ReadCalibrationDB(const char * /*name*/, const char * /*filename*/){ ;} //=========== Primaries ============ - TClonesArray * Primaries(void) ; - TParticle * Primary(Int_t index) const ; - Int_t NPrimaries()const { return fNPrimaries; } - TParticle * Secondary(const TParticle * p, Int_t index=1) const ; + virtual TClonesArray * Primaries(void) ; + virtual TParticle * Primary(Int_t index) const ; + virtual Int_t NPrimaries()const { return fNPrimaries; } + virtual TParticle * Secondary(const TParticle * p, Int_t index=1) const ; //=========== Hits ================= - TClonesArray * Hits(void) ; - AliPHOSHit * Hit(Int_t index) { return dynamic_cast(Hits()->At(index) );} - TTree * TreeH() const ; + virtual TClonesArray * Hits(void) ; + virtual AliPHOSHit * Hit(Int_t index) { return dynamic_cast(Hits()->At(index) );} + virtual TTree * TreeH() const ; //=========== SDigits ============== - TClonesArray * SDigits() ; - AliPHOSDigit * SDigit(Int_t index) { return static_cast(SDigits()->At(index)) ;} - TTree * TreeS() const ; - AliPHOSSDigitizer * SDigitizer() ; - - TString GetSDigitsFileName() const { return PhosLoader()->GetSDigitsFileName() ; } - Int_t LoadSDigits(Option_t* opt="") const { return PhosLoader()->LoadSDigits(opt) ; } - Int_t LoadSDigitizer(Option_t* opt="") const { return PhosLoader()->LoadSDigitizer(opt) ; } - Int_t WriteSDigits(Option_t* opt="") const { return PhosLoader()->WriteSDigits(opt) ; } - Int_t WriteSDigitizer(Option_t* opt="") const { + virtual TClonesArray * SDigits() ; + virtual AliPHOSDigit * SDigit(Int_t index) { return static_cast(SDigits()->At(index)) ;} + virtual TTree * TreeS() const ; + virtual AliPHOSSDigitizer * SDigitizer() ; + + virtual TString GetSDigitsFileName() const { return PhosLoader()->GetSDigitsFileName() ; } + virtual Int_t LoadSDigits(Option_t* opt="") const { return PhosLoader()->LoadSDigits(opt) ; } + virtual Int_t LoadSDigitizer(Option_t* opt="") const { return PhosLoader()->LoadSDigitizer(opt) ; } + virtual Int_t WriteSDigits(Option_t* opt="") const { return PhosLoader()->WriteSDigits(opt) ; } + virtual Int_t WriteSDigitizer(Option_t* opt="") const { return PhosLoader()->WriteSDigitizer(opt) ; } //========== Digits ================ - TClonesArray * Digits() ; - AliPHOSDigit * Digit(Int_t index) { return static_cast(Digits()->At(index)) ;} - TTree * TreeD() const ; - AliPHOSDigitizer * Digitizer() ; - TString GetDigitsFileName() const { return PhosLoader()->GetDigitsFileName() ; } - Int_t LoadDigits(Option_t* opt="") const { return PhosLoader()->LoadDigits(opt) ; } - Int_t LoadDigitizer(Option_t* opt="") const { + virtual TClonesArray * Digits() ; + virtual AliPHOSDigit * Digit(Int_t index) { return static_cast(Digits()->At(index)) ;} + virtual TTree * TreeD() const ; + virtual AliPHOSDigitizer * Digitizer() ; + virtual TString GetDigitsFileName() const { return PhosLoader()->GetDigitsFileName() ; } + virtual Int_t LoadDigits(Option_t* opt="") const { return PhosLoader()->LoadDigits(opt) ; } + virtual Int_t LoadDigitizer(Option_t* opt="") const { return PhosLoader()->LoadDigitizer(opt) ; } - Int_t WriteDigits(Option_t* opt="") const { return PhosLoader()->WriteDigits(opt) ; } - Int_t WriteDigitizer(Option_t* opt="") const { + virtual Int_t WriteDigits(Option_t* opt="") const { return PhosLoader()->WriteDigits(opt) ; } + virtual Int_t WriteDigitizer(Option_t* opt="") const { return PhosLoader()->WriteDigitizer(opt) ; } + + //Methods to distinguish raw and simulated digits + virtual Bool_t IsRawDigits(void) const {return fRawDigits;} + virtual void SetRawDigits(Bool_t isRaw = kTRUE){fRawDigits = isRaw;} //========== RecPoints ============= - TObjArray * EmcRecPoints() ; - AliPHOSEmcRecPoint * EmcRecPoint(Int_t index) { return static_cast(EmcRecPoints()->At(index)) ;} - TObjArray * CpvRecPoints() ; - AliPHOSCpvRecPoint * CpvRecPoint(Int_t index) { return static_cast(CpvRecPoints()->At(index)) ;} - TTree * TreeR() const ; - AliPHOSClusterizer * Clusterizer() ; - TString GetRecPointsFileName() const { return PhosLoader()->GetRecPointsFileName() ; } - Int_t LoadRecPoints(Option_t* opt="") const { return PhosLoader()->LoadRecPoints(opt) ; } - Int_t LoadClusterizer(Option_t* opt="") const { + virtual TObjArray * EmcRecPoints() ; + virtual AliPHOSEmcRecPoint * EmcRecPoint(Int_t index) { return static_cast(EmcRecPoints()->At(index)) ;} + virtual TObjArray * CpvRecPoints() ; + virtual AliPHOSCpvRecPoint * CpvRecPoint(Int_t index) { return static_cast(CpvRecPoints()->At(index)) ;} + virtual TTree * TreeR() const ; + virtual AliPHOSClusterizer * Clusterizer() ; + virtual TString GetRecPointsFileName() const { return PhosLoader()->GetRecPointsFileName() ; } + virtual Int_t LoadRecPoints(Option_t* opt="") const { return PhosLoader()->LoadRecPoints(opt) ; } + virtual Int_t LoadClusterizer(Option_t* opt="") const { return PhosLoader()->LoadClusterizer(opt) ; } - Int_t WriteRecPoints(Option_t* opt="") const { return PhosLoader()->WriteRecPoints(opt) ; } - Int_t WriteClusterizer(Option_t* opt="") const { + virtual Int_t WriteRecPoints(Option_t* opt="") const { return PhosLoader()->WriteRecPoints(opt) ; } + virtual Int_t WriteClusterizer(Option_t* opt="") const { return PhosLoader()->WriteClusterizer(opt) ; } //========== TrackSegments TClonesArray * TrackSegments(const char * name = 0) { - TClonesArray * TrackSegments() ; - AliPHOSTrackSegment * TrackSegment(Int_t index) { return static_cast(TrackSegments()->At(index)) ;} - TTree * TreeT() const ; - AliPHOSTrackSegmentMaker * TrackSegmentMaker() ; - TString GetTracksFileName() const { return PhosLoader()->GetTracksFileName() ; } - Int_t LoadTracks(Option_t* opt="") const { return PhosLoader()->LoadTracks(opt) ; } - Int_t LoadTrackSegementMaker(Option_t* opt="") const { + virtual TClonesArray * TrackSegments() ; + virtual AliPHOSTrackSegment * TrackSegment(Int_t index) { return static_cast(TrackSegments()->At(index)) ;} + virtual TTree * TreeT() const ; + virtual AliPHOSTrackSegmentMaker * TrackSegmentMaker() ; + virtual TString GetTracksFileName() const { return PhosLoader()->GetTracksFileName() ; } + virtual Int_t LoadTracks(Option_t* opt="") const { return PhosLoader()->LoadTracks(opt) ; } + virtual Int_t LoadTrackSegementMaker(Option_t* opt="") const { return PhosLoader()->LoadTrackSegmentMaker(opt) ; } - Int_t WriteTracks(Option_t* opt="") const { return PhosLoader()->WriteTracks(opt) ; } - Int_t WriteTrackSegmentMaker(Option_t* opt="") const { + virtual Int_t WriteTracks(Option_t* opt="") const { return PhosLoader()->WriteTracks(opt) ; } + virtual Int_t WriteTrackSegmentMaker(Option_t* opt="") const { return PhosLoader()->WriteTracker(opt) ; } //========== RecParticles =========== - TClonesArray * RecParticles() ; - AliPHOSRecParticle * RecParticle(Int_t index) { return static_cast(RecParticles()->At(index)) ;} - TTree * TreeP() const ; - AliPHOSPID * PID() ; - TString GetRecParticlesFileName() const { return PhosLoader()->GetRecParticlesFileName() ; } - Int_t LoadRecParticles(Option_t* opt="") const { return PhosLoader()->LoadRecParticles(opt) ; } - Int_t LoadPID(Option_t* opt="") const { + virtual TClonesArray * RecParticles() ; + virtual AliPHOSRecParticle * RecParticle(Int_t index) { return static_cast(RecParticles()->At(index)) ;} + virtual TTree * TreeP() const ; + virtual AliPHOSPID * PID() ; + virtual TString GetRecParticlesFileName() const { return PhosLoader()->GetRecParticlesFileName() ; } + virtual Int_t LoadRecParticles(Option_t* opt="") const { return PhosLoader()->LoadRecParticles(opt) ; } + virtual Int_t LoadPID(Option_t* opt="") const { return PhosLoader()->LoadPID(opt) ; } - Int_t WriteRecParticles(Option_t* opt="") const { return PhosLoader()->WriteRecParticles(opt) ; } - Int_t WritePID(Option_t* opt="") const { + virtual Int_t WriteRecParticles(Option_t* opt="") const { return PhosLoader()->WriteRecParticles(opt) ; } + virtual Int_t WritePID(Option_t* opt="") const { return PhosLoader()->WritePID(opt) ; } //========== Raw =========== - Int_t ReadRaw(Int_t event) ; + virtual Int_t ReadRaw(Int_t event) ; - void SetDebug(Int_t level) {fgDebug = level;} // Set debug level - void PostClusterizer(AliPHOSClusterizer * clu) + virtual void SetDebug(Int_t level) {fgDebug = level;} // Set debug level + virtual void PostClusterizer(AliPHOSClusterizer * clu) const{PhosLoader()->PostClusterizer(clu) ; } - void PostPID(AliPHOSPID * pid) + virtual void PostPID(AliPHOSPID * pid) const{PhosLoader()->PostPID(pid) ; } - void PostTrackSegmentMaker(AliPHOSTrackSegmentMaker * tr) + virtual void PostTrackSegmentMaker(AliPHOSTrackSegmentMaker * tr) const{PhosLoader()->PostTrackSegmentMaker(tr) ; } - void PostSDigitizer (AliPHOSSDigitizer * sdigitizer) + virtual void PostSDigitizer (AliPHOSSDigitizer * sdigitizer) const {PhosLoader()->PostSDigitizer(sdigitizer);} - void PostDigitizer (AliPHOSDigitizer * digitizer) + virtual void PostDigitizer (AliPHOSDigitizer * digitizer) const {PhosLoader()->PostDigitizer(dynamic_cast(digitizer));} - TString Version() const { return PhosLoader()->GetTitle() ; } - AliPHOSLoader * PhosLoader() const { return fgPhosLoader ; } - void Reset() ; + virtual TString Version() const { return PhosLoader()->GetTitle() ; } + virtual AliPHOSLoader * PhosLoader() const { return fgPhosLoader ; } + virtual void Reset() ; - AliESD * ESD() const { return fESD ; } + virtual AliESD * ESD() const { return fESD ; } private: - AliPHOSGetter(const char* headerFile, - const char* version = AliConfig::GetDefaultEventFolderName(), - Option_t * openingOption = "READ") ; - Int_t ReadTreeD(void) ; Int_t ReadTreeH(void) ; Int_t ReadTreeR(void) ; @@ -208,7 +217,6 @@ private: Bool_t OpenESDFile() ; void ReadPrimaries(void) ; - void FitRaw(Bool_t lowGainFlag, TGraph * gLowGain, TGraph * gHighGain, TF1* signalF, Int_t & amp, Double_t & time) ; private: @@ -222,13 +230,17 @@ private: TString fESDFileName ; //! ESD File Name AliESD * fESD ; //! ESD object TTree * fESDTree ; //! ESD Tree + + Bool_t fRawDigits ; //! - // AliPHOSCalibrationDB * fcdb ; //! + AliPHOSCalibrationDB * fcdb ; //! static AliPHOSLoader * fgPhosLoader ; // the loader for the NewIO - static AliPHOSGetter * fgObjGetter; // pointer to the unique instance of the singleton enum EDataTypes{kHits,kSDigits,kDigits,kRecPoints,kTracks,kNDataTypes}; + + protected: + static AliPHOSGetter * fgObjGetter; // pointer to the unique instance of the singleton ClassDef(AliPHOSGetter,1) // Algorithm class that provides methods to retrieve objects from a list knowing the index -- 2.43.0