Calib data usage reactivated for Nmean, thres is still not active
authorkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Mar 2007 19:55:35 +0000 (19:55 +0000)
committerkir <kir@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 7 Mar 2007 19:55:35 +0000 (19:55 +0000)
HMPID/AliHMPIDPreprocessor.cxx
HMPID/AliHMPIDPreprocessor.h
HMPID/AliHMPIDRecon.cxx
HMPID/AliHMPIDRecon.h
HMPID/AliHMPIDTracker.cxx
HMPID/AliHMPIDTracker.h
HMPID/Calib/Nmean/Run0_0_v0_s0.root [new file with mode: 0644]
HMPID/Calib/Qthre/Run0_0_v0_s0.root [new file with mode: 0644]
HMPID/Hshuttle.C

index 6198ce6..9a0fb3f 100644 (file)
@@ -2,29 +2,35 @@
 
 #include <AliCDBMetaData.h>
 #include <AliDCSValue.h>      
-#include <TObjArray.h>        //Test()
-#include <TObjString.h>       //Test()
-#include <AliCDBManager.h>    //Test()
-#include <AliCDBEntry.h>      //Test()
-//#include <AliTestShuttle.h>   //Test()
-#include <TRandom.h>          //Test()
 #include <TF1.h>              //Process()
 #include <TF2.h>              //Process()
 #include <TGraph.h>           //Process()
+#include <AliLog.h>           //Process() 
 
 ClassImp(AliHMPIDPreprocessor)
 
+char *AliHMPIDPreprocessor::fP ="HMP_DET/HMP_MP%i/HMP_MP%i_GAS/HMP_MP%i_GAS_PMWC.actual.value";
+char *AliHMPIDPreprocessor::fT1="HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp";
+char *AliHMPIDPreprocessor::fT2="HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iOut_Temp";
+char *AliHMPIDPreprocessor::fHV="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)
 {
   AliPreprocessor::Initialize(run, startTime, endTime);
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-UInt_t AliHMPIDPreprocessor::Process(TMap* pDcsMap)
+UInt_t AliHMPIDPreprocessor::Process(TMap* pMap)
 {
-// 
-// Argumets: pDcsMap - map of structure "alias name" - TObjArray of AliDCSValue
-   
+// 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     
+     
 //  TList* list = GetFileSources(kDAQ, "MAP"); //first analyse a set of pedestal files
 //  if (list){
 //    Log("The following sources produced files with the id MAP");
@@ -32,43 +38,57 @@ UInt_t AliHMPIDPreprocessor::Process(TMap* pDcsMap)
 //    delete list;
 //  }
 
-  if(!pDcsMap)  return 0;                    //no DCS map provided 
+  if(!pMap)  return 0;                    //no DCS map provided 
+  Double_t sor=0,eor=1500;
 
-  TF2 idxC6F14("RidxC4F14","sqrt(1+0.554*(1239.84/x)^2/((1239.84/x)^2-5796)-0.0005*(y-20))",5.5,8.5,0,50); //DiMauro mail temp 0-50 degrees C
-  Double_t eMean=6.67786;                                                                                  //mean energy of photon defined  by transperancy window
+  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 radTemp; radTemp.SetOwner(kTRUE);      //store temp versus time as TF1 array for all radiators (21)
-  TObjArray meanIdx; meanIdx.SetOwner(kTRUE);      //store ref idx versus time as TF1 array for all radiators (21)
-    
+//  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
   
-  for(Int_t iCh=0;iCh<7;iCh++){                             //aliases loop
+//  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    
+
+//    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);    
     for(Int_t iRad=0;iRad<3;iRad++){
-      TObjArray *pValLst=(TObjArray*)pDcsMap->GetValue(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp",iCh,iCh,iRad));//get data points for this alias
-      if(!pValLst) continue;                                                                                                                //no data points 
-      TF1    *pRadTempF=new TF1(Form("RadTemp%i%i",iCh,iRad),"[0]+[1]*x+[2]*sin([3]*x)",0,10); pRadTempF->SetLineColor(iRad+2);             //temp=f(time) 
-      TF1    *pMeanIdxF=new TF1(Form("MeanIdx%i%i",iCh,iRad),"[0]+[1]*x+[2]*sin([3]*x)",0,10); pMeanIdxF->SetLineColor(iRad+2);             //idx=f(time) 
-      TGraph *pRadTempG=new TGraph;                                                                    //tmp graph of rad temp versus time 
-      TGraph *pMeanIdxG=new TGraph;                                                                    //tmp graph of mean ref idx versus time 
-      TIter next(pValLst);  AliDCSValue *pDcsVal; Int_t i=0;
-      while((pDcsVal=(AliDCSValue*)next())){                                                           //loop over data points for this sensor 
-        pRadTempG->SetPoint(i,pDcsVal->GetTimeStamp(),                    pDcsVal->GetFloat());        //and fill the temp graph
-        pMeanIdxG->SetPoint(i,pDcsVal->GetTimeStamp(),idxC6F14.Eval(eMean,pDcsVal->GetFloat()));       //and fill the maen ref idx graph
-        i++;
-      }
-      pRadTempG->Fit(pRadTempF,"Q");                                                                   //now fit the temp graph 
-      pMeanIdxG->Fit(pMeanIdxF,"Q");                                                                   //now fit the mean idx  graph 
-      delete pRadTempG; 
-      delete pMeanIdxG;
-      radTemp.Add(pRadTempF);
-      meanIdx.Add(pMeanIdxF);
+//      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 
+      
+//      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;
     }//radiators loop
   }//chambers loop
   
   AliCDBMetaData metaData; metaData.SetBeamPeriod(0); metaData.SetResponsible("AliHMPIDPreprocessor"); metaData.SetComment("SIMULATED");
 
-  Store("DCS", "RadTemp" , &radTemp , &metaData); //use AliPreprocessor::Store(), not allowed to use AliCDBManager directly
-  Store("DCS", "MeanIdx" , &meanIdx , &metaData); 
   
+  arQthre.Print();
+//  Store("Calib", "Press" , &arPress , &metaData); 
+//  Store("Calib", "Tmean" , &arTmean , &metaData); 
+  Store("Calib", "Qthre" , &arQthre , &metaData); 
+  Store("Calib", "Nmean" , &arNmean , &metaData); 
+  AliInfo("End.");  
   return 1;
 
 }//Process()
index a795255..9ef3cb1 100644 (file)
@@ -10,6 +10,10 @@ class AliHMPIDPreprocessor : public AliPreprocessor
 public:
            AliHMPIDPreprocessor(AliShuttleInterface* pShuttle):AliPreprocessor("HMP",pShuttle) {}
   virtual ~AliHMPIDPreprocessor(                             )                                 {}
+  static char    *fP;     // Name of the aliases provided by the DCS
+  static char    *fHV;     // Name of the aliases provided by the DCS
+  static char    *fT1; // Name of the aliases provided by the DCS
+  static char    *fT2; // Name of the aliases provided by the DCS
 protected:
   virtual void   Initialize(Int_t run, UInt_t startTime, UInt_t endTime);
   virtual UInt_t Process   (TMap* pDcsMap                              );
index 865dd8c..804bb8e 100644 (file)
 const Double_t AliHMPIDRecon::fgkRadThick=1.5;
 const Double_t AliHMPIDRecon::fgkWinThick=0.5;
 const Double_t AliHMPIDRecon::fgkGapThick=8.0;
-const Double_t AliHMPIDRecon::fgkRadIdx  =1.292;
 const Double_t AliHMPIDRecon::fgkWinIdx  =1.5787;
 const Double_t AliHMPIDRecon::fgkGapIdx  =1.0005;
 
 
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 AliHMPIDRecon::AliHMPIDRecon():TTask("RichRec","RichPat"),
+  fRadNmean(1.292),  
   fPhotCnt(-1),
   fCkovSigma2(0),
   fIsWEIGHT(kFALSE),
@@ -54,7 +54,7 @@ AliHMPIDRecon::AliHMPIDRecon():TTask("RichRec","RichPat"),
   }
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst)
+void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean)
 {
 // Pattern recognition method based on Hough transform
 // Arguments:   pTrk     - track for which Ckov angle is to be found
@@ -66,6 +66,7 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst)
 
   // Photon Flag:  Flag = 0 initial set; Flag = 1 good candidate (charge compatible with photon); Flag = 2 photon used for the ring;
   Float_t xPc,yPc,th,ph;      pTrk->GetHMPIDtrk(xPc,yPc,th,ph);  SetTrack(xPc,yPc,th,ph); //initialize this track            
+  fRadNmean=nmean;
 
   
   
@@ -214,10 +215,10 @@ Double_t AliHMPIDRecon::TracePhot(Double_t ckovThe,Double_t ckovPhi,TVector2 &po
   TVector3  dirCkov;   dirCkov.SetMagThetaPhi(1,ckovThe,ckovPhi);                        //initially photon is directed according to requested ckov angle
                                                dirCkov=mrot*dirCkov;                     //now we know photon direction in LORS
                        dirCkov.SetPhi(ckovPhi);   
-  if(dirCkov.Theta() > TMath::ASin(1./fgkRadIdx)) return -999;//total refraction on WIN-GAP boundary
+  if(dirCkov.Theta() > TMath::ASin(1./fRadNmean)) return -999;//total refraction on WIN-GAP boundary
   
   Propagate(dirCkov,posCkov,-fgkWinThick-fgkGapThick); //go to RAD-WIN boundary  remeber that z=0 is PC plane
-  Refract  (dirCkov,         fgkRadIdx,fgkWinIdx    ); //RAD-WIN refraction
+  Refract  (dirCkov,         fRadNmean,fgkWinIdx    ); //RAD-WIN refraction
   Propagate(dirCkov,posCkov,-fgkGapThick           );  //go to WIN-GAP boundary
   Refract  (dirCkov,         fgkWinIdx,fgkGapIdx    ); //WIN-GAP refraction
   Propagate(dirCkov,posCkov,0                     );   //go to PC
@@ -309,7 +310,7 @@ Double_t AliHMPIDRecon::Sigma2(Double_t ckovTh, Double_t ckovPh)const
 //   Returns: absolute error on Cerenkov angle, [radians]    
   
   TVector3 v(-999,-999,-999);
-  Double_t trkBeta = 1./(TMath::Cos(ckovTh)*fgkRadIdx);
+  Double_t trkBeta = 1./(TMath::Cos(ckovTh)*fRadNmean);
 
   v.SetX(SigLoc (ckovTh,ckovPh,trkBeta));
   v.SetY(SigGeom(ckovTh,ckovPh,trkBeta));
@@ -329,7 +330,7 @@ Double_t AliHMPIDRecon::SigLoc(Double_t thetaC, Double_t phiC,Double_t betaM)con
   Double_t phiDelta = phiC - fTrkDir.Phi();
 
   Double_t alpha =TMath::Cos(fTrkDir.Theta())-TMath::Tan(thetaC)*TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Theta());
-  Double_t k = 1.-fgkRadIdx*fgkRadIdx+alpha*alpha/(betaM*betaM);
+  Double_t k = 1.-fRadNmean*fRadNmean+alpha*alpha/(betaM*betaM);
   if (k<0) return 1e10;
 
   Double_t mu =TMath::Sin(fTrkDir.Theta())*TMath::Sin(fTrkDir.Phi())+TMath::Tan(thetaC)*(TMath::Cos(fTrkDir.Theta())*TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Phi())+TMath::Sin(phiDelta)*TMath::Cos(fTrkDir.Phi()));
@@ -353,7 +354,7 @@ Double_t AliHMPIDRecon::SigCrom(Double_t thetaC, Double_t phiC,Double_t betaM)co
   Double_t phiDelta = phiC - fTrkDir.Phi();
   Double_t alpha =TMath::Cos(fTrkDir.Theta())-TMath::Tan(thetaC)*TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Theta());
 
-  Double_t dtdn = TMath::Cos(fTrkDir.Theta())*fgkRadIdx*betaM*betaM/(alpha*TMath::Tan(thetaC));
+  Double_t dtdn = TMath::Cos(fTrkDir.Theta())*fRadNmean*betaM*betaM/(alpha*TMath::Tan(thetaC));
             
   Double_t f = 0.00928*(7.75-5.635)/TMath::Sqrt(12.);
 
@@ -372,7 +373,7 @@ Double_t AliHMPIDRecon::SigGeom(Double_t thetaC, Double_t phiC,Double_t betaM)co
   Double_t phiDelta = phiC - fTrkDir.Phi();
   Double_t alpha =TMath::Cos(fTrkDir.Theta())-TMath::Tan(thetaC)*TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Theta());
 
-  Double_t k = 1.-fgkRadIdx*fgkRadIdx+alpha*alpha/(betaM*betaM);
+  Double_t k = 1.-fRadNmean*fRadNmean+alpha*alpha/(betaM*betaM);
   if (k<0) return 1e10;
 
   Double_t eTr = 0.5*1.5*betaM*TMath::Sqrt(k)/(8*alpha);
index 67eef64..74bb5ed 100644 (file)
@@ -26,7 +26,7 @@ public :
     virtual ~AliHMPIDRecon()                                                          {}
 
   
-  void     CkovAngle    (AliESDtrack *pTrk,TClonesArray *pCluLst                            );                           //reconstructed Theta Cerenkov
+  void     CkovAngle    (AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean             );                           //reconstructed Theta Cerenkov
   Double_t FindPhotCkov (Double_t cluX,Double_t cluY                                        );     //find ckov angle for single photon candidate
   Double_t FindPhotPhi  (Double_t cluX,Double_t cluY                                        );     //find phi angle for single photon candidate
   Double_t FindRingCkov (Int_t iNclus                                                       );     //best ckov for ring formed by found photon candidates
@@ -46,9 +46,9 @@ protected:
   static const Double_t fgkRadThick;                      //radiator thickness
   static const Double_t fgkWinThick;                      //window thickness
   static const Double_t fgkGapThick;                      //proximity gap thickness
-  static const Double_t fgkRadIdx;                        //mean refractive index of RAD material (C6F14)
   static const Double_t fgkWinIdx;                        //mean refractive index of WIN material (SiO2) 
   static const Double_t fgkGapIdx;                        //mean refractive index of GAP material (CH4)
+  Double_t fRadNmean;                          //C6F14 mean refractive index
   Int_t    fPhotCnt;                           // counter of photons candidate
   Int_t    fPhotFlag[3000];                    // flags of photon candidates
   Double_t fPhotCkov[3000];                    // Ckov angles of photon candidates, [rad]
index 1b3e4f5..ca3ca5e 100644 (file)
@@ -6,7 +6,11 @@
 #include <AliRun.h>              //GetTrackPoint(),PropagateBack()  
 #include <AliTrackPointArray.h>  //GetTrackPoint()
 #include <AliAlignObj.h>         //GetTrackPoint()
+#include <AliCDBManager.h>
+#include <AliCDBEntry.h>
+
 ClassImp(AliHMPIDTracker)
+
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++    
 Bool_t AliHMPIDTracker::GetTrackPoint(Int_t idx, AliTrackPoint& point) const
 {
@@ -35,20 +39,36 @@ Int_t AliHMPIDTracker::LoadClusters(TTree *pCluTree)
   AliDebug(1,"Start.");  pCluTree->GetEntry(0);  AliDebug(1,"Stop."); return 0;
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDTracker::Recon(AliESD *pESD,TObjArray *pCluAll)
+Int_t AliHMPIDTracker::PropagateBack(AliESD *pEsd)
+{
+// This method defined as pure virtual in AliTracker. It is invoked from AliReconstruction::RunTracking() after invocation of AliTracker::LoadClusters()
+// Agruments: pEsd - pointer to ESD
+//   Returns: error code    
+  AliCDBEntry *pNmeanEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Nmean",pEsd->GetRunNumber()); //contains TObjArray of 21 TF1
+  AliCDBEntry *pQthreEnt =AliCDBManager::Instance()->Get("HMPID/Calib/Qthes",pEsd->GetRunNumber()); //contains TObjArray of 7 TF1
+  if(!pNmeanEnt) AliFatal("No Nmean C6F14 ");
+  if(!pQthreEnt) AliFatal("No Qthre");
+  
+  AliHMPID *pHmpid=((AliHMPID*)gAlice->GetDetector("HMPID"));  
+  return Recon(pEsd,pHmpid->CluLst(),(TObjArray*)pNmeanEnt->GetObject());  
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+Int_t AliHMPIDTracker::Recon(AliESD *pEsd,TObjArray *pCluAll,TObjArray *pNmean)
 {
 // Interface callback methode invoked by AliRecontruction::RunTracking() during tracking after TOF. It's done just once per event
-// Arguments: pESD - pointer to Event Summary Data class instance which contains a list of tracks
+// Arguments: pEsd - pointer to Event Summary Data class instance which contains a list of tracks
 //   Returns: error code, 0 if no errors   
-  Int_t iNtracks=pESD->GetNumberOfTracks();  AliDebugClass(1,Form("Start with %i tracks",iNtracks));
+  Int_t iNtracks=pEsd->GetNumberOfTracks();  AliDebugClass(1,Form("Start with %i tracks",iNtracks));
+  
   
-  AliHMPIDRecon recon;                                                                           //instance of reconstruction class, nothing important in ctor
+  AliHMPIDRecon recon;                                                                       //instance of reconstruction class, nothing important in ctor
   Float_t xRa,yRa;
   for(Int_t iTrk=0;iTrk<iNtracks;iTrk++){                                                        //ESD tracks loop
-    AliESDtrack *pTrk = pESD->GetTrack(iTrk);                                                    //get next reconstructed track    
+    AliESDtrack *pTrk = pEsd->GetTrack(iTrk);                                                    //get next reconstructed track    
     Int_t cham=IntTrkCha(pTrk,xRa,yRa);                                                          //get chamber intersected by thie track 
     if(cham<0) continue;                                                                         //no intersection at all, go after next track
-    recon.CkovAngle(pTrk,(TClonesArray *)pCluAll->At(cham));                                     //search for Cerenkov angle for this track
+    Double_t nmean=((TF1*)pNmean->At(3*cham))->Eval(pEsd->GetTimeStamp());                       //C6F14 Nmean for this chamber   
+    recon.CkovAngle(pTrk,(TClonesArray *)pCluAll->At(cham),nmean);                               //search for Cerenkov angle for this track
   }                                                                                              //ESD tracks loop
   AliDebugClass(1,"Stop pattern recognition");
   return 0; // error code: 0=no error;
index d1bf4f3..e83959f 100644 (file)
@@ -4,38 +4,29 @@
 #include <AliTracker.h> //base class
 #include "AliHMPID.h"   //Recon()
 #include <AliRun.h>     //Recon()
-
+#include <TF1.h>        //field 
 class AliESD;      //Recon()     
 class AliESDtrack; //IntTrkCha()
 class AliHMPIDTracker : public AliTracker
 {
 public:
-           AliHMPIDTracker():AliTracker()                               {} 
+           AliHMPIDTracker():AliTracker()                               {}
   virtual ~AliHMPIDTracker()                                            {}
 //framework part  
          AliCluster *GetCluster     (Int_t                      )const  {return 0;} //pure virtual from AliTracker 
          Bool_t      GetTrackPoint  (Int_t idx,AliTrackPoint &pt)const;             //             from AliTracker  
          Int_t       Clusters2Tracks(AliESD *                   )       {return 0;} //pure virtual from AliTracker 
          Int_t       LoadClusters   (TTree *pCluTr              );                  //pure virtual from AliTracker   
-  inline Int_t       PropagateBack  (AliESD *                   );                  //pure virtual from AliTracker   
+         Int_t       PropagateBack  (AliESD *                   );                  //pure virtual from AliTracker   
          Int_t       RefitInward    (AliESD *                   )       {return 0;} //pure virtual from AliTracker 
          void        UnloadClusters (                           )       {         } //pure virtual from AliTracker 
 //private part  
   static Int_t       IntTrkCha(AliESDtrack *pTrk,Float_t &x,Float_t &y);                    //find track-chamber intersection, retuns chamber ID
-  static Int_t       Recon    (AliESD *pEsd,TObjArray *pCluAll        );                    //do actual job, returns status code  
+  static Int_t       Recon    (AliESD *pEsd,TObjArray *pCluAll,TObjArray *pNmean=0);        //do actual job, returns status code  
 protected:
   ClassDef(AliHMPIDTracker,0)
 };//class AliHMPIDTracker
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDTracker::PropagateBack(AliESD *pEsd)
-{
-// This method defined as pure virtual in AliTracker. It is invoked from AliReconstruction::RunTracking() after invocation of AliTracker::LoadClusters()
-// Agruments: pEsd - pointer to ESD
-//   Returns: error code    
-  AliHMPID *pHmpid=((AliHMPID*)gAlice->GetDetector("HMPID"));  
-  return Recon(pEsd,pHmpid->CluLst());  
-}
-
 
 
 typedef AliHMPIDTracker AliRICHTracker; // for backward compatibility
diff --git a/HMPID/Calib/Nmean/Run0_0_v0_s0.root b/HMPID/Calib/Nmean/Run0_0_v0_s0.root
new file mode 100644 (file)
index 0000000..6b4893a
Binary files /dev/null and b/HMPID/Calib/Nmean/Run0_0_v0_s0.root differ
diff --git a/HMPID/Calib/Qthre/Run0_0_v0_s0.root b/HMPID/Calib/Qthre/Run0_0_v0_s0.root
new file mode 100644 (file)
index 0000000..8d3b68e
Binary files /dev/null and b/HMPID/Calib/Qthre/Run0_0_v0_s0.root differ
index ea20715..fdd3ced 100644 (file)
-void Hshuttle()
+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    
-  TMultiGraph *pMG[7]; for(Int_t i=0;i<7;i++) {pMG[i]=new TMultiGraph; pMG[i]->SetTitle("T,grad C;time");}
-  TGraph      *pGr[21];for(Int_t i=0;i<21;i++){pGr[i]=new TGraph;      pGr[i]->SetMarkerStyle(i%3+24); pGr[i]->SetMarkerColor(i%3+2); pMG[i/3]->Add(pGr[i]);}    
+// 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   
+  gSystem->Load("libTestShuttle.so");
+  
+  AliTestShuttle::SetMainCDB(TString("local://$HOME"));
+  
   TMap        *pDcsMap = new TMap;       pDcsMap->SetOwner(1);          //DCS archive map
+
+  SimMap(pDcsMap,runTime);
+  TestShuttle(pDcsMap);  
+  TCanvas *c=new TCanvas("cc","ff",600,600);  
+  DrawInput(c,pDcsMap);
+  DrawOutput();
+}//Hshuttle()
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void SimMap(TMap *pDcsMap,Int_t runTime=1500)
+{
+  Int_t stepTime=100; //time interval between mesuraments
+  Int_t startTime=0;
+  
   
   for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
+    TObjArray *pP=new TObjArray;  pP->SetOwner(1);
+    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::fP,iCh,iCh,iCh)),pP); 
+    pDcsMap->Add(new TObjString(Form(AliHMPIDPreprocessor::fHV,iCh,iCh,iCh)),pHV); 
+        
     for(Int_t iRad=0;iRad<3;iRad++){//radiators loop
-      TObjArray* pValLst  = new TObjArray;  pValLst->SetOwner(1);                
-      Int_t iPoint=0;
-      for (Int_t time=0;time<1000;time+=50) {
-        AliDCSValue*    pVal = new AliDCSValue(Float_t(iCh*3+iRad+0.1*gRandom->Gaus()), time);         //sample new data point 
-        pValLst->Add(pVal);                                                                            //add it to the list
-        pGr[3*iCh+iRad]->SetPoint(iPoint++,time,pVal->GetFloat());                                     //and also to the graph  
-      }
-      pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iIn_Temp",iCh,iCh,iRad)),pValLst); 
-      pDcsMap->Add(new TObjString(Form("HMP_DET/HMP_MP%i/HMP_MP%i_LIQ_LOOP.actual.sensors.Rad%iOut_Temp",iCh,iCh,iRad)),pValLst);
-    }//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::fT1,iCh,iCh,iRad)) ,pT1); 
+      pDcsMap->Add(new TObjString(Form(AliHMPIDPreprocessor::fT2,iCh,iCh,iRad)),pT2);
+    }//radiators loop    
   }//chambers loop
-  
-  AliTestShuttle::SetOCDBStorage("local://$HOME/tstCDB");  
-  AliCDBManager::Instance()->SetDefaultStorage("local://$HOME/tstCDB"); // initialize location of CDB
-      
-  gSystem->Load("libTestShuttle.so"); 
-  Int_t iRun=1;   
-  AliTestShuttle* pShuttle = new AliTestShuttle(iRun,0,100000);   
+}//SimMap()
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void TestShuttle(TMap *pDcsMap)
+{
+  AliTestShuttle* pShuttle = new AliTestShuttle(0,0,1000000);   
   pShuttle->SetDCSInput(pDcsMap);                                                    //DCS map
   AliPreprocessor* pp = new AliHMPIDPreprocessor(pShuttle);                           //actual ipreprocessor is created here
   pShuttle->Process();                                                               //run SHUTTLE simulator
   delete pp;
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+void DrawInput(TCanvas *c,TMap *pDcsMap)
+{
+  c->Divide(3,3);
   
+  AliDCSValue *pVal; Int_t cnt=0;
+  
+  for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
+    if(iCh==6) c->cd(1);  if(iCh==5) c->cd(2);                          
+    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::fHV,iCh,iCh,iCh,iCh)); //HV
+    TObjArray *pP =(TObjArray*)pDcsMap->GetValue(Form(AliHMPIDPreprocessor::fP,iCh,iCh,iCh)); //P
+    TGraph *pGr=new TGraph; pGr->SetMarkerStyle(5);
     
-  AliCDBEntry *pTempEn=AliCDBManager::Instance()->Get("HMPID/DCS/RadTemp",iRun);
-  if(!pTempEn) {Printf("ERROR file is not retrieved!!!");return;}
+    TIter nextp(pP); cnt=0; while((pVal=(AliDCSValue*)nextp())){ pGr->SetPoint(cnt++,pVal->GetTimeStamp(),pVal->GetFloat());}//P
 
-  TObjArray *pTempLst=(TObjArray*)pTempEn->GetObject(); TF1 *pRad0,*pRad1,*pRad2;  
-  TCanvas *pC=new TCanvas; pC->Divide(3,3);
-  for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
-    if(iCh==6) pC->cd(1);  if(iCh==5) pC->cd(2);                          //this is just to see the input
-    if(iCh==4) pC->cd(4);  if(iCh==3) pC->cd(5);  if(iCh==2) pC->cd(6);
-                           if(iCh==1) pC->cd(8);  if(iCh==0) pC->cd(9); 
-    pMG[iCh]->Draw("ap"); pMG[iCh]->GetXaxis()->SetTimeDisplay(kTRUE);
-    pRad0=(TF1*)pTempLst->At(iCh*3+0); pRad0->Draw("same");
-    pRad1=(TF1*)pTempLst->At(iCh*3+1); pRad1->Draw("same");
-    pRad2=(TF1*)pTempLst->At(iCh*3+2); pRad2->Draw("same");
+    
+    pGr->Draw("AP");
   }  
+}
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+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);
+  
+  if(!pQthreEnt || ! pNmeanEnt) return;
+  
+  TObjArray *pNmean=(TObjArray*)pNmeanEnt->GetObject(); 
+  TObjArray *pQthre=(TObjArray*)pQthreEnt->GetObject(); 
+  
+  TF1 *pRad0,*pRad1,*pRad2;  
+  TCanvas *c2=new TCanvas("c2","Nmean"); c2->Divide(3,3);
+  
   
-  AliCDBEntry *pIdxEn=AliCDBManager::Instance()->Get("HMPID/DCS/MeanIdx",iRun);
-  if(!pIdxEn) {Printf("ERROR file is not retrieved!!!");return;}
-
-  TObjArray *pIdxLst=(TObjArray*)pIdxEn->GetObject(); TF1 *pRad0,*pRad1,*pRad2;  
-  TCanvas *pC=new TCanvas("c2","Ref Idx"); pC->Divide(3,3);
   for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
-    if(iCh==6) pC->cd(1);  if(iCh==5) pC->cd(2);                          //this is just to see the input
-    if(iCh==4) pC->cd(4);  if(iCh==3) pC->cd(5);  if(iCh==2) pC->cd(6);
-                           if(iCh==1) pC->cd(8);  if(iCh==0) pC->cd(9); 
-    pRad0=(TF1*)pIdxLst->At(iCh*3+0); pRad0->Draw();  pRad0->GetXaxis()->SetTimeDisplay(kTRUE); pRad0->GetYaxis()->SetRangeUser(1.28,1.3);
-    pRad1=(TF1*)pIdxLst->At(iCh*3+1); pRad1->Draw("same");
-    pRad2=(TF1*)pIdxLst->At(iCh*3+2); pRad2->Draw("same");
-  }    
-}//Hshuttle()
+    if(iCh==6) c2->cd(1);  if(iCh==5) c2->cd(2);                          
+    if(iCh==4) c2->cd(4);  if(iCh==3) c2->cd(5);  if(iCh==2) c2->cd(6);
+                           if(iCh==1) c2->cd(8);  if(iCh==0) c2->cd(9); 
+                          
+    TF1 *pRad0=(TF1*)pNmean->At(iCh*3+0); pRad0->Draw();  pRad0->GetXaxis()->SetTimeDisplay(kTRUE); pRad0->GetYaxis()->SetRangeUser(1.28,1.3);
+    TF1 *pRad1=(TF1*)pNmean->At(iCh*3+1); pRad1->Draw("same");
+    TF1 *pRad2=(TF1*)pNmean->At(iCh*3+2); pRad2->Draw("same");
+  }//chambers loop  
+}