From f9fc20b412f2f4014a5c2d03b3696225002c2b18 Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 23 Mar 2011 14:32:07 +0000 Subject: [PATCH] mods in AliReconstruction and AliReconstructor for the upgrade (Annalisa) --- STEER/AliReconstruction.cxx | 27 +++++++++++++++++++++++++-- STEER/AliReconstruction.h | 8 ++++++++ STEER/AliReconstructor.cxx | 1 + 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/STEER/AliReconstruction.cxx b/STEER/AliReconstruction.cxx index 3e1c2d2989e..e7dce40f167 100644 --- a/STEER/AliReconstruction.cxx +++ b/STEER/AliReconstruction.cxx @@ -296,13 +296,15 @@ AliReconstruction::AliReconstruction(const char* gAliceFilename) : fNspecie(0), fSspecie(0), fNhighPt(0), - fShighPt(0) + fShighPt(0), + fUpgradeModule("") { // create reconstruction object with default parameters gGeoManager = NULL; for (Int_t iDet = 0; iDet < kNDetectors; iDet++) { fReconstructor[iDet] = NULL; + fUpgradeMask[iDet]=kFALSE; fLoader[iDet] = NULL; fTracker[iDet] = NULL; } @@ -409,7 +411,8 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) : fNspecie(0), fSspecie(0), fNhighPt(0), - fShighPt(0) + fShighPt(0), + fUpgradeModule("") { // copy constructor @@ -418,6 +421,7 @@ AliReconstruction::AliReconstruction(const AliReconstruction& rec) : } for (Int_t iDet = 0; iDet < kNDetectors; iDet++) { fReconstructor[iDet] = NULL; + fUpgradeMask[iDet] = kFALSE; fLoader[iDet] = NULL; fTracker[iDet] = NULL; } @@ -511,6 +515,7 @@ AliReconstruction& AliReconstruction::operator = (const AliReconstruction& rec) fRecoParam = rec.fRecoParam; for (Int_t iDet = 0; iDet < kNDetectors; iDet++) { + fUpgradeMask[iDet] = kFALSE; delete fReconstructor[iDet]; fReconstructor[iDet] = NULL; delete fLoader[iDet]; fLoader[iDet] = NULL; delete fTracker[iDet]; fTracker[iDet] = NULL; @@ -570,6 +575,7 @@ AliReconstruction& AliReconstruction::operator = (const AliReconstruction& rec) fSspecie = 0; fNhighPt = 0; fShighPt = 0; + fUpgradeModule=""; return *this; } @@ -852,6 +858,15 @@ void AliReconstruction::SetCDBLock() { AliCDBManager::Instance()->SetLock(1); } +//_____________________________________________________________________________ +void AliReconstruction::MatchUpgradeDetector() { + // Translates detector name in a boolean. + // The boolean is used in GetReconstructor to load the + // upgrade reconstructor instead of the standard one. + for(Int_t iDet = 0; iDet < kNDetectors; iDet++) { + if(fUpgradeModule.Contains(fgkDetectorName[iDet])) fUpgradeMask[iDet]=kTRUE; + } +} //_____________________________________________________________________________ Bool_t AliReconstruction::MisalignGeometry(const TString& detectors) { @@ -3082,6 +3097,14 @@ AliReconstructor* AliReconstruction::GetReconstructor(Int_t iDet) if (pluginHandler && (pluginHandler->LoadPlugin() == 0)) { reconstructor = (AliReconstructor*) pluginHandler->ExecPlugin(0); } + + // check if the upgrade reconstructor should be used instead of the standard one + if(fUpgradeMask[iDet]) { + if(reconstructor) delete reconstructor; + TClass *cl = new TClass(Form("Ali%sUpgradeReconstructor",fgkDetectorName[iDet])); + reconstructor = (AliReconstructor*)(cl->New()); + } + if (reconstructor) { TObject* obj = fOptions.FindObject(detName.Data()); if (obj) reconstructor->SetOption(obj->GetTitle()); diff --git a/STEER/AliReconstruction.h b/STEER/AliReconstruction.h index 507c754300f..f33547eb8c0 100644 --- a/STEER/AliReconstruction.h +++ b/STEER/AliReconstruction.h @@ -163,6 +163,10 @@ public: }; static Int_t GetDetIndex(const char * detector); + // Upgrade + void SetUpgradeModule(const char* detectors) {fUpgradeModule = detectors; MatchUpgradeDetector() ; } + void MatchUpgradeDetector(); + protected: virtual Bool_t ProcessEvent(void* event); void InitRun(const char* input); @@ -334,6 +338,10 @@ private: Int_t fSspecie; //! Number of events, sampled from fNspecie Int_t fNhighPt; //! Number of events, selected by IsHighPt Int_t fShighPt; //! Number of events, sampled from fNhighPt + + // Upgrade detector reconstruction + TString fUpgradeModule; + Bool_t fUpgradeMask[kNDetectors]; ClassDef(AliReconstruction, 39) // class for running the reconstruction }; diff --git a/STEER/AliReconstructor.cxx b/STEER/AliReconstructor.cxx index bf48eddc30b..5b37cb76194 100644 --- a/STEER/AliReconstructor.cxx +++ b/STEER/AliReconstructor.cxx @@ -100,6 +100,7 @@ const char* AliReconstructor::GetDetectorName() const detName = GetName(); detName.Remove(0, 3); detName.Remove(detName.Index("Reconstructor")); + detName.ReplaceAll("Upgrade",""); return detName.Data(); } -- 2.43.0