18 #include "TEveManager.h"
19 #include "TEveGeoNode.h"
20 #include "TEveGeoShape.h"
21 #include "TEveCompound.h"
48 m_muonBarrelElements(nullptr),
49 m_muonBarrelFullElements(nullptr),
50 m_muonEndcapElements(nullptr),
51 m_muonEndcapFullElements(nullptr),
52 m_pixelBarrelElements(nullptr),
53 m_pixelEndcapElements(nullptr),
54 m_trackerBarrelElements(nullptr),
55 m_trackerEndcapElements(nullptr),
56 m_HGCalEEElements(nullptr),
57 m_HGCalHSiElements(nullptr),
58 m_HGCalHScElements(nullptr) {
59 SetElementName(
"3D Geometry");
84 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel) {
85 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
88 if (iWheel == -2 || iWheel == 2 || iStation == 4) {
90 s <<
"Station" << iStation;
91 TEveElementList* cStation =
new TEveElementList(
s.str().c_str());
93 for (Int_t iSector = 1; iSector <= 14; ++iSector) {
94 if (iStation < 4 && iSector > 12)
99 cStation->AddElement(shape);
116 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel) {
117 TEveElementList* cWheel =
new TEveElementList(TString::Format(
"Wheel %d", iWheel));
119 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
120 TEveElementList* cStation =
new TEveElementList(TString::Format(
"Station %d", iStation));
121 cWheel->AddElement(cStation);
122 for (Int_t iSector = 1; iSector <= 14; ++iSector) {
123 if (iStation < 4 && iSector > 12)
127 shape->SetTitle(TString::Format(
"DT: W=%d, S=%d, Sec=%d\ndet-id=%u", iWheel, iStation, iSector,
id.rawId()));
129 cStation->AddElement(shape);
147 for (Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap)
149 TEveElementList* cEndcap =
nullptr;
151 cEndcap =
new TEveElementList(
"CSC Forward");
153 cEndcap =
new TEveElementList(
"CSC Backward");
160 Int_t maxChambers = 36;
161 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
162 std::ostringstream
s;
163 s <<
"Station" << iStation;
164 TEveElementList* cStation =
new TEveElementList(
s.str().c_str());
165 cEndcap->AddElement(cStation);
166 for (Int_t iRing = 1; iRing <= 4; ++iRing) {
167 if (iStation > 1 && iRing > 2)
170 std::ostringstream
s;
171 s <<
"Ring" << iRing;
172 TEveElementList* cRing =
new TEveElementList(
s.str().c_str());
173 cStation->AddElement(cRing);
174 (iRing == 1 && iStation > 1) ? (maxChambers = 18) : (maxChambers = 36);
175 for (Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber) {
177 CSCDetId id(iEndcap, iStation, iRing, iChamber, iLayer);
179 shape->SetTitle(TString::Format(
180 "CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u", cEndcap->GetName(), iStation, iRing, iChamber,
id.rawId()));
183 cRing->AddElement(shape);
191 TEveElementList* teEndcap =
nullptr;
192 teEndcap =
new TEveElementList(Form(
"GEM Reg=%d", iRegion));
196 std::ostringstream
s;
197 s <<
"Station" << iStation;
198 TEveElementList* cStation =
new TEveElementList(
s.str().c_str());
199 teEndcap->AddElement(cStation);
203 std::ostringstream sl;
204 sl <<
"Layer" << iLayer;
205 TEveElementList* elayer =
new TEveElementList(sl.str().c_str());
206 cStation->AddElement(elayer);
208 for (Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber) {
209 std::ostringstream
cl;
210 cl <<
"Chamber" << iChamber;
211 TEveElementList* cha =
new TEveElementList(
cl.str().c_str());
212 elayer->AddElement(cha);
217 GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
220 shape->SetTitle(TString::Format(
221 "GEM: , Rng=%d, St=%d, Ch=%d Rl=%d\ndet-id=%u", iRing, iStation, iChamber, iRoll,
id.rawId()));
223 cha->AddElement(shape);
237 TEveElementList* teEndcap =
nullptr;
239 teEndcap =
new TEveElementList(
"ME0 Forward");
241 teEndcap =
new TEveElementList(
"ME0 Backward");
244 for (Int_t iLayer = 1; iLayer <= 6; ++iLayer) {
245 std::ostringstream
s;
246 s <<
"Layer" << iLayer;
247 TEveElementList* cLayer =
new TEveElementList(
s.str().c_str());
248 teEndcap->AddElement(cLayer);
250 for (Int_t iChamber = 1; iChamber <= 18; ++iChamber) {
253 ME0DetId id(iRegion, iLayer, iChamber, iRoll);
256 shape->SetTitle(TString::Format(
"ME0: , Ch=%d Rl=%d\ndet-id=%u", iChamber, iRoll,
id.rawId()));
259 cLayer->AddElement(shape);
281 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
284 uint32_t rawId = *
id;
287 shape->SetTitle(
title.c_str());
306 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
308 uint32_t rawId = *
id;
311 shape->SetTitle(
title.c_str());
330 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
336 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
338 shape->SetTitle(Form(
"TrackerBarrel %d", *
id));
356 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
362 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
365 shape->SetTitle(Form(
"TrackerEndcap %d", *
id));
384 const unsigned int layer = (
id >> 20) & 0x1F;
385 shape->SetTitle(Form(
"HGCalEE %d", layer));
388 color[0] = color[1] = color[2] = 0.3f + 0.7f * (1.0f - layer / 28.0f);
389 color[1] = 0.5f * (layer & 2
U) + 0.5
f * color[1];
390 const bool isFine = ((
id >> 26) & 0x3) == 0;
391 color[0] *= isFine ? 1.0f : 1.0f;
392 color[1] *= isFine ? 1.0f : 0.4f;
393 color[2] *= isFine ? 0.0f : 0.0f;
394 shape->SetMainColorRGB(color[0], color[1], color[2]);
395 shape->SetPickable(
false);
413 const unsigned int layer = (
id >> 20) & 0x1F;
414 shape->SetTitle(Form(
"HGCalHSi %d", layer));
417 color[0] = color[1] = color[2] = 0.3f + 0.7f * (1.0f - layer / 28.0f);
418 color[0] = 0.5f * (layer & 2
U) + 0.5
f * color[0];
419 const bool isFine = ((
id >> 26) & 0x3) == 0;
420 color[0] *= isFine ? 1.0f : 0.4f;
421 color[1] *= isFine ? 0.7f : 0.7f;
422 color[2] *= isFine ? 0.2f : 0.2f;
423 shape->SetMainColorRGB(color[0], color[1], color[2]);
424 shape->SetPickable(
false);
443 const unsigned int layer = (
id >> 17) & 0x1F;
444 shape->SetTitle(Form(
"HGCalHSc %d", layer));