]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
New schema for pedestal files to be processed.
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Apr 2008 09:37:17 +0000 (09:37 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Apr 2008 09:37:17 +0000 (09:37 +0000)
HMPID/AliHMPIDPreprocessor.cxx
HMPID/HMPIDda.cxx
HMPID/Hshuttle.C

index f3f20302ab6912545eaa39a0e24b5c2209c9f4cd..f5a69c0d6d6aa9755651b579774cd8d5c2126119 100644 (file)
@@ -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;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;
@@ -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()
 }   
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  
+
+
+
index 201a30589b102b0dc258093216a3fae84d70f9ae..beffd736d1857f0ae9f558dcfe04c45bfc266e44 100644 (file)
@@ -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
index 5970e92df8628df72ac7bdd82e1746eb3331f847..0398c19dd0f8e7b0ed21ee106236fa875f6f9cc7 100644 (file)
@@ -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 <<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)