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),
68 SetElementName(
"RPZGeomShared");
111 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoZoutline" );
112 el->SetPickable(kFALSE);
130 TEveStraightLineSet* el =
new TEveStraightLineSet(
"TrackerRhoPhi" );
134 const unsigned int nSegments = 100;
136 for (
unsigned int i = 1;
i <= nSegments; ++
i )
140 TEvePointSet* ref =
new TEvePointSet(
"reference");
141 ref->SetTitle(
"(0,0,0)");
142 ref->SetMarkerStyle(4);
143 ref->SetMarkerColor(kWhite);
144 ref->SetNextPoint(0.,0.,0.);
158 TEveCompound* container =
new TEveCompound(
"MuonRhoPhi" );
161 for( Int_t iStation = 1; iStation <= 4; ++iStation )
163 for( Int_t iSector = 1 ; iSector <= 14; ++iSector )
165 if( iStation < 4 && iSector > 12 )
continue;
172 container->AddElement( shape );
188 TEveElementList* container =
new TEveElementList(
"MuonRhoZ" );
191 TEveCompound* dtContainer =
new TEveCompound(
"DT" );
192 for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
194 for( Int_t iStation = 1; iStation <= 4; ++iStation )
196 float min_rho(1000), max_rho(0), min_z(2000), max_z(-2000);
200 for( Int_t iSector = 1; iSector <= 4; ++iSector )
203 unsigned int rawid =
id.rawId();
208 if ( min_rho > max_rho || min_z > max_z )
continue;
209 TEveElement* se =
makeShape( min_rho, max_rho, min_z, max_z );
211 dtContainer->AddElement(se);
212 se =
makeShape( -max_rho, -min_rho, min_z, max_z );
214 dtContainer->AddElement(se);
218 container->AddElement( dtContainer );
222 TEveCompound* cscContainer =
new TEveCompound(
"CSC" );
223 std::vector<CSCDetId>
ids;
237 int off = (
station == 1) ? 10:0;
244 for (std::vector<CSCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i)
246 unsigned int rawid =
i->rawId();
248 if (!shape)
return cscContainer;
250 shape->SetName(Form(
" e:%d r:%d s:%d chamber %d",
i->endcap(),
i->ring(),
i->station(),
i->chamber() ));
251 cscContainer->AddElement(shape);
253 container->AddElement( cscContainer );
265 t(1,1) = 1;
t(1,2) = 0;
t(1,3) = 0;
266 t(2,1) = 0;
t(2,2) = 1;
t(2,3) = 0;
267 t(3,1) = 0;
t(3,2) = 0;
t(3,3) = 1;
268 t(1,4) = 0;
t(2,4) = (min_rho+max_rho)/2;
t(3,4) = (min_z+max_z)/2;
270 TEveGeoShape* shape =
new TEveGeoShape;
271 shape->SetTransMatrix(t.Array());
273 shape->SetRnrSelf(kTRUE);
274 shape->SetRnrChildren(kTRUE);
275 TGeoBBox* box =
new TGeoBBox( 0, (max_rho-min_rho)/2, (max_z-min_z)/2 );
276 shape->SetShape( box );
285 float& min_rho,
float& max_rho,
float& min_z,
float& max_z )
288 float local[3], global[3];
290 float dX = info.
shape[1];
291 float dY = info.
shape[2];
292 float dZ = info.
shape[3];
294 local[0] = 0; local[1] = 0; local[2] = dZ;
298 local[0] = dX; local[1] = dY; local[2] = dZ;
302 local[0] = -dX; local[1] = dY; local[2] = dZ;
306 local[0] = dX; local[1] = -dY; local[2] = dZ;
310 local[0] = -dX; local[1] = -dY; local[2] = dZ;
314 local[0] = 0; local[1] = 0; local[2] = -dZ;
318 local[0] = dX; local[1] = dY; local[2] = -dZ;
322 local[0] = -dX; local[1] = dY; local[2] = -dZ;
326 local[0] = dX; local[1] = -dY; local[2] = -dZ;
330 local[0] = -dX; local[1] = -dY; local[2] = -dZ;
338 float& min_rho,
float& max_rho,
float& min_z,
float& max_z )
340 double rho =
sqrt(global[0] *global[0]+global[1] *global[1]);
341 if ( min_rho > rho ) min_rho =
rho;
342 if ( max_rho < rho ) max_rho =
rho;
343 if ( min_z > global[2] ) min_z = global[2];
344 if ( max_z < global[2] ) max_z = global[2];
371 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
372 id != ids.end(); ++
id )
376 shape->SetTitle(Form(
"PixelBarrel %d",*
id));
398 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
399 id != ids.end(); ++
id )
403 shape->SetTitle(Form(
"PixelEndCap %d",*
id));
428 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
429 id != ids.end(); ++
id )
437 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
438 id != ids.end(); ++
id )
442 shape->SetTitle(Form(
"TrackerBarrel %d",*
id));
466 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
467 id != ids.end(); ++
id )
476 for( std::vector<unsigned int>::const_iterator
id = ids.begin();
477 id != ids.end(); ++
id )
480 shape->SetTitle(Form(
"TrackerEndcap %d",*
id));
506 std::vector<RPCDetId>
ids;
508 for (
int region = -1; region <=1; ++ region )
510 if (region == 0 )
continue;
536 for (std::vector<RPCDetId>::iterator
i = ids.begin();
i != ids.end(); ++
i)
542 gEve->AddToListTree(shape,
true);
572 if (iStation >= 2) maxChamber = 18;
574 for( Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber ){
575 int maxRoll = iChamber%2 ? 9:10;
576 if (iStation == 2) maxRoll = 8;
577 if (iStation == 3) maxRoll = 12;
580 GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
585 gEve->AddToListTree(shape,
true);
609 for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
610 for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
612 ME0DetId id( iRegion, iLayer, iChamber, iRoll );
617 gEve->AddToListTree(shape,
true);
636 TEveProjected* proj = *BeginProjecteds();
637 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 float caloZ2(bool offset=true)
static const int minRegionId
static const int maxRegionId
const VersionInfo & versionInfo() const
static const int maxLayerId
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)
static const int minRollId
Tan< T >::type tan(const T &t)
const FWGeometry * m_geom
void showPixelEndcap(bool)
TEveElementList * m_rhoZGeo
TEveElementList * m_ME0Elements
void showPixelBarrel(bool)
static const int minStationId
TEveElement * makeCaloOutlineRhoZ()
void showTrackerBarrel(bool)
TEveElementList * m_trackerEndcapElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
TEveElement * makeMuonGeometryRhoZ()
static double caloMaxEta()
static float caloZ1(bool offset=true)
void showTrackerEndcap(bool)
static const int minLayerId
static const int maxRegionId
Color_t geomColor(FWGeomColorIndex) const
const fireworks::Context & m_context
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr