1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
7 * Permission to use, copy, modify and distribute this software and its *
8 * documentation strictly for non-commercial purposes is hereby granted *
9 * without fee, provided that the above copyright notice appears in all *
10 * copies and that both the copyright notice and this permission notice *
11 * appear in the supporting documentation. The authors make no claims *
12 * about the suitability of this software for any purpose. It is *
13 * provided "as is" without express or implied warranty. *
14 **************************************************************************/
16 //////////////////////////////////////////////////////////////////////////
20 // HMPID class to perfom pattern recognition based on Hough transfrom //
21 // for single chamber //
22 //////////////////////////////////////////////////////////////////////////
24 #include "AliHMPIDRecon.h" //class header
25 #include "AliHMPIDParam.h" //CkovAngle()
26 #include "AliHMPIDCluster.h" //CkovAngle()
27 #include <TRotation.h> //TracePhot()
28 #include <TH1D.h> //HoughResponse()
29 #include <TClonesArray.h> //CkovAngle()
30 #include <AliESDtrack.h> //CkovAngle()
32 const Double_t AliHMPIDRecon::fgkRadThick=1.5;
33 const Double_t AliHMPIDRecon::fgkWinThick=0.5;
34 const Double_t AliHMPIDRecon::fgkGapThick=8.0;
35 const Double_t AliHMPIDRecon::fgkWinIdx =1.5787;
36 const Double_t AliHMPIDRecon::fgkGapIdx =1.0005;
38 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
39 AliHMPIDRecon::AliHMPIDRecon():TTask("RichRec","RichPat"),
46 fTrkDir(TVector3(0,0,1)),fTrkPos(TVector2(30,40))
49 for (Int_t i=0; i<3000; i++) {
56 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
57 void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean)
59 // Pattern recognition method based on Hough transform
60 // Arguments: pTrk - track for which Ckov angle is to be found
61 // pCluLst - list of clusters for this chamber
62 // Returns: - track ckov angle, [rad],
64 AliHMPIDParam *pParam=AliHMPIDParam::Instance();
66 if(pCluLst->GetEntries()>pParam->MultCut()) fIsWEIGHT = kTRUE; // offset to take into account bkg in reconstruction
67 else fIsWEIGHT = kFALSE;
69 Float_t xRa,yRa,th,ph;
70 pTrk->GetHMPIDtrk(xRa,yRa,th,ph); //initialize this track: th and ph angles at middle of RAD
71 // ph-=TMath::Pi(); // right XYZ local orientation
72 SetTrack(xRa,yRa,th,ph);
76 Float_t dMin=999,mipX=-1,mipY=-1;Int_t chId=-1,mipId=-1,mipQ=-1;
78 for (Int_t iClu=0; iClu<pCluLst->GetEntriesFast();iClu++){//clusters loop
79 AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluLst->UncheckedAt(iClu); //get pointer to current cluster
81 if(pClu->Q()>pParam->QCut()){ //charge compartible with MIP clusters
82 Float_t dX=fPc.X()-pClu->X(),dY=fPc.Y()-pClu->Y(),d =TMath::Sqrt(dX*dX+dY*dY); //distance between current cluster and intersection point
83 if( d < dMin) {mipId=iClu; dMin=d;mipX=pClu->X();mipY=pClu->Y();mipQ=(Int_t)pClu->Q();} //current cluster is closer, overwrite data for min cluster
84 }else{ //charge compatible with photon cluster
85 Double_t thetaCer,phiCer;
86 if(FindPhotCkov(pClu->X(),pClu->Y(),thetaCer,phiCer)){ //find ckov angle for this photon candidate
87 fPhotCkov[fPhotCnt]=thetaCer; //actual theta Cerenkov (in TRS)
88 fPhotPhi [fPhotCnt]=phiCer; //actual phi Cerenkov (in TRS): -pi to come back to "unusual" ref system (X,Y,-Z)
89 fPhotCnt++; //increment counter of photon candidates
93 Int_t iNacc=FlagPhot(HoughResponse()); //flag photons according to individual theta ckov with respect to most probable
94 pTrk->SetHMPIDmip(mipX,mipY,mipQ,iNacc); //store mip info
96 if(mipId==-1) {pTrk->SetHMPIDsignal(kMipQdcCut); return;} //no clusters with QDC more the threshold at all
97 if(dMin>pParam->DistCut()) {pTrk->SetHMPIDsignal(kMipDistCut); return;} //closest cluster with enough charge is still too far from intersection
98 pTrk->SetHMPIDcluIdx(chId,mipId); //set index of cluster
99 if(iNacc<1) pTrk->SetHMPIDsignal(kNoPhotAccept); //no photon candidates is accepted
100 else pTrk->SetHMPIDsignal(FindRingCkov(pCluLst->GetEntries())); //find best Theta ckov for ring i.e. track
102 pTrk->SetHMPIDchi2(fCkovSigma2); //errors squared
105 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
106 Bool_t AliHMPIDRecon::FindPhotCkov(Double_t cluX,Double_t cluY,Double_t &thetaCer,Double_t &phiCer)
108 // Finds Cerenkov angle for this photon candidate
109 // Arguments: cluX,cluY - position of cadidate's cluster
110 // Returns: Cerenkov angle
114 Double_t zRad= -0.5*fgkRadThick-0.5*fgkWinThick; //z position of middle of RAD
115 TVector3 rad(fTrkPos.X(),fTrkPos.Y(),zRad); //impact point at middle of RAD
116 TVector3 pc(cluX,cluY,0.5*fgkWinThick+fgkGapIdx); //mip at PC
117 Double_t cluR = TMath::Sqrt((cluX-fTrkPos.X())*(cluX-fTrkPos.X())+
118 (cluY-fTrkPos.Y())*(cluY-fTrkPos.Y()));//ref. distance impact RAD-CLUSTER
119 Double_t phi=(pc-rad).Phi(); //phi of photon
122 Double_t ckov2=0.75+fTrkDir.Theta(); //start to find theta cerenkov in DRS
123 const Double_t kTol=0.01;
126 if(iIterCnt>=50) return kFALSE;
127 Double_t ckov=0.5*(ckov1+ckov2);
128 dirCkov.SetMagThetaPhi(1,ckov,phi);
129 TVector2 posC=TraceForward(dirCkov); //trace photon with actual angles
130 Double_t dist=cluR-(posC-fTrkPos).Mod(); //get distance between trial point and cluster position
131 if(posC.X()==-999) dist = - 999; //total reflection problem
132 iIterCnt++; //counter step
133 if (dist> kTol) ckov1=ckov; //cluster @ larger ckov
134 else if(dist<-kTol) ckov2=ckov; //cluster @ smaller ckov
135 else{ //precision achived: ckov in DRS found
136 dirCkov.SetMagThetaPhi(1,ckov,phi); //
137 RecPhot(dirCkov,thetaCer,phiCer); //find ckov (in TRS:the effective Cherenkov angle!)
142 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
143 TVector2 AliHMPIDRecon::TraceForward(TVector3 dirCkov)const
145 //Trace forward a photon from (x,y) up to PC
146 // Arguments: dirCkov photon vector in LORS
147 // Returns: pos of traced photon at PC
148 TVector2 pos(-999,-999);
149 Double_t thetaCer = dirCkov.Theta();
150 if(thetaCer > TMath::ASin(1./fRadNmean)) return pos; //total refraction on WIN-GAP boundary
151 Double_t zRad= -0.5*fgkRadThick-0.5*fgkWinThick; //z position of middle of RAD
152 TVector3 posCkov(fTrkPos.X(),fTrkPos.Y(),zRad); //RAD: photon position is track position @ middle of RAD
153 Propagate(dirCkov,posCkov, -0.5*fgkWinThick); //go to RAD-WIN boundary
154 Refract (dirCkov, fRadNmean,fgkWinIdx); //RAD-WIN refraction
155 Propagate(dirCkov,posCkov, 0.5*fgkWinThick); //go to WIN-GAP boundary
156 Refract (dirCkov, fgkWinIdx,fgkGapIdx); //WIN-GAP refraction
157 Propagate(dirCkov,posCkov,0.5*fgkWinThick+fgkGapThick); //go to PC
158 pos.Set(posCkov.X(),posCkov.Y());
161 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
162 void AliHMPIDRecon::RecPhot(TVector3 dirCkov,Double_t &thetaCer,Double_t &phiCer)
164 //Theta Cerenkov reconstruction
165 // Arguments: (x,y) of initial point in LORS, dirCkov photon vector in LORS
166 // Returns: thetaCer theta cerenkov reconstructed
168 // dirTrk.SetMagThetaPhi(1,fTrkDir.Theta(),fTrkDir.Phi());
169 // Double_t thetaCer = TMath::ACos(dirCkov*dirTrk);
170 TRotation mtheta; mtheta.RotateY(- fTrkDir.Theta());
171 TRotation mphi; mphi.RotateZ(- fTrkDir.Phi());
172 TRotation mrot=mtheta*mphi;
174 dirCkovTRS=mrot*dirCkov;
175 phiCer = dirCkovTRS.Phi(); //actual value of the phi of the photon
176 thetaCer= dirCkovTRS.Theta(); //actual value of thetaCerenkov of the photon
178 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
179 Double_t AliHMPIDRecon::FindRingArea(Double_t ckovAng)const
181 // Find area inside the cerenkov ring which lays inside PCs
182 // Arguments: ckovAng - cerenkov angle
183 // Returns: area of the ring in cm^2 for given theta ckov
187 for(Int_t i=0;i<kN;i++){
188 TVector2 pos1=TracePhot(ckovAng,Double_t(TMath::TwoPi()*i /kN));//trace this photon
189 TVector2 pos2=TracePhot(ckovAng,Double_t(TMath::TwoPi()*(i+1)/kN));//trace the next photon
190 area+=(pos1-fTrkPos)*(pos2-fTrkPos); //add area of the triangle...
194 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
195 Double_t AliHMPIDRecon::FindRingCkov(Int_t)
197 // Loops on all Ckov candidates and estimates the best Theta Ckov for a ring formed by those candidates. Also estimates an error for that Theat Ckov
198 // collecting errors for all single Ckov candidates thetas. (Assuming they are independent)
199 // Arguments: iNclus- total number of clusters in chamber for background estimation
200 // Return: best estimation of track Theta ckov
203 Double_t weightThetaCerenkov = 0.;
205 Double_t ckovMin=9999.,ckovMax=0.;
206 Double_t sigma2 = 0; //to collect error squared for this ring
208 for(Int_t i=0;i<fPhotCnt;i++){//candidates loop
209 if(fPhotFlag[i] == 2){
210 if(fPhotCkov[i]<ckovMin) ckovMin=fPhotCkov[i]; //find max and min Theta ckov from all candidates within probable window
211 if(fPhotCkov[i]>ckovMax) ckovMax=fPhotCkov[i];
212 weightThetaCerenkov += fPhotCkov[i]*fPhotWei[i];
213 wei += fPhotWei[i]; //collect weight as sum of all candidate weghts
215 sigma2 += 1./Sigma2(fPhotCkov[i],fPhotPhi[i]);
219 if(sigma2>0) fCkovSigma2=1./sigma2;
220 else fCkovSigma2=1e10;
222 if(wei != 0.) weightThetaCerenkov /= wei; else weightThetaCerenkov = 0.;
223 return weightThetaCerenkov;
225 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
226 Int_t AliHMPIDRecon::FlagPhot(Double_t ckov)
228 // Flag photon candidates if their individual ckov angle is inside the window around ckov angle returned by HoughResponse()
229 // Arguments: ckov- value of most probable ckov angle for track as returned by HoughResponse()
230 // Returns: number of photon candidates happened to be inside the window
232 // Photon Flag: Flag = 0 initial set;
233 // Flag = 1 good candidate (charge compatible with photon);
234 // Flag = 2 photon used for the ring;
236 Int_t steps = (Int_t)((ckov )/ fDTheta); //how many times we need to have fDTheta to fill the distance between 0 and thetaCkovHough
238 Double_t tmin = (Double_t)(steps - 1)*fDTheta;
239 Double_t tmax = (Double_t)(steps)*fDTheta;
240 Double_t tavg = 0.5*(tmin+tmax);
242 tmin = tavg - 0.5*fWindowWidth; tmax = tavg + 0.5*fWindowWidth;
244 Int_t iInsideCnt = 0; //count photons which Theta ckov inside the window
245 for(Int_t i=0;i<fPhotCnt;i++){//photon candidates loop
246 if(fPhotCkov[i] >= tmin && fPhotCkov[i] <= tmax) {
253 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
254 TVector2 AliHMPIDRecon::TracePhot(Double_t ckovThe,Double_t ckovPhi)const
256 // Trace a single Ckov photon from emission point somewhere in radiator up to photocathode taking into account ref indexes of materials it travereses
257 // Arguments: ckovThe,ckovPhi- photon ckov angles in DRS, [rad]
258 // Returns: distance between photon point on PC and track projection
259 TRotation mtheta; mtheta.RotateY(fTrkDir.Theta());
260 TRotation mphi; mphi.RotateZ(fTrkDir.Phi());
261 TRotation mrot=mphi*mtheta;
262 TVector3 dirCkov,dirCkovTors;
264 dirCkovTors.SetMagThetaPhi(1,ckovThe,ckovPhi); //initially photon is directed according to requested ckov angle
265 dirCkov=mrot*dirCkovTors; //now we know photon direction in LORS
266 return TraceForward(dirCkov);
268 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
269 void AliHMPIDRecon::Propagate(const TVector3 dir,TVector3 &pos,Double_t z)const
271 // Finds an intersection point between a line and XY plane shifted along Z.
272 // Arguments: dir,pos - vector along the line and any point of the line
273 // z - z coordinate of plain
275 // On exit: pos is the position if this intesection if any
276 static TVector3 nrm(0,0,1);
279 TVector3 diff=pnt-pos;
280 Double_t sint=(nrm*diff)/(nrm*dir);
283 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
284 void AliHMPIDRecon::Refract(TVector3 &dir,Double_t n1,Double_t n2)const
286 // Refract direction vector according to Snell law
288 // n1 - ref idx of first substance
289 // n2 - ref idx of second substance
291 // On exit: dir is new direction
292 Double_t sinref=(n1/n2)*TMath::Sin(dir.Theta());
293 if(sinref>1.) dir.SetXYZ(-999,-999,-999);
294 else dir.SetTheta(TMath::ASin(sinref));
296 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
297 Double_t AliHMPIDRecon::HoughResponse()
302 Double_t kThetaMax=0.75;
303 Int_t nChannels = (Int_t)(kThetaMax/fDTheta+0.5);
304 TH1D *phots = new TH1D("Rphot" ,"phots" ,nChannels,0,kThetaMax);
305 TH1D *photsw = new TH1D("RphotWeighted" ,"photsw" ,nChannels,0,kThetaMax);
306 TH1D *resultw = new TH1D("resultw","resultw" ,nChannels,0,kThetaMax);
307 Int_t nBin = (Int_t)(kThetaMax/fDTheta);
308 Int_t nCorrBand = (Int_t)(fWindowWidth/(2*fDTheta));
310 for (Int_t i=0; i< fPhotCnt; i++){//photon cadidates loop
311 Double_t angle = fPhotCkov[i]; if(angle<0||angle>kThetaMax) continue;
313 Int_t bin = (Int_t)(0.5+angle/(fDTheta));
316 Double_t lowerlimit = ((Double_t)bin)*fDTheta - 0.5*fDTheta; Double_t upperlimit = ((Double_t)bin)*fDTheta + 0.5*fDTheta;
317 Double_t diffArea = FindRingArea(upperlimit)-FindRingArea(lowerlimit);
318 if(diffArea>0) weight = 1./diffArea;
320 photsw->Fill(angle,weight);
322 }//photon candidates loop
324 for (Int_t i=1; i<=nBin;i++){
325 Int_t bin1= i-nCorrBand;
326 Int_t bin2= i+nCorrBand;
328 if(bin2>nBin)bin2=nBin;
329 Double_t sumPhots=phots->Integral(bin1,bin2);
330 if(sumPhots<3) continue; // if less then 3 photons don't trust to this ring
331 Double_t sumPhotsw=photsw->Integral(bin1,bin2);
332 resultw->Fill((Double_t)((i+0.5)*fDTheta),sumPhotsw);
334 // evaluate the "BEST" theta ckov as the maximum value of histogramm
335 Double_t *pVec = resultw->GetArray();
336 Int_t locMax = TMath::LocMax(nBin,pVec);
337 phots->Delete();photsw->Delete();resultw->Delete(); // Reset and delete objects
339 return (Double_t)(locMax*fDTheta+0.5*fDTheta); //final most probable track theta ckov
341 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
342 Double_t AliHMPIDRecon::Sigma2(Double_t ckovTh, Double_t ckovPh)const
344 // Analithical calculation of total error (as a sum of localization, geometrical and chromatic errors) on Cerenkov angle for a given Cerenkov photon
345 // created by a given MIP. Fromulae according to CERN-EP-2000-058
346 // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
347 // dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]
349 // Returns: absolute error on Cerenkov angle, [radians]
351 TVector3 v(-999,-999,-999);
352 Double_t trkBeta = 1./(TMath::Cos(ckovTh)*fRadNmean);
354 v.SetX(SigLoc (ckovTh,ckovPh,trkBeta));
355 v.SetY(SigGeom(ckovTh,ckovPh,trkBeta));
356 v.SetZ(SigCrom(ckovTh,ckovPh,trkBeta));
360 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
361 Double_t AliHMPIDRecon::SigLoc(Double_t thetaC, Double_t phiC,Double_t betaM)const
363 // Analithical calculation of localization error (due to finite segmentation of PC) on Cerenkov angle for a given Cerenkov photon
364 // created by a given MIP. Fromulae according to CERN-EP-2000-058
365 // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
366 // dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]
368 // Returns: absolute error on Cerenkov angle, [radians]
369 Double_t phiDelta = phiC - fTrkDir.Phi();
371 Double_t alpha =TMath::Cos(fTrkDir.Theta())-TMath::Tan(thetaC)*TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Theta());
372 Double_t k = 1.-fRadNmean*fRadNmean+alpha*alpha/(betaM*betaM);
373 if (k<0) return 1e10;
375 Double_t mu =TMath::Sin(fTrkDir.Theta())*TMath::Sin(fTrkDir.Phi())+TMath::Tan(thetaC)*(TMath::Cos(fTrkDir.Theta())*TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Phi())+TMath::Sin(phiDelta)*TMath::Cos(fTrkDir.Phi()));
376 Double_t e =TMath::Sin(fTrkDir.Theta())*TMath::Cos(fTrkDir.Phi())+TMath::Tan(thetaC)*(TMath::Cos(fTrkDir.Theta())*TMath::Cos(phiDelta)*TMath::Cos(fTrkDir.Phi())-TMath::Sin(phiDelta)*TMath::Sin(fTrkDir.Phi()));
378 Double_t kk = betaM*TMath::Sqrt(k)/(8*alpha);
379 Double_t dtdxc = kk*(k*(TMath::Cos(phiDelta)*TMath::Cos(fTrkDir.Phi())-TMath::Cos(fTrkDir.Theta())*TMath::Sin(phiDelta)*TMath::Sin(fTrkDir.Phi()))-(alpha*mu/(betaM*betaM))*TMath::Sin(fTrkDir.Theta())*TMath::Sin(phiDelta));
380 Double_t dtdyc = kk*(k*(TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Phi())+TMath::Cos(fTrkDir.Theta())*TMath::Sin(phiDelta)*TMath::Cos(fTrkDir.Phi()))+(alpha* e/(betaM*betaM))*TMath::Sin(fTrkDir.Theta())*TMath::Sin(phiDelta));
382 return TMath::Sqrt(0.2*0.2*dtdxc*dtdxc + 0.25*0.25*dtdyc*dtdyc);
384 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
385 Double_t AliHMPIDRecon::SigCrom(Double_t thetaC, Double_t phiC,Double_t betaM)const
387 // Analithical calculation of chromatic error (due to lack of knowledge of Cerenkov photon energy) on Cerenkov angle for a given Cerenkov photon
388 // created by a given MIP. Fromulae according to CERN-EP-2000-058
389 // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
390 // dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]
392 // Returns: absolute error on Cerenkov angle, [radians]
393 Double_t phiDelta = phiC - fTrkDir.Phi();
394 Double_t alpha =TMath::Cos(fTrkDir.Theta())-TMath::Tan(thetaC)*TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Theta());
396 Double_t dtdn = TMath::Cos(fTrkDir.Theta())*fRadNmean*betaM*betaM/(alpha*TMath::Tan(thetaC));
398 Double_t f = 0.00928*(7.75-5.635)/TMath::Sqrt(12.);
402 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
403 Double_t AliHMPIDRecon::SigGeom(Double_t thetaC, Double_t phiC,Double_t betaM)const
405 // Analithical calculation of geometric error (due to lack of knowledge of creation point in radiator) on Cerenkov angle for a given Cerenkov photon
406 // created by a given MIP. Formulae according to CERN-EP-2000-058
407 // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
408 // dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]
410 // Returns: absolute error on Cerenkov angle, [radians]
412 Double_t phiDelta = phiC - fTrkDir.Phi();
413 Double_t alpha =TMath::Cos(fTrkDir.Theta())-TMath::Tan(thetaC)*TMath::Cos(phiDelta)*TMath::Sin(fTrkDir.Theta());
415 Double_t k = 1.-fRadNmean*fRadNmean+alpha*alpha/(betaM*betaM);
416 if (k<0) return 1e10;
418 Double_t eTr = 0.5*1.5*betaM*TMath::Sqrt(k)/(8*alpha);
419 Double_t lambda = 1.-TMath::Sin(fTrkDir.Theta())*TMath::Sin(fTrkDir.Theta())*TMath::Sin(phiC)*TMath::Sin(phiC);
421 Double_t c = 1./(1.+ eTr*k/(alpha*alpha*TMath::Cos(thetaC)*TMath::Cos(thetaC)));
422 Double_t i = betaM*TMath::Tan(thetaC)*lambda*TMath::Power(k,1.5);
423 Double_t ii = 1.+eTr*betaM*i;
425 Double_t err = c * (i/(alpha*alpha*8) + ii*(1.-lambda) / ( alpha*alpha*8*betaM*(1.+eTr)) );
426 Double_t trErr = 1.5/(TMath::Sqrt(12.)*TMath::Cos(fTrkDir.Theta()));
430 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++