if (!time0TPC){
AliFatal("Time unisochronity missing");
}
+ AliTPCCorrection * correctionDelta = calib->GetTPCComposedCorrectionDelta();
if (!param){
AliFatal("Parameters missing");
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
//
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];
+ }
}
#include "AliTPCCalibRaw.h"
#include "AliTPCParam.h"
#include "AliTPCCorrection.h"
+#include "AliTPCComposedCorrection.h"
#include "AliTPCPreprocessorOnline.h"
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)
{
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)
{
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();
//
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")
}
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); //
+}
+
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;}
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
//
//
//
- AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
+ AliTPCcalibDB * calibDB = AliTPCcalibDB::Instance();
+ AliTPCTransform *transform = calibDB->GetTransform() ;
if (!transform) {
AliFatal("Tranformations not in calibDB");
return;
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]);
+ }
}
//_____________________________________________________________________________