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 **************************************************************************/
17 ///////////////////////////////////////////////////////////////////////////////
19 // class for RICH reconstruction //
21 ///////////////////////////////////////////////////////////////////////////////
24 #include "AliRICHReconstructor.h"
25 #include "AliRICHClusterFinder.h"
26 #include "AliRICHHelix.h"
27 #include <AliRunLoader.h>
31 ClassImp(AliRICHReconstructor)
33 //__________________________________________________________________________________________________
34 void AliRICHReconstructor::Reconstruct(AliRunLoader* pAL) const
36 //Finds clusters out of digits
37 AliDebug(1,"Start cluster finder.");AliRICHClusterFinder clus(GetRICH(pAL)); clus.Exec();
39 //__________________________________________________________________________________________________
40 void AliRICHReconstructor::FillESD(AliRunLoader* /*pAL*/, AliESD* pESD) const
42 //This methode fills AliESDtrack with information from RICH
43 AliDebug(1,Form("Start with %i tracks",pESD->GetNumberOfTracks()));
44 /* const Double_t masses[5]={0.000511,0.105658,0.139567,0.493677,0.93828};//electron,muon,pion,kaon,proton
45 const Double_t refIndex = 1.29052;
48 Double_t sinThetaThNorm;
49 Double_t sigmaThetaTh[5];
51 Double_t totalHeight=0;
52 Double_t x[3],p[3]; //tmp storage for track parameters
54 for(Int_t iTrackN=0;iTrackN<pESD->GetNumberOfTracks();iTrackN++){//ESD tracks loop
55 AliESDtrack *pTrack = pESD->GetTrack(iTrackN);// get next reconstructed track
56 // if((pTrack->GetStatus()&AliESDtrack::kTOFout)==0) continue; //ignore tracks not recontructed by TOF
57 pTrack->GetXYZ(x); pTrack->GetPxPyPz(p); Double_t pmod=pTrack->GetP();//get running track parameters
59 // AliRICHHelix helix(x[0],x[1],x[2],p[0],p[1],p[2]); //construct helix from running track parameters
61 // TVector rad(1,5); TVector pc(1,5);
62 // helix.RichIntersect(GetRICH(pAL)->P(),rad,pc); //returns cross point of track with RICH PC in LRS
64 for(Int_t iPart=4;iPart>=0;iPart--){
65 Double_t cosThetaTh = TMath::Sqrt(masses[iPart]*masses[iPart]+pmod*pmod)/(refIndex*pmod);
66 if(cosThetaTh>=1) {break;}
67 thetaTh[iPart] = TMath::ACos(cosThetaTh);
68 sinThetaThNorm = TMath::Sin(thetaTh[iPart])/TMath::Sqrt(1-1/(refIndex*refIndex));
69 sigmaThetaTh[iPart] = (0.014*(1/sinThetaThNorm-1) + 0.0043)*1.25;
70 height[iPart] = TMath::Gaus(thetaExp,thetaTh[iPart],sigmaThetaTh[iPart]);
71 totalHeight +=height[iPart];
75 for(Int_t iPart=0;iPart<5;iPart++) richPID[iPart] = height[iPart]/totalHeight;
76 pTrack->SetRICHpid(richPID);
80 //__________________________________________________________________________________________________
81 AliRICH* AliRICHReconstructor::GetRICH(AliRunLoader* pAL) const
83 // get the RICH detector
85 if (!pAL->GetAliRun()) pAL->LoadgAlice();
86 if (!pAL->GetAliRun()) {AliError("couldn't get AliRun object"); return NULL; }
87 AliRICH* pRich = (AliRICH*) pAL->GetAliRun()->GetDetector("RICH");
88 if (!pRich) {AliError("couldn't get RICH detector"); return NULL; }
91 //__________________________________________________________________________________________________