From 9daf22f89a6ff15396be26c8f46d2ad43910561e Mon Sep 17 00:00:00 2001 From: morsch Date: Fri, 14 Jan 2011 16:32:41 +0000 Subject: [PATCH] Bug fixes. Markus Fasel --- .../TenderSupplies/AliTRDTenderSupply.cxx | 24 +++++++++++++++---- ANALYSIS/TenderSupplies/AliTRDTenderSupply.h | 2 ++ 2 files changed, 21 insertions(+), 5 deletions(-) diff --git a/ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx b/ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx index 797a3c866bf..a2ed3272234 100644 --- a/ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx +++ b/ANALYSIS/TenderSupplies/AliTRDTenderSupply.cxx @@ -57,7 +57,8 @@ AliTRDTenderSupply::AliTRDTenderSupply() : fChamberGainNew(NULL), fChamberVdriftOld(NULL), fChamberVdriftNew(NULL), - fPIDmethod(k1DLQpid), + fFileNNref(""), + fPIDmethod(kNNpid), fPthreshold(0.8), fNBadChambers(0), fGainCorrection(kTRUE) @@ -76,7 +77,8 @@ AliTRDTenderSupply::AliTRDTenderSupply(const char *name, const AliTender *tender fChamberGainNew(NULL), fChamberVdriftOld(NULL), fChamberVdriftNew(NULL), - fPIDmethod(k1DLQpid), + fFileNNref(""), + fPIDmethod(kNNpid), fPthreshold(0.8), fNBadChambers(0), fGainCorrection(kTRUE) @@ -113,10 +115,13 @@ void AliTRDTenderSupply::Init() // Set Normalisation Factors if(mgr->GetMCtruthEventHandler()){ // Assume MC + //fESDpid->GetTRDResponse().SetGainNormalisationFactor(1.); SwitchOffGainCorrection(); } else{ // Assume Data + //if(fPIDmethod == kNNpid) fPidRecal->SetGainScaleFactor(1.14); + //fESDpid->GetTRDResponse().SetGainNormalisationFactor(1.14); SwitchOnGainCorrection(); } } @@ -141,9 +146,18 @@ void AliTRDTenderSupply::ProcessEvent() // for(Int_t itrack = 0; itrack < ntracks; itrack++){ AliESDtrack *track=fESD->GetTrack(itrack); + // Recalculate likelihoods if(!(track->GetStatus() & AliESDtrack::kTRDout)) continue; if(fGainCorrection) ApplyGainCorrection(track); - fESDpid->MakeTRDPID(fESD->GetTrack(itrack)); + switch(fPIDmethod){ + case kNNpid: + break; + case k1DLQpid: + fESDpid->MakeTRDPID(fESD->GetTrack(itrack)); + break; + default: + AliError("PID Method not implemented (yet)"); + } } } @@ -180,7 +194,7 @@ void AliTRDTenderSupply::SetChamberGain(){ // Get Old gain calibration AliCDBId *id=AliCDBId::MakeFromString(os->GetString()); - AliCDBEntry *entry=fTender->GetCDBManager()->Get(*id); + AliCDBEntry *entry=fTender->GetCDBManager()->Get(id->GetPath(), id->GetFirstRun(), id->GetVersion()); if (!entry) { AliError("No previous gain calibration entry found"); return; @@ -193,7 +207,7 @@ void AliTRDTenderSupply::SetChamberGain(){ // Get Old drift velocity calibration AliCDBId *id=AliCDBId::MakeFromString(os->GetString()); - AliCDBEntry *entry=fTender->GetCDBManager()->Get(*id); + AliCDBEntry *entry=fTender->GetCDBManager()->Get(id->GetPath(), id->GetFirstRun(), id->GetVersion()); if (!entry) { AliError("No previous drift velocity calibration entry found"); return; diff --git a/ANALYSIS/TenderSupplies/AliTRDTenderSupply.h b/ANALYSIS/TenderSupplies/AliTRDTenderSupply.h index 243c0996d21..5eb95432685 100644 --- a/ANALYSIS/TenderSupplies/AliTRDTenderSupply.h +++ b/ANALYSIS/TenderSupplies/AliTRDTenderSupply.h @@ -30,6 +30,7 @@ public: AliTRDTenderSupply(const char *name, const AliTender *tender=NULL); virtual ~AliTRDTenderSupply(); + void SetNNref(const char* file) {fFileNNref=file;} void SetPIDmethod(Int_t pidMethod) { fPIDmethod = pidMethod; } void SetCalibLowpThreshold(Double_t pmin) { fPthreshold = pmin; }; @@ -59,6 +60,7 @@ private: AliTRDCalDet *fChamberVdriftOld; // Old drift velocity calibration AliTRDCalDet *fChamberVdriftNew; // New drift velocity calibration + TString fFileNNref; // path and name to the NNref file Int_t fPIDmethod; // PID method Double_t fPthreshold; // Low Momentum threshold for calibration Int_t fBadChamberID[kNChambers]; // List of Bad Chambers -- 2.39.3