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));
383 for (
const auto&
id : ids) {
387 shape->SetTitle(Form(
"HGCalEE %d",
layer));
389 float color[3] = {0., 0., 0.};
390 if (siIndex >= 0 && siIndex < 3)
391 color[siIndex] = 1.f;
392 shape->SetMainColorRGB(color[0], color[1], color[2]);
393 shape->SetPickable(
false);
410 for (
const auto&
id : ids) {
414 shape->SetTitle(Form(
"HGCalHSi %d",
layer));
416 float color[3] = {0., 0., 0.};
417 if (siIndex >= 0 && siIndex < 3)
418 color[siIndex] = 1.f;
419 shape->SetMainColorRGB(color[0], color[1], color[2]);
420 shape->SetPickable(
false);
440 shape->SetTitle(Form(
"HGCalHSc %d",
layer));
~FW3DViewGeometry() override
void showMuonBarrel(long)
TEveCompound * m_colorComp[kFWGeomColorSize]
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
void showMuonBarrel(bool)
static constexpr int minRegionId
TEveElementList * m_pixelBarrelElements
std::string print(DetId detid) const
TEveElementList * m_HGCalEEElements
void showTrackerEndcap(bool)
static constexpr int32_t maxRegionId
bool haveExtraDet(const char *) const
void showMuonBarrelFull(bool)
constexpr std::array< uint8_t, layerIndexSize > layer
TEveElementList * m_HGCalHSiElements
void showTrackerBarrel(bool)
const VersionInfo & versionInfo() const
TEveElementList * m_HGCalHScElements
TEveGeoShape * getHGCScintillatorEveShape(unsigned int id) const
void showMuonEndcap(bool)
TEveElementList * m_pixelEndcapElements
const TrackerTopology * getTrackerTopology() const
TEveGeoShape * getHGCSiliconEveShape(unsigned int id) const
TEveElementList * m_muonEndcapElements
TEveElementList * m_muonBarrelElements
const FWGeometry * m_geom
TEveElementList * m_trackerEndcapElements
TEveElementList * m_trackerBarrelElements
TEveGeoShape * getEveShape(unsigned int id) const
void showPixelBarrel(bool)
TEveElementList * m_muonBarrelFullElements
static constexpr int32_t maxLayerId
FW3DViewGeometry(const fireworks::Context &context)
void showPixelEndcap(bool)
static constexpr int32_t maxChamberId
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
const float * getParameters(unsigned int id) const
static constexpr int maxRegionId
static constexpr int32_t minLayerId
static constexpr int32_t minRegionId