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 "TEveGeoShape.h" 27 #include "TEveManager.h" 28 #include "TEveProjectionManager.h" 61 m_pixelBarrelElements(nullptr),
62 m_pixelEndcapElements(nullptr),
63 m_trackerBarrelElements(nullptr),
64 m_trackerEndcapElements(nullptr),
65 m_rpcEndcapElements(nullptr),
66 m_GEMElements(nullptr),
67 m_ME0Elements(nullptr) {
68 SetElementName(
"RPZGeomShared");
103 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoZoutline");
104 el->SetPickable(kFALSE);
120 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoPhi");
124 const unsigned int nSegments = 100;
126 for (
unsigned int i = 1;
i <= nSegments; ++
i)
134 TEvePointSet* ref =
new TEvePointSet(
"reference");
135 ref->SetTitle(
"(0,0,0)");
136 ref->SetMarkerStyle(4);
137 ref->SetMarkerColor(kWhite);
138 ref->SetNextPoint(0., 0., 0.);
150 TEveCompound* container =
new TEveCompound(
"MuonRhoPhi");
152 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
153 for (Int_t iSector = 1; iSector <= 14; ++iSector) {
154 if (iStation < 4 && iSector > 12)
161 container->AddElement(shape);
175 TEveElementList* container =
new TEveElementList(
"MuonRhoZ");
178 TEveCompound* dtContainer =
new TEveCompound(
"DT");
179 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel) {
180 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
181 float min_rho(1000), max_rho(0), min_z(2000), max_z(-2000);
185 for (Int_t iSector = 1; iSector <= 4; ++iSector) {
187 unsigned int rawid =
id.rawId();
193 if (min_rho > max_rho || min_z > max_z)
195 TEveElement* se =
makeShape(min_rho, max_rho, min_z, max_z);
197 dtContainer->AddElement(se);
198 se =
makeShape(-max_rho, -min_rho, min_z, max_z);
200 dtContainer->AddElement(se);
204 container->AddElement(dtContainer);
208 TEveCompound* cscContainer =
new TEveCompound(
"CSC");
209 std::vector<CSCDetId> ids;
221 int off = (
station == 1) ? 10 : 0;
228 for (std::vector<CSCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i) {
229 unsigned int rawid =
i->rawId();
234 shape->SetName(Form(
" e:%d r:%d s:%d chamber %d",
i->endcap(),
i->ring(),
i->station(),
i->chamber()));
235 cscContainer->AddElement(shape);
237 container->AddElement(cscContainer);
257 t(2, 4) = (min_rho + max_rho) / 2;
258 t(3, 4) = (min_z + max_z) / 2;
260 TEveGeoShape* shape =
new TEveGeoShape;
261 shape->SetTransMatrix(
t.Array());
263 shape->SetRnrSelf(kTRUE);
264 shape->SetRnrChildren(kTRUE);
265 TGeoBBox* box =
new TGeoBBox(0, (max_rho - min_rho) / 2, (max_z - min_z) / 2);
266 shape->SetShape(box);
276 float local[3], global[3];
278 float dX =
info.shape[1];
279 float dY =
info.shape[2];
344 const float* global,
float& min_rho,
float& max_rho,
float& min_z,
float& max_z) {
345 double rho =
sqrt(global[0] * global[0] + global[1] * global[1]);
350 if (min_z > global[2])
352 if (max_z < global[2])
372 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
376 shape->SetTitle(Form(
"PixelBarrel %d", *
id));
394 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
398 shape->SetTitle(Form(
"PixelEndCap %d", *
id));
418 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
426 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
430 shape->SetTitle(Form(
"TrackerBarrel %d", *
id));
450 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
459 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
461 shape->SetTitle(Form(
"TrackerEndcap %d", *
id));
483 std::vector<RPCDetId> ids;
513 for (std::vector<RPCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i) {
519 gEve->AddToListTree(shape,
true);
544 int carr[4] = {10, 11, 29, 30};
545 for (
int i = 0;
i < 4; ++
i) {
546 int iChamber = carr[
i];
549 GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
554 gEve->AddToListTree(shape,
true);
577 for (Int_t iLayer = 1; iLayer <= 6; ++iLayer) {
578 for (Int_t iChamber = 1; iChamber <= 18; ++iChamber) {
580 ME0DetId id(iRegion, iLayer, iChamber, iRoll);
585 gEve->AddToListTree(shape,
true);
603 TEveProjected*
proj = *BeginProjecteds();
604 proj->GetManager()->SubImportElements(
x,
proj->GetProjectedAsElement());
~FWRPZViewGeometry() override
TEveElementList * m_pixelBarrelElements
FWRPZViewGeometry(const fireworks::Context &context)
TEveCompound * m_colorComp[kFWGeomColorSize]
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
void estimateProjectionSizeDT(const FWGeometry::GeomDetInfo &info, float &, float &, float &, float &)
static constexpr int minRegionId
TEveElementList * m_GEMElements
TEveElementList * m_rhoPhiGeo
TEveElement * makeCaloOutlineRhoPhi()
Sin< T >::type sin(const T &t)
static float caloZ2(bool offset=true)
static constexpr int32_t maxRegionId
bool haveExtraDet(const char *) const
IdToInfoItr find(unsigned int) const
const VersionInfo & versionInfo() const
TEveElementList * m_rpcEndcapElements
Color_t geomColor(FWGeomColorIndex) const
TEveGeoShape * makeShape(double, double, double, double)
void initStdGeoElements(const FWViewType::EType id)
static float caloR2(bool offset=true)
TEveElement * makeMuonGeometryRhoPhi()
void importNew(TEveElementList *x)
TEveElementList * m_trackerBarrelElements
void estimateProjectionSize(const float *, float &, float &, float &, float &)
TEveElementList * m_pixelEndcapElements
Cos< T >::type cos(const T &t)
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
void showPixelBarrel(bool)
TEveGeoShape * getEveShape(unsigned int id) const
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
TEveElement * makeCaloOutlineRhoZ()
void showTrackerBarrel(bool)
TEveElementList * m_trackerEndcapElements
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveElement * makeMuonGeometryRhoZ()
static double caloMaxEta()
IdToInfoItr mapEnd() const
static float caloZ1(bool offset=true)
static constexpr int maxRegionId
void showTrackerEndcap(bool)
const fireworks::Context & m_context
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
FWColorManager * colorManager() const
static constexpr int32_t minRegionId