UserCut removed from OCDB (not more necessary). Now UserCut from RecoParam or defaults
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Apr 2008 16:41:58 +0000 (16:41 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 15 Apr 2008 16:41:58 +0000 (16:41 +0000)
HMPID/AliHMPIDPreprocessor.cxx
HMPID/AliHMPIDRecoParam.h
HMPID/AliHMPIDReconstructor.cxx
HMPID/Hconfig.C

index 4a5b17e..f3f2030 100644 (file)
@@ -88,7 +88,6 @@ Bool_t AliHMPIDPreprocessor::ProcDcs(TMap* pMap)
   TObjArray arPress(7);        arPress.SetOwner(kTRUE);     //7  Press=f(time) one per chamber
   TObjArray arNmean(21);       arNmean.SetOwner(kTRUE);     //21 Nmean=f(time) one per radiator
   TObjArray arQthre(42);       arQthre.SetOwner(kTRUE);     //42 Qthre=f(time) one per sector
-  TObjArray arUserCut(7);    arUserCut.SetOwner(kTRUE);     //7  user cut in number of sigmas
   
   AliDCSValue *pVal; Int_t cnt=0;
 
@@ -120,11 +119,6 @@ Bool_t AliHMPIDPreprocessor::ProcDcs(TMap* pMap)
          Form("3*10^(3.01e-3*HV%i_%i - 4.72)+170745848*exp(-(P%i+Penv)*0.0162012)",iCh,iSec,iCh),fStartTime,fEndTime),6*iCh+iSec);
     }
     
-// evaluate UserCut
-    Int_t nSigmaUserCut = 3;
-    TObject *pUserCut = new TObject();pUserCut->SetUniqueID(nSigmaUserCut);
-    arUserCut.AddAt(pUserCut,iCh);    
-    
 // evaluate Temperatures    
     for(Int_t iRad=0;iRad<3;iRad++){
       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
@@ -150,12 +144,8 @@ Bool_t AliHMPIDPreprocessor::ProcDcs(TMap* pMap)
   metaData.SetResponsible("AliHMPIDPreprocessor"); 
   metaData.SetComment("SIMULATED");
 
-//  stDcsStore =   Store("Calib","Qthre",&arQthre,&metaData,0,kTRUE) &&    // from DCS 
-//                 Store("Calib","Nmean",&arNmean,&metaData,0,kTRUE) &&    // from DCS
-//                 Store("Calib","UserCut",&arUserCut,&metaData,0,kTRUE);  //really not from DCS...a method ProcManual maybe needed
   stDcsStore =   Store("Calib","Qthre",&arQthre,&metaData) &&    // from DCS 
-                 Store("Calib","Nmean",&arNmean,&metaData) &&    // from DCS
-                 Store("Calib","UserCut",&arUserCut,&metaData);  //really not from DCS...a method ProcManual maybe needed
+                 Store("Calib","Nmean",&arNmean,&metaData);      // from DCS
   if(!stDcsStore) {
     Log("HMPID - failure to store DCS data results in OCDB");    
   }
index 2026601..27832b8 100644 (file)
@@ -23,13 +23,12 @@ class AliHMPIDRecoParam : public TNamed
   AliHMPIDRecoParam& operator=(const AliHMPIDRecoParam &p);                                 // ass. op.
   virtual ~AliHMPIDRecoParam();                                                         //dtor
   
-  Bool_t   GetRecoMode(            )       const  { return fRecoMode;       }
-  inline  Int_t  GetUserCut(Int_t iCh    ) const;
-  Bool_t   GetUserCutMode(         )       const  { return fUserCutMode;    }
-
-  void    SetRecoMode(Bool_t recoMode)           { fRecoMode=recoMode; }
-  inline  void    SetUserCut(Int_t ucCh0,Int_t ucCh1,Int_t ucCh2,Int_t ucCh3,Int_t ucCh4,Int_t ucCh5,Int_t ucCh6);////set user cut
-  void    SetUserCutMode(Bool_t userCutMode)      { fUserCutMode=userCutMode;   }
+  Bool_t   GetRecoMode(            )       const  { return fRecoMode;          }
+  Bool_t   GetUserCutMode(         )       const  { return fUserCutMode;       }
+  Int_t   GetUserCut(Int_t iCh)            const  { return fUserCut[iCh];      }
+  void    SetRecoMode(Bool_t recoMode)            { fRecoMode=recoMode;        }
+  void    SetUserCut(Int_t iChamb,Int_t ucCh)     { fUserCut[iChamb]=ucCh;     }              //set user cut for a given chamber
+  void    SetUserCutMode(Bool_t userCutMode)      { fUserCutMode=userCutMode;  }
   
   static   AliHMPIDRecoParam *GetUserModeParam();        // make reco parameters
   
@@ -43,31 +42,5 @@ class AliHMPIDRecoParam : public TNamed
 
       ClassDef(AliHMPIDRecoParam, 1) 
 };
-
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      
-void AliHMPIDRecoParam::SetUserCut(Int_t ucCh0,Int_t ucCh1,Int_t ucCh2,Int_t ucCh3,Int_t ucCh4,Int_t ucCh5,Int_t ucCh6)
-{ 
-  //
-  // Set user cuts, ... make it nicer later ...
-  //
-  
-  fUserCut[0]=ucCh0;                 
-  fUserCut[1]=ucCh1;   
-  fUserCut[2]=ucCh2;   
-  fUserCut[3]=ucCh3;   
-  fUserCut[4]=ucCh4;   
-  fUserCut[5]=ucCh5;   
-  fUserCut[6]=ucCh6;     
-} //SetUserCut()
-//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++      
-Int_t  AliHMPIDRecoParam::GetUserCut(Int_t iCh)const
-{
-  //
-  //Return the UserCut for a given chamber
-  //
-  if( iCh < 0 || iCh > 6 ) return 3; // return a basic value actually does nothing , ADD AliError??? 
-  else return fUserCut[iCh];   // return the actual user cut
-  
-}
 #endif
 
index e38cd05..49c8d3e 100644 (file)
@@ -26,6 +26,7 @@
 #include <AliCDBManager.h>         //ctor
 #include <AliESDEvent.h>           //FillEsd()
 #include <AliRawReader.h>          //Reconstruct() for raw digits
+#include <AliLog.h>                //
 #include "AliHMPIDRawStream.h"     //ConvertDigits()
 #include "AliHMPIDRecoParam.h"     //ctor
 ClassImp(AliHMPIDReconstructor)
@@ -49,24 +50,18 @@ AliHMPIDReconstructor::AliHMPIDReconstructor():AliReconstructor(),fUserCut(0),fD
     fClu->AddAt(pClus,i);
   }
 
-   if(fgkRecoParam!=0x0 && fgkRecoParam->GetUserCutMode()==kFALSE)
-  {
-      for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
+   if(fgkRecoParam!=0x0 && fgkRecoParam->GetUserCutMode()==kTRUE) {
+    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
       fUserCut[iCh] = fgkRecoParam->GetUserCut(iCh);
       AliDebug(1,Form("UserCut successfully loaded (from RecoParam) for chamber %i -> %i ",iCh,fUserCut[iCh]));
-   }
+    }
   }  
   else {
-  AliCDBEntry *pUserCutEnt =AliCDBManager::Instance()->Get("HMPID/Calib/UserCut");    //contains TObjArray of 14 TObject with n. of sigmas to cut charge 
-  if(pUserCutEnt) {
-    TObjArray *pUserCut = (TObjArray*)pUserCutEnt->GetObject(); 
-    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++){                  //chambers loop 
-      fUserCut[iCh] = pUserCut->At(iCh)->GetUniqueID();
-      AliDebug(1,Form("UserCut successfully loaded (from OCDB) for chamber %i -> %i ",iCh,fUserCut[iCh]));
+    for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
+      fUserCut[iCh] = 3;                                                                             // minimal requirement for sigma cut
+      AliDebug(1,Form("UserCut loaded from defaults for chamber %i -> %i ",iCh,fUserCut[iCh]));
     }
-   }
-   else {for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fUserCut[iCh] = 3;}
-  }
+  } 
 
   AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthre"); //contains TObjArray of 7 TF1
   if(!pQthreEnt) AliFatal("No Qthre available");
index 800ca04..a2d4c82 100644 (file)
@@ -21,7 +21,7 @@ public:
           HmpConfig(const char*sFileName);
          ~HmpConfig()                    {Info("ctor","");Cleanup();}
          
-  enum EVersOpts  {kNo=101,kVer0,kVer1,kVer2,kTest, kDeclust=301,kSagita,kFeedback,kElNoise,kQe0=400,kQeNorm,kFlatIdx,kOptics};
+  enum EVersOpts  {kNo=101,kVer0,kVer1,kVer2,kVer3,kTest, kDeclust=301,kSagita,kFeedback,kElNoise,kQe0=400,kQeNorm,kFlatIdx,kOptics};
   enum EGenTypes  {kGunZ=1,kGun1,kGun7,kBox,kHijing,kHijingPara,kPythia,kHmpLib,kNotUsed=999};
   
   enum EDetectors {kPIPE=1,kITS,kTPC,kTRD,kTOF,kFRAME,kMAG,kACORDE,kHALL,kPHOS,kT0,kFMD,kABSO,kPMD,kDIPO,kEMCAL,kVZERO,kMUON,kZDC,kSHILD};
@@ -88,7 +88,8 @@ void HmpConfig::GuiHmp(TGHorizontalFrame *pMainHF)
     new TGRadioButton(fVerBG,   "No"         ,kNo       );   
     new TGRadioButton(fVerBG,   "ver0"       ,kVer0     );
     new TGRadioButton(fVerBG,   "ver1"       ,kVer1     );  
-    new TGRadioButton(fVerBG,   "ver2"       ,kVer2     ); fVerBG->SetButton(kVer2);
+    new TGRadioButton(fVerBG,   "ver2"       ,kVer2     ); 
+    new TGRadioButton(fVerBG,   "ver3"       ,kVer3     ); fVerBG->SetButton(kVer3);
   pHmpGF->AddFrame(fOptBG=new TGButtonGroup(pHmpGF,""));  fOptBG->Connect("Pressed(Int_t)" ,"HmpConfig",this,"HmpVerSlot(Int_t)");
     new TGCheckButton(fOptBG,"Test run position"   ,kTest);       
     new TGCheckButton(fOptBG,"Unfold cluster    "  ,kDeclust);      fOptBG->SetButton(kDeclust);
@@ -131,6 +132,7 @@ void HmpConfig::WriteHmp(FILE *pF)
     if     (fVerBG->GetButton(kVer0)->GetState())           fprintf(pF,"  new AliHMPIDv0(\"Gel %s\");\n\n",title.Data());    
     else if(fVerBG->GetButton(kVer1)->GetState())           fprintf(pF,"  new AliHMPIDv1(\"HMPID\",\"%s\");\n\n",title.Data());   
     else if(fVerBG->GetButton(kVer2)->GetState())           fprintf(pF,"  new AliHMPIDv2(\"HMPID\",\"%s\");\n\n",title.Data());   
+    else if(fVerBG->GetButton(kVer3)->GetState())           fprintf(pF,"  new AliHMPIDv3(\"HMPID\",\"%s\");\n\n",title.Data());   
   }
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -696,8 +698,14 @@ void HmpConfig::WriteBatch()
     if     (fTrkBG->GetButton(kRecoPar)->GetState())
       { 
          fprintf(fp,"  AliHMPIDRecoParam * hmpidRecoParam = AliHMPIDRecoParam::GetUserModeParam(); //Get the HMPID reco param\n"); 
-         fprintf(fp,"  hmpidRecoParam->SetUserCutMode(kFALSE);                                     //Switch to RecoParam from OCDB cuts\n");
-         fprintf(fp,"  hmpidRecoParam->SetUserCut(4,4,4,4,4,4,4);                                  //eg cut for UserCutSigma (Values: ch0, ch1, ..,ch6)\n");
+         fprintf(fp,"  hmpidRecoParam->SetUserCutMode(kTRUE);                                      //Switch to RecoParam\n");
+         fprintf(fp,"  hmpidRecoParam->SetUserCut(0,4);                                            //eg cut for UserCutSigma (Values: ch0)\n");
+         fprintf(fp,"  hmpidRecoParam->SetUserCut(1,4);                                            //eg cut for UserCutSigma (Values: ch1)\n");
+         fprintf(fp,"  hmpidRecoParam->SetUserCut(2,4);                                            //eg cut for UserCutSigma (Values: ch2)\n");
+         fprintf(fp,"  hmpidRecoParam->SetUserCut(3,4);                                            //eg cut for UserCutSigma (Values: ch3)\n");
+         fprintf(fp,"  hmpidRecoParam->SetUserCut(4,4);                                            //eg cut for UserCutSigma (Values: ch4)\n");
+         fprintf(fp,"  hmpidRecoParam->SetUserCut(5,4);                                            //eg cut for UserCutSigma (Values: ch5)\n");
+         fprintf(fp,"  hmpidRecoParam->SetUserCut(6,4);                                            //eg cut for UserCutSigma (Values: ch6)\n");
          fprintf(fp,"  AliHMPIDReconstructor::SetRecoParam(hmpidRecoParam);                        //Pass the RecoPar to the Reconstructor\n");
       }
     //---------------------------------------------