From d018ba668dd7841fc9000fe06c4a0bf538260f54 Mon Sep 17 00:00:00 2001 From: schutz Date: Tue, 20 Jan 2004 11:55:57 +0000 Subject: [PATCH] Added AliEMCALReconstructioner --- EMCAL/AliEMCALReconstructioner.cxx | 191 ++++++++++++++++++----------- EMCAL/AliEMCALReconstructioner.h | 45 +++---- EMCAL/EMCALLinkDef.h | 1 + EMCAL/libEMCAL.pkg | 3 +- 4 files changed, 143 insertions(+), 97 deletions(-) diff --git a/EMCAL/AliEMCALReconstructioner.cxx b/EMCAL/AliEMCALReconstructioner.cxx index 4544dfd7e2c..fef015ecb49 100644 --- a/EMCAL/AliEMCALReconstructioner.cxx +++ b/EMCAL/AliEMCALReconstructioner.cxx @@ -22,14 +22,13 @@ ///////////////////////////////////////////////////////////////////////////////////// // Wrapping class for reconstruction. Allows to produce reconstruction from // different steps: from previously produced hits,sdigits, etc. Each new reconstruction -// flow (e.g. digits, made from them RecPoints, subsequently made TrackSegments, +// flow (e.g. digits, made from them RecPoints, // subsequently made RecParticles) are distinguished by the title of created branches. One can // use this title as a comment, see use case below. // Thanks to getters, one can set // parameters to reconstruction briks. The full set of parameters is saved in the // corresponding branch: e.g. parameters of clusterizer are stored in branch -// TreeR::AliEMCALClusterizer with the same title as the branch containing the RecPoints. -// TTree does not support overwriting, therefore one can not produce several +// TreeR::AliEMCALClusterizer with the same title as the branch containing the RecPoints. // TTree does not support overwriting, therefore one can not produce several // branches with the same names and titles - use different titles. // // Use case: @@ -49,7 +48,7 @@ // // branches produced in this pass // root [4] r->StartFrom("AliEMCALClusterizer","Local max cut 0.02") // // means that will use already generated Digits and produce only RecPoints, -// // TS and RecParticles +// // and RecParticles // // // And finally one can call ExecuteTask() with the following options // root [5] r->ExecuteTask("debug all timing") @@ -60,23 +59,21 @@ // --- ROOT system --- -#include "TClonesArray.h" -#include "TROOT.h" -#include "TTree.h" -#include "TFile.h" - // --- Standard library --- +#include "Riostream.h" // --- AliRoot header files --- -#include "AliRun.h" +#include "AliRunLoader.h" +#include "AliESD.h" +#include "AliESDCaloTrack.h" #include "AliEMCALReconstructioner.h" #include "AliEMCALClusterizerv1.h" #include "AliEMCALDigitizer.h" #include "AliEMCALSDigitizer.h" -//#include "AliEMCALTrackSegmentMakerv1.h" -//#include "AliEMCALPIDv1.h" -//#include "AliEMCALFastRecParticle.h" -//#include "AliEMCALCpvRecPoint.h" +#include "AliEMCALPIDv1.h" +#include "AliEMCALGetter.h" + +#include "AliEMCALLoader.h" ClassImp(AliEMCALReconstructioner) @@ -84,61 +81,112 @@ ClassImp(AliEMCALReconstructioner) AliEMCALReconstructioner::AliEMCALReconstructioner():TTask("AliEMCALReconstructioner","") { // ctor - fToSplit = kFALSE ; fDigitizer = 0 ; fClusterizer = 0 ; - //fTSMaker = 0 ; - //fPID = 0 ; + fPID = 0 ; fSDigitizer = 0 ; - fHeaderFileName = "galice.root" ; fIsInitialized = kFALSE ; } //____________________________________________________________________________ -AliEMCALReconstructioner::AliEMCALReconstructioner(const char* headerFile,const char * branchName,Bool_t toSplit): -TTask("AliEMCALReconstructioner","") +AliEMCALReconstructioner::AliEMCALReconstructioner(const char* evFoldName,const char * branchName): +TTask("AliEMCALReconstructioner",evFoldName) { // ctor + AliRunLoader* rl = AliRunLoader::GetRunLoader(evFoldName); + if (rl == 0x0) + { + Fatal("AliEMCALReconstructioner","Can not get Run Loader from folder %s.",evFoldName); + } + if (rl->GetAliRun() == 0x0) + { + delete gAlice; + gAlice = 0x0; + rl->LoadgAlice(); + gAlice = rl->GetAliRun(); + } + + AliEMCALLoader* gime = dynamic_cast(rl->GetLoader("EMCALLoader")); + if (gime == 0x0) + { + Error("AliEMCALReconstructioner","Can not get EMCAL Loader"); + return; + } + + TString galicefn = rl->GetFileName(); + TString method("AliEMCALReconstructioner::AliEMCALReconstructioner("); + method = (((method + evFoldName)+",")+branchName)+"): "; - fHeaderFileName = headerFile ; - fToSplit = toSplit ; fSDigitsBranch= branchName; - fSDigitizer = new AliEMCALSDigitizer(fHeaderFileName.Data(),fSDigitsBranch.Data(),toSplit) ; - Add(fSDigitizer) ; - - fDigitsBranch=branchName ; - fDigitizer = new AliEMCALDigitizer(fHeaderFileName.Data(),fDigitsBranch.Data(),toSplit) ; + + //P.Skowronski remark + // Tasks has default fixed names + // other tasks can be added, even runtime + // with arbitrary name. See AliDataLoader:: + cout<<"\n\n\n"; + cout<PostSDigitizer(fSDigitizer); + + fDigitsBranch=branchName ; + cout<<"\n\n\n"; + cout<PostDigitizer(fDigitizer); fRecPointBranch=branchName ; - fClusterizer = new AliEMCALClusterizerv1(fHeaderFileName.Data(),fRecPointBranch.Data(),toSplit) ; - Add(fClusterizer) ; - - -// fTSBranch=branchName ; -// fTSMaker = new AliEMCALTrackSegmentMakerv1(fHeaderFileName.Data(),fTSBranch.Data(),toSplit) ; -// Add(fTSMaker) ; - + cout<<"\n\n\n"; + cout<PostReconstructioner(fClusterizer); -// fRecPartBranch=branchName ; -// fPID = new AliEMCALPIDv1(fHeaderFileName.Data(),fRecPartBranch.Data(),toSplit) ; -// Add(fPID) ; + fRecPartBranch=branchName ; + cout<<"\n\n\n"; + cout<SetEventRange(ievent,ievent); + fClusterizer->ExecuteTask(); + + fPID ->SetEventRange(ievent,ievent); + fPID ->ExecuteTask(); + + AliEMCALGetter *gime = AliEMCALGetter::Instance(); + TClonesArray *recParticles = gime->RecParticles(); + Int_t nOfRecParticles = recParticles->GetEntries(); + for (Int_t recpart=0; recpartAt(recpart)); + event->AddCaloTrack(ct); + } + +} //____________________________________________________________________________ void AliEMCALReconstructioner::Init() { @@ -148,64 +196,57 @@ void AliEMCALReconstructioner::Exec(Option_t *option) // Initialisation fSDigitsBranch="Default" ; - fSDigitizer = new AliEMCALSDigitizer(fHeaderFileName.Data(),fSDigitsBranch.Data(),fToSplit) ; + fSDigitizer = new AliEMCALSDigitizer(GetTitle(),fSDigitsBranch.Data()) ; Add(fSDigitizer) ; fDigitsBranch="Default" ; - fDigitizer = new AliEMCALDigitizer(fHeaderFileName.Data(),fDigitsBranch.Data(),fToSplit) ; + fDigitizer = new AliEMCALDigitizer(GetTitle(),fDigitsBranch.Data()); Add(fDigitizer) ; fRecPointBranch="Default" ; - fClusterizer = new AliEMCALClusterizerv1(fHeaderFileName.Data(),fRecPointBranch.Data(),fToSplit) ; + fClusterizer = new AliEMCALClusterizerv1(GetTitle(),fRecPointBranch.Data()); Add(fClusterizer) ; -// fTSBranch="Default" ; -// fTSMaker = new AliEMCALTrackSegmentMakerv1(fHeaderFileName.Data(),fTSBranch.Data(),fToSplit) ; -// Add(fTSMaker) ; - - -// fRecPartBranch="Default" ; -// fPID = new AliEMCALPIDv1(fHeaderFileName.Data(),fRecPartBranch.Data(),fToSplit) ; -// Add(fPID) ; + fRecPartBranch="Default"; + fPID = new AliEMCALPIDv1(GetTitle(),fRecPartBranch.Data()) ; + Add(fPID) ; fIsInitialized = kTRUE ; + } } //____________________________________________________________________________ AliEMCALReconstructioner::~AliEMCALReconstructioner() { // Delete data members if any - } -//____________________________________________________________________________ - -void AliEMCALReconstructioner::Print(Option_t * option)const { +void AliEMCALReconstructioner::Print()const { // Print reconstructioner data - printf("\n") ; - - printf(" Reconstruction of the header file "); - printf(fHeaderFileName.Data()); - printf("\n with the following modules:\n"); + TString message ; + message = "-----------------AliEMCALReconstructioner---------------\n" ; + message += " Reconstruction of the header file %s\n" ; + message += " with the following modules:\n" ; if(fSDigitizer->IsActive()){ - printf(" (+) "); - printf(fSDigitizer->GetName()); - printf(" to branch : "); - printf(fSDigitsBranch.Data()); + message += " (+) %s to branch %s\n" ; } if(fDigitizer->IsActive()){ - printf("\n (+) "); - printf(fDigitizer->GetName()); - printf(" to branch : "); - printf(fDigitsBranch.Data()); + message += " (+) %s to branch %s\n" ; } if(fClusterizer->IsActive()){ - printf("\n (+) "); - printf(fClusterizer->GetName()); - printf(" to branch : "); - printf(fRecPointBranch.Data()); - } + message += " (+) %s to branch %s\n" ; + } + + if(fPID->IsActive()){ + message += " (+) %s to branch %s\n" ; + } + Info("Print", message.Data(), + GetTitle(), + fSDigitizer->GetName(), fSDigitsBranch.Data(), + fDigitizer->GetName(), fDigitsBranch.Data() , + fClusterizer->GetName(), fRecPointBranch.Data(), + fPID->GetName(), fRecPartBranch.Data() ) ; } diff --git a/EMCAL/AliEMCALReconstructioner.h b/EMCAL/AliEMCALReconstructioner.h index 0ae1d5fc32a..dcdc54e9a99 100644 --- a/EMCAL/AliEMCALReconstructioner.h +++ b/EMCAL/AliEMCALReconstructioner.h @@ -8,19 +8,19 @@ //_________________________________________________________________________ // Wrapping class for reconstruction //*-- -//*-- Author: Gines Martinez & Yves Schutz (SUBATECH) +//*-- Author: Yves Schutz (SUBATECH) //*-- Dmitri Peressounko (SUBATECH & Kurchatov Institute) -#include + //#include // --- ROOT system --- #include "TTask.h" class AliEMCALDigitizer ; -class AliEMCALClusterizerv1 ; -//class AliEMCALTrackSegmentMaker ; +class AliEMCALClusterizer ; class AliEMCALPID ; class AliEMCALSDigitizer ; +class AliESD ; // --- Standard library --- @@ -31,28 +31,35 @@ class AliEMCALReconstructioner : public TTask { public: AliEMCALReconstructioner() ; //ctor - AliEMCALReconstructioner(const char * headreFile, const char * branchName = "Default",Bool_t toSplit = kFALSE) ; - AliEMCALReconstructioner(const AliEMCALReconstructioner & rec):TTask(rec) { + AliEMCALReconstructioner(const char * headreFile, const char * branchName = "Default"); + AliEMCALReconstructioner(const AliEMCALReconstructioner & rec) : TTask(rec) { // cpy ctor: // requested by the Coding Convention - Fatal("cpy ctor", "not implemented") ; + Fatal("cpy ctor", "not implemented") ; } virtual ~AliEMCALReconstructioner() ; - virtual void Exec(Option_t * option) ; + virtual void Exec(Option_t *) ; + void Clusters2Tracks(Int_t ievent, AliESD *event); AliEMCALDigitizer * GetDigitizer() const { return fDigitizer ; } - AliEMCALClusterizerv1 * GetClusterizer()const { return fClusterizer ; } - //AliEMCALPID * GetPID() const { return fPID; } - //AliEMCALTrackSegmentMaker * GetTSMaker() const { return fTSMaker ; } + AliEMCALClusterizer * GetClusterizer()const { return fClusterizer ; } + AliEMCALPID * GetPID() const { return fPID; } AliEMCALSDigitizer * GetSDigitizer() const { return fSDigitizer ; } - void Print(Option_t * option)const ; + void Print()const ; - AliEMCALReconstructioner & operator = (const AliEMCALReconstructioner & rvalue) { + // void SetBranchTitle(const char* branch,const char * title) ; + // // Sets the branch titles to separate different reconstruction flows + // + // void StartFrom(char * module = "SDigitizer",char * title = "Default") ; + // // From wich step reconstruction begins, + // // title to be set to all reconstructed branches + + AliEMCALReconstructioner & operator = (const AliEMCALReconstructioner & /*rvalue*/) { // assignement operator requested by coding convention but not needed - Fatal("operator =", "not implemented") ; + Fatal("operator =", "not implemented") ; return *this ; } @@ -62,24 +69,20 @@ private: private: - Bool_t fToSplit ; - TString fHeaderFileName ; // File with headers and gAlice TString fDigitsBranch ; // Title of digits branch TString fRecPointBranch ; // Title of RecPoints branch - TString fTSBranch ; // Title of TrackSegments branch TString fRecPartBranch ; // Title of RecParticles branch TString fSDigitsBranch ; // Title of SDigits branch AliEMCALDigitizer * fDigitizer ; //! Pointer to AliEMCALDigitizer - AliEMCALClusterizerv1 * fClusterizer ; //! Pointer to AliEMCALClusterizer - //AliEMCALPID * fPID ; //! Pointer to AliEMCALPID - //AliEMCALTrackSegmentMaker * fTSMaker ; //! Pointer to AliEMCALTrackSegmentMaker + AliEMCALClusterizer * fClusterizer ; //! Pointer to AliEMCALClusterizer + AliEMCALPID * fPID ; //! Pointer to AliEMCALPID AliEMCALSDigitizer * fSDigitizer ; //! Pointer to AliEMCALSDigitizer Bool_t fIsInitialized ; // kTRUE if reconstructioner is initialized - ClassDef(AliEMCALReconstructioner,3) // Reconstruction algorithm class (Base Class) + ClassDef(AliEMCALReconstructioner,1) // Reconstruction algorithm class (Base Class) }; diff --git a/EMCAL/EMCALLinkDef.h b/EMCAL/EMCALLinkDef.h index fb40b2e9147..1b0bfd1ee27 100644 --- a/EMCAL/EMCALLinkDef.h +++ b/EMCAL/EMCALLinkDef.h @@ -54,4 +54,5 @@ #pragma link C++ class AliEMCALPID+; #pragma link C++ class AliEMCALPIDv1+; #pragma link C++ class AliEMCALLoader+; +#pragma link C++ class AliEMCALReconstructioner+; #endif diff --git a/EMCAL/libEMCAL.pkg b/EMCAL/libEMCAL.pkg index 0abfc3b8f43..95208573713 100644 --- a/EMCAL/libEMCAL.pkg +++ b/EMCAL/libEMCAL.pkg @@ -42,7 +42,8 @@ AliEMCALRecParticle.cxx \ AliEMCALFastRecParticle.cxx \ AliEMCALPID.cxx \ AliEMCALPIDv1.cxx \ -AliEMCALLoader.cxx +AliEMCALLoader.cxx \ +AliEMCALReconstructioner.cxx HDRS= $(SRCS:.cxx=.h) -- 2.39.3