From d5113358a268fbde62b31932c8f1539721437082 Mon Sep 17 00:00:00 2001 From: bhess Date: Thu, 2 Oct 2014 13:19:49 +0200 Subject: [PATCH] - PIDResponse: Loading of special TPC response (splines) for debugging purposes has been fixed (bug: file with special file not used before) - PIDResponse+task: Special TPC eta map file for debugging can now be set in addition --- ANALYSIS/AliAnalysisTaskPIDResponse.cxx | 5 +++++ STEER/STEERBase/AliPIDResponse.cxx | 29 +++++++++++++++---------- STEER/STEERBase/AliPIDResponse.h | 4 ++++ 3 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ANALYSIS/AliAnalysisTaskPIDResponse.cxx b/ANALYSIS/AliAnalysisTaskPIDResponse.cxx index a9a436ff698..f9ce0421af4 100644 --- a/ANALYSIS/AliAnalysisTaskPIDResponse.cxx +++ b/ANALYSIS/AliAnalysisTaskPIDResponse.cxx @@ -122,6 +122,11 @@ void AliAnalysisTaskPIDResponse::UserCreateOutputObjects() fPIDResponse->SetCustomTPCpidResponse(resp.Data()); AliInfo(Form("Setting custom TPC response file: '%s'",resp.Data())); } + else if (resp.BeginsWith("TPC-Maps:")){ + resp.ReplaceAll("TPC-Maps:",""); + fPIDResponse->SetCustomTPCetaMaps(resp.Data()); + AliInfo(Form("Setting custom TPC eta maps file: '%s'",resp.Data())); + } } delete arr; } diff --git a/STEER/STEERBase/AliPIDResponse.cxx b/STEER/STEERBase/AliPIDResponse.cxx index 7b5cfe24881..450e6d0aeee 100644 --- a/STEER/STEERBase/AliPIDResponse.cxx +++ b/STEER/STEERBase/AliPIDResponse.cxx @@ -71,6 +71,7 @@ fIsMC(isMC), fCachePID(kFALSE), fOADBPath(), fCustomTPCpidResponse(), +fCustomTPCetaMaps(), fBeamType("PP"), fLHCperiod(), fMCperiodTPC(), @@ -137,6 +138,7 @@ fIsMC(other.fIsMC), fCachePID(other.fCachePID), fOADBPath(other.fOADBPath), fCustomTPCpidResponse(other.fCustomTPCpidResponse), +fCustomTPCetaMaps(other.fCustomTPCetaMaps), fBeamType("PP"), fLHCperiod(), fMCperiodTPC(), @@ -189,6 +191,7 @@ AliPIDResponse& AliPIDResponse::operator=(const AliPIDResponse &other) fITSPIDmethod=other.fITSPIDmethod; fOADBPath=other.fOADBPath; fCustomTPCpidResponse=other.fCustomTPCpidResponse; + fCustomTPCetaMaps=other.fCustomTPCetaMaps; fTuneMConData=other.fTuneMConData; fTuneMConDataMask=other.fTuneMConDataMask; fIsMC=other.fIsMC; @@ -1020,17 +1023,20 @@ void AliPIDResponse::SetTPCEtaMaps(Double_t refineFactorMapX, Double_t refineFac fTPCResponse.SetEtaCorrMap(0x0); fTPCResponse.SetSigmaParams(0x0, 0); + + TString fileNameMaps(Form("%s/COMMON/PID/data/TPCetaMaps.root", fOADBPath.Data())); + if (!fCustomTPCetaMaps.IsNull()) fileNameMaps=fCustomTPCetaMaps; + // Load the eta correction maps AliOADBContainer etaMapsCont(Form("TPCetaMaps_%s_pass%d", dataType.Data(), recopass)); - Int_t statusCont = etaMapsCont.InitFromFile(Form("%s/COMMON/PID/data/TPCetaMaps.root", fOADBPath.Data()), - Form("TPCetaMaps_%s_pass%d", dataType.Data(), recopass)); + Int_t statusCont = etaMapsCont.InitFromFile(fileNameMaps.Data(), Form("TPCetaMaps_%s_pass%d", dataType.Data(), recopass)); if (statusCont) { AliError("Failed initializing TPC eta correction maps from OADB -> Disabled eta correction"); fUseTPCEtaCorrection = kFALSE; } else { - AliInfo(Form("Loading TPC eta correction map from %s/COMMON/PID/data/TPCetaMaps.root", fOADBPath.Data())); + AliInfo(Form("Loading TPC eta correction map from %s", fileNameMaps.Data())); TH2D* etaMap = 0x0; @@ -1061,8 +1067,8 @@ void AliPIDResponse::SetTPCEtaMaps(Double_t refineFactorMapX, Double_t refineFac fUseTPCEtaCorrection = kFALSE; } else { - AliInfo(Form("Loaded TPC eta correction map (refine factors %.2f/%.2f) from %s/COMMON/PID/data/TPCetaMaps.root: %s (MD5(map) = %s)", - refineFactorMapX, refineFactorMapY, fOADBPath.Data(), fTPCResponse.GetEtaCorrMap()->GetTitle(), + AliInfo(Form("Loaded TPC eta correction map (refine factors %.2f/%.2f) from %s: %s (MD5(map) = %s)", + refineFactorMapX, refineFactorMapY, fileNameMaps.Data(), fTPCResponse.GetEtaCorrMap()->GetTitle(), GetChecksum(fTPCResponse.GetEtaCorrMap()).Data())); } @@ -1084,13 +1090,12 @@ void AliPIDResponse::SetTPCEtaMaps(Double_t refineFactorMapX, Double_t refineFac // Load the sigma parametrisation (1/dEdx vs tanTheta_local (~eta)) AliOADBContainer etaSigmaMapsCont(Form("TPCetaSigmaMaps_%s_pass%d", dataType.Data(), recopass)); - statusCont = etaSigmaMapsCont.InitFromFile(Form("%s/COMMON/PID/data/TPCetaMaps.root", fOADBPath.Data()), - Form("TPCetaSigmaMaps_%s_pass%d", dataType.Data(), recopass)); + statusCont = etaSigmaMapsCont.InitFromFile(fileNameMaps.Data(), Form("TPCetaSigmaMaps_%s_pass%d", dataType.Data(), recopass)); if (statusCont) { AliError("Failed initializing TPC eta sigma maps from OADB -> Using old sigma parametrisation"); } else { - AliInfo(Form("Loading TPC eta sigma map from %s/COMMON/PID/data/TPCetaMaps.root", fOADBPath.Data())); + AliInfo(Form("Loading TPC eta sigma map from %s", fileNameMaps.Data())); TObjArray* etaSigmaPars = 0x0; @@ -1132,8 +1137,8 @@ void AliPIDResponse::SetTPCEtaMaps(Double_t refineFactorMapX, Double_t refineFac fTPCResponse.SetSigmaParams(0x0, 0); } else { - AliInfo(Form("Loaded TPC sigma correction map (refine factors %.2f/%.2f) from %s/COMMON/PID/data/TPCetaMaps.root: %s (MD5(map) = %s, sigmaPar0 = %f)", - refineFactorSigmaMapX, refineFactorSigmaMapY, fOADBPath.Data(), fTPCResponse.GetSigmaPar1Map()->GetTitle(), + AliInfo(Form("Loaded TPC sigma correction map (refine factors %.2f/%.2f) from %s: %s (MD5(map) = %s, sigmaPar0 = %f)", + refineFactorSigmaMapX, refineFactorSigmaMapY, fileNameMaps.Data(), fTPCResponse.GetSigmaPar1Map()->GetTitle(), GetChecksum(fTPCResponse.GetSigmaPar1Map()).Data(), sigmaPar0)); } @@ -1162,11 +1167,11 @@ void AliPIDResponse::SetTPCPidResponseMaster() delete fArrPidResponseMaster; fArrPidResponseMaster=NULL; - TString fileName(Form("%s/COMMON/PID/data/TPCPIDResponse.root", fOADBPath.Data())); TFile *f=NULL; - if (!fCustomTPCpidResponse.IsNull()) fileName=fCustomTPCpidResponse; TString fileNamePIDresponse(Form("%s/COMMON/PID/data/TPCPIDResponse.root", fOADBPath.Data())); + if (!fCustomTPCpidResponse.IsNull()) fileNamePIDresponse=fCustomTPCpidResponse; + f=TFile::Open(fileNamePIDresponse.Data()); if (f && f->IsOpen() && !f->IsZombie()){ fArrPidResponseMaster=dynamic_cast(f->Get("TPCPIDResponse")); diff --git a/STEER/STEERBase/AliPIDResponse.h b/STEER/STEERBase/AliPIDResponse.h index 106ee67498a..8bd9d575543 100644 --- a/STEER/STEERBase/AliPIDResponse.h +++ b/STEER/STEERBase/AliPIDResponse.h @@ -139,6 +139,9 @@ public: void SetCustomTPCpidResponse(const char* tpcpid) { fCustomTPCpidResponse = tpcpid; } const char* GetCustomTPCpidResponse() const { return fCustomTPCpidResponse.Data(); } + void SetCustomTPCetaMaps(const char* tpcEtaMaps) { fCustomTPCetaMaps = tpcEtaMaps; } + const char* GetCustomTPCetaMaps() const { return fCustomTPCetaMaps.Data(); } + void InitialiseEvent(AliVEvent *event, Int_t pass, Int_t run=-1); void SetCurrentFile(const char* file) { fCurrentFile=file; } @@ -216,6 +219,7 @@ private: TString fOADBPath; // OADB path to use TString fCustomTPCpidResponse; // Custom TPC Pid Response file for debugging purposes + TString fCustomTPCetaMaps; // Custom TPC eta map file for debugging purposes TString fBeamType; //! beam type (PP) or (PBPB) TString fLHCperiod; //! LHC period -- 2.39.3