HV different for sectors in a chamber
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Mar 2008 11:22:56 +0000 (11:22 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 18 Mar 2008 11:22:56 +0000 (11:22 +0000)
HMPID/AliHMPIDParam.h
HMPID/AliHMPIDPreprocessor.cxx
HMPID/AliHMPIDReconstructor.cxx
HMPID/AliHMPIDTracker.cxx
HMPID/AliHMPIDTracker.h
HMPID/Hconfig.C
HMPID/Hshuttle.C

index 1cc5404db36e07b3b3ece504e085c958ecf752cf..947fa9e0da6cbbff8af393de09ba016eddbd9ae6 100644 (file)
@@ -62,6 +62,7 @@ public:
   Bool_t  GetInstType        (                               )const{return fgInstanceType;                            }  //return if the instance is from geom or ideal                        
   
   inline static Bool_t IsInDead(Float_t x,Float_t y        );                                                           //is the point in dead area?
+  inline static Int_t  InHVSector(Float_t x, Float_t y     );                                                           //find HV sector
   static Bool_t  IsInside    (Float_t x,Float_t y,Float_t d=0)     {return  x>-d&&y>-d&&x<fgkMaxPcX[kMaxPc]+d&&y<fgkMaxPcY[kMaxPc]+d; } //is point inside chamber boundaries?
 
             Double_t   MeanIdxRad              ()const {return 1.29204;}   //<--TEMPORAR--> to be removed in future. Mean ref index C6F14
@@ -173,4 +174,21 @@ void AliHMPIDParam::Lors2Pad(Float_t x,Float_t y,Int_t &pc,Int_t &px,Int_t &py)
   else if(y>fgkMinPcY[4] && y<fgkMaxPcY[4]) {pc+=4;py=Int_t((y-fgkMinPcY[4]) / SizePadY());}//PC 4 or 5
   else return;
 }
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Int_t AliHMPIDParam::InHVSector(Float_t x, Float_t y)
+{
+    Int_t hvsec = 0;
+
+    if(x>=fgkMinPcY[0] && x<=(fgkMaxPcY[0]+fgkMinPcY[0])/2 && y>=fgkMinPcY[1] && y<=(fgkMaxPcY[1]+fgkMinPcY[1])/2) hvsec=0;
+    if(x>=(fgkMaxPcY[0]+fgkMinPcY[0])/2 && x<=fgkMaxPcY[0] && y>=(fgkMaxPcY[1]+fgkMinPcY[1])/2 && y<=fgkMaxPcY[1]) hvsec=1;
+    if(x>=fgkMinPcY[2] && x<=(fgkMaxPcY[2]+fgkMinPcY[2])/2 && y>=fgkMinPcY[3] && y<=(fgkMaxPcY[3]+fgkMinPcY[3])/2) hvsec=2;
+    if(x>=(fgkMaxPcY[2]+fgkMinPcY[2])/2 && x<=fgkMaxPcY[2] && y>=(fgkMaxPcY[3]+fgkMinPcY[3])/2 && y<=fgkMaxPcY[3]) hvsec=3;
+    if(x>=fgkMinPcY[4] && x<=(fgkMaxPcY[4]+fgkMinPcY[4])/2 && y>=fgkMinPcY[5] && y<=(fgkMaxPcY[5]+fgkMinPcY[5])/2) hvsec=4;
+    if(x>=(fgkMaxPcY[4]+fgkMinPcY[4])/2 && x<=fgkMaxPcY[4] && y>=(fgkMaxPcY[5]-fgkMinPcY[5])/2 && y<=fgkMaxPcY[5]) hvsec=5;
+
+    return hvsec;
+
+ //in current pc
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 #endif
index 85ff3e8a7f31fc2c96f7efbf4d90f4a2a1dc12ff..4a5b17e700c258b8d2b98d629da765754f95bade 100644 (file)
@@ -85,42 +85,40 @@ Bool_t AliHMPIDPreprocessor::ProcDcs(TMap* pMap)
   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 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(7);        arQthre.SetOwner(kTRUE);     //7  Qthre=f(time) one pre chamber
+  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;
 
 // evaluate environment pressure
-  TObjArray *pPenv=(TObjArray*)pMap->GetValue("HMP_DET/HMP_ENV/HMP_ENV_PENV.actual.value"); 
-
-  TIter nextPenv(pPenv);
-
+  TObjArray *pPenv=(TObjArray*)pMap->GetValue("HMP_DET/HMP_ENV/HMP_ENV_PENV.actual.value");TIter nextPenv(pPenv);
   TGraph *pGrPenv=new TGraph; cnt=0;
   while((pVal=(AliDCSValue*)nextPenv())) pGrPenv->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());        //P env
   if( cnt!=0) pGrPenv->Fit(new TF1("Penv","1000+x*[0]",fStartTime,fEndTime),"Q");                               //clm: if no DCS map entry don't fit
   delete pGrPenv;
     
   for(Int_t iCh=0;iCh<7;iCh++){                   
-// evaluate High Voltage
-    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)); TIter nextHV(pHV);
-    TGraph *pGrHV=new TGraph; cnt=0;
-    while((pVal=(AliDCSValue*)nextHV())) pGrHV->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());            //P
-    if( cnt!=0) pGrHV->Fit(new TF1(Form("HV%i",iCh),"2000+x*[0]",fStartTime,fEndTime),"Q");                       //clm: if no DCS map entry don't fit
-    delete pGrHV;
-
 // evaluate Pressure
-    TObjArray *pP =(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWPC.actual.value"           ,iCh,iCh,iCh));
+    TObjArray *pP =(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWPC.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
-    if( cnt!=0) pGrP->Fit(new TF1(Form("P%i",iCh),"4 + x*[0]",fStartTime,fEndTime),"Q");                       //clm: if no DCS map entry don't fit
+    if( cnt!=0) pGrP->Fit(new TF1(Form("P%i",iCh),"[0] + x*[1]",fStartTime,fEndTime),"Q");                        //clm: if no DCS map entry don't fit
     delete pGrP;
     
+    for(Int_t iSec=0;iSec<6;iSec++){
+// evaluate High Voltage
+     TObjArray *pHV=(TObjArray*)pMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC%i/HMP_MP%i_SEC%i_HV.actual.vMon",iCh,iCh,iCh,iSec,iCh,iSec));TIter nextHV(pHV);
+     TGraph *pGrHV=new TGraph; cnt=0;
+     while((pVal=(AliDCSValue*)nextHV())) pGrHV->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());            //HV
+     if( cnt!=0) pGrHV->Fit(new TF1(Form("HV%i_%i",iCh,iSec),"[0]+x*[1]",fStartTime,fEndTime),"Q");               //clm: if no DCS map entry don't fit
+     delete pGrHV;
 // evaluate Qthre
-    arQthre.AddAt(new TF1(Form("HMP_Qthre%i",iCh),Form("3*10^(3.01e-3*HV%i - 4.72)+170745848*exp(-(P%i+Penv)*0.0162012)",iCh),fStartTime,fEndTime),iCh);
-
+     arQthre.AddAt(new TF1(Form("HMP_QthreC%iS%i",iCh,iSec),
+         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;
index a25dedc4e307ead1bf535d0302bc20205dc36462..cf2f8c6e768157602443a28adf2c8477e74fc7ab 100644 (file)
@@ -66,7 +66,21 @@ AliHMPIDReconstructor::AliHMPIDReconstructor():AliReconstructor(),fUserCut(0),fD
     }
    }
   }
-   
+
+  AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthre"); //contains TObjArray of 7 TF1
+  if(!pQthreEnt) AliFatal("No Qthre available");
+  TObjArray *pQthre = (TObjArray*)pQthreEnt->GetObject();
+  for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) {
+    for(Int_t isec=0;isec<=5;isec++) {
+     TF1 *pfQthre = (TF1*)pQthre->At(6*iCh+isec); 
+     Double_t tMin,tMax;
+     pfQthre->GetRange(tMin,tMax);
+     Double_t qthre=pfQthre->Eval(tMin);
+      Printf(" HMPID: Qthre successfully loaded for chamber %i  sector %i -> %f ",iCh,isec,qthre);
+    }
+  }
+
+     
   AliCDBEntry *pDaqSigEnt =AliCDBManager::Instance()->Get("HMPID/Calib/DaqSig");  //contains TObjArray of TObjArray 14 TMatrixF sigmas values for pads 
   if(!pDaqSigEnt) AliFatal("No pedestals from DAQ!");
   fDaqSig = (TObjArray*)pDaqSigEnt->GetObject();
index f271805edd68b0bbe156208e2ffdac4a6b54ba58..7b7b4fbc0e5fb9b967883b320dac51bc9491e28c 100644 (file)
@@ -85,7 +85,7 @@ Int_t AliHMPIDTracker::PropagateBack(AliESDEvent *pEsd)
 // Agruments: pEsd - pointer to ESD
 //   Returns: error code    
   AliCDBEntry *pNmeanEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Nmean"); //contains TObjArray of 21 TF1
-  AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthre"); //contains TObjArray of 7 TF1
+  AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthre"); //contains TObjArray of 42 (7ch * 6sec) TF1
   if(!pNmeanEnt) AliFatal("No Nmean C6F14 ");
   if(!pQthreEnt) AliFatal("No Qthre");
     
@@ -104,7 +104,8 @@ Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmea
     Int_t cham=IntTrkCha(pTrk,xPc,yPc);                                                          //get chamber intersected by this track 
     if(cham<0) continue;                                                                         //no intersection at all, go after next track
     Double_t nmean=((TF1*)pNmean->At(3*cham))->Eval(pEsd->GetTimeStamp());                       //C6F14 Nmean for this chamber
-    Double_t qthre=((TF1*)pQthre->At(cham))  ->Eval(pEsd->GetTimeStamp());                       //Qthre for this chamber
+    Int_t hvsec = AliHMPIDParam::InHVSector(xPc,yPc);
+    Double_t qthre=((TF1*)pQthre->At(6*cham+hvsec))->Eval(pEsd->GetTimeStamp());
     recon.SetImpPC(xPc,yPc);                                                                     //store track impact to PC
     recon.CkovAngle(pTrk,(TClonesArray *)pClus->At(cham),nmean,qthre);                           //search for Cerenkov angle of this track
 //    Printf("AliHMPIDTracker::Recon: nmean %f, qthre %f",nmean,qthre);
@@ -112,14 +113,14 @@ Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmea
   return 0; // error code: 0=no error;
 }//Recon()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDTracker::ReconHiddenTrk(Int_t iCh,AliESDtrack *pTrk,TClonesArray *pCluLst,TObjArray *pNmean,TObjArray *pQthre)
+Int_t AliHMPIDTracker::ReconHiddenTrk(Int_t iCh,Int_t iHVsec,AliESDtrack *pTrk,TClonesArray *pCluLst,TObjArray *pNmean,TObjArray *pQthre)
 {
 // Static method to reconstruct Theta Ckov for all valid tracks of a given event.
 // Arguments: pEsd- pointer ESD; pClu- pointer to clusters for all chambers; pNmean - pointer to all function Nmean=f(time), pQthre - pointer to all function Qthre=f(time)
 //   Returns: error code, 0 if no errors
   AliHMPIDReconHTA reconHTA;                                                                          //instance of reconstruction class, nothing important in ctor
   Double_t nmean=((TF1*)pNmean->At(3*iCh))->Eval(0);                                            //C6F14 Nmean for this chamber
-  Double_t qthre=((TF1*)pQthre->At(iCh))  ->Eval(0);                                            //C6F14 Nmean for this chamber
+  Double_t qthre=((TF1*)pQthre->At(iCh+iHVsec))->Eval(0);                                             //C6F14 Nmean for this chamber
   if(pCluLst->GetEntriesFast()<4) return 1;                                                     //min 4 clusters (3 + 1 mip) to find a ring! 
   if(reconHTA.CkovHiddenTrk(pTrk,pCluLst,nmean,qthre)) return 0;                                   //search for track parameters and Cerenkov angle of this track
   else return 1;                                                                                // error code: 0=no error,1=fit not performed;
index 13c659826cd56f3aefaf4238f6c005f809edc459..705b36dfed2712fd2e83c408165d61ca851927eb 100644 (file)
@@ -27,7 +27,7 @@ public:
 //private part  
   static Int_t       IntTrkCha     (AliESDtrack *pTrk,Float_t &xPc,Float_t &yPc        );              //find track-PC intersection, retuns chamber ID
   static Int_t       Recon         (AliESDEvent *pEsd,TObjArray *pCluAll,TObjArray *pNmean=0,TObjArray *pQthre=0);//do actual job, returns status code  
-  static Int_t       ReconHiddenTrk(Int_t iCh,AliESDtrack *pTrk,TClonesArray *pClus,TObjArray *pNmean, TObjArray *pQthre);//do actual job with Hidden Track Algorithm    
+  static Int_t       ReconHiddenTrk(Int_t iCh,Int_t iHVsec,AliESDtrack *pTrk,TClonesArray *pClus,TObjArray *pNmean, TObjArray *pQthre);//do actual job with Hidden Track Algorithm    
   
 protected:
   TObjArray            *fClu;                     //! each chamber holds it's one list of clusters 
index a876e706c1709373d93e2e8069dc292a39987628..997aaf85abe09ae0f3c5fba93f1829bc1794bc8c 100644 (file)
@@ -771,7 +771,8 @@ void HmpConfig::WriteConfig()
   WriteHmp(pF);  //private HMPID part
   WriteDet(pF);  //other detectors
 //end of Config.C file:  
-  fprintf(pF,"\n  ::Info(\"----------> HMPID private config\",\"Stop\\n\\n\\n\");\n"); 
+  fprintf(pF,"\n  ::Info(\"----------> HMPID private config\",\"Stop\\n\\n\\n\");\n");
+//
   fprintf(pF,"}\n");
   fclose(pF);  
 }//WriteConfig()
index bf2fd3c6435f71d59dce3e9c68860921db3348e0..0ef3d0c658437870b1a7898d9839369454c9bfcc 100644 (file)
@@ -6,6 +6,7 @@
   
   TMap *pDcsMap = new TMap;       pDcsMap->SetOwner(1);          //DCS archive map
   
+//  AliTestShuttle* pShuttle = new AliTestShuttle(0,0,1000000);   
   AliTestShuttle* pShuttle = new AliTestShuttle(0,0,1000000);   
   pShuttle->SetInputRunType("PHYSICS");
 //  pShuttle->SetInputRunType("PEDESTAL_RUN");
@@ -49,23 +50,32 @@ void SimMap(TMap *pDcsMap,Int_t runTime=1500)
   Int_t stepTime=100; //time interval between measurements
   Int_t startTime=0;
   
+  TObjArray *pHV[7];
   for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
-    TObjArray *pP=new TObjArray;  pP->SetOwner(1);
-    TObjArray *pHV=new TObjArray; pHV->SetOwner(1);
+    TObjArray *pPCH4=new TObjArray;  pPCH4->SetOwner(1);
+    TObjArray *pPenv=new TObjArray;  pPenv->SetOwner(1);
+    pHV[iCh]=new TObjArray; pHV[iCh]->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)2050.0,time));   //sample chamber HV [V]
+       pPCH4->Add(new AliDCSValue((Float_t)4.0,time));               //sample CH4 pressure [mBar] differential respect to atm
+       pPenv->Add(new AliDCSValue((Float_t)1000.0 ,time));               //also atm. pressure set to the same value
+       pHV[iCh]->Add(new AliDCSValue((Float_t)(1930+iCh*20),time));   //sample chamber HV [V]
     }
-    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); 
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWPC.actual.value"           ,iCh,iCh,iCh    )),pPCH4);         //CH4 pressure wrt atm
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_ENV/HMP_ENV_PENV.actual.value"                                               )),pPenv);         //atm pressure
+    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,iCh)),pHV[iCh]);      //HV SEC0
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC1/HMP_MP%i_SEC1_HV.actual.vMon",iCh,iCh,iCh,iCh)),pHV[iCh]);      //HV SEC1
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC2/HMP_MP%i_SEC2_HV.actual.vMon",iCh,iCh,iCh,iCh)),pHV[iCh]);      //HV SEC2 
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC3/HMP_MP%i_SEC3_HV.actual.vMon",iCh,iCh,iCh,iCh)),pHV[iCh]);      //HV SEC3 
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC4/HMP_MP%i_SEC4_HV.actual.vMon",iCh,iCh,iCh,iCh)),pHV[iCh]);      //HV SEC4 
+    pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_PW/HMP_MP%i_SEC5/HMP_MP%i_SEC5_HV.actual.vMon",iCh,iCh,iCh,iCh)),pHV[iCh]);      //HV SEC5 
 
     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)  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(14,time));  //sample outlet temperature
-      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);
+      pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp",iCh,iCh,iRad)) ,pT1);               //Temperature in  Rad 
+      pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iOut_Temp",iCh,iCh,iRad)),pT2);               //Temperature out Rad
     }//radiators loop
   }//chambers loop
 }//SimMap()