20 #include "TEveElement.h"
21 #include "TEveCompound.h"
22 #include "TEveScene.h"
23 #include "TEvePointSet.h"
24 #include "TEveStraightLineSet.h"
25 #include "TEveGeoNode.h"
26 #include "TEveManager.h"
27 #include "TEveProjectionManager.h"
60 m_pixelBarrelElements(nullptr),
61 m_pixelEndcapElements(nullptr),
62 m_trackerBarrelElements(nullptr),
63 m_trackerEndcapElements(nullptr),
64 m_rpcEndcapElements(nullptr),
65 m_GEMElements(nullptr),
66 m_ME0Elements(nullptr) {
67 SetElementName(
"RPZGeomShared");
102 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoZoutline");
103 el->SetPickable(kFALSE);
119 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoPhi");
123 const unsigned int nSegments = 100;
125 for (
unsigned int i = 1;
i <= nSegments; ++
i)
133 TEvePointSet* ref =
new TEvePointSet(
"reference");
134 ref->SetTitle(
"(0,0,0)");
135 ref->SetMarkerStyle(4);
136 ref->SetMarkerColor(kWhite);
137 ref->SetNextPoint(0., 0., 0.);
149 TEveCompound* container =
new TEveCompound(
"MuonRhoPhi");
151 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
152 for (Int_t iSector = 1; iSector <= 14; ++iSector) {
153 if (iStation < 4 && iSector > 12)
160 container->AddElement(shape);
174 TEveElementList* container =
new TEveElementList(
"MuonRhoZ");
177 TEveCompound* dtContainer =
new TEveCompound(
"DT");
178 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel) {
179 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
180 float min_rho(1000), max_rho(0), min_z(2000), max_z(-2000);
184 for (Int_t iSector = 1; iSector <= 4; ++iSector) {
186 unsigned int rawid =
id.rawId();
192 if (min_rho > max_rho || min_z > max_z)
194 TEveElement* se =
makeShape(min_rho, max_rho, min_z, max_z);
196 dtContainer->AddElement(se);
197 se =
makeShape(-max_rho, -min_rho, min_z, max_z);
199 dtContainer->AddElement(se);
203 container->AddElement(dtContainer);
207 TEveCompound* cscContainer =
new TEveCompound(
"CSC");
208 std::vector<CSCDetId> ids;
220 int off = (
station == 1) ? 10 : 0;
227 for (std::vector<CSCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i) {
228 unsigned int rawid =
i->rawId();
233 shape->SetName(Form(
" e:%d r:%d s:%d chamber %d",
i->endcap(),
i->ring(),
i->station(),
i->chamber()));
234 cscContainer->AddElement(shape);
236 container->AddElement(cscContainer);
256 t(2, 4) = (min_rho + max_rho) / 2;
257 t(3, 4) = (min_z + max_z) / 2;
259 TEveGeoShape* shape =
new TEveGeoShape;
260 shape->SetTransMatrix(
t.Array());
262 shape->SetRnrSelf(kTRUE);
263 shape->SetRnrChildren(kTRUE);
264 TGeoBBox* box =
new TGeoBBox(0, (max_rho - min_rho) / 2, (max_z - min_z) / 2);
265 shape->SetShape(box);
275 float local[3], global[3];
277 float dX =
info.shape[1];
278 float dY =
info.shape[2];
279 float dZ =
info.shape[3];
343 const float* global,
float& min_rho,
float& max_rho,
float& min_z,
float& max_z) {
344 double rho =
sqrt(global[0] * global[0] + global[1] * global[1]);
349 if (min_z > global[2])
351 if (max_z < global[2])
371 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
375 shape->SetTitle(Form(
"PixelBarrel %d", *
id));
393 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
397 shape->SetTitle(Form(
"PixelEndCap %d", *
id));
417 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
425 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
429 shape->SetTitle(Form(
"TrackerBarrel %d", *
id));
449 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
458 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
460 shape->SetTitle(Form(
"TrackerEndcap %d", *
id));
482 std::vector<RPCDetId> ids;
512 for (std::vector<RPCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i) {
518 gEve->AddToListTree(shape,
true);
548 for (Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber) {
549 int maxRoll = iChamber % 2 ? 9 : 10;
556 GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
561 gEve->AddToListTree(shape,
true);
583 for (Int_t iLayer = 1; iLayer <= 6; ++iLayer) {
584 for (Int_t iChamber = 1; iChamber <= 18; ++iChamber) {
586 ME0DetId id(iRegion, iLayer, iChamber, iRoll);
591 gEve->AddToListTree(shape,
true);
609 TEveProjected*
proj = *BeginProjecteds();
610 proj->GetManager()->SubImportElements(
x,
proj->GetProjectedAsElement());