X-Git-Url: http://git.uio.no/git/?p=u%2Fmrichter%2FAliRoot.git;a=blobdiff_plain;f=EMCAL%2FAliEMCALReconstructioner.cxx;h=fef015ecb49fb5b8a75879cbe12805ea3b4f8b2e;hp=9380eda3fbeb89c313904130ad1c710da10fc798;hb=d018ba668dd7841fc9000fe06c4a0bf538260f54;hpb=70479d0eaf6647221605280c1c435802bb47bfb8 diff --git a/EMCAL/AliEMCALReconstructioner.cxx b/EMCAL/AliEMCALReconstructioner.cxx index 9380eda3fbe..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,24 +59,21 @@ // --- ROOT system --- -#include "TClonesArray.h" -#include "TROOT.h" -#include "TTree.h" -#include "TFile.h" - // --- Standard library --- -#include +#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) @@ -85,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() { @@ -149,69 +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 - cout << "-----------------AliEMCALReconstructioner---------------" << endl ; - cout << " Reconstruction of the header file " <IsActive()){ - cout << " (+) " << fSDigitizer->GetName() << " to branch : " << fSDigitsBranch.Data() << endl ; - cout << endl ; + message += " (+) %s to branch %s\n" ; } if(fDigitizer->IsActive()){ - cout << " (+) " << fDigitizer->GetName() << " to branch : " << fDigitsBranch.Data() << endl ; - cout << endl ; + message += " (+) %s to branch %s\n" ; } if(fClusterizer->IsActive()){ - cout << " (+) " <GetName() << " to branch : " <IsActive()){ -// cout << " (+) " << fTSMaker->GetName() << " to branch : " << fTSBranch.Data() << endl ; -// cout << endl ; -// } - - -// if(fPID->IsActive()){ -// cout << " (+) " << fPID->GetName() << " to branch : " <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() ) ; }