]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - HMPID/AliHMPIDRecon.cxx
Fields for HMPID in the ESD filled in an optimized way+minors
[u/mrichter/AliRoot.git] / HMPID / AliHMPIDRecon.cxx
index 0f3257c5fe29372c6d34b284311f48d40ef7f96b..56b1549b5ceb620d3cab32ddd8e6adedb3eb2e5c 100644 (file)
 #include <TClonesArray.h>    //CkovAngle()
 #include <AliESDtrack.h>     //CkovAngle()
 
+  Int_t     fPhotCnt;                           // counter of photons candidate
+  Int_t    *fPhotFlag;                          // flags of photon candidates
+  Double_t *fPhotCkov;                          // Ckov angles of photon candidates, [rad]
+  Double_t *fPhotPhi;                           // phis of photons candidates, [rad]
+  Double_t *fPhotWei;                           // weigths of photon candidates
+  Double_t  fCkovSigma2;                        // sigma2 of the reconstructed ring
+
+  Bool_t    fIsWEIGHT;                          // flag to consider weight procedure
+  Float_t   fDTheta;                            // Step for sliding window
+  Float_t   fWindowWidth;                       // Hough width of sliding window
+  
+  Double_t  fRingArea;                          // area of a given ring
+  Double_t  fRingAcc;                           // fraction of the ring accepted by geometry
+  TVector3  fTrkDir;                            // track direction in LORS at RAD
+  TVector2  fTrkPos;                            // track positon in LORS at RAD
+  TVector2  fMipPos;                            // mip positon for a given track
+  TVector2  fPc;                                // track position at PC
+  
+  AliHMPIDParam *fParam;                        // Pointer to AliHMPIDParam
+
+
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-AliHMPIDRecon::AliHMPIDRecon():TTask("RichRec","RichPat")
+AliHMPIDRecon::AliHMPIDRecon():
+  TTask("RichRec","RichPat"),
+  fPhotCnt(-1),
+  fPhotFlag(0x0),
+  fPhotCkov(0x0),
+  fPhotPhi(0x0),
+  fPhotWei(0x0),
+  fCkovSigma2(0),
+  fIsWEIGHT(kFALSE),
+  fDTheta(0.001),
+  fWindowWidth(0.045),
+  fRingArea(0),
+  fRingAcc(0),
+  fTrkDir(0,0,1),  // Just for test
+  fTrkPos(30,40),  // Just for test
+  fMipPos(0,0),
+  fPc(0,0),
+  fParam(AliHMPIDParam::Instance())
 {
 //..
 //init of data members
 //..
   
-  fPhotCnt  = -1;
-  fPhotFlag = 0x0;
-  fPhotCkov = 0x0;
-  fPhotPhi  = 0x0;
-  fPhotWei  = 0x0;
-  fCkovSigma2 = 0;
-  fIsWEIGHT = kFALSE;
-  fDTheta   = 0.001;
-  fWindowWidth = 0.045;
-  fTrkDir = TVector3(0,0,1); // init just for test
-  fTrkPos = TVector2(30,40); // init just for test
-  
-  AliHMPIDParam *pParam=AliHMPIDParam::Instance();
-  fParam = pParam;
-  
   fParam->SetRefIdx(fParam->MeanIdxRad()); // initialization of ref index to a default one
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
@@ -66,7 +89,7 @@ void AliHMPIDRecon::InitVars(Int_t n)
 //
 }
 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDRecon::DeleteVars()
+void AliHMPIDRecon::DeleteVars()const
 {
 //..
 //Delete variables
@@ -84,6 +107,10 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t n
 //              pCluLst  - list of clusters for this chamber   
 //   Returns:            - track ckov angle, [rad], 
     
+
+  const Int_t nMinPhotAcc = 3;                      // Minimum number of photons required to perform the pattern recognition
+  
+  
   Int_t nClusTot = pCluLst->GetEntries();
   if(nClusTot>fParam->MultCut()) fIsWEIGHT = kTRUE; // offset to take into account bkg in reconstruction
   else                           fIsWEIGHT = kFALSE;
@@ -114,23 +141,38 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t n
       }
     }
   }//clusters loop
+  
+  if(fPhotCnt<=nMinPhotAcc) {                                                                 //no reconstruction with <=3 photon candidates
+    pTrk->SetHMPIDsignal(kNoPhotAccept);                                                      //set the appropriate flag
+    pTrk->SetHMPIDmip(mipX,mipY,mipQ,fPhotCnt);                                               //store mip info 
+    pTrk->SetHMPIDcluIdx(-1,-1);                                                              //set index of cluster
+    return;
+  }
+  
+  if(mipId==-1) {
+    pTrk->SetHMPIDcluIdx(chId,9999);                                                          //set index of cluster
+    pTrk->SetHMPIDsignal(kMipQdcCut);
+    return;
+  }                                                                                           //no clusters with QDC more the threshold at all
+    pTrk->SetHMPIDcluIdx(chId,mipId);                                                         //set index of cluster
+    if(dMin>fParam->DistCut()) {pTrk->SetHMPIDsignal(kMipDistCut); return;}                   //closest cluster with enough charge is still too far from intersection
+  
   fMipPos.Set(mipX,mipY);
-  if(fPhotCnt<=3) pTrk->SetHMPIDsignal(kNoPhotAccept);                                        //no reconstruction with <=3 photon candidates
+  
+  
+//PATTERN RECOGNITION STARTED: 
+  
   Int_t iNrec=FlagPhot(HoughResponse());                                                      //flag photons according to individual theta ckov with respect to most probable
   pTrk->SetHMPIDmip(mipX,mipY,mipQ,iNrec);                                                    //store mip info 
 
-  if(mipId==-1)              {pTrk->SetHMPIDsignal(kMipQdcCut);  return;}                     //no clusters with QDC more the threshold at all
-  if(dMin>fParam->DistCut()) {pTrk->SetHMPIDsignal(kMipDistCut); return;}                     //closest cluster with enough charge is still too far from intersection
-  pTrk->SetHMPIDcluIdx(chId,mipId);                                                           //set index of cluster
   if(iNrec<1){
     pTrk->SetHMPIDsignal(kNoPhotAccept);                                                      //no photon candidates are accepted
+    return;
   }
-  else {
-    Double_t thetaC = FindRingCkov(pCluLst->GetEntries());                                    //find the best reconstructed theta Cherenkov
+  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);                                                             //store theta Cherenkov
+  pTrk->SetHMPIDchi2(fCkovSigma2);                                                          //store errors squared
 
   DeleteVars();
 }//CkovAngle()