]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TOF/AliTOFReconstructor.cxx
take care of gGeoManager handling
[u/mrichter/AliRoot.git] / TOF / AliTOFReconstructor.cxx
index 93919145f3f19f369a0eba488d6f26102e01081e..16fccb14a5d3ee0dbfef1434164788601b5df87a 100644 (file)
@@ -52,35 +52,26 @@ AliTOFReconstructor::AliTOFReconstructor()
 //
   
   //Retrieving the TOF calibration info  
-  fTOFcalib    = new AliTOFcalib();
+  fTOFcalib = new AliTOFcalib();
+  fTOFcalib->Init();
+
+#if 0
   fTOFcalib->CreateCalObjects();
 
   if(!fTOFcalib->ReadParOnlineDelayFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
   if(!fTOFcalib->ReadParOnlineStatusFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
 
   if(!fTOFcalib->ReadParOfflineFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
-}
 
-//------------------------------------------------------------------------
-AliTOFReconstructor::AliTOFReconstructor(const AliTOFReconstructor &source)
-  : AliReconstructor(),
-    fTOFcalib(0)
-{
-//
-// copy ctor
-//
-  this->fTOFcalib=source.fTOFcalib;
-}
 
-//------------------------------------------------------------------------
-AliTOFReconstructor & AliTOFReconstructor::operator=(const AliTOFReconstructor &source)
-{
-//
-// assignment op.
-//
-  this->fTOFcalib=source.fTOFcalib;
-  return *this;
+  if(!fTOFcalib->ReadDeltaBCOffsetFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
+  if(!fTOFcalib->ReadCTPLatencyFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
+  if(!fTOFcalib->ReadT0FillFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
+  if(!fTOFcalib->ReadRunParamsFromCDB("TOF/Calib",-1)) {AliFatal("Exiting, no CDB object found!!!");exit(0);}  
+#endif
+
 }
+
 //_____________________________________________________________________________
 AliTOFReconstructor::~AliTOFReconstructor() 
 {
@@ -98,14 +89,39 @@ void AliTOFReconstructor::Reconstruct(AliRawReader *rawReader,
   // reconstruct clusters from Raw Data
   //
 
-  TString selectedClusterFinder = GetOption();
+  TString optionString = GetOption();
+
   // use V1 cluster finder if selected
-  if (selectedClusterFinder.Contains("NCF")) {
+  if (optionString.Contains("ClusterizerV1")) {
     static AliTOFClusterFinderV1 tofClus(fTOFcalib);
+
+    // decoder version option
+    if (optionString.Contains("DecoderV0")) {
+      tofClus.SetDecoderVersion(0);
+    }
+    else if (optionString.Contains("DecoderV1")) {
+      tofClus.SetDecoderVersion(1);
+    }
+    else {
+      tofClus.SetDecoderVersion(2);
+    }
+    
     tofClus.Digits2RecPoints(rawReader, clustersTree);
   }
   else {
     static AliTOFClusterFinder tofClus(fTOFcalib);
+    
+    // decoder version option
+    if (optionString.Contains("DecoderV0")) {
+      tofClus.SetDecoderVersion(0);
+    }
+    else if (optionString.Contains("DecoderV1")) {
+      tofClus.SetDecoderVersion(1);
+    }
+    else {
+      tofClus.SetDecoderVersion(2);
+    }
+
     tofClus.Digits2RecPoints(rawReader, clustersTree);
   }
 
@@ -121,14 +137,38 @@ void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
 
   AliDebug(2,Form("Global Event loop mode: Creating Recpoints from Digits Tree")); 
 
-  TString selectedClusterFinder = GetOption();
+  TString optionString = GetOption();
   // use V1 cluster finder if selected
-  if (selectedClusterFinder.Contains("NCF")) {
+  if (optionString.Contains("ClusterizerV1")) {
     static AliTOFClusterFinderV1 tofClus(fTOFcalib);
+
+    // decoder version option
+    if (optionString.Contains("DecoderV0")) {
+      tofClus.SetDecoderVersion(0);
+    }
+    else if (optionString.Contains("DecoderV1")) {
+      tofClus.SetDecoderVersion(1);
+    }
+    else {
+      tofClus.SetDecoderVersion(2);
+    }
+    
     tofClus.Digits2RecPoints(digitsTree, clustersTree);
   }
   else {
     static AliTOFClusterFinder tofClus(fTOFcalib);
+
+    // decoder version option
+    if (optionString.Contains("DecoderV0")) {
+      tofClus.SetDecoderVersion(0);
+    }
+    else if (optionString.Contains("DecoderV1")) {
+      tofClus.SetDecoderVersion(1);
+    }
+    else {
+      tofClus.SetDecoderVersion(2);
+    }
+    
     tofClus.Digits2RecPoints(digitsTree, clustersTree);
   }
 
@@ -140,14 +180,38 @@ void AliTOFReconstructor::Reconstruct(TTree *digitsTree,
 
   AliDebug(2,Form("Global Event loop mode: Converting Raw Data to a Digits Tree")); 
 
-  TString selectedClusterFinder = GetOption();
+  TString optionString = GetOption();
   // use V1 cluster finder if selected
-  if (selectedClusterFinder.Contains("NCF")) {
+  if (optionString.Contains("ClusterizerV1")) {
     static AliTOFClusterFinderV1 tofClus(fTOFcalib);
+
+    // decoder version option
+    if (optionString.Contains("DecoderV0")) {
+      tofClus.SetDecoderVersion(0);
+    }
+    else if (optionString.Contains("DecoderV1")) {
+      tofClus.SetDecoderVersion(1);
+    }
+    else {
+      tofClus.SetDecoderVersion(2);
+    }
+    
     tofClus.Raw2Digits(reader, digitsTree);
   }
   else {
     static AliTOFClusterFinder tofClus(fTOFcalib);
+
+    // decoder version option
+    if (optionString.Contains("DecoderV0")) {
+      tofClus.SetDecoderVersion(0);
+    }
+    else if (optionString.Contains("DecoderV1")) {
+      tofClus.SetDecoderVersion(1);
+    }
+    else {
+      tofClus.SetDecoderVersion(2);
+    }
+    
     tofClus.Raw2Digits(reader, digitsTree);
   }
 
@@ -166,11 +230,11 @@ AliTracker* AliTOFReconstructor::CreateTracker() const
  
   AliTracker *tracker;
   // use MI tracker if selected
-  if (selectedTracker.Contains("MI")) {
+  if (selectedTracker.Contains("TrackerMI")) {
     tracker = new AliTOFtrackerMI();
   }
   // use V1 tracker if selected
-  if (selectedTracker.Contains("V1")) {
+  else if (selectedTracker.Contains("TrackerV1")) {
     tracker =  new AliTOFtrackerV1();
   }
   else {