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 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)
 
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_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::FWRPZViewGeometry ( const fireworks::Context context)

Definition at line 54 of file FWRPZViewGeometry.cc.

54  :
55  FWViewGeometryList(context),
56 
57  m_rhoPhiGeo(nullptr),
58  m_rhoZGeo(nullptr),
59 
60  m_pixelBarrelElements(nullptr),
61  m_pixelEndcapElements(nullptr),
62  m_trackerBarrelElements(nullptr),
63  m_trackerEndcapElements(nullptr),
64  m_rpcEndcapElements(nullptr),
65  m_GEMElements(nullptr),
66  m_ME0Elements(nullptr)
67 {
68  SetElementName("RPZGeomShared");
69 }
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_rhoZGeo
TEveElementList * m_ME0Elements
TEveElementList * m_trackerEndcapElements
FWRPZViewGeometry::~FWRPZViewGeometry ( )
override

Definition at line 76 of file FWRPZViewGeometry.cc.

References m_rhoPhiGeo, and m_rhoZGeo.

77 {
78  m_rhoPhiGeo->DecDenyDestroy();
79  m_rhoZGeo->DecDenyDestroy();
80 }
TEveElementList * m_rhoPhiGeo
TEveElementList * m_rhoZGeo
FWRPZViewGeometry::FWRPZViewGeometry ( const FWRPZViewGeometry )
private

Member Function Documentation

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

Definition at line 337 of file FWRPZViewGeometry.cc.

References rho, and mathSSE::sqrt().

Referenced by estimateProjectionSizeDT().

339 {
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];
345 }
T sqrt(T t)
Definition: SSEVec.h:18
void FWRPZViewGeometry::estimateProjectionSizeCSC ( const FWGeometry::GeomDetInfo info,
float &  ,
float &  ,
float &  ,
float &   
)
private
void FWRPZViewGeometry::estimateProjectionSizeDT ( const FWGeometry::GeomDetInfo info,
float &  min_rho,
float &  max_rho,
float &  min_z,
float &  max_z 
)
private

Definition at line 284 of file FWRPZViewGeometry.cc.

References estimateProjectionSize(), DTRecHitClients_cfi::local, FWGeometry::localToGlobal(), FWViewGeometryList::m_geom, and FWGeometry::GeomDetInfo::shape.

Referenced by makeMuonGeometryRhoZ().

286 {
287  // we will test 5 points on both sides ( +/- z)
288  float local[3], global[3];
289 
290  float dX = info.shape[1];
291  float dY = info.shape[2];
292  float dZ = info.shape[3];
293 
294  local[0] = 0; local[1] = 0; local[2] = dZ;
295  m_geom->localToGlobal( info, local, global );
296  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
297 
298  local[0] = dX; local[1] = dY; 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; local[1] = dY; local[2] = dZ;
303  m_geom->localToGlobal( info, local, global );
304  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
305 
306  local[0] = dX; local[1] = -dY; local[2] = dZ;
307  m_geom->localToGlobal( info, local, global );
308  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
309 
310  local[0] = -dX; local[1] = -dY; 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; local[1] = 0; local[2] = -dZ;
315  m_geom->localToGlobal( info, local, global );
316  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
317 
318  local[0] = dX; local[1] = dY; local[2] = -dZ;
319  m_geom->localToGlobal( info, local, global );
320  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
321 
322  local[0] = -dX; local[1] = dY; 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; local[1] = -dY; local[2] = -dZ;
327  m_geom->localToGlobal( info, local, global );
328  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
329 
330  local[0] = -dX; local[1] = -dY; local[2] = -dZ;
331  m_geom->localToGlobal( info, local, global );
332  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
333 }
void estimateProjectionSize(const float *, float &, float &, float &, float &)
void localToGlobal(unsigned int id, const float *local, float *global, bool translatep=true) const
Definition: FWGeometry.cc:478
const FWGeometry * m_geom
void FWRPZViewGeometry::importNew ( TEveElementList *  x)
private

Definition at line 634 of file FWRPZViewGeometry.cc.

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

635 {
636  TEveProjected* proj = *BeginProjecteds();
637  proj->GetManager()->SubImportElements(x, proj->GetProjectedAsElement());
638 
639 }
void FWRPZViewGeometry::initStdGeoElements ( const FWViewType::EType  id)

Definition at line 85 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

86 {
87  assert(m_geom != nullptr);
88 
89  if (type == FWViewType::kRhoZ)
90  {
91  AddElement(makeMuonGeometryRhoZ());
92  AddElement(makeCaloOutlineRhoZ());
93  }
94  else
95  {
96  AddElement(makeMuonGeometryRhoPhi());
97  AddElement(makeCaloOutlineRhoPhi());
98  }
99 }
type
Definition: HCALResponse.h:21
TEveElement * makeCaloOutlineRhoPhi()
TEveElement * makeMuonGeometryRhoPhi()
const FWGeometry * m_geom
TEveElement * makeCaloOutlineRhoZ()
TEveElement * makeMuonGeometryRhoZ()
TEveElement * FWRPZViewGeometry::makeCaloOutlineRhoPhi ( )
private

Definition at line 128 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().

129 {
130  TEveStraightLineSet* el = new TEveStraightLineSet( "TrackerRhoPhi" );
132 
134  const unsigned int nSegments = 100;
135  const double r = m_context.caloR1();
136  for ( unsigned int i = 1; i <= nSegments; ++i )
137  el->AddLine(r*sin(TMath::TwoPi()/nSegments*(i-1)), r*cos(TMath::TwoPi()/nSegments*(i-1)), 0,
138  r*sin(TMath::TwoPi()/nSegments*i), r*cos(TMath::TwoPi()/nSegments*i), 0);
139 
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.);
145  el->AddElement(ref);
146 
147  return el;
148 }
const double TwoPi
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
FWColorManager * colorManager() const
Definition: Context.h:65
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static float caloR1(bool offset=true)
Definition: Context.cc:208
Color_t geomColor(FWGeomColorIndex) const
const fireworks::Context & m_context
TEveElement * FWRPZViewGeometry::makeCaloOutlineRhoZ ( )
private

Definition at line 105 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().

106 {
107  using namespace fireworks;
108 
109  float ri = m_context.caloZ2()*tan(2*atan(exp(-m_context.caloMaxEta())));
110 
111  TEveStraightLineSet* el = new TEveStraightLineSet( "TrackerRhoZoutline" );
112  el->SetPickable(kFALSE);
114 
115  el->AddLine(0, m_context.caloR1(), -m_context.caloZ1(), 0, m_context.caloR1(), m_context.caloZ1());
116  el->AddLine(0, -m_context.caloR1(), m_context.caloZ1(), 0, -m_context.caloR1(), -m_context.caloZ1());
117 
118  el->AddLine(0, -m_context.caloR2(), m_context.caloZ2(), 0, -ri, m_context.caloZ2());
119  el->AddLine(0, ri, m_context.caloZ2(), 0, m_context.caloR2(), m_context.caloZ2());
120 
121  el->AddLine(0, -m_context.caloR2(), -m_context.caloZ2(), 0, -ri, -m_context.caloZ2());
122  el->AddLine(0, ri, -m_context.caloZ2(), 0, m_context.caloR2(), -m_context.caloZ2());
123 
124  return el;
125 }
static float caloZ2(bool offset=true)
Definition: Context.cc:223
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
static float caloR2(bool offset=true)
Definition: Context.cc:213
static float caloR1(bool offset=true)
Definition: Context.cc:208
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static double caloMaxEta()
Definition: Context.cc:238
static float caloZ1(bool offset=true)
Definition: Context.cc:218
const fireworks::Context & m_context
TEveElement * FWRPZViewGeometry::makeMuonGeometryRhoPhi ( void  )
private

Definition at line 153 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), triggerObjects_cff::id, kFWMuonBarrelLineColorIndex, FWViewGeometryList::m_colorComp, and FWViewGeometryList::m_geom.

Referenced by initStdGeoElements().

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

Definition at line 186 of file FWRPZViewGeometry.cc.

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

Referenced by initStdGeoElements().

187 {
188  TEveElementList* container = new TEveElementList( "MuonRhoZ" );
189 
190  {
191  TEveCompound* dtContainer = new TEveCompound( "DT" );
192  for( Int_t iWheel = -2; iWheel <= 2; ++iWheel )
193  {
194  for( Int_t iStation = 1; iStation <= 4; ++iStation )
195  {
196  float min_rho(1000), max_rho(0), min_z(2000), max_z(-2000);
197 
198  // This will give us a quarter of DTs
199  // which is enough for our projection
200  for( Int_t iSector = 1; iSector <= 4; ++iSector )
201  {
202  DTChamberId id( iWheel, iStation, iSector );
203  unsigned int rawid = id.rawId();
204  FWGeometry::IdToInfoItr det = m_geom->find( rawid );
205  if (det == m_geom->mapEnd()) return container;
206  estimateProjectionSizeDT( *det, min_rho, max_rho, min_z, max_z );
207  }
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);
215  }
216  }
217 
218  container->AddElement( dtContainer );
219  }
220  {
221  // addcsc
222  TEveCompound* cscContainer = new TEveCompound( "CSC" );
223  std::vector<CSCDetId> ids;
225  {
226  for (int station = 1; station <= 4; ++station)
227  {
228  ids.push_back(CSCDetId(endcap, station, 2, 10, 0 ));//outer ring up
229  ids.push_back(CSCDetId(endcap, station, 2, 11, 0 ));//outer ring up
230 
231  ids.push_back(CSCDetId(endcap, station, 2, 28, 0 ));//outer ring down
232  ids.push_back(CSCDetId(endcap, station, 2, 29, 0 ));//outer ring down
233 
234  ids.push_back(CSCDetId(endcap, station, 1, 5, 0 ));//inner ring up
235  ids.push_back(CSCDetId(endcap, station, 1, 6, 0 )); //inner ring up
236 
237  int off = (station == 1) ? 10:0;
238  ids.push_back(CSCDetId(endcap, station, 1, 15+off, 0 ));//inner ring down
239  ids.push_back(CSCDetId(endcap, station, 1, 16+off, 0 )); //inner ring down
240  }
241  ids.push_back(CSCDetId(endcap, 1, 3, 10, 0 )); // ring 3 down
242  ids.push_back(CSCDetId(endcap, 1, 3, 28, 0 )); // ring 3 down
243  }
244  for (std::vector<CSCDetId>::iterator i = ids.begin(); i != ids.end(); ++i)
245  {
246  unsigned int rawid = i->rawId();
247  TEveGeoShape* shape = m_geom->getEveShape(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);
252  }
253  container->AddElement( cscContainer );
254  }
255 
256  return container;
257 }
static int minEndcapId()
Definition: CSCDetId.h:236
void estimateProjectionSizeDT(const FWGeometry::GeomDetInfo &info, float &, float &, float &, float &)
IdToInfoItr find(unsigned int) const
Definition: FWGeometry.cc:508
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * makeShape(double, double, double, double)
IdToInfoItr mapEnd() const
Definition: FWGeometry.h:121
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:298
static int maxEndcapId()
Definition: CSCDetId.h:237
const FWGeometry * m_geom
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:114
TEveGeoShape * FWRPZViewGeometry::makeShape ( double  min_rho,
double  max_rho,
double  min_z,
double  max_z 
)
private

Definition at line 262 of file FWRPZViewGeometry.cc.

References lumiQTWidget::t.

Referenced by makeMuonGeometryRhoZ().

263 {
264  TEveTrans t;
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;
269 
270  TEveGeoShape* shape = new TEveGeoShape;
271  shape->SetTransMatrix(t.Array());
272 
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 );
277 
278  return shape;
279 }
const FWRPZViewGeometry& FWRPZViewGeometry::operator= ( const FWRPZViewGeometry )
private
void FWRPZViewGeometry::showGEM ( bool  show)

Definition at line 559 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::VersionInfo::haveExtraDet(), triggerObjects_cff::id, importNew(), kFWMuonEndcapLineColorIndex, m_GEMElements, FWViewGeometryList::m_geom, GEMDetId::maxLayerId, GEMDetId::maxRegionId, GEMDetId::minLayerId, GEMDetId::minRegionId, GEMDetId::minRollId, GEMDetId::minStationId, and FWGeometry::versionInfo().

Referenced by FWRPZView::setContext().

560 {
561  // hardcoded gem and me0; need to find better way for different gem geometries
562  if( !m_GEMElements && show ){
563  m_GEMElements = new TEveElementList("GEM");
564 
565  for( Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion= iRegion+2){
566  int mxSt = m_geom->versionInfo().haveExtraDet("GE2") ? 3:1;
567 
568  for( Int_t iStation = GEMDetId::minStationId; iStation <= mxSt; ++iStation ){
569  Int_t iRing = 1;
570  for( Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId ; ++iLayer ){
571  int maxChamber = 36;
572  if (iStation >= 2) maxChamber = 18;
573 
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;
578 
579  for (Int_t iRoll = GEMDetId::minRollId; iRoll <= maxRoll ; ++iRoll ){
580  GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
581  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
582  if (shape){
584  m_GEMElements->AddElement( shape );
585  gEve->AddToListTree(shape, true);
586  }
587  }
588  }
589  }
590  }
591  }
592 
593  AddElement(m_GEMElements);
595  }
596  if (m_GEMElements){
597  m_GEMElements->SetRnrState(show);
598  gEve->Redraw3D();
599  }
600 }
TEveElementList * m_GEMElements
static const int minRegionId
Definition: GEMDetId.h:94
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:127
static const int maxLayerId
Definition: GEMDetId.h:108
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
bool haveExtraDet(const char *) const
Definition: FWGeometry.cc:529
void importNew(TEveElementList *x)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:298
static const int minRollId
Definition: GEMDetId.h:110
const FWGeometry * m_geom
static const int minStationId
Definition: GEMDetId.h:100
static const int minLayerId
Definition: GEMDetId.h:107
static const int maxRegionId
Definition: GEMDetId.h:95
void FWRPZViewGeometry::showME0 ( bool  show)

Definition at line 603 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), triggerObjects_cff::id, importNew(), kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, m_ME0Elements, ME0DetId::maxRegionId, and ME0DetId::minRegionId.

Referenced by FWRPZView::setContext().

604 {
605  if( !m_ME0Elements && show ){
606  m_ME0Elements = new TEveElementList("ME0");
607 
608  for( Int_t iRegion = ME0DetId::minRegionId; iRegion <= ME0DetId::maxRegionId; iRegion= iRegion+2 ){
609  for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
610  for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
611  Int_t iRoll = 1;
612  ME0DetId id( iRegion, iLayer, iChamber, iRoll );
613  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
614  if (shape){
616  m_ME0Elements->AddElement( shape );
617  gEve->AddToListTree(shape, true);
618  }
619  }
620  }
621  }
622 
623  AddElement(m_ME0Elements);
625  }
626  if (m_ME0Elements){
627  m_ME0Elements->SetRnrState(show);
628  gEve->Redraw3D();
629  }
630 }
static const int maxRegionId
Definition: ME0DetId.h:87
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
static const int minRegionId
Definition: ME0DetId.h:86
void importNew(TEveElementList *x)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:298
const FWGeometry * m_geom
TEveElementList * m_ME0Elements
void FWRPZViewGeometry::showPixelBarrel ( bool  show)

Definition at line 364 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), triggerObjects_cff::id, photons_cff::ids, importNew(), kFWPixelBarrelColorIndex, FWViewGeometryList::m_geom, m_pixelBarrelElements, FWGeometry::PixelBarrel, and FWGeometry::Tracker.

Referenced by FWRPZView::setContext().

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

Definition at line 391 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), triggerObjects_cff::id, photons_cff::ids, importNew(), kFWPixelEndcapColorIndex, FWViewGeometryList::m_geom, m_pixelEndcapElements, FWGeometry::PixelEndcap, and FWGeometry::Tracker.

Referenced by FWRPZView::setContext().

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

Definition at line 499 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::VersionInfo::haveExtraDet(), mps_fire::i, photons_cff::ids, importNew(), kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, m_rpcEndcapElements, relativeConstraints::ring, relativeConstraints::station, and FWGeometry::versionInfo().

Referenced by FWRPZView::setContext().

500 {
501  if( !m_rpcEndcapElements && show )
502  {
503  m_rpcEndcapElements = new TEveElementList("RpcEndcap");
504 
505 
506  std::vector<RPCDetId> ids;
507  int mxSt = m_geom->versionInfo().haveExtraDet("RE4") ? 4:3;
508  for (int region = -1; region <=1; ++ region )
509  {
510  if (region == 0 ) continue;
511  for (int ring = 2; ring <= 3; ++ring) {
512  for (int station = 1; station <= mxSt; ++station ) {
513  int sector = 1;
514  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 1));
515  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 2));
516  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 3));
517  if (ring == 2 && station == 1) { // 2 layers in ring 2 station 1 up
518  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 1));
519  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 2));
520  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 3));
521  }
522  sector = 5;
523  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 1));
524  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 2));
525  ids.push_back(RPCDetId(region, ring, station, sector, 1, 1, 3));
526 
527  if (ring == 2 && station == 1) { // 2 layers in ring 2 station 1 down
528  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 1));
529  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 2));
530  ids.push_back(RPCDetId(region, ring, station, sector, 1, 2, 3));
531  }
532  }
533  }
534  }
535 
536  for (std::vector<RPCDetId>::iterator i = ids.begin(); i != ids.end(); ++i)
537  {
538  TEveGeoShape* shape = m_geom->getEveShape(i->rawId());
539  if (!shape) return;
541  m_rpcEndcapElements->AddElement(shape);
542  gEve->AddToListTree(shape, true);
543  }
544 
545  AddElement(m_rpcEndcapElements);
547  }
548 
550  {
551  m_rpcEndcapElements->SetRnrState(show);
552  gEve->Redraw3D();
553  }
554 }
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:127
TEveElementList * m_rpcEndcapElements
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
bool haveExtraDet(const char *) const
Definition: FWGeometry.cc:529
void importNew(TEveElementList *x)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:298
const FWGeometry * m_geom
void FWRPZViewGeometry::showTrackerBarrel ( bool  show)

Definition at line 421 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), triggerObjects_cff::id, photons_cff::ids, importNew(), kFWTrackerBarrelColorIndex, FWViewGeometryList::m_geom, m_trackerBarrelElements, FWGeometry::TIB, FWGeometry::TOB, and FWGeometry::Tracker.

Referenced by FWRPZView::setContext().

422 {
423  if( !m_trackerBarrelElements && show )
424  {
425  m_trackerBarrelElements = new TEveElementList("TrackerBarrel");
426 
427  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
428  for( std::vector<unsigned int>::const_iterator id = ids.begin();
429  id != ids.end(); ++id )
430  {
431  TEveGeoShape* shape = m_geom->getEveShape( *id );
432  if (!shape) return;
434  m_trackerBarrelElements->AddElement( shape );
435  }
437  for( std::vector<unsigned int>::const_iterator id = ids.begin();
438  id != ids.end(); ++id )
439  {
440  TEveGeoShape* shape = m_geom->getEveShape( *id );
441  if (!shape) return;
442  shape->SetTitle(Form("TrackerBarrel %d",*id));
444  m_trackerBarrelElements->AddElement( shape );
445  }
446 
447  AddElement(m_trackerBarrelElements);
449  }
450 
452  {
453  m_trackerBarrelElements->SetRnrState(show);
454  gEve->Redraw3D();
455  }
456 }
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
void importNew(TEveElementList *x)
TEveElementList * m_trackerBarrelElements
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:298
const FWGeometry * m_geom
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:214
void FWRPZViewGeometry::showTrackerEndcap ( bool  show)

Definition at line 459 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::getMatchedIds(), triggerObjects_cff::id, photons_cff::ids, importNew(), kFWTrackerEndcapColorIndex, FWViewGeometryList::m_geom, m_trackerEndcapElements, FWGeometry::TEC, FWGeometry::TID, and FWGeometry::Tracker.

Referenced by FWRPZView::setContext().

460 {
461  if( !m_trackerEndcapElements && show )
462  {
463  m_trackerEndcapElements = new TEveElementList("TrackerEndcap");
464 
465  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
466  for( std::vector<unsigned int>::const_iterator id = ids.begin();
467  id != ids.end(); ++id )
468  {
469  TEveGeoShape* shape = m_geom->getEveShape( *id );
471 
472  if (!shape) return;
473  m_trackerEndcapElements->AddElement( shape );
474  }
476  for( std::vector<unsigned int>::const_iterator id = ids.begin();
477  id != ids.end(); ++id )
478  {
479  TEveGeoShape* shape = m_geom->getEveShape( *id );
480  shape->SetTitle(Form("TrackerEndcap %d",*id));
481  if (!shape) return;
483  m_trackerEndcapElements->AddElement( shape );
484  }
485 
486  AddElement(m_trackerEndcapElements);
488  }
489 
491  {
492  m_trackerEndcapElements->SetRnrState(show);
493  gEve->Redraw3D();
494  }
495 }
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
void importNew(TEveElementList *x)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:298
const FWGeometry * m_geom
TEveElementList * m_trackerEndcapElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:214

Member Data Documentation

TEveElementList* FWRPZViewGeometry::m_GEMElements
private

Definition at line 80 of file FWRPZViewGeometry.h.

Referenced by showGEM().

TEveElementList* FWRPZViewGeometry::m_ME0Elements
private

Definition at line 81 of file FWRPZViewGeometry.h.

Referenced by showME0().

TEveElementList* FWRPZViewGeometry::m_pixelBarrelElements
private

Definition at line 75 of file FWRPZViewGeometry.h.

Referenced by showPixelBarrel().

TEveElementList* FWRPZViewGeometry::m_pixelEndcapElements
private

Definition at line 76 of file FWRPZViewGeometry.h.

Referenced by showPixelEndcap().

TEveElementList* FWRPZViewGeometry::m_rhoPhiGeo
private

Definition at line 71 of file FWRPZViewGeometry.h.

Referenced by ~FWRPZViewGeometry().

TEveElementList* FWRPZViewGeometry::m_rhoZGeo
private

Definition at line 72 of file FWRPZViewGeometry.h.

Referenced by ~FWRPZViewGeometry().

TEveElementList* FWRPZViewGeometry::m_rpcEndcapElements
private

Definition at line 79 of file FWRPZViewGeometry.h.

Referenced by showRpcEndcap().

TEveElementList* FWRPZViewGeometry::m_trackerBarrelElements
private

Definition at line 77 of file FWRPZViewGeometry.h.

Referenced by showTrackerBarrel().

TEveElementList* FWRPZViewGeometry::m_trackerEndcapElements
private

Definition at line 78 of file FWRPZViewGeometry.h.

Referenced by showTrackerEndcap().