--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+ *
+ *
+ * this class defines the CTPLatency object to be stored
+ * in OCDB in order to apply CTPLatency correction during
+ * reconstruction.
+ *
+ *
+ */
+
+#include "AliTOFCTPLatency.h"
+
+ClassImp(AliTOFCTPLatency)
+
+//_________________________________________________________
+
+AliTOFCTPLatency::AliTOFCTPLatency() :
+ TObject(),
+ fCTPLatency(0.)
+{
+ /*
+ * default constructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFCTPLatency::~AliTOFCTPLatency()
+{
+ /*
+ * default destructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFCTPLatency::AliTOFCTPLatency(const AliTOFCTPLatency &source) :
+ TObject(source),
+ fCTPLatency(source.fCTPLatency)
+{
+ /*
+ * copy constructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFCTPLatency &
+AliTOFCTPLatency::operator=(const AliTOFCTPLatency &source)
+{
+ /*
+ * operator=
+ */
+
+ if (this == &source) return *this;
+ TObject::operator=(source);
+ fCTPLatency = source.fCTPLatency;
+ return *this;
+}
+
--- /dev/null
+#ifndef ALITOFCTPLATENCY_H
+#define ALITOFCTPLATENCY_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+/* $Id$ */
+
+/*
+ *
+ *
+ * this class defines the CTPLatency object to be stored
+ * in OCDB in order to apply CTPLatency correction during
+ * reconstruction.
+ *
+ *
+ */
+
+#include "TObject.h"
+
+class AliTOFCTPLatency :
+public TObject
+{
+
+ public:
+
+ AliTOFCTPLatency(); // default constructor
+ virtual ~AliTOFCTPLatency(); // default destructor
+ AliTOFCTPLatency(const AliTOFCTPLatency &source); // copy constructor
+ AliTOFCTPLatency &operator=(const AliTOFCTPLatency &source); // operator=
+ Float_t GetCTPLatency() const {return fCTPLatency;}; // getter
+ void SetCTPLatency(Float_t value) {fCTPLatency = value;}; // setter
+
+ private:
+
+ Float_t fCTPLatency; // CTP latency (ps)
+
+ ClassDef(AliTOFCTPLatency, 1);
+};
+
+#endif /* ALITOFCTPLATENCY_H */
// ctor with size
for (Int_t ich = 0; ich<size; ich ++){
SetStatus(ich,kTOFOnlineUnknown);
- SetLatencyWindow(ich, -1);
+ SetLatencyWindow(ich, 0);
}
}
//________________________________________________________________
Int_t AliTOFChannelOnlineStatusArray::GetLatencyWindow(Int_t pos) const
{
// getting the latency window for channel at position = pos
- Int_t lw = -1;
+ Int_t lw = 0;
if (!fLatencyWindow) {
AliWarning("cannot get latency window");
return lw;
#include "AliTOFrawData.h"
//#include "AliTOFRawStream.h"
+#include "AliTOFDeltaBCOffset.h"
+#include "AliTOFCTPLatency.h"
+#include "AliTOFT0Fill.h"
+
//extern TFile *gFile;
ClassImp(AliTOFClusterFinder)
Int_t ii;
Int_t dig[5]; //cluster detector indeces
- Int_t parTOF[5]; //The TOF signal parameters
+ Int_t parTOF[7]; //The TOF signal parameters
Bool_t status=kTRUE; // assume all sim channels ok in the beginning...
for (ii=0; ii<nDigits; ii++) {
AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii);
parTOF[2] = d->GetAdc(); // the adc charge
parTOF[3] = d->GetTdcND(); // non decalibrated sim time
parTOF[4] = d->GetTdc(); // raw time, == Tdc time for the moment
+ parTOF[5] = 0; // deltaBC
+ parTOF[6] = 0; // L0-L1 latency
Double_t posClus[3];
Double_t covClus[6];
UShort_t volIdClus=GetClusterVolIndex(dig);
Int_t ii;
Int_t dig[5]; //cluster detector indeces
- Int_t parTOF[5]; //The TOF signal parameters
+ Int_t parTOF[7]; //The TOF signal parameters
Bool_t status=kTRUE; // assume all sim channels ok in the beginning...
for (ii=0; ii<nDigits; ii++) {
AliTOFdigit *d = (AliTOFdigit*)digits->UncheckedAt(ii);
parTOF[2] = d->GetAdc(); // the adc charge
parTOF[3] = d->GetTdcND(); // non decalibrated sim time
parTOF[4] = d->GetTdc(); // raw time, == Tdc time for the moment
+ parTOF[5] = 0; // deltaBC
+ parTOF[6] = 0; // L0-L1 latency
Double_t posClus[3];
Double_t covClus[6];
Int_t dummy = -1;
Int_t detectorIndex[5];
- Int_t parTOF[5];
+ Int_t parTOF[7];
ofstream ftxt;
if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app);
parTOF[2] = tofRawDatum->GetTOT(); //ADC==TOF
parTOF[3] = -1;//raw data: no track of undecalib sim time
parTOF[4] = tofRawDatum->GetTOF(); // RAW time
+ parTOF[5] = tofRawDatum->GetDeltaBC(); // deltaBC
+ parTOF[6] = tofRawDatum->GetL0L1Latency(); // L0-L1 latency
Double_t posClus[3];
Double_t covClus[6];
UShort_t volIdClus=GetClusterVolIndex(detectorIndex);
Int_t dummy = -1;
Int_t detectorIndex[5] = {-1, -1, -1, -1, -1};
- Int_t parTOF[5];
+ Int_t parTOF[7];
ofstream ftxt;
if (fVerbose==2) ftxt.open("TOFdigitsRead.txt",ios::app);
parTOF[2] = tofRawDatum->GetTOT(); // raw data have ADC=TOT
parTOF[3] = -1; //raw data: no track of the undecalib sim time
parTOF[4] = tofRawDatum->GetTOF(); // Raw time == TDC
+ parTOF[5] = tofRawDatum->GetDeltaBC(); // deltaBC
+ parTOF[6] = tofRawDatum->GetL0L1Latency(); // L0-L1 latency
Double_t posClus[3];
Double_t covClus[6];
UShort_t volIdClus=GetClusterVolIndex(detectorIndex);
Int_t ii, jj;
Int_t detectorIndex[5];
- Int_t parTOF[5];
+ Int_t parTOF[7];
Int_t trackLabels[3];
Int_t digitIndex = -1;
Bool_t status=kTRUE;
parTOF[2] = fTofClusters[ii]->GetADC(); // ADC=TOT
parTOF[3] = fTofClusters[ii]->GetTDCND(); // TDCND
parTOF[4] = fTofClusters[ii]->GetTDCRAW();//RAW
+ parTOF[5] = fTofClusters[ii]->GetDeltaBC();//deltaBC
+ parTOF[6] = fTofClusters[ii]->GetL0L1Latency();//L0-L1 latency
status=fTofClusters[ii]->GetStatus();
Double_t posClus[3];
Double_t covClus[6];
Double_t tToT;
Double_t timeCorr;
Int_t tdcCorr;
+ Float_t tdcLatencyWindow;
AliDebug(1," Calibrating TOF Clusters");
AliTOFChannelOnlineArray *calDelay = fTOFcalib->GetTOFOnlineDelay();
AliTOFChannelOnlineStatusArray *calStatus = fTOFcalib->GetTOFOnlineStatus();
TObjArray *calTOFArrayOffline = fTOFcalib->GetTOFCalArrayOffline();
+
+ AliTOFDeltaBCOffset *deltaBCOffsetObj = fTOFcalib->GetDeltaBCOffset();
+ Int_t deltaBCOffset = deltaBCOffsetObj->GetDeltaBCOffset();
+ AliTOFCTPLatency *ctpLatencyObj = fTOFcalib->GetCTPLatency();
+ Float_t ctpLatency = ctpLatencyObj->GetCTPLatency();
+ AliTOFT0Fill *t0FillObj = fTOFcalib->GetT0Fill();
+ Float_t t0Fill = t0FillObj->GetT0Fill();
TString validity = (TString)fTOFcalib->GetOfflineValidity();
Int_t calibration = -1;
UChar_t statusNoise=calStatus->GetNoiseStatus(index);
UChar_t statusHW=calStatus->GetHWStatus(index);
UChar_t status=calStatus->GetStatus(index);
-
+ tdcLatencyWindow = calStatus->GetLatencyWindow(index) * 1.e3; /* ns -> ps */
+
//check the status, also unknown is fine!!!!!!!
AliDebug(2, Form(" Status for channel %d = %d",index, (Int_t)status));
timeCorr=(Double_t)(fTofClusters[ii]->GetTDC())*AliTOFGeometry::TdcBinWidth()*1.E-3-timeCorr;//redefine the time
timeCorr*=1.E3;
AliDebug(2,Form(" The channel time, corr (ps)= %e",timeCorr ));
+
+ /* here timeCorr should be already corrected for calibration.
+ * we now go into further corrections keeping in mind that timeCorr
+ * is in ps.
+ *
+ * the following corrections are performed in this way:
+ *
+ * time = timeRaw - deltaBC + L0L1Latency + CTPLatency - TDCLatencyWindow - T0Fill
+ *
+ */
+
+ AliDebug(2, Form("applying further corrections (DeltaBC): DeltaBC=%d (BC bins), DeltaBCoffset=%d (BC bins)", fTofClusters[ii]->GetDeltaBC(), deltaBCOffset));
+ AliDebug(2, Form("applying further corrections (L0L1Latency): L0L1Latency=%d (BC bins)", fTofClusters[ii]->GetL0L1Latency()));
+ AliDebug(2, Form("applying further corrections (CTPLatency): CTPLatency=%f (ps)", ctpLatency));
+ AliDebug(2, Form("applying further corrections (TDCLatencyWindow): TDCLatencyWindow=%f (ps)", tdcLatencyWindow));
+ AliDebug(2, Form("applying further corrections (T0Fill): T0Fill=%f (ps)", t0Fill));
+
+ /* deltaBC correction */
+ timeCorr -= (fTofClusters[ii]->GetDeltaBC() - deltaBCOffset) * AliTOFGeometry::BunchCrossingBinWidth();
+ /* L0L1-latency correction */
+ timeCorr += fTofClusters[ii]->GetL0L1Latency() * AliTOFGeometry::BunchCrossingBinWidth();
+ /* CTP-latency correction (from OCDB) */
+ timeCorr += ctpLatency;
+ /* TDC latency-window correction (from OCDB) */
+ timeCorr -= tdcLatencyWindow;
+ /* T0Fill correction (from OCDB) */
+ timeCorr -= t0Fill;
+
+ /*
+ * end of furhter corrections
+ */
+
tdcCorr=(Int_t)(timeCorr/AliTOFGeometry::TdcBinWidth()); //the corrected time (tdc counts)
fTofClusters[ii]->SetTDC(tdcCorr);
} // loop on clusters
--- /dev/null
+#ifndef ALITOFDRMSTATUSHEADER3_H
+#define ALITOFDRMSTATUSHEADER3_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+
+/* $Id: AliTOFRawDataFormat.h 23881 2008-02-12 16:46:22Z decaro $ */
+
+///////////////////////////////////////////////////////////////
+// //
+// This classes provide the TOF raw data bit fields. //
+// //
+///////////////////////////////////////////////////////////////
+
+#include "TROOT.h"
+
+class AliTOFDRMStatusHeader3
+{
+ public:
+ UInt_t GetSlot() {return fSlotID;};
+ UInt_t GetL0BCID() {return fL0BCID;};
+ UInt_t GetRunTimeInfo() {return fRunTimeInfo;};
+ UInt_t GetWordType() {return fWordType;};
+ private:
+ UInt_t fSlotID: 4;
+ UInt_t fL0BCID: 12;
+ UInt_t fRunTimeInfo: 12;
+ UInt_t fWordType: 4;
+};
+
+#endif
* classes.
*/
+ AliTOFDRMStatusHeader3 *lDRMStatusHeader3;
AliTOFTRMGlobalHeader *lTRMGlobalHeader; //TRM global header
AliTOFTRMGlobalTrailer *lTRMGlobalTrailer; //TRM global trailer
AliTOFTRMChainHeader *lTRMChainHeader; //TRM chain header
Short_t currentACQ = -1;
Short_t currentChain = -1;
Short_t currentBunchID = -1;
+ Short_t currentL0BCID = -1;
Short_t currentMiniEventID = cdh ? cdh->GetMiniEventID() : (Short_t)-1;
Short_t currentEventID1 = cdh ? cdh->GetEventID1() : (Short_t)-1;
AliDebug(1, Form("EvID1 = %d, EvID2 = %d, currentMiniEventID = %d", currentEventID1, cdh->GetEventID2(), currentMiniEventID));
decodeStatus = decodeStatus | DRM_BIT;
//skip DRM data
- for (Int_t i = 0; i < DRM_DATA_WORDS; i++, iWord++, rawData++){
+ for (Int_t i = 0; i < DRM_DATA_WORDS; i++, iWord++){
+ rawData++;
if (fVerbose)
AliInfo(Form(" %02x - 0x%08x \t DRM data",decodeStatus,*rawData));
+ switch (i) {
+ case 2:
+ lDRMStatusHeader3 = (AliTOFDRMStatusHeader3*)rawData;
+ currentL0BCID = lDRMStatusHeader3->GetL0BCID();
+ break;
+ default:
+ break;
+ }
}
break;
decodeStatus = decodeStatus | LTM_BIT;
//skip LTM data
- for (Int_t i = 0; i < LTM_DATA_WORDS; i++, iWord++, rawData++){
+ for (Int_t i = 0; i < LTM_DATA_WORDS; i++, iWord++){
+ rawData++;
if (fVerbose)
AliInfo(Form(" %02x - 0x%08x \t LTM data",decodeStatus,*rawData));
}
hitData.SetTOT((float)lTDCPackedHit->GetTOTWidth() * TOT_BIN_WIDTH);
hitData.SetTOTBin(lTDCPackedHit->GetTOTWidth());
hitData.SetDeltaBunchID(currentBunchID - currentEventID1);
+ hitData.SetL0L1Latency(currentMiniEventID - currentL0BCID);
//orphane leading hit
if (hitData.GetPS()==LEADING_HIT_PS){
hitData.SetTime((float)lTDCUnpackedHit->GetHitTime() * TIME_BIN_WIDTH);
hitData.SetTOT(-1.);
hitData.SetTOTBin(-1);
hitData.SetDeltaBunchID(currentBunchID - currentEventID1);
+ hitData.SetL0L1Latency(currentMiniEventID - currentL0BCID);
//push hit data in data buffer
if (fDataBuffer != 0x0)
fDataBuffer->Add(hitData);
hitData.SetTOT(-1.);
hitData.SetTOTBin(-1);
hitData.SetDeltaBunchID(currentBunchID - currentEventID1);
+ hitData.SetL0L1Latency(currentMiniEventID - currentL0BCID);
//push hit data in data buffer
if (fDataBuffer != 0x0)
fDataBuffer->Add(hitData);
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+ *
+ *
+ * this class defines the DeltaBCOffset object to be stored
+ * in OCDB in order to apply DeltaBC correction during
+ * reconstruction.
+ *
+ *
+ */
+
+#include "AliTOFDeltaBCOffset.h"
+
+ClassImp(AliTOFDeltaBCOffset)
+
+//_________________________________________________________
+
+AliTOFDeltaBCOffset::AliTOFDeltaBCOffset() :
+ TObject(),
+ fDeltaBCOffset(0)
+{
+ /*
+ * default constructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFDeltaBCOffset::~AliTOFDeltaBCOffset()
+{
+ /*
+ * default destructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFDeltaBCOffset::AliTOFDeltaBCOffset(const AliTOFDeltaBCOffset &source) :
+ TObject(source),
+ fDeltaBCOffset(source.fDeltaBCOffset)
+{
+ /*
+ * copy constructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFDeltaBCOffset &
+AliTOFDeltaBCOffset::operator=(const AliTOFDeltaBCOffset &source)
+{
+ /*
+ * operator=
+ */
+
+ if (this == &source) return *this;
+ TObject::operator=(source);
+ fDeltaBCOffset = source.fDeltaBCOffset;
+ return *this;
+}
+
--- /dev/null
+#ifndef ALITOFDELTABCOFFSET_H
+#define ALITOFDELTABCOFFSET_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+/* $Id$ */
+
+/*
+ *
+ *
+ * this class defines the DeltaBCOffset object to be stored
+ * in OCDB in order to apply DeltaBC correction during
+ * reconstruction.
+ *
+ *
+ */
+
+#include "TObject.h"
+
+class AliTOFDeltaBCOffset :
+public TObject
+{
+
+ public:
+
+ AliTOFDeltaBCOffset(); // default constructor
+ virtual ~AliTOFDeltaBCOffset(); // default destructor
+ AliTOFDeltaBCOffset(const AliTOFDeltaBCOffset &source); // copy constructor
+ AliTOFDeltaBCOffset &operator=(const AliTOFDeltaBCOffset &source); // operator=
+ Int_t GetDeltaBCOffset() const {return fDeltaBCOffset;}; // getter
+ void SetDeltaBCOffset(Int_t value) {fDeltaBCOffset = value;}; // setter
+
+ private:
+
+ Int_t fDeltaBCOffset; // deltaBC offset (BC bins)
+
+ ClassDef(AliTOFDeltaBCOffset, 1);
+};
+
+#endif /* ALITOFDELTABCOFFSET_H */
const Float_t AliTOFGeometry::fgkTdcBin = 24.4; // time-of-flight bin width [ps]
const Float_t AliTOFGeometry::fgkToTBin = 48.8; // time-over-threshold bin width [ps]
+const Float_t AliTOFGeometry::fgkBunchCrossingBin = fgkTdcBin * 1024; // bunch-crossing bin width [ps]
const Float_t AliTOFGeometry::fgkDeadTime = 25E+03; // Single channel dead time (ps)
const Float_t AliTOFGeometry::fgkMatchingWindow = fgkTdcBin*TMath::Power(2,13); // Matching window (ps)
static Float_t TdcBinWidth() {return fgkTdcBin;};
static Float_t ToTBinWidth() {return fgkToTBin;};
+ static Float_t BunchCrossingBinWidth() {return fgkBunchCrossingBin;};
virtual void ImportGeometry();
virtual void SetHoles(Bool_t holes) {fHoles = holes;};
static const Float_t fgkTdcBin; // time-of-flight bin width [ps]
static const Float_t fgkToTBin; // time-over-threshold bin width [ps]
+ static const Float_t fgkBunchCrossingBin; // bunch-crossing bin width [ps]
ClassDef(AliTOFGeometry,8) // TOF Geometry base class
};
fTOT(-1),
fTOTBin(-1),
fDeltaBunchID(-1),
+ fL0L1Latency(-1),
fDeltaEventCounter(-1)
{
//ctor
fTOT(source.fTOT),
fTOTBin(source.fTOTBin),
fDeltaBunchID(source.fDeltaBunchID),
+ fL0L1Latency(source.fL0L1Latency),
fDeltaEventCounter(source.fDeltaEventCounter)
{
// copy constructor
fTOT= source.fTOT;
fTOTBin= source.fTOTBin;
fDeltaBunchID=source.fDeltaBunchID;
+ fL0L1Latency=source.fL0L1Latency;
fDeltaEventCounter=source.fDeltaEventCounter;
}
return *this;
Float_t GetTOT() const {return fTOT;};
Int_t GetTOTBin() const {return fTOTBin;};
Int_t GetDeltaBunchID() const {return fDeltaBunchID;};
+ Int_t GetL0L1Latency() const {return fL0L1Latency;};
Int_t GetDeltaEventCounter() const {return fDeltaEventCounter;};
void SetVolume(Int_t *Volume);
void SetTOT(Float_t TOT) { fTOT=TOT;};
void SetTOTBin(Int_t TOTBin) {fTOTBin=TOTBin;};
void SetDeltaBunchID(Int_t Value) {fDeltaBunchID=Value;};
+ void SetL0L1Latency(Int_t Value) {fL0L1Latency=Value;};
void SetDeltaEventCounter(Int_t Value) {fDeltaEventCounter=Value;};
private:
Float_t fTOT; // tot [ns]
Int_t fTOTBin; // TOT [TOT bin = 48.4ps]
Int_t fDeltaBunchID; // TRM bunchID - miniEventID
+ Int_t fL0L1Latency; // L0BCID - miniEventID
Int_t fDeltaEventCounter; // TRM event counter - DRM local event counter
- ClassDef(AliTOFHitData, 1);
+ ClassDef(AliTOFHitData, 2);
};
#endif
// //
///////////////////////////////////////////////////////////////
+#include "AliTOFDRMStatusHeader3.h"
#include "AliTOFTRMGlobalHeader.h"
#include "AliTOFTRMGlobalTrailer.h"
#include "AliTOFTRMChainHeader.h"
Int_t hitChan = hitData->GetChan();
Int_t hitTimeBin = hitData->GetTimeBin();
Int_t hitTOTBin = hitData->GetTOTBin();
-
- if (fgApplyBCCorrections) {
- /* DDL BC shift time correction */
- hitTimeBin += 1024 * fgkddlBCshift[indexDDL];
- /* deltaBC shift time correction */
- hitTimeBin += 1024 * (hitData->GetDeltaBunchID() - 37);
- }
+ Int_t hitDeltaBC = hitData->GetDeltaBunchID();
+ Int_t hitL0L1Latency = hitData->GetL0L1Latency();
Int_t hitLeading = hitData->GetTimeBin();
Int_t hitTrailing = -1;
Int_t hitError = -1;
TClonesArray &arrayTofRawData = *fTOFrawData;
- new (arrayTofRawData[fPackedDigits++]) AliTOFrawData(hitSlotID, hitChain, hitTDC, hitChan, hitTimeBin, hitTOTBin, hitLeading, hitTrailing, hitPS, hitACQ, hitError);
+ new (arrayTofRawData[fPackedDigits++]) AliTOFrawData(hitSlotID, hitChain, hitTDC, hitChan, hitTimeBin, hitTOTBin, hitLeading, hitTrailing, hitPS, hitACQ, hitError, hitDeltaBC, hitL0L1Latency);
}
if (verbose > 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);}
+
+
+ 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);}
}
//_____________________________________________________________________________
--- /dev/null
+/**************************************************************************
+ * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * *
+ * Author: The ALICE Off-line Project. *
+ * Contributors are mentioned in the code where appropriate. *
+ * *
+ * Permission to use, copy, modify and distribute this software and its *
+ * documentation strictly for non-commercial purposes is hereby granted *
+ * without fee, provided that the above copyright notice appears in all *
+ * copies and that both the copyright notice and this permission notice *
+ * appear in the supporting documentation. The authors make no claims *
+ * about the suitability of this software for any purpose. It is *
+ * provided "as is" without express or implied warranty. *
+ **************************************************************************/
+
+/*
+ *
+ *
+ * this class defines the T0Fill object to be stored
+ * in OCDB in order to apply T0Fill correction during
+ * reconstruction.
+ *
+ *
+ */
+
+#include "AliTOFT0Fill.h"
+
+ClassImp(AliTOFT0Fill)
+
+//_________________________________________________________
+
+AliTOFT0Fill::AliTOFT0Fill() :
+ TObject(),
+ fT0Fill(0.)
+{
+ /*
+ * default constructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFT0Fill::~AliTOFT0Fill()
+{
+ /*
+ * default destructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFT0Fill::AliTOFT0Fill(const AliTOFT0Fill &source) :
+ TObject(source),
+ fT0Fill(source.fT0Fill)
+{
+ /*
+ * copy constructor
+ */
+}
+
+//_________________________________________________________
+
+AliTOFT0Fill &
+AliTOFT0Fill::operator=(const AliTOFT0Fill &source)
+{
+ /*
+ * operator=
+ */
+
+ if (this == &source) return *this;
+ TObject::operator=(source);
+ fT0Fill = source.fT0Fill;
+ return *this;
+}
+
--- /dev/null
+#ifndef ALITOFT0FILL_H
+#define ALITOFT0FILL_H
+
+/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+ * See cxx source for full Copyright notice */
+/* $Id$ */
+
+/*
+ *
+ *
+ * this class defines the T0Fill object to be stored
+ * in OCDB in order to apply T0Fill correction during
+ * reconstruction.
+ *
+ *
+ */
+
+#include "TObject.h"
+
+class AliTOFT0Fill :
+public TObject
+{
+
+ public:
+
+ AliTOFT0Fill(); // default constructor
+ virtual ~AliTOFT0Fill(); // default destructor
+ AliTOFT0Fill(const AliTOFT0Fill &source); // copy constructor
+ AliTOFT0Fill &operator=(const AliTOFT0Fill &source); // operator=
+ Float_t GetT0Fill() const {return fT0Fill;}; // getter
+ void SetT0Fill(Float_t value) {fT0Fill = value;}; // setter
+
+ private:
+
+ Float_t fT0Fill; // event time (ps)
+
+ ClassDef(AliTOFT0Fill, 1);
+};
+
+#endif /* ALITOFT0FILL_H */
#include "AliTOFChannelOffline.h"
#include "AliTOFGeometry.h"
#include "AliTOFRecoParam.h"
+#include "AliTOFDeltaBCOffset.h"
+#include "AliTOFCTPLatency.h"
+#include "AliTOFT0Fill.h"
+
class TROOT;
class TStyle;
fNruns(0),
fFirstRun(0),
fLastRun(AliCDBRunRange::Infinity()),
- fConfigMap(new TMap)
+ fConfigMap(new TMap),
+ fDeltaBCOffset(NULL),
+ fCTPLatency(NULL),
+ fT0Fill(NULL)
{
//TOF Calibration Class ctor
fNChannels = AliTOFGeometry::NSectors()*(2*(AliTOFGeometry::NStripC()+AliTOFGeometry::NStripB())+AliTOFGeometry::NStripA())*AliTOFGeometry::NpadZ()*AliTOFGeometry::NpadX();
fNruns(calib.fNruns),
fFirstRun(calib.fFirstRun),
fLastRun(calib.fLastRun),
- fConfigMap(calib.fConfigMap)
+ fConfigMap(calib.fConfigMap),
+ fDeltaBCOffset(NULL),
+ fCTPLatency(NULL),
+ fT0Fill(NULL)
{
//TOF Calibration Class copy ctor
for (Int_t iarray = 0; iarray<fNChannels; iarray++){
fTOFCalOnlineHW->AddAt(calChOnlineStHW,iarray);
fTOFCalOffline->AddAt(calChOffline,iarray);
}
+
+ if (calib.fDeltaBCOffset) fDeltaBCOffset = new AliTOFDeltaBCOffset(*calib.fDeltaBCOffset);
+ if (calib.fCTPLatency) fCTPLatency = new AliTOFCTPLatency(*calib.fCTPLatency);
+ if (calib.fT0Fill) fT0Fill = new AliTOFT0Fill(*calib.fT0Fill);
}
//____________________________________________________________________________
fTOFCalOnlineHW->AddAt(calChOnlineStHW,iarray);
fTOFCalOffline->AddAt(calChOffline,iarray);
}
+
+ if (calib.fDeltaBCOffset) {
+ if (fDeltaBCOffset) *fDeltaBCOffset = *calib.fDeltaBCOffset;
+ else fDeltaBCOffset = new AliTOFDeltaBCOffset(*calib.fDeltaBCOffset);
+ }
+
+ if (calib.fCTPLatency) {
+ if (fCTPLatency) *fCTPLatency = *calib.fCTPLatency;
+ else fCTPLatency = new AliTOFCTPLatency(*calib.fCTPLatency);
+ }
+
+ if (calib.fT0Fill) {
+ if (fT0Fill) *fT0Fill = *calib.fT0Fill;
+ else fT0Fill = new AliTOFT0Fill(*calib.fT0Fill);
+ }
+
return *this;
}
if (fConfigMap){
delete fConfigMap;
}
+ if (fDeltaBCOffset) delete fDeltaBCOffset;
+ if (fCTPLatency) delete fCTPLatency;
+ if (fT0Fill) delete fT0Fill;
}
if (fTree!=0x0) delete fTree;
if (fChain!=0x0) delete fChain;
+
}
//_____________________________________________________________________________
void AliTOFcalib::CreateCalArrays(){
}
return nusefulbins;
}
+
+
+//----------------------------------------------------------------------------
+
+void
+AliTOFcalib::CreateDeltaBCOffset()
+{
+ /*
+ * create deltaBC offset
+ */
+
+ if (fDeltaBCOffset) {
+ AliWarning("DeltaBCOffset object already defined, cannot create a new one");
+ return;
+ }
+ fDeltaBCOffset = new AliTOFDeltaBCOffset();
+}
+
+//----------------------------------------------------------------------------
+
+void
+AliTOFcalib::CreateCTPLatency()
+{
+ /*
+ * create CTP latency
+ */
+
+ if (fCTPLatency) {
+ AliWarning("CTPLatency object already defined, cannot create a new one");
+ return;
+ }
+ fCTPLatency = new AliTOFCTPLatency();
+}
+
+//----------------------------------------------------------------------------
+
+void
+AliTOFcalib::CreateT0Fill()
+{
+ /*
+ * create event-time
+ */
+
+ if (fT0Fill) {
+ AliWarning("T0Fill object already defined, cannot create a new one");
+ return;
+ }
+ fT0Fill = new AliTOFT0Fill();
+}
+
+//----------------------------------------------------------------------------
+
+void
+AliTOFcalib::WriteDeltaBCOffsetOnCDB(const Char_t *sel , Int_t minrun, Int_t maxrun)
+{
+ /*
+ * deltaBC offset on CDB
+ */
+
+ if (!fDeltaBCOffset) return;
+ AliCDBId id(Form("%s/DeltaBCOffset", sel), minrun, maxrun);
+ AliCDBMetaData *md = new AliCDBMetaData();
+ md->SetResponsible("Roberto Preghenella");
+ AliCDBManager *man = AliCDBManager::Instance();
+ man->Put(fDeltaBCOffset, id, md);
+ AliDebug(2,Form("DeltaBCOffset written on CDB with run range [%i, %i] ",minrun ,maxrun));
+ delete md;
+}
+
+//----------------------------------------------------------------------------
+
+void
+AliTOFcalib::WriteCTPLatencyOnCDB(const Char_t *sel , Int_t minrun, Int_t maxrun)
+{
+ /*
+ * write CTP latency on CDB
+ */
+
+ if (!fCTPLatency) return;
+ AliCDBId id(Form("%s/CTPLatency", sel), minrun, maxrun);
+ AliCDBMetaData *md = new AliCDBMetaData();
+ md->SetResponsible("Roberto Preghenella");
+ AliCDBManager *man = AliCDBManager::Instance();
+ man->Put(fCTPLatency, id, md);
+ AliDebug(2,Form("CTPLatency written on CDB with run range [%i, %i] ",minrun ,maxrun));
+ delete md;
+}
+
+//----------------------------------------------------------------------------
+
+void
+AliTOFcalib::WriteT0FillOnCDB(const Char_t *sel , Int_t minrun, Int_t maxrun)
+{
+ /*
+ * write event-time on CDB
+ */
+
+ if (!fT0Fill) return;
+ AliCDBId id(Form("%s/T0Fill", sel), minrun, maxrun);
+ AliCDBMetaData *md = new AliCDBMetaData();
+ md->SetResponsible("Roberto Preghenella");
+ AliCDBManager *man = AliCDBManager::Instance();
+ man->Put(fT0Fill, id, md);
+ AliDebug(2,Form("T0Fill written on CDB with run range [%i, %i] ",minrun ,maxrun));
+ delete md;
+}
+
+//----------------------------------------------------------------------------
+
+Bool_t
+AliTOFcalib::ReadDeltaBCOffsetFromCDB(const Char_t *sel , Int_t nrun)
+{
+ /*
+ * read deltaBC offset from CDB
+ */
+
+ AliCDBManager *man = AliCDBManager::Instance();
+ AliCDBEntry *entry = man->Get(Form("%s/DeltaBCOffset", sel),nrun);
+ if (!entry) {
+ AliFatal("No DeltaBCOffset entry found in CDB");
+ exit(0);
+ }
+ fDeltaBCOffset =(AliTOFDeltaBCOffset *)entry->GetObject();
+ if(!fDeltaBCOffset){
+ AliFatal("No DeltaBCOffset object found in CDB entry");
+ exit(0);
+ }
+ return kTRUE;
+}
+
+//----------------------------------------------------------------------------
+
+Bool_t
+AliTOFcalib::ReadCTPLatencyFromCDB(const Char_t *sel , Int_t nrun)
+{
+ /*
+ * read CTP latency from CDB
+ */
+
+ AliCDBManager *man = AliCDBManager::Instance();
+ AliCDBEntry *entry = man->Get(Form("%s/CTPLatency", sel),nrun);
+ if (!entry) {
+ AliFatal("No CTPLatency entry found in CDB");
+ exit(0);
+ }
+ fCTPLatency =(AliTOFCTPLatency *)entry->GetObject();
+ if(!fCTPLatency){
+ AliFatal("No CTPLatency object found in CDB entry");
+ exit(0);
+ }
+ return kTRUE;
+}
+
+//----------------------------------------------------------------------------
+
+Bool_t
+AliTOFcalib::ReadT0FillFromCDB(const Char_t *sel , Int_t nrun)
+{
+ /*
+ * read event-time from CDB
+ */
+
+ AliCDBManager *man = AliCDBManager::Instance();
+ AliCDBEntry *entry = man->Get(Form("%s/T0Fill", sel),nrun);
+ if (!entry) {
+ AliFatal("No T0Fill entry found in CDB");
+ exit(0);
+ }
+ fT0Fill =(AliTOFT0Fill *)entry->GetObject();
+ if(!fT0Fill){
+ AliFatal("No T0Fill object found in CDB entry");
+ exit(0);
+ }
+ return kTRUE;
+}
+
class AliTOFRecoParam;
class AliTOFChannelOnlineStatusArray;
class AliTOFChannelOnlineArray;
+class AliTOFDeltaBCOffset;
+class AliTOFCTPLatency;
+class AliTOFT0Fill;
class AliTOFcalib:public TTask{
public:
void SetOfflineValidity(const char* validity) {fkValidity = validity;}
Int_t NChannels()const{return fNChannels;}
+ void CreateDeltaBCOffset();
+ void CreateCTPLatency();
+ void CreateT0Fill();
+ AliTOFDeltaBCOffset *GetDeltaBCOffset() const {return fDeltaBCOffset;};
+ AliTOFCTPLatency *GetCTPLatency() const {return fCTPLatency;};
+ AliTOFT0Fill *GetT0Fill() const {return fT0Fill;};
+
// Methods to retrieve/write parameters from/on CDB
// writing
void WriteParOnlineHWOnCDB(const Char_t *sel); // old, before unification of status info
void WriteParOfflineOnCDB(const Char_t *sel, const Char_t *validity);
+ void WriteDeltaBCOffsetOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
+ void WriteCTPLatencyOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
+ void WriteT0FillOnCDB(const Char_t *sel, Int_t minrun, Int_t maxrun);
+
// reading
Bool_t ReadSimHistoFromCDB(const Char_t *sel, Int_t nrun);
Bool_t ReadConfigMapFromCDB(const Char_t *sel, Int_t nrun);
void SetLastRun(Int_t lastRun) {fLastRun=lastRun;}
Int_t GetLastRun() const {return fLastRun;}
+ Bool_t ReadDeltaBCOffsetFromCDB(const Char_t *sel, Int_t nrun);
+ Bool_t ReadCTPLatencyFromCDB(const Char_t *sel, Int_t nrun);
+ Bool_t ReadT0FillFromCDB(const Char_t *sel, Int_t nrun);
+
private:
Int_t fNChannels; // number of TOF channels
Int_t fLastRun; // last run for calib obj validity
TMap* fConfigMap; // map holding configuration obj
- ClassDef(AliTOFcalib,7);
+ AliTOFDeltaBCOffset *fDeltaBCOffset; // deltaBC offset
+ AliTOFCTPLatency *fCTPLatency; // CTP latency
+ AliTOFT0Fill *fT0Fill; // T0 fill
+
+ ClassDef(AliTOFcalib,8);
};
#endif // AliTOFcalib_H
fADC(0),
fTdcND(0),
fTdcRAW(0),
- fStatus(kTRUE)
+ fStatus(kTRUE),
+ fDeltaBC(0),
+ fL0L1Latency(0)
{
//
// default ctor
fADC(par[2]),
fTdcND(par[3]),
fTdcRAW(par[4]),
- fStatus(status)
+ fStatus(status),
+ fDeltaBC(par[5]),
+ fL0L1Latency(par[6])
{
//
// constructor
fADC(cluster.fADC),
fTdcND(cluster.fTdcND),
fTdcRAW(cluster.fTdcRAW),
- fStatus(cluster.fStatus)
+ fStatus(cluster.fStatus),
+ fDeltaBC(cluster.fDeltaBC),
+ fL0L1Latency(cluster.fL0L1Latency)
{
//
// copy ctor for AliTOFcluster object
Int_t IsUsed() const {return (fADC<0) ? 1 : 0;} // Flagging
Int_t GetDetInd(Int_t n) const {return fdetIndex[n];} // Cluster Detector Indices getter
Int_t GetIndex() const {return fIdx;} // Digit Index getter
+ Int_t GetDeltaBC() const {return fDeltaBC;}; // deltaBC
+ Int_t GetL0L1Latency() const {return fL0L1Latency;}; // L0L1 latency
void Use(Int_t = 0) {fADC=-fADC;} // setter
void SetQuality(Double_t quality) {fQuality = quality;} // Cluster quality setter
void SetTDC(Int_t Tdc) {fTDC = Tdc;} // Cluster ToF setter
void SetTDCND(Int_t Tdc) {fTdcND = Tdc;} // Cluster ToFnd setter
void SetTDCRAW(Int_t Tdc) {fTdcRAW = Tdc;} // Cluster ToF-raw setter
+ void SetDeltaBC(Int_t value) {fDeltaBC = value;}; // deltaBC
+ void SetL0L1Latency(Int_t value) {fL0L1Latency = value;}; // L0-L1 latency
private:
Int_t fTdcND; // TDC count
Int_t fTdcRAW; // RAW TDC count
Bool_t fStatus; // cluster online status
+ Int_t fDeltaBC; // deltaBC
+ Int_t fL0L1Latency; // L0L1 latency
- ClassDef(AliTOFcluster, 6) // TOF cluster
+ ClassDef(AliTOFcluster, 7) // TOF cluster
};
#endif
fTrailing(-1),
fToT(-1),
fTime(-1),
- fError(-1)
+ fError(-1),
+ fDeltaBC(-1),
+ fL0L1Latency(-1)
{
// default ctr
fTrailing(-1),
fToT(f),
fTime(e),
- fError(l)
+ fError(l),
+ fDeltaBC(0),
+ fL0L1Latency(0)
{
// ctr
//_____________________________________________________________________________
AliTOFrawData::AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e,
- Int_t f, Int_t ee, Int_t ff, Int_t g, Int_t h, Int_t l) :
+ Int_t f, Int_t ee, Int_t ff, Int_t g, Int_t h, Int_t l, Int_t deltaBC, Int_t l0l1) :
TObject(),
fACQflag(h),
fPSbit(g),
fTrailing(ff),
fToT(f),
fTime(e),
- fError(l)
+ fError(l),
+ fDeltaBC(deltaBC),
+ fL0L1Latency(l0l1)
{
// ctr
fTrailing(-1),
fToT(-1),
fTime(-1),
- fError(-1)
+ fError(-1),
+ fDeltaBC(-1),
+ fL0L1Latency(-1)
{
// dummy copy constructor
fToT = r.fToT;
fTime = r.fTime;
fError = r.fError;
+ fDeltaBC = r.fDeltaBC;
+ fL0L1Latency = r.fL0L1Latency;
}
this->fToT = r.fToT;
this->fTime = r.fTime;
this->fError = r.fError;
+ this->fDeltaBC = r.fDeltaBC;
+ this->fL0L1Latency = r.fL0L1Latency;
return *this;
}
public:
AliTOFrawData(); // default ctr
AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t g, Int_t h, Int_t l); // ctr
- AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t ee, Int_t ff, Int_t g, Int_t h, Int_t l); // ctr
+ AliTOFrawData(Int_t a, Int_t b, Int_t c, Int_t d, Int_t e, Int_t f, Int_t ee, Int_t ff, Int_t g, Int_t h, Int_t l, Int_t deltaBC = 0, Int_t l0l1 = 0); // ctr
~AliTOFrawData() {}; // default dtr
AliTOFrawData(const AliTOFrawData& r); // dummy copy constructor
AliTOFrawData& operator=(const AliTOFrawData& r); // dummy assignment operator
Int_t GetTOT() const;
Int_t GetLeading() const {return fLeading;};
Int_t GetTrailing() const {return fTrailing;};
+
+ Int_t GetDeltaBC() const {return fDeltaBC;};
+ Int_t GetL0L1Latency() const {return fL0L1Latency;};
+
+ void SetDeltaBC(Int_t value) {fDeltaBC = value;};
+ void SetL0L1Latency(Int_t value) {fL0L1Latency = value;};
private:
Int_t fACQflag; // ACQ flag
Int_t fTrailing; // Trailing Edge
Int_t fToT; // Time-Over-Threashould
Int_t fTime; // Time
-
+
Int_t fError; // Error flag
- ClassDef(AliTOFrawData, 1) // class for TOF raw data
+ Int_t fDeltaBC; // delta BC
+ Int_t fL0L1Latency; // L0-L1 latency
+
+ ClassDef(AliTOFrawData, 2) // class for TOF raw data
};
#endif
--- /dev/null
+MakeCDBEntryCTPLatency(Float_t value = 0., Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity())
+{
+
+ /* create object */
+ AliTOFCTPLatency *obj = new AliTOFCTPLatency();
+ obj->SetCTPLatency(value);
+
+ /* create cdb info */
+ AliCDBId id("TOF/Calib/CTPLatency", startRun, endRun);
+ AliCDBMetaData *md = new AliCDBMetaData();
+ md->SetResponsible("Roberto Preghenella");
+ md->SetComment("CTPLatency (ps)");
+ md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+ md->SetBeamPeriod(0);
+
+ /* put object in cdb */
+ AliCDBManager *cdb = AliCDBManager::Instance();
+ cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+ cdb->GetDefaultStorage()->Put(obj, id, md);
+
+}
--- /dev/null
+MakeCDBEntryDeltaBCOffset(Int_t value = 0, Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity())
+{
+
+ /* create object */
+ AliTOFDeltaBCOffset *obj = new AliTOFDeltaBCOffset();
+ obj->SetDeltaBCOffset(value);
+
+ /* create cdb info */
+ AliCDBId id("TOF/Calib/DeltaBCOffset", startRun, endRun);
+ AliCDBMetaData *md = new AliCDBMetaData();
+ md->SetResponsible("Roberto Preghenella");
+ md->SetComment("DeltaBCOffset (BC bins)");
+ md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+ md->SetBeamPeriod(0);
+
+ /* put object in cdb */
+ AliCDBManager *cdb = AliCDBManager::Instance();
+ cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+ cdb->GetDefaultStorage()->Put(obj, id, md);
+
+}
--- /dev/null
+MakeCDBEntryT0Fill(Float_t value = 0., Int_t startRun = 0, Int_t endRun = AliCDBRunRange::Infinity())
+{
+
+ /* create object */
+ AliTOFT0Fill *obj = new AliTOFT0Fill();
+ obj->SetT0Fill(value);
+
+ /* create cdb info */
+ AliCDBId id("TOF/Calib/T0Fill", startRun, endRun);
+ AliCDBMetaData *md = new AliCDBMetaData();
+ md->SetResponsible("Roberto Preghenella");
+ md->SetComment("T0Fill (ps)");
+ md->SetAliRootVersion(gSystem->Getenv("ARVERSION"));
+ md->SetBeamPeriod(0);
+
+ /* put object in cdb */
+ AliCDBManager *cdb = AliCDBManager::Instance();
+ cdb->SetDefaultStorage("local://$ALICE_ROOT/OCDB");
+ cdb->GetDefaultStorage()->Put(obj, id, md);
+
+}
#pragma link C++ class AliTOFcalibHisto+;
#pragma link C++ class AliTOFArray+;
#pragma link C++ class AliTOFDaConfigHandler+;
+#pragma link C++ class AliTOFDeltaBCOffset+;
+#pragma link C++ class AliTOFCTPLatency+;
+#pragma link C++ class AliTOFT0Fill+;
#endif
AliTOFcalibHisto.cxx \
AliTOFArray.cxx \
AliTOFDaConfigHandler.cxx \
+ AliTOFDeltaBCOffset.cxx \
+ AliTOFCTPLatency.cxx \
+ AliTOFT0Fill.cxx \
HDRS:= $(SRCS:.cxx=.h)