,"tr"
,"pd"
};
+Int_t AliTRDReconstructor::fgNTimeBins = -1;
//_____________________________________________________________________________
AliTRDReconstructor::AliTRDReconstructor()
// take over ownership of online tracklets
fgTracklets = clusterer.TrackletsArray();
clusterer.SetTrackletsOwner(kFALSE);
+
+ fgNTimeBins = clusterer.GetNTimeBins();
}
//_____________________________________________________________________________
// take over ownership of online tracklets
fgTracklets = clusterer.TrackletsArray();
clusterer.SetTrackletsOwner(kFALSE);
+
+ fgNTimeBins = clusterer.GetNTimeBins();
}
//_____________________________________________________________________________
virtual void FillESD(TTree *digitsTree, TTree *clusterTree, AliESDEvent *esd) const;
static TClonesArray* GetClusters() {return fgClusters;}
static TClonesArray* GetTracklets() {return fgTracklets;}
+ static Int_t GetNTimeBins() {return fgNTimeBins;}
Int_t GetNdEdxSlices() const { return (Int_t)AliTRDpidUtil::GetNdEdxSlices(GetPIDMethod());}
AliTRDpidUtil::ETRDPIDMethod GetPIDMethod() const { return GetRecoParam()->IsPIDNeuralNetwork() ? AliTRDpidUtil::kNN : AliTRDpidUtil::kLQ;}
static AliTRDdigitsParam* GetDigitsParam() { return fgDigitsParam;}
static AliTRDdigitsParam *fgDigitsParam; // Digits Param information
static TClonesArray *fgClusters; // list of clusters for local reconstructor
static TClonesArray *fgTracklets; // list of online tracklets for local reconstructor
+ static Int_t fgNTimeBins; // number of time bins as given by the clusterizer
ClassDef(AliTRDReconstructor, 2) // Class for the TRD reconstruction
// Returns Number of time bins from the DCS
//
+ Int_t nMixed = -2; // not the same number for all chambers
+ Int_t nUndef = -1; // default value - has not been set!
+ Int_t nTbSor = nUndef;
+ Int_t nTbEor = nUndef;
+
const TObjArray *dcsArr = dynamic_cast<const TObjArray *>(GetCachedCDBObject(kIDDCS));
- if(!dcsArr){
- printf("No DCS Object found\n");
- //return -1;
- return 30;
+ if (!dcsArr) {
+ AliError("No DCS object found!");
+ return nUndef;
}
- const AliTRDCalDCS *calDCSsor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(0)); // Take SOR
+
+ const AliTRDCalDCS *calDCSsor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(0));
const AliTRDCalDCS *calDCSeor = dynamic_cast<const AliTRDCalDCS *>(dcsArr->At(1));
- // prefer SOR
- if(!calDCSsor){
- if(!calDCSeor){
- printf("No calDCSeor found\n");
- //return -1;
- return 30;
+ if (!calDCSsor) {
+ // the SOR file is mandatory
+ AliError("NO SOR AliTRDCalDCS object found in CDB file!");
+ return nUndef;
}
- if(calDCSeor->GetGlobalNumberOfTimeBins() > 0) return calDCSeor->GetGlobalNumberOfTimeBins();
- else return 30;
- }
- // if SOR is available and the number of timebins is > -1, take this, otherwise check EOR
- Int_t nTimeSOR = calDCSsor->GetGlobalNumberOfTimeBins();
- if(nTimeSOR > -1){
- // Make a consistency check
- if(calDCSeor){
- Int_t nTimeEOR = calDCSeor->GetGlobalNumberOfTimeBins();
- if((nTimeEOR > -1) && (nTimeSOR != nTimeEOR)){
- // Parameter inconsistency found, return -2 to be able to catch the error
- //return -2;
- printf("Inconsistency\n");
- return 30;
- }
- }
- // Consisency check passed or not done
- if(nTimeSOR > 0.0) return nTimeSOR;
- else return 30;
- } else {
- // SOR has unphysical time parameter, take EOR
- if(calDCSeor) {
- if(calDCSeor->GetGlobalNumberOfTimeBins() > 0) return calDCSeor->GetGlobalNumberOfTimeBins();
- else return 30;
+
+ if (!calDCSeor) {
+ // this can happen if the run is shorter than a couple of seconds.
+ AliWarning("NO EOR AliTRDCalDCS object found in CDB file.");
}
- return 30; // Both SOR and EOR not available
+
+ // get the numbers
+ nTbSor = calDCSsor->GetGlobalNumberOfTimeBins();
+ if (calDCSeor) nTbEor = calDCSeor->GetGlobalNumberOfTimeBins();
+
+ // if they're the same return the value
+ // -2 means mixed, -1: no data, >= 0: good number of time bins
+ if (nTbSor == nTbEor) return nTbSor;
+
+ // if they're differing:
+ if (nTbSor == nMixed || nTbEor == nMixed) {
+ AliWarning("Inconsistent number of time bins found!");
+ return nMixed;
}
+
+ // one is undefined, the other ok -> return that one
+ if (nTbSor == nUndef) return nTbEor;
+ if (nTbEor == nUndef) return nTbSor;
+
+ // only remains: two different numbers >= 0
+ return nMixed;
}
//_____________________________________________________________________________
else
fRawStream->SetReader(rawReader);
- if(fReconstructor->IsHLT()){
+ SetBit(kHLT, fReconstructor->IsHLT());
+
+ if(TestBit(kHLT)){
fRawStream->SetSharedPadReadout(kFALSE);
fRawStream->SetNoErrorWarning();
}
Int_t det = 0;
while ((det = fRawStream->NextChamber(fDigitsManager,fTrackletContainer)) >= 0){
- Bool_t iclusterBranch = kFALSE;
- if (fDigitsManager->GetIndexes(det)->HasEntry()){
- iclusterBranch = MakeClusters(det);
- }
+ if (fDigitsManager->GetIndexes(det)->HasEntry())
+ MakeClusters(det);
fDigitsManager->ClearArrays(det);
return kFALSE;
}
- const AliTRDrecoParam* const recoParam = fReconstructor->GetRecoParam();
+ const AliTRDrecoParam *const recoParam = fReconstructor->GetRecoParam();
fMaxThresh = recoParam->GetClusMaxThresh();
fSigThresh = recoParam->GetClusSigThresh();
// Check consistency between OCDB and raw data
Int_t nTimeOCDB = calibration->GetNumberOfTimeBinsDCS();
- if ((nTimeOCDB > -1) &&
- (fTimeTotal != nTimeOCDB)) {
- AliError(Form("Number of timebins does not match OCDB value (RAW[%d] OCDB[%d])"
- ,fTimeTotal,calibration->GetNumberOfTimeBinsDCS()));
+ if(TestBit(kHLT)){
+ if((nTimeOCDB > -1) && (fTimeTotal != nTimeOCDB)){
+ AliWarning(Form("Number of timebins does not match OCDB value (RAW[%d] OCDB[%d]), using raw value"
+ ,fTimeTotal,nTimeOCDB));
+ }
+ }else{
+ if(nTimeOCDB == -1){
+ AliWarning("Undefined number of timebins in OCDB, using value from raw data.");
+ if(!fTimeTotal>0){
+ AliError("Number of timebins in raw data is negative, skipping chamber!");
+ return kFALSE;
+ }
+ }else if(nTimeOCDB == -2){
+ AliError("Mixed number of timebins in OCDB, no reconstruction of TRD data!");
+ return kFALSE;
+ }else if(fTimeTotal != nTimeOCDB){
+ AliError(Form("Number of timebins in raw data does not match OCDB value (RAW[%d] OCDB[%d]), skipping chamber!"
+ ,fTimeTotal,nTimeOCDB));
+ return kFALSE;
+ }
}
// Detector wise calibration object for the gain factors
// Calibration object with the pad status
fCalPadStatusROC = calibration->GetPadStatusROC(fDet);
- SetBit(kLUT, recoParam->UseLUT());
- SetBit(kGAUS, recoParam->UseGAUS());
- SetBit(kHLT, fReconstructor->IsHLT());
-
firstClusterROC = -1;
fClusterROC = 0;
+ SetBit(kLUT, recoParam->UseLUT());
+ SetBit(kGAUS, recoParam->UseGAUS());
+
// Apply the gain and the tail cancelation via digital filter
if(recoParam->UseTailCancelation()) TailCancelation(recoParam);
,fkTrackLikelihood(-15.)
,fFlags(0)
,fRawStreamVersion("REAL")
- ,fADCBaseline(0)
,fMinMaxCutSigma(4.)
,fMinLeftRightCutSigma(8.)
,fClusMaxThresh(4.5)
,fkTrackLikelihood(ref.fkTrackLikelihood)
,fFlags(ref.fFlags)
,fRawStreamVersion(ref.fRawStreamVersion)
- ,fADCBaseline(ref.fADCBaseline)
,fMinMaxCutSigma(ref.fMinMaxCutSigma)
,fMinLeftRightCutSigma(ref.fMinLeftRightCutSigma)
,fClusMaxThresh(ref.fClusMaxThresh)
par->fkNMeanClusters = 12.89;
par->fkNSigmaClusters = 2.095;
par->fkRoadzMultiplicator = 3.;
- par->fADCBaseline = 10;
par->fStreamLevel[kTracker] = 1;
par->SetCheckTimeConsistency();
return par;
inline void GetTCParams(Double_t *par) const;
inline Int_t GetStreamLevel(ETRDReconstructionTask task) const;
const TString *GetRawStreamVersion() const{ return &fRawStreamVersion; };
- Int_t GetADCBaseline() const { return fADCBaseline; }
Double_t GetMinMaxCutSigma() const { return fMinMaxCutSigma; };
Double_t GetMinLeftRightCutSigma() const { return fMinLeftRightCutSigma; };
Double_t GetClusMaxThresh() const { return fClusMaxThresh; };
void SetNSigmaClusters(Double_t sigmaNclusters) {fkNSigmaClusters = sigmaNclusters;}
void SetRawStreamVersion(const Char_t *version) {fRawStreamVersion = version; }
void SetRoadzMultiplicator(Double_t mult) {fkRoadzMultiplicator = mult; }
- void SetADCBaseline(Int_t baseline) { fADCBaseline = baseline; }
void SetMinMaxCutSigma(Float_t minMaxCutSigma) { fMinMaxCutSigma = minMaxCutSigma; }
void SetMinLeftRightCutSigma(Float_t minLeftRightCutSigma) { fMinLeftRightCutSigma = minLeftRightCutSigma; };
void SetClusMaxThresh(Float_t thresh) { fClusMaxThresh = thresh; };
// Raw Reader Params
TString fRawStreamVersion; // Raw Reader version
- Int_t fADCBaseline; // ADC Baseline
// Clusterization parameter
Double_t fMinMaxCutSigma; // Threshold sigma noise pad middle
}
AliTRDCalibraFillHisto *calibra = AliTRDCalibraFillHisto::Instance(); // Calibration monitor
if (!calibra) AliInfo("Could not get Calibra instance");
- if(!fgNTimeBins) CookNTimeBins();
+ if (!fgNTimeBins) fgNTimeBins = fkReconstructor->GetNTimeBins();
// Define scalers
Int_t nFound = 0, // number of tracks found
return new ((*fTracklets)[nentries]) AliTRDseedV1(*tracklet);
}
-//____________________________________________________________________
-void AliTRDtrackerV1::CookNTimeBins()
-{
- // Initialize number of time bins
-
- if(fgNTimeBins){
- // first look if set by hand
- AliDebug(2, Form("NTimeBins [%d] (set by user)", fgNTimeBins));
- } else if(fkReconstructor && fkReconstructor->HasDigitsParam()) {
- // second look into digits param to avoid DB query
- fgNTimeBins = fkReconstructor->GetDigitsParam()->GetNTimeBins();
- if(fgNTimeBins>0) AliDebug(2, Form("NTimeBins [%d] (set from digits param)", fgNTimeBins));
- else AliWarning(Form("NTimeBins [%d] failed from digits param.", fgNTimeBins));
- }
-
- if(!fgNTimeBins){ // third query DB
- AliTRDcalibDB *trd(NULL);
- if((trd = AliTRDcalibDB::Instance())) {
- if((fgNTimeBins = trd->GetNumberOfTimeBinsDCS()) <= 0){
- AliError("Corrupted DCS Object in OCDB");
- fgNTimeBins = 24;
- AliDebug(2, Form("NTimeBins [%d] (set to default 24)", fgNTimeBins));
- } else AliDebug(2, Form("NTimeBins [%d] (set from DB)", fgNTimeBins));
- } else AliFatal("Could not get DB.");
- }
-
- if(fgNTimeBins<=0){
- AliError("NTimeBins failed all settings. Use default 24 !");
- fgNTimeBins = 24;
- }
-}
-
//____________________________________________________________________
AliTRDtrackV1* AliTRDtrackerV1::SetTrack(const AliTRDtrackV1 * const track)
{
AliTRDtrackerV1(const AliTRDtrackerV1 &tracker);
AliTRDtrackerV1 &operator=(const AliTRDtrackerV1 &tracker);
Double_t CookLikelihood(AliTRDseedV1 *cseed, Int_t planes[4]);
- void CookNTimeBins();
Double_t CalculateTrackLikelihood(const AliTRDseedV1 *const tracklets, Double_t *chi2);
Int_t ImproveSeedQuality(AliTRDtrackingChamber **stack, AliTRDseedV1 *tracklet);
static Float_t CalculateReferenceX(const AliTRDseedV1 *const tracklets);