X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=TRD%2FAliTRDReconstructor.cxx;h=4769387e31c28cb54bf91713c7235be1ff64f0f8;hb=d6882b38e994e5cd8d8b4a7192e4aad7418a008d;hp=85d2dcee0978f096d4db33d80edd9655e3dde36d;hpb=bdbb05bb7ec7474aa9a07ec884d702e042cb7001;p=u%2Fmrichter%2FAliRoot.git diff --git a/TRD/AliTRDReconstructor.cxx b/TRD/AliTRDReconstructor.cxx index 85d2dcee097..4769387e31c 100644 --- a/TRD/AliTRDReconstructor.cxx +++ b/TRD/AliTRDReconstructor.cxx @@ -17,77 +17,128 @@ /////////////////////////////////////////////////////////////////////////////// // // -// class for TRD reconstruction // +// Class for TRD reconstruction // // // /////////////////////////////////////////////////////////////////////////////// +#include -#include "AliTRDReconstructor.h" #include "AliRunLoader.h" -#include "AliTRDparameter.h" -#include "AliTRDclusterizerV1.h" -#include "AliTRDtracker.h" -#include +#include "AliRawReader.h" +#include "AliLog.h" +#include "AliESDTrdTrack.h" +#include "AliESDEvent.h" +#include "AliTRDReconstructor.h" +#include "AliTRDclusterizer.h" +#include "AliTRDtracker.h" +#include "AliTRDpidESD.h" +#include "AliTRDgtuTrack.h" +#include "AliTRDrawData.h" +#include "AliTRDdigitsManager.h" +#include "AliTRDtrackerV1.h" +#include "AliTRDrecoParam.h" ClassImp(AliTRDReconstructor) +Bool_t AliTRDReconstructor::fgkSeedingOn = kFALSE; +Int_t AliTRDReconstructor::fgStreamLevel = 0; // Stream (debug) level +AliTRDrecoParam* AliTRDReconstructor::fgRecoParam = 0x0; + //_____________________________________________________________________________ -void AliTRDReconstructor::Reconstruct(AliRunLoader* runLoader) const -{ -// reconstruct clusters - - AliLoader *loader=runLoader->GetLoader("TRDLoader"); - loader->LoadRecPoints("recreate"); - - AliTRDclusterizerV1 clusterer("clusterer", "TRD clusterizer"); - runLoader->CdGAFile(); - AliTRDparameter* trdParam = GetTRDparameter(runLoader); - if (!trdParam) { - Error("Reconstruct", "no TRD parameters found"); - return; - } - trdParam->ReInit(); - clusterer.SetParameter(trdParam); - Int_t nEvents = runLoader->GetNumberOfEvents(); - - for (Int_t iEvent = 0; iEvent < nEvents; iEvent++) { - clusterer.Open(runLoader->GetFileName(), iEvent); - clusterer.ReadDigits(); - clusterer.MakeClusters(); - clusterer.WriteClusters(-1); - } +AliTRDReconstructor::~AliTRDReconstructor() { + if(fgRecoParam) delete fgRecoParam; } + + //_____________________________________________________________________________ -AliTracker* AliTRDReconstructor::CreateTracker(AliRunLoader* runLoader) const +void AliTRDReconstructor::ConvertDigits(AliRawReader *rawReader + , TTree *digitsTree) const { -// create a TRD tracker + // + // Convert raw data digits into digit objects in a root tree + // + + AliInfo("Convert raw data digits into digit objects [RawReader -> Digit TTree]"); + + AliTRDrawData rawData; + rawReader->Reset(); + rawReader->Select("TRD"); + AliTRDdigitsManager *manager = rawData.Raw2Digits(rawReader); + manager->MakeBranch(digitsTree); + manager->WriteDigits(); + delete manager; - runLoader->CdGAFile(); - return new AliTRDtracker(gFile); } //_____________________________________________________________________________ -void AliTRDReconstructor::FillESD(AliRunLoader* /*runLoader*/, - AliESD* /*esd*/) const +void AliTRDReconstructor::Reconstruct(AliRawReader *rawReader + , TTree *clusterTree) const { + // + // Reconstruct clusters + // + + AliInfo("Reconstruct TRD clusters from RAW data [RawReader -> Cluster TTree]"); + + // TODO move it to rec.C. check TPC + if (!fgRecoParam) fgRecoParam = AliTRDrecoParam::GetLowFluxParam(); + + rawReader->Reset(); + rawReader->Select("TRD"); + + // New (fast) cluster finder + AliTRDclusterizer clusterer("clusterer","TRD clusterizer"); + clusterer.OpenOutput(clusterTree); + clusterer.SetAddLabels(kFALSE); + clusterer.Raw2ClustersChamber(rawReader); + } +//_____________________________________________________________________________ +void AliTRDReconstructor::Reconstruct(TTree *digitsTree + , TTree *clusterTree) const +{ + // + // Reconstruct clusters + // + + AliInfo("Reconstruct TRD clusters from Digits [Digit TTree -> Cluster TTree]"); + + // TODO move it to rec.C. check TPC + if (!fgRecoParam) fgRecoParam = AliTRDrecoParam::GetLowFluxParam(); + + AliTRDclusterizer clusterer("clusterer","TRD clusterizer"); + clusterer.OpenOutput(clusterTree); + clusterer.ReadDigits(digitsTree); + clusterer.MakeClusters(); + +} //_____________________________________________________________________________ -AliTRDparameter* AliTRDReconstructor::GetTRDparameter(AliRunLoader* runLoader) const +AliTracker *AliTRDReconstructor::CreateTracker() const { -// get the TRD parameters - - runLoader->CdGAFile(); - AliTRDparameter* trdParam = (AliTRDparameter*) gFile->Get("TRDparameter"); - if (!trdParam) { - Error("GetTRDparameter", "no TRD parameters available"); - return NULL; - } - return trdParam; + // + // Create a TRD tracker + // + + //return new AliTRDtracker(NULL); + + // TODO move it to rec.C. check TPC + if (!fgRecoParam) fgRecoParam = AliTRDrecoParam::GetLowFluxParam(); + return new AliTRDtrackerV1(); + } +//_____________________________________________________________________________ +void AliTRDReconstructor::FillESD(TTree* /*digitsTree*/ + , TTree* /*clusterTree*/ + , AliESDEvent* /*esd*/) const +{ + // + // Fill ESD + // +}