From a9f9c69b92adbdaab4b15c918e49895fd41847de Mon Sep 17 00:00:00 2001 From: hristov Date: Wed, 19 Sep 2012 10:16:31 +0000 Subject: [PATCH] #97528: Commit to the trunk changes needed for mirroring OCDB entries during CPass --- PWGPP/CalibMacros/CPass0/makeOCDB.C | 60 ++++++----- PWGPP/CalibMacros/CPass1/makeOCDB.C | 52 +++++---- .../ITS/AliMeanVertexPreprocessorOffline.cxx | 38 ++----- PWGPP/ITS/AliMeanVertexPreprocessorOffline.h | 3 +- T0/AliT0PreprocessorOffline.cxx | 30 +++--- T0/AliT0PreprocessorOffline.h | 9 +- TOF/AliTOFAnalysisTaskCalibPass0.cxx | 25 ++--- TOF/AliTOFAnalysisTaskCalibPass0.h | 7 +- TPC/AliTPCPreprocessorOffline.cxx | 88 +++++++-------- TPC/AliTPCPreprocessorOffline.h | 21 ++-- TRD/AliTRDPreprocessorOffline.cxx | 100 ++++++++++-------- TRD/AliTRDPreprocessorOffline.h | 31 +++--- 12 files changed, 240 insertions(+), 224 deletions(-) diff --git a/PWGPP/CalibMacros/CPass0/makeOCDB.C b/PWGPP/CalibMacros/CPass0/makeOCDB.C index f06d2958e16..6c8454f7a6d 100644 --- a/PWGPP/CalibMacros/CPass0/makeOCDB.C +++ b/PWGPP/CalibMacros/CPass0/makeOCDB.C @@ -32,67 +32,77 @@ void makeOCDB(Int_t runNumber, TString targetOCDBstorage="", TString sourceOCDB // check the presence of the detectors AliCDBEntry* entry = AliCDBManager::Instance()->Get("GRP/GRP/Data"); - AliGRPObject* grpData = dynamic_cast(entry->GetObject()); + AliGRPObject* grpData = dynamic_cast(entry->GetObject()); if (!grpData) {printf("Failed to get GRP data for run",runNumber); return;} - Int_t activeDetectors = grpData->GetDetectorMask(); + Int_t activeDetectors = grpData->GetDetectorMask(); TString detStr = AliDAQ::ListOfTriggeredDetectors(activeDetectors); printf("Detectors in the data:\n%s\n",detStr.Data()); - printf("Monalisa: Detectors in the data:\t%s\n",detStr.Data()); // Steering Tasks - set output storage // DefaultStorage set already before - in ConfigCalibTrain.C - //targetOCDBstorage+="?se=ALICE::CERN::SE"; - // for tests, the target OCDB has to be different from raw://, but since the calibration procedure may need to read the OCDB, - // one cannot set the target OCDB as new default storage, since it could it that it does not contain all the necessary entries. - // This is true only if the target OCDB storage is different from the one used as default source and to configure the train - if (targetOCDBstorage != sourceOCDBstorage) AliCDBManager::Instance()->SetSpecificStorage("*/*/*", targetOCDBstorage.Data()); + // Setting the mirror SEs for the default storage + TString mirrorsStr("ALICE::CERN::OCDB,ALICE::FZK::SE,ALICE::LLNL::SE"); + AliCDBManager::Instance()->SetMirrorSEs(mirrorsStr.Data()); + printf("List of mirror SEs set to: \"%s\"\n",mirrorsStr.Data()); + // activate target OCDB storage + AliCDBStorage* targetStorage = 0x0; + if (targetOCDBstorage.Length()==0) targetOCDBstorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + else if (targetOCDBstorage.CompareTo("same",TString::kIgnoreCase) == 0 ){ + targetStorage = AliCDBManager::Instance()->GetDefaultStorage(); + } + else { + targetStorage = AliCDBManager::Instance()->GetStorage(targetOCDBstorage.Data()); + targetStorage->SetMirrorSEs(mirrorsStr.Data()); + } + printf("** targetOCDBstorage: \"%s\"\n",targetOCDBstorage.Data()); + + // specific storage for TPC/Calib/Correction entry if (gSystem->AccessPathName("TPC", kFileExists)==0) { AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Correction","local://"); } - // set OCDB storage - if (targetOCDBstorage.Length()==0) targetOCDBstorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; // TPC part AliTPCPreprocessorOffline *procesTPC = 0; - if (detStr.Contains("TPC")){ + if (detStr.Contains("TPC")){ Printf("\n******* Calibrating TPC *******"); - procesTPC = new AliTPCPreprocessorOffline; + procesTPC = new AliTPCPreprocessorOffline; // switch on parameter validation procesTPC->SetTimeGainRange(0.5,5.0); procesTPC->SetMaxVDriftCorr(0.2); + //procesTPC->SetMinTracksVdrift(100000); procesTPC->SwitchOnValidation(); // Make timegain calibration //proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),targetOCDBstorage); - procesTPC->CalibTimeGain("CalibObjects.root", runNumber,runNumber,targetOCDBstorage); + procesTPC->CalibTimeGain("CalibObjects.root", runNumber,runNumber,targetStorage); // Make vdrift calibration //proces.CalibTimeVdrift("CalibObjects.root",runNumber,AliCDBRunRange::Infinity(),targetOCDBstorage); - procesTPC->CalibTimeVdrift("CalibObjects.root",runNumber,runNumber,targetOCDBstorage); + procesTPC->CalibTimeVdrift("CalibObjects.root",runNumber,runNumber,targetStorage); } // TOF part AliTOFAnalysisTaskCalibPass0 *procesTOF=0; - if ( detStr.Contains("TOF") && detStr.Contains("TPC")){ + if (detStr.Contains("TOF") && detStr.Contains("TPC")){ procesTOF = new AliTOFAnalysisTaskCalibPass0; Printf("\n******* Calibrating TOF *******"); - procesTOF->ProcessOutput("CalibObjects.root", targetOCDBstorage); + procesTOF->ProcessOutput("CalibObjects.root", targetStorage); } // T0 part AliT0PreprocessorOffline *procesT0= 0; - if ( detStr.Contains("T0")) { + if (detStr.Contains("T0")) { Printf("\n******* Calibrating T0 *******"); // Make calibration of channels offset - procesT0= new AliT0PreprocessorOffline; - procesT0->Process("CalibObjects.root",runNumber, runNumber, targetOCDBstorage); + procesT0 = new AliT0PreprocessorOffline; + procesT0->Process("CalibObjects.root",runNumber, runNumber, targetStorage); } //TRD part AliTRDPreprocessorOffline *procesTRD = 0; - if ( detStr.Contains("TRD") && detStr.Contains("TPC")){ + if (detStr.Contains("TRD") && detStr.Contains("TPC")){ Printf("\n******* Calibrating TRD *******"); procesTRD = new AliTRDPreprocessorOffline; procesTRD->SetLinearFitForVdrift(kTRUE); @@ -112,15 +122,15 @@ void makeOCDB(Int_t runNumber, TString targetOCDBstorage="", TString sourceOCDB printf("version and subversion vdrift %d and %d\n",versionVdriftUsed,subversionVdriftUsed); printf("version and subversion gain %d and %d\n",versionGainUsed,subversionGainUsed); printf("version and subversion exb %d and %d\n",versionExBUsed,subversionExBUsed); - procesTRD->Process("CalibObjects.root",runNumber,runNumber,targetOCDBstorage); + procesTRD->Process("CalibObjects.root",runNumber,runNumber,targetStorage); } //Mean Vertex AliMeanVertexPreprocessorOffline * procesMeanVtx=0; - if ( detStr.Contains("ITSSPD")) { + if (detStr.Contains("ITSSPD")) { Printf("\n******* Calibrating MeanVertex *******"); - procesMeanVtx = new AliMeanVertexPreprocessorOffline; - procesMeanVtx->ProcessOutput("CalibObjects.root", targetOCDBstorage, runNumber); + procesMeanVtx = new AliMeanVertexPreprocessorOffline; + procesMeanVtx->ProcessOutput("CalibObjects.root", targetStorage, runNumber); } // @@ -129,7 +139,7 @@ void makeOCDB(Int_t runNumber, TString targetOCDBstorage="", TString sourceOCDB Int_t trdStatus = (procesTRD) ? procesTRD->GetStatus():0; Int_t tofStatus = (procesTOF) ? procesTOF->GetStatus():0; Int_t t0Status = (procesT0) ? procesT0->GetStatus():0; - Int_t tpcStatus = (procesTPC) ? ((procesTPC->ValidateTimeDrift() || procesTPC->ValidateTimeGain())==kFALSE):0; + Int_t tpcStatus = (procesTPC) ? procesTPC->GetStatus():0; // printf("\n"); printf("******* CPass0 calibration status *******\n"); diff --git a/PWGPP/CalibMacros/CPass1/makeOCDB.C b/PWGPP/CalibMacros/CPass1/makeOCDB.C index c0f857e4a75..dab6458553e 100644 --- a/PWGPP/CalibMacros/CPass1/makeOCDB.C +++ b/PWGPP/CalibMacros/CPass1/makeOCDB.C @@ -38,55 +38,65 @@ void makeOCDB(Int_t runNumber, TString targetOCDBstorage="", TString sourceOCDB // Steering Tasks - set output storage // DefaultStorage set already before - in ConfigCalibTrain.C - //targetOCDBstorage+="?se=ALICE::CERN::SE"; - // for tests, the target OCDB has to be different from raw://, but since the calibration procedure may need to read the OCDB, - // one cannot set the target OCDB as new default storage, since it could it that it does not contain all the necessary entries. - // This is true only if the target OCDB storage is different from the one used as default source and to configure the train - if (targetOCDBstorage != sourceOCDBstorage) AliCDBManager::Instance()->SetSpecificStorage("*/*/*", targetOCDBstorage.Data()); + // Setting the mirror SEs for the default storage + TString mirrorsStr("ALICE::CERN::OCDB,ALICE::FZK::SE,ALICE::LLNL::SE"); + AliCDBManager::Instance()->SetMirrorSEs(mirrorsStr.Data()); + printf("List of mirror SEs set to: \"%s\"\n",mirrorsStr.Data()); + // activate target OCDB storage + AliCDBStorage* targetStorage = 0x0; + if (targetOCDBstorage.Length()==0) targetOCDBstorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + else if (targetOCDBstorage.CompareTo("same",TString::kIgnoreCase) == 0 ){ + targetStorage = AliCDBManager::Instance()->GetDefaultStorage(); + } + else { + targetStorage = AliCDBManager::Instance()->GetStorage(targetOCDBstorage.Data()); + } + printf("** targetOCDBstorage: \"%s\"\n",targetOCDBstorage.Data()); + + // specific storage for TPC/Calib/Correction entry if (gSystem->AccessPathName("TPC", kFileExists)==0) { AliCDBManager::Instance()->SetSpecificStorage("TPC/Calib/Correction","local://"); } - // set OCDB storage - if (targetOCDBstorage.Length()==0) targetOCDBstorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; // TPC part - AliTPCPreprocessorOffline* procesTPC=0; + AliTPCPreprocessorOffline *procesTPC = 0; if (detStr.Contains("TPC")){ Printf("\n******* Calibrating TPC *******"); Printf("TPC won't be calibrated at CPass1 for the time being... Doing nothing here"); //procesTPC = new AliTPCPreprocessorOffline; // switch on parameter validation //procesTPC->SetTimeGainRange(0.5,4.0); + //procesTPC->SetMinTracksVdrift(100000); //procesTPC->SwitchOnValidation(); // Make timegain calibration - //proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),targetOCDBstorage); + //proces.CalibTimeGain("CalibObjects.root", runNumber,AliCDBRunRange::Infinity(),targetStorage); // Make vdrift calibration - //proces.CalibTimeVdrift("CalibObjects.root",runNumber,AliCDBRunRange::Infinity(),targetOCDBstorage); + //proces.CalibTimeVdrift("CalibObjects.root",runNumber,AliCDBRunRange::Infinity(),targetStorage); } // TOF part AliTOFAnalysisTaskCalibPass0 *procesTOF=0; - if ( detStr.Contains("TOF") && detStr.Contains("TPC")){ + if (detStr.Contains("TOF") && detStr.Contains("TPC")){ procesTOF = new AliTOFAnalysisTaskCalibPass0; Printf("\n******* Calibrating TOF *******"); - procesTOF->ProcessOutput("CalibObjects.root", targetOCDBstorage); + procesTOF->ProcessOutput("CalibObjects.root", targetStorage); } // T0 part AliT0PreprocessorOffline *procesT0= 0; - if ( detStr.Contains("T0")) { + if (detStr.Contains("T0")) { Printf("\n******* Calibrating T0 *******"); procesT0 = new AliT0PreprocessorOffline; // Make calibration of channels offset procesT0->setDArun(177000); - procesT0->Process("CalibObjects.root",runNumber, runNumber, targetOCDBstorage); + procesT0->Process("CalibObjects.root",runNumber, runNumber, targetStorage); } //TRD part AliTRDPreprocessorOffline *procesTRD = 0; - if ( detStr.Contains("TRD") && detStr.Contains("TPC")){ + if (detStr.Contains("TRD") && detStr.Contains("TPC")){ Printf("\n******* Calibrating TRD *******"); procesTRD = new AliTRDPreprocessorOffline; procesTRD->SetLinearFitForVdrift(kTRUE); @@ -106,17 +116,17 @@ void makeOCDB(Int_t runNumber, TString targetOCDBstorage="", TString sourceOCDB printf("version and subversion vdrift %d and %d\n",versionVdriftUsed,subversionVdriftUsed); printf("version and subversion gain %d and %d\n",versionGainUsed,subversionGainUsed); printf("version and subversion exb %d and %d\n",versionExBUsed,subversionExBUsed); - procesTRD->Process("CalibObjects.root",runNumber,runNumber,targetOCDBstorage); + procesTRD->Process("CalibObjects.root",runNumber,runNumber,targetStorage); } // switched OFF at CPass1 in any case /* //Mean Vertex AliMeanVertexPreprocessorOffline * procesMeanVtx=0; - if ( detStr.Contains("ITSSPD")) { + if (detStr.Contains("ITSSPD")) { Printf("\n******* Calibrating MeanVertex *******"); procesMeanVtx = new AliMeanVertexPreprocessorOffline; - procesMeanVtx->ProcessOutput("CalibObjects.root", targetOCDBstorage, runNumber); + procesMeanVtx->ProcessOutput("CalibObjects.root", targetStorage, runNumber); } */ @@ -126,10 +136,10 @@ void makeOCDB(Int_t runNumber, TString targetOCDBstorage="", TString sourceOCDB Int_t trdStatus = (procesTRD) ? procesTRD->GetStatus():0; Int_t tofStatus = (procesTOF) ? procesTOF->GetStatus():0; Int_t t0Status = (procesT0) ? procesT0->GetStatus():0; - Int_t tpcStatus = (procesTPC) ? ((procesTPC->ValidateTimeDrift() || procesTPC->ValidateTimeGain())==kFALSE):0; + Int_t tpcStatus = (procesTPC) ? procesTPC->GetStatus():0; // - printf("\n\n\n\n"); - printf("CPass1 calibration status\n"); + printf("\n"); + printf("******* CPass1 calibration status *******\n"); printf("TRD calibration status=%d\n",trdStatus); printf("TOF calibration status=%d\n",tofStatus); printf("TPC calibration status=%d\n",tpcStatus); diff --git a/PWGPP/ITS/AliMeanVertexPreprocessorOffline.cxx b/PWGPP/ITS/AliMeanVertexPreprocessorOffline.cxx index 81120366d97..60869698aa3 100644 --- a/PWGPP/ITS/AliMeanVertexPreprocessorOffline.cxx +++ b/PWGPP/ITS/AliMeanVertexPreprocessorOffline.cxx @@ -60,7 +60,7 @@ AliMeanVertexPreprocessorOffline::~AliMeanVertexPreprocessorOffline() } //____________________________________________________ -void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, const char *dbString, Int_t runNb){ +void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, AliCDBStorage *db, Int_t runNb){ TFile *file = TFile::Open(filename); if (!file || !file->IsOpen()){ @@ -68,9 +68,9 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, const return; } - if (!dbString){ - AliError(Form("no OCDB path found, return")); - return; + if (!db){ + AliError(Form("no OCDB storage found, return")); + return; } @@ -347,16 +347,7 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, const Double_t sigma[3]={0.0150, 0.0150, zSigmaVtx}; AliESDVertex *vertex = new AliESDVertex(posOnline, sigma, "vertex"); - - AliCDBManager *cdb = AliCDBManager::Instance(); - AliCDBStorage *sto = cdb->GetStorage(dbString); - - - if (!sto) { - AliError(Form("cannot get storage %s", dbString)); - return; - } - + AliCDBId id("GRP/Calib/MeanVertex", runNb, runNb); AliCDBMetaData metaData; @@ -364,8 +355,8 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, const metaData.SetResponsible("Davide Caffarri"); metaData.SetComment("Mean Vertex object used in reconstruction"); - if (!sto->Put(vertex, id, &metaData)) { - AliError(Form("Error while putting object in storage %s", dbString)); + if (!db->Put(vertex, id, &metaData)) { + AliError(Form("Error while putting object in storage %s", db->GetURI().Data())); } delete vertex; @@ -603,16 +594,7 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, const //Printf ("%f, %f, %f, %f", xSigmaVtx, ySigmaVtx, covarXZ, covarYZ); AliESDVertex *vertex = new AliESDVertex(position, covMatrix, chi2, nContr, "vertex"); - - AliCDBManager *cdb = AliCDBManager::Instance(); - AliCDBStorage *sto = cdb->GetStorage(dbString); - - - if (!sto) { - AliError(Form("cannot get storage %s", dbString)); - return; - } - + AliCDBId id("GRP/Calib/MeanVertex", runNb, runNb); AliCDBMetaData metaData; @@ -620,8 +602,8 @@ void AliMeanVertexPreprocessorOffline::ProcessOutput(const char *filename, const metaData.SetResponsible("Davide Caffarri"); metaData.SetComment("Mean Vertex object used in reconstruction"); - if (!sto->Put(vertex, id, &metaData)) { - AliError(Form("Error while putting object in storage %s", dbString)); + if (!db->Put(vertex, id, &metaData)) { + AliError(Form("Error while putting object in storage %s", db->GetURI().Data())); } delete vertex; diff --git a/PWGPP/ITS/AliMeanVertexPreprocessorOffline.h b/PWGPP/ITS/AliMeanVertexPreprocessorOffline.h index cae1a314d7d..0297c778710 100644 --- a/PWGPP/ITS/AliMeanVertexPreprocessorOffline.h +++ b/PWGPP/ITS/AliMeanVertexPreprocessorOffline.h @@ -11,6 +11,7 @@ // Davide Caffarri // #include "TNamed.h" +class AliCDBStorage; class AliMeanVertexPreprocessorOffline: public TNamed { @@ -18,7 +19,7 @@ class AliMeanVertexPreprocessorOffline: public TNamed AliMeanVertexPreprocessorOffline(); virtual ~AliMeanVertexPreprocessorOffline(); - void ProcessOutput(const char *filename, const char *dbString, Int_t runNb); + void ProcessOutput(const char *filename, AliCDBStorage *db, Int_t runNb); private: diff --git a/T0/AliT0PreprocessorOffline.cxx b/T0/AliT0PreprocessorOffline.cxx index 5b432dcf203..e013b830193 100644 --- a/T0/AliT0PreprocessorOffline.cxx +++ b/T0/AliT0PreprocessorOffline.cxx @@ -50,7 +50,7 @@ TNamed("AliT0PreprocessorOffline","AliT0PreprocessorOffline"), endRun(0), startTime(0), endTime(0), - ocdbStorage(""), + ocdbStorage(0), fNewDArun(9999999), fStatusDelay(0), fStatusAdjust(0) @@ -66,7 +66,7 @@ AliT0PreprocessorOffline::~AliT0PreprocessorOffline() } //____________________________________________________ -void AliT0PreprocessorOffline::Process(TString filePhysName, Int_t ustartRun, Int_t uendRun, TString pocdbStorage) +void AliT0PreprocessorOffline::Process(TString filePhysName, Int_t ustartRun, Int_t uendRun, AliCDBStorage* pocdbStorage) { if ( ustartRun < fNewDArun) CalibOffsetChannels(filePhysName, ustartRun, uendRun, pocdbStorage); @@ -74,7 +74,7 @@ void AliT0PreprocessorOffline::Process(TString filePhysName, Int_t ustartRun, In } //____________________________________________________ -void AliT0PreprocessorOffline::CalibOffsetChannels(TString filePhysName, Int_t ustartRun, Int_t uendRun, TString pocdbStorage) +void AliT0PreprocessorOffline::CalibOffsetChannels(TString filePhysName, Int_t ustartRun, Int_t uendRun, AliCDBStorage* pocdbStorage) { Float_t zero_timecdb[24]={0}; @@ -87,9 +87,11 @@ void AliT0PreprocessorOffline::CalibOffsetChannels(TString filePhysName, Int_t u Int_t badpmt=-1; //Processing data from DAQ Physics run AliInfo("Processing Time Offset between channels"); - if (pocdbStorage.Length()>0) ocdbStorage=pocdbStorage; - else - ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (pocdbStorage) ocdbStorage=pocdbStorage; + else { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + ocdbStorage= AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } AliCDBEntry *entryCalib = AliCDBManager::Instance()->Get("T0/Calib/TimeDelay"); if(!entryCalib) { AliWarning(Form("Cannot find any AliCDBEntry for [Calib, TimeDelay]!")); @@ -115,8 +117,7 @@ void AliT0PreprocessorOffline::CalibOffsetChannels(TString filePhysName, Int_t u if (writeok==0) { AliCDBId* id1=NULL; id1=new AliCDBId("T0/Calib/TimeDelay", ustartRun, uendRun ); - AliCDBStorage* gStorage = AliCDBManager::Instance()->GetStorage(ocdbStorage); - gStorage->Put(offline, (*id1), &metaData); + ocdbStorage->Put(offline, (*id1), &metaData); } else { @@ -127,14 +128,16 @@ void AliT0PreprocessorOffline::CalibOffsetChannels(TString filePhysName, Int_t u } //------------------------------------------------------------------------------------- -void AliT0PreprocessorOffline::CalibT0sPosition(TString filePhysName, Int_t ustartRun, Int_t uendRun, TString pocdbStorage) +void AliT0PreprocessorOffline::CalibT0sPosition(TString filePhysName, Int_t ustartRun, Int_t uendRun, AliCDBStorage* pocdbStorage) { printf(" AliT0PreprocessorOffline::CalibT0sPosition \n"); Float_t zero_timecdb[4]={0}; Float_t *timecdb = zero_timecdb; - if (pocdbStorage.Length()>0) ocdbStorage=pocdbStorage; - else - ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (pocdbStorage) ocdbStorage=pocdbStorage; + else { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + ocdbStorage=AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } AliT0CalibSeasonTimeShift *offline = new AliT0CalibSeasonTimeShift(); Int_t writeok = offline->SetT0Par(filePhysName.Data(), timecdb); @@ -147,8 +150,7 @@ void AliT0PreprocessorOffline::CalibT0sPosition(TString filePhysName, Int_t usta if (writeok == 0) { AliCDBId* id1=NULL; id1=new AliCDBId("T0/Calib/TimeAdjust", ustartRun, uendRun); - AliCDBStorage* gStorage = AliCDBManager::Instance()->GetStorage(ocdbStorage); - gStorage->Put(offline, (*id1), &metaData); + ocdbStorage->Put(offline, (*id1), &metaData); } } diff --git a/T0/AliT0PreprocessorOffline.h b/T0/AliT0PreprocessorOffline.h index 4d83b2d20b8..f3285327a93 100644 --- a/T0/AliT0PreprocessorOffline.h +++ b/T0/AliT0PreprocessorOffline.h @@ -9,15 +9,16 @@ // T0 preprocessor. #include "TNamed.h" +class AliCDBStorage; class AliT0PreprocessorOffline: public TNamed { public: AliT0PreprocessorOffline(); virtual ~AliT0PreprocessorOffline(); - void CalibOffsetChannels(TString FileName, Int_t ustartRun, Int_t uendRun, TString ocdbStorage); - void CalibT0sPosition(TString FileName, Int_t ustartRun, Int_t uendRun, TString ocdbStorage); - void Process(TString FileName, Int_t ustartRun, Int_t uendRun, TString ocdbStorage); + void CalibOffsetChannels(TString FileName, Int_t ustartRun, Int_t uendRun, AliCDBStorage* ocdbStorage); + void CalibT0sPosition(TString FileName, Int_t ustartRun, Int_t uendRun, AliCDBStorage* ocdbStorage); + void Process(TString FileName, Int_t ustartRun, Int_t uendRun, AliCDBStorage* ocdbStorage); void setDArun(Int_t runnumber) {fNewDArun = runnumber; }; Int_t GetStatus() const; private: @@ -27,7 +28,7 @@ class AliT0PreprocessorOffline: public TNamed Int_t endRun; // end Run - used to make fast selection in THnSparse Int_t startTime; // startTime - used to make fast selection in THnSparse Int_t endTime; // endTime - used to make fast selection in THnSparse - TString ocdbStorage; // path to the OCDB storage + AliCDBStorage* ocdbStorage; // OCDB storage Int_t fNewDArun; // run number with new DA Int_t fStatusDelay; //status time delay calibration Int_t fStatusAdjust; // status time adjust calibration diff --git a/TOF/AliTOFAnalysisTaskCalibPass0.cxx b/TOF/AliTOFAnalysisTaskCalibPass0.cxx index 38a36dbc571..d0a943d9045 100644 --- a/TOF/AliTOFAnalysisTaskCalibPass0.cxx +++ b/TOF/AliTOFAnalysisTaskCalibPass0.cxx @@ -412,13 +412,13 @@ AliTOFAnalysisTaskCalibPass0::PrintStatus() //_______________________________________________________ Bool_t -AliTOFAnalysisTaskCalibPass0::ProcessOutput(const Char_t *filename, const Char_t *dbString) +AliTOFAnalysisTaskCalibPass0::ProcessOutput(const Char_t *filename, AliCDBStorage* db) { /* * process output */ - Int_t ret = DoProcessOutput(filename, dbString); + Int_t ret = DoProcessOutput(filename, db); PrintStatus(); return ret; } @@ -426,7 +426,7 @@ AliTOFAnalysisTaskCalibPass0::ProcessOutput(const Char_t *filename, const Char_t //_______________________________________________________ Bool_t -AliTOFAnalysisTaskCalibPass0::DoProcessOutput(const Char_t *filename, const Char_t *dbString) +AliTOFAnalysisTaskCalibPass0::DoProcessOutput(const Char_t *filename, AliCDBStorage *db) { /* * do process output @@ -506,7 +506,7 @@ AliTOFAnalysisTaskCalibPass0::DoProcessOutput(const Char_t *filename, const Char return kFALSE; } /* calibrate and store */ - if (!CalibrateAndStore(histoVertexTimestamp, histoDeltatTimestamp, dbString)) { + if (!CalibrateAndStore(histoVertexTimestamp, histoDeltatTimestamp, db)) { AliError("error while calibrating and storing"); return kFALSE; } @@ -534,7 +534,7 @@ AliTOFAnalysisTaskCalibPass0::CheckMatchingPerformance(const TH2F *histoDeltazCo //_______________________________________________________ Bool_t -AliTOFAnalysisTaskCalibPass0::CalibrateAndStore(TH2F *histoVertexTimestamp, TH2F *histoDeltatTimestamp, const Char_t *dbString) +AliTOFAnalysisTaskCalibPass0::CalibrateAndStore(TH2F *histoVertexTimestamp, TH2F *histoDeltatTimestamp, AliCDBStorage *db) { /* * calibrate and store @@ -783,29 +783,22 @@ AliTOFAnalysisTaskCalibPass0::CalibrateAndStore(TH2F *histoVertexTimestamp, TH2F /*** CREATE OCDB ENTRY ***/ - if (!dbString) { - AliError("cannot store object because of NULL string"); + if (!db) { + AliError("cannot store object because of NULL storage"); fStatus = kStoreError; return kFALSE; } /* install run params object in OCDB */ - AliCDBManager *cdb = AliCDBManager::Instance(); - AliCDBStorage *sto = cdb->GetStorage(dbString); - if (!sto) { - AliError(Form("cannot get storage %s", dbString)); - fStatus = kStoreError; - return kFALSE; - } AliCDBId id("TOF/Calib/RunParams", runNb, runNb); AliCDBMetaData md; md.SetResponsible("Roberto Preghenella"); md.SetComment("offline TOF run parameters"); md.SetAliRootVersion(gSystem->Getenv("ARVERSION")); md.SetBeamPeriod(0); - if (!sto->Put(&obj, id, &md)) { + if (!db->Put(&obj, id, &md)) { fStatus = kStoreError; - AliError(Form("error while putting object in storage %s", dbString)); + AliError(Form("error while putting object in storage %s", db->GetURI().Data())); return kFALSE; } diff --git a/TOF/AliTOFAnalysisTaskCalibPass0.h b/TOF/AliTOFAnalysisTaskCalibPass0.h index ccf5b20660e..3266b764c86 100644 --- a/TOF/AliTOFAnalysisTaskCalibPass0.h +++ b/TOF/AliTOFAnalysisTaskCalibPass0.h @@ -24,6 +24,7 @@ class TList; class TH2F; class TF1; class TH1D; +class AliCDBStorage; class AliTOFAnalysisTaskCalibPass0 : public AliAnalysisTaskSE @@ -48,8 +49,8 @@ public AliAnalysisTaskSE void SetVertexCut(Double_t value) {fVertexCut = value;}; // setter /* post-processing methods */ - Bool_t ProcessOutput(const Char_t *filename, const Char_t *dbString); // process output - Bool_t DoProcessOutput(const Char_t *filename, const Char_t *dbString); // process output + Bool_t ProcessOutput(const Char_t *filename, AliCDBStorage* db); // process output + Bool_t DoProcessOutput(const Char_t *filename, AliCDBStorage* db); // process output Int_t GetStatus(); // get status void PrintStatus(); // print status @@ -85,7 +86,7 @@ public AliAnalysisTaskSE /* post-processing methods */ Bool_t CheckMatchingPerformance(const TH2F *histoDeltazEta, const TH2F *histoAcceptedTracksEtaPt, const TH2F *histoMatchedTracksEtaPt) const; // check matching efficiency - Bool_t CalibrateAndStore(TH2F *histoVertexTimestamp, TH2F *histoDeltatTimestamp, const Char_t *dbString); // calibrate and store + Bool_t CalibrateAndStore(TH2F *histoVertexTimestamp, TH2F *histoDeltatTimestamp, AliCDBStorage *db); // calibrate and store Int_t FitPeak(TF1 *fitFunc, TH1D *h, Float_t startSigma, Float_t nSigmaMin, Float_t nSigmaMax); // fit peak /* flags and cuts */ diff --git a/TPC/AliTPCPreprocessorOffline.cxx b/TPC/AliTPCPreprocessorOffline.cxx index c486ad5d39a..54a595c20f0 100644 --- a/TPC/AliTPCPreprocessorOffline.cxx +++ b/TPC/AliTPCPreprocessorOffline.cxx @@ -95,11 +95,11 @@ ClassImp(AliTPCPreprocessorOffline) AliTPCPreprocessorOffline::AliTPCPreprocessorOffline(): TNamed("TPCPreprocessorOffline","TPCPreprocessorOffline"), fMinEntries(500), // minimal number of entries for fit - startRun(0), // start Run - used to make fast selection in THnSparse - endRun(0), // end Run - used to make fast selection in THnSparse - startTime(0), // startTime - used to make fast selection in THnSparse - endTime(0), // endTime - used to make fast selection in THnSparse - ocdbStorage(""), // path to the OCDB storage + fStartRun(0), // start Run - used to make fast selection in THnSparse + fEndRun(0), // end Run - used to make fast selection in THnSparse + fStartTime(0), // fStartTime - used to make fast selection in THnSparse + fEndTime(0), // fEndTime - used to make fast selection in THnSparse + fOCDBstorage(0), // OCDB storage fVdriftArray(new TObjArray), fTimeDrift(0), fGraphMIP(0), // graph time dependence of MIP @@ -149,33 +149,33 @@ void AliTPCPreprocessorOffline::GetRunRange(AliTPCcalibTime * const timeDrift){ TH1D* histoTime=addHist->Projection(0); printf("%s\t%f\t%d\t%d\n",histo->GetName(), histo->GetEntries(),histo->FindFirstBinAbove(0),histo->FindLastBinAbove(0)); - if (startRun<=0){ - startRun=histo->FindFirstBinAbove(0); - endRun =histo->FindLastBinAbove(0); + if (fStartRun<=0){ + fStartRun=histo->FindFirstBinAbove(0); + fEndRun =histo->FindLastBinAbove(0); }else{ - startRun=TMath::Min(histo->FindFirstBinAbove(0),startRun); - endRun =TMath::Max(histo->FindLastBinAbove(0),endRun); + fStartRun=TMath::Min(histo->FindFirstBinAbove(0),fStartRun); + fEndRun =TMath::Max(histo->FindLastBinAbove(0),fEndRun); } - if (startTime==0){ - startTime=histoTime->FindFirstBinAbove(0); - endTime =histoTime->FindLastBinAbove(0); + if (fStartTime==0){ + fStartTime=histoTime->FindFirstBinAbove(0); + fEndTime =histoTime->FindLastBinAbove(0); }else{ - startTime=TMath::Min(histoTime->FindFirstBinAbove(0),startTime); - endTime =TMath::Max(histoTime->FindLastBinAbove(0),endTime); + fStartTime=TMath::Min(histoTime->FindFirstBinAbove(0),fStartTime); + fEndTime =TMath::Max(histoTime->FindLastBinAbove(0),fEndTime); } delete histo; delete histoTime; }} - if (startRun<0) startRun=0; - if (endRun<0) endRun=100000000; - printf("Run range :\t%d-%d\n", startRun, endRun); - printf("Time range :\t%d-%d\n", startTime, endTime); + if (fStartRun<0) fStartRun=0; + if (fEndRun<0) fEndRun=100000000; + printf("Run range :\t%d-%d\n", fStartRun, fEndRun); + printf("Time range :\t%d-%d\n", fStartTime, fEndTime); } -void AliTPCPreprocessorOffline::CalibTimeVdrift(const Char_t* file, Int_t ustartRun, Int_t uendRun, TString pocdbStorage){ +void AliTPCPreprocessorOffline::CalibTimeVdrift(const Char_t* file, Int_t ustartRun, Int_t uendRun, AliCDBStorage* pocdbStorage){ // // make calibration of the drift velocity // Input parameters: @@ -183,9 +183,12 @@ void AliTPCPreprocessorOffline::CalibTimeVdrift(const Char_t* file, Int_t ustart // ustartRun, uendrun - run validity period // pocdbStorage - path to hte OCDB storage // - if empty - local storage 'pwd' uesed - if (pocdbStorage.Length()>0) ocdbStorage=pocdbStorage; - else - ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (pocdbStorage) fOCDBstorage=pocdbStorage; + else { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + fOCDBstorage=AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } + // // 1. Initialization and run range setting TFile fcalib(file); @@ -203,15 +206,15 @@ void AliTPCPreprocessorOffline::CalibTimeVdrift(const Char_t* file, Int_t ustart if (fNtracksVdrift==0) fNtracksVdrift=TMath::Nint(fTimeDrift->GetResHistoTPCTOF(0)->GetEntries()); fNeventsVdrift = TMath::Nint(fTimeDrift->GetTPCVertexHisto(0)->GetEntries()); - startRun=ustartRun; - endRun=ustartRun; + fStartRun=ustartRun; + fEndRun=ustartRun; TObjArray *hisArray =fTimeDrift->GetHistoDrift(); GetRunRange(fTimeDrift); for (Int_t i=0; iGetEntriesFast(); i++){ THnSparse* addHist=(THnSparse*)hisArray->At(i); if (!addHist) continue; - if (startTimeGetAxis(0)->SetRange(startTime-1,endTime+1); - if (startRunGetAxis(3)->SetRange(startRun-1,endRun+1); + if (fStartTimeGetAxis(0)->SetRange(fStartTime-1,fEndTime+1); + if (fStartRunGetAxis(3)->SetRange(fStartRun-1,fEndRun+1); } // // @@ -248,10 +251,10 @@ void AliTPCPreprocessorOffline::CalibTimeVdrift(const Char_t* file, Int_t ustart // 5. update of OCDB // // - UpdateOCDBDrift(ustartRun,uendRun,ocdbStorage); + UpdateOCDBDrift(ustartRun,uendRun,fOCDBstorage); } -void AliTPCPreprocessorOffline::UpdateOCDBDrift( Int_t ustartRun, Int_t uendRun, const char* storagePath ){ +void AliTPCPreprocessorOffline::UpdateOCDBDrift( Int_t ustartRun, Int_t uendRun, AliCDBStorage* storage ){ // // Update OCDB // @@ -263,8 +266,7 @@ void AliTPCPreprocessorOffline::UpdateOCDBDrift( Int_t ustartRun, Int_t uendRun, metaData->SetComment("Calibration of the time dependence of the drift velocity"); AliCDBId* id1=NULL; id1=new AliCDBId("TPC/Calib/TimeDrift", ustartRun, uendRun); - AliCDBStorage* gStorage = AliCDBManager::Instance()->GetStorage(storagePath); - gStorage->Put(fVdriftArray, (*id1), metaData); + storage->Put(fVdriftArray, (*id1), metaData); } Bool_t AliTPCPreprocessorOffline::ValidateTimeGain() @@ -348,7 +350,7 @@ Bool_t AliTPCPreprocessorOffline::ValidateTimeDrift() // check whether drift velocity corrections in the range for(Int_t iPoint = 0; iPointGetN(); iPoint++) { - Printf("Y value from the graph: %f",TMath::Abs(gr->GetY()[iPoint])); + //Printf("Y value from the graph: %f",TMath::Abs(gr->GetY()[iPoint])); if(TMath::Abs(gr->GetY()[iPoint]) > maxVDriftCorr) { fCalibrationStatus|=kCalibFailedTimeDrift; @@ -380,8 +382,7 @@ void AliTPCPreprocessorOffline::UpdateDriftParam(AliTPCParam *param, TObjArray * metaData->SetComment("Updated calibration of nominal time 0"); AliCDBId* id1=NULL; id1=new AliCDBId("TPC/Calib/Parameters", lstartRun, AliCDBRunRange::Infinity()); - AliCDBStorage* gStorage = AliCDBManager::Instance()->GetStorage(ocdbStorage); - gStorage->Put(param, (*id1), metaData); + fOCDBstorage->Put(param, (*id1), metaData); } @@ -871,11 +872,14 @@ void AliTPCPreprocessorOffline::MakeDefaultPlots(TObjArray * const arr, TObjArra -void AliTPCPreprocessorOffline::CalibTimeGain(const Char_t* fileName, Int_t startRunNumber, Int_t endRunNumber, TString pocdbStorage){ +void AliTPCPreprocessorOffline::CalibTimeGain(const Char_t* fileName, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* pocdbStorage){ // // Update OCDB gain // - if (pocdbStorage.Length()==0) pocdbStorage+="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (pocdbStorage==0) { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + pocdbStorage = AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } // // 1. Read gain values @@ -906,7 +910,7 @@ void AliTPCPreprocessorOffline::CalibTimeGain(const Char_t* fileName, Int_t star // // 5. Update OCDB // - UpdateOCDBGain( startRunNumber, endRunNumber, pocdbStorage.Data()); + UpdateOCDBGain( startRunNumber, endRunNumber, pocdbStorage); } void AliTPCPreprocessorOffline::ReadGainGlobal(const Char_t* fileName){ @@ -925,8 +929,8 @@ void AliTPCPreprocessorOffline::ReadGainGlobal(const Char_t* fileName){ fGainMult = ( AliTPCcalibGainMult *)fcalib.Get("calibGainMult"); } if (!fGainMult){ - TFile fcalibMult("TPCMultObjects.root"); - fGainMult = ( AliTPCcalibGainMult *)fcalibMult.Get("calibGainMult"); + TFile calibMultFile("TPCMultObjects.root"); + fGainMult = ( AliTPCcalibGainMult *)calibMultFile.Get("calibGainMult"); } TH1 * hisT=0; Int_t firstBinA =0, lastBinA=0; @@ -1197,6 +1201,7 @@ Bool_t AliTPCPreprocessorOffline::AnalyzeGainChamberByChamber(){ // // get chamber by chamber gain // + if (!fGainMult) return kFALSE; TGraphErrors *grShort = fGainMult->GetGainPerChamber(0); TGraphErrors *grMedium = fGainMult->GetGainPerChamber(1); TGraphErrors *grLong = fGainMult->GetGainPerChamber(2); @@ -1214,7 +1219,7 @@ Bool_t AliTPCPreprocessorOffline::AnalyzeGainChamberByChamber(){ return kTRUE; } -void AliTPCPreprocessorOffline::UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){ +void AliTPCPreprocessorOffline::UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage *storage){ // // Update OCDB entry // @@ -1225,8 +1230,7 @@ void AliTPCPreprocessorOffline::UpdateOCDBGain(Int_t startRunNumber, Int_t endRu metaData->SetAliRootVersion("05-24-00"); //root version metaData->SetComment("Calibration of the time dependence of the gain due to pressure and temperature changes."); AliCDBId id1("TPC/Calib/TimeGain", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); - gStorage->Put(fGainArray, id1, metaData); + storage->Put(fGainArray, id1, metaData); } void AliTPCPreprocessorOffline::MakeQAPlot(Float_t FPtoMIPratio) { diff --git a/TPC/AliTPCPreprocessorOffline.h b/TPC/AliTPCPreprocessorOffline.h index bf1285dbd7a..3766d3ac9ea 100644 --- a/TPC/AliTPCPreprocessorOffline.h +++ b/TPC/AliTPCPreprocessorOffline.h @@ -19,20 +19,21 @@ class AliTPCROC; class AliTPCParam; class TPad; class AliCDBRunRange; +class AliCDBStorage; class AliTPCPreprocessorOffline:public TNamed { public: AliTPCPreprocessorOffline(); virtual ~AliTPCPreprocessorOffline(); - void UpdateOCDBDrift(Int_t ustartRun, Int_t uendRun, const char* storagePath); - void UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); - void UpdateDriftParam(AliTPCParam *param, TObjArray *const arr, Int_t startRun); + void UpdateOCDBDrift(Int_t ustartRun, Int_t uendRun, AliCDBStorage* storage); + void UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); + void UpdateDriftParam(AliTPCParam *param, TObjArray *const arr, Int_t lstartRun); // // v drift part // void GetRunRange(AliTPCcalibTime* const timeDrift); - void CalibTimeVdrift(const Char_t* file, Int_t ustartRun, Int_t uendRun,TString ocdbStorage=""); + void CalibTimeVdrift(const Char_t* file, Int_t ustartRun, Int_t uendRun,AliCDBStorage* ocdbStorage=0x0); void AddHistoGraphs( TObjArray * vdriftArray, AliTPCcalibTime * const timeDrift, Int_t minEntries); void AddAlignmentGraphs( TObjArray * vdriftArray, AliTPCcalibTime * const timeDrift); void AddLaserGraphs( TObjArray * vdriftArray, AliTPCcalibTime *timeDrift); @@ -43,7 +44,7 @@ public: // // Gain part // - void CalibTimeGain(const Char_t* fileName, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage); + void CalibTimeGain(const Char_t* fileName, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage); void ReadGainGlobal(const Char_t* fileName="CalibObjectsTrain1.root"); void MakeQAPlot(Float_t FPtoMIPratio); Bool_t AnalyzeGain(Int_t startRunNumber, Int_t endRunNumber, Int_t minEntriesGaussFit = 500, Float_t FPtoMIPratio = 1.43); @@ -97,11 +98,11 @@ public: private: Int_t fMinEntries; // minimal number of entries for fit - Int_t startRun; // start Run - used to make fast selection in THnSparse - Int_t endRun; // end Run - used to make fast selection in THnSparse - Int_t startTime; // startTime - used to make fast selection in THnSparse - Int_t endTime; // endTime - used to make fast selection in THnSparse - TString ocdbStorage; // path to the OCDB storage + Int_t fStartRun; // start Run - used to make fast selection in THnSparse + Int_t fEndRun; // end Run - used to make fast selection in THnSparse + Int_t fStartTime; // fStartTime - used to make fast selection in THnSparse + Int_t fEndTime; // fEndTime - used to make fast selection in THnSparse + AliCDBStorage* fOCDBstorage; // OCDB storage TObjArray * fVdriftArray; // array with output calibration graphs AliTPCcalibTime * fTimeDrift; // input data to construct calibration graphs TGraphErrors * fGraphMIP; // graph time dependence of MIP diff --git a/TRD/AliTRDPreprocessorOffline.cxx b/TRD/AliTRDPreprocessorOffline.cxx index d54a94b3f52..df81d3b8f1e 100644 --- a/TRD/AliTRDPreprocessorOffline.cxx +++ b/TRD/AliTRDPreprocessorOffline.cxx @@ -166,7 +166,7 @@ AliTRDPreprocessorOffline::~AliTRDPreprocessorOffline() { } //___________________________________________________________________________________ -void AliTRDPreprocessorOffline::Process(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage) +void AliTRDPreprocessorOffline::Process(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage) { // // Process to the gain, vdrift, timeoffset, exb and chamber status calibration @@ -195,15 +195,18 @@ void AliTRDPreprocessorOffline::Process(const Char_t* file, Int_t startRunNumber } //___________________________________________________________________________________________________________________ -void AliTRDPreprocessorOffline::CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){ +void AliTRDPreprocessorOffline::CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage){ // // make calibration of the drift velocity // Input parameters: // file - the location of input file // startRunNumber, endRunNumber - run validity period - // ocdbStorage - path to the OCDB storage + // ocdbStorage - OCDB storage // - if empty - local storage 'pwd' uesed - if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (ocdbStorage==0x0) { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + ocdbStorage=AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } // // 1. Initialization // @@ -247,15 +250,18 @@ void AliTRDPreprocessorOffline::CalibVdriftT0(const Char_t* file, Int_t startRun } //___________________________________________________________________________________________________________________ -void AliTRDPreprocessorOffline::CalibExbAlt(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){ +void AliTRDPreprocessorOffline::CalibExbAlt(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage){ // // make calibration of the drift velocity // Input parameters: // file - the location of input file // startRunNumber, endRunNumber - run validity period - // ocdbStorage - path to the OCDB storage + // ocdbStorage - OCDB storage // - if empty - local storage 'pwd' uesed - if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (ocdbStorage==0x0) { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + ocdbStorage=AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } // // 1. Initialization // @@ -282,15 +288,18 @@ void AliTRDPreprocessorOffline::CalibExbAlt(const Char_t* file, Int_t startRunNu //_________________________________________________________________________________________________________________ -void AliTRDPreprocessorOffline::CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){ +void AliTRDPreprocessorOffline::CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage){ // // make calibration of the drift velocity // Input parameters: // file - the location of input file // startRunNumber, endRunNumber - run validity period - // ocdbStorage - path to the OCDB storage + // ocdbStorage - OCDB storage // - if empty - local storage 'pwd' uesed - if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (ocdbStorage==0x0) { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + ocdbStorage=AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } // fNotEnoughStatisticsForTheGain = kFALSE; // @@ -325,15 +334,18 @@ void AliTRDPreprocessorOffline::CalibGain(const Char_t* file, Int_t startRunNumb } //________________________________________________________________________________________________________________ -void AliTRDPreprocessorOffline::CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){ +void AliTRDPreprocessorOffline::CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage){ // // make calibration of the drift velocity // Input parameters: // file - the location of input file // startRunNumber, endRunNumber - run validity period - // ocdbStorage - path to the OCDB storage + // ocdbStorage - OCDB storage // - if empty - local storage 'pwd' uesed - if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (ocdbStorage==0x0) { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + ocdbStorage=AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } // // 1. Initialization if(!ReadPRFGlobal(file)) return; @@ -363,17 +375,20 @@ void AliTRDPreprocessorOffline::CalibPRF(const Char_t* file, Int_t startRunNumbe } //________________________________________________________________________________________________________________ -void AliTRDPreprocessorOffline::CalibPHQ(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage) +void AliTRDPreprocessorOffline::CalibPHQ(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage) { // // make calibration of puls height Q // Input parameters: // startRunNumber, endRunNumber - run validity period - // ocdbStorage - path to the OCDB storage + // ocdbStorage - OCDB storage // - if empty - local storage 'pwd' uesed // - if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (ocdbStorage==0x0) { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + ocdbStorage=AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } //printf("test %s\n", ocdbStorage.Data()); if(!ReadPHQGlobal(file)) return; @@ -385,14 +400,17 @@ void AliTRDPreprocessorOffline::CalibPHQ(const Char_t* file, Int_t startRunNumbe //________________________________________________________________________________________________________________ -void AliTRDPreprocessorOffline::CalibChamberStatus(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage){ +void AliTRDPreprocessorOffline::CalibChamberStatus(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage){ // // make calibration of the chamber status // Input parameters: // startRunNumber, endRunNumber - run validity period - // ocdbStorage - path to the OCDB storage + // ocdbStorage - OCDB storage // - if empty - local storage 'pwd' uesed - if (ocdbStorage.Length()<=0) ocdbStorage="local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + if (ocdbStorage==0x0) { + TString localStorage = "local://"+gSystem->GetFromPipe("pwd")+"/OCDB"; + ocdbStorage=AliCDBManager::Instance()->GetStorage(localStorage.Data()); + } // // // 1. Initialization @@ -1227,7 +1245,7 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() } //_________________________________________________________________________________________________________________ - void AliTRDPreprocessorOffline::UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){ + void AliTRDPreprocessorOffline::UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage *storage){ // // Update OCDB entry // @@ -1239,14 +1257,13 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() metaData->SetBeamPeriod(1); AliCDBId id1("TRD/Calib/ChamberGainFactor", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kGain); - if(calDet) gStorage->Put(calDet, id1, metaData); + if(calDet) storage->Put(calDet, id1, metaData); } //___________________________________________________________________________________________________________________ - void AliTRDPreprocessorOffline::UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){ + void AliTRDPreprocessorOffline::UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage *storage){ // // Update OCDB entry // @@ -1263,14 +1280,13 @@ Bool_t AliTRDPreprocessorOffline::AnalyzeChamberStatus() metaData->SetBeamPeriod(1); AliCDBId id1("TRD/Calib/ChamberExB", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(detExB); - if(calDet) gStorage->Put(calDet, id1, metaData); + if(calDet) storage->Put(calDet, id1, metaData); //if(!calDet) printf("No caldet\n"); } //___________________________________________________________________________________________________________________ -void AliTRDPreprocessorOffline::UpdateOCDBExBAlt(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){ +void AliTRDPreprocessorOffline::UpdateOCDBExBAlt(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage *storage){ // // Update OCDB entry // @@ -1287,14 +1303,13 @@ void AliTRDPreprocessorOffline::UpdateOCDBExBAlt(Int_t startRunNumber, Int_t end metaData->SetBeamPeriod(1); AliCDBId id1("TRD/Calib/ChamberExBAlt", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(detExB); - if(calDet) gStorage->Put(calDet, id1, metaData); + if(calDet) storage->Put(calDet, id1, metaData); //if(!calDet) printf("No caldet\n"); } //___________________________________________________________________________________________________________________ - void AliTRDPreprocessorOffline::UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){ + void AliTRDPreprocessorOffline::UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage){ // // Update OCDB entry // @@ -1310,9 +1325,8 @@ void AliTRDPreprocessorOffline::UpdateOCDBExBAlt(Int_t startRunNumber, Int_t end metaData->SetBeamPeriod(1); AliCDBId id1("TRD/Calib/ChamberVdrift", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(detVdrift); - if(calDet) gStorage->Put(calDet, id1, metaData); + if(calDet) storage->Put(calDet, id1, metaData); // @@ -1326,13 +1340,13 @@ void AliTRDPreprocessorOffline::UpdateOCDBExBAlt(Int_t startRunNumber, Int_t end AliCDBId id1Pad("TRD/Calib/LocalVdrift", startRunNumber, endRunNumber); AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kVdriftPHPad); - if(calPad) gStorage->Put(calPad, id1Pad, metaDataPad); + if(calPad) storage->Put(calPad, id1Pad, metaDataPad); } } //________________________________________________________________________________________________________________________ - void AliTRDPreprocessorOffline::UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){ + void AliTRDPreprocessorOffline::UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage){ // // Update OCDB entry // @@ -1344,9 +1358,8 @@ void AliTRDPreprocessorOffline::UpdateOCDBExBAlt(Int_t startRunNumber, Int_t end metaData->SetBeamPeriod(1); AliCDBId id1("TRD/Calib/ChamberT0", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); AliTRDCalDet *calDet = (AliTRDCalDet *) fCalibObjects->At(kT0PHDet); - if(calDet) gStorage->Put(calDet, id1, metaData); + if(calDet) storage->Put(calDet, id1, metaData); // @@ -1358,13 +1371,13 @@ void AliTRDPreprocessorOffline::UpdateOCDBExBAlt(Int_t startRunNumber, Int_t end AliCDBId id1Pad("TRD/Calib/LocalT0", startRunNumber, endRunNumber); AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kT0PHPad); - if(calPad) gStorage->Put(calPad, id1Pad, metaDataPad); + if(calPad) storage->Put(calPad, id1Pad, metaDataPad); } //_________________________________________________________________________________________________________________ - void AliTRDPreprocessorOffline::UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){ + void AliTRDPreprocessorOffline::UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage){ // // Update OCDB entry // @@ -1377,14 +1390,13 @@ void AliTRDPreprocessorOffline::UpdateOCDBExBAlt(Int_t startRunNumber, Int_t end AliCDBId id1("TRD/Calib/PRFWidth", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); AliTRDCalPad *calPad = (AliTRDCalPad *) fCalibObjects->At(kPRF); - if(calPad) gStorage->Put(calPad, id1, metaData); + if(calPad) storage->Put(calPad, id1, metaData); } //_________________________________________________________________________________________________________________ -void AliTRDPreprocessorOffline::UpdateOCDBPHQ(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath) +void AliTRDPreprocessorOffline::UpdateOCDBPHQ(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage) { // // Update OCDB entry @@ -1396,16 +1408,15 @@ void AliTRDPreprocessorOffline::UpdateOCDBPHQ(Int_t startRunNumber, Int_t endRun metaData->SetBeamPeriod(1); AliCDBId id1("TRD/Calib/PHQ", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); TObjArray *cobj = (TObjArray *) fCalibObjects->At(kPHQ); if(cobj){ //cobj->Print(); - gStorage->Put(cobj, id1, metaData); + storage->Put(cobj, id1, metaData); } } //_________________________________________________________________________________________________________________ - void AliTRDPreprocessorOffline::UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath){ + void AliTRDPreprocessorOffline::UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage){ // // Update OCDB entry // @@ -1417,9 +1428,8 @@ void AliTRDPreprocessorOffline::UpdateOCDBPHQ(Int_t startRunNumber, Int_t endRun metaData->SetBeamPeriod(1); AliCDBId id1("TRD/Calib/ChamberStatus", startRunNumber, endRunNumber); - AliCDBStorage * gStorage = AliCDBManager::Instance()->GetStorage(storagePath); AliTRDCalChamberStatus *calChamberStatus = (AliTRDCalChamberStatus *) fCalibObjects->At(kChamberStatus); - if(calChamberStatus) gStorage->Put(calChamberStatus, id1, metaData); + if(calChamberStatus) storage->Put(calChamberStatus, id1, metaData); } diff --git a/TRD/AliTRDPreprocessorOffline.h b/TRD/AliTRDPreprocessorOffline.h index c540afbb514..ec094658db8 100644 --- a/TRD/AliTRDPreprocessorOffline.h +++ b/TRD/AliTRDPreprocessorOffline.h @@ -22,6 +22,7 @@ class AliTRDCalibraExbAltFit; class TH1I; class TH2F; class TString; +class AliCDBStorage; class AliTRDPreprocessorOffline:public TNamed { public: @@ -57,7 +58,7 @@ public: virtual ~AliTRDPreprocessorOffline(); Bool_t Init(const Char_t* fileName); - void Process(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage); + void Process(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage); // settings void SetLinearFitForVdrift(Bool_t methodsecond) { fMethodSecond = methodsecond;}; @@ -147,12 +148,12 @@ public: // Internal functions - void CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); - void CalibExbAlt(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); - void CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); - void CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); - void CalibChamberStatus(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage=""); - void CalibPHQ(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, TString ocdbStorage); + void CalibVdriftT0(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage=0x0); + void CalibExbAlt(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage=0x0); + void CalibGain(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage=0x0); + void CalibPRF(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage=0x0); + void CalibChamberStatus(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage=0x0); + void CalibPHQ(const Char_t* file, Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* ocdbStorage); Bool_t ReadStatusGlobal(const Char_t* fileName="CalibObjects.root"); Bool_t ReadGainGlobal(const Char_t* fileName="CalibObjects.root"); @@ -173,14 +174,14 @@ public: void CorrectFromDetGainUsed(); void CorrectFromDetVdriftUsed(); - void UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); - void UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); - void UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath); - void UpdateOCDBExBAlt(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath); - void UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); - void UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, const char* storagePath); - void UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath); - void UpdateOCDBPHQ(Int_t startRunNumber, Int_t endRunNumber, const Char_t *storagePath); + void UpdateOCDBT0(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); + void UpdateOCDBVdrift(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); + void UpdateOCDBExB(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); + void UpdateOCDBExBAlt(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); + void UpdateOCDBGain(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); + void UpdateOCDBPRF(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); + void UpdateOCDBChamberStatus(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); + void UpdateOCDBPHQ(Int_t startRunNumber, Int_t endRunNumber, AliCDBStorage* storage); Bool_t ValidateGain(); Bool_t ValidateVdrift(); -- 2.39.3