From 0d0d6b983a5bd02ff0618a84fc99cde8020a6f24 Mon Sep 17 00:00:00 2001 From: gconesab Date: Wed, 5 Jan 2011 12:09:21 +0000 Subject: [PATCH] Modifications to allow reclusterization during analysis --- EMCAL/AliEMCALAfterBurnerUF.cxx | 22 +++++++++++++++++----- EMCAL/AliEMCALAfterBurnerUF.h | 9 +++++---- EMCAL/AliEMCALClusterizer.cxx | 3 +-- EMCAL/AliEMCALClusterizer.h | 14 +++++++++++--- EMCAL/AliEMCALClusterizerNxN.cxx | 2 +- EMCAL/AliEMCALClusterizerv1.cxx | 2 +- EMCAL/AliEMCALRecPoint.cxx | 5 +++-- EMCAL/AliEMCALRecPoint.h | 2 +- 8 files changed, 40 insertions(+), 19 deletions(-) diff --git a/EMCAL/AliEMCALAfterBurnerUF.cxx b/EMCAL/AliEMCALAfterBurnerUF.cxx index 5bf62b420c7..c727fcbbfed 100644 --- a/EMCAL/AliEMCALAfterBurnerUF.cxx +++ b/EMCAL/AliEMCALAfterBurnerUF.cxx @@ -120,12 +120,12 @@ void AliEMCALAfterBurnerUF::Init() // required for global cluster position recalculation if (!gGeoManager) - Fatal("AliEMCALAfterBurnerUF::Init", "failed to import geometry.root"); + Info("AliEMCALAfterBurnerUF::Init", "gGeoManager was not set, be careful"); // initialize geometry, if not yet initialized if (!AliEMCALGeometry::GetInstance()) { - Warning("AliEMCALAfterBurnerUF::Init", "AliEMCALGeometry is not yet initialized. Initializing with EMCAL_FIRSTYEARV1"); - AliEMCALGeometry::GetInstance("EMCAL_FIRSTYEARV1"); + Warning("AliEMCALAfterBurnerUF::Init", "AliEMCALGeometry is not yet initialized. Initializing with EMCAL_COMPLETEV1"); + AliEMCALGeometry::GetInstance("EMCAL_COMPLETEV1"); } // AliEMCALRecPoint is using exactly this call @@ -146,13 +146,25 @@ AliEMCALAfterBurnerUF::~AliEMCALAfterBurnerUF() { if (fClusterUnfolding) delete fClusterUnfolding; - if (fRecPoints) delete fRecPoints; + if (fRecPoints) { + fRecPoints->Delete(); + delete fRecPoints; + } if (fDigitsArr) { fDigitsArr->Clear("C"); delete fDigitsArr; } } +//------------------------------------------------------------------------ +void AliEMCALAfterBurnerUF::Clear() +{ + //Clean the arrays + + if (fRecPoints) fRecPoints->Delete(); // do not Clear(), it leaks, why? + if (fDigitsArr) fDigitsArr->Clear("C"); + +} //------------------------------------------------------------------------ void AliEMCALAfterBurnerUF::RecPoints2Clusters(TObjArray *clusArray) { @@ -272,7 +284,7 @@ void AliEMCALAfterBurnerUF::UnfoldClusters(TObjArray *clusArray, AliVCaloCells * RecPoints2Clusters(clusArray); // clean up - fRecPoints->Clear(); + fRecPoints->Delete(); // do not Clear(), it leaks, why? fDigitsArr->Clear("C"); clusArray->Compress(); diff --git a/EMCAL/AliEMCALAfterBurnerUF.h b/EMCAL/AliEMCALAfterBurnerUF.h index 4a6fd3ca7aa..9c456bf3d10 100644 --- a/EMCAL/AliEMCALAfterBurnerUF.h +++ b/EMCAL/AliEMCALAfterBurnerUF.h @@ -26,7 +26,7 @@ class AliEMCALAfterBurnerUF { public: AliEMCALAfterBurnerUF(); - AliEMCALAfterBurnerUF(Float_t logWeight, Float_t ECALocMaxCut); + AliEMCALAfterBurnerUF(Float_t logWeight, Float_t locMaxCut); virtual ~AliEMCALAfterBurnerUF(); private: @@ -34,10 +34,11 @@ class AliEMCALAfterBurnerUF { AliEMCALAfterBurnerUF & operator = (const AliEMCALAfterBurnerUF & uf) ;//cpy assignment, put here to avoid compilation warning public: + virtual void Clear(); virtual void Init(); virtual void RecPoints2Clusters(TObjArray *clusArray); virtual void UnfoldClusters(TObjArray *clusArray, AliVCaloCells *cellsEMCAL); // does the job - + // getters and setters virtual AliEMCALUnfolding *GetClusterUnfoldingInstance() { return fClusterUnfolding; } @@ -45,8 +46,8 @@ class AliEMCALAfterBurnerUF { AliEMCALGeometry *fGeom; // EMCAL geometry Float_t fLogWeight; // used in AliEMCALRecPoint::EvalGlobalPosition() Float_t fECALocMaxCut; // this amount of energy must distinguish a local maximum from its neighbours - TObjArray *fRecPoints; // cluster <=> recPoint - TClonesArray *fDigitsArr; // cell <=> digit + TObjArray *fRecPoints; //! cluster <=> recPoint + TClonesArray *fDigitsArr; //-> cell <=> digit AliEMCALUnfolding *fClusterUnfolding; // unfolding class instance diff --git a/EMCAL/AliEMCALClusterizer.cxx b/EMCAL/AliEMCALClusterizer.cxx index f3cae2076a6..048553a0bc9 100644 --- a/EMCAL/AliEMCALClusterizer.cxx +++ b/EMCAL/AliEMCALClusterizer.cxx @@ -56,7 +56,6 @@ class TSystem; #include "AliEMCALCalibData.h" class AliCDBStorage; #include "AliCDBEntry.h" -#include "AliEMCALUnfolding.h" ClassImp(AliEMCALClusterizer) @@ -356,7 +355,7 @@ void AliEMCALClusterizer::InitParameters() fPar6[i] = recParam->GetPar6(i); }//end of loop over parameters - fClusterUnfolding=new AliEMCALUnfolding(fGeom,fECALocMaxCut,fSSPars,fPar5,fPar6); + InitClusterUnfolding(); for (i = 0; i < 8; i++) { AliDebug(1,Form("unfolding shower shape parameters: fSSPars=%f \n",fSSPars[i])); diff --git a/EMCAL/AliEMCALClusterizer.h b/EMCAL/AliEMCALClusterizer.h index 4aa0956328a..2e2e52be1a6 100644 --- a/EMCAL/AliEMCALClusterizer.h +++ b/EMCAL/AliEMCALClusterizer.h @@ -22,7 +22,7 @@ class TTree; class AliEMCALGeometry ; class AliEMCALCalibData ; class AliCaloCalibPedestal ; -class AliEMCALUnfolding ; +#include "AliEMCALUnfolding.h" class AliEMCALClusterizer : public TObject { @@ -61,8 +61,16 @@ public: virtual void SetMinECut(Float_t mine) { fMinECut = mine; } virtual void SetECALocalMaxCut(Float_t cut) { fECALocMaxCut = cut ; } virtual void SetECALogWeight(Float_t w) { fECAW0 = w ; } - virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) {fToUnfold = toUnfold ;} - + + //Unfolding + virtual void SetUnfolding(Bool_t toUnfold = kTRUE ) { fToUnfold = toUnfold ;} + virtual void SetSSPars (Int_t ipar, Double_t par) { fSSPars[ipar] = par ;} + virtual void SetPar5 (Int_t ipar, Double_t par) { fPar5 [ipar] = par ;} + virtual void SetPar6 (Int_t ipar, Double_t par) { fPar6 [ipar] = par ;} + virtual void InitClusterUnfolding() { + fClusterUnfolding=new AliEMCALUnfolding(fGeom,fECALocMaxCut,fSSPars,fPar5,fPar6); + } + virtual void SetInput(TTree *digitsTree); virtual void SetOutput(TTree *clustersTree); diff --git a/EMCAL/AliEMCALClusterizerNxN.cxx b/EMCAL/AliEMCALClusterizerNxN.cxx index a4eadaadee1..b3d0b122b29 100644 --- a/EMCAL/AliEMCALClusterizerNxN.cxx +++ b/EMCAL/AliEMCALClusterizerNxN.cxx @@ -131,7 +131,7 @@ void AliEMCALClusterizerNxN::Digits2Clusters(Option_t * option) { AliEMCALRecPoint * rp = dynamic_cast(fRecPoints->At(index)); if(rp){ - rp->EvalAll(fECAW0,fDigitsArr) ; + rp->EvalAll(fECAW0,fDigitsArr,fgkIsInputCalibrated) ; AliDebug(5, Form("MAX INDEX %d ", rp->GetMaximalEnergyIndex())); //For each rec.point set the distance to the nearest bad crystal rp->EvalDistanceToBadChannels(fCaloPed); diff --git a/EMCAL/AliEMCALClusterizerv1.cxx b/EMCAL/AliEMCALClusterizerv1.cxx index 41998b0662b..5177b9f8c57 100644 --- a/EMCAL/AliEMCALClusterizerv1.cxx +++ b/EMCAL/AliEMCALClusterizerv1.cxx @@ -118,7 +118,7 @@ void AliEMCALClusterizerv1::Digits2Clusters(Option_t * option) for(index = 0; index < fRecPoints->GetEntries(); index++) { AliEMCALRecPoint * rp = dynamic_cast(fRecPoints->At(index)); if(rp){ - rp->EvalAll(fECAW0,fDigitsArr) ; + rp->EvalAll(fECAW0,fDigitsArr,fgkIsInputCalibrated) ; //For each rec.point set the distance to the nearest bad crystal rp->EvalDistanceToBadChannels(fCaloPed); } diff --git a/EMCAL/AliEMCALRecPoint.cxx b/EMCAL/AliEMCALRecPoint.cxx index 96cc08165b6..4a638d0efd2 100644 --- a/EMCAL/AliEMCALRecPoint.cxx +++ b/EMCAL/AliEMCALRecPoint.cxx @@ -441,7 +441,7 @@ Int_t AliEMCALRecPoint::Compare(const TObject * obj) const //} //____________________________________________________________________________ -void AliEMCALRecPoint::EvalAll(Float_t logWeight,TClonesArray * digits) +void AliEMCALRecPoint::EvalAll(Float_t logWeight,TClonesArray * digits, const Bool_t justClusters) { // Evaluates cluster parameters @@ -465,7 +465,8 @@ void AliEMCALRecPoint::EvalAll(Float_t logWeight,TClonesArray * digits) EvalParents(digits); //Called last because it sets the global position of the cluster? - EvalLocal2TrackingCSTransform(); + //Do not call it when recalculating clusters out of standard reconstruction + if(!justClusters) EvalLocal2TrackingCSTransform(); } diff --git a/EMCAL/AliEMCALRecPoint.h b/EMCAL/AliEMCALRecPoint.h index b4af8a02745..26e61b82cff 100644 --- a/EMCAL/AliEMCALRecPoint.h +++ b/EMCAL/AliEMCALRecPoint.h @@ -56,7 +56,7 @@ class AliEMCALRecPoint : public AliCluster { virtual void SetClusterType(Int_t ver) { fClusterType = ver; } virtual Int_t GetClusterType() const { return fClusterType; } - virtual void EvalAll(Float_t logWeight, TClonesArray * digits); + virtual void EvalAll(Float_t logWeight, TClonesArray * digits, const Bool_t justClusters); virtual void EvalLocalPosition (Float_t logWeight, TClonesArray * digits); virtual void EvalGlobalPosition(Float_t logWeight, TClonesArray * digits); -- 2.31.1