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
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;iddl<AliHMPIDRawStream::kNDDL;iddl++) //retrieve the files from LDCs independently the DDL<->LDC 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;i<pLdc->GetEntries();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;i<pLdc->GetEntries();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;
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;
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);
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+
+
+
/* 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
- 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"));
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 <<endl;
+ out << Form("%8s %2d\n","RunNumber", 999); //read run number
+ out << Form("%8s %2d\n","LdcId" , 999); //read LDC Id
+ out << Form("%8s %2d\n","TimeStamp", 999); //read time stamp
+ out << Form("%8s %2d\n","TotNumEvt", 999); //read number of total events processed
+ out << Form("%8s %2d\n","TotDDLEvt", 999); //read number of bad events for DDL # nDDL processed
+ out << Form("%8s %2d\n","NumBadEvt", 999); //read number of bad events for DDL # nDDL processed
+ out << Form("%8s %2f\n","NBadE(%)", 999.9); //read number of bad events (in %) for DDL # nDDL processed
+ out << Form("%8s %2.2d\n","SigCut", nSigmas); //# of sigma cuts
for(Int_t row=1;row<=24;row++)
for(Int_t dil=1;dil<=10;dil++)
for(Int_t adr=0;adr<=47;adr++){
Float_t mean = 150+200*gRandom->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)