Skip to content

Commit

Permalink
Account for BC dependent ALTRO/LHC clocks shift (#1099) (#1101)
Browse files Browse the repository at this point in the history
  • Loading branch information
chiarazampolli authored Jan 31, 2020
1 parent b85b9a2 commit 520c815
Show file tree
Hide file tree
Showing 13 changed files with 67 additions and 9 deletions.
12 changes: 10 additions & 2 deletions STEER/ESD/AliTrackerBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ AliTrackerBase::AliTrackerBase():
fZ(0),
fSigmaX(0.005),
fSigmaY(0.005),
fSigmaZ(0.010)
fSigmaZ(0.010),
fRun(0),
fOrbitNumber(0),
fPeriodNumber(0),
fBunchCrossNumber(0)
{
//--------------------------------------------------------------------
// The default constructor.
Expand All @@ -58,7 +62,11 @@ AliTrackerBase::AliTrackerBase(const AliTrackerBase &atr):
fZ(atr.fZ),
fSigmaX(atr.fSigmaX),
fSigmaY(atr.fSigmaY),
fSigmaZ(atr.fSigmaZ)
fSigmaZ(atr.fSigmaZ),
fRun(atr.fRun),
fOrbitNumber(atr.fOrbitNumber),
fPeriodNumber(atr.fPeriodNumber),
fBunchCrossNumber(atr.fBunchCrossNumber)
{
//--------------------------------------------------------------------
// The default constructor.
Expand Down
15 changes: 14 additions & 1 deletion STEER/ESD/AliTrackerBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ class AliTrackerBase : public TObject {
Int_t GetRunNumber() const {return fRun;}
void SetTimeStamp(UInt_t t) {fTimeStamp = t;}
void SetRunNumber(int run) {fRun = run;}

void SetBunchCrossNumber(UShort_t n) {fBunchCrossNumber=n;}
void SetPeriodNumber(UInt_t n) {fPeriodNumber=n;}
void SetOrbitNumber(UInt_t n) {fOrbitNumber=n;}

UShort_t GetBunchCrossNumber() const {return fBunchCrossNumber;}
UInt_t GetPeriodNumber() const {return fPeriodNumber;}
UInt_t GetOrbitNumber() const {return fOrbitNumber;}


static Double_t GetTrackPredictedChi2(AliExternalTrackParam *track,
Double_t mass, Double_t step,
const AliExternalTrackParam *backup);
Expand Down Expand Up @@ -101,7 +110,11 @@ class AliTrackerBase : public TObject {
UInt_t fTimeStamp; // event time stamp
Int_t fRun; // run number

ClassDef(AliTrackerBase,2) //base tracker
UInt_t fOrbitNumber; // Orbit Number
UInt_t fPeriodNumber; // Period Number
UShort_t fBunchCrossNumber; // Bunch Crossing Number

ClassDef(AliTrackerBase,3) //base tracker
};

//__________________________________________________________________________
Expand Down
5 changes: 4 additions & 1 deletion STEER/STEER/AliReconstruction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -2256,7 +2256,10 @@ Bool_t AliReconstruction::ProcessEvent(Int_t iEvent)
for (Int_t iDet = 0; iDet < kNDetectors; iDet++) {
if (fTracker[iDet]) { // some trackers need details about the run/time
fTracker[iDet]->SetTimeStamp(fesd->GetTimeStamp());
fTracker[iDet]->SetRunNumber(fesd->GetRunNumber());
fTracker[iDet]->SetOrbitNumber(fesd->GetOrbitNumber());
fTracker[iDet]->SetPeriodNumber(fesd->GetPeriodNumber());
fTracker[iDet]->SetBunchCrossNumber(fesd->GetBunchCrossNumber());
fTracker[iDet]->SetRunNumber(fesd->GetRunNumber());
}
//RS also some reconstructructors may need the time stamp
if (fReconstructor[iDet]) fReconstructor[iDet]->SetTimeStamp(fesd->GetTimeStamp());
Expand Down
3 changes: 3 additions & 0 deletions TPC/TPCbase/AliTPCTransform.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ AliTPCTransform::AliTPCTransform():
fLumiGraphMap(0),
fCurrentRun(0), //! current run
fCurrentTimeStamp(0), //! current time stamp
fAltroLHCShift(0),
fTimeDependentUpdated(kFALSE),
fCorrMapMode(kTRUE),
//
Expand Down Expand Up @@ -143,6 +144,7 @@ AliTPCTransform::AliTPCTransform(const AliTPCTransform& transform):
fLumiGraphMap(transform.fLumiGraphMap ? new TGraph(*transform.fLumiGraphMap) : 0),
fCurrentRun(transform.fCurrentRun), //! current run
fCurrentTimeStamp(transform.fCurrentTimeStamp), //! current time stamp
fAltroLHCShift(transform.fAltroLHCShift),
fTimeDependentUpdated(transform.fTimeDependentUpdated),
fCorrMapMode(transform.fCorrMapMode),
fDebugStreamer(0),
Expand Down Expand Up @@ -193,6 +195,7 @@ void AliTPCTransform::Transform(Double_t *x,Int_t *i,UInt_t /*time*/,
/// line approximation

if (!fCurrentRecoParam) return;
x[2] -= fAltroLHCShift; // account for the (BC%4)*100ns/200ns BC-dependent shift
Int_t row=TMath::Nint(x[0]);
Int_t pad=TMath::Nint(x[1]);
Int_t sector=i[0];
Expand Down
9 changes: 8 additions & 1 deletion TPC/TPCbase/AliTPCTransform.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ class AliTPCTransform:public AliTransform {
void SetCurrentRecoParam(AliTPCRecoParam* param){fCurrentRecoParam=param;}
void SetCurrentRun(Int_t run){fCurrentRun=run;}
void SetCurrentTimeStamp(time_t timeStamp);
void AccountCurrentBC(UShort_t bc);
void ApplyTransformations(Double_t *xyz, Int_t volID);
//
// new correction maps
Expand Down Expand Up @@ -125,6 +126,7 @@ class AliTPCTransform:public AliTransform {
TGraph* fLumiGraphMap; //!<! graph for current map luminosity (may be different from current run), owned by the class
Int_t fCurrentRun; //!<! current run
time_t fCurrentTimeStamp; //!<! current time stamp
Float_t fAltroLHCShift; //!<! current (BC%4)*25ns/100ns BC-dependent shift
Bool_t fTimeDependentUpdated; //!<! flag successful update of time dependent stuff
Bool_t fCorrMapMode; //!<! correction or distortion map mode
//
Expand All @@ -150,7 +152,7 @@ class AliTPCTransform:public AliTransform {

AliHLTTPCReverseTransformInfoV1* fTmpReverseTransformInfo; //!
//
ClassDef(AliTPCTransform,5)
ClassDef(AliTPCTransform,6)
/// \endcond
};

Expand Down Expand Up @@ -208,5 +210,10 @@ inline int AliTPCTransform::SectorDown(int idROC)
return idROC + (((idROC%18)== 0) ? 17 : -1); // change to the lower sector
}

//_________________________________________________
inline void AliTPCTransform::AccountCurrentBC(UShort_t bc)
{
fAltroLHCShift = (bc%4)*0.25; // (bc%4)*25ns/100ns
}

#endif
3 changes: 2 additions & 1 deletion TPC/TPCcalib/AliTPCcalibAlignInterpolation.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -468,7 +468,8 @@ void AliTPCcalibAlignInterpolation::Process(AliVEvent *eventV) {
transform->GetCurrentRecoParamNonConst()->SetAccountDistortions(kFALSE);

transform->SetCurrentTimeStamp(esdEvent->GetTimeStamp()); // to be independent from the time set by other tasks

transform->AccountCurrentBC( esdEvent->GetBunchCrossNumber() );

for (Int_t iTrack=0;iTrack<nTracks;iTrack++){ // Track loop
// 0.) For each track in each event, get the AliESDfriendTrack
AliESDtrack *esdTrack = esdEvent->GetTrack(iTrack);
Expand Down
13 changes: 13 additions & 0 deletions TPC/TPCcalib/AliTPCcalibBase.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ AliTPCcalibBase::AliTPCcalibBase():
fRun(0), //! current Run number
fEvent(0), //! current Event number
fTime(0), //! current Time
fOrbitNumber(0),
fPeriodNumber(0),
fBunchCrossNumber(0),
fTrigger(0), //! current trigger type
fMagF(0), //! current magnetic field
fTriggerMaskReject(-1), //trigger mask - reject trigger
Expand All @@ -93,6 +96,9 @@ AliTPCcalibBase::AliTPCcalibBase(const char * name, const char * title):
fRun(0), //! current Run number
fEvent(0), //! current Event number
fTime(0), //! current Time
fOrbitNumber(0),
fPeriodNumber(0),
fBunchCrossNumber(0),
fTrigger(0), //! current trigger type
fMagF(0), //! current magnetic field
fTriggerMaskReject(-1), //trigger mask - reject trigger
Expand All @@ -118,6 +124,9 @@ AliTPCcalibBase::AliTPCcalibBase(const AliTPCcalibBase&calib):
fRun(0), //! current Run number
fEvent(0), //! current Event number
fTime(0), //! current Time
fOrbitNumber(0),
fPeriodNumber(0),
fBunchCrossNumber(0),
fTrigger(0), //! current trigger type
fMagF(0), //! current magnetic field
fTriggerMaskReject(calib.fTriggerMaskReject), //trigger mask - reject trigger
Expand Down Expand Up @@ -192,6 +201,10 @@ void AliTPCcalibBase::UpdateEventInfo(AliVEvent * event){
fRun = event->GetRunNumber();
fEvent = event->GetEventNumberInFile();
fTime = event->GetTimeStamp();
fOrbitNumber = event->GetOrbitNumber();
fPeriodNumber = event->GetPeriodNumber();
fBunchCrossNumber = event->GetBunchCrossNumber();

fTrigger = event->GetTriggerMask();
fMagF = event->GetMagneticField();
fTriggerClass = event->GetFiredTriggerClasses().Data();
Expand Down
7 changes: 6 additions & 1 deletion TPC/TPCcalib/AliTPCcalibBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class AliTPCcalibBase:public TNamed {
Int_t fRun; //! current Run number
Int_t fEvent; //! current Event number
Int_t fTime; //! current Time
UInt_t fOrbitNumber; //! Orbit Number
UInt_t fPeriodNumber; //! Period Number
UShort_t fBunchCrossNumber; //! Bunch Crossing Number


ULong64_t fTrigger; //! current trigger mask
Float_t fMagF; // current magnetic field
Int_t fTriggerMaskReject; //trigger mask - non accept trigger
Expand All @@ -80,7 +85,7 @@ class AliTPCcalibBase:public TNamed {
private:
Int_t fDebugLevel; // debug level

ClassDef(AliTPCcalibBase,3)
ClassDef(AliTPCcalibBase,4)
};

#endif
1 change: 1 addition & 0 deletions TPC/TPCcalib/AliTPCcalibCalib.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ Bool_t AliTPCcalibCalib::RefitTrack(AliVTrack * track, AliTPCseed *seed, Float_
AliTPCParam *param = AliTPCcalibDB::Instance()->GetParameters();
transform->SetCurrentRun(fRun);
transform->SetCurrentTimeStamp((UInt_t)fTime);
transform->AccountCurrentBC( fBunchCrossNumber );
if(!fApplyExBCorrection) { // disable ExB correction in transform
if(transform->GetCurrentRecoParam())
transform->GetCurrentRecoParamNonConst()->SetUseExBCorrection(0);
Expand Down
3 changes: 2 additions & 1 deletion TPC/TPCcalib/AliTPCcalibGainMult.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,8 @@ void AliTPCcalibGainMult::Process(AliVEvent *event) {
AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
transform->SetCurrentRun(fRun);
transform->SetCurrentTimeStamp((UInt_t)fTime);

transform->AccountCurrentBC( fBunchCrossNumber );

const Int_t row0 = param->GetNRowLow();
const Int_t row1 = row0+param->GetNRowUp1();
const Int_t row2 = row1+param->GetNRowUp2();
Expand Down
3 changes: 2 additions & 1 deletion TPC/TPCcalib/AliTPCcalibTimeGain.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,8 @@ void AliTPCcalibTimeGain::Process(AliVEvent *event) {
AliTPCTransform *transform = AliTPCcalibDB::Instance()->GetTransform() ;
transform->SetCurrentRun(fRun);
transform->SetCurrentTimeStamp((UInt_t)fTime);

transform->AccountCurrentBC( fBunchCrossNumber );

if (fIsCosmic) { // this should be removed at some point based on trigger mask !?
ProcessCosmicEvent(event);
} else {
Expand Down
1 change: 1 addition & 0 deletions TPC/TPCrec/AliTPCclusterer.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,7 @@ void AliTPCclusterer::AddCluster(AliTPCclusterMI &c, bool addtoarray, Float_t *
if (transform->GetCurrentTimeStamp()!=fTimeStamp) {
transform->SetCurrentTimeStamp(fTimeStamp);
}
transform->AccountCurrentBC( fBunchCrossNumber );
Double_t x[3]={static_cast<Double_t>(c.GetRow()),static_cast<Double_t>(c.GetPad()),static_cast<Double_t>(c.GetTimeBin())};
Int_t i[1]={fSector};
transform->Transform(x,i,0,1);
Expand Down
1 change: 1 addition & 0 deletions TPC/TPCrec/AliTPCtracker.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -1484,6 +1484,7 @@ Int_t AliTPCtracker::LoadClusters(const TObjArray *arr)
transform->SetCurrentRecoParam((AliTPCRecoParam*)AliTPCReconstructor::GetRecoParam());
transform->SetCurrentTimeStamp( GetTimeStamp());
transform->SetCurrentRun( GetRunNumber() );
transform->AccountCurrentBC( GetBunchCrossNumber() );

AliWarning("Sector Change ins not checked in LoadClusters(const TObjArray *arr)");

Expand Down

0 comments on commit 520c815

Please sign in to comment.