Get rid of compiler warning
[u/mrichter/AliRoot.git] / HMPID / Hdisp.C
CommitLineData
8282f9d0 1TCanvas *pAll=0;
2AliRunLoader *gAL=0; AliLoader *gHL=0; AliESD *gEsd=0; TTree *gEsdTr=0; AliHMPID *gH=0;
6f0ca13b 3Int_t gEvt=-1; Int_t gMaxEvt=0;
bd73b83f 4TObjArray *pNmean;
126b3e0e 5
6TChain *pCosCh=new TChain("cosmic"); //clm: Define TChain for cosmic
7TObjArray *pCosDigAll=0; //clm: Define global Digits
8TObjArray *pCosCluAll=0; //clm: Define global Clusters
9Int_t gCosRun=0; //clm: global cosmic event number
8282f9d0 10//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
126b3e0e 11void Hdisp(Int_t cosRun=44) //clm: Select cosmic file for display
8282f9d0 12{//display events from files if any in current directory or simulated events
50e69536 13 pAll=new TCanvas("all","",1300,900); pAll->Divide(3,3,0,0);
14// pAll->ToggleEditor();
8282f9d0 15 pAll->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",0,"","DoZoom(Int_t,Int_t,Int_t,TObject*)");
bd73b83f 16
17 OpenCalib();
126b3e0e 18 if(gSystem->IsFileInIncludePath("galice.root")){// tries to open session
19 if(gAlice) delete gAlice; //in case we execute this in aliroot delete default AliRun object
20 gAL=AliRunLoader::Open(); //try to open galice.root from current dir
21 gAL->LoadgAlice(); //take new AliRun object from galice.root
22 gHL=gAL->GetDetectorLoader("HMPID"); gH=(AliHMPID*)gAL->GetAliRun()->GetDetector("HMPID"); //get HMPID object from galice.root
23 gMaxEvt=gAL->GetNumberOfEvents()-1;
24 gHL->LoadHits(); gHL->LoadSDigits(); gHL->LoadDigits(); gHL->LoadRecPoints();
8282f9d0 25
5582ed3a 26 AliHMPIDTracker::SetFieldMap(gAL->GetAliRun()->Field(),kTRUE);
27
126b3e0e 28 TFile *pEsdFl=TFile::Open("AliESDs.root"); gEsdTr=(TTree*) pEsdFl->Get("esdTree"); gEsdTr->SetBranchAddress("ESD", &gEsd);
29 pAll->cd(7); TButton *pBtn=new TButton("Next","ReadEvt()",0,0,0.2,0.1); pBtn->Draw();
6b155609 30 TButton *pHitBtn=new TButton("Print hits","PrintHits()",0 ,0.2,0.3,0.3); pHitBtn->Draw();
31 TButton *pSdiBtn=new TButton("Print sdis","PrintSdis()",0 ,0.4,0.3,0.5); pSdiBtn->Draw();
32 TButton *pDigBtn=new TButton("Print digs","PrintDigs()",0 ,0.6,0.3,0.7); pDigBtn->Draw();
33 TButton *pCluBtn=new TButton("Print clus","PrintClus()",0 ,0.8,0.3,0.9); pCluBtn->Draw();
34 TButton *pEsdBtn=new TButton("Print ESD"," PrintEsd()",0.4,0.8,0.7,0.9); pEsdBtn->Draw();
126b3e0e 35 ReadEvt();
36 }
37 else if ( gSystem->IsFileInIncludePath(Form("cosmic%d.root",cosRun))){ //clm: Check if cosmic file is in the folder
38 gCosRun=cosRun;
39 pCosCh->Add(Form("cosmic%d.root",gCosRun)); //clm: Add cosmic file to chain
40 pCosCh->SetBranchAddress("Digs",&pCosDigAll); //clm: Set digit branch address
41 pCosCh->SetBranchAddress("Clus",&pCosCluAll); //clm: Set cluster branch address
42 gMaxEvt=pCosCh->GetEntries()-1; //clm: Get number of events from the cosmic chain
43 pAll->cd(7); TButton *pCosBtn=new TButton("Next Cosmic","ReadCosEvt()",0,0,0.3,0.1); pCosBtn->Draw(); //clm: define next button
44 ReadCosEvt(); //clm: Read first cosmic event
45 }
46 else{
47 pAll->cd(7); TButton *pBtn=new TButton("Next","SimEvt()",0,0,0.2,0.1); pBtn->Draw();
48 SimEvt();
49 }
50}
51
52//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
53void ReadCosEvt()
54{// Read curent cosmic event and display it assumes that session is alredy opened
6f0ca13b 55 if(gEvt>gMaxEvt) gEvt=-1; if(gEvt<-1) gEvt=gMaxEvt; //clm: set event limits
56 gEvt++;
126b3e0e 57 pCosCh->GetEntry(gEvt); //clm: read event from chain
58 DrawCosEvt(pCosDigAll,pCosCluAll); //clm: draw cosmic event
8282f9d0 59}
60//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
61void ReadEvt()
62{// Read curent event and display it assumes that session is alredy opened
63 TClonesArray hits("AliHMPIDHit");
6f0ca13b 64 if(gEvt>gMaxEvt) gEvt=-1; if(gEvt<-1) gEvt=gMaxEvt; //clm: set event limits
65 gEvt++;
8282f9d0 66
67 gEsdTr->GetEntry(gEvt); gAL->GetEvent(gEvt);
d73ece6a 68 ReadHits(&hits); gHL->TreeS()->GetEntry(0); gHL->TreeD()->GetEntry(0); gHL->TreeR()->GetEntry(0);
126b3e0e 69
8282f9d0 70 DrawEvt(&hits,gH->DigLst(),gH->CluLst(),gEsd);
8282f9d0 71}
72//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
73void SimEvt()
74{
75 TClonesArray hits("AliHMPIDHit");
76 TClonesArray sdig("AliHMPIDDigit");
77 TObjArray digs(7); for(Int_t i=0;i<7;i++) digs.AddAt(new TClonesArray("AliHMPIDDigit"),i);
78 TObjArray clus(7); for(Int_t i=0;i<7;i++) clus.AddAt(new TClonesArray("AliHMPIDCluster"),i);
79 AliESD esd;
6f0ca13b 80 gEvt++;
8282f9d0 81 SimEsd(&esd);
82 SimHits(&esd,&hits);
83 AliHMPIDv1::Hit2Sdi(&hits,&sdig);
84 AliHMPIDDigitizer::Sdi2Dig(&sdig,&digs);
50e69536 85 AliHMPIDReconstructor::Dig2Clu(&digs,&clus);
bd73b83f 86 AliHMPIDTracker::Recon(&esd,&clus,pNmean);
8282f9d0 87
88 pAll->cd(3); gPad->Clear(); TLatex txt;txt.DrawLatex(0.2,0.2,Form("Simulated event %i",gEvt));
89 DrawEvt(&hits,&digs,&clus,&esd);
8282f9d0 90}//SimEvt()
a1d55ff3 91//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
92void SimEsd(AliESD *pEsd)
93{
94 TParticle part; TLorentzVector mom;
50e69536 95 for(Int_t iTrk=0;iTrk<100;iTrk++){//stack loop
a1d55ff3 96 part.SetPdgCode(kProton);
50e69536 97 part.SetProductionVertex(0,0,0,0);
98 Double_t eta= -0.2+gRandom->Rndm()*0.4; //rapidity is random [-0.2,+0.2]
99 Double_t phi= gRandom->Rndm()*60.*TMath::DegToRad(); //phi is random [ 0 , 60 ] degrees
100 mom.SetPtEtaPhiM(5,eta,phi,part.GetMass());
a1d55ff3 101 part.SetMomentum(mom);
102 AliESDtrack trk(&part);
103 pEsd->AddTrack(&trk);
104 }//stack loop
105}//EsdFromStack()
106//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8282f9d0 107void SimHits(AliESD *pEsd, TClonesArray *pHits)
a1d55ff3 108{
50e69536 109 const Int_t kCerenkov=50000050;
110 const Int_t kFeedback=50000051;
f3bae3e2 111
a1d55ff3 112 AliHMPIDRecon rec;
f3bae3e2 113
a591e55f 114 Int_t hc=0;
a1d55ff3 115 for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){//tracks loop
116 AliESDtrack *pTrk=pEsd->GetTrack(iTrk);
e0f1d33b 117 Float_t xPc,yPc;
118 Int_t ch=AliHMPIDTracker::IntTrkCha(pTrk,xPc,yPc);
a1d55ff3 119 if(ch<0) continue; //this track does not hit HMPID
50e69536 120 Float_t beta = pTrk->GetP()/(TMath::Sqrt(pTrk->GetP()*pTrk->GetP()+0.938*0.938));
121 Float_t ckov=TMath::ACos(1./(beta*1.292));
a1d55ff3 122
50e69536 123 Float_t theta,phi,xPc,yPc,;
124 pTrk->GetHMPIDtrk(xPc,yPc,theta,phi);
125 rec.SetTrack(xRa,yRa,theta,phi);
a1d55ff3 126
8282f9d0 127 if(!AliHMPIDDigit::IsInDead(xPc,yPc)) new((*pHits)[hc++]) AliHMPIDHit(ch,200e-9,kProton ,iTrk,xPc,yPc); //mip hit
50e69536 128 Int_t nPhots = (Int_t)(20.*TMath::Power(TMath::Sin(ckov),2)/TMath::Power(TMath::Sin(TMath::ACos(1./1.292)),2));
129 for(int i=0;i<nPhots;i++){
a591e55f 130 TVector2 pos;
131 pos=rec.TracePhot(ckov,gRandom->Rndm()*TMath::TwoPi());
50e69536 132 if(!AliHMPIDDigit::IsInDead(pos.X(),pos.Y())) new((*pHits)[hc++]) AliHMPIDHit(ch,7.5e-9,kCerenkov,iTrk,pos.X(),pos.Y());
a1d55ff3 133 } //photon hits
134 }//tracks loop
8282f9d0 135}//SimHits()
a1d55ff3 136//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8282f9d0 137void ReadHits(TClonesArray *pHitLst)
a1d55ff3 138{
8282f9d0 139 pHitLst->Delete(); Int_t cnt=0;
140 for(Int_t iEnt=0;iEnt<gHL->TreeH()->GetEntries();iEnt++){ //TreeH loop
141 gHL->TreeH()->GetEntry(iEnt); //get current entry (prim)
142 for(Int_t iHit=0;iHit<gH->Hits()->GetEntries();iHit++){ //hits loop
143 AliHMPIDHit *pHit = (AliHMPIDHit*)gH->Hits()->At(iHit); //get current hit
144 new((*pHitLst)[cnt++]) AliHMPIDHit(*pHit);
145 }//hits loop for this entry
146 }//tree entries loop
147
148}//ReadHits()
a1d55ff3 149//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8282f9d0 150void DrawCh(Int_t iCh)
a1d55ff3 151{
152 gPad->Range(-10,-10,AliHMPIDDigit::SizeAllX()+5,AliHMPIDDigit::SizeAllY()+5);
f3bae3e2 153 if(iCh>=0){TLatex txt; txt.SetTextSize(0.1); txt.DrawLatex(-5,-5,Form("%i",iCh));}
a1d55ff3 154
155 for(Int_t iPc=AliHMPIDDigit::kMinPc;iPc<=AliHMPIDDigit::kMaxPc;iPc++){
ea925242 156 TBox *pBox=new TBox(AliHMPIDDigit::MinPcX(iPc),AliHMPIDDigit::MinPcY(iPc),
157 AliHMPIDDigit::MaxPcX(iPc),AliHMPIDDigit::MaxPcY(iPc));
a1d55ff3 158
8282f9d0 159 pBox->SetFillStyle(0);
a1d55ff3 160 pBox->Draw();
161
a1d55ff3 162 }//PC loop
8282f9d0 163}//DrawCh()
a1d55ff3 164//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8282f9d0 165void DrawEvt(TClonesArray *pHitLst,TObjArray *pDigLst,TObjArray *pCluLst,AliESD *pEsd)
a1d55ff3 166{//draws all the objects of current event in given canvas
5582ed3a 167
168 AliHMPIDParam *pParam=AliHMPIDParam::Instance();
169
a1d55ff3 170 AliHMPIDRecon rec;
d73ece6a 171 TPolyMarker *pTxC[7], *pRin[7]; TMarker *pMip,*pCko,*pFee,*pDig,*pClu;
172 pMip=new TMarker; pMip->SetMarkerColor(kRed); pMip->SetMarkerStyle(kOpenTriangleUp);
173 pCko=new TMarker; pCko->SetMarkerColor(kRed); pCko->SetMarkerStyle(kOpenCircle);
174 pFee=new TMarker; pFee->SetMarkerColor(kRed); pFee->SetMarkerStyle(kOpenDiamond);
175 pDig=new TMarker; pDig->SetMarkerColor(kGreen);pDig->SetMarkerStyle(kOpenSquare);
176 pClu=new TMarker; pClu->SetMarkerColor(kBlue); pClu->SetMarkerStyle(kStar);
a1d55ff3 177 for(Int_t ch=0;ch<7;ch++){
178 pTxC[ch]=new TPolyMarker; pTxC[ch]->SetMarkerStyle(2); pTxC[ch]->SetMarkerColor(kRed); pTxC[ch]->SetMarkerSize(3);
179 pRin[ch]=new TPolyMarker; pRin[ch]->SetMarkerStyle(6); pRin[ch]->SetMarkerColor(kMagenta);
180 }
181
a1d55ff3 182 for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){//tracks loop to collect cerenkov rings and intersection points
183 AliESDtrack *pTrk=pEsd->GetTrack(iTrk);
184 Int_t ch=pTrk->GetHMPIDcluIdx();
185 if(ch<0) continue; //this track does not hit HMPID
186 ch/=1000000;
a591e55f 187 Float_t th,ph,xRad,yRad; pTrk->GetHMPIDtrk(xRad,yRad,th,ph);//get info on current track
5582ed3a 188//
189//Find again intersection of track with PC--> it is not stored in ESD!
190//
191 Float_t xPc=0,yPc=0; //track intersection point with PC
192 Double_t pMom[3],nCh[3]; pTrk->GetPxPyPz(pMom);pParam->Norm(ch,nCh); pParam->Lors2Mars(ch,0,0,pMom,AliHMPIDParam::kPc); //point & norm for PC
193 if(pTrk->Intersect(pMom,nCh,-AliHMPIDTracker::GetBz())==kTRUE){ //try to intersect track with PC
194 pParam->Mars2Lors (ch,pMom,xPc,yPc); //TRKxPC position
195 pTxC[ch]->SetNextPoint(xPc,yPc);
196 }
197// end of point intersection @ PC
a1d55ff3 198 Float_t ckov=pTrk->GetHMPIDsignal(); Float_t err=TMath::Sqrt(pTrk->GetHMPIDchi2());
a1d55ff3 199 if(ckov>0){
5582ed3a 200// Printf("theta %f phi %f ckov %f",th*TMath::RadToDeg(),ph*TMath::RadToDeg(),ckov);
b4ad85e9 201 rec.SetTrack(xRad,yRad,th,ph);
a591e55f 202 for(Int_t j=0;j<100;j++){
203 TVector2 pos;
204 pos=rec.TracePhot(ckov,j*0.0628);
50e69536 205 if(!AliHMPIDDigit::IsInDead(pos.X(),pos.Y())) pRin[ch]->SetNextPoint(pos.X(),pos.Y());
206 }
a1d55ff3 207 }
208 }//tracks loop
209
b08ebbb0 210 Int_t totHit=pHitLst->GetEntriesFast(),totDig=0,totClu=0,totTxC=0;
211 Int_t totCkov=0, totFeed=0,totMip=0;
a1d55ff3 212 for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
d73ece6a 213 totTxC+=pTxC[iCh]->GetN();
214 totDig+=((TClonesArray*)pDigLst->At(iCh))->GetEntriesFast();
215 totClu+=((TClonesArray*)pCluLst->At(iCh))->GetEntriesFast();
216
a1d55ff3 217 switch(iCh){
8282f9d0 218 case 6: pAll->cd(1); break; case 5: pAll->cd(2); break;
219 case 4: pAll->cd(4); break; case 3: pAll->cd(5); break; case 2: pAll->cd(6); break;
220 case 1: pAll->cd(8); break; case 0: pAll->cd(9); break;
a1d55ff3 221 }
222 gPad->SetEditable(kTRUE); gPad->Clear();
8282f9d0 223 DrawCh(iCh);
d73ece6a 224
8c1bbb8a 225 ((TClonesArray*)pDigLst->At(iCh))->Draw(); //draw digits
226
b08ebbb0 227 totCkov=0;totFeed=0;totMip=0;
8c1bbb8a 228 for(Int_t iHit=0;iHit<pHitLst->GetEntriesFast();iHit++){ // Draw hits
a1d55ff3 229 AliHMPIDHit *pHit=(AliHMPIDHit*)pHitLst->At(iHit);
d73ece6a 230 if(pHit->Ch()==iCh) pHit->Draw();
b08ebbb0 231 if(pHit->Pid()==50000050) totCkov++;
232 else if(pHit->Pid()==50000051) totFeed++;
233 else totMip++;
d73ece6a 234 }
235
8c1bbb8a 236 ((TClonesArray*)pCluLst->At(iCh))->Draw(); //draw clusters
237 pTxC[iCh]->Draw(); //draw intersections
238 pRin[iCh]->Draw("CLP"); //draw rings
a1d55ff3 239 gPad->SetEditable(kFALSE);
240 }//chambers loop
d73ece6a 241
242 pAll->cd(3); gPad->Clear(); TLegend *pLeg=new TLegend(0.2,0.2,0.8,0.8);
243 pLeg->SetHeader(Form("Event %i Total %i",gEvt,gMaxEvt+1));
244 pLeg->AddEntry(pTxC[0],Form("TRKxPC %i" ,totTxC),"p");
b08ebbb0 245 pLeg->AddEntry(pMip ,Form("Mip hits %i" ,totMip),"p");
246 pLeg->AddEntry(pCko ,Form("Ckov hits %i" ,totCkov),"p");
247 pLeg->AddEntry(pFee ,Form("Feed hits %i" ,totFeed),"p");
d73ece6a 248 pLeg->AddEntry(pDig ,Form("Digs %i" ,totDig),"p");
249 pLeg->AddEntry(pClu ,Form("Clus %i" ,totClu),"p");
250 pLeg->Draw();
a1d55ff3 251}//DrawEvt()
8282f9d0 252//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
126b3e0e 253void DrawCosEvt(TObjArray *pCosDigLst,TObjArray *pCosCluLst) //clm: new method to read and display cosmic events
254{//draws all the objects of current event in given canvas
255 TMarker *pDig,*pClu;
256 pDig=new TMarker; pDig->SetMarkerColor(kGreen);pDig->SetMarkerStyle(kOpenSquare);
257 pClu=new TMarker; pClu->SetMarkerColor(kBlue); pClu->SetMarkerStyle(kStar);
258
259
260 Int_t totDig=0,totClu=0;
261 for(Int_t iCh=0;iCh<7;iCh++){//chambers loop //clm: chambers loop is now not needed since iCh=0 but kept for provision
262 totDig+=((TClonesArray*)pCosDigLst->At(iCh))->GetEntriesFast();
263 totClu+=((TClonesArray*)pCosCluLst->At(iCh))->GetEntriesFast();
264
265 switch(iCh){
266 case 6: pAll->cd(1); break; case 5: pAll->cd(2); break;
267 case 4: pAll->cd(4); break; case 3: pAll->cd(5); break; case 2: pAll->cd(6); break;
268 case 1: pAll->cd(8); break; case 0: pAll->cd(9); break;
269 }
270 gPad->SetEditable(kTRUE); gPad->Clear();
271 DrawCh(iCh);
272 if(gCosRun < 500 && iCh == 6) { //clm: hard coded selection since raw data does not contain ch info which is set to 0
273 ((TClonesArray*)pCosDigLst->At(0))->Draw(); //draw digits
274 ((TClonesArray*)pCosCluLst->At(0))->Draw(); //draw clusters
275 }
276 if (gCosRun >= 500 && iCh == 5) {
277 ((TClonesArray*)pCosDigLst->At(0))->Draw(); //draw digits
278 ((TClonesArray*)pCosCluLst->At(0))->Draw(); //draw clusters
279 }
280
281 gPad->SetEditable(kFALSE);
282 }//chambers loop
283 pAll->cd(3); gPad->Clear(); TLegend *pLeg=new TLegend(0.2,0.2,0.8,0.8);
284 pLeg->SetHeader(Form("Cosmic Run %i Event %i Total %i",gCosRun,gEvt,gMaxEvt+1));
285 pLeg->AddEntry(pDig ,Form("Digs %i" ,totDig),"p");
286 pLeg->AddEntry(pClu ,Form("Clus %i" ,totClu),"p");
287 pLeg->Draw();
288}//DrawCosEvt()
289//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
8282f9d0 290void DoZoom(Int_t evt, Int_t px, Int_t py, TObject *obj)
a1d55ff3 291{
8282f9d0 292 if(evt!=5 && evt!=6) return; //5- zoom in 6-zoom out
293 const Int_t minZoom=64;
294 const Int_t maxZoom=2;
295 static Int_t zoom=minZoom; //zoom level
296 if(evt==5&&zoom==maxZoom) return;
297 if(evt==6&&zoom==minZoom) return;
298
d73ece6a 299 // if(!obj->IsA()->InheritsFrom("TPad")) return; //current object is not pad
50e69536 300 TVirtualPad *pPad=gPad->GetSelectedPad();
8282f9d0 301 if(pPad->GetNumber()==3 || pPad->GetNumber()==7) return; //current pad is wrong
302
303 // Printf("evt=%i (%i,%i) %s",evt,px,py,obj->GetName());
304
305 Float_t x=pPad->AbsPixeltoX(px); Float_t y=pPad->AbsPixeltoY(py);
6ed6a312 306
307 if(evt==5){ zoom=zoom/2; pPad->Range(x-zoom*2,y-zoom*2,x+zoom*2,y+zoom*2);} //zoom in
308 else { zoom=zoom*2; pPad->Range(x-zoom*2,y-zoom*2,x+zoom*2,y+zoom*2);} //zoom out
309 if(zoom==minZoom) pPad->Range(-10,-10,AliHMPIDDigit::SizeAllX()+5,AliHMPIDDigit::SizeAllY()+5);
8282f9d0 310 ((TCanvas *)gTQSender)->SetTitle(Form("zoom x%i",minZoom/zoom));
311 pPad->Modified();
312 pPad->Update();
a1d55ff3 313}
8282f9d0 314//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
d73ece6a 315void PrintHits()
316{
317//Prints a list of HMPID hits for a given event. Default is event number 0.
318 Printf("List of HMPID hits for event %i",gEvt);
319
320 Int_t iTotHits=0;
321 for(Int_t iPrim=0;iPrim<gHL->TreeH()->GetEntries();iPrim++){//prims loop
322 gHL->TreeH()->GetEntry(iPrim);
323 gH->Hits()->Print();
324 iTotHits+=gH->Hits()->GetEntries();
325 }
326 Printf("totally %i hits for event %i",iTotHits,gEvt);
327}
328//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
329void PrintSdis()
330{
331//prints a list of HMPID sdigits for a given event
332 Printf("List of HMPID sdigits for event %i",gEvt);
333 gH->SdiLst()->Print();
334 Printf("totally %i sdigits for event %i",gH->SdiLst()->GetEntries(),gEvt);
335}
336//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
337void PrintDigs()
338{
339//prints a list of HMPID digits
340 Printf("List of HMPID digits for event %i",gEvt);
341 gH->DigLst()->Print();
342 Int_t totDigs=0; for(Int_t i=0;i<7;i++) {totDigs+=gH->DigLst(i)->GetEntries();}
343 Printf("totally %i digits for event %i",totDigs,gEvt);
344}
345//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
346void PrintClus()
347{//prints a list of HMPID clusters for a given event
348 Printf("List of HMPID clusters for event %i",gEvt);
349 gH->CluLst()->Print();
350
351 Int_t iCluCnt=0; for(Int_t iCh=0;iCh<7;iCh++) iCluCnt+=gH->CluLst(iCh)->GetEntries();
352
353 Printf("totally %i clusters for event %i",iCluCnt,gEvt);
354}
50e69536 355//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6b155609 356void PrintEsd()
357{//prints a list of HMPID Esd for a given event
358 Printf("List of HMPID ESD summary for event %i",gEvt);
359 Int_t nTrks = gEsd->GetNumberOfTracks();
360
361 for(Int_t iTrk=0;iTrk<nTrks;iTrk++){
362 AliESDtrack *pTrk = gEsd->GetTrack(iTrk);
e0f1d33b 363 Float_t x,y;Int_t q,nacc;
364 pTrk->GetHMPIDmip(x,y,q,nacc);
365 Printf("Track %02i with p %7.2f with ThetaCer %5.3f with %i photons",iTrk,pTrk->GetP(),pTrk->GetHMPIDsignal(),nacc);
6b155609 366 }
367
368}
369//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
bd73b83f 370void OpenCalib()
50e69536 371{
372 AliCDBManager* pCDB = AliCDBManager::Instance();
373 pCDB->SetDefaultStorage("local://$HOME");
374 AliCDBEntry *pQthreEnt=pCDB->Get("HMPID/Calib/Qthre",0);
375 AliCDBEntry *pNmeanEnt=pCDB->Get("HMPID/Calib/Nmean",0);
376
377 if(!pQthreEnt || ! pNmeanEnt) return;
378
bd73b83f 379 pNmean=(TObjArray*)pNmeanEnt->GetObject();
50e69536 380}