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 "AliHMPIDCluster.h" //CkovAngle()
26 #include <TRotation.h> //TracePhot()
27 #include <TH1D.h> //HoughResponse()
28 #include <TClonesArray.h> //CkovAngle()
29 #include <AliESDtrack.h> //CkovAngle()
31 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
32 AliHMPIDRecon::AliHMPIDRecon():TTask("RichRec","RichPat")
35 //init of data members
47 fTrkDir = TVector3(0,0,1); // init just for test
48 fTrkPos = TVector2(30,40); // init just for test
50 AliHMPIDParam *pParam=AliHMPIDParam::Instance();
53 fParam->SetRefIdx(fParam->MeanIdxRad()); // initialization of ref index to a default one
55 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
56 void AliHMPIDRecon::InitVars(Int_t n)
62 fPhotFlag = new Int_t[n];
63 fPhotCkov = new Double_t[n];
64 fPhotPhi = new Double_t[n];
65 fPhotWei = new Double_t[n];
68 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
69 void AliHMPIDRecon::DeleteVars()
79 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
80 void AliHMPIDRecon::CkovAngle(AliESDtrack *pTrk,TClonesArray *pCluLst,Double_t nmean,Double_t qthre)
82 // Pattern recognition method based on Hough transform
83 // Arguments: pTrk - track for which Ckov angle is to be found
84 // pCluLst - list of clusters for this chamber
85 // Returns: - track ckov angle, [rad],
87 Int_t nClusTot = pCluLst->GetEntries();
88 if(nClusTot>fParam->MultCut()) fIsWEIGHT = kTRUE; // offset to take into account bkg in reconstruction
89 else fIsWEIGHT = kFALSE;
93 Float_t xRa,yRa,th,ph;
94 pTrk->GetHMPIDtrk(xRa,yRa,th,ph); //initialize this track: th and ph angles at middle of RAD
95 SetTrack(xRa,yRa,th,ph);
97 fParam->SetRefIdx(nmean);
99 Float_t dMin=999,mipX=-1,mipY=-1;Int_t chId=-1,mipId=-1,mipQ=-1;
101 for (Int_t iClu=0; iClu<pCluLst->GetEntriesFast();iClu++){//clusters loop
102 AliHMPIDCluster *pClu=(AliHMPIDCluster*)pCluLst->UncheckedAt(iClu); //get pointer to current cluster
104 if(pClu->Q()>qthre){ //charge compartible with MIP clusters
105 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
106 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
107 }else{ //charge compatible with photon cluster
108 Double_t thetaCer,phiCer;
109 if(FindPhotCkov(pClu->X(),pClu->Y(),thetaCer,phiCer)){ //find ckov angle for this photon candidate
110 fPhotCkov[fPhotCnt]=thetaCer; //actual theta Cerenkov (in TRS)
111 fPhotPhi [fPhotCnt]=phiCer; //actual phi Cerenkov (in TRS): -pi to come back to "unusual" ref system (X,Y,-Z)
112 //PH Printf("photon n. %i reconstructed theta = %f",fPhotCnt,fPhotCkov[fPhotCnt]);
113 fPhotCnt++; //increment counter of photon candidates
117 fMipPos.Set(mipX,mipY);
118 if(fPhotCnt<=3) pTrk->SetHMPIDsignal(kNoPhotAccept); //no reconstruction with <=3 photon candidates
119 Int_t iNacc=FlagPhot(HoughResponse()); //flag photons according to individual theta ckov with respect to most probable
120 pTrk->SetHMPIDmip(mipX,mipY,mipQ,iNacc); //store mip info
122 if(mipId==-1) {pTrk->SetHMPIDsignal(kMipQdcCut); return;} //no clusters with QDC more the threshold at all
123 if(dMin>fParam->DistCut()) {pTrk->SetHMPIDsignal(kMipDistCut); return;} //closest cluster with enough charge is still too far from intersection
124 pTrk->SetHMPIDcluIdx(chId,mipId); //set index of cluster
126 pTrk->SetHMPIDsignal(kNoPhotAccept); //no photon candidates is accepted
129 pTrk->SetHMPIDsignal(FindRingCkov(pCluLst->GetEntries())); //find best Theta ckov for ring i.e. track
130 pTrk->SetHMPIDchi2(fCkovSigma2); //errors squared
135 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
136 Bool_t AliHMPIDRecon::FindPhotCkov(Double_t cluX,Double_t cluY,Double_t &thetaCer,Double_t &phiCer)
138 // Finds Cerenkov angle for this photon candidate
139 // Arguments: cluX,cluY - position of cadidate's cluster
140 // Returns: Cerenkov angle
144 Double_t zRad= -0.5*fParam->RadThick()-0.5*fParam->WinThick(); //z position of middle of RAD
145 TVector3 rad(fTrkPos.X(),fTrkPos.Y(),zRad); //impact point at middle of RAD
146 TVector3 pc(cluX,cluY,0.5*fParam->WinThick()+fParam->GapIdx()); //mip at PC
147 Double_t cluR = TMath::Sqrt((cluX-fTrkPos.X())*(cluX-fTrkPos.X())+
148 (cluY-fTrkPos.Y())*(cluY-fTrkPos.Y()));//ref. distance impact RAD-CLUSTER
149 Double_t phi=(pc-rad).Phi(); //phi of photon
152 Double_t ckov2=0.75+fTrkDir.Theta(); //start to find theta cerenkov in DRS
153 const Double_t kTol=0.01;
156 if(iIterCnt>=50) return kFALSE;
157 Double_t ckov=0.5*(ckov1+ckov2);
158 dirCkov.SetMagThetaPhi(1,ckov,phi);
159 TVector2 posC=TraceForward(dirCkov); //trace photon with actual angles
160 Double_t dist=cluR-(posC-fTrkPos).Mod(); //get distance between trial point and cluster position
161 if(posC.X()==-999) dist = - 999; //total reflection problem
162 iIterCnt++; //counter step
163 if (dist> kTol) ckov1=ckov; //cluster @ larger ckov
164 else if(dist<-kTol) ckov2=ckov; //cluster @ smaller ckov
165 else{ //precision achived: ckov in DRS found
166 dirCkov.SetMagThetaPhi(1,ckov,phi); //
167 RecPhot(dirCkov,thetaCer,phiCer); //find ckov (in TRS:the effective Cherenkov angle!)
172 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
173 TVector2 AliHMPIDRecon::TraceForward(TVector3 dirCkov)const
175 //Trace forward a photon from (x,y) up to PC
176 // Arguments: dirCkov photon vector in LORS
177 // Returns: pos of traced photon at PC
179 TVector2 pos(-999,-999);
180 Double_t thetaCer = dirCkov.Theta();
181 if(thetaCer > TMath::ASin(1./fParam->GetRefIdx())) return pos; //total refraction on WIN-GAP boundary
182 Double_t zRad= -0.5*fParam->RadThick()-0.5*fParam->WinThick(); //z position of middle of RAD
183 TVector3 posCkov(fTrkPos.X(),fTrkPos.Y(),zRad); //RAD: photon position is track position @ middle of RAD
184 Propagate(dirCkov,posCkov, -0.5*fParam->WinThick()); //go to RAD-WIN boundary
185 Refract (dirCkov, fParam->GetRefIdx(),fParam->WinIdx()); //RAD-WIN refraction
186 Propagate(dirCkov,posCkov, 0.5*fParam->WinThick()); //go to WIN-GAP boundary
187 Refract (dirCkov, fParam->WinIdx(),fParam->GapIdx()); //WIN-GAP refraction
188 Propagate(dirCkov,posCkov,0.5*fParam->WinThick()+fParam->GapThick()); //go to PC
189 pos.Set(posCkov.X(),posCkov.Y());
192 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
193 void AliHMPIDRecon::RecPhot(TVector3 dirCkov,Double_t &thetaCer,Double_t &phiCer)
195 //Theta Cerenkov reconstruction
196 // Arguments: (x,y) of initial point in LORS, dirCkov photon vector in LORS
197 // Returns: thetaCer theta cerenkov reconstructed
199 // dirTrk.SetMagThetaPhi(1,fTrkDir.Theta(),fTrkDir.Phi());
200 // Double_t thetaCer = TMath::ACos(dirCkov*dirTrk);
201 TRotation mtheta; mtheta.RotateY(- fTrkDir.Theta());
202 TRotation mphi; mphi.RotateZ(- fTrkDir.Phi());
203 TRotation mrot=mtheta*mphi;
205 dirCkovTRS=mrot*dirCkov;
206 phiCer = dirCkovTRS.Phi(); //actual value of the phi of the photon
207 thetaCer= dirCkovTRS.Theta(); //actual value of thetaCerenkov of the photon
209 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
210 Double_t AliHMPIDRecon::FindRingArea(Double_t ckovAng)const
212 // Find area covered in the PC acceptance
213 // Arguments: ckovAng - cerenkov angle
214 // Returns: area of the ring in cm^2 for given theta ckov
220 for(Int_t i=0;i<kN;i++){
222 pos1=TracePhot(ckovAng,Double_t(TMath::TwoPi()*(i+1)/kN)); //find a good trace for the first photon
223 if(pos1.X()==-999) continue; //no area: open ring
224 if(!fParam->IsInside(pos1.X(),pos1.Y(),0)) pos1 = IntWithEdge(fMipPos,pos1); // ffind the very first intersection...
228 TVector2 pos2=TracePhot(ckovAng,Double_t(TMath::TwoPi()*(i+1)/kN)); //trace the next photon
229 if(pos2.X()==-999) continue; //no area: open ring
230 if(!fParam->IsInside(pos2.X(),pos2.Y(),0)) {
231 pos2 = IntWithEdge(fMipPos,pos2);
233 area+=TMath::Abs((pos1-fMipPos).X()*(pos2-fMipPos).Y()-(pos1-fMipPos).Y()*(pos2-fMipPos).X()); //add area of the triangle...
236 //--- find points from ring
240 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
241 TVector2 AliHMPIDRecon::IntWithEdge(TVector2 p1,TVector2 p2)const
243 // It finds the intersection of the line for 2 points traced as photons
244 // and the edge of a given PC
245 // Arguments: 2 points obtained tracing the photons
246 // Returns: intersection point with detector (PC) edges
248 Double_t xmin = (p1.X()<p2.X())? p1.X():p2.X();
249 Double_t xmax = (p1.X()<p2.X())? p2.X():p1.X();
250 Double_t ymin = (p1.Y()<p2.Y())? p1.Y():p2.Y();
251 Double_t ymax = (p1.Y()<p2.Y())? p2.Y():p1.Y();
253 Double_t m = TMath::Tan((p2-p1).Phi());
255 //intersection with low X
256 pint.Set((Double_t)(p1.X() + (0-p1.Y())/m),0.);
257 if(pint.X()>=0 && pint.X()<=fParam->SizeAllX() &&
258 pint.X()>=xmin && pint.X()<=xmax &&
259 pint.Y()>=ymin && pint.Y()<=ymax) return pint;
260 //intersection with high X
261 pint.Set((Double_t)(p1.X() + (fParam->SizeAllY()-p1.Y())/m),(Double_t)(fParam->SizeAllY()));
262 if(pint.X()>=0 && pint.X()<=fParam->SizeAllX() &&
263 pint.X()>=xmin && pint.X()<=xmax &&
264 pint.Y()>=ymin && pint.Y()<=ymax) return pint;
265 //intersection with left Y
266 pint.Set(0.,(Double_t)(p1.Y() + m*(0-p1.X())));
267 if(pint.Y()>=0 && pint.Y()<=fParam->SizeAllY() &&
268 pint.Y()>=ymin && pint.Y()<=ymax &&
269 pint.X()>=xmin && pint.X()<=xmax) return pint;
270 //intersection with righ Y
271 pint.Set((Double_t)(fParam->SizeAllX()),(Double_t)(p1.Y() + m*(fParam->SizeAllX()-p1.X())));
272 if(pint.Y()>=0 && pint.Y()<=fParam->SizeAllY() &&
273 pint.Y()>=ymin && pint.Y()<=ymax &&
274 pint.X()>=xmin && pint.X()<=xmax) return pint;
277 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
278 Double_t AliHMPIDRecon::FindRingCkov(Int_t)
280 // 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
281 // collecting errors for all single Ckov candidates thetas. (Assuming they are independent)
282 // Arguments: iNclus- total number of clusters in chamber for background estimation
283 // Return: best estimation of track Theta ckov
286 Double_t weightThetaCerenkov = 0.;
288 Double_t ckovMin=9999.,ckovMax=0.;
289 Double_t sigma2 = 0; //to collect error squared for this ring
291 for(Int_t i=0;i<fPhotCnt;i++){//candidates loop
292 if(fPhotFlag[i] == 2){
293 if(fPhotCkov[i]<ckovMin) ckovMin=fPhotCkov[i]; //find max and min Theta ckov from all candidates within probable window
294 if(fPhotCkov[i]>ckovMax) ckovMax=fPhotCkov[i];
295 weightThetaCerenkov += fPhotCkov[i]*fPhotWei[i];
296 wei += fPhotWei[i]; //collect weight as sum of all candidate weghts
298 sigma2 += 1./Sigma2(fPhotCkov[i],fPhotPhi[i]);
302 if(sigma2>0) fCkovSigma2=1./sigma2;
303 else fCkovSigma2=1e10;
305 if(wei != 0.) weightThetaCerenkov /= wei; else weightThetaCerenkov = 0.;
306 return weightThetaCerenkov;
308 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
309 Int_t AliHMPIDRecon::FlagPhot(Double_t ckov)
311 // Flag photon candidates if their individual ckov angle is inside the window around ckov angle returned by HoughResponse()
312 // Arguments: ckov- value of most probable ckov angle for track as returned by HoughResponse()
313 // Returns: number of photon candidates happened to be inside the window
315 // Photon Flag: Flag = 0 initial set;
316 // Flag = 1 good candidate (charge compatible with photon);
317 // Flag = 2 photon used for the ring;
319 Int_t steps = (Int_t)((ckov )/ fDTheta); //how many times we need to have fDTheta to fill the distance between 0 and thetaCkovHough
321 Double_t tmin = (Double_t)(steps - 1)*fDTheta;
322 Double_t tmax = (Double_t)(steps)*fDTheta;
323 Double_t tavg = 0.5*(tmin+tmax);
325 tmin = tavg - 0.5*fWindowWidth; tmax = tavg + 0.5*fWindowWidth;
327 Int_t iInsideCnt = 0; //count photons which Theta ckov inside the window
328 for(Int_t i=0;i<fPhotCnt;i++){//photon candidates loop
330 if(fPhotCkov[i] >= tmin && fPhotCkov[i] <= tmax) {
337 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
338 TVector2 AliHMPIDRecon::TracePhot(Double_t ckovThe,Double_t ckovPhi)const
340 // Trace a single Ckov photon from emission point somewhere in radiator up to photocathode taking into account ref indexes of materials it travereses
341 // Arguments: ckovThe,ckovPhi- photon ckov angles in TRS, [rad]
342 // Returns: distance between photon point on PC and track projection
343 TRotation mtheta; mtheta.RotateY(fTrkDir.Theta());
344 TRotation mphi; mphi.RotateZ(fTrkDir.Phi());
345 TRotation mrot=mphi*mtheta;
346 TVector3 dirCkov,dirCkovTors;
348 dirCkovTors.SetMagThetaPhi(1,ckovThe,ckovPhi); //initially photon is directed according to requested ckov angle
349 dirCkov=mrot*dirCkovTors; //now we know photon direction in LORS
350 return TraceForward(dirCkov);
352 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
353 void AliHMPIDRecon::Propagate(const TVector3 dir,TVector3 &pos,Double_t z)const
355 // Finds an intersection point between a line and XY plane shifted along Z.
356 // Arguments: dir,pos - vector along the line and any point of the line
357 // z - z coordinate of plain
359 // On exit: pos is the position if this intesection if any
360 static TVector3 nrm(0,0,1);
363 TVector3 diff=pnt-pos;
364 Double_t sint=(nrm*diff)/(nrm*dir);
367 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
368 void AliHMPIDRecon::Refract(TVector3 &dir,Double_t n1,Double_t n2)const
370 // Refract direction vector according to Snell law
372 // n1 - ref idx of first substance
373 // n2 - ref idx of second substance
375 // On exit: dir is new direction
376 Double_t sinref=(n1/n2)*TMath::Sin(dir.Theta());
377 if(TMath::Abs(sinref)>1.) dir.SetXYZ(-999,-999,-999);
378 else dir.SetTheta(TMath::ASin(sinref));
380 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
381 Double_t AliHMPIDRecon::HoughResponse()
387 Double_t kThetaMax=0.75;
388 Int_t nChannels = (Int_t)(kThetaMax/fDTheta+0.5);
389 TH1D *phots = new TH1D("Rphot" ,"phots" ,nChannels,0,kThetaMax);
390 TH1D *photsw = new TH1D("RphotWeighted" ,"photsw" ,nChannels,0,kThetaMax);
391 TH1D *resultw = new TH1D("resultw","resultw" ,nChannels,0,kThetaMax);
392 Int_t nBin = (Int_t)(kThetaMax/fDTheta);
393 Int_t nCorrBand = (Int_t)(fWindowWidth/(2*fDTheta));
395 for (Int_t i=0; i< fPhotCnt; i++){//photon cadidates loop
396 Double_t angle = fPhotCkov[i]; if(angle<0||angle>kThetaMax) continue;
398 Int_t bin = (Int_t)(0.5+angle/(fDTheta));
401 Double_t lowerlimit = ((Double_t)bin)*fDTheta - 0.5*fDTheta; Double_t upperlimit = ((Double_t)bin)*fDTheta + 0.5*fDTheta;
402 Double_t diffArea = FindRingArea(upperlimit)-FindRingArea(lowerlimit);
403 if(diffArea>0) weight = 1./diffArea;
405 photsw->Fill(angle,weight);
407 }//photon candidates loop
409 for (Int_t i=1; i<=nBin;i++){
410 Int_t bin1= i-nCorrBand;
411 Int_t bin2= i+nCorrBand;
413 if(bin2>nBin)bin2=nBin;
414 Double_t sumPhots=phots->Integral(bin1,bin2);
415 if(sumPhots<3) continue; // if less then 3 photons don't trust to this ring
416 Double_t sumPhotsw=photsw->Integral(bin1,bin2);
417 resultw->Fill((Double_t)((i+0.5)*fDTheta),sumPhotsw);
419 // evaluate the "BEST" theta ckov as the maximum value of histogramm
420 Double_t *pVec = resultw->GetArray();
421 Int_t locMax = TMath::LocMax(nBin,pVec);
422 delete phots;delete photsw;delete resultw; // Reset and delete objects
424 return (Double_t)(locMax*fDTheta+0.5*fDTheta); //final most probable track theta ckov
426 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
427 Double_t AliHMPIDRecon::Sigma2(Double_t ckovTh, Double_t ckovPh)const
429 // Analithical calculation of total error (as a sum of localization, geometrical and chromatic errors) on Cerenkov angle for a given Cerenkov photon
430 // created by a given MIP. Fromulae according to CERN-EP-2000-058
431 // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
432 // dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]
434 // Returns: absolute error on Cerenkov angle, [radians]
436 TVector3 v(-999,-999,-999);
437 Double_t trkBeta = 1./(TMath::Cos(ckovTh)*fParam->GetRefIdx());
439 if(trkBeta > 1) trkBeta = 1; //protection against bad measured thetaCer
440 if(trkBeta < 0) trkBeta = 0.0001; //
442 v.SetX(SigLoc (ckovTh,ckovPh,trkBeta));
443 v.SetY(SigGeom(ckovTh,ckovPh,trkBeta));
444 v.SetZ(SigCrom(ckovTh,ckovPh,trkBeta));
448 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
449 Double_t AliHMPIDRecon::SigLoc(Double_t thetaC, Double_t phiC,Double_t betaM)const
451 // Analithical calculation of localization error (due to finite segmentation of PC) on Cerenkov angle for a given Cerenkov photon
452 // created by a given MIP. Fromulae according to CERN-EP-2000-058
453 // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
454 // dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]
456 // Returns: absolute error on Cerenkov angle, [radians]
458 Double_t phiDelta = phiC - fTrkDir.Phi();
460 Double_t sint = TMath::Sin(fTrkDir.Theta());
461 Double_t cost = TMath::Cos(fTrkDir.Theta());
462 Double_t sinf = TMath::Sin(fTrkDir.Phi());
463 Double_t cosf = TMath::Cos(fTrkDir.Phi());
464 Double_t sinfd = TMath::Sin(phiDelta);
465 Double_t cosfd = TMath::Cos(phiDelta);
466 Double_t tantheta = TMath::Tan(thetaC);
468 Double_t alpha =cost-tantheta*cosfd*sint; // formula (11)
469 Double_t k = 1.-fParam->GetRefIdx()*fParam->GetRefIdx()+alpha*alpha/(betaM*betaM); // formula (after 8 in the text)
470 if (k<0) return 1e10;
471 Double_t mu =sint*sinf+tantheta*(cost*cosfd*sinf+sinfd*cosf); // formula (10)
472 Double_t e =sint*cosf+tantheta*(cost*cosfd*cosf-sinfd*sinf); // formula (9)
474 Double_t kk = betaM*TMath::Sqrt(k)/(fParam->GapThick()*alpha); // formula (6) and (7)
475 Double_t dtdxc = kk*(k*(cosfd*cosf-cost*sinfd*sinf)-(alpha*mu/(betaM*betaM))*sint*sinfd); // formula (6)
476 Double_t dtdyc = kk*(k*(cosfd*sinf+cost*sinfd*cosf)+(alpha* e/(betaM*betaM))*sint*sinfd); // formula (7) pag.4
478 Double_t errX = 0.2,errY=0.25; //end of page 7
479 return TMath::Sqrt(errX*errX*dtdxc*dtdxc + errY*errY*dtdyc*dtdyc);
481 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
482 Double_t AliHMPIDRecon::SigCrom(Double_t thetaC, Double_t phiC,Double_t betaM)const
484 // Analithical calculation of chromatic error (due to lack of knowledge of Cerenkov photon energy) on Cerenkov angle for a given Cerenkov photon
485 // created by a given MIP. Fromulae according to CERN-EP-2000-058
486 // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
487 // dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]
489 // Returns: absolute error on Cerenkov angle, [radians]
491 Double_t phiDelta = phiC - fTrkDir.Phi();
493 Double_t sint = TMath::Sin(fTrkDir.Theta());
494 Double_t cost = TMath::Cos(fTrkDir.Theta());
495 Double_t cosfd = TMath::Cos(phiDelta);
496 Double_t tantheta = TMath::Tan(thetaC);
498 Double_t alpha =cost-tantheta*cosfd*sint; // formula (11)
499 Double_t dtdn = cost*fParam->GetRefIdx()*betaM*betaM/(alpha*tantheta); // formula (12)
501 // Double_t f = 0.00928*(7.75-5.635)/TMath::Sqrt(12.);
502 Double_t f = 0.0172*(7.75-5.635)/TMath::Sqrt(24.);
506 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
507 Double_t AliHMPIDRecon::SigGeom(Double_t thetaC, Double_t phiC,Double_t betaM)const
509 // Analithical calculation of geometric error (due to lack of knowledge of creation point in radiator) on Cerenkov angle for a given Cerenkov photon
510 // created by a given MIP. Formulae according to CERN-EP-2000-058
511 // Arguments: Cerenkov and azimuthal angles for Cerenkov photon, [radians]
512 // dip and azimuthal angles for MIP taken at the entrance to radiator, [radians]
514 // Returns: absolute error on Cerenkov angle, [radians]
516 Double_t phiDelta = phiC - fTrkDir.Phi();
518 Double_t sint = TMath::Sin(fTrkDir.Theta());
519 Double_t cost = TMath::Cos(fTrkDir.Theta());
520 Double_t sinf = TMath::Sin(fTrkDir.Phi());
521 Double_t cosfd = TMath::Cos(phiDelta);
522 Double_t costheta = TMath::Cos(thetaC);
523 Double_t tantheta = TMath::Tan(thetaC);
525 Double_t alpha =cost-tantheta*cosfd*sint; // formula (11)
527 Double_t k = 1.-fParam->GetRefIdx()*fParam->GetRefIdx()+alpha*alpha/(betaM*betaM); // formula (after 8 in the text)
528 if (k<0) return 1e10;
530 Double_t eTr = 0.5*fParam->RadThick()*betaM*TMath::Sqrt(k)/(fParam->GapThick()*alpha); // formula (14)
531 Double_t lambda = 1.-sint*sint*sinf*sinf; // formula (15)
533 Double_t c1 = 1./(1.+ eTr*k/(alpha*alpha*costheta*costheta)); // formula (13.a)
534 Double_t c2 = betaM*TMath::Power(k,1.5)*tantheta*lambda/(fParam->GapThick()*alpha*alpha); // formula (13.b)
535 Double_t c3 = (1.+eTr*k*betaM*betaM)/((1+eTr)*alpha*alpha); // formula (13.c)
536 Double_t c4 = TMath::Sqrt(k)*tantheta*(1-lambda)/(fParam->GapThick()*betaM); // formula (13.d)
537 Double_t dtdT = c1 * (c2+c3*c4);
538 Double_t trErr = fParam->RadThick()/(TMath::Sqrt(12.)*cost);