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

53  :
54  FWViewGeometryList(context),
55 
56  m_rhoPhiGeo(0),
57  m_rhoZGeo(0),
58 
64 {
65  SetElementName("RPZGeomShared");
66 }
TEveElementList * m_pixelBarrelElements
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_trackerEndcapElements
FWRPZViewGeometry::~FWRPZViewGeometry ( )
virtual

Definition at line 73 of file FWRPZViewGeometry.cc.

References m_rhoPhiGeo, and m_rhoZGeo.

74 {
75  m_rhoPhiGeo->DecDenyDestroy();
76  m_rhoZGeo->DecDenyDestroy();
77 }
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 332 of file FWRPZViewGeometry.cc.

References rho, and mathSSE::sqrt().

Referenced by estimateProjectionSizeDT().

334 {
335  double rho = sqrt(global[0] *global[0]+global[1] *global[1]);
336  if ( min_rho > rho ) min_rho = rho;
337  if ( max_rho < rho ) max_rho = rho;
338  if ( min_z > global[2] ) min_z = global[2];
339  if ( max_z < global[2] ) max_z = global[2];
340 }
Definition: DDAxes.h:10
T sqrt(T t)
Definition: SSEVec.h:48
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 279 of file FWRPZViewGeometry.cc.

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

Referenced by makeMuonGeometryRhoZ().

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

Definition at line 589 of file FWRPZViewGeometry.cc.

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

590 {
591  TEveProjected* proj = *BeginProjecteds();
592  proj->GetManager()->SubImportElements(x, proj->GetProjectedAsElement());
593 
594 }
Definition: DDAxes.h:10
void FWRPZViewGeometry::initStdGeoElements ( const FWViewType::EType  id)

Definition at line 82 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

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

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

126 {
127  TEveStraightLineSet* el = new TEveStraightLineSet( "TrackerRhoPhi" );
129 
131  const unsigned int nSegments = 100;
132  const double r = m_context.caloR1();
133  for ( unsigned int i = 1; i <= nSegments; ++i )
134  el->AddLine(r*sin(TMath::TwoPi()/nSegments*(i-1)), r*cos(TMath::TwoPi()/nSegments*(i-1)), 0,
135  r*sin(TMath::TwoPi()/nSegments*i), r*cos(TMath::TwoPi()/nSegments*i), 0);
136 
137  TEvePointSet* ref = new TEvePointSet("reference");
138  ref->SetTitle("(0,0,0)");
139  ref->SetMarkerStyle(4);
140  ref->SetMarkerColor(kWhite);
141  ref->SetNextPoint(0.,0.,0.);
142  el->AddElement(ref);
143 
144  return el;
145 }
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:209
Color_t geomColor(FWGeomColorIndex) const
const fireworks::Context & m_context
TEveElement * FWRPZViewGeometry::makeCaloOutlineRhoZ ( )
private

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

103 {
104  using namespace fireworks;
105 
106  float ri = m_context.caloZ2()*tan(2*atan(exp(-m_context.caloMaxEta())));
107 
108  TEveStraightLineSet* el = new TEveStraightLineSet( "TrackerRhoZoutline" );
109  el->SetPickable(kFALSE);
111 
112  el->AddLine(0, m_context.caloR1(), -m_context.caloZ1(), 0, m_context.caloR1(), m_context.caloZ1());
113  el->AddLine(0, -m_context.caloR1(), m_context.caloZ1(), 0, -m_context.caloR1(), -m_context.caloZ1());
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  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  return el;
122 }
static float caloZ2(bool offset=true)
Definition: Context.cc:224
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
static float caloR2(bool offset=true)
Definition: Context.cc:214
static float caloR1(bool offset=true)
Definition: Context.cc:209
Tan< T >::type tan(const T &t)
Definition: Tan.h:22
static double caloMaxEta()
Definition: Context.cc:239
static float caloZ1(bool offset=true)
Definition: Context.cc:219
const fireworks::Context & m_context
TEveElement * FWRPZViewGeometry::makeMuonGeometryRhoPhi ( void  )
private

Definition at line 150 of file FWRPZViewGeometry.cc.

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

Referenced by initStdGeoElements().

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

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

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

Definition at line 257 of file FWRPZViewGeometry.cc.

References edmStreamStallGrapher::t.

Referenced by makeMuonGeometryRhoZ().

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

Definition at line 549 of file FWRPZViewGeometry.cc.

References FWViewGeometryList::addToCompound(), FWGeometry::getEveShape(), importNew(), kFWMuonEndcapLineColorIndex, m_GEMElements, and FWViewGeometryList::m_geom.

Referenced by FWRPZView::setContext().

550 {
551  if( !m_GEMElements && show )
552  {
553  m_GEMElements = new TEveElementList("GEM");
554 
555 
556  std::vector<GEMDetId> ids;
557  int rArr [] = { -1, 1}; // front back region
558  int cArr [] = { 10, 30}; // top bottom chamber
559 
560  for (int st = 1; st <= 2; ++st )
561  for (int ri = 0; ri < 2; ++ri )
562  for (int ci= 0; ci < 2; ++ci) {
563  int maxRoll = st == 1 ? 8 : 12;
564  for (int roll = 1; roll <=maxRoll; ++roll)
565  for (int layer = 1; layer <=2; ++layer)
566  {
567  GEMDetId id(rArr[ri], 1, st, layer, cArr[ci]/st, roll);
568  TEveGeoShape* shape = m_geom->getEveShape(id.rawId());
570  m_GEMElements->AddElement( shape );
571  // gEve->AddToListTree(shape, true);
572  //gEve->AddElement(shape);
573  }
574  }
575 
576 
577 
578  AddElement(m_GEMElements);
580  }
581  if (m_GEMElements)
582  {
583  m_GEMElements->SetRnrState(show);
584  gEve->Redraw3D();
585  }
586 }
TEveElementList * m_GEMElements
void addToCompound(TEveElement *el, FWGeomColorIndex idx, bool applyTransp=true) const
void importNew(TEveElementList *x)
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
const FWGeometry * m_geom
void FWRPZViewGeometry::showPixelBarrel ( bool  show)

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

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

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

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

Definition at line 490 of file FWRPZViewGeometry.cc.

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

Referenced by FWRPZView::setContext().

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

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

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

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

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

Member Data Documentation

TEveElementList* FWRPZViewGeometry::m_GEMElements
private

Definition at line 79 of file FWRPZViewGeometry.h.

Referenced by showGEM().

TEveElementList* FWRPZViewGeometry::m_pixelBarrelElements
private

Definition at line 74 of file FWRPZViewGeometry.h.

Referenced by showPixelBarrel().

TEveElementList* FWRPZViewGeometry::m_pixelEndcapElements
private

Definition at line 75 of file FWRPZViewGeometry.h.

Referenced by showPixelEndcap().

TEveElementList* FWRPZViewGeometry::m_rhoPhiGeo
private

Definition at line 70 of file FWRPZViewGeometry.h.

Referenced by ~FWRPZViewGeometry().

TEveElementList* FWRPZViewGeometry::m_rhoZGeo
private

Definition at line 71 of file FWRPZViewGeometry.h.

Referenced by ~FWRPZViewGeometry().

TEveElementList* FWRPZViewGeometry::m_rpcEndcapElements
private

Definition at line 78 of file FWRPZViewGeometry.h.

Referenced by showRpcEndcap().

TEveElementList* FWRPZViewGeometry::m_trackerBarrelElements
private

Definition at line 76 of file FWRPZViewGeometry.h.

Referenced by showTrackerBarrel().

TEveElementList* FWRPZViewGeometry::m_trackerEndcapElements
private

Definition at line 77 of file FWRPZViewGeometry.h.

Referenced by showTrackerEndcap().