fPhotPhi [i] = -1;
fPhotWei [i] = 0;
}
+//hidden algorithm
+ fMipX=fMipY=fThTrkFit=fPhTrkFit=fCkovFit=-999;
+ fIdxMip=fNClu=0;
+ for (Int_t i=0; i<1000; i++) {
+ fXClu[i] = fYClu[i] = 0;
+ }
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean)
if(pCluLst->GetEntries()>pParam->MultCut()) fIsWEIGHT = kTRUE; // offset to take into account bkg in reconstruction
else fIsWEIGHT = kFALSE;
- Float_t xRa,yRa,th,ph;
+ Float_t xRa,yRa,th,ph;
pTrk->GetHMPIDtrk(xRa,yRa,th,ph); //initialize this track: th and ph angles at middle of RAD
SetTrack(xRa,yRa,th,ph);
-
+
fRadNmean=nmean;
Float_t dMin=999,mipX=-1,mipY=-1;Int_t chId=-1,mipId=-1,mipQ=-1;
pTrk->SetHMPIDcluIdx(chId,mipId); //set index of cluster
if(iNacc<1) pTrk->SetHMPIDsignal(kNoPhotAccept); //no photon candidates is accepted
else pTrk->SetHMPIDsignal(FindRingCkov(pCluLst->GetEntries())); //find best Theta ckov for ring i.e. track
-
+
pTrk->SetHMPIDchi2(fCkovSigma2); //errors squared
}//CkovAngle()
Double_t AliHMPIDRecon::HoughResponse()
{
//
-//
+// fIdxMip = mipId;
+
//
Double_t kThetaMax=0.75;
Int_t nChannels = (Int_t)(kThetaMax/fDTheta+0.5);
}//SigGeom()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-//
-// From here Hidden track algorithm....
-//
-//
-//
-//
-//
-//
+// From here HTA....
//
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDRecon::CkovHiddenTrk(TClonesArray *pCluLst,Double_t nmean)
+Int_t AliHMPIDRecon::CkovHiddenTrk(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean)
{
-// Pattern recognition method without any infos from tracking...
+// Pattern recognition method without any infos from tracking:HTA (Hidden Track Algorithm)...
// The method finds in the chmber the cluster with the highest charge
// compatibile with a MIP, then the strategy is applied
-// Arguments: pCluLst - list of clusters for this chamber
-// Returns: - track ckov angle, [rad],
+// Arguments: pTrk - pointer to ESD track
+// pCluLs - list of clusters for a given chamber
+// nmean - mean freon ref. index
+// Returns: - 0=ok,1=not fitted
+
+ AliHMPIDParam *pParam=AliHMPIDParam::Instance();
fRadNmean=nmean;
mipId=iClu; mipX=pClu->X();mipY=pClu->Y();mipQ=(Int_t)pClu->Q();
}
}//clusters loop
-
- fIdxMip = mipId;
- fMipX = mipX; fMipY=mipY;
- DoRecHiddenTrk();
+ if(qRef>pParam->QCut()){ //charge compartible with MIP clusters
+ fIdxMip = mipId;
+ fMipX = mipX; fMipY=mipY; fMipQ = qRef;
+ if(!DoRecHiddenTrk()) return 1; //Do track and ring reconstruction,if problems returns 1
+ pTrk->SetHMPIDtrk(fRadX,fRadY,fThTrkFit,fPhTrkFit); //store track intersection info
+ pTrk->SetHMPIDmip(fMipX,fMipY,(Int_t)fMipQ,fNClu); //store mip info
+ pTrk->SetHMPIDcluIdx(pCluLst->GetUniqueID(),fIdxMip); //set cham number and index of cluster
+ pTrk->SetHMPIDsignal(fCkovFit); //find best Theta ckov for ring i.e. track
+ }
+ return 0;
}//CkovHiddenTrk()
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDRecon::DoRecHiddenTrk()
+Bool_t AliHMPIDRecon::DoRecHiddenTrk()
{
// Pattern recognition method without any infos from tracking...
-// Before a preclustering filter to avoid part of the noise
+// First a preclustering filter to avoid part of the noise
// Then only ellipsed-rings are fitted (no possibility,
-// for the moment, to reconstruct very inclined tracks
-// Finally a fitting with (th,ph) free starting by very close values
+// for the moment, to reconstruct very inclined tracks)
+// Finally a fitting with (th,ph) free, starting by very close values
// previously evaluated.
// Arguments: none
// Returns: none
Double_t phiRec;
CluPreFilter();
- if(!FitEllipse(phiRec)) {Printf("Not an ellipse, bye!");return;}
- Printf("--->now it starts the free fit with phi = %f",phiRec*TMath::RadToDeg());
+ if(!FitEllipse(phiRec)) {return kFALSE;}
return FitFree(phiRec);
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
// AB - H^2
Double_t cA,cB,cF,cG,cH;
- Double_t aArg=-1,parStep,parLow,parHigh; Int_t iErrFlg; //tmp vars for TMinuit
+ Double_t aArg=-1; Int_t iErrFlg; //tmp vars for TMinuit
- if(!gMinuit) gMinuit = new TMinuit(100); //init MINUIT with this number of parameters (5 params)
+ if(!gMinuit) gMinuit = new TMinuit(5); //init MINUIT with this number of parameters (5 params)
gMinuit->mncler(); // reset Minuit list of paramters
gMinuit->SetObjectFit((TObject*)this); gMinuit->SetFCN(AliHMPIDRecon::FunMinEl); //set fit function
gMinuit->mnexcm("SET PRI",&aArg,1,iErrFlg); //suspend all printout from TMinuit
Double_t d1,d2,d3;
TString sName;
- gMinuit->mnparm(0," A ",1,parStep=0.01,parLow=0,parHigh=0,iErrFlg);
- gMinuit->mnparm(1," B ",1,parStep=0.01,parLow=0,parHigh=0,iErrFlg);
- gMinuit->mnparm(2," H ",1,parStep=0.01,parLow=0,parHigh=0,iErrFlg);
- gMinuit->mnparm(3," G ",1,parStep=0.01,parLow=0,parHigh=0,iErrFlg);
- gMinuit->mnparm(4," F ",1,parStep=0.01,parLow=0,parHigh=0,iErrFlg);
+ gMinuit->mnparm(0," A ",1,0.01,0,0,iErrFlg);
+ gMinuit->mnparm(1," B ",1,0.01,0,0,iErrFlg);
+ gMinuit->mnparm(2," H ",1,0.01,0,0,iErrFlg);
+ gMinuit->mnparm(3," G ",1,0.01,0,0,iErrFlg);
+ gMinuit->mnparm(4," F ",1,0.01,0,0,iErrFlg);
gMinuit->mnexcm("SIMPLEX" ,&aArg,0,iErrFlg);
gMinuit->mnexcm("MIGRAD" ,&aArg,0,iErrFlg);
//
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDRecon::FitFree(Double_t phiRec)
+Bool_t AliHMPIDRecon::FitFree(Double_t phiRec)
{
// Fit performed by minimizing RMS/sqrt(n) of the
// photons reconstructed. First phi is fixed and theta
// as free parameters
// Arguments: PhiRec phi of the track
// Returns: none
- Double_t aArg=-1,parStep,parLow,parHigh; Int_t iErrFlg; //tmp vars for TMinuit
- if(!gMinuit) gMinuit = new TMinuit(100); //init MINUIT with this number of parameters (5 params)
+ Double_t aArg=-1; Int_t iErrFlg; //tmp vars for TMinuit
+ if(!gMinuit) gMinuit = new TMinuit(2); //init MINUIT with this number of parameters (5 params)
gMinuit->mncler(); // reset Minuit list of paramters
gMinuit->SetObjectFit((TObject*)this); gMinuit->SetFCN(AliHMPIDRecon::FunMinPhot); //set fit function
gMinuit->mnexcm("SET PRI",&aArg,1,iErrFlg); //suspend all printout from TMinuit
gMinuit->mnexcm("SET PRI",&aArg,1,iErrFlg); //suspend all printout from TMinuit
gMinuit->mnexcm("SET NOW",&aArg,0,iErrFlg);
- gMinuit->mnparm(0," theta ",0.01,parStep=0.01,parLow=0,parHigh=TMath::PiOver2(),iErrFlg);
- gMinuit->mnparm(1," phi ",phiRec,parStep=0.01,parLow=0,parHigh=TMath::TwoPi(),iErrFlg);
+ gMinuit->mnparm(0," theta ", 0.01,0.01,0,TMath::PiOver2(),iErrFlg);
+ gMinuit->mnparm(1," phi ",phiRec,0.01,0,TMath::TwoPi() ,iErrFlg);
gMinuit->FixParameter(1);
gMinuit->mnexcm("SIMPLEX" ,&aArg,0,iErrFlg);
gMinuit->mnpout(0,sName,th,d1,d2,d3,iErrFlg);
gMinuit->mnpout(1,sName,ph,d1,d2,d3,iErrFlg);
+
+ Double_t outPar[2] = {th,ph}; Double_t g; Double_t f;Int_t flag = 3;
+ gMinuit->Eval(2, &g, f, outPar,flag);
+
+ SetTrkFit(th,ph);
- Printf(" reconstr. theta %f phi %f",th*TMath::RadToDeg(),ph*TMath::RadToDeg());
+ return kTRUE;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Double_t AliHMPIDRecon::FunConSect(Double_t *c,Double_t x,Double_t y)
f = minFun;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
-void AliHMPIDRecon::FunMinPhot(Int_t &/* */,Double_t* /* */,Double_t &f,Double_t *par,Int_t /* */)
+void AliHMPIDRecon::FunMinPhot(Int_t &/* */,Double_t* /* */,Double_t &f,Double_t *par,Int_t iflag)
{
AliHMPIDRecon *pRec=(AliHMPIDRecon*)gMinuit->GetObjectFit();
-
- Double_t sizeCh = fgkRadThick+fgkWinThick+fgkGapThick;
+ Double_t sizeCh = 0.5*fgkRadThick+fgkWinThick+fgkGapThick;
Double_t thTrk = par[0];
Double_t phTrk = par[1];
Double_t xrad = pRec->MipX() - sizeCh*TMath::Tan(thTrk)*TMath::Cos(phTrk);
Double_t yrad = pRec->MipY() - sizeCh*TMath::Tan(thTrk)*TMath::Sin(phTrk);
-
+ pRec->SetRadXY(xrad,yrad);
pRec->SetTrack(xrad,yrad,thTrk,phTrk);
Double_t meanCkov=0;
meanCkov/=pRec->NClu();
Double_t rms = TMath::Sqrt(meanCkov2/pRec->NClu() - meanCkov*meanCkov);
f = rms/TMath::Sqrt(pRec->NClu());
- pRec->SetCkovFit(meanCkov);
+ Printf(" mean %f rms/sqrt(n) %f",meanCkov,f);
+ if(iflag==3) pRec->SetCkovFit(meanCkov);
+
}//FunMinPhot()
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+//
+// ended Hidden track algorithm....
+//
+//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
AliHMPIDRecon();
virtual ~AliHMPIDRecon() {}
-
+
void CkovAngle (AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean ); //reconstructed Theta Cerenkov
Bool_t FindPhotCkov (Double_t cluX,Double_t cluY,Double_t &thetaCer,Double_t &phiCer ); //find ckov angle for single photon candidate
Double_t FindRingCkov (Int_t iNclus ); //best ckov for ring formed by found photon candidates
Double_t SigCrom (Double_t ckovTh,Double_t ckovPh,Double_t beta )const;//error due to unknonw photon energy
Double_t Sigma2 (Double_t ckovTh,Double_t ckovPh )const;//photon candidate sigma
enum ETrackingFlags {kMipDistCut=-9,kMipQdcCut=-5,kNoPhotAccept=-11};
-// hidden track algorithm
- void CkovHiddenTrk (TClonesArray *pCluLst,Double_t nmean); //Pattern recognition without trackinf information
+// HTA hidden track algorithm
+ Int_t CkovHiddenTrk (AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean); //Pattern recognition without trackinf information
void CluPreFilter ( ); //Pre clustering filter to cut bkg clusters
- void DoRecHiddenTrk ( ); //Calling to the fitted procedures
+ Bool_t DoRecHiddenTrk ( ); //Calling to the fitted procedures
Bool_t FitEllipse (Double_t &phiRec ); //Fit clusters with a conical section (kTRUE only for ellipses)
- void FitFree (Double_t phiRec ); //Fit (th,ph) of the track and ckovFit as result
+ Bool_t FitFree (Double_t phiRec ); //Fit (th,ph) of the track and ckovFit as result
Double_t FunConSect (Double_t *c,Double_t x,Double_t y ); //Function of a general conical section
void SetCkovFit (Double_t ckov ) {fCkovFit=ckov;} //Setter for ckof fitted
void SetTrkFit (Double_t th,Double_t ph ) {fThTrkFit = th;fPhTrkFit = ph;}//Setter for (th,ph) of the track
+ void SetRadXY (Double_t x,Double_t y ) {fRadX = x;fRadY = y;} //Setter for (th,ph) of the track
static void FunMinEl (Int_t&/* */,Double_t* /* */,Double_t &f,Double_t *par,Int_t /* */); //Fit function to find ellipes parameters
- static void FunMinPhot(Int_t&/* */,Double_t* /* */,Double_t &f,Double_t *par,Int_t /* */); //Fit function to minimize thetaCer RMS/Sqrt(n) of n clusters
+ static void FunMinPhot(Int_t&/* */,Double_t* /* */,Double_t &f,Double_t *par,Int_t iflag); //Fit function to minimize thetaCer RMS/Sqrt(n) of n clusters
Int_t IdxMip ()const {return fIdxMip;} //Getter index of MIP
Double_t MipX ()const {return fMipX;} //Getter of x MIP in LORS
Double_t MipY ()const {return fMipY;} //Getter of y MIP in LORS
+ Double_t MipQ ()const {return fMipQ;} //Getter of Q MIP
+ Double_t RadX ()const {return fRadX;} //Getter of x at RAD in LORS
+ Double_t RadY ()const {return fRadY;} //Getter of y at RAD in LORS
Int_t NClu ()const {return fNClu;} //Getter of cluster multiplicity
Double_t XClu (Int_t i)const {return fXClu[i];} //Getter of x clu
Double_t YClu (Int_t i)const {return fYClu[i];} //Getter of y clu
TVector3 fTrkDir; //track direction in LORS at RAD
TVector2 fTrkPos; //track positon in LORS at RAD
TVector2 fPc; //track position at PC
-// hidden track algorithm
+// HTA hidden track algorithm
Double_t fMipX; //mip X position for Hidden Track Algorithm
Double_t fMipY; //mip Y position for Hidden Track Algorithm
+ Double_t fMipQ; //mip Q for Hidden Track Algorithm
+ Double_t fRadX; //rad X position for Hidden Track Algorithm
+ Double_t fRadY; //rad Y position for Hidden Track Algorithm
Int_t fIdxMip; //mip index in the clus list
Int_t fNClu; //n clusters to fit
Double_t fXClu[1000]; //container for x clus position
Double_t fPhTrkFit; //phi fitted of the track
Double_t fCkovFit; //estimated ring Cherenkov angle
//
-private:
+private:
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 fgkWinIdx; //mean refractive index of WIN material (SiO2)
static const Double_t fgkGapIdx; //mean refractive index of GAP material (CH4)
-
+
ClassDef(AliHMPIDRecon,0)
};