Bug fixed. Now Chamber properly evaluated.
authordibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Sep 2008 10:29:12 +0000 (10:29 +0000)
committerdibari <dibari@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 5 Sep 2008 10:29:12 +0000 (10:29 +0000)
HMPID/AliHMPIDRecon.cxx
HMPID/AliHMPIDTracker.cxx

index ce974bd..e8cb828 100644 (file)
@@ -107,8 +107,8 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Int_t inde
   fPhotCnt=0;
   
   for (Int_t iClu=0; iClu<pCluLst->GetEntriesFast();iClu++){//clusters loop
-    AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluLst->UncheckedAt(iClu);                     //get pointer to current cluster    
-    if(iClu == index) {                                                                     // this is the MIP! not a photon candidate: just store mip info
+    AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluLst->UncheckedAt(iClu);                       //get pointer to current cluster    
+    if(iClu == index) {                                                                       // this is the MIP! not a photon candidate: just store mip info
       mipX = pClu->X();
       mipY = pClu->Y();
       mipQ=(Int_t)pClu->Q();
@@ -117,18 +117,18 @@ void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Int_t inde
     }
     chId=pClu->Ch();
     Double_t thetaCer,phiCer;
-    if(FindPhotCkov(pClu->X(),pClu->Y(),thetaCer,phiCer)){                                  //find ckov angle for this  photon candidate
-      fPhotCkov[fPhotCnt]=thetaCer;                                                         //actual theta Cerenkov (in TRS)
-      fPhotPhi [fPhotCnt]=phiCer;                                                           //actual phi   Cerenkov (in TRS): -pi to come back to "unusual" ref system (X,Y,-Z)
-      fPhotCnt++;                                                                           //increment counter of photon candidates
+    if(FindPhotCkov(pClu->X(),pClu->Y(),thetaCer,phiCer)){                                    //find ckov angle for this  photon candidate
+      fPhotCkov[fPhotCnt]=thetaCer;                                                           //actual theta Cerenkov (in TRS)
+      fPhotPhi [fPhotCnt]=phiCer;                                                             //actual phi   Cerenkov (in TRS): -pi to come back to "unusual" ref system (X,Y,-Z)
+      fPhotCnt++;                                                                             //increment counter of photon candidates
     }
   }//clusters loop
 
-  pTrk->SetHMPIDmip(mipX,mipY,mipQ,fPhotCnt);                                                //store mip info in any case 
+  pTrk->SetHMPIDmip(mipX,mipY,mipQ,fPhotCnt);                                                 //store mip info in any case 
+  pTrk->SetHMPIDcluIdx(chId,index+1000*sizeClu);                                              //set index of cluster
   
   if(fPhotCnt<=nMinPhotAcc) {                                                                 //no reconstruction with <=3 photon candidates
     pTrk->SetHMPIDsignal(kNoPhotAccept);                                                      //set the appropriate flag
-    pTrk->SetHMPIDcluIdx(chId,index+1000*sizeClu);                                            //set index of cluster
     return;
   }
   
index 9bfe6e3..8ccd186 100644 (file)
@@ -124,7 +124,6 @@ Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmea
   Int_t nMipClusTot=0;
   Double_t d3d=0,dmin=999999,bz=0;
   Bool_t isMatched=kFALSE;
-  Int_t bestCluCh=-1;
   Int_t cluSiz=0;
   Double_t qthre = 0;   Double_t nmean=0; Int_t cham=0; Int_t hvsec=0;
   Int_t index=0;                                                                                //index of the "best" matching cluster
@@ -137,14 +136,14 @@ Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmea
   AliHMPIDParam *pParam = AliHMPIDParam::Instance();                                             //Instance of AliHMPIDParam
   
   for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){                                        //loop on the ESD tracks in the event
-    isMatched=kFALSE;bestCluCh=-1;dmin=999999;bestChi2=99999;chi2=99999;cluSiz=0;                 //init. track matching params
+    isMatched=kFALSE;dmin=999999;bestChi2=99999;chi2=99999;cluSiz=0;                              //init. track matching params
     isOkQcut = kFALSE;
     AliHMPIDCluster *bestHmpCluster=0x0;                                                          //the best matching cluster
     AliESDtrack *pTrk = pEsd->GetTrack(iTrk);                                                     //get reconstructed track    
     AliHMPIDtrack *hmpTrk = new AliHMPIDtrack(*pTrk);                                             //create a hmpid track to be used for propagation and matching 
     bz=AliTracker::GetBz();  
     
-    Int_t ipCh=IntTrkCha(pTrk,xPc,yPc,xRa,yRa,theta,phi);
+    Int_t ipCh=IntTrkCha(pTrk,xPc,yPc,xRa,yRa,theta,phi);                                        //find the intersected chamber for this track 
     if(ipCh<0) {                                                                                 //no intersection at all, go after next track
       pTrk->SetHMPIDtrk(0,0,0,0);                                                                //no intersection found
       pTrk->SetHMPIDcluIdx   (99,99999);                                                         //chamber not found, mip not yet considered
@@ -187,7 +186,6 @@ Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmea
       if(dmin > d3d ) {                                                                         //to be saved for the moment...
         cluSiz = pClu->Size();
         dmin=d3d;
-        bestCluCh=ipCh;
         bestHmpCluster=pClu;
         index=iClu;
         bestChi2=chi2;
@@ -216,13 +214,13 @@ Int_t AliHMPIDTracker::Recon(AliESDEvent *pEsd,TObjArray *pClus,TObjArray *pNmea
     if(!isMatched) continue;                                                                    // If matched continue...
     
     Int_t indexAll = 0;
-    for(Int_t iC=0;iC<bestCluCh;iC++) indexAll+=nClusCh[iC]; indexAll+=index;                    //to be verified...
+    for(Int_t iC=0;iC<ipCh;iC++) indexAll+=nClusCh[iC]; indexAll+=index;                        //to be verified...
 
     Bool_t isOk = hmpTrk->Update(bestHmpCluster,bestChi2,indexAll);
     if(!isOk) continue;
     pTrk->SetOuterParam((AliExternalTrackParam*)&hmpTrk,AliESDtrack::kHMPIDout);                 
 
-//    cham=IntTrkCha(bestCluCh,hmpTrk,xPc,yPc,xRa,yRa,theta,phi);
+//    cham=IntTrkCha(ipCh,hmpTrk,xPc,yPc,xRa,yRa,theta,phi);
     cham=IntTrkCha(pTrk,xPc,yPc,xRa,yRa,theta,phi);
     if(cham<0) {                                                                                  //no intersection at all, go after next track
       pTrk->SetHMPIDtrk(0,0,0,0);                                                                //no intersection found