#include <TH1D.h> //HoughResponse()
#include <TClonesArray.h> //CkovAngle()
#include <AliESDtrack.h> //CkovAngle()
+#include <AliESDfriendTrack.h> //CkovAngle()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AliHMPIDRecon::AliHMPIDRecon():
TTask("RichRec","RichPat"),
fPhotCnt(-1),
fPhotFlag(0x0),
+ fPhotClusIndex(0x0),
fPhotCkov(0x0),
fPhotPhi(0x0),
fPhotWei(0x0),
//..
if(n<=0) return;
fPhotFlag = new Int_t[n];
+ fPhotClusIndex = new Int_t[n];
fPhotCkov = new Double_t[n];
fPhotPhi = new Double_t[n];
fPhotWei = new Double_t[n];
//Delete variables
//..
delete [] fPhotFlag;
+ delete [] fPhotClusIndex;
delete [] fPhotCkov;
delete [] fPhotPhi;
delete [] fPhotWei;
// Arguments: pTrk - track for which Ckov angle is to be found
// 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();
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)
+ fPhotPhi [fPhotCnt]=phiCer;
+ fPhotClusIndex[fPhotCnt]=iClu; //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->SetHMPIDsignal(kNoPhotAccept); //set the appropriate flag
return;
}
-
-
+
fMipPos.Set(mipX,mipY);
-
-
+
//PATTERN RECOGNITION STARTED:
- Int_t iNrec=FlagPhot(HoughResponse()); //flag photons according to individual theta ckov with respect to most probable
+ Int_t iNrec=FlagPhot(HoughResponse(),pCluLst,pTrk); //flag photons according to individual theta ckov with respect to most probable
+
pTrk->SetHMPIDmip(mipX,mipY,mipQ,iNrec); //store mip info
if(iNrec<1){
pTrk->SetHMPIDsignal(kNoPhotAccept); //no photon candidates are accepted
return;
}
+
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
-
+
DeleteVars();
}//CkovAngle()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
return weightThetaCerenkov;
}//FindCkovRing()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-Int_t AliHMPIDRecon::FlagPhot(Double_t ckov)
+Int_t AliHMPIDRecon::FlagPhot(Double_t ckov,TClonesArray *pCluLst, AliESDtrack *pTrk)
{
// Flag photon candidates if their individual ckov angle is inside the window around ckov angle returned by HoughResponse()
// Arguments: ckov- value of most probable ckov angle for track as returned by HoughResponse()
// Photon Flag: Flag = 0 initial set;
// Flag = 1 good candidate (charge compatible with photon);
// Flag = 2 photon used for the ring;
+ Int_t *PhotIndex = new Int_t[fPhotCnt];
Int_t steps = (Int_t)((ckov )/ fDTheta); //how many times we need to have fDTheta to fill the distance between 0 and thetaCkovHough
fPhotFlag[i] = 0;
if(fPhotCkov[i] >= tmin && fPhotCkov[i] <= tmax) {
fPhotFlag[i]=2;
+ PhotIndex[iInsideCnt]=fPhotClusIndex[i];
iInsideCnt++;
}
}
+
+ for (Int_t iClu=0; iClu<pCluLst->GetEntriesFast();iClu++){//clusters loop
+ AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluLst->UncheckedAt(iClu); //get pointer to current cluster
+ for(Int_t j=0; j<iInsideCnt; j++){
+ if(iClu==PhotIndex[j]) {
+ AliHMPIDCluster *pClus = new AliHMPIDCluster(*pClu);
+ pTrk->AddCalibObject(pClus);
+ }
+ }
+ }
+
+ delete [] PhotIndex;
+
return iInsideCnt;
+
}//FlagPhot()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
TVector2 AliHMPIDRecon::TracePhot(Double_t ckovThe,Double_t ckovPhi)const
TVector2 pos; pos=TracePhot(ckov,j*TMath::TwoPi()/(Double_t)(nStep-1));
if(fParam->IsInDead(pos.X(),pos.Y())) continue;
fParam->Lors2Pad(pos.X(),pos.Y(),ipc,ipadx,ipady);
+ ipadx+=(ipc%2)*fParam->kPadPcX;
+ ipady+=(ipc/2)*fParam->kPadPcY;
if(fParam->IsDeadPad(ipadx,ipady,ch)) continue;
nPhi++;
}//point loop