10 #include "FairRootManager.h"
13 #include "TGeoMatrix.h"
14 #include "TClonesArray.h"
15 #include "TEveTrans.h"
16 #include "TEveManager.h"
17 #include "TEveBoxSet.h"
18 #include "TGLViewer.h"
19 #include "TGLSAViewer.h"
55 while((vol=(TGeoVolume*)
next())){
56 TString volumename = vol->GetName();
57 if(!volumename.Contains(
"Drc")) vol->SetVisibility(kFALSE);
58 if(volumename.Contains(
"DrcBarSupport")) vol->SetVisibility(kFALSE);
59 if(volumename.Contains(
"DrcAirBox")) vol->SetTransparency(80);
60 if(volumename.Contains(
"DrcEV")) vol->SetTransparency(80);
61 if(volumename.Contains(
"DrcBarSensor")) vol->SetTransparency(80);
62 if(volumename.Contains(
"DrcLENS")) vol->SetTransparency(95);
63 if(volumename.Contains(
"DrcMirr")) vol->SetTransparency(50);
64 if(volumename.Contains(
"DrcEVgrease")) vol->SetTransparency(60);
72 TGLViewer *
v = gEve->GetDefaultGLViewer();
74 TGLSAViewer *sav = (TGLSAViewer *)v;
75 sav->SetDrawCameraCenter(
true);
76 TGLCamera & cam=(TGLOrthoCamera &)v->CurrentCamera();
77 cam.SetExternalCenter(
true);
78 cam.SetCenterVec(46.8, 8.9, -120.);
90 TTree *
t=(TTree *) f->Get(
"pndsim") ;
91 TClonesArray*
hit_array=
new TClonesArray(
"PndDrcPDHit");
93 TVector3 recoVector,recoLocal;
95 TGeoHMatrix testMatrix;
96 t->SetBranchAddress(
"DrcPDHit",&hit_array);
99 if(j%1==0) cout<<
"Event No "<<j<<
" #entries "<<hit_array->GetEntriesFast()<<endl;
100 for (Int_t
i=0;
i<hit_array->GetEntriesFast();
i++)
103 hit->Position(recoVector);
104 Int_t detId = hit->GetDetectorID();
105 Int_t sensorId = detId/100;
109 TString detName = Form(
"pix %d", detId);
112 bs->SetDefWidth(pixSize);
113 bs->SetDefHeight(pixSize);
114 bs->AddBox(recoLocal.X()-pixSize/2., recoLocal.Y()-pixSize/2., -0.01);
116 TEveTrans& et = bs->RefMainTrans();
117 et.SetFrom(testMatrix);
128 gStyle->SetPalette(1);
130 TEveRGBAPalette* pal =
new TEveRGBAPalette(0, colnums);
131 TEveElement* man = (TEveElement*)fEventManager;
135 if(it->second > max) max = it->second;
139 TEveBoxSet* topbs =
new TEveBoxSet(
"DrcAccuDigiPixel");
142 it->second->SetPalette(pal);
143 Int_t color =
fHitsN[it->first]*colnums/
max;
144 if(color<1) color =1;
145 it->second->DigitValue(color);
147 it->second->SetDefDepth(s);
148 TEveTrans& et = it->second->RefMainTrans();
149 TVector3
pos = et.GetPos();
150 et.SetPos(pos.X(),pos.Y(),pos.Z()-
s);
151 topbs->AddElement(it->second);
153 gEve->AddElement(topbs, man);
155 gEve->Redraw3D(kFALSE);
162 TEveBoxSet* bs =
new TEveBoxSet(name);
163 bs->Reset(TEveBoxSet::kBT_AABoxFixedDim, kFALSE, 64);
virtual ~PndDrcAccuDigiPixelDraw()
std::map< Int_t, TEveBoxSet * >::iterator boxSetMapIter
cout<< "POINTs for new FwEndCap == "<< tsim-> GetEntriesFast()
friend F32vec4 max(const F32vec4 &a, const F32vec4 &b)
TGeoManager * gGeoManager
PndDrcAccuDigiPixelDraw()
TGeoHMatrix * GetMatrixShortId(Int_t shortId)
void Exec(Option_t *option)
std::map< Int_t, TEveBoxSet * > fHitsArr
TEveBoxSet * CreateNewBoxSet(TString &name)
static PndGeoHandling * Instance()
TVector3 MasterToLocalShortId(const TVector3 &master, const Int_t &shortId)
std::map< Int_t, Int_t > fHitsN
std::map< Int_t, Int_t >::iterator IntIter