SND@LHC Software
Loading...
Searching...
No Matches
ecalDrawer.cxx
Go to the documentation of this file.
1#include "ecalDrawer.h"
2
3#include "FairRootManager.h"
4
5#include "ShipMCTrack.h"
6#include "FairTrackParam.h"
7
8#include "ecalStructure.h"
9#include "ecalInf.h"
10#include "ecalCell.h"
11#include "ecalPoint.h"
12#include "ecalCluster.h"
13#include "ecalMaximum.h"
14#include "ecalCellMC.h"
15
16#include "TTree.h"
17#include "TClonesArray.h"
18#include "TASImage.h"
19#include "TText.h"
20
21#include <stdio.h>
22
23#include <iostream>
24
25using namespace std;
26
28{
29public:
30 ecalDrawerItem(ecalCell* cell, Float_t r, Float_t g, Float_t b)
31 : fCell(cell), fR(r), fG(g), fB(b) {};
33 Float_t fR;
34 Float_t fG;
35 Float_t fB;
36};
37
38void ecalDrawer::Exec(Option_t* option)
39{
40 DrawImage();
41 fEventN++;
42}
43
44void ecalDrawer::PutPixel(Int_t x, Int_t y, Float_t r, Float_t g, Float_t b)
45{
46 if (x<0||x>=fCX) return;
47 if (y<0||y>=fCY) return;
48 if (r<0||r>1)return;
49 if (g<0||g>1)return;
50 if (b<0||b>1)return;
51 Int_t ri=(Int_t)(255.0*r);
52 Int_t gi=(Int_t)(255.0*g);
53 Int_t bi=(Int_t)(255.0*b);
54 static char color[10];
55 sprintf(color, "#%.2X%.2X%.2X", ri, gi, bi);
56 fC->PutPixel(x, y, color);
57}
58
59void ecalDrawer::PutPixel(Int_t x, Int_t y, const char* color)
60{
61 if (x<0||x>=fCX) return;
62 if (y<0||y>=fCY) return;
63 fC->PutPixel(x, fCY-y-1, color);
64}
65
67void ecalDrawer::DrawCell(ecalCell* cell, Float_t r, Float_t g, Float_t b)
68{
69 Int_t ri=(Int_t)(255.0*r);
70 Int_t gi=(Int_t)(255.0*g);
71 Int_t bi=(Int_t)(255.0*b);
72 static char color[10];
73 sprintf(color, "#%.2X%.2X%.2X", ri, gi, bi);
74 DrawCell(cell, color);
75}
76
77void ecalDrawer::DrawCell(ecalCell* cell, const char* color)
78{
79 Int_t xi1=(Int_t)((cell->X1()/fInf->GetEcalSize(0))*fCX+fCX/2.0);
80 Int_t xi2=(Int_t)((cell->X2()/fInf->GetEcalSize(0))*fCX+fCX/2.0);
81 Int_t yi1=(Int_t)((cell->Y1()/fInf->GetEcalSize(1))*fCY+fCY/2.0);
82 Int_t yi2=(Int_t)((cell->Y2()/fInf->GetEcalSize(1))*fCY+fCY/2.0);
83 for(Int_t x=xi1;x<=xi2;x++)
84 for(Int_t y=yi1;y<=yi2;y++)
85 if (x==xi1||y==yi1||x==xi2||y==yi2)
86 PutPixel(x, y, fEdging);
87 else
88 PutPixel(x, y, color);
89
90}
91
92void ecalDrawer::DrawMark(Double_t x, Double_t y, const char* color, Int_t type)
93{
94 Int_t xi=(Int_t)((x/fInf->GetEcalSize(0))*fCX+fCX/2.0);
95 Int_t yi=(Int_t)((y/fInf->GetEcalSize(1))*fCY+fCY/2.0);
96 PutPixel(xi-1, yi-1, color);
97 PutPixel(xi , yi-1, color);
98 PutPixel(xi+1, yi-1, color);
99 PutPixel(xi-1, yi , color);
100 PutPixel(xi , yi , color);
101 PutPixel(xi+1, yi , color);
102 PutPixel(xi-1, yi+1, color);
103 PutPixel(xi , yi+1, color);
104 PutPixel(xi+1, yi+1, color);
105 if (type==1) return;
106 PutPixel(xi-2, yi-2, color);
107 PutPixel(xi+2, yi-2, color);
108 PutPixel(xi-2, yi+2, color);
109 PutPixel(xi+2, yi+2, color);
110 PutPixel(xi , yi-2, color);
111 PutPixel(xi-2, yi , color);
112 PutPixel(xi , yi+2, color);
113 PutPixel(xi+2, yi , color);
114 PutPixel(xi , yi-3, color);
115 PutPixel(xi-3, yi , color);
116 PutPixel(xi , yi+3, color);
117 PutPixel(xi+3, yi , color);
118}
119
121{
122 TString name=fNamePrefix;
123 if (fEventN<10) name+="0";
124 if (fEventN<100) name+="0";
125 if (fEventN<1000) name+="0";
126 name+=fEventN;
127 fC->FillRectangle("#000000", 0, 0, fCX, fCY);
128 fEdging="#FFFFFF";
129 DrawCells();
130 DrawMC();
131// DrawTracks();
132// DrawPhotons();
134 /*
135 PutPixel((Int_t)(fCX/2.0+ 0), (Int_t)(fCY/2.0+ 0), "#FFFFFF");
136 PutPixel((Int_t)(fCX/2.0+ 0), (Int_t)(fCY/2.0+ 1), "#FFFFFF");
137 PutPixel((Int_t)(fCX/2.0+ 0), (Int_t)(fCY/2.0+ 3), "#FFFFFF");
138 PutPixel((Int_t)(fCX/2.0+ 0), (Int_t)(fCY/2.0+ 4), "#FFFFFF");
139 PutPixel((Int_t)(fCX/2.0+ 1), (Int_t)(fCY/2.0+ 2), "#FFFFFF");
140 PutPixel((Int_t)(fCX/2.0+ 2), (Int_t)(fCY/2.0+ 0), "#FFFFFF");
141 PutPixel((Int_t)(fCX/2.0+ 2), (Int_t)(fCY/2.0+ 1), "#FFFFFF");
142 PutPixel((Int_t)(fCX/2.0+ 2), (Int_t)(fCY/2.0+ 3), "#FFFFFF");
143 PutPixel((Int_t)(fCX/2.0+ 2), (Int_t)(fCY/2.0+ 4), "#FFFFFF");
144 PutPixel((Int_t)(fCX/2.0+ 4), (Int_t)(fCY/2.0+ 0), "#FFFFFF");
145 PutPixel((Int_t)(fCX/2.0+ 4), (Int_t)(fCY/2.0+ 3), "#FFFFFF");
146 PutPixel((Int_t)(fCX/2.0+ 4), (Int_t)(fCY/2.0+ 4), "#FFFFFF");
147 PutPixel((Int_t)(fCX/2.0+ 5), (Int_t)(fCY/2.0+ 0), "#FFFFFF");
148 PutPixel((Int_t)(fCX/2.0+ 5), (Int_t)(fCY/2.0+ 2), "#FFFFFF");
149 PutPixel((Int_t)(fCX/2.0+ 6), (Int_t)(fCY/2.0+ 1), "#FFFFFF");
150 PutPixel((Int_t)(fCX/2.0+ 6), (Int_t)(fCY/2.0+ 2), "#FFFFFF");
151 PutPixel((Int_t)(fCX/2.0+ 6), (Int_t)(fCY/2.0+ 3), "#FFFFFF");
152 PutPixel((Int_t)(fCX/2.0+ 6), (Int_t)(fCY/2.0+ 4), "#FFFFFF");
153 PutPixel((Int_t)(fCX/2.0+ 8), (Int_t)(fCY/2.0+ 0), "#FFFFFF");
154 PutPixel((Int_t)(fCX/2.0+ 8), (Int_t)(fCY/2.0+ 1), "#FFFFFF");
155 PutPixel((Int_t)(fCX/2.0+ 8), (Int_t)(fCY/2.0+ 2), "#FFFFFF");
156 PutPixel((Int_t)(fCX/2.0+ 8), (Int_t)(fCY/2.0+ 3), "#FFFFFF");
157 PutPixel((Int_t)(fCX/2.0+ 8), (Int_t)(fCY/2.0+ 4), "#FFFFFF");
158 PutPixel((Int_t)(fCX/2.0+ 9), (Int_t)(fCY/2.0+ 1), "#FFFFFF");
159 PutPixel((Int_t)(fCX/2.0+ 9), (Int_t)(fCY/2.0+ 6), "#FFFFFF");
160 PutPixel((Int_t)(fCX/2.0+10), (Int_t)(fCY/2.0+ 2), "#FFFFFF");
161 PutPixel((Int_t)(fCX/2.0+10), (Int_t)(fCY/2.0+ 6), "#FFFFFF");
162 PutPixel((Int_t)(fCX/2.0+11), (Int_t)(fCY/2.0+ 0), "#FFFFFF");
163 PutPixel((Int_t)(fCX/2.0+11), (Int_t)(fCY/2.0+ 1), "#FFFFFF");
164 PutPixel((Int_t)(fCX/2.0+11), (Int_t)(fCY/2.0+ 2), "#FFFFFF");
165 PutPixel((Int_t)(fCX/2.0+11), (Int_t)(fCY/2.0+ 3), "#FFFFFF");
166 PutPixel((Int_t)(fCX/2.0+11), (Int_t)(fCY/2.0+ 4), "#FFFFFF");
167 */
168 fC->WriteImage(name+".png", TImage::kPng);
169}
170
171void ecalDrawer::DrawLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2,const char* color)
172{
173 Int_t x1i=(Int_t)((x1/fInf->GetEcalSize(0))*fCX+fCX/2.0);
174 Int_t y1i=(Int_t)((y1/fInf->GetEcalSize(1))*fCY+fCY/2.0);
175 Int_t x2i=(Int_t)((x2/fInf->GetEcalSize(0))*fCX+fCX/2.0);
176 Int_t y2i=(Int_t)((y2/fInf->GetEcalSize(1))*fCY+fCY/2.0);
177 if (x1i<0) x1i=0;
178 if (x1i>=fCX) x1i=fCX-1;
179 if (x2i<0) x2i=0;
180 if (x2i>=fCX) x2i=fCX-1;
181 if (y1i<0) y1i=0;
182 if (y1i>=fCY) y1i=fCY-1;
183 if (y2i<0) y2i=0;
184 if (y2i>=fCY) y2i=fCY-1;
185 y1i=fCY-y1i-1;
186 y2i=fCY-y2i-1;
187 fC->DrawLine(x1i, y1i, x2i, y2i, color);
188}
189
190void ecalDrawer::DrawLine(Double_t x, Double_t y, const char* color, Int_t track)
191{
192 if (track==-1111) return;
193 Int_t i=0;
194 Int_t n=fPoints->GetEntriesFast();
195 ecalPoint* pt;
196
197 for(i=0;i<n;i++)
198 {
199 pt=(ecalPoint*)fPoints->At(i);
200 if (pt->GetTrackID()==track) break;
201 }
202 if (i==n) return;
203 DrawLine(x, y, pt->GetX(), pt->GetY(), color);
204}
205
206/*
207void ecalDrawer::DrawPhotons()
208{
209 Int_t rn=fReco->GetEntriesFast();
210 CbmEcalRecParticle* r;
211 Int_t i;
212 for(i=0;i<rn;i++)
213 {
214 r=(CbmEcalRecParticle*)fReco->At(i);
215 DrawLine(r->X(), r->Y(), "#0000FF", r->MCTrack());
216 DrawMark(r->X(), r->Y(), "#0000FF", 0);
217 DrawEnergy(r->X(), r->Y(), r->E(), "#0000FF");
218 DrawChi2(r->X(), r->Y(), r->Chi2(), "#0000FF");
219 }
220}
221
222
223void ecalDrawer::DrawTracks()
224{
225 FairTrackParam* tr;
226 Int_t i;
227 Int_t n=fTracks->GetEntriesFast();
228 Double_t p;
229 for(i=0;i<n;i++)
230 {
231 tr=(FairTrackParam*)fTracks->At(i);
232 p=(TMath::Abs(tr->GetQp())>1.e-4)?1./TMath::Abs(tr->GetQp()):1.e4;
233 DrawMark(tr->GetX(), tr->GetY(), "#FF0000", 0);
234 DrawEnergy(tr->GetX(), tr->GetY(), p, "#FF7777");
235 }
236}
237*/
239{
240 Double_t px=p->GetPx();
241 Double_t py=p->GetPy();
242 Double_t pz=p->GetPz();
243
244 return TMath::Sqrt(px*px+py*py+pz*pz);
245}
246
248void ecalDrawer::DrawChi2(Float_t x, Float_t y, Float_t chi2, const char* color)
249{
250 char stri[30];
251 Int_t xi=(Int_t)((x/fInf->GetEcalSize(0))*fCX+fCX/2.0);
252 Int_t yi=(Int_t)((y/fInf->GetEcalSize(1))*fCY+fCY/2.0);
253 yi-=8;
254 yi=fCY-yi-1;
255 xi-=6;
256
257 if (chi2!=-1111)
258 {
259 sprintf(stri,"%.1f", chi2);
260 fC->DrawText(xi, yi, stri, 8, color, "arialbd.ttf");
261 }
262 else
263 fC->DrawText(xi, yi, "-111", 8, color, "arialbd.ttf");
264}
265
266
267void ecalDrawer::DrawEnergy(ecalPoint* p, const char* color)
268{
269 if (GetP(p)<0.01) return;
270 char stri[10];
271 Int_t x=(Int_t)((p->GetX()/fInf->GetEcalSize(0))*fCX+fCX/2.0);
272 Int_t y=(Int_t)((p->GetY()/fInf->GetEcalSize(1))*fCY+fCY/2.0);
273 y+=9;
274 y=fCY-y-1;
275 x-=6;
276
277 sprintf(stri,"%.2f", GetP(p));
278 if (stri[0]=='0')
279 {
280 x+=2;
281 stri[0]=stri[1];
282 stri[1]=stri[2];
283 stri[2]=stri[3];
284 stri[3]=stri[4];
285 stri[4]=stri[5];
286 stri[5]=stri[6];
287 stri[6]=stri[7];
288 }
289 fC->DrawText(x, y, stri, 8, color, "arialbd.ttf");
290}
291
292void ecalDrawer::DrawPDG(ecalPoint* p, const char* color)
293{
294 char stri[30];
295 Int_t xi=(Int_t)((p->GetX()/fInf->GetEcalSize(0))*fCX+fCX/2.0);
296 Int_t yi=(Int_t)((p->GetY()/fInf->GetEcalSize(1))*fCY+fCY/2.0);
297 yi-=8;
298 yi=fCY-yi-1;
299 xi-=6;
300
301 sprintf(stri,"%d", p->GetPdgCode());
302 fC->DrawText(xi, yi, stri, 8, color, "arialbd.ttf");
303}
304
305
306void ecalDrawer::DrawEnergy(Float_t x, Float_t y, Float_t p, const char* color)
307{
308 if (p<0.01) return;
309 char stri[10];
310 Int_t xi=(Int_t)((x/fInf->GetEcalSize(0))*fCX+fCX/2.0);
311 Int_t yi=(Int_t)((y/fInf->GetEcalSize(1))*fCY+fCY/2.0);
312 yi-=2;
313 yi=fCY-yi-1;
314 xi-=6;
315
316 sprintf(stri,"%.2f", p);
317 fC->DrawText(xi, yi, stri, 8, color, "arialbd.ttf");
318}
319
321{
322 Int_t i;
323 Int_t pn=fPoints->GetEntriesFast();
324 ecalPoint* p;
325
326
327 for(i=0;i<pn;i++)
328 {
329 p=(ecalPoint*)fPoints->At(i);
330 if (!p) continue;
332 if (p->GetPdgCode()==22)
333 {
334 DrawMark(p->GetX(), p->GetY(), "#00FF00", 1);
335 DrawEnergy(p, "#00FF00");
336 continue;
337 }
338 if (TMath::Abs(p->GetPdgCode())==11)
339 {
340 DrawMark(p->GetX(), p->GetY(), "#FFFF00", 1);
341 DrawEnergy(p, "#FFFF00");
342 continue;
343 }
345 if (TMath::Abs(p->GetPdgCode())==2112)
346 {
347 DrawMark(p->GetX(), p->GetY(), "#FF00FF", 1);
348 DrawEnergy(p, "#FF00FF");
349 continue;
350 }
352 DrawMark(p->GetX(), p->GetY(), "#FF0000", 1);
353 DrawEnergy(p, "#FF0000");
354 DrawPDG(p, "#FF0000");
355 }
356}
357
359{
360 list<ecalDrawerItem*>::const_iterator p;
361 list<ecalCell*> clusters;
362 list<ecalCell*> maximums;
363 list<ecalCell*>::const_iterator cp;
364 ShipMCTrack* tr;
365 ShipMCTrack* tq;
366 Float_t max;
367 std::map<Int_t, Float_t>::const_iterator p1;
368 ecalCellMC* c;
369 Int_t rn=fClusters->GetEntriesFast();
370 Int_t i;
371 Int_t j;
372 Float_t x;
373 Float_t y;
374 Float_t dx;
375 Float_t dy;
376 Float_t rad;
377 Float_t phi;
378
379 clusters.clear();
380
381 for(i=0;i<rn;i++)
382 {
383 ecalCluster* cl=(ecalCluster*)fClusters->At(i);
384 for(j=0;j<cl->Size();j++)
385 clusters.push_back(fStr->GetHitCell(cl->CellNum(j)));
386 for(j=0;j<cl->Maxs();j++)
387 maximums.push_back(fStr->GetHitCell(cl->PeakNum(j)));
388 }
389
390 for(p=fCells.begin();p!=fCells.end();++p)
391 {
392 c=(ecalCellMC*)((*p)->fCell);
393 (*p)->fG=c->GetEnergy();
394 (*p)->fR=0;
395 (*p)->fB=0;
396 }
397/*
398 for(p=fCells.begin();p!=fCells.end();++p)
399 {
400 c=(ecalCellMC*)((*p)->fCell);
401 (*p)->fG=c->GetEnergy();
402 (*p)->fR=0;
403 (*p)->fB=0;
404 for(p1=c->GetTrackEnergyBegin();p1!=c->GetTrackEnergyEnd();++p1)
405 {
406 tr=(ShipMCTrack*)fMCTracks->At(p1->first);
407 if (tr==NULL) continue;
408 if (tr->GetPdgCode()==22)
409 (*p)->fR+=p1->second;
410 else
411 if (tr->GetMotherId()>=0)
412 {
413 tq=(ShipMCTrack*)fMCTracks->At(tr->GetMotherId());
414 if (tr->GetMotherId()==22)
415 (*p)->fR+=p1->second;
416 }
417 }
418 if (find(clusters.begin(), clusters.end(), c)==clusters.end())
419 continue;
420 for(i=0;i<rn;i++)
421 {
422 r=(CbmEcalRecParticle*)fReco->At(i);
423 dx=x=c->GetCenterX();
424 dy=y=c->GetCenterY();
425 dx-=r->X();
426 dy-=r->Y();
427 if (TMath::Abs(dx)>30) continue;
428 if (TMath::Abs(dy)>30) continue;
429 rad=TMath::Sqrt(x*x+y*y);
430 phi=TMath::ACos(x/rad)*TMath::RadToDeg();
431 if (y<0) phi=360-phi;
432// (*p)->fB+=fShLib->GetResponse(dx, dy, phi, TMath::ATan(rad/fInf->GetZPos())*TMath::RadToDeg(), c->GetType());
433 }
434 }
435*/
437 max=0;
438 for(p=fCells.begin();p!=fCells.end();++p)
439 {
440 if (max<(*p)->fR) max=(*p)->fR;
441 if (max<(*p)->fG) max=(*p)->fG;
442 if (max<(*p)->fB) max=(*p)->fB;
443 }
444 if (max>0)
445 for(p=fCells.begin();p!=fCells.end();++p)
446 {
447 (*p)->fR/=max;
448 (*p)->fG/=max;
449 (*p)->fB/=max;
450 }
451
456 for(p=fCells.begin();p!=fCells.end();++p)
457 {
458 Float_t l=(*p)->fG; l=TMath::Sqrt(l);
459 Float_t a=0;
460 Float_t b=((*p)->fG-(*p)->fB)/((*p)->fG+(*p)->fB);
461 if ((*p)->fB==0) { b=0; }
462 else
463 {
464 if (b<-0.7) b=-0.7;
465 if (b>0.7) b=0.7;
466 }
467 LabToRGB(l, b, a, (*p)->fR, (*p)->fG, (*p)->fB);
468 }
470 fEdging="#FFFFFF";
471 for(p=fCells.begin();p!=fCells.end();++p)
472 if (find(clusters.begin(), clusters.end(), (*p)->fCell)==clusters.end())
473 DrawCell((*p)->fCell, (*p)->fR, (*p)->fG, (*p)->fB);
474 fEdging="#FF0000";
475 for(p=fCells.begin();p!=fCells.end();++p)
476 if (find(clusters.begin(), clusters.end(), (*p)->fCell)!=clusters.end())
477 DrawCell((*p)->fCell, (*p)->fR, (*p)->fG, (*p)->fB);
478 fEdging="#00FF00";
479 for(p=fCells.begin();p!=fCells.end();++p)
480 if (find(maximums.begin(), maximums.end(), (*p)->fCell)!=maximums.end())
481 DrawCell((*p)->fCell, (*p)->fR, (*p)->fG, (*p)->fB);
482}
483
486{
487 fEventN=0;
488
489
490 FairRootManager* io=FairRootManager::Instance();
491 if (!io)
492 {
493 Fatal("Init", "Can't find IOManager.");
494 return kFATAL;
495 }
496 fMCTracks=(TClonesArray*)io->GetObject("MCTrack");
497 if (!fMCTracks)
498 {
499 Fatal("Init", "Can't find array of MC tracks");
500 return kFATAL;
501 }
502 fPoints=(TClonesArray*)io->GetObject("EcalPoint");
503 if (!fPoints)
504 {
505 Fatal("Init", "Can't find array of Ecal Points");
506 return kFATAL;
507 }
508 fStr=(ecalStructure*)io->GetObject("EcalStructure");
509 if (!fStr)
510 {
511 Fatal("Init", "Can't find calorimeter structure for drawing");
512 return kFATAL;
513 }
514 fClusters=(TClonesArray*)io->GetObject("EcalClusters");
515 if (!fClusters)
516 {
517 Fatal("Init", "Can't find array of calorimeter clusters");
518 return kFATAL;
519 }
522 fCX*=fCellSize*4+4; fCX+=1;
523 fCY*=fCellSize*4+4; fCY+=1;
524 fC=new TASImage(fCX, fCY);
525
526 list<ecalCell*> cells;
527 list<ecalCell*>::const_iterator p;
528 fStr->GetCells(cells);
529 for(p=cells.begin();p!=cells.end();++p)
530 fCells.push_back(new ecalDrawerItem((*p), 0.0, 0.0, 0.0));
531 fTxt->SetTextFont(43);
532 fTxt->SetTextSizePixels(8);
533 fTxt->SetTextAlign(21);
534 return kSUCCESS;
535}
536
537Int_t ecalDrawer::InitPython(TClonesArray* mctracks, TClonesArray* ecalPoints, ecalStructure* structure, TClonesArray* clusters)
538{
539 fMCTracks=mctracks;
540 if (fMCTracks==NULL) return -1111;
541 fPoints=ecalPoints;
542 if (fPoints==NULL) return -1111;
543 fStr=structure;
544 if (fStr==NULL) return -1111;
545 fClusters=clusters;
546 if (fClusters==NULL) return -1111;
547
550 fCX*=fCellSize*4+4; fCX+=1;
551 fCY*=fCellSize*4+4; fCY+=1;
552 fC=new TASImage(fCX, fCY);
553
554 list<ecalCell*> cells;
555 list<ecalCell*>::const_iterator p;
556 fStr->GetCells(cells);
557 for(p=cells.begin();p!=cells.end();++p)
558 fCells.push_back(new ecalDrawerItem((*p), 0.0, 0.0, 0.0));
559 fTxt->SetTextFont(43);
560 fTxt->SetTextSizePixels(8);
561 fTxt->SetTextAlign(21);
562
563 return 0;
564}
565
567{
568 ;
569}
570
571
574{
575 list<ecalDrawerItem*>::const_iterator p=fCells.begin();
576 for(;p!=fCells.end();++p)
577 delete (*p);
578 delete fTxt;
579}
580
582ecalDrawer::ecalDrawer(const char *name, const Int_t iVerbose)
583 : FairTask(name, iVerbose),
584 fNamePrefix("ecal"),
585 fC(NULL),
586 fCellSize(8),
587 fCX(0),
588 fCY(0),
589 fMaxEnergyDep(0.),
590 fStr(NULL),
591 fInf(NULL),
592 fEdging(""),
593 fTxt(new TText()),
594 fCells(),
595 fMCTracks(NULL),
596 fPoints(NULL),
597 fClusters(NULL),
598 fInName("EcalReco"),
599 fEventN(0),
600 fX(0.),
601 fY(0.),
602 fZ(0.),
603 fMCX(0.),
604 fMCY(0.),
605 fMCZ(0.),
606 fMCMotherTrN(0),
607 fE(0.),
608 fMCE(0.),
609 fPX(0.),
610 fPY(0.),
611 fPZ(0.),
612 fMCPX(0.),
613 fMCPY(0.),
614 fMCPZ(0.),
615 fChi2(0.),
616 fPdgCode(0),
617 fR(0.)
618{
619}
620
623 : FairTask(),
624 fNamePrefix("ecal"),
625 fC(NULL),
626 fCellSize(8),
627 fCX(0),
628 fCY(0),
629 fMaxEnergyDep(0.),
630 fStr(NULL),
631 fInf(NULL),
632 fEdging(""),
633 fTxt(new TText()),
634 fCells(),
635 fMCTracks(NULL),
636 fPoints(NULL),
637 fClusters(NULL),
638 fInName("EcalReco"),
639 fEventN(0),
640 fX(0.),
641 fY(0.),
642 fZ(0.),
643 fMCX(0.),
644 fMCY(0.),
645 fMCZ(0.),
646 fMCMotherTrN(0),
647 fE(0.),
648 fMCE(0.),
649 fPX(0.),
650 fPY(0.),
651 fPZ(0.),
652 fMCPX(0.),
653 fMCPY(0.),
654 fMCPZ(0.),
655 fChi2(0.),
656 fPdgCode(0),
657 fR(0.)
658{
659}
660
Float_t X2() const
Definition ecalCell.h:29
Float_t Y2() const
Definition ecalCell.h:30
Float_t Y1() const
Definition ecalCell.h:28
Float_t X1() const
Definition ecalCell.h:27
Int_t Maxs() const
Definition ecalCluster.h:37
Int_t Size() const
Definition ecalCluster.h:35
Int_t PeakNum(Int_t i) const
Definition ecalCluster.h:59
Int_t CellNum(Int_t i) const
Definition ecalCluster.h:58
ecalDrawerItem(ecalCell *cell, Float_t r, Float_t g, Float_t b)
ecalCell * fCell
void PutPixel(Int_t x, Int_t y, Float_t r, Float_t g, Float_t b)
TClonesArray * fMCTracks
Definition ecalDrawer.h:92
TClonesArray * fClusters
Definition ecalDrawer.h:94
TString fEdging
Definition ecalDrawer.h:63
Int_t InitPython(TClonesArray *mctracks, TClonesArray *ecalPoints, ecalStructure *structure, TClonesArray *clusters)
void DrawEnergy(ecalPoint *p, const char *color)
ecalInf * fInf
Definition ecalDrawer.h:62
void DrawMark(Double_t x, Double_t y, const char *color, Int_t type)
TString fNamePrefix
Definition ecalDrawer.h:51
virtual void Finish()
Int_t fCX
Definition ecalDrawer.h:55
Int_t fCellSize
Definition ecalDrawer.h:54
void DrawChi2(Float_t x, Float_t y, Float_t chi2, const char *color)
TText * fTxt
Definition ecalDrawer.h:83
void DrawLine(Double_t x, Double_t y, const char *color, Int_t track)
virtual void Exec(Option_t *option)
Int_t fEventN
Definition ecalDrawer.h:97
ecalStructure * fStr
Definition ecalDrawer.h:61
virtual ~ecalDrawer()
TClonesArray * fPoints
Definition ecalDrawer.h:93
void DrawImage()
std::list< ecalDrawerItem * > fCells
Definition ecalDrawer.h:89
Int_t fCY
Definition ecalDrawer.h:56
void DrawMC()
Double_t GetP(ecalPoint *p)
void DrawCells()
void DrawCell(ecalCell *cell, Float_t r, Float_t g, Float_t b)
TASImage * fC
Definition ecalDrawer.h:53
virtual InitStatus Init()
void DrawPDG(ecalPoint *p, const char *color)
Int_t GetYSize() const
Definition ecalInf.h:46
Int_t GetXSize() const
Definition ecalInf.h:45
Double_t GetEcalSize(Int_t num) const
Definition ecalInf.h:54
void GetCells(std::list< ecalCell * > &cells) const
ecalCell * GetHitCell(const Int_t hitId) const
ecalInf * GetEcalInf() const
ClassImp(ecalDrawer)
void LabToRGB(Float_t L, Float_t a, Float_t b, Float_t &R, Float_t &G, Float_t &B)
Definition ecalDrawer.h:129