preprocessor: pedestal files treatment
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 May 2007 16:29:27 +0000 (16:29 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 8 May 2007 16:29:27 +0000 (16:29 +0000)
HMPID/AliHMPIDDigit.h
HMPID/AliHMPIDPreprocessor.cxx
HMPID/AliHMPIDPreprocessor.h
HMPID/HMPIDbaseLinkDef.h
HMPID/HMPIDrecLinkDef.h
HMPID/Hmenu.C
HMPID/Hshuttle.C
HMPID/libHMPIDbase.pkg
HMPID/libHMPIDrec.pkg

index af32f3c..a9c5136 100644 (file)
@@ -189,7 +189,7 @@ void AliHMPIDDigit::Raw(UInt_t w32,Int_t ddl)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDDigit::Raw(Int_t ddl,Int_t r,Int_t d,Int_t a)
 {
-  assert(0<=r&&r<=13); assert(1<=r&&r<=24); assert(1<=d&&d<=10);   assert(0<=a&&a<=47);  
+  assert(0<=ddl&&ddl<=13); assert(1<=r&&r<=24); assert(1<=d&&d<=10);   assert(0<=a&&a<=47);  
   Int_t a2y[6]={3,2,4,1,5,0};//pady for a given address (for single DILOGIC chip)
                                   Int_t ch=ddl/2;
   Int_t tmp=(r-1)/8;              Int_t pc=(ddl%2)? 5-2*tmp:2*tmp; 
index 034e6a6..5b07e94 100644 (file)
@@ -1,15 +1,15 @@
-#include "AliHMPIDPreprocessor.h" //header
-
-#include <Riostream.h>
-#include <AliCDBMetaData.h>
-#include <AliDCSValue.h>      
-#include <TObjString.h>       //Process()
-#include <TF1.h>              //Process()
-#include <TF2.h>              //Process()
-#include <TGraph.h>           //Process()
-#include <TMatrixF.h>         //Process()
-#include <AliLog.h>           //Process() 
-
+#include "AliHMPIDPreprocessor.h" //header no includes
+#include "AliHMPIDDigit.h"        //ProcPed()
+#include <Riostream.h>            //ProcPed()  
+#include <AliCDBMetaData.h>       //ProcPed(), ProcDcs()
+#include <AliDCSValue.h>          //ProcDcs()
+#include <TObjString.h>           //ProcDcs(), ProcPed()
+#include <TF1.h>                  //Process()
+#include <TF2.h>                  //Process()
+#include <TGraph.h>               //Process()
+#include <TMatrix.h>              //ProcPed()
+#include <TList.h>                //ProcPed()
+#include <TSystem.h>              //ProcPed()
 //.
 // HMPID Preprocessor base class
 //.
 //.
 ClassImp(AliHMPIDPreprocessor)
 
-char *AliHMPIDPreprocessor::fgP ="HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWC.actual.value";
-char *AliHMPIDPreprocessor::fgT1="HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp";
-char *AliHMPIDPreprocessor::fgT2="HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iOut_Temp";
-char *AliHMPIDPreprocessor::fgHV="HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC0/HMP_MP%i_SEC0_HV.actual.vMon";
-
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void AliHMPIDPreprocessor::Initialize(Int_t run, UInt_t startTime,UInt_t endTime)
 {
@@ -30,98 +25,102 @@ void AliHMPIDPreprocessor::Initialize(Int_t run, UInt_t startTime,UInt_t endTime
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 UInt_t AliHMPIDPreprocessor::Process(TMap* pMap)
 {
+// Process all information from DCS and DAQ
+// Arguments: pMap- map of DCS aliases
+//   Returns: 0 on success or 1 on error    
+  if(! pMap)                     return 1; 
+  if(ProcDcs(pMap) && ProcPed()) return 0;
+  else                           return 1;     
+}//Process()
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Bool_t AliHMPIDPreprocessor::ProcDcs(TMap* pMap)
+{
 // Process: 1. inlet and outlet C6F14 temperature, stores TObjArray of 21 TF1, where TF1 is Nmean=f(t), one per radiator
 //          2. CH4 pressure and HV                 stores TObjArray of 7 TF1 where TF1 is thr=f(t), one per chamber
 // Arguments: pDcsMap - map of structure "alias name" - TObjArray of AliDCSValue
 // Assume that: HV is the same during the run for a given chamber, different chambers might have different HV
 //              P=f(t), different for different chambers
-  TObjArray arDaqSig(14); arDaqSig.SetOwner(kTRUE);
-  for(Int_t iddl=0;iddl<14;iddl++){
-    arDaqSig.AddAt(new TObjArray(24),iddl);
-    for(Int_t row=1;row<=24;row++){
-      ((TObjArray*)arDaqSig.At(iddl))->Add(new TMatrixF(1,10,0,47));
-    }
-  }
-  TObjArray arSigCut(14); arSigCut.SetOwner(kTRUE);                                  //14  n. of sigmas for zero suppression
-  Int_t ddl,r,d,a,hard;
-  Float_t mean,sigma;
-  Int_t sigmaCut;
-  for(Int_t iddl=0;iddl<14;iddl++){
-    TObject *sigCut= new TObject; 
-    const char *name=GetFile(kDAQ,"pedestals",Form("DDL%i",iddl));                   //first analyse a set of pedestal files
-    ifstream infile(name);
-    //
-    infile>>sigmaCut;
-    sigCut->SetUniqueID(sigmaCut);arSigCut.AddAt(sigCut,iddl);
-    TObjArray *pTmp = (TObjArray*)arDaqSig.At(iddl);
-    TMatrixF *pM;
-    while(!infile.eof()){
-      infile>>dec>>ddl>>r>>d>>a>>mean>>sigma>>hex>>hard;
-      pM = (TMatrixF*)pTmp->At(r-1);
-      (*pM)(d,a) = sigma;
-    }
-    //
-    infile.close();
-    Printf("file %s read successfully",name);
-  }
-
-  if(!pMap)  return 0;                    //no DCS map provided 
-  Double_t sor=0,eor=1500;
+// Returns: kTRUE on success  
 
   TF2 idx("RidxC4F14","sqrt(1+0.554*(1239.84/x)^2/((1239.84/x)^2-5796)-0.0005*(y-20))",5.5 ,8.5 ,0  ,50);  //N=f(Ephot,T) [eV,grad C] DiMauro mail
-  TF2 thr("RthrCH4"  ,"x+170745848*exp(-y*0.0162012)"                                                      ,2000,3000,900,1200); //thr=f(HV,P)  [V,mBar]
-//  Double_t eMean=6.67786;                                                                                  //mean energy of photon defined  by transperancy window
   
-//  TObjArray arTmean(21); arTmean.SetOwner(kTRUE);     //21 Tmean=f(time) one per radiator
-//  TObjArray arPress(7);  arPress.SetOwner(kTRUE);     //7  Press=f(time) one pre chamber
-  TObjArray arNmean(21); arNmean.SetOwner (kTRUE);     //21 Nmean=f(time) one per radiator
-  TObjArray arQthre(7);  arQthre.SetOwner (kTRUE);     //7  Qthre=f(time) one pre chamber
+// Qthr=f(HV,P) [V,mBar]  logA0=k*HV+b is taken from p. 64 TDR plot 2.59 for PC32 
+//                           A0=f(P) is taken from DiMauro mail
+// Qthr is estimated as 3*A0
+  TF2 thr("RthrCH4"  ,"3*10^(3.01e-3*x-4.72)+170745848*exp(-y*0.0162012)"             ,2000,3000,900,1200); 
+  
+  TObjArray arTmean(21); arTmean.SetOwner(kTRUE);     //21 Tmean=f(time) one per radiator
+  TObjArray arPress(7);  arPress.SetOwner(kTRUE);     //7  Press=f(time) one pre chamber
+  TObjArray arNmean(21); arNmean.SetOwner(kTRUE);     //21 Nmean=f(time) one per radiator
+  TObjArray arQthre(7);  arQthre.SetOwner(kTRUE);     //7  Qthre=f(time) one pre chamber
   
-//  AliDCSValue *pVal; Int_t cnt=0;
+  AliDCSValue *pVal; Int_t cnt=0;
     
-  for(Int_t iCh=0;iCh<7;iCh++){            
- //   TObjArray *pHV=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC0/HMP_MP%i_SEC0_HV.actual.vMon",iCh,iCh,iCh,iCh)); //HV
-//    pVal=(AliDCSValue*)pHV->At(0); Float_t hv=pVal->GetFloat();//HV    
+  for(Int_t iCh=0;iCh<7;iCh++){                   
+//    TObjArray *pHV=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC0/HMP_MP%i_SEC0_HV.actual.vMon",iCh,iCh,iCh,iCh)); //HV
+    TObjArray *pP =(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWC.actual.value"           ,iCh,iCh,iCh));    TIter nextP(pP);
+    TGraph *pGrP=new TGraph; cnt=0; while((pVal=(AliDCSValue*)nextP())) pGrP->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());            //P
 
-//    TObjArray *pP =(TObjArray*)pMap->GetValue(Form(fP,iCh,iCh,iCh)); //P
-//    TGraph *pGrP; cnt=0;TIter nextp(pP); while((pVal=(AliDCSValue*)nextp())) pGrP->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //P
-                                                                         
-//    TF1 *pFuP=new TF1(Form("P%i",iCh),"1005",sor,eor); 
-//    pGrP->Fit(pFuP,"Q"); delete pGrP;
-    TF1 *pFuQ=new TF1(Form("HMP_Qthre%i",iCh),"100",sor,eor);
-    arQthre.AddAt(pFuQ,iCh);    
+    pGrP->Fit(new TF1(Form("P%i",iCh),"1005",fStartTime,fEndTime),"Q"); delete pGrP;
+    arQthre.AddAt(new TF1(Form("HMP_Qthre%i",iCh),"100",fStartTime,fEndTime),iCh);    
+    
     for(Int_t iRad=0;iRad<3;iRad++){
-//      TObjArray *pT1=(TObjArray*)pMap->GetValue(Form(fT1,iCh,iCh,iRad)); //Tin
-//      TGraph *pGrT1=new TGraph; cnt=0; TIter next1(pT1); while((pVal=(AliDCSValue*)next1())) pGrT1->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //inlet temperature
-//      pGrT1->Fit(new TF1(Form("Tin%i%i",iCh,iRad),"[0]+[1]*x+[2]*sin([3]*x)",sor,eor),"Q");       //now fit the temp graph 
-      
-//      TObjArray *pT2=(TObjArray*)pMap->GetValue(Form(fT2,iCh,iCh,iRad));//Tout      
-//      TGraph *pGrT2=new TGraph; cnt=0; TIter next2(pT2); while((pVal=(AliDCSValue*)next2())) pGrT2->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //outlet temperature
-//      TF1*pFuT1=new TF1(Form("Tout%i%i",iCh,iRad),"13",sor,eor)      
-//      pGrT2->Fit(,"Q");       //now fit the temp graph 
-      
+      TObjArray *pT1=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp",iCh,iCh,iRad));  TIter nextT1(pT1);//Tin
+      TObjArray *pT2=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iOut_Temp",iCh,iCh,iRad)); TIter nextT2(pT2);//Tout      
+      TGraph *pGrT1=new TGraph; cnt=0;  while((pVal=(AliDCSValue*)nextT1())) pGrT1->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //T inlet
+      TGraph *pGrT2=new TGraph; cnt=0;  while((pVal=(AliDCSValue*)nextT2())) pGrT2->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat()); //T outlet 
+      pGrT1->Fit(new TF1(Form("Tin%i%i",iCh,iRad),"[0]+[1]*x+[2]*sin([3]*x)",fStartTime,fEndTime),"Q");       //fit Tin graph 
+      pGrT2->Fit(new TF1(Form("Tou%i%i",iCh,iRad),"[0]+[1]*x+[2]*sin([3]*x)",fStartTime,fEndTime),"Q");       //fit Tout graph 
+
+      delete pGrT1;  delete pGrT2;
+            
 //      arTmean.Add(pRadTempF);  
-      TF1 *pFuN=new TF1(Form("HMP_Nmean%i-%i",iCh,iRad),"1.292",sor,eor); pFuN->SetLineColor(iRad+2); pFuN->SetLineWidth(1);
-      arNmean.AddAt(pFuN,3*iCh+iRad);
-//      delete pGrT1;  delete pGrT2;
+      arNmean.AddAt(new TF1(Form("HMP_Nmean%i-%i",iCh,iRad),"1.292",fStartTime,fEndTime),3*iCh+iRad); //Nmean=f(t)
     }//radiators loop
   }//chambers loop
   
   AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("AliHMPIDPreprocessor"); metaData.SetComment("SIMULATED");
   
-//  arQthre.Print();
-//  Store("Calib", "Press" , &arPress , &metaData); 
-//  Store("Calib", "Tmean" , &arTmean , &metaData);
+//  Store("Calib", "Press" , &arPress , &metaData)  Store("Calib", "Tmean" , &arTmean , &metaData);
   
-  if(Store("Calib","Qthre"    ,&arQthre , &metaData,0,kTRUE) == kTRUE && 
-     Store("Calib","Nmean"    ,&arNmean , &metaData,0,kTRUE) == kTRUE &&   
-     Store("Calib","DaqSigCut",&arSigCut, &metaData,0,kTRUE) == kTRUE &&
-     Store("Calib","DaqSig"   ,&arDaqSig, &metaData,0,kTRUE) == kTRUE    ) return 0; //all OK
-  else
-    return 1;
-  
-  //  AliInfo("End.");  
-
+  if(Store("Calib","Qthre",&arQthre,&metaData,0,kTRUE) && Store("Calib","Nmean",&arNmean,&metaData,0,kTRUE) ) return kTRUE; //all OK
+  else                                                                                                        return 1;
 }//Process()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Bool_t AliHMPIDPreprocessor::ProcPed()
+{
+// Process pedestal files and create 7 M(padx,pady)=sigma, one for each chamber
+// Arguments:
+//   Returns:    
+  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"
+  for(Int_t i=0;i<pLdc->GetEntries();i++)//lists of LDCs
+    gSystem->Exec(Form("tar xzf %s",GetFile(kDAQ,"pedestals",((TObjString*)pLdc->At(i))->GetName()))); //untar pedestal files from current LDC
+  AliHMPIDDigit dig;
+  Int_t nSigCut,r,d,a,hard;  Float_t mean,sigma;
+  for(Int_t ddl=0;ddl<14;ddl++){  
+    ifstream infile(Form("HmpidPedDdl%02i.txt",ddl));
+    if(!infile.is_open()) return kFALSE;
+    TMatrix *pM=(TMatrixF*)aDaqSig.At(ddl/2);
+    infile>>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;      
+      dig.Raw(ddl,r,d,a);
+      (*pM)(dig.PadPcX(),dig.PadPcY()) = sigma;
+    }
+    infile.close();
+  }
+  gSystem->Exec("rm -rf HmpidPed*");
+  AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("AliHMPIDPreprocessor"); metaData.SetComment("SIMULATED");
+  return Store("Calib","DaqSig",&aDaqSig,&metaData,0,kTRUE);
+}//ProcPed()  
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Double_t ProcTrans()
+{
+// Process transparency monitoring data and calculates Emean  
+  Double_t eMean=6.67786;     //mean energy of photon defined  by transperancy window
+  return eMean;
+}   
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index c7b32f3..9eaa263 100644 (file)
@@ -13,17 +13,11 @@ class AliHMPIDPreprocessor : public AliPreprocessor
 public:
            AliHMPIDPreprocessor(AliShuttleInterface* pShuttle):AliPreprocessor("HMP",pShuttle) {}
   virtual ~AliHMPIDPreprocessor(                             )                                 {}
-  static char*     GetP ()    {return fgP;}        //getter for pressure
-  static char*     GetHV()    {return fgHV;}       //getter for high voltage
-  static char*     GetT1()    {return fgT1;}       //getter for inlet temperature
-  static char*     GetT2()    {return fgT2;}       //getter for inlet temperature
 protected:
-  static char    *fgP;     // Name of the aliases provided by the DCS
-  static char    *fgHV;    // Name of the aliases provided by the DCS
-  static char    *fgT1;    // Name of the aliases provided by the DCS
-  static char    *fgT2;    // Name of the aliases provided by the DCS
-  virtual void   Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
-  virtual UInt_t Process   (TMap* pDcsMap                              );
+  virtual void   Initialize(Int_t run, UInt_t startTime, UInt_t endTime); //
+  virtual UInt_t Process   (TMap* pDcsMap                              ); //process everthing
+          Bool_t ProcDcs   (TMap* pDcsMap                              ); //process DCS data points
+          Bool_t ProcPed   (                                           ); //process pedestal files
   ClassDef(AliHMPIDPreprocessor, 0);
 };
 
index cf02931..772bda3 100644 (file)
@@ -8,4 +8,6 @@
 #pragma link C++ class  AliHMPIDHit+;
 #pragma link C++ class  AliHMPIDCluster+;
 #pragma link C++ class  AliHMPIDParam+;
+#pragma link C++ class  AliHMPIDPreprocessor+;
+
 #endif
index b25a621..187b7ef 100644 (file)
@@ -6,5 +6,4 @@
 #pragma link C++ class  AliHMPIDReconstructor+;
 #pragma link C++ class  AliHMPIDTracker+;
 #pragma link C++ class  AliHMPIDRecon+;
-#pragma link C++ class  AliHMPIDPreprocessor+;
 #endif
index b0bb6bf..23c2e62 100644 (file)
@@ -201,9 +201,6 @@ void t1(Int_t case=1)
   cl->Print();  
 }//t1()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void hp(Int_t iEvt=0)
 {
 //Prints a list of HMPID hits for a given event. Default is event number 0.
@@ -264,16 +261,3 @@ void cp(Int_t iEvt=0)
   Printf("totally %i clusters for event %i",iCluCnt,iEvt);
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-
-void ttt()
-{
-  TClonesArray hits ("AliHMPIDDigit");
-  TClonesArray sdigs("AliHMPIDDigit");
-  
-  AliHMPIDHit hit(0,45e-9,kProton,33,0,0);
-  hit.Hit2Sdi(&sdigs);
-  sdigs.Print();
-}
-
-
-#include "Hdisp.C"
index d38c903..8d966df 100644 (file)
@@ -1,28 +1,24 @@
 void Hshuttle(Int_t runTime=1500)
-{
-// this macro is to simulate the functionality of SHUTTLE.
-// Here the list of DCS aliases is created and packed in TMap of structure "alias name" - TObjArray of AliDCSValue; AliDCSValue is a pair value-time stamp     
-// currently simulated: freon temperature 2 per radiator (inlet,outlet)
-//                      methane pressure 1 per chamber   
+{// this macro is to simulate the functionality of SHUTTLE.
   gSystem->Load("libTestShuttle.so");
-  
   AliTestShuttle::SetMainCDB(TString("local://$HOME"));
   
-  TMap        *pDcsMap = new TMap;       pDcsMap->SetOwner(1);          //DCS archive map
+  TMap *pDcsMap = new TMap;       pDcsMap->SetOwner(1);          //DCS archive map
+  
+  AliTestShuttle* pShuttle = new AliTestShuttle(0,0,1000000);   
+  SimPed();   for(Int_t ldc=1;ldc<=4;ldc++) pShuttle->AddInputFile(AliTestShuttle::kDAQ,"HMP","pedestals",Form("LDC%i",ldc),Form("HmpidPeds%i.tgz",ldc));
+  SimMap(pDcsMap,runTime); pShuttle->SetDCSInput(pDcsMap);                                    //DCS map
+  
+  AliPreprocessor* pp = new AliHMPIDPreprocessor(pShuttle); pShuttle->Process();  delete pp;  //here goes preprocessor 
 
-  SimPed();
-  SimMap(pDcsMap,runTime);
-  TestShuttle(pDcsMap);  
-  TCanvas *c=new TCanvas("cc","ff",600,600);  
-  DrawInput(c,pDcsMap);
-  DrawOutput();
+  TCanvas *c=new TCanvas("cc","ff",600,600);  DrawInput(c,pDcsMap); DrawOutput();
 }//Hshuttle()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void SimPed()
 {
   ofstream out;
   for(Int_t ddl=0;ddl<=13;ddl++){
-    out.open(Form("ped_%02i.txt",ddl));
+    out.open(Form("HmpidPedDdl%02i.txt",ddl));
     out << 3 <<endl;
     for(Int_t row=1;row<=24;row++)
       for(Int_t dil=1;dil<=10;dil++)
@@ -30,12 +26,17 @@ void SimPed()
           Float_t mean  = 150+200*gRandom->Rndm();
           Float_t sigma = 1+0.2*gRandom->Rndm();
           Int_t inhard=((Int_t(mean))<<9)+Int_t(mean+3*sigma);
-          out << Form("%2i %2i %2i %2i %5.2f %5.2f %x\n",ddl,row,dil,adr,mean,sigma,inhard);
+          out << Form("%2i %2i %2i %5.2f %5.2f %x\n",row,dil,adr,mean,sigma,inhard);
         }
 
     Printf("file ped %02i created",ddl);
     out.close();
   }
+  gSystem->Exec("tar czf HmpidPeds1.tgz HmpidPedDdl00.txt HmpidPedDdl01.txt HmpidPedDdl02.txt HmpidPedDdl03.txt");
+  gSystem->Exec("tar czf HmpidPeds2.tgz HmpidPedDdl04.txt HmpidPedDdl05.txt HmpidPedDdl06.txt HmpidPedDdl07.txt");
+  gSystem->Exec("tar czf HmpidPeds3.tgz HmpidPedDdl08.txt HmpidPedDdl09.txt HmpidPedDdl10.txt HmpidPedDdl11.txt");
+  gSystem->Exec("tar czf HmpidPeds4.tgz HmpidPedDdl12.txt HmpidPedDdl13.txt");
+  gSystem->Exec("rm -rf ped*.txt");
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void SimMap(TMap *pDcsMap,Int_t runTime=1500)
@@ -49,30 +50,20 @@ void SimMap(TMap *pDcsMap,Int_t runTime=1500)
     TObjArray *pHV=new TObjArray; pHV->SetOwner(1); 
     for(Int_t time=0;time<runTime;time+=stepTime)  pP->Add(new AliDCSValue((Float_t)1005.0 ,time));   //sample CH4 pressure [mBar]
                                                    pHV->Add(new AliDCSValue((Float_t)2010.0,time));   //sample chamber HV [V]
-    pDcsMap->Add(new TObjString(Form(AliHMPIDPreprocessor::GetP(),iCh,iCh,iCh)),pP); 
-    pDcsMap->Add(new TObjString(Form(AliHMPIDPreprocessor::GetHV(),iCh,iCh,iCh)),pHV); 
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWC.actual.value"           ,iCh,iCh,iCh)),pP); 
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC0/HMP_MP%i_SEC0_HV.actual.vMon",iCh,iCh,iCh)),pHV); 
         
     for(Int_t iRad=0;iRad<3;iRad++){//radiators loop
       TObjArray *pT1=new TObjArray; pT1->SetOwner(1); 
       TObjArray *pT2=new TObjArray; pT2->SetOwner(1); 
       for (Int_t time=0;time<runTime;time+=stepTime)  pT1->Add(new AliDCSValue(13,time));  //sample inlet temperature    Nmean=1.292 @ 13 degrees
       for (Int_t time=0;time<runTime;time+=stepTime)  pT2->Add(new AliDCSValue(13,time));  //sample outlet temperature
-      pDcsMap->Add(new TObjString(Form(AliHMPIDPreprocessor::GetT1(),iCh,iCh,iRad)) ,pT1); 
-      pDcsMap->Add(new TObjString(Form(AliHMPIDPreprocessor::GetT2(),iCh,iCh,iRad)),pT2);
+      pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp",iCh,iCh,iRad)) ,pT1); 
+      pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iOut_Temp",iCh,iCh,iRad)),pT2);
     }//radiators loop    
   }//chambers loop
 }//SimMap()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void TestShuttle(TMap *pDcsMap)
-{
-  AliTestShuttle* pShuttle = new AliTestShuttle(0,0,1000000);   
-  pShuttle->SetDCSInput(pDcsMap);                                                    //DCS map
-  for(Int_t ddl=0;ddl<=13;ddl++) pShuttle->AddInputFile(AliTestShuttle::kDAQ,"HMP","pedestals",Form("DDL%i",ddl),Form("./ped_%02i.txt",ddl));
-  AliPreprocessor* pp = new AliHMPIDPreprocessor(pShuttle);                           //actual preprocessor is created here
-  pShuttle->Process();                                                               //run SHUTTLE simulator
-  delete pp;
-}
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void DrawInput(TCanvas *c,TMap *pDcsMap)
 {
   c->Divide(3,3);
@@ -84,8 +75,8 @@ void DrawInput(TCanvas *c,TMap *pDcsMap)
     if(iCh==4) c->cd(4);  if(iCh==3) c->cd(5);  if(iCh==2) c->cd(6);
                           if(iCh==1) c->cd(8);  if(iCh==0) c->cd(9); 
                           
-    TObjArray *pHV=(TObjArray*)pDcsMap->GetValue(Form(AliHMPIDPreprocessor::GetHV(),iCh,iCh,iCh,iCh)); //HV
-    TObjArray *pP =(TObjArray*)pDcsMap->GetValue(Form(AliHMPIDPreprocessor::GetP(),iCh,iCh,iCh)); //P
+    TObjArray *pHV=(TObjArray*)pDcsMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC0/HMP_MP%i_SEC0_HV.actual.vMon",iCh,iCh,iCh,iCh)); //HV
+    TObjArray *pP =(TObjArray*)pDcsMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWC.actual.value",iCh,iCh,iCh)); //P
     TGraph *pGr=new TGraph; pGr->SetMarkerStyle(5);
     
     TIter nextp(pP); cnt=0; while((pVal=(AliDCSValue*)nextp())){ pGr->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());}//P
@@ -97,17 +88,15 @@ void DrawInput(TCanvas *c,TMap *pDcsMap)
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 void DrawOutput()
 {
-  AliCDBManager::Instance()->SetDefaultStorage("local://$HOME");
-  AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthre",0);
-  AliCDBEntry *pNmeanEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Nmean",0);
-  AliCDBEntry *pSigCutEnt=AliCDBManager::Instance()->Get("HMPID/Calib/SigCut",0);
-  AliCDBEntry *pDaqSigEnt=AliCDBManager::Instance()->Get("HMPID/Calib/DaqSig",0);
+  AliCDBManager::Instance()->SetDefaultStorage("local://$HOME"); AliCDBManager::Instance()->SetRun(0);
+  AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthre");
+  AliCDBEntry *pNmeanEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Nmean");
+  AliCDBEntry *pDaqSigEnt=AliCDBManager::Instance()->Get("HMPID/Calib/DaqSig");
   
-  if(!pQthreEnt || ! pNmeanEnt || !pSigCutEnt || !pDaqSigEnt) return;
+  if(!pQthreEnt || !pNmeanEnt || !pDaqSigEnt) return;
   
   TObjArray *pNmean =(TObjArray*)pNmeanEnt ->GetObject(); 
   TObjArray *pQthre =(TObjArray*)pQthreEnt ->GetObject(); 
-  TObjArray *pSigCut=(TObjArray*)pSigCutEnt->GetObject(); 
   TObjArray *pDaqSig=(TObjArray*)pDaqSigEnt->GetObject();
    
   TF1 *pRad0,*pRad1,*pRad2;  
@@ -124,3 +113,4 @@ void DrawOutput()
     TF1 *pRad2=(TF1*)pNmean->At(iCh*3+2); pRad2->Draw("same");
   }//chambers loop  
 }
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
index 3807a1a..fa6ef68 100644 (file)
@@ -1,4 +1,4 @@
-SRCS:=  AliHMPIDHit.cxx AliHMPIDDigit.cxx  AliHMPIDCluster.cxx AliHMPIDParam.cxx 
+SRCS:=  AliHMPIDHit.cxx AliHMPIDDigit.cxx  AliHMPIDCluster.cxx AliHMPIDParam.cxx AliHMPIDPreprocessor.cxx
 
 HDRS:= $(SRCS:.cxx=.h)
 DHDR:= HMPIDbaseLinkDef.h
index b25ca00..bcb4def 100644 (file)
@@ -1,4 +1,4 @@
-SRCS:=  AliHMPIDReconstructor.cxx AliHMPIDTracker.cxx AliHMPIDRecon.cxx AliHMPIDPreprocessor.cxx
+SRCS:=  AliHMPIDReconstructor.cxx AliHMPIDTracker.cxx AliHMPIDRecon.cxx
 
 HDRS:= $(SRCS:.cxx=.h)
 DHDR:= HMPIDrecLinkDef.h