]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Possiibility to use time dependent alignment
authormarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Feb 2011 16:20:18 +0000 (16:20 +0000)
committermarian <marian@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 18 Feb 2011 16:20:18 +0000 (16:20 +0000)
 AliTPCcalibDB.h AliTPCcalibDB.cxx - getter for time dependent alignment
 AliTPCTransform.cxx               - usage of time dependent alignment if available
                                   - use the trandormation instead olf cal pad for the z alignment - if available

AliTPCtrackerMI.cxx                - use alignment integrated in the Correction framework - if available

TPC/AliTPCTransform.cxx
TPC/AliTPCcalibDB.cxx
TPC/AliTPCcalibDB.h
TPC/AliTPCtrackerMI.cxx

index a99c508b460852a024b29ca64d9166b410f9d7fd..91d4affe1297752e0ed8b48a76452c47b00be545 100755 (executable)
@@ -156,6 +156,7 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/,
   if (!time0TPC){
     AliFatal("Time unisochronity missing");
   }
+  AliTPCCorrection * correctionDelta = calib->GetTPCComposedCorrectionDelta(); 
 
   if (!param){
     AliFatal("Parameters missing");
@@ -163,8 +164,8 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/,
 
   Double_t xx[3];
   //  Apply Time0 correction - Pad by pad fluctuation
-  //
-  x[2]-=time0TPC->GetCalROC(sector)->GetValue(row,pad);
+  //  
+  if (!calib->HasAlignmentOCDB()) x[2]-=time0TPC->GetCalROC(sector)->GetValue(row,pad);
   //
   // Tranform from pad - time coordinate system to the rotated global (tracking) system
   //
@@ -199,6 +200,13 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/,
     xx[0]=distPoint[0];
     xx[1]=distPoint[1];
     xx[2]=distPoint[2];
+    if (correctionDelta&&fCurrentRecoParam->GetUseAlignmentTime()){  // appply time dependent correction if available and enabled
+      Float_t distPointDelta[3]={xx[0],xx[1],xx[2]};
+      correction->CorrectPoint(distPointDelta, sector);
+      xx[0]=distPointDelta[0];
+      xx[1]=distPointDelta[1];
+      xx[2]=distPointDelta[2];
+    }
   } 
 
 
index 831830ec6901e37ca695b939733e0d4323264cdb..65435ff4aeddb2e7e46a1d984a02fd73277ad417 100644 (file)
@@ -125,6 +125,7 @@ class AliTPCCalDet;
 #include "AliTPCCalibRaw.h"
 #include "AliTPCParam.h"
 #include "AliTPCCorrection.h"
+#include "AliTPCComposedCorrection.h"
 #include "AliTPCPreprocessorOnline.h"
 
 
@@ -202,6 +203,7 @@ AliTPCcalibDB::AliTPCcalibDB():
   fVdriftArray(100000),                 //! array of v drift interfaces
   fDriftCorrectionArray(100000),  //! array of drift correction
   fRunList(100000),              //! run list - indicates try to get the run param 
+  fBHasAlignmentOCDB(kFALSE),    // Flag  - has the alignment on the composed correction ?
   fDButil(0),
   fCTPTimeParams(0)
 {
@@ -245,6 +247,7 @@ AliTPCcalibDB::AliTPCcalibDB(const AliTPCcalibDB& ):
   fVdriftArray(0),         //! array of v drift interfaces
   fDriftCorrectionArray(0), //! array of v drift corrections
   fRunList(0),              //! run list - indicates try to get the run param 
+  fBHasAlignmentOCDB(kFALSE),    // Flag  - has the alignment on the composed correction ?
   fDButil(0),
   fCTPTimeParams(0)
 {
@@ -466,14 +469,20 @@ void AliTPCcalibDB::Update(){
     fComposedCorrectionArray=dynamic_cast<TObjArray*>(entry->GetObject());
     if (fComposedCorrectionArray){
       for (Int_t i=0; i<fComposedCorrectionArray->GetEntries(); i++){
-       AliTPCCorrection* composedCorrection= dynamic_cast<AliTPCCorrection*>(fComposedCorrectionArray->At(i));
-       if (composedCorrection) composedCorrection->Init();
+       AliTPCComposedCorrection* composedCorrection= dynamic_cast<AliTPCComposedCorrection*>(fComposedCorrectionArray->At(i));
+       if (composedCorrection) {
+         composedCorrection->Init();
+         if (composedCorrection->GetCorrections()){
+           if (composedCorrection->GetCorrections()->FindObject("FitAlignTPC")){
+             fBHasAlignmentOCDB=kTRUE;
+           }
+         }
+       }
       }
-    }
+    }  
   }else{
     AliError("TPC - Missing calibration entry-  TPC/Calib/Correction")
-  }  
-
+  }    
   //
   if (!fTransform) {
     fTransform=new AliTPCTransform(); 
@@ -975,7 +984,13 @@ void AliTPCcalibDB::UpdateRunInformations( Int_t run, Bool_t force){
   //
   entry = AliCDBManager::Instance()->Get("TPC/Calib/TimeDrift",run);
   if (entry)  {
-    fDriftCorrectionArray.AddAt(entry->GetObject(),run);
+    TObjArray * timeArray = (TObjArray*)entry->GetObject();    
+    fDriftCorrectionArray.AddAt(entry->GetObject(),run);  
+    AliTPCCorrection * correctionTime = (AliTPCCorrection *)timeArray->FindObject("FitCorrectionTime");
+    if (correctionTime && fComposedCorrectionArray){
+      correctionTime->Init();
+      fComposedCorrectionArray->AddAt(correctionTime,4); //add time dependent correction to the list of available corrections
+    }
   }else{
     AliFatal("TPC - Missing calibration entry TimeDrift")
   }
@@ -1977,11 +1992,27 @@ AliTPCCalPad* AliTPCcalibDB::MakeDeadMap(Double_t notInMap, const char* nameMapp
 AliTPCCorrection * AliTPCcalibDB::GetTPCComposedCorrection(Float_t field) const{
   //
   // GetComposed correction for given field setting
-  //
+  // If not specific correction for field used return correction for all field
+  //        - Complication needed to gaurantee OCDB back compatibility 
+  //        - Not neeeded for the new space point correction 
   if (!fComposedCorrectionArray) return 0;
-  if (field>0.1) return (AliTPCCorrection *)fComposedCorrectionArray->At(1);
-  if (field<-0.1) return (AliTPCCorrection *)fComposedCorrectionArray->At(2);
+  if (field>0.1 && fComposedCorrectionArray->At(1)) {   
+    return (AliTPCCorrection *)fComposedCorrectionArray->At(1);
+  }
+  if (field<-0.1 &&fComposedCorrectionArray->At(2)) {
+    return (AliTPCCorrection *)fComposedCorrectionArray->At(2);
+  }
   return (AliTPCCorrection *)fComposedCorrectionArray->At(0);
   
 }
 
+
+AliTPCCorrection * AliTPCcalibDB::GetTPCComposedCorrectionDelta() const{
+  //
+  // GetComposedCorrection delta
+  // Delta is time dependent - taken form the CalibTime OCDB entry
+  //
+  if (!fComposedCorrectionArray) return 0;
+  return (AliTPCCorrection *)fComposedCorrectionArray->At(4);  //
+}
+
index 882e94b46ac6aada95deb46c8a7ac3c8aee41565..5940a5bd173c07e86bdf9a13dfa5ffb6d8556e53 100644 (file)
@@ -69,6 +69,8 @@ class AliTPCcalibDB : public TObject
   TObjArray * GetTPCComposedCorrectionArray() const { return fComposedCorrectionArray;}
   void          SetTPCComposedCorrection(AliTPCCorrection *compCorr) { fComposedCorrection=compCorr;}
   AliTPCCorrection * GetTPCComposedCorrection(Float_t field) const;
+  AliTPCCorrection * GetTPCComposedCorrectionDelta() const;
+  Bool_t      HasAlignmentOCDB() const { return fBHasAlignmentOCDB;}
 
   AliTPCCalPad* GetPadNoise() const {return fPadNoise;}
   AliTPCCalPad* GetPedestals() const{return fPedestals;}
@@ -215,6 +217,7 @@ protected:
   TObjArray      fDriftCorrectionArray;                //! array of drift correction
 
   TArrayI        fRunList;                                                     //! run list - indicates try to get the run param
+  Bool_t         fBHasAlignmentOCDB;                // Flag - alignment from the Transformation class
   //
   static AliTPCcalibDB* fgInstance;  // singleton control
   static Bool_t       fgTerminated;  // termination control 
index f00f0e403af3434d6966eecf5ae852a7885c9f5b..e7c5a8981c2ddd09010c0a52636d9276a8e8cbed 100644 (file)
@@ -1356,7 +1356,8 @@ void   AliTPCtrackerMI::Transform(AliTPCclusterMI * cluster){
   //
   //
   //
-  AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
+  AliTPCcalibDB * calibDB = AliTPCcalibDB::Instance();
+  AliTPCTransform *transform = calibDB->GetTransform() ;
   if (!transform) {
     AliFatal("Tranformations not in calibDB");
     return;
@@ -1392,22 +1393,23 @@ void   AliTPCtrackerMI::Transform(AliTPCclusterMI * cluster){
   cluster->SetY(x[1]);
   cluster->SetZ(x[2]);
   // The old stuff:
-
   //
   // 
   //
   //if (!fkParam->IsGeoRead()) fkParam->ReadGeoMatrices();
-  TGeoHMatrix  *mat = fkParam->GetClusterMatrix(cluster->GetDetector());
-  //TGeoHMatrix  mat;
-  Double_t pos[3]= {cluster->GetX(),cluster->GetY(),cluster->GetZ()};
-  Double_t posC[3]={cluster->GetX(),cluster->GetY(),cluster->GetZ()};
-  if (mat) mat->LocalToMaster(pos,posC);
-  else{
-    // chack Loading of Geo matrices from GeoManager - TEMPORARY FIX
-  }
-  cluster->SetX(posC[0]);
-  cluster->SetY(posC[1]);
-  cluster->SetZ(posC[2]);
+  if (AliTPCReconstructor::GetRecoParam()->GetUseSectorAlignment() && (!calibDB->HasAlignmentOCDB())){
+    TGeoHMatrix  *mat = fkParam->GetClusterMatrix(cluster->GetDetector());
+    //TGeoHMatrix  mat;
+    Double_t pos[3]= {cluster->GetX(),cluster->GetY(),cluster->GetZ()};
+    Double_t posC[3]={cluster->GetX(),cluster->GetY(),cluster->GetZ()};
+    if (mat) mat->LocalToMaster(pos,posC);
+    else{
+      // chack Loading of Geo matrices from GeoManager - TEMPORARY FIX
+    }
+    cluster->SetX(posC[0]);
+    cluster->SetY(posC[1]);
+    cluster->SetZ(posC[2]);
+  }
 }
 
 //_____________________________________________________________________________