joint-venture of christian, andrei and jan fiete:
[u/mrichter/AliRoot.git] / HMPID / Hdisp.C
CommitLineData
c0d7adf8 1#if !defined(__CINT__) || defined(__MAKECINT__)
2
e9f11028 3#include <TSystem.h>
4#include <TFile.h>
06a9f120 5#include <TVirtualX.h>
e9f11028 6#include <TTree.h>
7#include <TButton.h>
8#include <TCanvas.h>
66298970 9#include <TCanvasImp.h>
06a9f120 10#include <TStyle.h>
45b05be5 11#include <TString.h>
e9f11028 12#include <TClonesArray.h>
13#include <TParticle.h>
14#include <TRandom.h>
15#include <TLatex.h>
45b05be5 16#include <TPDGCode.h>
e9f11028 17#include <TLegend.h>
18#include <TPolyMarker.h>
19#include <TBox.h>
6e06db1d 20#include <AliESDEvent.h>
e9f11028 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"
e4290ede 29#include "AliTracker.h"
30
c0d7adf8 31#endif
32
66298970 33AliHMPIDParam *fParam;
34
45b05be5 35TCanvas *fCanvas=0; Int_t fType=3; Int_t fEvt=-1; Int_t fNevt=0;
66298970 36TCanvasImp *fCanvasImp;
e9f11028 37TFile *fHitFile; TTree *fHitTree; TClonesArray *fHitLst; TPolyMarker *fRenMip[7]; TPolyMarker *fRenCko[7]; TPolyMarker *fRenFee[7];
38 TClonesArray *fSdiLst;
06a9f120 39TFile *fDigFile; TTree *fDigTree; TObjArray *fDigLst; TBox *fRenDig[7][160*144]; TBox *fBox[7][160*144];
e9f11028 40TFile *fCluFile; TTree *fCluTree; TObjArray *fCluLst; TPolyMarker *fRenClu[7];
45b05be5 41TFile *fEsdFile; TTree *fEsdTree; AliESDEvent *fEsd; TPolyMarker *fRenTxC[7]; TPolyMarker *fRenRin[7];
e9f11028 42TFile *fCosFile; TTree *fCosTree;
45b05be5 43
44TButton *fHitMipBok,*fHitCkoBok,*fHitFeeBok,*fDigBok,*fCluBok,*fEsdBok;
45
46TString fStHitMip = "ON";
47TString fStHitCko = "ON";
48TString fStHitFee = "ON";
49TString fStDig = "ON";
50TString fStClu = "ON";
51TString fStEsd = "ON";
52
53Int_t fTimeArrow = 1;
54
06a9f120 55Int_t fMaxCharge = 200; //maximum charge to saturate color to red
56
66298970 57Int_t fChamN[9]={6,5,-1,4,3,2,-1,1,0};
58
59Int_t fTotPads[7],fTotClus[7];
60
e4290ede 61AliRunLoader *gAL=0;
8282f9d0 62
06a9f120 63Int_t nDigs[7];
e9f11028 64//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
65void CreateContainers()
66{//to create all containers
67 fHitLst=new TClonesArray("AliHMPIDHit");
68 fSdiLst=new TClonesArray("AliHMPIDDigit");
69 fDigLst=new TObjArray(7); for(Int_t i=0;i<7;i++) fDigLst->AddAt(new TClonesArray("AliHMPIDDigit"),i); fDigLst->SetOwner(kTRUE);
70 fCluLst=new TObjArray(7); for(Int_t i=0;i<7;i++) fCluLst->AddAt(new TClonesArray("AliHMPIDCluster"),i); fCluLst->SetOwner(kTRUE);
6e06db1d 71 fEsd =new AliESDEvent;
126b3e0e 72}
126b3e0e 73//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
e9f11028 74void CreateRenders()
75{
76 for(Int_t ch=0;ch<7;ch++){
06a9f120 77 fRenMip[ch]=new TPolyMarker; fRenMip[ch]->SetMarkerStyle(kOpenTriangleUp); fRenMip[ch]->SetMarkerColor(kBlack);
78 fRenCko[ch]=new TPolyMarker; fRenCko[ch]->SetMarkerStyle(kOpenCircle); fRenCko[ch]->SetMarkerColor(kBlack);
79 fRenFee[ch]=new TPolyMarker; fRenFee[ch]->SetMarkerStyle(kOpenDiamond); fRenFee[ch]->SetMarkerColor(kBlack);
80 fRenClu[ch]=new TPolyMarker; fRenClu[ch]->SetMarkerStyle(kStar); fRenClu[ch]->SetMarkerColor(kMagenta);
e9f11028 81 fRenTxC[ch]=new TPolyMarker; fRenTxC[ch]->SetMarkerStyle(kPlus); fRenTxC[ch]->SetMarkerColor(kRed); fRenTxC[ch]->SetMarkerSize(3);
82 fRenRin[ch]=new TPolyMarker; fRenRin[ch]->SetMarkerStyle(kFullDotSmall); fRenRin[ch]->SetMarkerColor(kMagenta);
06a9f120 83 for(Int_t iDig=0;iDig<160*144;iDig++) {
84 fRenDig[ch][iDig] = new TBox;
85 fRenDig[ch][iDig]->SetFillStyle(1);
86 fBox[ch][iDig] = new TBox;
87 fBox[ch][iDig]->SetFillStyle(0);
88 }
e9f11028 89 }
90}//CreateRenders()
91//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
92void ClearRenders()
93{
94 for(Int_t ch=0;ch<7;ch++){
95 fRenTxC[ch]->SetPolyMarker(0);
96 fRenRin[ch]->SetPolyMarker(0);
97 fRenMip[ch]->SetPolyMarker(0);
98 fRenCko[ch]->SetPolyMarker(0);
99 fRenFee[ch]->SetPolyMarker(0);
06a9f120 100 nDigs[ch] = 0;
e9f11028 101 fRenClu[ch]->SetPolyMarker(0);
102 }
103}//ClearRenders()
104//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
105void PrintHits()
106{
107//Prints a list of HMPID hits for a given event. Default is event number 0.
108 if(!fHitTree) return;
109 Printf("List of HMPID hits for event %i",fEvt);
110 Int_t iTot=0;
111 for(Int_t iEnt=0;iEnt<fHitTree->GetEntries();iEnt++){//entries loop
112 fHitTree->GetEntry(iEnt);
113 fHitLst->Print();
114 iTot+=fHitLst->GetEntries();
115 }
116 Printf("totally %i hits for event %i",iTot,fEvt);
117}//PrintHits();
118//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
119void PrintSdis()
120{//prints a list of HMPID sdigits for a given event
121 Printf("List of HMPID sdigits for event %i",fEvt);
122 fSdiLst->Print();
123 Printf("totally %i sdigits for event %i",fSdiLst->GetEntries(),fEvt);
124}//PrintSdis()
125//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
126void PrintDigs()
127{//prints a list of HMPID digits
128 Printf("List of HMPID digits for event %i",fEvt);
129 fDigLst->Print();
130 Int_t iTot=0; for(Int_t i=0;i<7;i++) {iTot+=((TClonesArray*)fDigLst->At(i))->GetEntries();}
131 Printf("totally %i digits for event %i",iTot,fEvt);
8282f9d0 132}
133//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
e9f11028 134void PrintClus()
135{//prints a list of HMPID clusters for a given event
136 Printf("List of HMPID clusters for event %i",fEvt);
8282f9d0 137
e9f11028 138 fCluLst->Print();
139 Int_t iTot=0; for(Int_t iCh=0;iCh<7;iCh++) iTot+=((TClonesArray*)fCluLst->At(iCh))->GetEntries();
140
141 Printf("totally %i clusters for event %i",iTot,fEvt);
8282f9d0 142}
143//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
e9f11028 144void PrintEsd()
145{//prints a list of HMPID Esd for a given event
146 Printf("List of HMPID ESD summary for event %i",fEvt);
147 for(Int_t iTrk=0;iTrk<fEsd->GetNumberOfTracks();iTrk++){
148 AliESDtrack *pTrk = fEsd->GetTrack(iTrk);
149 Float_t x,y;Int_t q,nacc; pTrk->GetHMPIDmip(x,y,q,nacc);
150 Printf("Track %02i with p %7.2f with ThetaCer %5.3f with %i photons",iTrk,pTrk->GetP(),pTrk->GetHMPIDsignal(),nacc);
151 }
152}//PrintEsd()
153//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
154void DrawChamber(Int_t iCh)
155{//used by Draw() to Draw() chamber structure
45b05be5 156 gPad->Range(-10,-10,AliHMPIDParam::SizeAllX()+5,AliHMPIDParam::SizeAllY()+5);
e9f11028 157 if(iCh>=0){TLatex txt; txt.SetTextSize(0.1); txt.DrawLatex(-5,-5,Form("%i",iCh));}
158
ae5a42aa 159 for(Int_t iPc=AliHMPIDParam::kMinPc;iPc<=AliHMPIDParam::kMaxPc;iPc++){
160 TBox *pBox=new TBox(AliHMPIDParam::MinPcX(iPc),AliHMPIDParam::MinPcY(iPc),
161 AliHMPIDParam::MaxPcX(iPc),AliHMPIDParam::MaxPcY(iPc));
e9f11028 162 pBox->SetFillStyle(0); pBox->Draw();
163 }//PC loop
164}//DrawChamber()
165//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
166void DrawLegend()
167{//used by Draw() to draw legend
168 Int_t nTxC=0,nMip=0,nCko=0,nFee=0,nDig=0,nClu=0;
169 for(Int_t ch=0;ch<7;ch++){
45b05be5 170 nTxC+=fRenTxC[ch]->GetLastPoint()+1;
171 nMip+=fRenMip[ch]->GetLastPoint()+1;
172 nCko+=fRenCko[ch]->GetLastPoint()+1;
173 nFee+=fRenFee[ch]->GetLastPoint()+1;
45b05be5 174 nClu+=fRenClu[ch]->GetLastPoint()+1;
06a9f120 175 nDig+=nDigs[ch];
e9f11028 176 }
177 TLegend *pLeg=new TLegend(0.2,0.2,0.8,0.8);
178 pLeg->SetHeader(Form("Event %i Total %i",fEvt,fNevt));
06a9f120 179 pLeg->AddEntry(fRenTxC[0], Form("TRKxPC %i" ,nTxC),"p");
180 pLeg->AddEntry(fRenMip[0], Form("Mip hits %i" ,nMip),"p");
181 pLeg->AddEntry(fRenCko[0], Form("Ckov hits %i" ,nCko),"p");
182 pLeg->AddEntry(fRenFee[0], Form("Feed hits %i" ,nFee),"p");
183 pLeg->AddEntry(fRenDig[0][0],Form("Digs %i" ,nDig),"p");
184 pLeg->AddEntry(fRenClu[0], Form("Clus %i" ,nClu),"p");
e9f11028 185 pLeg->Draw();
186}//DrawLegend()
187//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
188void Draw()
189{//draws all the objects of current event in given canvas
45b05be5 190 Int_t iPadN[7]={9,8,6,5,4,2,1};
06a9f120 191 Int_t sampleCol = fMaxCharge/gStyle->GetNumberOfColors();
e9f11028 192 for(Int_t iCh=0;iCh<7;iCh++){//chambers loop
45b05be5 193 fCanvas->cd(iPadN[iCh]);
e9f11028 194 gPad->SetEditable(kTRUE); gPad->Clear(); DrawChamber(iCh);
06a9f120 195
196 if(fStDig =="ON") {
197 for(Int_t iDig=0;iDig<nDigs[iCh];iDig++) {
198 Int_t charge = fRenDig[iCh][iDig]->GetUniqueID();
66298970 199 Int_t color = charge/sampleCol;if(color>=gStyle->GetNumberOfColors()) color = gStyle->GetNumberOfColors()-1;
06a9f120 200 fRenDig[iCh][iDig]->SetFillColor(gStyle->GetColorPalette(color));
201 fRenDig[iCh][iDig]->Draw();
202 fBox[iCh][iDig]->Draw();
203 }
204 }
45b05be5 205 if(fStEsd =="ON") fRenTxC[iCh]->Draw();
206 if(fStHitMip=="ON") fRenMip[iCh]->Draw();
207 if(fStHitFee=="ON") fRenFee[iCh]->Draw();
208 if(fStHitCko=="ON") fRenCko[iCh]->Draw();
209 if(fStEsd =="ON") fRenRin[iCh]->Draw();
45b05be5 210 if(fStClu =="ON") fRenClu[iCh]->Draw();
e9f11028 211 gPad->SetEditable(kFALSE);
212 }//chambers loop
e9f11028 213 fCanvas->cd(3); gPad->Clear(); DrawLegend();
45b05be5 214
215 fCanvas->cd(7);
216
217 if(fHitFile){fHitMipBok->SetTitle(Form("Mips %s",fStHitMip.Data())); fHitMipBok->Modified();}
218 if(fHitFile){fHitCkoBok->SetTitle(Form("Ckov %s",fStHitCko.Data())); fHitCkoBok->Modified();}
219 if(fHitFile){fHitFeeBok->SetTitle(Form("Fdbk %s",fStHitFee.Data())); fHitFeeBok->Modified();}
220 if(fDigFile){fDigBok->SetTitle(fStDig); fDigBok->Modified();}
221 if(fCluFile){fCluBok->SetTitle(fStClu); fCluBok->Modified();}
222 if(fEsdFile){fEsdBok->SetTitle(fStEsd); fEsdBok->Modified();}
223
e9f11028 224}//Draw()
225//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
226void RenderHit(TClonesArray *pHitLst)
227{//used by ReadEvent() and SimulateEvent() to render hits to polymarker structures, one per chamber
228 for(Int_t iHit=0;iHit<pHitLst->GetEntries();iHit++){ //hits loop
229 AliHMPIDHit *pHit = (AliHMPIDHit*)pHitLst->At(iHit); Int_t ch=pHit->Ch(); Float_t x=pHit->LorsX(); Float_t y=pHit->LorsY(); //get current hit
230 switch(pHit->Pid()){
231 case 50000050: fRenCko[ch]->SetNextPoint(x,y);break;
232 case 50000051: fRenFee[ch]->SetNextPoint(x,y);break;
233 default: fRenMip[ch]->SetNextPoint(x,y);break;
234 }//switch hit PID
235 }//hits loop for this entry
236}//RenderHits()
237//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
e4290ede 238void RenderDig(TObjArray *pDigLst)
239{//used by ReadEvent() and SimulateEvent() to render digs to Tbox structures, one per chamber
240 for(Int_t iCh=0;iCh<=6;iCh++){ //chambers loop
241 TClonesArray *pDigCham=(TClonesArray*)pDigLst->At(iCh); //get digs list for this chamber
06a9f120 242 nDigs[iCh] = 0;
66298970 243 fTotPads[iCh] = pDigCham->GetEntries();
e4290ede 244 for(Int_t iDig=0;iDig<pDigCham->GetEntries();iDig++){ //digs loop
245 AliHMPIDDigit *pDig = (AliHMPIDDigit*)pDigCham->At(iDig); Float_t x=pDig->LorsX(); Float_t y=pDig->LorsY(); //get current hit
06a9f120 246 fRenDig[iCh][iDig]->SetX1(x-0.5*AliHMPIDParam::SizePadX());
247 fRenDig[iCh][iDig]->SetX2(x+0.5*AliHMPIDParam::SizePadX());
248 fRenDig[iCh][iDig]->SetY1(y-0.5*AliHMPIDParam::SizePadY());
249 fRenDig[iCh][iDig]->SetY2(y+0.5*AliHMPIDParam::SizePadY());
250 fRenDig[iCh][iDig]->SetUniqueID((Int_t)pDig->Q());
251 fBox[iCh][iDig]->SetX1(x-0.5*AliHMPIDParam::SizePadX());
252 fBox[iCh][iDig]->SetX2(x+0.5*AliHMPIDParam::SizePadX());
253 fBox[iCh][iDig]->SetY1(y-0.5*AliHMPIDParam::SizePadY());
254 fBox[iCh][iDig]->SetY2(y+0.5*AliHMPIDParam::SizePadY());
255 nDigs[iCh]++;
45b05be5 256 }//Digit loop
e4290ede 257 }//hits loop for this entry
258}//RenderHits()
259//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
260void RenderClu(TObjArray *pClus)
e9f11028 261{//used by ReadEvent() and SimulateEvent() to render clusters to polymarker structures, one per chamber
262 for(Int_t iCh=0;iCh<=6;iCh++){ //chambers loop
263 TClonesArray *pClusCham=(TClonesArray*)pClus->At(iCh); //get clusters list for this chamber
66298970 264 fTotClus[iCh] = pClusCham->GetEntries();
e9f11028 265 for(Int_t iClu=0;iClu<pClusCham->GetEntries();iClu++){ //clusters loop
266 AliHMPIDCluster *pClu = (AliHMPIDCluster*)pClusCham->At(iClu); //get current cluster
e4290ede 267 fRenClu[iCh]->SetNextPoint(pClu->X(),pClu->Y());
45b05be5 268// Printf("RenderClu: ch %i x %f y %f",iCh,pClu->X(),pClu->Y());
269 }//cluster loop
270 }//chamber loop for this entry
e9f11028 271}//RenderClus()
272//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6e06db1d 273void RenderEsd(AliESDEvent *pEsd)
e9f11028 274{//used by ReadEvent() or SimulateEvent() to render ESD to polymarker structures for rings and intersections one per chamber
275 AliHMPIDRecon rec;
276 for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){//tracks loop to collect cerenkov rings and intersection points
277 AliESDtrack *pTrk=pEsd->GetTrack(iTrk); Int_t ch=pTrk->GetHMPIDcluIdx(); //get track and chamber intersected by it
278 if(ch<0) continue; //this track does not intersect any chamber
279 Float_t thRa,phRa,xRa,yRa; pTrk->GetHMPIDtrk(xRa,yRa,thRa,phRa); //get info on current track
e4290ede 280 ch/=1000000;
e9f11028 281 Float_t xPc=0,yPc=0; AliHMPIDTracker::IntTrkCha(pTrk,xPc,yPc); //find again intersection of track with PC--> it is not stored in ESD!
282 fRenTxC[ch]->SetNextPoint(xPc,yPc); //add this intersection point
283 Float_t ckov=pTrk->GetHMPIDsignal(); //get ckov angle stored for this track
284 if(ckov>0){
285 rec.SetTrack(xRa,yRa,thRa,phRa);
06a9f120 286 for(Int_t j=0;j<500;j++){
287 TVector2 pos; pos=rec.TracePhot(ckov,j*6.28/500.);
ae5a42aa 288 if(!AliHMPIDParam::IsInDead(pos.X(),pos.Y())) fRenRin[ch]->SetNextPoint(pos.X(),pos.Y());
e9f11028 289 }
290 }//if ckov is valid
291 }//tracks loop
292}//RenEsd()
a1d55ff3 293//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6e06db1d 294void SimulateEsd(AliESDEvent *pEsd)
a1d55ff3 295{
296 TParticle part; TLorentzVector mom;
50e69536 297 for(Int_t iTrk=0;iTrk<100;iTrk++){//stack loop
45b05be5 298 Printf("SimulateEsd: kProton %i",kProton);
a1d55ff3 299 part.SetPdgCode(kProton);
50e69536 300 part.SetProductionVertex(0,0,0,0);
301 Double_t eta= -0.2+gRandom->Rndm()*0.4; //rapidity is random [-0.2,+0.2]
302 Double_t phi= gRandom->Rndm()*60.*TMath::DegToRad(); //phi is random [ 0 , 60 ] degrees
303 mom.SetPtEtaPhiM(5,eta,phi,part.GetMass());
a1d55ff3 304 part.SetMomentum(mom);
305 AliESDtrack trk(&part);
306 pEsd->AddTrack(&trk);
307 }//stack loop
308}//EsdFromStack()
309//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
6e06db1d 310void SimulateHits(AliESDEvent *pEsd, TClonesArray *pHits)
e9f11028 311{//used by SimulateEvent to simulate hits out from provided ESD
50e69536 312 const Int_t kCerenkov=50000050;
313 const Int_t kFeedback=50000051;
f3bae3e2 314
a1d55ff3 315 AliHMPIDRecon rec;
e9f11028 316 Float_t eMip=200e-9,ePho=7.5e-9;
a591e55f 317 Int_t hc=0;
a1d55ff3 318 for(Int_t iTrk=0;iTrk<pEsd->GetNumberOfTracks();iTrk++){//tracks loop
319 AliESDtrack *pTrk=pEsd->GetTrack(iTrk);
e9f11028 320 Float_t xRa,yRa;
321 Int_t ch=AliHMPIDTracker::IntTrkCha(pTrk,xRa,yRa);
a1d55ff3 322 if(ch<0) continue; //this track does not hit HMPID
50e69536 323 Float_t beta = pTrk->GetP()/(TMath::Sqrt(pTrk->GetP()*pTrk->GetP()+0.938*0.938));
324 Float_t ckov=TMath::ACos(1./(beta*1.292));
a1d55ff3 325
e9f11028 326 Float_t theta,phi,xPc,yPc,; pTrk->GetHMPIDtrk(xPc,yPc,theta,phi); rec.SetTrack(xRa,yRa,theta,phi);
a1d55ff3 327
ae5a42aa 328 if(!AliHMPIDParam::IsInDead(xPc,yPc)) new((*pHits)[hc++]) AliHMPIDHit(ch,eMip,kProton ,iTrk,xPc,yPc); //mip hit
50e69536 329 Int_t nPhots = (Int_t)(20.*TMath::Power(TMath::Sin(ckov),2)/TMath::Power(TMath::Sin(TMath::ACos(1./1.292)),2));
330 for(int i=0;i<nPhots;i++){
a591e55f 331 TVector2 pos;
332 pos=rec.TracePhot(ckov,gRandom->Rndm()*TMath::TwoPi());
ae5a42aa 333 if(!AliHMPIDParam::IsInDead(pos.X(),pos.Y())) new((*pHits)[hc++]) AliHMPIDHit(ch,ePho,kCerenkov,iTrk,pos.X(),pos.Y());
a1d55ff3 334 } //photon hits
e9f11028 335 for(int i=0;i<3;i++){//feedback photons
336 Float_t x=gRandom->Rndm()*160; Float_t y=gRandom->Rndm()*150;
ae5a42aa 337 if(!AliHMPIDParam::IsInDead(x,y)) new((*pHits)[hc++]) AliHMPIDHit(ch,ePho,kFeedback,iTrk,x,y); //feedback hits
e9f11028 338 }//photon hits loop
a1d55ff3 339 }//tracks loop
e9f11028 340}//SimulateHits()
a1d55ff3 341//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66298970 342void DisplayInfo(Int_t px, Int_t py)
343{
344 TObject *obj = fCanvas->GetSelected();
345 TString name = obj->GetName();
346 if(name.Contains("TBox")) {
347 TBox *b = (TBox*)obj;
348 if(b->GetUniqueID()==0) return; // just black frame hit!
349 Float_t locX = 0.5*(b->GetX1()+b->GetX2());
350 Float_t locY = 0.5*(b->GetY1()+b->GetY2());
351 Int_t ch,pc,padX,padY;
352 TVirtualPad *pPad=gPad->GetSelectedPad();
353 Int_t padN = pPad->GetNumber()-1;
354 if(padN<0 || padN>8) return;
355 ch = fChamN[pPad->GetNumber()-1];
356 fParam->Lors2Pad(locX,locY,pc,padX,padY);
357 TVector3 xyz=fParam->Lors2Mars(ch,locX,locY);
358 TString text0;text0.Append(Form("Pad(%i,%i) - LORS(%6.2f,%6.2f) - MARS(%7.2f,%7.2f,%7.2f)",padX,padY,locX,locY,xyz.X(),xyz.Y(),xyz.Z()));
359 TString text1;text1.Append(Form("Module %i Sector = %i ",ch,pc));
360 TString text2;text2.Append(Form("charge = %i ADC",b->GetUniqueID()));
361 TString text3;text3.Append(Form("Pads = %i - Clusters = %i - Multiplicity %5.2f%%",fTotPads[ch],fTotClus[ch],100.*fTotPads[ch]/(144.*160.)));
362 fCanvasImp->SetStatusText(text0,0);
363 fCanvasImp->SetStatusText(text1,1);
364 fCanvasImp->SetStatusText(text2,2);
365 fCanvasImp->SetStatusText(text3,3);
366 }
367}
368//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
369void CloseInfo()
370{
371}
372//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
e9f11028 373void DoZoom(Int_t evt, Int_t px, Int_t py, TObject *)
a1d55ff3 374{
66298970 375// Printf(" px %i py%i event %i",px,py,evt);
376 if(evt==1) DisplayInfo(px,py);
377 if(evt==11) CloseInfo();
378 if(evt!=5 && evt!=6 && evt!=-999) return; //5- zoom in 6-zoom out
8282f9d0 379 const Int_t minZoom=64;
380 const Int_t maxZoom=2;
06a9f120 381 static Int_t zoom[7]={64,64,64,64,64,64,64}; //zoom level
8282f9d0 382
d73ece6a 383 // if(!obj->IsA()->InheritsFrom("TPad")) return; //current object is not pad
50e69536 384 TVirtualPad *pPad=gPad->GetSelectedPad();
06a9f120 385 Int_t padN = pPad->GetNumber()-1;
386 if(padN<0 || padN>8) return;
387
66298970 388 Int_t iCh = fChamN[padN];
06a9f120 389 if(iCh < 0) return;
390
391 if(evt==5&&zoom[iCh]==maxZoom) return;
392 if(evt==6&&zoom[iCh]==minZoom) return;
8282f9d0 393
394 Float_t x=pPad->AbsPixeltoX(px); Float_t y=pPad->AbsPixeltoY(py);
6ed6a312 395
06a9f120 396 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
66298970 397 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
06a9f120 398 if(zoom[iCh]==minZoom) pPad->Range(-10,-10,AliHMPIDParam::SizeAllX()+5,AliHMPIDParam::SizeAllY()+5);
399 ((TCanvas *)gTQSender)->SetTitle(Form("zoom x%i",minZoom/zoom[iCh]));
8282f9d0 400 pPad->Modified();
401 pPad->Update();
a1d55ff3 402}
8282f9d0 403//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
e9f11028 404void ReadEvent()
405{//used by NextEvent() to read curent event and construct all render elements
406 if(fNevt && fEvt>=fNevt) fEvt=0; //loop over max event
45b05be5 407 if(fNevt && fEvt<0) fEvt=fNevt-1; //loop over max event
d73ece6a 408
e9f11028 409 if(fHitFile){
410 if(fHitTree) delete fHitTree; fHitTree=(TTree*)fHitFile->Get(Form("Event%i/TreeH",fEvt));
411
412 fHitTree->SetBranchAddress("HMPID",&fHitLst);
413 for(Int_t iEnt=0;iEnt<fHitTree->GetEntries();iEnt++){
414 fHitTree->GetEntry(iEnt);
415 RenderHit(fHitLst);
416 }//prim loop
417 }//if hits file
e4290ede 418
419 if(fDigFile){
420 if(fDigTree) delete fDigTree; fDigTree=(TTree*)fDigFile->Get(Form("Event%i/TreeD",fEvt));
421 for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fDigTree->SetBranchAddress(Form("HMPID%i",iCh),&(*fDigLst)[iCh]);
422 fDigTree->GetEntry(0);
423 RenderDig(fDigLst);
424 }//if digs file
425
e9f11028 426 if(fCluFile){
427 if(fCluTree) delete fCluTree; fCluTree=(TTree*)fCluFile->Get(Form("Event%i/TreeR",fEvt));
ae5a42aa 428 for(Int_t iCh=AliHMPIDParam::kMinCh;iCh<=AliHMPIDParam::kMaxCh;iCh++) fCluTree->SetBranchAddress(Form("HMPID%i",iCh),&(*fCluLst)[iCh]);
e9f11028 429 fCluTree->GetEntry(0);
e4290ede 430 RenderClu(fCluLst);
e9f11028 431 }//if clus file
432
433 if(fEsdFile){//if ESD file open
434 fEsdTree->GetEntry(fEvt);
435 RenderEsd(fEsd);
436 }//if ESD file
437}//ReadEvent()
d73ece6a 438//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
e9f11028 439void SimulateEvent()
440{// used by NextEvent() to simulate all info
441 AliCDBManager* pCDB = AliCDBManager::Instance(); pCDB->SetDefaultStorage("local://$HOME"); pCDB->SetRun(0);
442 AliCDBEntry *pNmeanEnt=pCDB->Get("HMPID/Calib/Nmean");
443
444 SimulateEsd(fEsd);
445 SimulateHits(fEsd,fHitLst);
45b05be5 446 AliHMPIDv2::Hit2Sdi(fHitLst,fSdiLst);
e9f11028 447 AliHMPIDDigitizer::Sdi2Dig(fSdiLst,fDigLst);
448 AliHMPIDReconstructor::Dig2Clu(fDigLst,fCluLst);
449 AliHMPIDTracker::Recon(fEsd,fCluLst,(TObjArray*)pNmeanEnt->GetObject());
450
451 RenderHit(fHitLst);
e4290ede 452 RenderClu(fCluLst);
e9f11028 453 RenderEsd(fEsd);
454}//SimulateEvent()
d73ece6a 455//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
66298970 456void CheckStatus()
457{
458 if(fStHitMip=="OFF") {fHitMipBok->SetFillColor(kRed);} else {fHitMipBok->SetFillColor(18);}
459 if(fStHitCko=="OFF") {fHitCkoBok->SetFillColor(kRed);} else {fHitCkoBok->SetFillColor(18);}
460 if(fStHitFee=="OFF") {fHitFeeBok->SetFillColor(kRed);} else {fHitFeeBok->SetFillColor(18);}
461 if(fStDig =="OFF") {fDigBok->SetFillColor(kRed);} else {fDigBok->SetFillColor(18);}
462 if(fStClu =="OFF") {fCluBok->SetFillColor(kRed);} else {fCluBok->SetFillColor(18);}
463 if(fStEsd =="OFF") {fEsdBok->SetFillColor(kRed);} else {fEsdBok->SetFillColor(18);}
464}
465//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
45b05be5 466void GetEvent()
d73ece6a 467{
e9f11028 468 ClearRenders();
06a9f120 469 CheckStatus();
e9f11028 470 switch(fType){
471 case 1: ReadEvent();break;
472// case 2: ReadCosmic(); break;
473 case 3: SimulateEvent(); break;
474 default: return;
475 }
476 Draw();
d73ece6a 477}
478//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
45b05be5 479void NextEvent()
480{
481 fTimeArrow = 1;
482 fEvt+=fTimeArrow;
483 GetEvent();
484}
485//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
486void PrevEvent()
487{
488 fTimeArrow = -1;
489 fEvt+=fTimeArrow;
490 GetEvent();
491}
492//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
493void End()
494{
495 gSystem->Exit(0);
496}
497//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
e9f11028 498void Hdisp()
499{//display events from files if any in current directory or simulated events
66298970 500 fParam=AliHMPIDParam::Instance(); // first invocation of AliHMPIDParam to initialize geometry...
e9f11028 501 CreateContainers();
502 CreateRenders();
d73ece6a 503
e9f11028 504 TString title="Session with";
505 if(gSystem->IsFileInIncludePath("HMPID.Hits.root")){// tries to open hits
506 fHitFile=TFile::Open("HMPID.Hits.root"); fNevt=fHitFile->GetNkeys(); fType=1; title+=Form(" HITS-%i ",fNevt);
507 }
6b155609 508
e9f11028 509 if(gSystem->IsFileInIncludePath("HMPID.Digits.root")){// tries to open clusters
e4290ede 510 fDigFile=TFile::Open("HMPID.Digits.root"); fNevt=fDigFile->GetNkeys(); fType=1; title+=Form(" DIGITS-%i ",fNevt);
511 }
6b155609 512
e9f11028 513 if(gSystem->IsFileInIncludePath("HMPID.RecPoints.root")){// tries to open clusters
514 fCluFile=TFile::Open("HMPID.RecPoints.root"); fNevt=fCluFile->GetNkeys(); fType=1; title+=Form(" CLUSTERS-%i ",fNevt);
e4290ede 515 }
50e69536 516
e9f11028 517 if(gSystem->IsFileInIncludePath("AliESDs.root")){
e4290ede 518 fEsdFile=TFile::Open("AliESDs.root");
519 fEsdTree=(TTree*)fEsdFile->Get("esdTree");
520 fEsd->ReadFromTree(fEsdTree); fEsd->GetStdContent(); //clm: new ESD schema: see Task Force meeting 20th June, 2007
521 fNevt=fEsdTree->GetEntries(); fType=1; title+=Form(" ESD-%i ",fNevt);
522
523 //clm: we need to set the magnetic field
524 if(gSystem->IsFileInIncludePath("galice.root")){
525 if(gAlice) delete gAlice;
526 gAL=AliRunLoader::Open();
527 gAL->LoadgAlice();
528 AliHMPIDTracker::SetFieldMap(gAL->GetAliRun()->Field(),kTRUE);
529 }else{
530 Printf("=============== NO galice file! Magnetic field for ESD tracking is: %f ===============",AliTracker::GetBz());
531 }
532
e9f11028 533 }
534
535 if(gSystem->IsFileInIncludePath("cosmic.root")){ //clm: Check if cosmic file is in the folder
536 fCosFile=TFile::Open("cosmic.root"); fCosTree=(TTree*)fCosFile->Get("cosmic"); fNevt=fCosTree->GetEntries(); fType=2;
537 fCosTree->SetBranchAddress("Digs",&fDigLst); fCosTree->SetBranchAddress("Clus",&fCluLst);
538 }
539
66298970 540 fCanvas=new TCanvas("all","",-1024,768);fCanvas->SetWindowSize(-1024,768);
541 fCanvasImp = fCanvas->GetCanvasImp();
542 fCanvasImp->ShowStatusBar();
45b05be5 543 fCanvas->Divide(3,3,0,0);// pAll->ToggleEditor();
e9f11028 544 fCanvas->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",0,0,"DoZoom(Int_t,Int_t,Int_t,TObject*)");
545 fCanvas->cd(7);
06a9f120 546 gStyle->SetPalette(1,0);
e9f11028 547 switch(fType){
548 case 1: fCanvas->SetTitle(title.Data());
45b05be5 549 TButton *pNxtBtn = new TButton("Next" ,"NextEvent()" ,0.0,0.0,0.3,0.1); pNxtBtn->Draw();
550 TButton *pPrvBtn = new TButton("Previous" ,"PrevEvent()" ,0.3,0.0,0.6,0.1); pPrvBtn->Draw();
551 if(fHitFile){TButton *pHitBtn = new TButton("Print hits","PrintHits()" ,0.0,0.2,0.3,0.3); pHitBtn->Draw();}
552 if(fDigFile){TButton *pDigBtn = new TButton("Print digs","PrintDigs()" ,0.0,0.4,0.3,0.5); pDigBtn->Draw();}
553 if(fCluFile){TButton *pCluBtn = new TButton("Print clus","PrintClus()" ,0.0,0.6,0.3,0.7); pCluBtn->Draw();}
554 if(fEsdFile){TButton *pEsdBtn = new TButton("Print ESD ","PrintEsd()" ,0.0,0.8,0.3,0.9); pEsdBtn->Draw();}
06a9f120 555 if(fHitFile){ fHitMipBok = new TButton(Form("Mip %s",fStHitMip.Data()),"SwitchHitMip()",0.3,0.16,0.6,0.22); fHitMipBok->Draw();}
45b05be5 556 if(fHitFile){ fHitCkoBok = new TButton(Form("Ckov %s",fStHitCko.Data()),"SwitchHitCko()",0.3,0.22,0.6,0.28); fHitCkoBok->Draw();}
557 if(fHitFile){ fHitFeeBok = new TButton(Form("Fdbk %s",fStHitFee.Data()),"SwitchHitFee()",0.3,0.28,0.6,0.34); fHitFeeBok->Draw();}
558 if(fDigFile){ fDigBok = new TButton(fStDig ,"SwitchDigs()" ,0.3,0.4,0.6,0.5); fDigBok->Draw();}
559 if(fCluFile){ fCluBok = new TButton(fStClu ,"SwitchClus()" ,0.3,0.6,0.6,0.7); fCluBok->Draw();}
560 if(fEsdFile){ fEsdBok = new TButton(fStEsd ,"SwitchEsd()" ,0.3,0.8,0.6,0.9); fEsdBok->Draw();}
06a9f120 561
562 if(fHitFile){TButton *fHitMipOnly = new TButton(" Only ","OnlyHitMip()",0.6,0.16,0.9,0.22); fHitMipOnly->Draw();}
563 if(fHitFile){TButton *fHitCkoOnly = new TButton(" Only ","OnlyHitCko()",0.6,0.22,0.9,0.28); fHitCkoOnly->Draw();}
564 if(fHitFile){TButton *fHitFeeOnly = new TButton(" Only ","OnlyHitFee()",0.6,0.28,0.9,0.34); fHitFeeOnly->Draw();}
565 if(fDigFile){TButton *fDigOnly = new TButton(" Only ","OnlyDigs()" ,0.6,0.40,0.9,0.50); fDigOnly->Draw();}
566 if(fCluFile){TButton *fCluOnly = new TButton(" Only ","OnlyClus()" ,0.6,0.60,0.9,0.70); fCluOnly->Draw();}
567 if(fEsdFile){TButton *fEsdOnly = new TButton(" Only ","OnlyEsd()" ,0.6,0.80,0.9,0.90); fEsdOnly->Draw();}
66298970 568 TButton *pAll = new TButton(" ALL ","All()" ,0.5,0.90,0.7,1.00); pAll->Draw();
06a9f120 569
570 TButton *pEnd = new TButton("Quit" ,"End()" ,0.6,0.0,0.9,0.1); pEnd->Draw();
e9f11028 571 break;
572 case 2: fCanvas->SetTitle("COSMIC");
45b05be5 573 TButton *pCosBtn = new TButton("Next" ,"NextEvent()",0.0,0.0,0.3,0.1); pCosBtn->Draw();
e9f11028 574
575 break;
576 case 3: fCanvas->SetTitle("SIMULATION");
45b05be5 577 TButton *pSimBtn = new TButton("Simulate" ,"NextEvent()",0.0,0.0,0.3,0.1); pSimBtn->Draw();
578 TButton *pHitBtn = new TButton("Print hits","PrintHits()",0.0,0.2,0.3,0.3); pHitBtn->Draw();
579 TButton *pDigBtn = new TButton("Print digs","PrintDigs()",0.0,0.4,0.3,0.5); pDigBtn->Draw();
580 TButton *pCluBtn = new TButton("Print clus","PrintClus()",0.0,0.6,0.3,0.7); pCluBtn->Draw();
581 TButton *pEsdBtn = new TButton("Print ESD" ,"PrintEsd()" ,0.0,0.8,0.3,0.9); pEsdBtn->Draw();
582 if(fHitFile){ fHitMipBok = new TButton(Form("Mips %s",fStHitMip.Data()),"SwitchHitMip()",0.3,0.16,0.6,0.22); fHitMipBok->Draw();}
583 if(fHitFile){ fHitCkoBok = new TButton(Form("Ckov %s",fStHitCko.Data()),"SwitchHitCko()",0.3,0.22,0.6,0.28); fHitCkoBok->Draw();}
584 if(fHitFile){ fHitFeeBok = new TButton(Form("Fdbk %s",fStHitFee.Data()),"SwitchHitFee()",0.3,0.28,0.6,0.34); fHitFeeBok->Draw();}
585 if(fDigFile){ fDigBok = new TButton(fStDig ,"SwitchDigs()" ,0.3,0.4,0.6,0.5); fDigBok->Draw();}
586 if(fCluFile){ fCluBok = new TButton(fStClu ,"SwitchClus()" ,0.3,0.6,0.6,0.7); fCluBok->Draw();}
587 if(fEsdFile){ fEsdBok = new TButton(fStEsd ,"SwitchEsd()" ,0.3,0.8,0.6,0.9); fEsdBok->Draw();}
06a9f120 588
589 if(fHitFile){TButton *fHitMipOnly = new TButton(" Only ","OnlyHitMip()",0.6,0.16,0.9,0.22); fHitMipOnly->Draw();}
590 if(fHitFile){TButton *fHitCkoOnly = new TButton(" Only ","OnlyHitCko()",0.6,0.22,0.9,0.28); fHitCkoOnly->Draw();}
591 if(fHitFile){TButton *fHitFeeOnly = new TButton(" Only ","OnlyHitFee()",0.6,0.28,0.9,0.34); fHitFeeOnly->Draw();}
592 if(fDigFile){TButton *fDigOnly = new TButton(" Only ","OnlyDigs()" ,0.6,0.40,0.9,0.50); fDigOnly->Draw();}
593 if(fCluFile){TButton *fCluOnly = new TButton(" Only ","OnlyClus()" ,0.6,0.60,0.9,0.70); fCluOnly->Draw();}
594 if(fEsdFile){TButton *fEsdOnly = new TButton(" Only ","OnlyEsd()" ,0.6,0.80,0.9,0.90); fEsdOnly->Draw();}
66298970 595 TButton *pSimAll = new TButton(" ALL ","All()" ,0.5,0.90,0.7,1.00); pSimAll->Draw();
e9f11028 596 break;
597 }
598
0112d781 599 NextEvent();
e9f11028 600
601}//Hdisp()
602//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
45b05be5 603void SwitchHitMip()
604{
605 fStHitMip=(fStHitMip=="OFF")? "ON":"OFF";
606 GetEvent();
607}
608//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
609void SwitchHitCko()
610{
611 fStHitCko=(fStHitCko=="OFF")? "ON":"OFF";
612 GetEvent();
613}
614//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
615void SwitchHitFee()
616{
617 fStHitFee=(fStHitFee=="OFF")? "ON":"OFF";
618 GetEvent();
619}
620//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
621void SwitchDigs()
622{
623 fStDig=(fStDig=="OFF")? "ON":"OFF";
624 GetEvent();
625}
626//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
627void SwitchClus()
628{
629 fStClu=(fStClu=="OFF")? "ON":"OFF";
630 GetEvent();
631}
632//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
633void SwitchEsd()
634{
635 fStEsd=(fStEsd=="OFF")? "ON":"OFF";
06a9f120 636 GetEvent();
637}
638//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
639void AllNo()
640{
641 fStHitMip = "OFF";
642 fStHitCko = "OFF";
643 fStHitFee = "OFF";
644 fStDig = "OFF";
645 fStClu = "OFF";
646 fStEsd = "OFF";
647}
648//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
649void AllYes()
650{
651 if(fHitFile) fStHitMip = "ON";
652 if(fHitFile) fStHitCko = "ON";
653 if(fHitFile) fStHitFee = "ON";
654 if(fDigFile) fStDig = "ON";
655 if(fCluFile) fStClu = "ON";
656 if(fEsdFile) fStEsd = "ON";
657}
658//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
659void All()
660{
661 AllYes();
45b05be5 662 GetEvent();
663}
664//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
06a9f120 665void OnlyHitMip()
666{
667 AllNo();
668 fStHitMip = "ON";
669 GetEvent();
670}
671//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
672void OnlyHitCko()
673{
674 AllNo();
675 fStHitCko = "ON";
676 GetEvent();
677}
678//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
679void OnlyHitFee()
680{
681 AllNo();
682 fStHitFee = "ON";
683 GetEvent();
684}
685//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
686void OnlyDigs()
687{
688 AllNo();
689 fStDig = "ON";
690 GetEvent();
691}
692//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
693void OnlyClus()
694{
695 AllNo();
696 fStClu = "ON";
697 GetEvent();
698}
699//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
700void OnlyEsd()
701{
702 AllNo();
703 fStEsd = "ON";
704 GetEvent();
705}
706//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++