CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWRPZViewGeometry Class Reference

#include <Fireworks/Core/interface/FWRPZViewGeometry.h>

Inheritance diagram for FWRPZViewGeometry:
FWViewGeometryList

Public Member Functions

 FWRPZViewGeometry (const fireworks::Context &context)
 
void initStdGeoElements (const FWViewType::EType id)
 
void showGEM (bool)
 
void showME0 (bool)
 
void showMtdBarrel (bool)
 
void showMtdEndcap (bool)
 
void showPixelBarrel (bool)
 
void showPixelEndcap (bool)
 
void showRpcEndcap (bool)
 
void showTrackerBarrel (bool)
 
void showTrackerEndcap (bool)
 
 ~FWRPZViewGeometry () override
 
- Public Member Functions inherited from FWViewGeometryList
 FWViewGeometryList (const fireworks::Context &context, bool projected=true)
 
 FWViewGeometryList (const FWViewGeometryList &)=delete
 
const FWViewGeometryListoperator= (const FWViewGeometryList &)=delete
 
void updateColors ()
 
void updateTransparency (bool projectedType)
 
 ~FWViewGeometryList () override
 

Private Member Functions

void estimateProjectionSize (const float *, float &, float &, float &, float &)
 
void estimateProjectionSizeCSC (const FWGeometry::GeomDetInfo &info, float &, float &, float &, float &)
 
void estimateProjectionSizeDT (const FWGeometry::GeomDetInfo &info, float &, float &, float &, float &)
 
 FWRPZViewGeometry (const FWRPZViewGeometry &)
 
void importNew (TEveElementList *x)
 
TEveElement * makeCaloOutlineRhoPhi ()
 
TEveElement * makeCaloOutlineRhoZ ()
 
TEveElement * makeMuonGeometryRhoPhi ()
 
TEveElement * makeMuonGeometryRhoZ ()
 
TEveGeoShape * makeShape (double, double, double, double)
 
const FWRPZViewGeometryoperator= (const FWRPZViewGeometry &)
 

Private Attributes

TEveElementList * m_GEMElements
 
TEveElementList * m_ME0Elements
 
TEveElementList * m_mtdBarrelElements
 
TEveElementList * m_mtdEndcapElements
 
TEveElementList * m_pixelBarrelElements
 
TEveElementList * m_pixelEndcapElements
 
TEveElementList * m_rhoPhiGeo
 
TEveElementList * m_rhoZGeo
 
TEveElementList * m_rpcEndcapElements
 
TEveElementList * m_trackerBarrelElements
 
TEveElementList * m_trackerEndcapElements
 

Additional Inherited Members

- Protected Member Functions inherited from FWViewGeometryList
void addToCompound (TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
 
- Protected Attributes inherited from FWViewGeometryList
TEveCompound * m_colorComp [kFWGeomColorSize]
 
const fireworks::Contextm_context
 
const FWGeometrym_geom
 

Detailed Description

Description: [one line class summary]

Usage: <usage>

Definition at line 32 of file FWRPZViewGeometry.h.

Constructor & Destructor Documentation

◆ FWRPZViewGeometry() [1/2]

FWRPZViewGeometry::FWRPZViewGeometry ( const fireworks::Context context)

Definition at line 55 of file FWRPZViewGeometry.cc.

57 
58  m_rhoPhiGeo(nullptr),
59  m_rhoZGeo(nullptr),
60 
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");
71 }
TEveElementList * m_pixelBarrelElements
TEveElementList * m_GEMElements
TEveElementList * m_rhoPhiGeo
FWViewGeometryList(const fireworks::Context &context, bool projected=true)
TEveElementList * m_rpcEndcapElements
TEveElementList * m_trackerBarrelElements
TEveElementList * m_pixelEndcapElements
TEveElementList * m_mtdBarrelElements
TEveElementList * m_rhoZGeo
TEveElementList * m_ME0Elements
TEveElementList * m_trackerEndcapElements
TEveElementList * m_mtdEndcapElements

◆ ~FWRPZViewGeometry()

FWRPZViewGeometry::~FWRPZViewGeometry ( )
override

Definition at line 78 of file FWRPZViewGeometry.cc.

References m_rhoPhiGeo, and m_rhoZGeo.

78  {
79  m_rhoPhiGeo->DecDenyDestroy();
80  m_rhoZGeo->DecDenyDestroy();
81 }
TEveElementList * m_rhoPhiGeo
TEveElementList * m_rhoZGeo

◆ FWRPZViewGeometry() [2/2]

FWRPZViewGeometry::FWRPZViewGeometry ( const FWRPZViewGeometry )
private

Member Function Documentation

◆ estimateProjectionSize()

void FWRPZViewGeometry::estimateProjectionSize ( const float *  global,
float &  min_rho,
float &  max_rho,
float &  min_z,
float &  max_z 
)
private

Definition at line 345 of file FWRPZViewGeometry.cc.

References rho, and mathSSE::sqrt().

Referenced by estimateProjectionSizeDT().

346  {
347  double rho = sqrt(global[0] * global[0] + global[1] * global[1]);
348  if (min_rho > rho)
349  min_rho = rho;
350  if (max_rho < rho)
351  max_rho = rho;
352  if (min_z > global[2])
353  min_z = global[2];
354  if (max_z < global[2])
355  max_z = global[2];
356 }
T sqrt(T t)
Definition: SSEVec.h:19

◆ estimateProjectionSizeCSC()

void FWRPZViewGeometry::estimateProjectionSizeCSC ( const FWGeometry::GeomDetInfo info,
float &  ,
float &  ,
float &  ,
float &   
)
private

◆ estimateProjectionSizeDT()

void FWRPZViewGeometry::estimateProjectionSizeDT ( const FWGeometry::GeomDetInfo info,
float &  min_rho,
float &  max_rho,
float &  min_z,
float &  max_z 
)
private

Definition at line 275 of file FWRPZViewGeometry.cc.

References l1ctLayer1_cff::dZ, estimateProjectionSize(), info(), DTRecHitClients_cfi::local, FWGeometry::localToGlobal(), and FWViewGeometryList::m_geom.

Referenced by makeMuonGeometryRhoZ().

276  {
277  // we will test 5 points on both sides ( +/- z)
278  float local[3], global[3];
279 
280  float dX = info.shape[1];
281  float dY = info.shape[2];
282  float dZ = info.shape[3];
283 
284  local[0] = 0;
285  local[1] = 0;
286  local[2] = dZ;
287  m_geom->localToGlobal(info, local, global);
288  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
289 
290  local[0] = dX;
291  local[1] = dY;
292  local[2] = dZ;
293  m_geom->localToGlobal(info, local, global);
294  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
295 
296  local[0] = -dX;
297  local[1] = dY;
298  local[2] = dZ;
299  m_geom->localToGlobal(info, local, global);
300  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
301 
302  local[0] = dX;
303  local[1] = -dY;
304  local[2] = dZ;
305  m_geom->localToGlobal(info, local, global);
306  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
307 
308  local[0] = -dX;
309  local[1] = -dY;
310  local[2] = dZ;
311  m_geom->localToGlobal(info, local, global);
312  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
313 
314  local[0] = 0;
315  local[1] = 0;
316  local[2] = -dZ;
317  m_geom->localToGlobal(info, local, global);
318  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
319 
320  local[0] = dX;
321  local[1] = dY;
322  local[2] = -dZ;
323  m_geom->localToGlobal(info, local, global);
324  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
325 
326  local[0] = -dX;
327  local[1] = dY;
328  local[2] = -dZ;
329  m_geom->localToGlobal(info, local, global);
330  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
331 
332  local[0] = dX;
333  local[1] = -dY;
334  local[2] = -dZ;
335  m_geom->localToGlobal(info, local, global);
336  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
337 
338  local[0] = -dX;
339  local[1] = -dY;
340  local[2] = -dZ;
341  m_geom->localToGlobal(info, local, global);
342  estimateProjectionSize(global, min_rho, max_rho, min_z, max_z);
343 }
static const TGPicture * info(bool iBackgroundIsBlack)
void estimateProjectionSize(const float *, float &, float &, float &, float &)
const FWGeometry * m_geom
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:472

◆ importNew()

void FWRPZViewGeometry::importNew ( TEveElementList *  x)
private

Definition at line 683 of file FWRPZViewGeometry.cc.

References amptDefault_cfi::proj, and x.

Referenced by showGEM(), showME0(), showMtdBarrel(), showMtdEndcap(), showPixelBarrel(), showPixelEndcap(), showRpcEndcap(), showTrackerBarrel(), and showTrackerEndcap().

683  {
684  TEveProjected* proj = *BeginProjecteds();
685  proj->GetManager()->SubImportElements(x, proj->GetProjectedAsElement());
686 }

◆ initStdGeoElements()

void FWRPZViewGeometry::initStdGeoElements ( const FWViewType::EType  id)

Definition at line 85 of file FWRPZViewGeometry.cc.

References FWGeometry::isEmpty(), FWViewType::kRhoZ, FWViewGeometryList::m_geom, makeCaloOutlineRhoPhi(), makeCaloOutlineRhoZ(), makeMuonGeometryRhoPhi(), and makeMuonGeometryRhoZ().

Referenced by FWRPZView::setContext().

85  {
86  if (m_geom->isEmpty())
87  return;
88 
89  if (type == FWViewType::kRhoZ) {
90  AddElement(makeMuonGeometryRhoZ());
91  AddElement(makeCaloOutlineRhoZ());
92  } else {
93  AddElement(makeMuonGeometryRhoPhi());
94  AddElement(makeCaloOutlineRhoPhi());
95  }
96 }
TEveElement * makeCaloOutlineRhoPhi()
TEveElement * makeMuonGeometryRhoPhi()
const FWGeometry * m_geom
bool isEmpty() const
Definition: FWGeometry.cc:31
TEveElement * makeCaloOutlineRhoZ()
TEveElement * makeMuonGeometryRhoZ()

◆ makeCaloOutlineRhoPhi()

TEveElement * FWRPZViewGeometry::makeCaloOutlineRhoPhi ( )
private

Definition at line 121 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), fireworks::Context::caloR1(), fireworks::Context::colorManager(), funct::cos(), FWColorManager::geomColor(), mps_fire::i, kFWTrackerBarrelColorIndex, FWViewGeometryList::m_context, alignCSCRings::r, funct::sin(), and TwoPi.

Referenced by initStdGeoElements().

121  {
122  TEveStraightLineSet* el = new TEveStraightLineSet("TrackerRhoPhi");
124 
126  const unsigned int nSegments = 100;
127  const double r = m_context.caloR1();
128  for (unsigned int i = 1; i <= nSegments; ++i)
129  el->AddLine(r * sin(TMath::TwoPi() / nSegments * (i - 1)),
130  r * cos(TMath::TwoPi() / nSegments * (i - 1)),
131  0,
132  r * sin(TMath::TwoPi() / nSegments * i),
133  r * cos(TMath::TwoPi() / nSegments * i),
134  0);
135 
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.);
141  el->AddElement(ref);
142 
143  return el;
144 }
const double TwoPi
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Color_t geomColor(FWGeomColorIndex) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static float caloR1(bool offset=true)
Definition: Context.cc:187
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
const fireworks::Context & m_context
FWColorManager * colorManager() const
Definition: Context.h:58

◆ makeCaloOutlineRhoZ()

TEveElement * FWRPZViewGeometry::makeCaloOutlineRhoZ ( )
private

Definition at line 100 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), fireworks::Context::caloMaxEta(), fireworks::Context::caloR1(), fireworks::Context::caloR2(), fireworks::Context::caloZ1(), fireworks::Context::caloZ2(), JetChargeProducer_cfi::exp, kFWTrackerBarrelColorIndex, FWViewGeometryList::m_context, and funct::tan().

Referenced by initStdGeoElements().

100  {
101  using namespace fireworks;
102 
103  float ri = m_context.caloZ2() * tan(2 * atan(exp(-m_context.caloMaxEta())));
104 
105  TEveStraightLineSet* el = new TEveStraightLineSet("TrackerRhoZoutline");
106  el->SetPickable(kFALSE);
108 
109  el->AddLine(0, m_context.caloR1(), -m_context.caloZ1(), 0, m_context.caloR1(), m_context.caloZ1());
110  el->AddLine(0, -m_context.caloR1(), m_context.caloZ1(), 0, -m_context.caloR1(), -m_context.caloZ1());
111 
112  el->AddLine(0, -m_context.caloR2(), m_context.caloZ2(), 0, -ri, m_context.caloZ2());
113  el->AddLine(0, ri, m_context.caloZ2(), 0, m_context.caloR2(), m_context.caloZ2());
114 
115  el->AddLine(0, -m_context.caloR2(), -m_context.caloZ2(), 0, -ri, -m_context.caloZ2());
116  el->AddLine(0, ri, -m_context.caloZ2(), 0, m_context.caloR2(), -m_context.caloZ2());
117 
118  return el;
119 }
static float caloZ2(bool offset=true)
Definition: Context.cc:192
static float caloR2(bool offset=true)
Definition: Context.cc:189
static float caloR1(bool offset=true)
Definition: Context.cc:187
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
static double caloMaxEta()
Definition: Context.cc:198
static float caloZ1(bool offset=true)
Definition: Context.cc:190
const fireworks::Context & m_context

◆ makeMuonGeometryRhoPhi()

TEveElement * FWRPZViewGeometry::makeMuonGeometryRhoPhi ( void  )
private

Definition at line 148 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), l1ctLayer2EG_cff::id, kFWMuonBarrelLineColorIndex, FWViewGeometryList::m_colorComp, FWViewGeometryList::m_geom, nano_mu_digi_cff::rawId, and l1trig_cff::shape.

Referenced by initStdGeoElements().

148  {
149  Int_t iWheel = 0;
150 
151  // rho-phi view
152  TEveCompound* container = new TEveCompound("MuonRhoPhi");
153 
154  for (Int_t iStation = 1; iStation <= 4; ++iStation) {
155  for (Int_t iSector = 1; iSector <= 14; ++iSector) {
156  if (iStation < 4 && iSector > 12)
157  continue;
158  DTChamberId id(iWheel, iStation, iSector);
159  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
160  if (shape) {
161  shape->SetMainColor(m_colorComp[kFWMuonBarrelLineColorIndex]->GetMainColor());
163  container->AddElement(shape);
164  }
165  }
166  }
167  return container;
168 }
TEveCompound * m_colorComp[kFWGeomColorSize]
const FWGeometry * m_geom
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const

◆ makeMuonGeometryRhoZ()

TEveElement * FWRPZViewGeometry::makeMuonGeometryRhoZ ( void  )
private

Definition at line 176 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), makeMuonMisalignmentScenario::endcap, estimateProjectionSizeDT(), FWGeometry::find(), FWGeometry::getEveShape(), mps_fire::i, l1ctLayer2EG_cff::id, kFWMuonBarrelLineColorIndex, kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, makeShape(), FWGeometry::mapEnd(), CSCDetId::maxEndcapId(), CSCDetId::minEndcapId(), l1trig_cff::shape, and relativeConstraints::station.

Referenced by initStdGeoElements().

176  {
177  TEveElementList* container = new TEveElementList("MuonRhoZ");
178 
179  {
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);
184 
185  // This will give us a quarter of DTs
186  // which is enough for our projection
187  for (Int_t iSector = 1; iSector <= 4; ++iSector) {
188  DTChamberId id(iWheel, iStation, iSector);
189  unsigned int rawid = id.rawId();
190  FWGeometry::IdToInfoItr det = m_geom->find(rawid);
191  if (det == m_geom->mapEnd())
192  return container;
193  estimateProjectionSizeDT(*det, min_rho, max_rho, min_z, max_z);
194  }
195  if (min_rho > max_rho || min_z > max_z)
196  continue;
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);
203  }
204  }
205 
206  container->AddElement(dtContainer);
207  }
208  {
209  // addcsc
210  TEveCompound* cscContainer = new TEveCompound("CSC");
211  std::vector<CSCDetId> ids;
213  for (int station = 1; station <= 4; ++station) {
214  ids.push_back(CSCDetId(endcap, station, 2, 10, 0)); //outer ring up
215  ids.push_back(CSCDetId(endcap, station, 2, 11, 0)); //outer ring up
216 
217  ids.push_back(CSCDetId(endcap, station, 2, 28, 0)); //outer ring down
218  ids.push_back(CSCDetId(endcap, station, 2, 29, 0)); //outer ring down
219 
220  ids.push_back(CSCDetId(endcap, station, 1, 5, 0)); //inner ring up
221  ids.push_back(CSCDetId(endcap, station, 1, 6, 0)); //inner ring up
222 
223  int off = (station == 1) ? 10 : 0;
224  ids.push_back(CSCDetId(endcap, station, 1, 15 + off, 0)); //inner ring down
225  ids.push_back(CSCDetId(endcap, station, 1, 16 + off, 0)); //inner ring down
226  }
227  ids.push_back(CSCDetId(endcap, 1, 3, 10, 0)); // ring 3 down
228  ids.push_back(CSCDetId(endcap, 1, 3, 28, 0)); // ring 3 down
229  }
230  for (std::vector<CSCDetId>::iterator i = ids.begin(); i != ids.end(); ++i) {
231  unsigned int rawid = i->rawId();
232  TEveGeoShape* shape = m_geom->getEveShape(rawid);
233  if (!shape)
234  return cscContainer;
236  shape->SetName(Form(" e:%d r:%d s:%d chamber %d", i->endcap(), i->ring(), i->station(), i->chamber()));
237  cscContainer->AddElement(shape);
238  }
239  container->AddElement(cscContainer);
240  }
241 
242  return container;
243 }
static int minEndcapId()
Definition: CSCDetId.h:234
void estimateProjectionSizeDT(const FWGeometry::GeomDetInfo &info, float &, float &, float &, float &)
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:492
TEveGeoShape * makeShape(double, double, double, double)
static int maxEndcapId()
Definition: CSCDetId.h:235
const FWGeometry * m_geom
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
IdToInfoItr mapEnd() const
Definition: FWGeometry.h:142
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:138

◆ makeShape()

TEveGeoShape * FWRPZViewGeometry::makeShape ( double  min_rho,
double  max_rho,
double  min_z,
double  max_z 
)
private

Definition at line 247 of file FWRPZViewGeometry.cc.

References l1trig_cff::shape, and submitPVValidationJobs::t.

Referenced by makeMuonGeometryRhoZ(), and showMtdEndcap().

247  {
248  TEveTrans t;
249  t(1, 1) = 1;
250  t(1, 2) = 0;
251  t(1, 3) = 0;
252  t(2, 1) = 0;
253  t(2, 2) = 1;
254  t(2, 3) = 0;
255  t(3, 1) = 0;
256  t(3, 2) = 0;
257  t(3, 3) = 1;
258  t(1, 4) = 0;
259  t(2, 4) = (min_rho + max_rho) / 2;
260  t(3, 4) = (min_z + max_z) / 2;
261 
262  TEveGeoShape* shape = new TEveGeoShape;
263  shape->SetTransMatrix(t.Array());
264 
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);
269 
270  return shape;
271 }

◆ operator=()

const FWRPZViewGeometry& FWRPZViewGeometry::operator= ( const FWRPZViewGeometry )
private

◆ showGEM()

void FWRPZViewGeometry::showGEM ( bool  show)

Definition at line 536 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), MillePedeFileConverter_cfg::e, fwLog, FWGeometry::getEveShape(), mps_fire::i, l1ctLayer2EG_cff::id, importNew(), fwlog::kError, kFWMuonEndcapLineColorIndex, m_GEMElements, FWViewGeometryList::m_geom, GEMDetId::maxRegionId, GEMDetId::minRegionId, nano_mu_digi_cff::rawId, and l1trig_cff::shape.

Referenced by FWRPZView::setContext().

536  {
537  // hardcoded gem and me0; need to find better way for different gem geometries
538  if (!m_GEMElements && show) {
539  m_GEMElements = new TEveElementList("GEM");
540 
541  for (Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion = iRegion + 2) {
542  int iStation = 1;
543  int iRing = 1;
544  int iLayer = 1;
545 
546  int carr[4] = {10, 11, 29, 30};
547  for (int i = 0; i < 4; ++i) {
548  int iChamber = carr[i];
549  int iRoll = 0;
550  try {
551  GEMDetId id(iRegion, iRing, iStation, iLayer, iChamber, iRoll);
552  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
553  if (shape) {
555  m_GEMElements->AddElement(shape);
556  gEve->AddToListTree(shape, true);
557  }
558  } catch (cms::Exception& e) {
559  fwLog(fwlog::kError) << "FWRPZViewGeomtery " << e << std::endl;
560  }
561  }
562  }
563 
564  AddElement(m_GEMElements);
566  }
567 
568  if (m_GEMElements) {
569  m_GEMElements->SetRnrState(show);
570  gEve->Redraw3D();
571  }
572 }
TEveElementList * m_GEMElements
static constexpr int32_t maxRegionId
Definition: GEMDetId.h:21
void importNew(TEveElementList *x)
const FWGeometry * m_geom
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
#define fwLog(_level_)
Definition: fwLog.h:45
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
static constexpr int32_t minRegionId
Definition: GEMDetId.h:20

◆ showME0()

void FWRPZViewGeometry::showME0 ( bool  show)

Definition at line 574 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), l1ctLayer2EG_cff::id, importNew(), kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, m_ME0Elements, ME0DetId::maxRegionId, ME0DetId::minRegionId, nano_mu_digi_cff::rawId, and l1trig_cff::shape.

Referenced by FWRPZView::setContext().

574  {
575  if (!m_ME0Elements && show) {
576  m_ME0Elements = new TEveElementList("ME0");
577 
578  for (Int_t iRegion = ME0DetId::minRegionId; iRegion <= ME0DetId::maxRegionId; iRegion = iRegion + 2) {
579  for (Int_t iLayer = 1; iLayer <= 6; ++iLayer) {
580  for (Int_t iChamber = 1; iChamber <= 18; ++iChamber) {
581  Int_t iRoll = 1;
582  ME0DetId id(iRegion, iLayer, iChamber, iRoll);
583  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
584  if (shape) {
586  m_ME0Elements->AddElement(shape);
587  gEve->AddToListTree(shape, true);
588  }
589  }
590  }
591  }
592 
593  AddElement(m_ME0Elements);
595  }
596  if (m_ME0Elements) {
597  m_ME0Elements->SetRnrState(show);
598  gEve->Redraw3D();
599  }
600 }
static constexpr int minRegionId
Definition: ME0DetId.h:63
void importNew(TEveElementList *x)
const FWGeometry * m_geom
TEveElementList * m_ME0Elements
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
static constexpr int maxRegionId
Definition: ME0DetId.h:64

◆ showMtdBarrel()

void FWRPZViewGeometry::showMtdBarrel ( bool  show)

Definition at line 604 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::Forward, FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), l1ctLayer2EG_cff::id, importNew(), kFWMtdBarrelColorIndex, FWViewGeometryList::m_geom, m_mtdBarrelElements, FWGeometry::PixelBarrel, nano_mu_digi_cff::rawId, and l1trig_cff::shape.

Referenced by FWRPZView::setContext().

604  {
605  if (!m_mtdBarrelElements && show) {
606  m_mtdBarrelElements = new TEveElementList("MtdBarrel");
607 
608  std::vector<unsigned int> ids = m_geom->getMatchedIds(FWGeometry::Forward, FWGeometry::PixelBarrel);
609  for (std::vector<unsigned int>::const_iterator mtdId = ids.begin(); mtdId != ids.end(); ++mtdId) {
610  MTDDetId id(*mtdId);
611  if (id.mtdSubDetector() != MTDDetId::MTDType::BTL)
612  continue;
613 
614  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
615  shape->SetTitle(Form("MTD barrel %d", id.rawId()));
616 
618  m_mtdBarrelElements->AddElement(shape);
619  }
620 
621  AddElement(m_mtdBarrelElements);
623  }
624 
625  if (m_mtdBarrelElements) {
626  m_mtdBarrelElements->SetRnrState(show);
627  gEve->Redraw3D();
628  }
629 }
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:254
Detector identifier base class for the MIP Timing Layer.
Definition: MTDDetId.h:21
void importNew(TEveElementList *x)
const FWGeometry * m_geom
TEveElementList * m_mtdBarrelElements
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const

◆ showMtdEndcap()

void FWRPZViewGeometry::showMtdEndcap ( bool  show)

Definition at line 631 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), importNew(), kFWMtdEndcapColorIndex, FWViewGeometryList::m_context, m_mtdEndcapElements, makeShape(), fireworks::Context::mtdEtlR1(), fireworks::Context::mtdEtlR2(), fireworks::Context::mtdEtlZ1(), and fireworks::Context::mtdEtlZ2().

Referenced by FWRPZView::setContext().

631  {
632  if (!m_mtdEndcapElements && show) {
633  m_mtdEndcapElements = new TEveElementList("MtdEndcap");
634 
635  TEveElement* disk1ZposUp =
638  m_mtdEndcapElements->AddElement(disk1ZposUp);
639  TEveElement* disk1ZposDw =
642  m_mtdEndcapElements->AddElement(disk1ZposDw);
643 
644  TEveElement* disk2ZposUp =
647  m_mtdEndcapElements->AddElement(disk2ZposUp);
648  TEveElement* disk2ZposDw =
651  m_mtdEndcapElements->AddElement(disk2ZposDw);
652 
653  TEveElement* disk1ZnegUp =
656  m_mtdEndcapElements->AddElement(disk1ZnegUp);
657  TEveElement* disk1ZnegDw =
660  m_mtdEndcapElements->AddElement(disk1ZnegDw);
661 
662  TEveElement* disk2ZnegUp =
665  m_mtdEndcapElements->AddElement(disk2ZnegUp);
666  TEveElement* disk2ZnegDw =
669  m_mtdEndcapElements->AddElement(disk2ZnegDw);
670 
671  AddElement(m_mtdEndcapElements);
673  }
674 
675  if (m_mtdEndcapElements) {
676  m_mtdEndcapElements->SetRnrState(show);
677  gEve->Redraw3D();
678  }
679 }
static float mtdEtlZ1(const unsigned int &disk_number=1)
Definition: Context.cc:202
static float mtdEtlZ2(const unsigned int &disk_number=1)
Definition: Context.cc:205
TEveGeoShape * makeShape(double, double, double, double)
void importNew(TEveElementList *x)
static float mtdEtlR2()
Definition: Context.cc:201
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveElementList * m_mtdEndcapElements
static float mtdEtlR1()
Definition: Context.cc:200
const fireworks::Context & m_context

◆ showPixelBarrel()

void FWRPZViewGeometry::showPixelBarrel ( bool  show)

Definition at line 369 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), l1ctLayer2EG_cff::id, importNew(), kFWPixelBarrelColorIndex, FWViewGeometryList::m_geom, m_pixelBarrelElements, FWGeometry::PixelBarrel, l1trig_cff::shape, and FWGeometry::Tracker.

Referenced by FWRPZView::setContext().

369  {
370  if (!m_pixelBarrelElements && show) {
371  m_pixelBarrelElements = new TEveElementList("PixelBarrel");
372  AddElement(m_pixelBarrelElements);
373  std::vector<unsigned int> ids = m_geom->getMatchedIds(FWGeometry::Tracker, FWGeometry::PixelBarrel);
374  for (std::vector<unsigned int>::const_iterator id = ids.begin(); id != ids.end(); ++id) {
375  TEveGeoShape* shape = m_geom->getEveShape(*id);
376  if (!shape)
377  return;
378  shape->SetTitle(Form("PixelBarrel %d", *id));
380  m_pixelBarrelElements->AddElement(shape);
381  }
383  }
384 
385  if (m_pixelBarrelElements) {
386  m_pixelBarrelElements->SetRnrState(show);
387  gEve->Redraw3D();
388  }
389 }
TEveElementList * m_pixelBarrelElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:254
void importNew(TEveElementList *x)
const FWGeometry * m_geom
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const

◆ showPixelEndcap()

void FWRPZViewGeometry::showPixelEndcap ( bool  show)

Definition at line 391 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), l1ctLayer2EG_cff::id, importNew(), kFWPixelEndcapColorIndex, FWViewGeometryList::m_geom, m_pixelEndcapElements, FWGeometry::PixelEndcap, l1trig_cff::shape, and FWGeometry::Tracker.

Referenced by FWRPZView::setContext().

391  {
392  if (!m_pixelEndcapElements && show) {
393  m_pixelEndcapElements = new TEveElementList("PixelEndcap");
394 
395  std::vector<unsigned int> ids = m_geom->getMatchedIds(FWGeometry::Tracker, FWGeometry::PixelEndcap);
396  for (std::vector<unsigned int>::const_iterator id = ids.begin(); id != ids.end(); ++id) {
397  TEveGeoShape* shape = m_geom->getEveShape(*id);
398  if (!shape)
399  return;
400  shape->SetTitle(Form("PixelEndCap %d", *id));
402  m_pixelEndcapElements->AddElement(shape);
403  }
404 
405  AddElement(m_pixelEndcapElements);
407  }
408 
409  if (m_pixelEndcapElements) {
410  m_pixelEndcapElements->SetRnrState(show);
411  gEve->Redraw3D();
412  }
413 }
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:254
void importNew(TEveElementList *x)
TEveElementList * m_pixelEndcapElements
const FWGeometry * m_geom
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const

◆ showRpcEndcap()

void FWRPZViewGeometry::showRpcEndcap ( bool  show)

Definition at line 481 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::VersionInfo::haveExtraDet(), mps_fire::i, importNew(), kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, m_rpcEndcapElements, nano_mu_digi_cff::region, relativeConstraints::ring, nano_mu_digi_cff::sector, l1trig_cff::shape, relativeConstraints::station, and FWGeometry::versionInfo().

Referenced by FWRPZView::setContext().

481  {
482  if (!m_rpcEndcapElements && show) {
483  m_rpcEndcapElements = new TEveElementList("RpcEndcap");
484 
485  std::vector<RPCDetId> ids;
486  int mxSt = m_geom->versionInfo().haveExtraDet("RE4") ? 4 : 3;
487  for (int region = -1; region <= 1; ++region) {
488  if (region == 0)
489  continue;
490  for (int ring = 2; ring <= 3; ++ring) {
491  for (int station = 1; station <= mxSt; ++station) {
492  int sector = 1;
493  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 1));
494  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 2));
495  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 3));
496  if (ring == 2 && station == 1) { // 2 layers in ring 2 station 1 up
497  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 1));
498  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 2));
499  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 3));
500  }
501  sector = 5;
502  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 1));
503  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 2));
504  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 3));
505 
506  if (ring == 2 && station == 1) { // 2 layers in ring 2 station 1 down
507  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 1));
508  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 2));
509  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 3));
510  }
511  }
512  }
513  }
514 
515  for (std::vector<RPCDetId>::iterator i = ids.begin(); i != ids.end(); ++i) {
516  TEveGeoShape* shape = m_geom->getEveShape(i->rawId());
517  if (!shape)
518  return;
520  m_rpcEndcapElements->AddElement(shape);
521  gEve->AddToListTree(shape, true);
522  }
523 
524  AddElement(m_rpcEndcapElements);
526  }
527 
528  if (m_rpcEndcapElements) {
529  m_rpcEndcapElements->SetRnrState(show);
530  gEve->Redraw3D();
531  }
532 }
bool haveExtraDet(const char *) const
Definition: FWGeometry.cc:507
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:151
TEveElementList * m_rpcEndcapElements
void importNew(TEveElementList *x)
const FWGeometry * m_geom
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const

◆ showTrackerBarrel()

void FWRPZViewGeometry::showTrackerBarrel ( bool  show)

Definition at line 415 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), l1ctLayer2EG_cff::id, importNew(), kFWTrackerBarrelColorIndex, FWViewGeometryList::m_geom, m_trackerBarrelElements, l1trig_cff::shape, FWGeometry::TIB, FWGeometry::TOB, and FWGeometry::Tracker.

Referenced by FWRPZView::setContext().

415  {
416  if (!m_trackerBarrelElements && show) {
417  m_trackerBarrelElements = new TEveElementList("TrackerBarrel");
418 
419  std::vector<unsigned int> ids = m_geom->getMatchedIds(FWGeometry::Tracker, FWGeometry::TIB);
420  for (std::vector<unsigned int>::const_iterator id = ids.begin(); id != ids.end(); ++id) {
421  TEveGeoShape* shape = m_geom->getEveShape(*id);
422  if (!shape)
423  return;
425  m_trackerBarrelElements->AddElement(shape);
426  }
428  for (std::vector<unsigned int>::const_iterator id = ids.begin(); id != ids.end(); ++id) {
429  TEveGeoShape* shape = m_geom->getEveShape(*id);
430  if (!shape)
431  return;
432  shape->SetTitle(Form("TrackerBarrel %d", *id));
434  m_trackerBarrelElements->AddElement(shape);
435  }
436 
437  AddElement(m_trackerBarrelElements);
439  }
440 
442  m_trackerBarrelElements->SetRnrState(show);
443  gEve->Redraw3D();
444  }
445 }
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:254
void importNew(TEveElementList *x)
TEveElementList * m_trackerBarrelElements
const FWGeometry * m_geom
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const

◆ showTrackerEndcap()

void FWRPZViewGeometry::showTrackerEndcap ( bool  show)

Definition at line 447 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), l1ctLayer2EG_cff::id, importNew(), kFWTrackerEndcapColorIndex, FWViewGeometryList::m_geom, m_trackerEndcapElements, l1trig_cff::shape, FWGeometry::TEC, FWGeometry::TID, and FWGeometry::Tracker.

Referenced by FWRPZView::setContext().

447  {
448  if (!m_trackerEndcapElements && show) {
449  m_trackerEndcapElements = new TEveElementList("TrackerEndcap");
450 
451  std::vector<unsigned int> ids = m_geom->getMatchedIds(FWGeometry::Tracker, FWGeometry::TID);
452  for (std::vector<unsigned int>::const_iterator id = ids.begin(); id != ids.end(); ++id) {
453  TEveGeoShape* shape = m_geom->getEveShape(*id);
455 
456  if (!shape)
457  return;
458  m_trackerEndcapElements->AddElement(shape);
459  }
461  for (std::vector<unsigned int>::const_iterator id = ids.begin(); id != ids.end(); ++id) {
462  TEveGeoShape* shape = m_geom->getEveShape(*id);
463  shape->SetTitle(Form("TrackerEndcap %d", *id));
464  if (!shape)
465  return;
467  m_trackerEndcapElements->AddElement(shape);
468  }
469 
470  AddElement(m_trackerEndcapElements);
472  }
473 
475  m_trackerEndcapElements->SetRnrState(show);
476  gEve->Redraw3D();
477  }
478 }
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:254
void importNew(TEveElementList *x)
const FWGeometry * m_geom
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:317
TEveElementList * m_trackerEndcapElements
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const

Member Data Documentation

◆ m_GEMElements

TEveElementList* FWRPZViewGeometry::m_GEMElements
private

Definition at line 80 of file FWRPZViewGeometry.h.

Referenced by showGEM().

◆ m_ME0Elements

TEveElementList* FWRPZViewGeometry::m_ME0Elements
private

Definition at line 81 of file FWRPZViewGeometry.h.

Referenced by showME0().

◆ m_mtdBarrelElements

TEveElementList* FWRPZViewGeometry::m_mtdBarrelElements
private

Definition at line 82 of file FWRPZViewGeometry.h.

Referenced by showMtdBarrel().

◆ m_mtdEndcapElements

TEveElementList* FWRPZViewGeometry::m_mtdEndcapElements
private

Definition at line 83 of file FWRPZViewGeometry.h.

Referenced by showMtdEndcap().

◆ m_pixelBarrelElements

TEveElementList* FWRPZViewGeometry::m_pixelBarrelElements
private

Definition at line 75 of file FWRPZViewGeometry.h.

Referenced by showPixelBarrel().

◆ m_pixelEndcapElements

TEveElementList* FWRPZViewGeometry::m_pixelEndcapElements
private

Definition at line 76 of file FWRPZViewGeometry.h.

Referenced by showPixelEndcap().

◆ m_rhoPhiGeo

TEveElementList* FWRPZViewGeometry::m_rhoPhiGeo
private

Definition at line 72 of file FWRPZViewGeometry.h.

Referenced by ~FWRPZViewGeometry().

◆ m_rhoZGeo

TEveElementList* FWRPZViewGeometry::m_rhoZGeo
private

Definition at line 73 of file FWRPZViewGeometry.h.

Referenced by ~FWRPZViewGeometry().

◆ m_rpcEndcapElements

TEveElementList* FWRPZViewGeometry::m_rpcEndcapElements
private

Definition at line 79 of file FWRPZViewGeometry.h.

Referenced by showRpcEndcap().

◆ m_trackerBarrelElements

TEveElementList* FWRPZViewGeometry::m_trackerBarrelElements
private

Definition at line 77 of file FWRPZViewGeometry.h.

Referenced by showTrackerBarrel().

◆ m_trackerEndcapElements

TEveElementList* FWRPZViewGeometry::m_trackerEndcapElements
private

Definition at line 78 of file FWRPZViewGeometry.h.

Referenced by showTrackerEndcap().