Chambers occupancy stored in the ESDs, it has been packed with the reconstructed...
authorgvolpe <gvolpe@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Oct 2011 16:30:38 +0000 (16:30 +0000)
committergvolpe <gvolpe@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 10 Oct 2011 16:30:38 +0000 (16:30 +0000)
HMPID/AliHMPIDAnalysisTask.cxx
HMPID/AliHMPIDPid.cxx
HMPID/AliHMPIDQADataMaker.cxx
HMPID/AliHMPIDQADataMakerRec.cxx
HMPID/AliHMPIDRecon.cxx
HMPID/Hdisp.C

index 00f0d51..6db12c1 100644 (file)
@@ -311,26 +311,27 @@ void AliHMPIDAnalysisTask::UserExec(Option_t *)
     }
 
     if(track->GetHMPIDsignal() > 0 ){
+      Double_t thetaCkov = track->GetHMPIDsignal() - (Int_t)track->GetHMPIDsignal();
       if (pHmp3) fHmpPesdPhmp->Fill(track->P(),pHmp3);
       if (dist<=1.0) fHmpMipCharge1cm->Fill(q);
       fHmpNumPhots->Fill(nph);
-      fHmpCkovPesd->Fill(track->P(),track->GetHMPIDsignal());
-      if (pHmp3) fHmpCkovPhmp->Fill(pHmp3,track->GetHMPIDsignal());
+      fHmpCkovPesd->Fill(track->P(),thetaCkov);
+      if (pHmp3) fHmpCkovPhmp->Fill(pHmp3,thetaCkov);
 
       if (fUseMC && dist<distCut && TMath::Abs(th)<thetaCut){
         if (!pStack->IsPhysicalPrimary(label)) continue;
         Int_t pdgCode = TMath::Abs(pPart->GetPdgCode());
         if (pdgCode==211){
-          fThetapivsPesd->Fill(track->P(),track->GetHMPIDsignal());
+          fThetapivsPesd->Fill(track->P(),thetaCkov);
           Int_t mot=pPart->GetFirstMother();
           if (mot > -1){
             TParticle *pMot=pStack->Particle(mot);
             TString str=pMot->GetName();
-            if (str.Contains("K")) fThetavsPiFromK->Fill(pHmp3,track->GetHMPIDsignal());
+            if (str.Contains("K")) fThetavsPiFromK->Fill(pHmp3,thetaCkov);
           }
         }
-        if (pdgCode==321) fThetaKvsPesd->Fill(track->P(),track->GetHMPIDsignal());
-        if (pdgCode==2212) fThetaPvsPesd->Fill(track->P(),track->GetHMPIDsignal());
+        if (pdgCode==321) fThetaKvsPesd->Fill(track->P(),thetaCkov);
+        if (pdgCode==2212) fThetaPvsPesd->Fill(track->P(),thetaCkov);
 
         if (track->P()<1. || track->P()>5.) continue;
         Int_t pBin=(Int_t) (2*(track->P()-1));
@@ -371,7 +372,7 @@ void AliHMPIDAnalysisTask::UserExec(Option_t *)
     fVar[4] = ypc;
     fVar[5] = x;
     fVar[6] = y;
-    fVar[7] = (Float_t)track->GetHMPIDsignal();
+    fVar[7] = (Float_t)thetaCkov;
     fVar[8] = q;
     fVar[9] = th;
     fVar[10] = ph;
index aa558c0..bebe27e 100644 (file)
@@ -42,9 +42,12 @@ void AliHMPIDPid::FindPid(AliESDtrack *pTrk,Int_t nsp,Double_t *prob)
 // (i.e. apriory probability to be the particle of the given sort is the same for all sorts)
 
   AliPID *pPid = new AliPID();
-  Double_t thetaCerExp = pTrk->GetHMPIDsignal();                                                                           //  measured thetaCherenkov
   
-  if(thetaCerExp<=0){                                         //HMPID does not find anything reasonable for this track, assign 0.2 for all species
+  Double_t thetaCerExp = -999.;                                                                           
+  if(pTrk->GetHMPIDsignal()<=0) thetaCerExp = pTrk->GetHMPIDsignal();                                                                           
+  else                          thetaCerExp = pTrk->GetHMPIDsignal() - (Int_t)pTrk->GetHMPIDsignal();     //  measured thetaCherenkov
+  
+  if(thetaCerExp<=0){                                                                                     //HMPID does not find anything reasonable for this track, assign 0.2 for all species
     for(Int_t iPart=0;iPart<nsp;iPart++) prob[iPart]=1.0/(Float_t)nsp;
     delete pPid ; pPid=0x0; return;
   } 
index 6ac16a8..bf94349 100644 (file)
@@ -388,7 +388,10 @@ void AliHMPIDQADataMaker::MakeESDs(AliESDEvent * esd)
   //
   for(Int_t iTrk = 0 ; iTrk < esd->GetNumberOfTracks() ; iTrk++){
     AliESDtrack *pTrk = esd->GetTrack(iTrk) ;
-    FillESDsData(0,pTrk->GetP(),pTrk->GetHMPIDsignal());
+    Float_t thetaCkov = -999.;
+    if(pTrk->GetHMPIDsignal()<0.) thetaCkov = pTrk->GetHMPIDsignal();
+    else                          thetaCkov = pTrk->GetHMPIDsignal() - (Int_t)pTrk->GetHMPIDsignal();;
+    FillESDsData(0,pTrk->GetP(),thetaCkov);
     FillESDsData(1, pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
     Float_t xm,ym; Int_t q,np;  
     pTrk->GetHMPIDmip(xm,ym,q,np);                       //mip info
index ec03b4e..435d50e 100644 (file)
@@ -423,7 +423,10 @@ void AliHMPIDQADataMakerRec::MakeESDs(AliESDEvent * esd)
  
   for(Int_t iTrk = 0 ; iTrk < esd->GetNumberOfTracks() ; iTrk++){
     AliESDtrack *pTrk = esd->GetTrack(iTrk) ;
-    FillESDsData(0,pTrk->GetP(),pTrk->GetHMPIDsignal());
+    Float_t thetaCkov = -999.;
+    if(pTrk->GetHMPIDsignal()<0.) thetaCkov = pTrk->GetHMPIDsignal();
+    else                          thetaCkov = pTrk->GetHMPIDsignal() - (Int_t)pTrk->GetHMPIDsignal();;
+    FillESDsData(0,pTrk->GetP(),thetaCkov);
     FillESDsData(1, pTrk->GetP(),TMath::Sqrt(pTrk->GetHMPIDchi2()));
     Float_t xm,ym; Int_t q,np;  
     pTrk->GetHMPIDmip(xm,ym,q,np);                       //mip info
@@ -433,9 +436,9 @@ void AliHMPIDQADataMakerRec::MakeESDs(AliESDEvent * esd)
     Float_t yPc = yRad+9.25*TMath::Tan(th)*TMath::Sin(ph); // temporar:          "
     FillESDsData(2,xm-xPc,ym-yPc); //track info
     if(pTrk->GetHMPIDsignal()>0) {
-     Double_t a = 1.292*1.292*TMath::Cos(pTrk->GetHMPIDsignal())*TMath::Cos(pTrk->GetHMPIDsignal())-1.;
+     Double_t a = 1.292*1.292*TMath::Cos(thetaCkov)*TMath::Cos(thetaCkov)-1.;
      if(a > 0) {
-    Double_t mass = pTrk->P()*TMath::Sqrt(1.292*1.292*TMath::Cos(pTrk->GetHMPIDsignal())*TMath::Cos(pTrk->GetHMPIDsignal())-1.);
+    Double_t mass = pTrk->P()*TMath::Sqrt(1.292*1.292*TMath::Cos(thetaCkov)*TMath::Cos(thetaCkov)-1.);
     FillESDsData(3, pTrk->GetP(),mass);
      }
     }
index 52fd878..72336d9 100644 (file)
@@ -109,8 +109,11 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Int_t inde
   
   fPhotCnt=0;
   
+  Int_t nPads = 0;
+  
   for (Int_t iClu=0; iClu<pCluLst->GetEntriesFast();iClu++){//clusters loop
-    AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluLst->UncheckedAt(iClu);                       //get pointer to current cluster    
+    AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluLst->UncheckedAt(iClu);                       //get pointer to current cluster
+    nPads+=pClu->Size();    
     if(iClu == index) {                                                                       // this is the MIP! not a photon candidate: just store mip info
       mipX = pClu->X();
       mipY = pClu->Y();
@@ -150,10 +153,12 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Int_t inde
     return;
   }
   
+  Int_t occupancy = (Int_t)(1000*(nPads/(6.*80.*48.))); 
+  
   Double_t thetaC = FindRingCkov(pCluLst->GetEntries());                                    //find the best reconstructed theta Cherenkov
 //    FindRingGeom(thetaC,2);
-  pTrk->SetHMPIDsignal(thetaC);                                                             //store theta Cherenkov
-  pTrk->SetHMPIDchi2(fCkovSigma2);                                                          //store errors squared
+  pTrk->SetHMPIDsignal(thetaC+occupancy);                                                             //store theta Cherenkov
+  pTrk->SetHMPIDchi2(fCkovSigma2);                                                              //store errors squared
   
   DeleteVars();
 }//CkovAngle()
index c706ba6..a7ec8e8 100644 (file)
@@ -200,8 +200,11 @@ void PrintEsd()
     idx = word%1000;
     Double_t rout[3]; pTrk->GetOuterXYZ(rout);
     vol = gGeoManager->FindNode(rout[0],rout[1],rout[2]);
+    Float_t thetaCkov = -999.;
+    if(pTrk->GetHMPIDsignal()<0) thetaCkov = pTrk->GetHMPIDsignal();
+    else                         thetaCkov = pTrk->GetHMPIDsignal() - (Int_t)pTrk->GetHMPIDsignal();
     Printf("Trk %02i Ch.%2i (%5.2f,%5.2f) pOut %7.2f ThCer %7.3f phots %3i QMip %4i size %2i (idx %3i) in vol. %s",iTrk,ch,
-        xra,yra,pMomOut,pTrk->GetHMPIDsignal(),nacc,q,size,idx,vol->GetName());
+        xra,yra,pMomOut,thetaCkov,nacc,q,size,idx,vol->GetName());
   }  
 }//PrintEsd()
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -380,10 +383,11 @@ void RenderEsd(AliESDEvent *pEsd)
     Int_t npTrk = fRenTxC[ch]->SetNextPoint(xRa,yRa);                           //add this intersection point
     Float_t ckov=pTrk->GetHMPIDsignal();                                        //get ckov angle stored for this track  
     if(ckov>0){
+      Float_t thetaCkov = pTrk->GetHMPIDsignal() - (Int_t)pTrk->GetHMPIDsignal();
       rec.SetTrack(xRa,yRa,thRa,phRa);
       fRenRin[ch]->SetUniqueID(npTrk);
       for(Int_t j=0;j<500;j++){
-        TVector2 pos; pos=rec.TracePhot(ckov,j*6.28/500.);
+        TVector2 pos; pos=rec.TracePhot(thetaCkov,j*6.28/500.);
        if(!AliHMPIDParam::IsInDead(pos.X(),pos.Y())) fRenRin[ch]->SetNextPoint(pos.X(),pos.Y());
       }      
     }//if ckov is valid
@@ -582,9 +586,10 @@ void DisplayInfo(Int_t evt,Int_t px, Int_t py)
     Double_t prob[5];
     pTrk->GetHMPIDpid(prob);
     if(ckov>0){
+      Float_t thetaCkov = pTrk->GetHMPIDsignal() - (Int_t)pTrk->GetHMPIDsignal();
       Float_t x,y;Int_t q,nacc;   pTrk->GetHMPIDmip(x,y,q,nacc);
       text3="";text3.Append(Form("Theta Cherenkov %5.3f with %i photons |  e %5.1f%% | u %5.1f%% | pi %5.1f%% | K %5.1f%% | p %5.1f%%",
-          pTrk->GetHMPIDsignal(),nacc,prob[0]*100,prob[1]*100,prob[2]*100,prob[3]*100,prob[4]*100));
+          thetaCkov,nacc,prob[0]*100,prob[1]*100,prob[2]*100,prob[3]*100,prob[4]*100));
     }      
   }
 //Update toolbar status