X-Git-Url: http://git.uio.no/git/?a=blobdiff_plain;f=ITS%2FAliITSPreprocessorSPD.cxx;h=27c320f952c3bb41ae56ef996060530c4f9ddf9a;hb=130be8e8fe92500ed2f6bed16a1bcf3ee1de1f37;hp=4529a2ccb6efde0f7d7a448657536a3cde1b1dbb;hpb=7817da2294b4fba25b2425a60156488738ef01b2;p=u%2Fmrichter%2FAliRoot.git diff --git a/ITS/AliITSPreprocessorSPD.cxx b/ITS/AliITSPreprocessorSPD.cxx index 4529a2ccb6e..27c320f952c 100644 --- a/ITS/AliITSPreprocessorSPD.cxx +++ b/ITS/AliITSPreprocessorSPD.cxx @@ -18,6 +18,7 @@ /* $Id$ */ +using std::ifstream; ClassImp(AliITSPreprocessorSPD) //______________________________________________________________________________________________ @@ -67,9 +68,7 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/) fIdList.Clear(); - UInt_t nrEqForScan = 0; - // UInt_t nrEqForPhysN = 0; - // UInt_t nrEqForPhysD = 0; + // ******************************************************************************************** // // *** GET THE FILE IDs FOR DEBUGGING *** // @@ -122,106 +121,38 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/) // ******************************************************************************************** // // *** REFERENCE DATA *** // - // Standalone runs: + // SCAN runs: if (runType == "DAQ_MIN_TH_SCAN" || runType == "DAQ_MEAN_TH_SCAN" || runType == "DAQ_GEN_DAC_SCAN" || runType == "DAQ_UNIFORMITY_SCAN" || runType == "DAQ_NOISY_PIX_SCAN" || - runType == "DAQ_PIX_DELAY_SCAN" || - runType == "DAQ_FO_UNIF_SCAN") { - // Store the scan container files as reference data (0 or 1 file for each equipment) - for (UInt_t eq=0; eq<20; eq++) { - TString id = Form("SPD_ref_scan_%d",eq); - TList* list = GetFileSources(kDAQ,id.Data()); // (the id should be unique, so always 1 file) - if (list) { - TObjString* fileNameEntry = (TObjString*) list->First(); - if (fileNameEntry!=NULL) { - nrEqForScan++; - TString fileName = GetFile(kDAQ, id, fileNameEntry->GetString().Data()); - if (fileName.IsNull()) { - Log(Form("GetFile failed to retrieve file %s.",fileNameEntry->GetString().Data())); - return 1; - } - if (!RemoveIdFromList(id.Data())) { - Log(Form("Warning: Retrieved file with id %s, that was not in the id list!",id.Data())); - } - TString refCAT = Form("SPD_ref_scan_eq_%d",eq); - if (!StoreReferenceFile(fileName.Data(),refCAT.Data())) { - Log(Form("Failed to store reference file %s.",fileName.Data())); - return 1; - } - } - } - } + runType == "DAQ_PIX_DELAY_SCAN") { + // Store scan container files for all equipments used - as reference data + // ids from FXS follow ("SPD_ref_scan_%d",eq), while Alien follow ("SPD_ref_scan_eq_%d",eq) + // the first part of the id is passed as argument here: + if (!StoreRefForIdStartingWith("SPD_ref_scan")) return 1; + } + + // FO runs: + else if (runType == "DAQ_FO_UNIF_SCAN") { + // Store fo container files for all equipments used - as reference data + // ids from FXS follow ("SPD_ref_fo_%d",eq), while Alien follow ("SPD_ref_fo_eq_%d",eq) + // the first part of the id is passed as argument here: + if (!StoreRefForIdStartingWith("SPD_ref_fo")) return 1; } // Physics runs (online monitoring): - if (runType == "PHYSICS") { - // Store the phys "per run" container files as reference data + else if (runType == "PHYSICS") { + // Store the phys "per run" container files - as reference data if (!StoreRefFromTarForId("SPD_ref_phys")) return 1; - // Store the phys "dead" container files as reference data + // Store the phys "dead" container files - as reference data if (!StoreRefFromTarForId("SPD_ref_phys_dead")) return 1; } -// *** OLD CODE NOT TARED -// for (UInt_t eq=0; eq<20; eq++) { -// TString id = Form("SPD_ref_phys_%d",eq); -// TList* list = GetFileSources(kDAQ,id.Data()); // (the id should be unique, so always 1 file) -// if (list) { -// TObjString* fileNameEntry = (TObjString*) list->First(); -// if (fileNameEntry!=NULL) { -// nrEqForPhysN++; -// TString fileName = GetFile(kDAQ, id, fileNameEntry->GetString().Data()); -// if (fileName.IsNull()) { -// Log(Form("GetFile failed to retrieve file %s.",fileNameEntry->GetString().Data())); -// return 1; -// } -// if (!RemoveIdFromList(id.Data())) { -// Log(Form("Warning: Retrieved file with id %s, that was not in the id list!",id.Data())); -// } -// TString refCAT = Form("SPD_ref_phys_eq_%d",eq); -// if (!StoreReferenceFile(fileName.Data(),refCAT.Data())) { -// Log(Form("Failed to store reference file %s.",fileName.Data())); -// return 1; -// } -// } -// } -// } -// *** - -// *** OLD CODE NOT TARED -// // Store the phys "dead" container files as reference data (0 or 1 file for each equipment) -// for (UInt_t eq=0; eq<20; eq++) { -// TString id = Form("SPD_ref_phys_dead_%d",eq); -// TList* list = GetFileSources(kDAQ,id.Data()); // (the id should be unique, so always 1 file) -// if (list) { -// TObjString* fileNameEntry = (TObjString*) list->First(); -// if (fileNameEntry!=NULL) { -// nrEqForPhysD++; -// TString fileName = GetFile(kDAQ, id, fileNameEntry->GetString().Data()); -// if (fileName.IsNull()) { -// Log(Form("GetFile failed to retrieve file %s.",fileNameEntry->GetString().Data())); -// return 1; -// } -// if (!RemoveIdFromList(id.Data())) { -// Log(Form("Warning: Retrieved file with id %s, that was not in the id list!",id.Data())); -// } -// TString refCAT = Form("SPD_ref_phys_dead_eq_%d",eq); -// if (!StoreReferenceFile(fileName.Data(),refCAT.Data())) { -// Log(Form("Failed to store reference file %s.",fileName.Data())); -// return 1; -// } -// } -// } -// } -// } -// *** // ******************************************************************************************** // - - // *** NOISY AND DEAD DATA *** // // Standalone runs: @@ -259,7 +190,7 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/) handler->SetFileLocation(fileLoc.Data()); handler->ReadNoisyFromFiles(); for (Int_t module=0; module<240; module++) { - ((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetNrBadSingle( handler->GetNrNoisy(module) ); + ((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetNrBadSingle( handler->GetNrNoisySingle(module) ); ((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetBadList( handler->GetNoisyArray(module) ); } delete handler; @@ -323,7 +254,7 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/) // If new noisy pixels were found: Update calibration objects if (nrNewNoisy>0) { for (Int_t module=0; module<240; module++) { - ((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetNrBadSingle( handOld->GetNrNoisy(module) ); + ((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetNrBadSingle( handOld->GetNrNoisySingle(module) ); ((AliITSCalibrationSPD*) spdEntryNoisy->At(module)) -> SetBadList( handOld->GetNoisyArray(module) ); } // Store the new calibration objects in OCDB @@ -380,7 +311,7 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/) handOld->ReadSilentFromFiles(); for (UInt_t module=0; module<240; module++) { AliITSCalibrationSPD* calibSPD = (AliITSCalibrationSPD*) spdEntryDead->At(module); - calibSPD->SetNrBadSingle( handOld->GetNrDead(module) ); + calibSPD->SetNrBadSingle( handOld->GetNrDeadSingle(module) ); calibSPD->SetBadList( handOld->GetDeadArray(module) ); for (UInt_t chipIndex=0; chipIndex<5; chipIndex++) { UInt_t eq,hs,chip,col,row; @@ -411,6 +342,8 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/) } + + // ******************************************************************************************** // // check that there are no ids left in the list: if (fIdList.First()!=NULL) { TString logMessage = ""; @@ -423,9 +356,9 @@ UInt_t AliITSPreprocessorSPD::Process(TMap* /*dcsAliasMap*/) Log(Form("Files with the following ids were never retrieved: %s.",logMessage.Data())); return 1; } - fIdList.Clear(); + return 0; // 0 means success } @@ -445,6 +378,34 @@ Bool_t AliITSPreprocessorSPD::RemoveIdFromList(const Char_t *id) { return found; } //_________________________________________________________________________________________ +Bool_t AliITSPreprocessorSPD::StoreRefForIdStartingWith(const Char_t *idStart) { + // Store the standalone container files as reference data (0 or 1 file for each equipment) + // idStart is the first part of the id string (which also should contain the actual eq) + for (UInt_t eq=0; eq<20; eq++) { + TString id = Form("%s_%d",idStart,eq); + TList* list = GetFileSources(kDAQ,id.Data()); // (the id should be unique, so always 1 file) + if (list) { + TObjString* fileNameEntry = (TObjString*) list->First(); + if (fileNameEntry!=NULL) { + TString fileName = GetFile(kDAQ, id, fileNameEntry->GetString().Data()); + if (fileName.IsNull()) { + Log(Form("GetFile failed to retrieve file %s.",fileNameEntry->GetString().Data())); + return kFALSE; + } + if (!RemoveIdFromList(id.Data())) { + Log(Form("Warning: Retrieved file with id %s, that was not in the id list!",id.Data())); + } + TString refCAT = Form("%s_eq_%d",idStart,eq); + if (!StoreReferenceFile(fileName.Data(),refCAT.Data())) { + Log(Form("Failed to store reference file %s.",fileName.Data())); + return kFALSE; + } + } + } + } + return kTRUE; +} +//_________________________________________________________________________________________ Bool_t AliITSPreprocessorSPD::StoreRefFromTarForId(const Char_t *id) { // store reference files from tar file for the id given (this is just to not duplicate code) TList* list = GetFileSources(kDAQ,id);