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" 62 m_trackerBarrelElements(
nullptr),
63 m_trackerEndcapElements(
nullptr),
67 SetElementName(
"RPZGeomShared");
101 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoZoutline");
102 el->SetPickable(kFALSE);
118 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoPhi");
122 const unsigned int nSegments = 100;
124 for (
unsigned int i = 1;
i <= nSegments; ++
i)
132 TEvePointSet* ref =
new TEvePointSet(
"reference");
133 ref->SetTitle(
"(0,0,0)");
134 ref->SetMarkerStyle(4);
135 ref->SetMarkerColor(kWhite);
136 ref->SetNextPoint(0., 0., 0.);
148 TEveCompound* container =
new TEveCompound(
"MuonRhoPhi");
150 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
151 for (Int_t iSector = 1; iSector <= 14; ++iSector) {
152 if (iStation < 4 && iSector > 12)
159 container->AddElement(shape);
173 TEveElementList* container =
new TEveElementList(
"MuonRhoZ");
176 TEveCompound* dtContainer =
new TEveCompound(
"DT");
177 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel) {
178 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
179 float min_rho(1000), max_rho(0), min_z(2000), max_z(-2000);
183 for (Int_t iSector = 1; iSector <= 4; ++iSector) {
185 unsigned int rawid =
id.rawId();
191 if (min_rho > max_rho || min_z > max_z)
193 TEveElement* se =
makeShape(min_rho, max_rho, min_z, max_z);
195 dtContainer->AddElement(se);
196 se =
makeShape(-max_rho, -min_rho, min_z, max_z);
198 dtContainer->AddElement(se);
202 container->AddElement(dtContainer);
206 TEveCompound* cscContainer =
new TEveCompound(
"CSC");
207 std::vector<CSCDetId>
ids;
219 int off = (
station == 1) ? 10 : 0;
226 for (std::vector<CSCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i) {
227 unsigned int rawid =
i->rawId();
232 shape->SetName(Form(
" e:%d r:%d s:%d chamber %d",
i->endcap(),
i->ring(),
i->station(),
i->chamber()));
233 cscContainer->AddElement(shape);
235 container->AddElement(cscContainer);
255 t(2, 4) = (min_rho + max_rho) / 2;
256 t(3, 4) = (min_z + max_z) / 2;
258 TEveGeoShape* shape =
new TEveGeoShape;
259 shape->SetTransMatrix(t.Array());
261 shape->SetRnrSelf(kTRUE);
262 shape->SetRnrChildren(kTRUE);
263 TGeoBBox* box =
new TGeoBBox(0, (max_rho - min_rho) / 2, (max_z - min_z) / 2);
264 shape->SetShape(box);
274 float local[3], global[3];
276 float dX = info.
shape[1];
277 float dY = info.
shape[2];
278 float dZ = info.
shape[3];
342 const float* global,
float& min_rho,
float& max_rho,
float& min_z,
float& max_z) {
343 double rho =
sqrt(global[0] * global[0] + global[1] * global[1]);
348 if (min_z > global[2])
350 if (max_z < global[2])
370 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
374 shape->SetTitle(Form(
"PixelBarrel %d", *
id));
392 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
396 shape->SetTitle(Form(
"PixelEndCap %d", *
id));
416 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
424 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
428 shape->SetTitle(Form(
"TrackerBarrel %d", *
id));
448 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
457 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
459 shape->SetTitle(Form(
"TrackerEndcap %d", *
id));
481 std::vector<RPCDetId>
ids;
511 for (std::vector<RPCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i) {
517 gEve->AddToListTree(shape,
true);
547 for (Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber) {
548 int maxRoll = iChamber % 2 ? 9 : 10;
555 GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
560 gEve->AddToListTree(shape,
true);
582 for (Int_t iLayer = 1; iLayer <= 6; ++iLayer) {
583 for (Int_t iChamber = 1; iChamber <= 18; ++iChamber) {
585 ME0DetId id(iRegion, iLayer, iChamber, iRoll);
590 gEve->AddToListTree(shape,
true);
608 TEveProjected*
proj = *BeginProjecteds();
609 proj->GetManager()->SubImportElements(x, proj->GetProjectedAsElement());
~FWRPZViewGeometry() override
TEveElementList * m_pixelBarrelElements
FWRPZViewGeometry(const fireworks::Context &context)
TEveCompound * m_colorComp[kFWGeomColorSize]
void estimateProjectionSizeDT(const FWGeometry::GeomDetInfo &info, float &, float &, float &, float &)
IdToInfoItr find(unsigned int) const
TEveElementList * m_GEMElements
TEveElementList * m_rhoPhiGeo
TEveElement * makeCaloOutlineRhoPhi()
Sin< T >::type sin(const T &t)
FWColorManager * colorManager() const
static int32_t minRegionId
static float caloZ2(bool offset=true)
static const int maxRegionId
const VersionInfo & versionInfo() const
TEveElementList * m_rpcEndcapElements
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * makeShape(double, double, double, double)
static const int minRegionId
void initStdGeoElements(const FWViewType::EType id)
bool haveExtraDet(const char *) const
static float caloR2(bool offset=true)
TEveElement * makeMuonGeometryRhoPhi()
IdToInfoItr mapEnd() const
void importNew(TEveElementList *x)
TEveElementList * m_trackerBarrelElements
void estimateProjectionSize(const float *, float &, float &, float &, float &)
TEveGeoShape * getEveShape(unsigned int id) const
TEveElementList * m_pixelEndcapElements
Cos< T >::type cos(const T &t)
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
static float caloR1(bool offset=true)
Tan< T >::type tan(const T &t)
const FWGeometry * m_geom
void showPixelEndcap(bool)
TEveElementList * m_rhoZGeo
TEveElementList * m_ME0Elements
static int32_t maxLayerId
void showPixelBarrel(bool)
TEveElement * makeCaloOutlineRhoZ()
void showTrackerBarrel(bool)
TEveElementList * m_trackerEndcapElements
static int32_t maxRegionId
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
TEveElement * makeMuonGeometryRhoZ()
static double caloMaxEta()
static int32_t minStationId
static float caloZ1(bool offset=true)
void showTrackerEndcap(bool)
static int32_t minLayerId
Color_t geomColor(FWGeomColorIndex) const
const fireworks::Context & m_context
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr