X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TOF%2FAliTOFReconstructor.cxx;h=4c2e1b67177cb263552a2c0ccfc6bcfa2f109043;hb=f754f2c452d0ee08a9a0aaef1933655e6f407604;hp=70bad529aeb6911a68f07cb8a02de2bf77953960;hpb=af885e0fc45eeab1177d3d34f858ccd8836787fb;p=u%2Fmrichter%2FAliRoot.git diff --git a/TOF/AliTOFReconstructor.cxx b/TOF/AliTOFReconstructor.cxx index 70bad529aeb..4c2e1b67177 100644 --- a/TOF/AliTOFReconstructor.cxx +++ b/TOF/AliTOFReconstructor.cxx @@ -21,108 +21,70 @@ // // /////////////////////////////////////////////////////////////////////////////// -#include "TFile.h" +#include +#include "TObjArray.h" +#include "TString.h" #include "AliLog.h" +#include "AliESDEvent.h" +#include "AliESDpid.h" #include "AliRawReader.h" -#include "AliRunLoader.h" +#include "AliTOFHeader.h" #include "AliTOFClusterFinder.h" -#include "AliTOFGeometry.h" -#include "AliTOFGeometryV5.h" +#include "AliTOFClusterFinderV1.h" #include "AliTOFcalib.h" #include "AliTOFtrackerMI.h" #include "AliTOFtracker.h" +#include "AliTOFtrackerV1.h" +#include "AliTOFT0maker.h" #include "AliTOFReconstructor.h" class TTree; -class AliESDEvent; - -extern TDirectory *gDirectory; -extern TFile *gFile; - ClassImp(AliTOFReconstructor) //____________________________________________________________________ AliTOFReconstructor::AliTOFReconstructor() : AliReconstructor(), - fTOFGeometry(0), - fTOFcalib(0) + fTOFcalib(0)/*, + fTOFT0maker(0)*/ { // // ctor // + //Retrieving the TOF calibration info - fTOFGeometry = new AliTOFGeometryV5(); - fTOFcalib = new AliTOFcalib(fTOFGeometry); - if(!fTOFcalib->ReadParFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} -} + fTOFcalib = new AliTOFcalib(); + fTOFcalib->Init(); -//------------------------------------------------------------------------ -AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source) - : AliReconstructor(), - fTOFGeometry(0), - fTOFcalib(0) -{ -// -// copy ctor -// - this->fTOFGeometry=source.fTOFGeometry; - this->fTOFcalib=source.fTOFcalib; -} +#if 0 + fTOFcalib->CreateCalObjects(); + + if(!fTOFcalib->ReadParOnlineDelayFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} + if(!fTOFcalib->ReadParOnlineStatusFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} + + if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} + + + if(!fTOFcalib->ReadDeltaBCOffsetFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} + if(!fTOFcalib->ReadCTPLatencyFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} + if(!fTOFcalib->ReadT0FillFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} + if(!fTOFcalib->ReadRunParamsFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);} +#endif -//------------------------------------------------------------------------ -AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source) -{ -// -// assignment op. -// - this->fTOFGeometry=source.fTOFGeometry; - this->fTOFcalib=source.fTOFcalib; - return *this; } + //_____________________________________________________________________________ AliTOFReconstructor::~AliTOFReconstructor() { // // dtor // - delete fTOFGeometry; - delete fTOFcalib; -} -//_____________________________________________________________________________ - void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader) const -{ -// reconstruct clusters from digits - - AliTOFClusterFinder tofClus(runLoader, fTOFcalib); - tofClus.Load(); - for (Int_t iEvent = 0; iEvent < runLoader->GetNumberOfEvents(); iEvent++) - { - AliDebug(2,Form("Local Event loop mode: Creating Recpoints from Digits, Event n. %i",iEvent)); - tofClus.Digits2RecPoints(iEvent); - } - tofClus.UnLoad(); - -} + delete fTOFcalib; -//_____________________________________________________________________________ -void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader, - AliRawReader *rawReader) const -{ -// reconstruct clusters from Raw Data - - AliTOFClusterFinder tofClus(runLoader, fTOFcalib); - tofClus.LoadClusters(); - Int_t iEvent = 0; - while (rawReader->NextEvent()) { - AliDebug(2,Form("Local Event loop mode: Creating Recpoints from Raw data, Event n. %i",iEvent)); - tofClus.Digits2RecPoints(iEvent,rawReader); - iEvent++; - } - tofClus.UnLoadClusters(); + //delete fTOFT0maker; } @@ -130,10 +92,45 @@ void AliTOFReconstructor::Reconstruct(AliRunLoader* runLoader, void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader, TTree *clustersTree) const { -// reconstruct clusters from Raw Data + // + // reconstruct clusters from Raw Data + // + + TString optionString = GetOption(); + + // use V1 cluster finder if selected + if (optionString.Contains("ClusterizerV1")) { + static AliTOFClusterFinderV1 tofClus(fTOFcalib); - AliTOFClusterFinder tofClus(fTOFcalib); - tofClus.Digits2RecPoints(rawReader, clustersTree); + // decoder version option + if (optionString.Contains("DecoderV0")) { + tofClus.SetDecoderVersion(0); + } + else if (optionString.Contains("DecoderV1")) { + tofClus.SetDecoderVersion(1); + } + else { + tofClus.SetDecoderVersion(2); + } + + tofClus.Digits2RecPoints(rawReader, clustersTree); + } + else { + static AliTOFClusterFinder tofClus(fTOFcalib); + + // decoder version option + if (optionString.Contains("DecoderV0")) { + tofClus.SetDecoderVersion(0); + } + else if (optionString.Contains("DecoderV1")) { + tofClus.SetDecoderVersion(1); + } + else { + tofClus.SetDecoderVersion(2); + } + + tofClus.Digits2RecPoints(rawReader, clustersTree); + } } @@ -141,11 +138,46 @@ void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader, void AliTOFReconstructor::Reconstruct(TTree *digitsTree, TTree *clustersTree) const { -// reconstruct clusters from Raw Data + // + // reconstruct clusters from digits + // AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); - AliTOFClusterFinder tofClus(fTOFcalib); - tofClus.Digits2RecPoints(digitsTree, clustersTree); + + TString optionString = GetOption(); + // use V1 cluster finder if selected + if (optionString.Contains("ClusterizerV1")) { + static AliTOFClusterFinderV1 tofClus(fTOFcalib); + + // decoder version option + if (optionString.Contains("DecoderV0")) { + tofClus.SetDecoderVersion(0); + } + else if (optionString.Contains("DecoderV1")) { + tofClus.SetDecoderVersion(1); + } + else { + tofClus.SetDecoderVersion(2); + } + + tofClus.Digits2RecPoints(digitsTree, clustersTree); + } + else { + static AliTOFClusterFinder tofClus(fTOFcalib); + + // decoder version option + if (optionString.Contains("DecoderV0")) { + tofClus.SetDecoderVersion(0); + } + else if (optionString.Contains("DecoderV1")) { + tofClus.SetDecoderVersion(1); + } + else { + tofClus.SetDecoderVersion(2); + } + + tofClus.Digits2RecPoints(digitsTree, clustersTree); + } } //_____________________________________________________________________________ @@ -154,54 +186,101 @@ void AliTOFReconstructor::Reconstruct(TTree *digitsTree, // reconstruct clusters from digits AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); - AliTOFClusterFinder tofClus(fTOFcalib); - tofClus.Raw2Digits(reader, digitsTree); + + TString optionString = GetOption(); + // use V1 cluster finder if selected + if (optionString.Contains("ClusterizerV1")) { + static AliTOFClusterFinderV1 tofClus(fTOFcalib); + + // decoder version option + if (optionString.Contains("DecoderV0")) { + tofClus.SetDecoderVersion(0); + } + else if (optionString.Contains("DecoderV1")) { + tofClus.SetDecoderVersion(1); + } + else { + tofClus.SetDecoderVersion(2); + } + + tofClus.Raw2Digits(reader, digitsTree); + } + else { + static AliTOFClusterFinder tofClus(fTOFcalib); + + // decoder version option + if (optionString.Contains("DecoderV0")) { + tofClus.SetDecoderVersion(0); + } + else if (optionString.Contains("DecoderV1")) { + tofClus.SetDecoderVersion(1); + } + else { + tofClus.SetDecoderVersion(2); + } + + tofClus.Raw2Digits(reader, digitsTree); + } } //_____________________________________________________________________________ -AliTracker* AliTOFReconstructor::CreateTracker(AliRunLoader* /*runLoader*/) const +AliTracker* AliTOFReconstructor::CreateTracker() const { -// create a TOF tracker + + // + // create a TOF tracker using + // TOF Reco Param collected by STEER + // TString selectedTracker = GetOption(); + + AliTracker *tracker; // use MI tracker if selected - if (selectedTracker.Contains("MI")) return new AliTOFtrackerMI(); - return new AliTOFtracker(); + if (selectedTracker.Contains("TrackerMI")) { + tracker = new AliTOFtrackerMI(); + } + // use V1 tracker if selected + else if (selectedTracker.Contains("TrackerV1")) { + tracker = new AliTOFtrackerV1(); + } + else { + tracker = new AliTOFtracker(); + } + return tracker; + } //_____________________________________________________________________________ -void AliTOFReconstructor::FillESD(AliRunLoader* /*runLoader*/, - AliESDEvent* /*esd*/) const +void AliTOFReconstructor::FillEventTimeWithTOF(AliESDEvent *event, AliESDpid *esdPID) { -// nothing to be done + // + // Fill AliESDEvent::fTOFHeader variable + // It contains the event_time estiamted by the TOF combinatorial algorithm + // -} + if (!GetRecoParam()) AliFatal("cannot get TOF RECO params"); -//_____________________________________________________________________________ -AliTOFGeometry* AliTOFReconstructor::GetTOFGeometry(AliRunLoader* runLoader) const -{ -// get the TOF parameters + Float_t tofResolution = GetRecoParam()->GetTimeResolution();// TOF time resolution in ps + AliTOFT0maker *tofT0maker = new AliTOFT0maker(esdPID); + tofT0maker->SetTimeResolution(tofResolution); + tofT0maker->ComputeT0TOF(event); + tofT0maker->WriteInESD(event); + tofT0maker->~AliTOFT0maker(); + delete tofT0maker; - AliTOFGeometry *tofGeom; + esdPID->SetTOFResponse(event,(AliESDpid::EStartTimeType_t)GetRecoParam()->GetStartTimeType()); - runLoader->CdGAFile(); - TDirectory *savedir=gDirectory; - TFile *in=(TFile*)gFile; - if (!in->IsOpen()) { - AliWarning("Geometry file is not open default TOF geometry will be used"); - tofGeom = new AliTOFGeometryV5(); - } - else { - in->cd(); - tofGeom = (AliTOFGeometry*) in->Get("TOFgeometry"); - } +} - savedir->cd(); +//_____________________________________________________________________________ +void +AliTOFReconstructor::FillESD(TTree *, TTree *, AliESDEvent * /*esdEvent*/) const +{ + // + // correct Texp + // + // - if (!tofGeom) { - AliError("no TOF geometry available"); - return NULL; - } - return tofGeom; + // fTOFcalib->CalibrateTExp(esdEvent); }