18 #include "TEveManager.h"
19 #include "TEveGeoNode.h"
20 #include "TEveCompound.h"
46 m_muonBarrelElements(nullptr),
47 m_muonBarrelFullElements(nullptr),
48 m_muonEndcapElements(nullptr),
49 m_muonEndcapFullElements(nullptr),
50 m_pixelBarrelElements(nullptr),
51 m_pixelEndcapElements(nullptr),
52 m_trackerBarrelElements(nullptr),
53 m_trackerEndcapElements(nullptr),
54 m_HGCalEEElements(nullptr),
55 m_HGCalHSiElements(nullptr),
56 m_HGCalHScElements(nullptr) {
57 SetElementName(
"3D Geometry");
82 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel) {
83 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
86 if (iWheel == -2 || iWheel == 2 || iStation == 4) {
88 s <<
"Station" << iStation;
89 TEveElementList* cStation =
new TEveElementList(
s.str().c_str());
91 for (Int_t iSector = 1; iSector <= 14; ++iSector) {
92 if (iStation < 4 && iSector > 12)
97 cStation->AddElement(shape);
114 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel) {
115 TEveElementList* cWheel =
new TEveElementList(TString::Format(
"Wheel %d", iWheel));
117 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
118 TEveElementList* cStation =
new TEveElementList(TString::Format(
"Station %d", iStation));
119 cWheel->AddElement(cStation);
120 for (Int_t iSector = 1; iSector <= 14; ++iSector) {
121 if (iStation < 4 && iSector > 12)
125 shape->SetTitle(TString::Format(
"DT: W=%d, S=%d, Sec=%d\ndet-id=%u", iWheel, iStation, iSector,
id.rawId()));
127 cStation->AddElement(shape);
145 for (Int_t iEndcap = 1; iEndcap <= 2; ++iEndcap)
147 TEveElementList* cEndcap =
nullptr;
149 cEndcap =
new TEveElementList(
"CSC Forward");
151 cEndcap =
new TEveElementList(
"CSC Backward");
158 Int_t maxChambers = 36;
159 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
160 std::ostringstream
s;
161 s <<
"Station" << iStation;
162 TEveElementList* cStation =
new TEveElementList(
s.str().c_str());
163 cEndcap->AddElement(cStation);
164 for (Int_t iRing = 1; iRing <= 4; ++iRing) {
165 if (iStation > 1 && iRing > 2)
168 std::ostringstream
s;
169 s <<
"Ring" << iRing;
170 TEveElementList* cRing =
new TEveElementList(
s.str().c_str());
171 cStation->AddElement(cRing);
172 (iRing == 1 && iStation > 1) ? (maxChambers = 18) : (maxChambers = 36);
173 for (Int_t iChamber = 1; iChamber <= maxChambers; ++iChamber) {
175 CSCDetId id(iEndcap, iStation, iRing, iChamber, iLayer);
177 shape->SetTitle(TString::Format(
178 "CSC: %s, S=%d, R=%d, C=%d\ndet-id=%u", cEndcap->GetName(), iStation, iRing, iChamber,
id.rawId()));
181 cRing->AddElement(shape);
188 TEveElementList* teEndcap =
nullptr;
190 teEndcap =
new TEveElementList(
"GEM Forward");
192 teEndcap =
new TEveElementList(
"GEM Backward");
198 std::ostringstream
s;
199 s <<
"Station" << iStation;
200 TEveElementList* cStation =
new TEveElementList(
s.str().c_str());
201 teEndcap->AddElement(cStation);
209 for (Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber) {
210 int maxRoll = iChamber % 2 ? 9 : 10;
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 cStation->AddElement(shape);
235 TEveElementList* teEndcap =
nullptr;
237 teEndcap =
new TEveElementList(
"ME0 Forward");
239 teEndcap =
new TEveElementList(
"ME0 Backward");
242 for (Int_t iLayer = 1; iLayer <= 6; ++iLayer) {
243 std::ostringstream
s;
244 s <<
"Layer" << iLayer;
245 TEveElementList* cLayer =
new TEveElementList(
s.str().c_str());
246 teEndcap->AddElement(cLayer);
248 for (Int_t iChamber = 1; iChamber <= 18; ++iChamber) {
251 ME0DetId id(iRegion, iLayer, iChamber, iRoll);
254 shape->SetTitle(TString::Format(
"ME0: , Ch=%d Rl=%d\ndet-id=%u", iChamber, iRoll,
id.rawId()));
257 cLayer->AddElement(shape);
279 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
282 uint32_t rawId = *
id;
285 shape->SetTitle(
title.c_str());
304 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
306 uint32_t rawId = *
id;
309 shape->SetTitle(
title.c_str());
328 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
334 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
336 shape->SetTitle(Form(
"TrackerBarrel %d", *
id));
354 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
360 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
363 shape->SetTitle(Form(
"TrackerEndcap %d", *
id));
382 const unsigned int layer = (
id >> 20) & 0x1F;
383 shape->SetTitle(Form(
"HGCalEE %d", layer));
386 color[0] = color[1] = color[2] = 0.3f + 0.7f * (1.0f - layer / 28.0f);
387 color[1] = 0.5f * (layer & 2
U) + 0.5
f * color[1];
388 const bool isFine = ((
id >> 26) & 0x3) == 0;
389 color[0] *= isFine ? 1.0f : 1.0f;
390 color[1] *= isFine ? 1.0f : 0.4f;
391 color[2] *= isFine ? 0.0f : 0.0f;
392 shape->SetMainColorRGB(color[0], color[1], color[2]);
393 shape->SetPickable(
false);
411 const unsigned int layer = (
id >> 20) & 0x1F;
412 shape->SetTitle(Form(
"HGCalHSi %d", layer));
415 color[0] = color[1] = color[2] = 0.3f + 0.7f * (1.0f - layer / 28.0f);
416 color[0] = 0.5f * (layer & 2
U) + 0.5
f * color[0];
417 const bool isFine = ((
id >> 26) & 0x3) == 0;
418 color[0] *= isFine ? 1.0f : 0.4f;
419 color[1] *= isFine ? 0.7f : 0.7f;
420 color[2] *= isFine ? 0.2f : 0.2f;
421 shape->SetMainColorRGB(color[0], color[1], color[2]);
422 shape->SetPickable(
false);
441 const unsigned int layer = (
id >> 17) & 0x1F;
442 shape->SetTitle(Form(
"HGCalHSc %d", layer));