1 #if !defined(__CINT__) || defined(__MAKECINT__)
9 #include <TCanvasImp.h>
12 #include <TClonesArray.h>
13 #include <TParticle.h>
18 #include <TPolyMarker.h>
20 #include <AliESDEvent.h>
21 #include <AliCDBManager.h>
22 #include <AliCDBEntry.h>
23 #include "AliHMPIDHit.h"
24 #include "AliHMPIDv2.h"
25 #include "AliHMPIDReconstructor.h"
26 #include "AliHMPIDRecon.h"
27 #include "AliHMPIDParam.h"
28 #include "AliHMPIDCluster.h"
29 #include "AliTracker.h"
34 AliHMPIDParam *fParam;
37 TCanvas *fCanvas=0; Int_t fType=1; Int_t fEvt=-1; Int_t fNevt=0;
38 TCanvasImp *fCanvasImp;
39 TFile *fHitFile; TTree *fHitTree; TClonesArray *fHitLst; TPolyMarker *fRenMip[7]; TPolyMarker *fRenCko[7]; TPolyMarker *fRenFee[7];
40 TClonesArray *fSdiLst;
41 TFile *fDigFile; TTree *fDigTree; TObjArray *fDigLst; TBox *fRenDig[7][160*144]; TBox *fBox[7][160*144];
42 TFile *fCluFile; TTree *fCluTree; TObjArray *fCluLst; TPolyMarker *fRenClu[7];
43 TFile *fEsdFile; TTree *fEsdTree; AliESDEvent *fEsd; TPolyMarker *fRenTxC[7]; TPolyMarker *fRenRin[7];
44 TFile *fCosFile; TTree *fCosTree;
46 TButton *fHitMipBok,*fHitCkoBok,*fHitFeeBok,*fDigBok,*fCluBok,*fEsdBok;
48 TString fStHitMip = "ON";
49 TString fStHitCko = "ON";
50 TString fStHitFee = "ON";
51 TString fStDig = "ON";
52 TString fStClu = "ON";
53 TString fStEsd = "ON";
57 Int_t fMaxCharge = 200; //maximum charge to saturate color to red
59 Int_t fChamN[9]={6,5,-1,4,3,2,-1,1,0};
61 Int_t fTotPads[7],fTotClus[7];
68 AliLoader *gDL=0; // detector loader (needed to get Digits and Clusters)
72 enum EObjectType {kHitMip=kOpenTriangleUp,kHitCko=kOpenCircle,kHitFee=kOpenDiamond,kCluster=kStar,kTrack=kPlus,kRing=kFullDotSmall};
73 // kOpenTriangleUp Hit Mip
74 // kOpenCircle Hit Ckov
75 // kOpenDiamond Hit Feedback
80 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
81 void CreateContainers()
82 {//to create all containers
83 fHitLst=new TClonesArray("AliHMPIDHit");
84 fSdiLst=new TClonesArray("AliHMPIDDigit");
85 fDigLst=new TObjArray(7); for(Int_t i=0;i<7;i++) fDigLst->AddAt(new TClonesArray("AliHMPIDDigit"),i); fDigLst->SetOwner(kTRUE);
86 fCluLst=new TObjArray(7); for(Int_t i=0;i<7;i++) fCluLst->AddAt(new TClonesArray("AliHMPIDCluster"),i); fCluLst->SetOwner(kTRUE);
87 fEsd =new AliESDEvent;
89 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
92 for(Int_t ch=0;ch<7;ch++){
93 fRenMip[ch]=new TPolyMarker; fRenMip[ch]->SetMarkerStyle(kOpenTriangleUp);fRenMip[ch]->SetMarkerColor(kBlack) ;
94 fRenCko[ch]=new TPolyMarker; fRenCko[ch]->SetMarkerStyle(kOpenCircle); fRenCko[ch]->SetMarkerColor(kBlack) ;
95 fRenFee[ch]=new TPolyMarker; fRenFee[ch]->SetMarkerStyle(kOpenDiamond); fRenFee[ch]->SetMarkerColor(kBlack) ;
96 fRenClu[ch]=new TPolyMarker; fRenClu[ch]->SetMarkerStyle(kStar); fRenClu[ch]->SetMarkerColor(kMagenta);
97 fRenTxC[ch]=new TPolyMarker; fRenTxC[ch]->SetMarkerStyle(kPlus); fRenTxC[ch]->SetMarkerColor(kRed) ;
98 fRenTxC[ch]->SetMarkerSize(3);
99 fRenRin[ch]=new TPolyMarker; fRenRin[ch]->SetMarkerStyle(kFullDotSmall); fRenRin[ch]->SetMarkerColor(kMagenta);
101 for(Int_t iDig=0;iDig<160*144;iDig++) {
102 fRenDig[ch][iDig] = new TBox;
103 fRenDig[ch][iDig]->SetFillStyle(1);
104 fBox[ch][iDig] = new TBox;
105 fBox[ch][iDig]->SetFillStyle(0);
109 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
112 for(Int_t ch=0;ch<7;ch++){
113 fRenTxC[ch]->SetPolyMarker(0);
114 fRenRin[ch]->SetPolyMarker(0);
115 fRenMip[ch]->SetPolyMarker(0);
116 fRenCko[ch]->SetPolyMarker(0);
117 fRenFee[ch]->SetPolyMarker(0);
119 fRenClu[ch]->SetPolyMarker(0);
122 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
125 //Prints a list of HMPID hits for a given event. Default is event number 0.
126 if(!fHitTree) return;
127 Printf("List of HMPID hits for event %i",fEvt);
129 for(Int_t iEnt=0;iEnt<fHitTree->GetEntries();iEnt++){//entries loop
130 fHitTree->GetEntry(iEnt);
132 iTot+=fHitLst->GetEntries();
134 Printf("totally %i hits for event %i",iTot,fEvt);
136 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
138 {//prints a list of HMPID sdigits for a given event
139 Printf("List of HMPID sdigits for event %i",fEvt);
141 Printf("totally %i sdigits for event %i",fSdiLst->GetEntries(),fEvt);
143 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
145 {//prints a list of HMPID digits
146 Printf("List of HMPID digits for event %i",fEvt);
148 Int_t iTot=0; for(Int_t i=0;i<7;i++) {iTot+=((TClonesArray*)fDigLst->At(i))->GetEntries();}
149 Printf("totally %i digits for event %i",iTot,fEvt);
151 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
153 {//prints a list of HMPID clusters for a given event
154 Printf("List of HMPID clusters for event %i",fEvt);
157 Int_t iTot=0; for(Int_t iCh=0;iCh<7;iCh++) iTot+=((TClonesArray*)fCluLst->At(iCh))->GetEntries();
159 Printf("totally %i clusters for event %i",iTot,fEvt);
161 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
163 {//prints a list of HMPID Esd for a given event
164 Printf("List of HMPID ESD summary for event %i",fEvt);
165 for(Int_t iTrk=0;iTrk<fEsd->GetNumberOfTracks();iTrk++){
166 AliESDtrack *pTrk = fEsd->GetTrack(iTrk);
167 Float_t x,y;Int_t q,nacc; pTrk->GetHMPIDmip(x,y,q,nacc);
168 Printf("Track %02i with phi %7.2f theta %7.2f p %7.2f with ThetaCer %5.3f with %i photons",iTrk,pTrk->Phi()*TMath::RadToDeg(),
169 pTrk->Theta()*TMath::RadToDeg(),
170 pTrk->GetP(),pTrk->GetHMPIDsignal(),nacc);
173 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
174 void DrawChamber(Int_t iCh)
175 {//used by Draw() to Draw() chamber structure
176 gPad->Range(-10,-10,AliHMPIDParam::SizeAllX()+5,AliHMPIDParam::SizeAllY()+5);
177 if(iCh>=0){TLatex txt; txt.SetTextSize(0.06); txt.DrawLatex(55,-9,Form("RICH %i",iCh));}
179 for(Int_t iPc=AliHMPIDParam::kMinPc;iPc<=AliHMPIDParam::kMaxPc;iPc++){
180 TBox *pBox=new TBox(AliHMPIDParam::MinPcX(iPc),AliHMPIDParam::MinPcY(iPc),
181 AliHMPIDParam::MaxPcX(iPc),AliHMPIDParam::MaxPcY(iPc));
182 pBox->SetFillStyle(0); pBox->Draw();
185 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
187 {//used by Draw() to draw legend
188 Int_t nTxC=0,nMip=0,nCko=0,nFee=0,nDig=0,nClu=0;
189 for(Int_t ch=0;ch<7;ch++){
190 nTxC+=fRenTxC[ch]->Size();
191 nMip+=fRenMip[ch]->Size();
192 nCko+=fRenCko[ch]->Size();
193 nFee+=fRenFee[ch]->Size();
194 nClu+=fRenClu[ch]->Size();
197 TLegend *pLeg=new TLegend(0.15,0.3,0.85,0.98);
198 pLeg->SetHeader(Form("Event %i Total %i",fEvt,fNevt));
199 pLeg->AddEntry(fRenTxC[0], Form("TRKxPC %i" ,nTxC),"p");
200 pLeg->AddEntry(fRenMip[0], Form("Mip hits %i" ,nMip),"p");
201 pLeg->AddEntry(fRenCko[0], Form("Ckov hits %i" ,nCko),"p");
202 pLeg->AddEntry(fRenFee[0], Form("Feed hits %i" ,nFee),"p");
203 pLeg->AddEntry(fRenDig[0][0],Form("Digs %i" ,nDig),"p");
204 pLeg->AddEntry(fRenClu[0], Form("Clus %i" ,nClu),"p");
207 /* TLegend *pLeg2 = new TLegend(0.4,0.087,0.8,0.97);
208 pLeg2->SetHeader("");
209 pLeg2->AddEntry(fRenMip[0],Form("Mip hits %i" ,nMip),"p");
212 TBox *pBox = new TBox(0.012,0.01,0.97,0.28);
215 TText *pText = new TText(0.35,0.21, "ddl = (0....13)");
216 pText->SetTextSize(0.06);
219 TText *pText2 = new TText(0.09,0.15,"RICH n ---> ddl 2n (left) & 2n+1 (right)");
220 pText2->SetTextSize(0.06);
223 TText *pText3 = new TText(0.1,0.09, "phcat (0,2,4) left, phcat (1,3,5) right");
224 pText3->SetTextSize(0.06);
227 TText *pText4 = new TText(0.35,0.03, Form("sigma cut = %i",qSigmaCut));
228 pText4->SetTextSize(0.06);
232 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
234 {//draws all the objects of current event in given canvas
235 Int_t iPadN[7]={9,8,6,5,4,2,1};
236 Int_t sampleCol = fMaxCharge/gStyle->GetNumberOfColors();
237 for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
238 fCanvas->cd(iPadN[iCh]);
239 gPad->SetEditable(kTRUE); gPad->Clear(); DrawChamber(iCh);
243 for(Int_t iDig=0;iDig<nDigs[iCh];iDig++) {
244 Int_t charge = fRenDig[iCh][iDig]->GetUniqueID();
245 Int_t color = charge/sampleCol;if(color>=gStyle->GetNumberOfColors()) color = gStyle->GetNumberOfColors()-1;
246 fRenDig[iCh][iDig]->SetFillColor(gStyle->GetColorPalette(color));
247 fRenDig[iCh][iDig]->Draw();
248 fBox[iCh][iDig]->Draw();
253 if(fEsdFile){if(fStEsd =="ON") fRenTxC[iCh]->Draw();}
256 if(fStHitMip=="ON") fRenMip[iCh]->Draw();
257 if(fStHitFee=="ON") fRenFee[iCh]->Draw();
258 if(fStHitCko=="ON") fRenCko[iCh]->Draw();
261 if(fEsdFile){if(fStEsd =="ON") fRenRin[iCh]->Draw();}
262 if(fCluFile){if(fStClu =="ON") fRenClu[iCh]->Draw();}
263 gPad->SetEditable(kFALSE);
266 fCanvas->cd(3); gPad->Clear(); DrawLegend();
271 fHitMipBok->SetTitle(Form("Mips %s",fStHitMip.Data())); fHitMipBok->Modified();
272 fHitCkoBok->SetTitle(Form("Ckov %s",fStHitCko.Data())); fHitCkoBok->Modified();
273 fHitFeeBok->SetTitle(Form("Fdbk %s",fStHitFee.Data())); fHitFeeBok->Modified();
275 if(fDigFile){fDigBok->SetTitle(fStDig); fDigBok->Modified();}
276 if(fCluFile){fCluBok->SetTitle(fStClu); fCluBok->Modified();}
277 if(fEsdFile){fEsdBok->SetTitle(fStEsd); fEsdBok->Modified();}
280 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
281 void RenderHit(TClonesArray *pHitLst)
282 {//used by ReadEvent() to render hits to polymarker structures, one per chamber
283 for(Int_t iHit=0;iHit<pHitLst->GetEntries();iHit++){ //hits loop
284 AliHMPIDHit *pHit = (AliHMPIDHit*)pHitLst->At(iHit); Int_t ch=pHit->Ch(); Float_t x=pHit->LorsX(); Float_t y=pHit->LorsY(); //get current hit
286 case 50000050: fRenCko[ch]->SetNextPoint(x,y);break;
287 case 50000051: fRenFee[ch]->SetNextPoint(x,y);break;
288 default: fRenMip[ch]->SetNextPoint(x,y);break;
290 // Printf("----------ihit %i ch %i chhit %i MIP %i CKO %i FEE %i",iHit,ch,pHit->Pid());
291 }//hits loop for this entry
293 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
294 void RenderDig(TObjArray *pDigLst)
295 {//used by ReadEvent() to render digs to Tbox structures, one per chamber
297 Printf("RENDERDIG : event n. %i",fEvt);
299 for(Int_t iCh=0;iCh<=6;iCh++){ //chambers loop
300 TClonesArray *pDigCham=(TClonesArray*)pDigLst->At(iCh); //get digs list for this chamber
302 fTotPads[iCh] = pDigCham->GetEntries();
304 for(Int_t iDig=0;iDig<pDigCham->GetEntries();iDig++){ //digs loop
305 AliHMPIDDigit *pDig = (AliHMPIDDigit*)pDigCham->At(iDig); Float_t x=pDig->LorsX(); Float_t y=pDig->LorsY(); //get current hit
306 if((Int_t)pDig->Q()<=qSigmaCut) continue;
307 fRenDig[iCh][iDigEff]->SetX1(x-0.5*AliHMPIDParam::SizePadX());
308 fRenDig[iCh][iDigEff]->SetX2(x+0.5*AliHMPIDParam::SizePadX());
309 fRenDig[iCh][iDigEff]->SetY1(y-0.5*AliHMPIDParam::SizePadY());
310 fRenDig[iCh][iDigEff]->SetY2(y+0.5*AliHMPIDParam::SizePadY());
311 fRenDig[iCh][iDigEff]->SetUniqueID((Int_t)pDig->Q());
312 fBox[iCh][iDigEff]->SetX1(x-0.5*AliHMPIDParam::SizePadX());
313 fBox[iCh][iDigEff]->SetX2(x+0.5*AliHMPIDParam::SizePadX());
314 fBox[iCh][iDigEff]->SetY1(y-0.5*AliHMPIDParam::SizePadY());
315 fBox[iCh][iDigEff]->SetY2(y+0.5*AliHMPIDParam::SizePadY());
319 }//hits loop for this entry
321 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
322 void RenderClu(TObjArray *pClus)
323 {//used by ReadEvent() to render clusters to polymarker structures, one per chamber
324 for(Int_t iCh=0;iCh<=6;iCh++){ //chambers loop
325 TClonesArray *pClusCham=(TClonesArray*)pClus->At(iCh); //get clusters list for this chamber
326 fTotClus[iCh] = pClusCham->GetEntries();
327 for(Int_t iClu=0;iClu<pClusCham->GetEntries();iClu++){ //clusters loop
328 AliHMPIDCluster *pClu = (AliHMPIDCluster*)pClusCham->At(iClu); //get current cluster
329 fRenClu[iCh]->SetNextPoint(pClu->X(),pClu->Y());
330 // Printf("RenderClu: ch %i x %f y %f",iCh,pClu->X(),pClu->Y());
332 }//chamber loop for this entry
334 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
335 void RenderEsd(AliESDEvent *pEsd)
336 {//used by ReadEvent() to render ESD to polymarker structures for rings and intersections one per chamber
338 for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){//tracks loop to collect cerenkov rings and intersection points
339 AliESDtrack *pTrk=pEsd->GetTrack(iTrk); Int_t ch=pTrk->GetHMPIDcluIdx(); //get track and chamber intersected by it
341 Float_t xPc,yPc,xRa,yRa,thRa,phRa;
342 pTrk->GetHMPIDtrk(xRa,yRa,thRa,phRa);;
343 if(ch<AliHMPIDParam::AliHMPIDParam::kMinCh||ch>AliHMPIDParam::kMaxCh) continue;//this track does not intersect any chamber
344 Int_t npTrk = fRenTxC[ch]->SetNextPoint(xRa,yRa); //add this intersection point
345 Float_t ckov=pTrk->GetHMPIDsignal(); //get ckov angle stored for this track
347 rec.SetTrack(xRa,yRa,thRa,phRa);
348 fRenRin[ch]->SetUniqueID(npTrk);
349 for(Int_t j=0;j<500;j++){
350 TVector2 pos; pos=rec.TracePhot(ckov,j*6.28/500.);
351 if(!AliHMPIDParam::IsInDead(pos.X(),pos.Y())) fRenRin[ch]->SetNextPoint(pos.X(),pos.Y());
356 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
357 TString Stack(Int_t evt,Int_t tid)
359 // Prints some useful info from stack
360 // Arguments: evt - event number. if not -1 print info only for that event
361 // tid - track id. if not -1 then print it and all it's mothers if any
362 // Returns: mother tid of the given tid if any
363 if(gAL->LoadHeader()) return -1;
364 if(gAL->LoadKinematics()) return -1;
367 AliStack *pStack=gAL->Stack();
368 TParticle *pTrack=pStack->Particle(tid);
369 // Int_t mtid=pTrack->GetFirstMother();
371 str.Append(Form("with P = %7.4f (%7.4f,%7.4f,%7.4f) GeV/c ",pTrack->P(),pTrack->Px(),pTrack->Py(),pTrack->Pz()));
372 gAL->UnloadHeader(); gAL->UnloadKinematics();
375 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
376 void DispTB(TString t0,TString t1,TString t2,TString t3)
378 fCanvasImp->SetStatusText(t0,0);
379 fCanvasImp->SetStatusText(t1,1);
380 fCanvasImp->SetStatusText(t2,2);
381 fCanvasImp->SetStatusText(t3,3);
383 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
384 Bool_t FindPos(TVector3 xyz,Int_t &cham,Int_t §,Int_t &gap,Int_t &padX,Int_t &padY)
386 // It finds the chamber parameters for a given point
387 // Arguments: xyz coordinates of a given point in MARS
388 // Returns: cham chamber ID ( 0-6 )
389 // sect sector ID ( 0-5 )
390 // padX X (integer) of the pad in X in the given sector (1-80)
391 // padY Y (integer) of the pad in Y in the given sector (1-48)
393 TGeoNode *node = gGeoManager->FindNode(xyz.X(),xyz.Y(),xyz.Z());
394 if(!node) return kFALSE;
395 TGeoVolume *vol = node->GetVolume();
396 if(!vol) return kFALSE;
397 TGeoManager *geo = vol->GetGeoManager();
398 if(!geo) return kFALSE;
400 while(geo->GetMother(i)) {
401 TString s = geo->GetMother(i)->GetName();
402 // if(s.Contains("Hcel_")) padX=(Int_t)(s.Remove(0,5)).Atof();
403 // if(s.Contains("Hrow_")) padY=(Int_t)(s.Remove(0,5)).Atof();
404 // if(s.Contains("Hsec_")) sect=(Int_t)(s.Remove(0,5)).Atof();
405 // if(s.Contains("Hmp_")) cham=(Int_t)(s.Remove(0,4)).Atof();
406 if(s.Contains("Hcel_")) padX=geo->GetMother(i)->GetNumber();
407 if(s.Contains("Hrow_")) padY=geo->GetMother(i)->GetNumber();
408 if(s.Contains("Hsec_")) sect=geo->GetMother(i)->GetNumber();
409 if(s.Contains("Hmp_")) cham=geo->GetMother(i)->GetNumber();
412 return (cham==-1) ? kFALSE : kTRUE;
414 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
415 void DisplayInfo(Int_t evt,Int_t px, Int_t py)
418 TVirtualPad *pPad=gPad->GetSelectedPad();
419 Int_t padN = pPad->GetNumber()-1;
420 if(padN<0 || padN>8) return;
421 Int_t ch,pc,padX,padY;
424 TString text0,text1,text2,text3;
426 Float_t x=pPad->AbsPixeltoX(px); Float_t y=pPad->AbsPixeltoY(py);
427 fParam->Lors2Pad(x,y,pc,padX,padY);
428 TVector3 xyz=fParam->Lors2Mars(ch,x,y);
430 if(padX>=0&&padY>=0) {
431 text0.Append(Form("Pad(%i,%i)-LORS(%6.2f,%6.2f)-MARS(%7.2f,%7.2f,%7.2f) A(%6.2f,%6.2f)",padX,padY,x,y,xyz.X(),xyz.Y(),xyz.Z(),
432 xyz.Theta()*TMath::RadToDeg(),xyz.Phi()*TMath::RadToDeg()));
433 text1.Append(Form("Module %i Sector %i",ch,pc));
435 text3.Append(Form("Pads = %i - Clusters = %i - Occupancy %5.2f%%",fTotPads[ch],fTotClus[ch],100.*fTotPads[ch]/(144.*160.)));
438 TObject *obj = fCanvas->GetSelected();
439 TString name = obj->GetName();
443 if(name=="") {DispTB(text0,text1,text2,text3);return;} // TLatex not interesting
445 if(name.Contains("TBox")) {
446 TBox *box = (TBox*)obj;
447 if(box->GetUniqueID()==0) return; // just black frame hit!
448 text2.Append(Form("charge = %i ADC",box->GetUniqueID()));
449 DispTB(text0,text1,text2,text3);
453 // Find object HITs CLUSTER TRACK and RING (based on TPolyMarker and symbol)
455 TPolyMarker *b = (TPolyMarker*)obj;
457 const Int_t big = 9999;
459 // check if point is near one of the points
460 Int_t distance = big;
463 Double_t *xPol = b->GetX();
464 Double_t *yPol = b->GetY();
466 for(Int_t i=0;i<b->Size();i++) {
467 Int_t pxp = pPad->XtoAbsPixel(pPad->XtoPad(xPol[i]));
468 Int_t pyp = pPad->YtoAbsPixel(pPad->YtoPad(yPol[i]));
469 Int_t d = TMath::Abs(pxp-px) + TMath::Abs(pyp-py);
470 if (d < distance) {distance = d; index=i;}
473 Int_t symbol = b->GetMarkerStyle();
475 // kOpenTriangleUp Hit Mip
476 // kOpenCircle Hit Ckov
477 // kOpenDiamond Hit Feedback
480 // kFullDotSmall Ring
482 // Case Hit Mip of Hit Ckov or Hit Feedback
483 if(symbol==kHitMip || symbol==kHitCko || symbol==kHitFee) {
484 if(evt!=kButton1Down) return;
486 Int_t iCko[7]={0,0,0,0,0,0,0};
487 Int_t iFee[7]={0,0,0,0,0,0,0};
488 Int_t iMip[7]={0,0,0,0,0,0,0};
493 Int_t indTrk = b->GetUniqueID(); // track index
494 for(Int_t iEnt=0;iEnt<fHitTree->GetEntries();iEnt++){//entries loop
495 fHitTree->GetEntry(iEnt);
496 for(iHit=0;iHit<fHitLst->GetEntries();iHit++) { //hits loop
497 AliHMPIDHit *pHit = (AliHMPIDHit*)fHitLst->At(iHit);
499 Int_t pid = pHit->Pid();
500 if(pid==50000050) iCko[chHit]++;
501 else if(pid==50000051) iFee[chHit]++;
504 if(symbol==kHitMip && ch==chHit && index==iMip[chHit]-1) {indTrk=iEnt;indHit = iHit;break;}
505 if(symbol==kHitCko && ch==chHit && index==iCko[chHit]-1) {indTrk=iEnt;indHit = iHit;break;}
506 if(symbol==kHitFee && ch==chHit && index==iFee[chHit]-1) {indTrk=iEnt;indHit = iHit;break;}
509 fHitTree->GetEntry(indTrk);
510 AliHMPIDHit *pHit = (AliHMPIDHit*)fHitLst->At(indHit);
512 Int_t tid = pHit->Tid();
514 TString str = Stack(fEvt,tid);
516 Float_t x=pHit->LorsX();
517 Float_t y=pHit->LorsY();
518 Float_t charge = pHit->Q();
520 TVector3 v = fParam->Lors2Mars(pHit->Ch(),pHit->LorsX(),pHit->LorsY());
521 Int_t cham,sect,gap,padX,padY;
522 FindPos(v,cham,sect,gap,padX,padY);
524 if(pHit->Pid()==50000050) {nameHit = " Cherenkov Photon ";}
525 else if(pHit->Pid()==50000051) {nameHit = " Feedback Photon ";}
526 else if(fPdg->GetParticle(pHit->Pid())) nameHit = fPdg->GetParticle(pHit->Pid())->GetName();
527 nameHit.Append(Form(" (tid %i)",tid));
528 text0="";text0.Append(Form("Hit(%5.2f,%6.2f) LORS - Pad Volume(%i,%i) - hit %i/%i",x,y,padX,padY,indHit+1,fHitLst->GetEntries()));
529 text2="";text2.Append(Form("Q = %7.2f ADC",charge));
530 text3="";text3="Particle: "+ nameHit +" "+ str;
532 else if (symbol==kCluster) {
533 TClonesArray *pClusCham=(TClonesArray*)fCluLst->At(ch); //get clusters list for this chamber
534 AliHMPIDCluster *pClu = (AliHMPIDCluster*)pClusCham->At(index); //get current cluster
535 text0="";text0.Append(Form("CLUSTER: x %6.2f y %6.2f",pClu->X(),pClu->Y()));
536 text2="";text2.Append(Form("charge = %i ADC",(Int_t)pClu->Q()));
538 else if (symbol==kTrack || symbol==kRing) {
539 if(symbol==kRing) index = b->GetUniqueID();
540 AliESDtrack *pTrk=fEsd->GetTrack(index);
541 Float_t xPc,yPc,thRa,phRa,xRa,yRa;
542 Int_t ch = AliHMPIDTracker::IntTrkCha(pTrk,xPc,yPc,xRa,yRa,thRa,phRa);
543 text0="";text0.Append(Form("TRACK n.%d: x %6.2f y %6.2f at PC plane in chamber %i",index,xPc,yPc,ch));
544 text2="";text2.Append(Form("p = %7.2f GeV/c",pTrk->GetP()));
545 Float_t ckov=pTrk->GetHMPIDsignal();
547 pTrk->GetHMPIDpid(prob);
549 Float_t x,y;Int_t q,nacc; pTrk->GetHMPIDmip(x,y,q,nacc);
550 text3="";text3.Append(Form("Theta Cherenkov %5.3f with %i photons | e %5.1f%% | u %5.1f%% | pi %5.1f%% | K %5.1f%% | p %5.1f%%",
551 pTrk->GetHMPIDsignal(),nacc,prob[0]*100,prob[1]*100,prob[2]*100,prob[3]*100,prob[4]*100));
554 //Update toolbar status
556 DispTB(text0,text1,text2,text3);
558 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
562 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
563 void DoZoom(Int_t evt, Int_t px, Int_t py, TObject *)
565 // Printf(" px %i py%i event %i",px,py,evt);
566 if(evt==kMouseMotion||evt==kButton1Down) DisplayInfo(evt,px,py);
567 if(evt==11) CloseInfo();
568 if(evt!=5 && evt!=6) return; //5- zoom in 6-zoom out
569 const Int_t minZoom=64;
570 const Int_t maxZoom=2;
571 static Int_t zoom[7]={64,64,64,64,64,64,64}; //zoom level
573 // if(!obj->IsA()->InheritsFrom("TPad")) return; //current object is not pad
574 TVirtualPad *pPad=gPad->GetSelectedPad();
575 Int_t padN = pPad->GetNumber()-1;
576 if(padN<0 || padN>8) return;
578 Int_t iCh = fChamN[padN];
581 if(evt==5&&zoom[iCh]==maxZoom) return;
582 if(evt==6&&zoom[iCh]==minZoom) return;
584 Float_t x=pPad->AbsPixeltoX(px); Float_t y=pPad->AbsPixeltoY(py);
586 if(evt==5){ zoom[iCh]=zoom[iCh]/2; pPad->Range(x-zoom[iCh]*2,y-zoom[iCh]*2,x+zoom[iCh]*2,y+zoom[iCh]*2);} //zoom in
587 if(evt==6){ zoom[iCh]=zoom[iCh]*2; pPad->Range(x-zoom[iCh]*2,y-zoom[iCh]*2,x+zoom[iCh]*2,y+zoom[iCh]*2);} //zoom out
588 if(zoom[iCh]==minZoom) pPad->Range(-10,-10,AliHMPIDParam::SizeAllX()+5,AliHMPIDParam::SizeAllY()+5);
589 ((TCanvas *)gTQSender)->SetTitle(Form("zoom x%i",minZoom/zoom[iCh]));
593 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
597 if(fStHitMip=="OFF") {fHitMipBok->SetFillColor(kRed);} else {fHitMipBok->SetFillColor(18);}
598 if(fStHitCko=="OFF") {fHitCkoBok->SetFillColor(kRed);} else {fHitCkoBok->SetFillColor(18);}
599 if(fStHitFee=="OFF") {fHitFeeBok->SetFillColor(kRed);} else {fHitFeeBok->SetFillColor(18);}
601 if(fDigFile){if(fStDig =="OFF") {fDigBok->SetFillColor(kRed);} else {fDigBok->SetFillColor(18);}}
602 if(fCluFile){if(fStClu =="OFF") {fCluBok->SetFillColor(kRed);} else {fCluBok->SetFillColor(18);}}
603 if(fEsdFile){if(fStEsd =="OFF") {fEsdBok->SetFillColor(kRed);} else {fEsdBok->SetFillColor(18);}}
605 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
610 Printf("get Event...... event n. %i",fEvt);
614 Printf(" trigger %i for event %i",Trigger(),fEvt);
623 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
630 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
637 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
642 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
644 {//display events from files if any in current directory or simulated events
646 fParam=AliHMPIDParam::Instance(); // first invocation of AliHMPIDParam to initialize geometry...
647 fPdg = TDatabasePDG::Instance(); // first invocation of TDatabasePDG to retrieve particle infos...
652 TString title="Session with";
656 if(gSystem->IsFileInIncludePath("HMPID.Hits.root")){// tries to open hits
657 fHitFile=TFile::Open("HMPID.Hits.root"); fNevt=fHitFile->GetNkeys(); fType=1; title+=Form(" HITS-%i ",fNevt);
660 if(gSystem->IsFileInIncludePath("HMPID.Digits.root")){// tries to open clusters
661 fDigFile=TFile::Open("HMPID.Digits.root"); fNevt=fDigFile->GetNkeys(); fType=1; title+=Form(" DIGITS-%i ",fNevt);
664 if(gSystem->IsFileInIncludePath("HMPID.RecPoints.root")){// tries to open clusters
665 fCluFile=TFile::Open("HMPID.RecPoints.root"); fNevt=fCluFile->GetNkeys(); fType=1; title+=Form(" CLUSTERS-%i ",fNevt);
668 if(gSystem->IsFileInIncludePath("cosmic.root")){ //clm: Check if cosmic file is in the folder
669 fCosFile=TFile::Open("cosmic.root"); fCosTree=(TTree*)fCosFile->Get("cosmic"); fNevt=fCosTree->GetEntries(); fType=2;
670 fCosTree->SetBranchAddress("Digs",&fDigLst); fCosTree->SetBranchAddress("Clus",&fCluLst);
673 if(gSystem->IsFileInIncludePath("AliESDs.root")){
674 fEsdFile=TFile::Open("AliESDs.root");
676 fEsdTree=(TTree*)fEsdFile->Get("esdTree");
677 fEsd->ReadFromTree(fEsdTree); fEsd->GetStdContent(); //clm: new ESD schema: see Task Force meeting 20th June, 2007
679 fNevt=fEsdTree->GetEntries(); fType=1; title+=Form(" ESD-%i ",fNevt);
680 } else {delete fEsdFile;fEsdFile=0x0;}
681 } else {delete fEsdFile; delete fEsdTree;}
684 fCanvas=new TCanvas("all","",-1024,768);fCanvas->SetWindowSize(1024,768);
685 fCanvasImp = fCanvas->GetCanvasImp();
686 fCanvasImp->ShowStatusBar();
687 fCanvas->Divide(3,3,0,0);// pAll->ToggleEditor();
688 fCanvas->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",0,0,"DoZoom(Int_t,Int_t,Int_t,TObject*)");
690 gStyle->SetPalette(1,0);
692 case 1: fCanvas->SetTitle(title.Data());
693 TButton *pNxtBtn = new TButton("Next" ,"NextEvent()" ,0.0,0.0,0.3,0.1); pNxtBtn->Draw();
694 TButton *pPrvBtn = new TButton("Previous" ,"PrevEvent()" ,0.3,0.0,0.6,0.1); pPrvBtn->Draw();
695 if(fHitFile){TButton *pHitBtn = new TButton("Print hits","PrintHits()" ,0.0,0.2,0.3,0.3); pHitBtn->Draw();}
696 if(fDigFile){TButton *pDigBtn = new TButton("Print digs","PrintDigs()" ,0.0,0.4,0.3,0.5); pDigBtn->Draw();}
697 if(fCluFile){TButton *pCluBtn = new TButton("Print clus","PrintClus()" ,0.0,0.6,0.3,0.7); pCluBtn->Draw();}
698 if(fEsdFile){TButton *pEsdBtn = new TButton("Print ESD ","PrintEsd()" ,0.0,0.8,0.3,0.9); pEsdBtn->Draw();}
699 if(fHitFile){ fHitMipBok = new TButton(Form("Mip %s",fStHitMip.Data()),"SwitchHitMip()",0.3,0.16,0.6,0.22); fHitMipBok->Draw();}
700 if(fHitFile){ fHitCkoBok = new TButton(Form("Ckov %s",fStHitCko.Data()),"SwitchHitCko()",0.3,0.22,0.6,0.28); fHitCkoBok->Draw();}
701 if(fHitFile){ fHitFeeBok = new TButton(Form("Fdbk %s",fStHitFee.Data()),"SwitchHitFee()",0.3,0.28,0.6,0.34); fHitFeeBok->Draw();}
702 if(fDigFile){ fDigBok = new TButton(fStDig ,"SwitchDigs()" ,0.3,0.4,0.6,0.5); fDigBok->Draw();}
703 if(fCluFile){ fCluBok = new TButton(fStClu ,"SwitchClus()" ,0.3,0.6,0.6,0.7); fCluBok->Draw();}
704 if(fEsdFile){ fEsdBok = new TButton(fStEsd ,"SwitchEsd()" ,0.3,0.8,0.6,0.9); fEsdBok->Draw();}
706 if(fHitFile){TButton *fHitMipOnly = new TButton(" Only ","OnlyHitMip()",0.6,0.16,0.9,0.22); fHitMipOnly->Draw();}
707 if(fHitFile){TButton *fHitCkoOnly = new TButton(" Only ","OnlyHitCko()",0.6,0.22,0.9,0.28); fHitCkoOnly->Draw();}
708 if(fHitFile){TButton *fHitFeeOnly = new TButton(" Only ","OnlyHitFee()",0.6,0.28,0.9,0.34); fHitFeeOnly->Draw();}
709 if(fDigFile){TButton *fDigOnly = new TButton(" Only ","OnlyDigs()" ,0.6,0.40,0.9,0.50); fDigOnly->Draw();}
710 if(fCluFile){TButton *fCluOnly = new TButton(" Only ","OnlyClus()" ,0.6,0.60,0.9,0.70); fCluOnly->Draw();}
711 if(fEsdFile){TButton *fEsdOnly = new TButton(" Only ","OnlyEsd()" ,0.6,0.80,0.9,0.90); fEsdOnly->Draw();}
712 TButton *pAll = new TButton(" ALL ","All()" ,0.5,0.90,0.7,1.00); pAll->Draw();
714 TButton *pEnd = new TButton("Quit" ,"End()" ,0.6,0.0,0.9,0.1); pEnd->Draw();
716 case 2: fCanvas->SetTitle("COSMIC");
717 TButton *pCosBtn = new TButton("Next" ,"NextEvent()",0.0,0.0,0.3,0.1); pCosBtn->Draw();
720 case 3: fCanvas->SetTitle("SIMULATION");
721 TButton *pSimBtn = new TButton("Simulate" ,"NextEvent()",0.0,0.0,0.3,0.1); pSimBtn->Draw();
722 TButton *pHitBtn = new TButton("Print hits","PrintHits()",0.0,0.2,0.3,0.3); pHitBtn->Draw();
723 TButton *pDigBtn = new TButton("Print digs","PrintDigs()",0.0,0.4,0.3,0.5); pDigBtn->Draw();
724 TButton *pCluBtn = new TButton("Print clus","PrintClus()",0.0,0.6,0.3,0.7); pCluBtn->Draw();
725 TButton *pEsdBtn = new TButton("Print ESD" ,"PrintEsd()" ,0.0,0.8,0.3,0.9); pEsdBtn->Draw();
726 if(fHitFile){ fHitMipBok = new TButton(Form("Mips %s",fStHitMip.Data()),"SwitchHitMip()",0.3,0.16,0.6,0.22); fHitMipBok->Draw();}
727 if(fHitFile){ fHitCkoBok = new TButton(Form("Ckov %s",fStHitCko.Data()),"SwitchHitCko()",0.3,0.22,0.6,0.28); fHitCkoBok->Draw();}
728 if(fHitFile){ fHitFeeBok = new TButton(Form("Fdbk %s",fStHitFee.Data()),"SwitchHitFee()",0.3,0.28,0.6,0.34); fHitFeeBok->Draw();}
729 if(fDigFile){ fDigBok = new TButton(fStDig ,"SwitchDigs()" ,0.3,0.4,0.6,0.5); fDigBok->Draw();}
730 if(fCluFile){ fCluBok = new TButton(fStClu ,"SwitchClus()" ,0.3,0.6,0.6,0.7); fCluBok->Draw();}
731 if(fEsdFile){ fEsdBok = new TButton(fStEsd ,"SwitchEsd()" ,0.3,0.8,0.6,0.9); fEsdBok->Draw();}
733 if(fHitFile){TButton *fHitMipOnly = new TButton(" Only ","OnlyHitMip()",0.6,0.16,0.9,0.22); fHitMipOnly->Draw();}
734 if(fHitFile){TButton *fHitCkoOnly = new TButton(" Only ","OnlyHitCko()",0.6,0.22,0.9,0.28); fHitCkoOnly->Draw();}
735 if(fHitFile){TButton *fHitFeeOnly = new TButton(" Only ","OnlyHitFee()",0.6,0.28,0.9,0.34); fHitFeeOnly->Draw();}
736 if(fDigFile){TButton *fDigOnly = new TButton(" Only ","OnlyDigs()" ,0.6,0.40,0.9,0.50); fDigOnly->Draw();}
737 if(fCluFile){TButton *fCluOnly = new TButton(" Only ","OnlyClus()" ,0.6,0.60,0.9,0.70); fCluOnly->Draw();}
738 if(fEsdFile){TButton *fEsdOnly = new TButton(" Only ","OnlyEsd()" ,0.6,0.80,0.9,0.90); fEsdOnly->Draw();}
739 TButton *pSimAll = new TButton(" ALL ","All()" ,0.5,0.90,0.7,1.00); pSimAll->Draw();
746 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
749 fStHitMip=(fStHitMip=="OFF")? "ON":"OFF";
752 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
755 fStHitCko=(fStHitCko=="OFF")? "ON":"OFF";
758 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
761 fStHitFee=(fStHitFee=="OFF")? "ON":"OFF";
764 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
767 fStDig=(fStDig=="OFF")? "ON":"OFF";
770 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
773 fStClu=(fStClu=="OFF")? "ON":"OFF";
776 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
779 fStEsd=(fStEsd=="OFF")? "ON":"OFF";
782 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
790 if(fDigFile) fStDig = "OFF";
791 if(fCluFile) fStClu = "OFF";
792 if(fEsdFile) fStEsd = "OFF";
794 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
802 if(fDigFile) fStDig = "ON";
803 if(fCluFile) fStClu = "ON";
804 if(fEsdFile) fStEsd = "ON";
806 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
812 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
819 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
826 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
833 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
840 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
847 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
854 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
855 void LoadRunLoader(){
856 if(!gSystem->IsFileInIncludePath("galice.root")) {
857 Printf("\n\n galice.root not in path: please check! \n\n");
860 if(gAlice) gAlice=0x0;
861 gAL=AliRunLoader::Open();
863 gAL->LoadHits("HMPID");
864 gAL->LoadDigits("HMPID");
865 gAL->LoadRecPoints("HMPID");
866 gDL = gAL->GetDetectorLoader("HMPID");
868 Printf("\n\n no AliLoader present: please check! \n\n");
871 fNevt= gAL->GetNumberOfEvents();
873 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
875 //used by NextEvent() to read curent event and construct all render elements
876 if(fNevt && fEvt>=fNevt) fEvt=0; //loop over max event
877 if(fNevt && fEvt<0) fEvt=fNevt-1; //loop over max event
879 Printf("getting event %i out of %i",fEvt,fNevt);
887 fHitTree=gDL->TreeH();
891 fHitTree->SetBranchAddress("HMPID",&fHitLst);
893 for(Int_t iEnt=0;iEnt<fHitTree->GetEntries();iEnt++){
894 fHitTree->GetEntry(iEnt);
901 fDigTree=gDL->TreeD();
904 for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fDigTree->SetBranchAddress(Form("HMPID%i",iCh),&(*fDigLst)[iCh]);
905 // fDigTree->GetEvent(fEvt);
906 fDigTree->GetEntry(0);
908 //cout << "pointer to the dig list " << fDigLst << endl;
913 fCluTree= gDL->TreeR();
916 for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fCluTree->SetBranchAddress(Form("HMPID%i",iCh),&(*fCluLst)[iCh]);
917 fCluTree->GetEntry(0);
924 if(fEsdFile){//if ESD file open
925 fEsdTree->GetEntry(fEvt);
930 //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
931 void SetEvent(Int_t ev)
936 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
937 void SetSigmaCut(Int_t sig=0)
941 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
944 gROOT->LoadMacro("Field.C");
946 AliMagF * b = Field();
948 AliHMPIDTracker::SetFieldMap(b,kTRUE);
950 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
951 void SetTrigger(Int_t type=0)
954 if(type==1) Printf(" Trigger 1 selected: at least ONE track in HMPID.");
956 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
959 if(trigType==0) return kTRUE;
961 if(fEsd->GetNumberOfTracks()>0) {
964 } else return kFALSE;