]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
mods in AliReconstruction and AliReconstructor for the upgrade (Annalisa)
authorhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Mar 2011 14:32:07 +0000 (14:32 +0000)
committerhristov <hristov@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 23 Mar 2011 14:32:07 +0000 (14:32 +0000)
STEER/AliReconstruction.cxx
STEER/AliReconstruction.h
STEER/AliReconstructor.cxx

index 3e1c2d2989ef8290296f97f6077eb95812bf610e..e7dce40f16730a22869bb9a039c6efd8359e3a45 100644 (file)
@@ -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());
index 507c754300f239f968d0cf1aa3e9acba77fcd130..f33547eb8c0d76004f89a35fda530f107db77626 100644 (file)
@@ -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
 };
index bf48eddc30b7eec74b7c764e2ba927aac5d27c8f..5b37cb76194e2972390ab6dac129bb38f7b8dacc 100644 (file)
@@ -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();
 }