CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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)
 
virtual ~FWRPZViewGeometry ()
 
- Public Member Functions inherited from FWViewGeometryList
 FWViewGeometryList (const fireworks::Context &context, bool projected=true)
 
void updateColors ()
 
void updateTransparency (bool projectedType)
 
virtual ~FWViewGeometryList ()
 

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(0),
58  m_rhoZGeo(0),
59 
65  m_GEMElements(0),
66  m_ME0Elements(0)
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 ( )
virtual

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 335 of file FWRPZViewGeometry.cc.

References rho, and mathSSE::sqrt().

Referenced by estimateProjectionSizeDT().

337 {
338  double rho = sqrt(global[0] *global[0]+global[1] *global[1]);
339  if ( min_rho > rho ) min_rho = rho;
340  if ( max_rho < rho ) max_rho = rho;
341  if ( min_z > global[2] ) min_z = global[2];
342  if ( max_z < global[2] ) max_z = global[2];
343 }
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 282 of file FWRPZViewGeometry.cc.

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

Referenced by makeMuonGeometryRhoZ().

284 {
285  // we will test 5 points on both sides ( +/- z)
286  float local[3], global[3];
287 
288  float dX = info.shape[1];
289  float dY = info.shape[2];
290  float dZ = info.shape[3];
291 
292  local[0] = 0; local[1] = 0; 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; local[1] = dY; local[2] = dZ;
297  m_geom->localToGlobal( info, local, global );
298  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
299 
300  local[0] = -dX; local[1] = dY; local[2] = dZ;
301  m_geom->localToGlobal( info, local, global );
302  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
303 
304  local[0] = dX; local[1] = -dY; 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; local[1] = -dY; local[2] = dZ;
309  m_geom->localToGlobal( info, local, global );
310  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
311 
312  local[0] = 0; local[1] = 0; local[2] = -dZ;
313  m_geom->localToGlobal( info, local, global );
314  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
315 
316  local[0] = dX; local[1] = dY; 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; local[1] = dY; local[2] = -dZ;
321  m_geom->localToGlobal( info, local, global );
322  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
323 
324  local[0] = dX; local[1] = -dY; local[2] = -dZ;
325  m_geom->localToGlobal( info, local, global );
326  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
327 
328  local[0] = -dX; local[1] = -dY; local[2] = -dZ;
329  m_geom->localToGlobal( info, local, global );
330  estimateProjectionSize( global, min_rho, max_rho, min_z, max_z );
331 }
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:328
const FWGeometry * m_geom
void FWRPZViewGeometry::importNew ( TEveElementList *  x)
private

Definition at line 627 of file FWRPZViewGeometry.cc.

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

628 {
629  TEveProjected* proj = *BeginProjecteds();
630  proj->GetManager()->SubImportElements(x, proj->GetProjectedAsElement());
631 
632 }
void FWRPZViewGeometry::initStdGeoElements ( const FWViewType::EType  id)

Definition at line 85 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

86 {
87  assert(m_geom != 0);
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()
assert(m_qm.get())
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(), 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
int i
Definition: DBlmapReader.cc:9
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(), create_public_lumi_plots::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(), 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:253
const FWGeometry * m_geom
TEveElement * FWRPZViewGeometry::makeMuonGeometryRhoZ ( void  )
private

Definition at line 186 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), CSCDetId, Reference_intrackfit_cff::endcap, estimateProjectionSizeDT(), FWGeometry::find(), FWGeometry::getEveShape(), i, kFWMuonBarrelLineColorIndex, kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, makeShape(), 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  estimateProjectionSizeDT( *det, min_rho, max_rho, min_z, max_z );
206  }
207  if ( min_rho > max_rho || min_z > max_z ) continue;
208  TEveElement* se = makeShape( min_rho, max_rho, min_z, max_z );
210  dtContainer->AddElement(se);
211  se = makeShape( -max_rho, -min_rho, min_z, max_z );
213  dtContainer->AddElement(se);
214  }
215  }
216 
217  container->AddElement( dtContainer );
218  }
219  {
220  // addcsc
221  TEveCompound* cscContainer = new TEveCompound( "CSC" );
222  std::vector<CSCDetId> ids;
224  {
225  for (int station = 1; station <= 4; ++station)
226  {
227  ids.push_back(CSCDetId(endcap, station, 2, 10, 0 ));//outer ring up
228  ids.push_back(CSCDetId(endcap, station, 2, 11, 0 ));//outer ring up
229 
230  ids.push_back(CSCDetId(endcap, station, 2, 28, 0 ));//outer ring down
231  ids.push_back(CSCDetId(endcap, station, 2, 29, 0 ));//outer ring down
232 
233  ids.push_back(CSCDetId(endcap, station, 1, 5, 0 ));//inner ring up
234  ids.push_back(CSCDetId(endcap, station, 1, 6, 0 )); //inner ring up
235 
236  int off = (station == 1) ? 10:0;
237  ids.push_back(CSCDetId(endcap, station, 1, 15+off, 0 ));//inner ring down
238  ids.push_back(CSCDetId(endcap, station, 1, 16+off, 0 )); //inner ring down
239  }
240  ids.push_back(CSCDetId(endcap, 1, 3, 10, 0 )); // ring 3 down
241  ids.push_back(CSCDetId(endcap, 1, 3, 28, 0 )); // ring 3 down
242  }
243  for (std::vector<CSCDetId>::iterator i = ids.begin(); i != ids.end(); ++i)
244  {
245  unsigned int rawid = i->rawId();
246  TEveGeoShape* shape = m_geom->getEveShape(rawid);
248  shape->SetName(Form(" e:%d r:%d s:%d chamber %d",i->endcap(), i->ring(), i->station(), i->chamber() ));
249  cscContainer->AddElement(shape);
250  }
251  container->AddElement( cscContainer );
252  }
253 
254  return container;
255 }
int i
Definition: DBlmapReader.cc:9
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:358
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
TEveGeoShape * makeShape(double, double, double, double)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
static int maxEndcapId()
Definition: CSCDetId.h:237
const FWGeometry * m_geom
std::vector< FWGeometry::GeomDetInfo >::const_iterator IdToInfoItr
Definition: FWGeometry.h:107
TEveGeoShape * FWRPZViewGeometry::makeShape ( double  min_rho,
double  max_rho,
double  min_z,
double  max_z 
)
private

Definition at line 260 of file FWRPZViewGeometry.cc.

References lumiQTWidget::t.

Referenced by makeMuonGeometryRhoZ().

261 {
262  TEveTrans t;
263  t(1,1) = 1; t(1,2) = 0; t(1,3) = 0;
264  t(2,1) = 0; t(2,2) = 1; t(2,3) = 0;
265  t(3,1) = 0; t(3,2) = 0; t(3,3) = 1;
266  t(1,4) = 0; t(2,4) = (min_rho+max_rho)/2; t(3,4) = (min_z+max_z)/2;
267 
268  TEveGeoShape* shape = new TEveGeoShape;
269  shape->SetTransMatrix(t.Array());
270 
271  shape->SetRnrSelf(kTRUE);
272  shape->SetRnrChildren(kTRUE);
273  TGeoBBox* box = new TGeoBBox( 0, (max_rho-min_rho)/2, (max_z-min_z)/2 );
274  shape->SetShape( box );
275 
276  return shape;
277 }
const FWRPZViewGeometry& FWRPZViewGeometry::operator= ( const FWRPZViewGeometry )
private
void FWRPZViewGeometry::showGEM ( bool  show)

Definition at line 552 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::VersionInfo::haveExtraDet(), 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().

553 {
554  // hardcoded gem and me0; need to find better way for different gem geometries
555  if( !m_GEMElements && show ){
556  m_GEMElements = new TEveElementList("GEM");
557 
558  for( Int_t iRegion = GEMDetId::minRegionId; iRegion <= GEMDetId::maxRegionId; iRegion= iRegion+2){
559  int mxSt = m_geom->versionInfo().haveExtraDet("GE2") ? 3:1;
560 
561  for( Int_t iStation = GEMDetId::minStationId; iStation <= mxSt; ++iStation ){
562  Int_t iRing = 1;
563  for( Int_t iLayer = GEMDetId::minLayerId; iLayer <= GEMDetId::maxLayerId ; ++iLayer ){
564  int maxChamber = 36;
565  if (iStation >= 2) maxChamber = 18;
566 
567  for( Int_t iChamber = 1; iChamber <= maxChamber; ++iChamber ){
568  int maxRoll = iChamber%2 ? 9:10;
569  if (iStation == 2) maxRoll = 8;
570  if (iStation == 3) maxRoll = 12;
571 
572  for (Int_t iRoll = GEMDetId::minRollId; iRoll <= maxRoll ; ++iRoll ){
573  GEMDetId id( iRegion, iRing, iStation, iLayer, iChamber, iRoll );
574  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
575  if (shape){
577  m_GEMElements->AddElement( shape );
578  gEve->AddToListTree(shape, true);
579  }
580  }
581  }
582  }
583  }
584  }
585 
586  AddElement(m_GEMElements);
588  }
589  if (m_GEMElements){
590  m_GEMElements->SetRnrState(show);
591  gEve->Redraw3D();
592  }
593 }
TEveElementList * m_GEMElements
static const int minRegionId
Definition: GEMDetId.h:90
const VersionInfo & versionInfo() const
Definition: FWGeometry.h:117
static const int maxLayerId
Definition: GEMDetId.h:103
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
bool haveExtraDet(const char *) const
Definition: FWGeometry.cc:379
void importNew(TEveElementList *x)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
static const int minRollId
Definition: GEMDetId.h:105
const FWGeometry * m_geom
static const int minStationId
Definition: GEMDetId.h:96
static const int minLayerId
Definition: GEMDetId.h:102
static const int maxRegionId
Definition: GEMDetId.h:91
void FWRPZViewGeometry::showME0 ( bool  show)

Definition at line 596 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

597 {
598  if( !m_ME0Elements && show ){
599  m_ME0Elements = new TEveElementList("ME0");
600 
601  for( Int_t iRegion = ME0DetId::minRegionId; iRegion <= ME0DetId::maxRegionId; iRegion= iRegion+2 ){
602  for( Int_t iLayer = 1; iLayer <= 6 ; ++iLayer ){
603  for( Int_t iChamber = 1; iChamber <= 18; ++iChamber ){
604  Int_t iRoll = 1;
605  ME0DetId id( iRegion, iLayer, iChamber, iRoll );
606  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
607  if (shape){
609  m_ME0Elements->AddElement( shape );
610  gEve->AddToListTree(shape, true);
611  }
612  }
613  }
614  }
615 
616  AddElement(m_ME0Elements);
618  }
619  if (m_ME0Elements){
620  m_ME0Elements->SetRnrState(show);
621  gEve->Redraw3D();
622  }
623 }
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:253
const FWGeometry * m_geom
TEveElementList * m_ME0Elements
void FWRPZViewGeometry::showPixelBarrel ( bool  show)

Definition at line 362 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

363 {
364  if( !m_pixelBarrelElements && show )
365  {
366  m_pixelBarrelElements = new TEveElementList("PixelBarrel");
367  AddElement(m_pixelBarrelElements);
368  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::PixelBarrel );
369  for( std::vector<unsigned int>::const_iterator id = ids.begin();
370  id != ids.end(); ++id )
371  {
372  TEveGeoShape* shape = m_geom->getEveShape( *id );
373  shape->SetTitle(Form("PixelBarrel %d",*id));
375  m_pixelBarrelElements->AddElement( shape );
376  }
378  }
379 
381  {
382  m_pixelBarrelElements->SetRnrState(show);
383  gEve->Redraw3D();
384  }
385 }
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:253
const FWGeometry * m_geom
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197
void FWRPZViewGeometry::showPixelEndcap ( bool  show)

Definition at line 388 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

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

Definition at line 493 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), FWGeometry::VersionInfo::haveExtraDet(), i, importNew(), kFWMuonEndcapLineColorIndex, FWViewGeometryList::m_geom, m_rpcEndcapElements, HLT_25ns10e33_v2_cff::region, relativeConstraints::ring, RPCDetId, relativeConstraints::station, and FWGeometry::versionInfo().

Referenced by FWRPZView::setContext().

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

Definition at line 418 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

419 {
420  if( !m_trackerBarrelElements && show )
421  {
422  m_trackerBarrelElements = new TEveElementList("TrackerBarrel");
423 
424  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TIB );
425  for( std::vector<unsigned int>::const_iterator id = ids.begin();
426  id != ids.end(); ++id )
427  {
428  TEveGeoShape* shape = m_geom->getEveShape( *id );
430  m_trackerBarrelElements->AddElement( shape );
431  }
433  for( std::vector<unsigned int>::const_iterator id = ids.begin();
434  id != ids.end(); ++id )
435  {
436  TEveGeoShape* shape = m_geom->getEveShape( *id );
437 
438  shape->SetTitle(Form("TrackerBarrel %d",*id));
440  m_trackerBarrelElements->AddElement( shape );
441  }
442 
443  AddElement(m_trackerBarrelElements);
445  }
446 
448  {
449  m_trackerBarrelElements->SetRnrState(show);
450  gEve->Redraw3D();
451  }
452 }
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:253
const FWGeometry * m_geom
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197
void FWRPZViewGeometry::showTrackerEndcap ( bool  show)

Definition at line 455 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

456 {
457  if( !m_trackerEndcapElements && show )
458  {
459  m_trackerEndcapElements = new TEveElementList("TrackerEndcap");
460 
461  std::vector<unsigned int> ids = m_geom->getMatchedIds( FWGeometry::Tracker, FWGeometry::TID );
462  for( std::vector<unsigned int>::const_iterator id = ids.begin();
463  id != ids.end(); ++id )
464  {
465  TEveGeoShape* shape = m_geom->getEveShape( *id );
467  m_trackerEndcapElements->AddElement( shape );
468  }
470  for( std::vector<unsigned int>::const_iterator id = ids.begin();
471  id != ids.end(); ++id )
472  {
473  TEveGeoShape* shape = m_geom->getEveShape( *id );
474 
475  shape->SetTitle(Form("TrackerEndcap %d",*id));
477  m_trackerEndcapElements->AddElement( shape );
478  }
479 
480  AddElement(m_trackerEndcapElements);
482  }
483 
485  {
486  m_trackerEndcapElements->SetRnrState(show);
487  gEve->Redraw3D();
488  }
489 }
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
void importNew(TEveElementList *x)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:253
const FWGeometry * m_geom
TEveElementList * m_trackerEndcapElements
std::vector< unsigned int > getMatchedIds(Detector det, SubDetector subdet) const
Definition: FWGeometry.cc:197

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().