]>
Commit | Line | Data |
---|---|---|
db910db9 | 1 | #include "AliRICHTracker.h" //class header |
2 | #include "AliRICH.h" | |
3 | #include "AliRICHRecon.h" | |
84093f6f | 4 | #include "AliRICHParam.h" |
998b831f | 5 | #include <AliESD.h> |
84093f6f | 6 | #include <TGeoManager.h> //EsdQA() |
998b831f | 7 | #include <TVector3.h> |
84093f6f | 8 | #include <TTree.h> //EsdQA() |
9 | #include <TFile.h> //EsdQA() | |
10 | #include <TProfile.h> //EsdQA() | |
998b831f | 11 | #include "AliRICHHelix.h" |
12 | #include <AliMagF.h> | |
998b831f | 13 | #include <AliStack.h> |
14 | #include <TParticle.h> | |
30c60010 | 15 | #include <TMath.h> |
0fe8fa07 | 16 | #include <AliRun.h> |
db910db9 | 17 | #include <TNtupleD.h> //RecWithStack(); |
18 | #include <AliTrackPointArray.h> //GetTrackPoint() | |
19 | #include <AliAlignObj.h> //GetTrackPoint() | |
84093f6f | 20 | #include <TH1F.h> //EsdQA() |
21 | #include <TH2F.h> //EsdQA() | |
22 | #include <TCanvas.h> //EsdQA() | |
998b831f | 23 | ClassImp(AliRICHTracker) |
db910db9 | 24 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
25 | AliRICHTracker::AliRICHTracker():AliTracker() | |
998b831f | 26 | { |
db910db9 | 27 | // AliRICHTracker is created from AliReconstraction::Run() which invokes AliReconstraction::CreateTrackers() |
28 | // which in turn invokes AliRICHReconstructor::CreateTracker(). | |
29 | // Note that this is done just once per session before AliReconstruction::Run() goes to events loop. | |
30 | AliRICHParam::Instance()->CdbRead(0,0); | |
31 | for(Int_t i=0;i<5;i++)fErrPar[i]=0; | |
32 | } | |
33 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
34 | Bool_t AliRICHTracker::GetTrackPoint(Int_t idx, AliTrackPoint& point) const | |
30c60010 | 35 | { |
db910db9 | 36 | // Interface callback methode invoked from AliReconstruction::WriteAlignmentData() to get position of MIP cluster in MARS associated to a current track. |
37 | // MIP cluster is reffered by index which is stored in AliESDtrack ??????? | |
38 | // Arguments: idx- cluster index which is stored by RICH in AliESDtrack | |
39 | // point- reference to the object where to store the point | |
40 | // Returns: status of operation if FALSE then AliReconstruction::WriteAlignmentData() do not store this point to array of points for current track. | |
41 | if(idx<0) return kFALSE; //no MIP cluster assigned to this track in PropagateBack() | |
42 | Int_t iCham=idx/1000000; | |
43 | Int_t iClu=idx%1000000; | |
44 | point.SetVolumeID(AliAlignObj::LayerToVolUID(AliAlignObj::kRICH,iCham-1));//layer and chamber number | |
45 | AliRICH *pRich=((AliRICH*)gAlice->GetDetector("RICH")); | |
46 | AliRICHCluster *pClu=(AliRICHCluster*)pRich->Clus(iCham)->UncheckedAt(iClu);//get pointer to cluster | |
47 | TVector3 mars=AliRICHParam::Instance()->Lors2Mars(iCham,pClu->X(),pClu->Y()); | |
48 | point.SetXYZ(mars.X(),mars.Y(),mars.Z()); | |
49 | return kTRUE; | |
50 | } | |
51 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
52 | Int_t AliRICHTracker::LoadClusters(TTree *pCluTree) | |
53 | { | |
54 | // Interface callback methode invoked from AliReconstruction::RunTracking() to load RICH clusters for RICH | |
55 | // Arguments: pCluTree- pointer to clusters tree got by AliRICHLoader::LoadRecPoints("read") then AliRICHLoader::TreeR() | |
56 | // Returns: error code (currently ignored in AliReconstruction::RunTraking()) | |
57 | AliDebug(1,"Start."); pCluTree->GetEntry(0); AliDebug(1,"Stop."); return 0; | |
58 | } | |
59 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
60 | Int_t AliRICHTracker::PropagateBack(AliESD *pESD) | |
61 | { | |
62 | // Interface callback methode invoked by AliRecontruction::RunTracking() during tracking after TOF. It's done just once per event | |
63 | // Arguments: pESD - pointer to Event Summary Data class instance which contains a list of tracks | |
64 | // Returns: error code, 0 if no errors | |
65 | Int_t iNtracks=pESD->GetNumberOfTracks(); | |
66 | AliDebug(1,Form("Start with %i tracks",iNtracks)); | |
67 | AliRICH *pRich=((AliRICH*)gAlice->GetDetector("RICH")); | |
68 | AliRICHRecon recon; | |
cb801d41 | 69 | AliPID pid; // needed to retrive all the PID info |
db910db9 | 70 | |
71 | for(Int_t iTrk=0;iTrk<iNtracks;iTrk++){//ESD tracks loop | |
72 | AliESDtrack *pTrack = pESD->GetTrack(iTrk);// get next reconstructed track | |
e1e6896f | 73 | Double_t mom[3], pos[3]; |
74 | pTrack->GetPxPyPz(mom); TVector3 mom3(mom[0],mom[1],mom[2]); | |
75 | pTrack->GetXYZ(pos); TVector3 pos3(pos[0],pos[1],pos[2]); | |
76 | AliRICHHelix helix(pos3,mom3,(Int_t)pTrack->GetSign(),-0.1*GetBz()); //construct helix out of track running parameters | |
2a92c3fe | 77 | //Printf(" magnetic field %f charged %f\n",GetBz(),pTrack->GetSign()); helix.Print("Track"); |
db910db9 | 78 | Int_t iChamber=helix.RichIntersect(AliRICHParam::Instance()); |
79 | if(!iChamber) continue; //no intersection with chambers, ignore this track go after the next one | |
80 | ||
81 | //find MIP cluster candidate (closest to track intersection point cluster with large enough QDC) | |
2714766e | 82 | Double_t dR=9999, dX=9999, dY=9999; //distance between track-PC intersection point and current cluster |
83 | Double_t mipDr=9999,mipDx=9999,mipDy=9999,mipX=9999,mipY=9999; //nearest cluster parameters | |
db910db9 | 84 | Int_t iMipId=-1; //index of this nearest cluster |
85 | for(Int_t iClu=0;iClu<pRich->Clus(iChamber)->GetEntries();iClu++){//clusters loop for intersected chamber | |
86 | AliRICHCluster *pClu=(AliRICHCluster*)pRich->Clus(iChamber)->UncheckedAt(iClu);//get pointer to current cluster | |
87 | if(pClu->Q()<AliRICHParam::QthMIP()) continue; //to low QDC, go after another one | |
88 | pClu->DistXY(helix.PosPc(),dX,dY); dR=TMath::Sqrt(dX*dX+dY*dY); //get distance for current cluster | |
2714766e | 89 | if(dR<mipDr){iMipId=iClu; mipDr=dR; mipDx=dX; mipDy=dY; mipX=pClu->X(); mipY=pClu->Y();} //current cluster is closer, overwrite data for min cluster |
a25b3368 | 90 | }//clusters loop for intersected chamber |
01c81d9d | 91 | |
db910db9 | 92 | pTrack->SetRICHthetaPhi(helix.Ploc().Theta(),helix.Ploc().Phi()); //store track impact angles with respect to RICH planes |
2714766e | 93 | pTrack->SetRICHdxdy(mipDx,mipDy); //distance between track-PC intersection and closest cluster with Qdc>100 |
94 | pTrack->SetRICHmipXY(mipX,mipY); //position of that closest cluster with Qdc>100 | |
d3eb6079 | 95 | |
db910db9 | 96 | if(iMipId==-1) {pTrack->SetRICHsignal(kMipQdcCut); continue;} //no cluster with enough QDC found |
2714766e | 97 | if(mipDr>AliRICHParam::DmatchMIP()) {pTrack->SetRICHsignal(kMipDistCut); continue;} //closest cluster with enough carge is still too far |
db910db9 | 98 | |
99 | pTrack->SetRICHcluster(iMipId+1000000*iChamber); //set mip cluster index | |
717518b3 | 100 | Int_t nphots =0; |
101 | pTrack->SetRICHsignal(recon.ThetaCerenkov(&helix,pRich->Clus(iChamber),nphots));//search for mean Cerenkov angle for this track | |
84093f6f | 102 | pTrack->SetRICHchi2(recon.GetRingSigma2()); |
717518b3 | 103 | pTrack->SetRICHnclusters(nphots); //on return nphots is number of photon clusters accepted in reconstruction |
fab9e039 | 104 | |
db910db9 | 105 | AliDebug(1,Form("Ch=%i PC Intersection=(%5.2f,%5.2f) cm MIP cluster dist=(%5.2f,%5.2f)=%5.2f cm ThetaCkov=%f", |
2714766e | 106 | iChamber,helix.PosPc().X(),helix.PosPc().Y(), mipDx,mipDy,mipDr, pTrack->GetRICHsignal())); |
db910db9 | 107 | |
108 | //here comes PID calculations | |
84093f6f | 109 | // CalcProb(pTrack->GetRICHsignal(),pTrack->GetP(),sigmaPID,richPID); |
db910db9 | 110 | }//ESD tracks loop |
111 | AliDebug(1,"Stop pattern recognition"); | |
112 | return 0; // error code: 0=no error; | |
113 | }//PropagateBack() | |
114 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
1cb5a97c | 115 | void AliRICHTracker::RecWithStack(TNtupleD *hn) |
30c60010 | 116 | { |
db910db9 | 117 | // Reconstruction for particles from STACK. This methode is to be used for RICH standalone when no other detectors are switched on, so normal tracking is not available. |
118 | // Arguments: hn- output ntuple where to store all variables | |
119 | // Returns: none | |
d3eb6079 | 120 | AliDebug(1,"Start."); |
30c60010 | 121 | AliRICH *pRich=((AliRICH*)gAlice->GetDetector("RICH")); |
122 | ||
1cb5a97c | 123 | // pRich->GetLoader()->GetRunLoader()->LoadHeader(); |
d3eb6079 | 124 | if(!pRich->GetLoader()->GetRunLoader()->TreeK()) pRich->GetLoader()->GetRunLoader()->LoadKinematics(); |
30c60010 | 125 | AliStack *pStack = pRich->GetLoader()->GetRunLoader()->Stack(); |
39853df5 | 126 | if(!pStack) {AliDebug(1,Form("No STACK found in AliRoot"));return;} |
30c60010 | 127 | Int_t iNtracks=pStack->GetNtrack(); |
1cb5a97c | 128 | AliDebug(1,Form(" Start reconstruction with %i track(s) from Stack",iNtracks)); |
129 | ||
ab92fbe6 | 130 | Double_t hnvec[20]; |
1cb5a97c | 131 | |
30c60010 | 132 | Double_t b=GetFieldMap()->SolenoidField()/10;// magnetic field in Tesla |
133 | AliDebug(1,Form("Start with simulated %i tracks in %f Tesla field",iNtracks,b)); | |
134 | TVector3 x0(0,0,0); TVector3 p0(0,0,0);//tmp storage for AliRICHHelix | |
135 | ||
136 | ||
1cb5a97c | 137 | if(pRich->GetLoader()->LoadRecPoints()) {AliDebug(1,Form("No clusters found in RICH"));return;} |
138 | pRich->GetLoader()->TreeR()->GetEntry(0); | |
139 | ||
db910db9 | 140 | AliRICHRecon recon; |
a25b3368 | 141 | for(Int_t iTrackN=0;iTrackN<iNtracks;iTrackN++){//stack particles loop |
30c60010 | 142 | TParticle *pParticle = pStack->Particle(iTrackN); |
39853df5 | 143 | if(!pParticle) {AliDebug(1,Form("Not a valid TParticle pointer. Track skipped"));continue;} |
144 | AliDebug(1,Form(" PDG code : %i",pParticle->GetPdgCode())); | |
ab92fbe6 | 145 | // |
146 | // problem of PDG code of some extra particles to be solved!!!!!!!!! | |
147 | // | |
148 | // found problem! Look in TRD directory : codes from Fluka are : | |
149 | // | |
150 | // if ((pdg_code == 10010020) || | |
151 | // (pdg_code == 10010030) || | |
152 | // (pdg_code == 50000050) || | |
153 | // (pdg_code == 50000051) || | |
154 | // (pdg_code == 10020040)) { | |
155 | // | |
156 | if(pParticle->GetPdgCode()>=50000050||pParticle->GetPdgCode()==0||pParticle->GetPdgCode()>10000) {AliDebug(1,Form("A photon as track... Track skipped"));continue;} | |
1e066c96 | 157 | if(!pParticle->GetPDG()) continue; |
ab92fbe6 | 158 | // |
159 | // to be updated for us!! | |
160 | // | |
9f873529 | 161 | AliDebug(1,Form("Track %i is a %s with charge %i and momentum %f", |
162 | iTrackN,pParticle->GetPDG()->GetName(),Int_t(pParticle->GetPDG()->Charge()),pParticle->P())); | |
163 | // if(pParticle->GetMother(0)!=-1) continue; //consider only primaries | |
164 | if(pParticle->GetPDG()->Charge()==0||TMath::Abs(Int_t(pParticle->GetPDG()->Charge()))!=3) continue; //to avoid photons from stack... | |
1cb5a97c | 165 | hnvec[0]=pParticle->P(); |
166 | hnvec[1]=pParticle->GetPDG()->Charge(); | |
db910db9 | 167 | |
168 | p0.SetMagThetaPhi(pParticle->P(),pParticle->Theta(),pParticle->Phi()); x0.SetXYZ(pParticle->Vx(),pParticle->Vy(),pParticle->Vz()); | |
9f873529 | 169 | AliRICHHelix helix(x0,p0,TMath::Sign(1,(Int_t)pParticle->GetPDG()->Charge()),b); |
db910db9 | 170 | Int_t iChamber=helix.RichIntersect(AliRICHParam::Instance()); |
171 | if(!iChamber) continue;// no intersection with RICH found | |
172 | ||
ef210ba6 | 173 | hnvec[2]=helix.Ploc().Theta(); |
174 | hnvec[3]=helix.Ploc().Phi(); | |
1cb5a97c | 175 | hnvec[4]=helix.PosPc().X(); |
176 | hnvec[5]=helix.PosPc().Y(); | |
db910db9 | 177 | |
178 | Double_t dX,dY,dR,dRmip=9999; //min distance between clusters and track position on PC | |
0fe8fa07 | 179 | Int_t iMipId=-1; //index of that min distance cluster |
db910db9 | 180 | for(Int_t iClu=0;iClu<pRich->Clus(iChamber)->GetEntries();iClu++){//clusters loop for intersected chamber |
181 | AliRICHCluster *pClu=(AliRICHCluster*)pRich->Clus(iChamber)->UncheckedAt(iClu);//get pointer to current cluster | |
182 | pClu->DistXY(helix.PosPc(),dX,dY); dR=TMath::Sqrt(dX*dX+dY*dY);//ditance between current cluster and helix intersection with PC | |
183 | if(dR<dRmip){dRmip=dR; hnvec[6]=pClu->X();hnvec[7]=pClu->Y();hnvec[8]=pClu->Q(); | |
184 | iMipId=1000000*iChamber+iClu;}//find cluster nearest to the track | |
30c60010 | 185 | |
a25b3368 | 186 | }//clusters loop for intersected chamber |
30c60010 | 187 | |
db910db9 | 188 | |
189 | hnvec[9]=recon.ThetaCerenkov(&helix,pRich->Clus(iChamber),iMipId); //search for mean Cerenkov angle for this track | |
190 | hnvec[10]=iMipId;//on return from ThetaCerenkov() contains number of photon candidates accepted | |
1cb5a97c | 191 | hnvec[11]=(Double_t)iMipId; |
ab92fbe6 | 192 | hnvec[12]=(Double_t)iChamber; |
193 | hnvec[13]=(Double_t)pParticle->GetPdgCode(); | |
1cb5a97c | 194 | if(hn) hn->Fill(hnvec); |
db910db9 | 195 | AliDebug(1,Form("FINAL Theta Cerenkov=%f",hnvec[9])); |
a25b3368 | 196 | }//stack particles loop |
1cb5a97c | 197 | |
39853df5 | 198 | pRich->GetLoader()->UnloadRecPoints(); |
30c60010 | 199 | AliDebug(1,"Stop."); |
a25b3368 | 200 | }//RecWithStack |
db910db9 | 201 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |
84093f6f | 202 | void AliRICHTracker::EsdQA(Bool_t isPrint) |
30c60010 | 203 | { |
84093f6f | 204 | // Reads a set of ESD files and print out or plot some information |
205 | // Arguments: isPrint is a flag to choose between printing (isPrint = kTRUE) and plotting (isPrint = kFALSE) | |
2a92c3fe | 206 | // Returns: none |
207 | ||
208 | TFile *pFile=TFile::Open("AliESDs.root","read"); if(!pFile) {Printf("ERROR: AliESDs.root does not exist!");return;} | |
209 | TTree *pTr=(TTree*)pFile->Get("esdTree"); if(!pTr) {Printf("ERROR: AliESDs.root, no ESD tree inside!");return;} | |
210 | AliESD *pEsd=new AliESD; pTr->SetBranchAddress("ESD", &pEsd); | |
db910db9 | 211 | |
2a92c3fe | 212 | Int_t iNevt=pTr->GetEntries(); Printf("This ESD contains %i events",iNevt); |
84093f6f | 213 | //AliRICHParam *pPar; |
214 | ||
68cc5666 | 215 | TH1D *pDx=0,*pDy=0,*pProbEl=0,*pProbMu=0,*pProbPi=0,*pProbKa=0,*pProbPr=0,*pMom=0; TH2F *pThP=0; TProfile *pChiTh=0; |
84093f6f | 216 | if(!isPrint){ |
217 | TH1::AddDirectory(kFALSE); | |
218 | pDx =new TH1D("dX" ,"distance between Xmip and Xtrack;cm",300,-1.5,1.5); | |
219 | pDy =new TH1D("dY" ,"distance between Ymip and Ytrack;cm",300,-1.5,1.5); | |
84093f6f | 220 | pProbPi=new TH1D("RichProbPion","HMPID PID probability for e #mu #pi" ,101,0.05,1.05); pProbPi->SetLineColor(kRed); |
221 | pProbEl=new TH1D("RichProbEle" ,"" ,101,0.05,1.05); pProbEl->SetLineColor(kGreen); | |
222 | pProbMu=new TH1D("RichProbMuon" ,"" ,101,0.05,1.05); pProbMu->SetLineColor(kBlue); | |
223 | pProbKa=new TH1D("RichProbKaon","HMPID PID probability for K" ,101,0.05,1.05); | |
224 | pProbPr=new TH1D("RichProbProton","HMPID PID probability for p" ,101,0.05,1.05); | |
68cc5666 | 225 | pMom =new TH1D("pMom","Momentum of tracks",200,0.,10.); |
84093f6f | 226 | pChiTh =new TProfile("RichChiTh","#chi^{2};#theta_{C}" ,80 ,0,0.8 , -2,2); |
68cc5666 | 227 | pThP =new TH2F("tvsp","#theta_{Ckov} radian;P GeV" ,65 ,-0.5,6.0,75,0,0.75); pThP->SetStats(0); |
84093f6f | 228 | |
229 | //if(!gGeoManager)TGeoManager::Import("geometry.root"); | |
230 | //pPar = AliRICHParam::Instance(); | |
231 | } | |
232 | ||
db910db9 | 233 | for(Int_t iEvt=0;iEvt<iNevt;iEvt++){//ESD events loop |
2a92c3fe | 234 | pTr->GetEvent(iEvt); |
235 | Int_t iNtracks=pEsd->GetNumberOfTracks(); Printf("ESD contains %i tracks created in Bz=%.2f Tesla",iNtracks,pEsd->GetMagneticField()/10.); | |
db910db9 | 236 | for(Int_t iTrk=0;iTrk<iNtracks;iTrk++){//ESD tracks loop |
2a92c3fe | 237 | AliESDtrack *pTrack = pEsd->GetTrack(iTrk);// get next reconstructed track |
2714766e | 238 | Float_t dx,dy; pTrack->GetRICHdxdy(dx,dy); |
239 | Float_t theta,phi; pTrack->GetRICHthetaPhi(theta,phi); | |
240 | TString comment; | |
84093f6f | 241 | if(isPrint){ |
242 | if(pTrack->GetRICHsignal()>0) comment="OK"; | |
243 | else if(pTrack->GetRICHsignal()==kMipQdcCut) comment="no enough QDC"; | |
244 | else if(pTrack->GetRICHsignal()==kMipDistCut) comment="nearest cluster is too far"; | |
245 | else if(pTrack->GetRICHsignal()==-1) comment="no intersection"; | |
246 | Double_t pid[5]; pTrack->GetRICHpid(pid); | |
247 | Printf("Tr %2i Q=%4.1f P=%.3f GeV Tr-Mip=%5.2f cm Th=%7.3f rad Prob : e=%.4f mu=%.4f pi=%.4f K=%.4f p=%.4f %s" , | |
248 | iTrk,pTrack->GetSign(),pTrack->GetP(),TMath::Sqrt(dx*dx+dy*dy),pTrack->GetRICHsignal(), | |
249 | pid[0],pid[1],pid[2],pid[3],pid[4], comment.Data()); | |
250 | }else{//collect hists | |
68cc5666 | 251 | pMom->Fill(pTrack->GetP()); |
84093f6f | 252 | pDx->Fill(dx); pDy->Fill(dy); |
253 | pThP->Fill(pTrack->GetP(),pTrack->GetRICHsignal()); | |
254 | pChiTh->Fill(pTrack->GetRICHsignal(),pTrack->GetRICHchi2()); | |
255 | Double_t prob[5]; pTrack->GetRICHpid(prob); | |
256 | pProbEl->Fill(prob[0]); pProbMu->Fill(prob[1]); pProbPi->Fill(prob[2]); pProbKa->Fill(prob[3]); pProbPr->Fill(prob[4]); | |
257 | }//if plot | |
db910db9 | 258 | }//ESD tracks loop |
259 | }//ESD events loop | |
2a92c3fe | 260 | delete pEsd; pFile->Close();//close AliESDs.root |
84093f6f | 261 | if(!isPrint){ |
262 | TCanvas *pC=new TCanvas("c","Quality",1200,1500); pC->Divide(2,2); | |
68cc5666 | 263 | TF1 *pPion = new TF1("RICHtheor","acos(sqrt(x*x+[0]*[0])/(x*[1]))",1.2,6); pPion->SetLineWidth(1); |
264 | pPion->SetParameter(1,1.292); //ref idx | |
265 | AliPID ppp; pPion->SetLineColor(kRed); pPion->SetParameter(0,AliPID::ParticleMass(AliPID::kPion)); //mass | |
266 | TF1 *pKaon = (TF1*)pPion->Clone(); pKaon->SetLineColor(kGreen); pKaon->SetParameter(0,AliPID::ParticleMass(AliPID::kKaon)); | |
267 | TF1 *pProt = (TF1*)pPion->Clone(); pProt->SetLineColor(kBlue); pProt->SetParameter(0,AliPID::ParticleMass(AliPID::kProton)); | |
84093f6f | 268 | |
269 | pC->cd(1); pDx->Draw(); | |
270 | pC->cd(2); pDy->Draw(); | |
68cc5666 | 271 | pC->cd(3); pThP->Draw(); pPion->Draw("same"); pKaon->Draw("same"); pProt->Draw("same"); //Theta Ckov versus p + theoretical curves |
272 | pC->cd(4); pChiTh->Draw(); //Theta Ckov error versus theta Ckov | |
84093f6f | 273 | |
274 | TCanvas *pC2=new TCanvas("c2","Quality 2",1200,1500); pC2->Divide(2,2); | |
275 | pC2->cd(1); pProbPi->Draw(); pProbMu->Draw("same"); pProbEl->Draw("same"); | |
276 | pC2->cd(2); pProbKa->Draw(); | |
277 | pC2->cd(3); pProbPr->Draw(); | |
68cc5666 | 278 | pC2->cd(4); pMom->Draw(); |
84093f6f | 279 | } |
2a92c3fe | 280 | } |
281 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ | |
282 | void AliRICHTracker::MatrixPrint(Double_t probCut) | |
283 | { | |
284 | // Reads a set of 3 ESD files from current directory and prints out the matrix of probabilities to pion kaon or proton completely blindly withou nay assumption on the contents of files. | |
285 | // Normally it implies that those 3 ESDs contain only particles of the same sort namly pions, kaons and protons in that order. | |
286 | // Arguments: probCut - cut on probability | |
287 | // Returns: none | |
288 | for(Int_t iFile=0;iFile<3;iFile++){ | |
289 | TFile *pFile=TFile::Open(Form("Esd%1i.root",iFile+1),"read"); if(!pFile) {Printf("ERROR: Esd%1i.root does not exist!",iFile+1);return;} | |
290 | TTree *pTr=(TTree*)pFile->Get("esdTree"); if(!pTr) {Printf("ERROR: Esd%1i.root, no ESD tree inside!",iFile+1);return;} | |
291 | AliESD *pEsd=new AliESD; pTr->SetBranchAddress("ESD", &pEsd); | |
292 | Int_t iProtCnt=0,iKaonCnt=0,iPionCnt=0,iUnreconCnt=0,iTrkCnt=0; //counters | |
293 | ||
294 | for(Int_t iEvt=0;iEvt<pTr->GetEntries();iEvt++){//ESD events loop | |
295 | pTr->GetEvent(iEvt); | |
296 | iTrkCnt+=pEsd->GetNumberOfTracks(); | |
297 | for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){//ESD tracks loop | |
298 | AliESDtrack *pTrack = pEsd->GetTrack(iTrk);// get next reconstructed track | |
2714766e | 299 | Float_t dx,dy; pTrack->GetRICHdxdy(dx,dy); |
300 | Float_t theta,phi; pTrack->GetRICHthetaPhi(theta,phi); | |
2a92c3fe | 301 | Double_t prob[5]; pTrack->GetRICHpid(prob); |
302 | if(pTrack->GetRICHsignal()>0){ | |
303 | if(prob[4]>probCut) iProtCnt++; | |
304 | if(prob[3]>probCut) iKaonCnt++; | |
305 | if((prob[0]+prob[1]+prob[2])>probCut) iPionCnt++; | |
306 | } else | |
307 | iUnreconCnt++; | |
308 | }//ESD tracks loop | |
309 | ||
310 | }//ESD events loop | |
311 | Printf("Bz=%5.2f Events=%i Total tracks=%i No recognized tracks=%i Pion=%i Kaon=%i Proton=%i ProbCut=%.2f", | |
312 | 0.1*pEsd->GetMagneticField(),pTr->GetEntries(),iTrkCnt,iUnreconCnt,iPionCnt,iKaonCnt,iProtCnt,probCut); | |
313 | delete pEsd; pFile->Close();//close AliESDs.root | |
314 | }//files loop | |
db910db9 | 315 | } |
316 | //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ |