From b7c14c1cf1377e6dcf10ce25ed6e03771a381ce2 Mon Sep 17 00:00:00 2001 From: dibari Date: Wed, 16 Apr 2008 09:37:17 +0000 Subject: [PATCH] New schema for pedestal files to be processed. --- HMPID/AliHMPIDPreprocessor.cxx | 43 +++++++++++++++++----------------- HMPID/HMPIDda.cxx | 4 ++-- HMPID/Hshuttle.C | 33 ++++++++++++++++---------- 3 files changed, 45 insertions(+), 35 deletions(-) diff --git a/HMPID/AliHMPIDPreprocessor.cxx b/HMPID/AliHMPIDPreprocessor.cxx index f3f20302ab6..f5a69c0d6d6 100644 --- a/HMPID/AliHMPIDPreprocessor.cxx +++ b/HMPID/AliHMPIDPreprocessor.cxx @@ -142,7 +142,7 @@ Bool_t AliHMPIDPreprocessor::ProcDcs(TMap* pMap) AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("AliHMPIDPreprocessor"); - metaData.SetComment("SIMULATED"); + metaData.SetComment("HMPID preprocessor fills TObjArrays."); stDcsStore = Store("Calib","Qthre",&arQthre,&metaData) && // from DCS Store("Calib","Nmean",&arNmean,&metaData); // from DCS @@ -162,27 +162,24 @@ Bool_t AliHMPIDPreprocessor::ProcPed() TObjArray aDaqSig(7); aDaqSig.SetOwner(kTRUE); for(Int_t i=0;i<7;i++) aDaqSig.AddAt(new TMatrix(160,144),i); //TObjArray of 7 TMatrixF, m(padx,pady)=sigma - TList *pLdc=GetFileSources(kDAQ,"pedestals"); //get list of LDC names containing id "pedestals" - - if(!pLdc) { - Log("ERROR: Retrieval of sources for pedestals failed!"); + //TList *pLdc=GetFileSources(kDAQ,"pedestals"); //get list of LDC names containing id "pedestals" + + for(Int_t iddl=0;iddlLDC connection + { + TList *pLdc=GetFileSources(kDAQ,Form("HmpidPedDdl%02i.txt",iddl)); //get list of LDC names containing id "pedestals" + if(!pLdc) { + Log(Form("ERROR: Retrieval of sources for pedestals: HmpidPedDdl%02i.txt failed!",iddl)); return kFALSE;} - Log(Form("HMPID - Pedestal files to be read --> %i LDCs for HMPID",pLdc->GetEntries())); - - for(Int_t i=0;iGetEntries();i++) {//lists of LDCs - - //gSystem->Exec(Form("tar xf %s",GetFile(kDAQ,"pedestals",((TObjString*)pLdc->At(i))->GetName()))); //untar pedestal files from current LDC - - TString fileName = GetFile(kDAQ,"pedestals", ((TObjString*)pLdc->At(i))->GetName()); - + for(Int_t i=0;iGetEntries();i++) {//lists of LDCs -- but in general we have 1 LDC for 1 ped file + TString fileName = GetFile(kDAQ,Form("HmpidPedDdl%02i.txt",iddl),((TObjString*)pLdc->At(i))->GetName()); + if(fileName.Length()==0) { - Log("ERROR retrieving pedestal file!"); + Log(Form("ERROR retrieving pedestal file: HmpidPedDdl%02i.txt!",iddl)); return kFALSE; } - gSystem->Exec(Form("tar xf %s",fileName.Data())); - - } + }//LDCs + }//DDL AliHMPIDDigit dig; AliHMPIDRawStream rs; @@ -194,6 +191,7 @@ Bool_t AliHMPIDPreprocessor::ProcPed() ifstream infile(Form("HmpidPedDdl%02i.txt",ddl)); if(!infile.is_open()) {Log("No pedestal file found for HMPID,bye!");return kFALSE;} TMatrix *pM=(TMatrixF*)aDaqSig.At(ddl/2); + infile>>tName>>runNumber; infile>>tName>>ldcId; infile>>tName>>timeStamp; @@ -201,20 +199,20 @@ Bool_t AliHMPIDPreprocessor::ProcPed() infile>>tName>>nDdlEv; infile>>tName>>nBadEv; infile>>tName>>nBadEvPer; - infile>>nSigCut; pM->SetUniqueID(nSigCut); //n. of pedestal distribution sigmas used to create zero suppresion table + infile>>tName>>nSigCut; pM->SetUniqueID(nSigCut); //n. of pedestal distribution sigmas used to create zero suppresion table while(!infile.eof()){ - infile>>dec>>r>>d>>a>>mean>>sigma>>hex>>hard; + infile>>dec>>r>>d>>a>>mean>>sigma>>hex>>hard; AliHMPIDDigit dig(rs.GetPad(ddl,r,d,a),(Int_t)mean); (*pM)(dig.PadChX(),dig.PadChY()) = sigma; } infile.close(); Log(Form("Pedestal file for DDL %i read successfully",ddl)); - } + }//ddl AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("AliHMPIDPreprocessor"); - metaData.SetComment("SIMULATED"); + metaData.SetComment("HMPID processor fills TObjArrays."); stPedStore = Store("Calib","DaqSig",&aDaqSig,&metaData,0,kTRUE); @@ -233,3 +231,6 @@ Double_t ProcTrans() } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + + + diff --git a/HMPID/HMPIDda.cxx b/HMPID/HMPIDda.cxx index 201a30589b1..beffd736d18 100644 --- a/HMPID/HMPIDda.cxx +++ b/HMPID/HMPIDda.cxx @@ -211,9 +211,9 @@ int main(int argc, char **argv){ /* store the result file on FES */ - status=daqDA_FES_storeFile(Form("%sHmpidPedDdl%02i.txt",sDaOut.Data(),nDDL),Form("HMPID_DA_Pedestals_ddl=%02i",nDDL)); + status=daqDA_FES_storeFile(Form("%sHmpidPedDdl%02i.txt",sDaOut.Data(),nDDL),Form("HmpidPedDdl%02i.txt",nDDL)); if (status) { printf("Failed to export file : %d\n",status); } - status=daqDA_FES_storeFile(Form("%sHmpidErrorsDdl%02i.txt",sDaOut.Data(),nDDL),Form("HMPID_DA_Errors_ddl=%02i",nDDL)); + status=daqDA_FES_storeFile(Form("%sHmpidErrorsDdl%02i.txt",sDaOut.Data(),nDDL),Form("HmpidErrorsDdl%02i.txt",nDDL)); if (status) { printf("Failed to export file : %d\n",status); } }//nDDL diff --git a/HMPID/Hshuttle.C b/HMPID/Hshuttle.C index 5970e92df86..0398c19dd0f 100644 --- a/HMPID/Hshuttle.C +++ b/HMPID/Hshuttle.C @@ -1,4 +1,4 @@ - void Hshuttle(Int_t runTime=1500) +void Hshuttle(Int_t runTime=1500) {// this macro is to simulate the functionality of SHUTTLE. gSystem->Load("$ALICE_ROOT/SHUTTLE/TestShuttle/libTestShuttle.so"); // AliTestShuttle::SetMainCDB(TString("local://$HOME/CDB")); @@ -7,41 +7,50 @@ TMap *pDcsMap = new TMap; pDcsMap->SetOwner(1); //DCS archive map AliTestShuttle* pShuttle = new AliTestShuttle(0,0,1000000); - pShuttle->SetInputRunType("PHYSICS"); -// pShuttle->SetInputRunType("PEDESTAL_RUN"); - SimPed(); for(Int_t ldc=1;ldc<=2;ldc++) pShuttle->AddInputFile(AliTestShuttle::kDAQ,"HMP","pedestals",Form("LDC%i",ldc),Form("HmpidPeds%i.tar",ldc)); + // pShuttle->SetInputRunType("PHYSICS"); + pShuttle->SetInputRunType("CALIBRATION"); + SimPed(); + for(Int_t ldc=51;ldc<=52;ldc++) + { + if(ldc==51) {for(Int_t iddl=0;iddl<=7;iddl++) pShuttle->AddInputFile(AliTestShuttle::kDAQ,"HMP",Form("HmpidPedDdl%02i.txt",iddl),Form("LDC%i",ldc),Form("HmpidPedDdl%02i.txt",iddl));} + if(ldc==52) {for(Int_t iddl=8;iddl<=13;iddl++) pShuttle->AddInputFile(AliTestShuttle::kDAQ,"HMP",Form("HmpidPedDdl%02i.txt",iddl),Form("LDC%i",ldc),Form("HmpidPedDdl%02i.txt",iddl));} + } SimMap(pDcsMap,runTime); pShuttle->SetDCSInput(pDcsMap); //DCS map AliPreprocessor* pp = new AliHMPIDPreprocessor(pShuttle); pShuttle->Process(); delete pp; //here goes preprocessor DrawInput(pDcsMap); DrawOutput(); gSystem->Exec("rm -rf HmpidPedDdl*.txt"); - gSystem->Exec("rm -rf HmpidPeds*.tar"); + }//Hshuttle() //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void SimPed() { Int_t iDDLmin=0,iDDLmax=13; - Int_t nSigmas = 3; // value stored in the ddl files of pedestals + Int_t nSigmas = 3; // value stored in the ddl files of pedestals ofstream out; for(Int_t ddl=iDDLmin;ddl<=iDDLmax;ddl++){ out.open(Form("HmpidPedDdl%02i.txt",ddl)); - out << nSigmas <Rndm(); Float_t sigma = 1+0.3*gRandom->Gaus(); - Int_t inhard=((Int_t(mean))<<9)+Int_t(mean+nSigmas*sigma); - out << Form("%2i %2i %2i %5.2f %5.2f %x\n",row,dil,adr,mean,sigma,inhard); + Int_t inhard=((Int_t(mean+nSigmas*sigma))<<9)+Int_t(mean); //right calculation, xchecked with Paolo 8/4/2008 + out << Form("%2i %2i %2i %5.3f %5.3f %4.4x \n",row,dil,adr,mean,sigma,inhard); } out.close(); } Printf("HMPID - All %i DDL pedestal files created successfully",iDDLmax-iDDLmin+1); - gSystem->Exec("tar cf HmpidPeds1.tar HmpidPedDdl00.txt HmpidPedDdl01.txt HmpidPedDdl02.txt HmpidPedDdl03.txt HmpidPedDdl04.txt HmpidPedDdl05.txt HmpidPedDdl06.txt"); - gSystem->Exec("tar cf HmpidPeds2.tar HmpidPedDdl07.txt HmpidPedDdl08.txt HmpidPedDdl09.txt HmpidPedDdl10.txt HmpidPedDdl11.txt HmpidPedDdl12.txt HmpidPedDdl13.txt"); - Printf("HMPID - 2 tar files (HmpidPeds1-2) created (size 2273280 bytes)"); } //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ void SimMap(TMap *pDcsMap,Int_t runTime=1500) -- 2.43.5