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 m_mtdBarrelElements(nullptr),
69 m_mtdEndcapElements(nullptr) {
70 SetElementName(
"RPZGeomShared");
105 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoZoutline");
106 el->SetPickable(kFALSE);
122 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoPhi");
126 const unsigned int nSegments = 100;
128 for (
unsigned int i = 1;
i <= nSegments; ++
i)
136 TEvePointSet* ref =
new TEvePointSet(
"reference");
137 ref->SetTitle(
"(0,0,0)");
138 ref->SetMarkerStyle(4);
139 ref->SetMarkerColor(kWhite);
140 ref->SetNextPoint(0., 0., 0.);
152 TEveCompound* container =
new TEveCompound(
"MuonRhoPhi");
154 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
155 for (Int_t iSector = 1; iSector <= 14; ++iSector) {
156 if (iStation < 4 && iSector > 12)
163 container->AddElement(
shape);
177 TEveElementList* container =
new TEveElementList(
"MuonRhoZ");
180 TEveCompound* dtContainer =
new TEveCompound(
"DT");
181 for (Int_t iWheel = -2; iWheel <= 2; ++iWheel) {
182 for (Int_t iStation = 1; iStation <= 4; ++iStation) {
183 float min_rho(1000), max_rho(0), min_z(2000), max_z(-2000);
187 for (Int_t iSector = 1; iSector <= 4; ++iSector) {
189 unsigned int rawid =
id.rawId();
195 if (min_rho > max_rho || min_z > max_z)
197 TEveElement* se =
makeShape(min_rho, max_rho, min_z, max_z);
199 dtContainer->AddElement(se);
200 se =
makeShape(-max_rho, -min_rho, min_z, max_z);
202 dtContainer->AddElement(se);
206 container->AddElement(dtContainer);
210 TEveCompound* cscContainer =
new TEveCompound(
"CSC");
211 std::vector<CSCDetId> ids;
223 int off = (
station == 1) ? 10 : 0;
230 for (std::vector<CSCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i) {
231 unsigned int rawid =
i->rawId();
236 shape->SetName(Form(
" e:%d r:%d s:%d chamber %d",
i->endcap(),
i->ring(),
i->station(),
i->chamber()));
237 cscContainer->AddElement(
shape);
239 container->AddElement(cscContainer);
259 t(2, 4) = (min_rho + max_rho) / 2;
260 t(3, 4) = (min_z + max_z) / 2;
262 TEveGeoShape*
shape =
new TEveGeoShape;
263 shape->SetTransMatrix(
t.Array());
265 shape->SetRnrSelf(kTRUE);
266 shape->SetRnrChildren(kTRUE);
267 TGeoBBox* box =
new TGeoBBox(0, (max_rho - min_rho) / 2, (max_z - min_z) / 2);
268 shape->SetShape(box);
278 float local[3], global[3];
346 const float* global,
float& min_rho,
float& max_rho,
float& min_z,
float& max_z) {
347 double rho =
sqrt(global[0] * global[0] + global[1] * global[1]);
352 if (min_z > global[2])
354 if (max_z < global[2])
374 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
378 shape->SetTitle(Form(
"PixelBarrel %d", *
id));
396 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
400 shape->SetTitle(Form(
"PixelEndCap %d", *
id));
420 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
428 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
432 shape->SetTitle(Form(
"TrackerBarrel %d", *
id));
452 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
461 for (std::vector<unsigned int>::const_iterator
id = ids.begin();
id != ids.end(); ++
id) {
463 shape->SetTitle(Form(
"TrackerEndcap %d", *
id));
485 std::vector<RPCDetId> ids;
515 for (std::vector<RPCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i) {
521 gEve->AddToListTree(
shape,
true);
546 int carr[4] = {10, 11, 29, 30};
547 for (
int i = 0;
i < 4; ++
i) {
548 int iChamber = carr[
i];
551 GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
556 gEve->AddToListTree(
shape,
true);
579 for (Int_t iLayer = 1; iLayer <= 6; ++iLayer) {
580 for (Int_t iChamber = 1; iChamber <= 18; ++iChamber) {
582 ME0DetId id(iRegion, iLayer, iChamber, iRoll);
587 gEve->AddToListTree(
shape,
true);
609 for (std::vector<unsigned int>::const_iterator mtdId = ids.begin(); mtdId != ids.end(); ++mtdId) {
611 if (
id.mtdSubDetector() != MTDDetId::MTDType::BTL)
615 shape->SetTitle(Form(
"MTD barrel %d",
id.
rawId()));
635 TEveElement* disk1ZposUp =
639 TEveElement* disk1ZposDw =
644 TEveElement* disk2ZposUp =
648 TEveElement* disk2ZposDw =
653 TEveElement* disk1ZnegUp =
657 TEveElement* disk1ZnegDw =
662 TEveElement* disk2ZnegUp =
666 TEveElement* disk2ZnegDw =
684 TEveProjected*
proj = *BeginProjecteds();
685 proj->GetManager()->SubImportElements(
x,
proj->GetProjectedAsElement());
~FWRPZViewGeometry() override
TEveElementList * m_pixelBarrelElements
static float mtdEtlZ1(const unsigned int &disk_number=1)
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
static float mtdEtlZ2(const unsigned int &disk_number=1)
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
Detector identifier base class for the MIP Timing Layer.
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
TEveElementList * m_mtdBarrelElements
void showPixelEndcap(bool)
TEveElementList * m_rhoZGeo
TEveElementList * m_ME0Elements
float dX(const MatchPair &match)
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)
TEveElementList * m_mtdEndcapElements
const fireworks::Context & m_context
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
FWColorManager * colorManager() const
static constexpr int32_t minRegionId
float dY(const MatchPair &match)