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
FWRecoGeometryESProducer Class Reference

#include <FWRecoGeometryESProducer.h>

Inheritance diagram for FWRecoGeometryESProducer:
edm::ESProducer edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

Public Member Functions

 FWRecoGeometryESProducer (const edm::ParameterSet &)
 
boost::shared_ptr< FWRecoGeometryproduce (const FWRecoGeometryRecord &)
 
virtual ~FWRecoGeometryESProducer (void)
 
- Public Member Functions inherited from edm::ESProducer
 ESProducer ()
 
virtual ~ESProducer ()
 
- Public Member Functions inherited from edm::ESProxyFactoryProducer
 ESProxyFactoryProducer ()
 
virtual void newInterval (const eventsetup::EventSetupRecordKey &iRecordType, const ValidityInterval &iInterval)
 overrides DataProxyProvider method More...
 
virtual ~ESProxyFactoryProducer ()
 
- Public Member Functions inherited from edm::eventsetup::DataProxyProvider
 DataProxyProvider ()
 
const ComponentDescriptiondescription () const
 
bool isUsingRecord (const EventSetupRecordKey &) const
 
const KeyedProxieskeyedProxies (const EventSetupRecordKey &iRecordKey) const
 
void resetProxies (const EventSetupRecordKey &iRecordType)
 
void resetProxiesIfTransient (const EventSetupRecordKey &iRecordType)
 
void setAppendToDataLabel (const edm::ParameterSet &)
 
void setDescription (const ComponentDescription &iDescription)
 
std::set< EventSetupRecordKeyusingRecords () const
 
virtual ~DataProxyProvider ()
 

Private Member Functions

void addCaloGeometry (void)
 
void addCSCGeometry (void)
 
void addDTGeometry (void)
 
void addGEMGeometry (void)
 
void addME0Geometry (void)
 
void addPixelBarrelGeometry (void)
 
void addPixelForwardGeometry (void)
 
void addRPCGeometry (void)
 
void addTECGeometry (void)
 
void addTIBGeometry (void)
 
void addTIDGeometry (void)
 
void addTOBGeometry (void)
 
void fillPoints (unsigned int id, std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end)
 
void fillShapeAndPlacement (unsigned int id, const GeomDet *det)
 
 FWRecoGeometryESProducer (const FWRecoGeometryESProducer &)
 
unsigned int insert_id (unsigned int id)
 
const FWRecoGeometryESProduceroperator= (const FWRecoGeometryESProducer &)
 

Private Attributes

edm::ESHandle< CaloGeometrym_caloGeom
 
unsigned int m_current
 
boost::shared_ptr< FWRecoGeometrym_fwGeometry
 
edm::ESHandle
< GlobalTrackingGeometry
m_geomRecord
 
std::vector< edm::ESHandle
< HGCalGeometry > > 
m_hgcalGeoms
 
const TrackerGeometrym_trackerGeom
 

Additional Inherited Members

- Public Types inherited from edm::eventsetup::DataProxyProvider
typedef std::vector< std::pair
< DataKey,
edm::propagate_const
< std::shared_ptr< DataProxy > > > > 
KeyedProxies
 
typedef std::vector
< EventSetupRecordKey
Keys
 
typedef std::map
< EventSetupRecordKey,
KeyedProxies
RecordProxies
 
- Static Public Member Functions inherited from edm::eventsetup::DataProxyProvider
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::ESProducer
template<typename T >
void setWhatProduced (T *iThis, const es::Label &iLabel=es::Label())
 
template<typename T >
void setWhatProduced (T *iThis, const char *iLabel)
 
template<typename T >
void setWhatProduced (T *iThis, const std::string &iLabel)
 
template<typename T , typename TDecorator >
void setWhatProduced (T *iThis, const TDecorator &iDec, const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const es::Label &iLabel=es::Label())
 
template<typename T , typename TReturn , typename TRecord , typename TArg >
void setWhatProduced (T *iThis, TReturn(T::*iMethod)(const TRecord &), const TArg &iDec, const es::Label &iLabel=es::Label())
 
- Protected Member Functions inherited from edm::ESProxyFactoryProducer
template<class TFactory >
void registerFactory (std::auto_ptr< TFactory > iFactory, const std::string &iLabel=std::string())
 
virtual void registerFactoryWithKey (const eventsetup::EventSetupRecordKey &iRecord, std::auto_ptr< eventsetup::ProxyFactoryBase > &iFactory, const std::string &iLabel=std::string())
 
virtual void registerProxies (const eventsetup::EventSetupRecordKey &iRecord, KeyedProxies &aProxyList)
 override DataProxyProvider method More...
 
- Protected Member Functions inherited from edm::eventsetup::DataProxyProvider
void eraseAll (const EventSetupRecordKey &iRecordKey)
 deletes all the Proxies in aStream More...
 
void invalidateProxies (const EventSetupRecordKey &iRecordKey)
 
template<class T >
void usingRecord ()
 
void usingRecordWithKey (const EventSetupRecordKey &)
 

Detailed Description

Definition at line 23 of file FWRecoGeometryESProducer.h.

Constructor & Destructor Documentation

FWRecoGeometryESProducer::FWRecoGeometryESProducer ( const edm::ParameterSet )

Definition at line 74 of file FWRecoGeometryESProducer.cc.

References edm::ESProducer::setWhatProduced().

75  : m_current( -1 )
76 {
77  setWhatProduced( this );
78 }
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
FWRecoGeometryESProducer::~FWRecoGeometryESProducer ( void  )
virtual

Definition at line 80 of file FWRecoGeometryESProducer.cc.

81 {}
FWRecoGeometryESProducer::FWRecoGeometryESProducer ( const FWRecoGeometryESProducer )
private

Member Function Documentation

void FWRecoGeometryESProducer::addCaloGeometry ( void  )
private

Definition at line 481 of file FWRecoGeometryESProducer.cc.

References end, fillPoints(), insert_id(), m_caloGeom, and m_hgcalGeoms.

Referenced by produce().

482 {
483  std::vector<DetId> vid = m_caloGeom->getValidDetIds(); // Calo
484  for( std::vector<DetId>::const_iterator it = vid.begin(),
485  end = vid.end();
486  it != end; ++it )
487  {
488  const CaloCellGeometry::CornersVec& cor( m_caloGeom->getGeometry( *it )->getCorners());
489  unsigned int id = insert_id( it->rawId());
490  fillPoints( id, cor.begin(), cor.end());
491  }
492  for( const auto& hgc : m_hgcalGeoms ) {
493  const auto& hgcprod = *hgc;
494  const auto& vid = hgcprod.getValidDetIds();
495  for( const auto& id : vid ) {
496  uint32_t intid = insert_id( id.rawId() );
497  const auto& cor = hgcprod.getCorners( id );
498  fillPoints( intid, cor.begin(), cor.end() );
499  }
500  }
501 }
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
void fillPoints(unsigned int id, std::vector< GlobalPoint >::const_iterator begin, std::vector< GlobalPoint >::const_iterator end)
std::vector< edm::ESHandle< HGCalGeometry > > m_hgcalGeoms
edm::ESHandle< CaloGeometry > m_caloGeom
void FWRecoGeometryESProducer::addCSCGeometry ( void  )
private

Definition at line 126 of file FWRecoGeometryESProducer.cc.

References CSCRadialStripTopology::angularWidth(), CSCRadialStripTopology::centreToIntersection(), CSCGeometry::chambers(), end, fillShapeAndPlacement(), GeomDet::geographicalId(), CSCLayer::geometry(), insert_id(), CSCChamber::layers(), m_fwGeometry, m_geomRecord, DetId::Muon, CSCRadialStripTopology::phiOfOneEdge(), OffsetRadialStripTopology::stripOffset(), CSCLayerGeometry::topology(), CSCWireTopology::wireAngle(), CSCWireTopology::wireSpacing(), CSCLayerGeometry::wireTopology(), CSCRadialStripTopology::yAxisOrientation(), and CSCRadialStripTopology::yCentreOfStripPlane().

Referenced by produce().

127 {
128  DetId detId( DetId::Muon, 2 );
129  const CSCGeometry* cscGeometry = (const CSCGeometry*) m_geomRecord->slaveGeometry( detId );
130  for( auto it = cscGeometry->chambers().begin(),
131  end = cscGeometry->chambers().end();
132  it != end; ++it )
133  {
134  const CSCChamber *chamber = *it;
135 
136  if( chamber )
137  {
138  unsigned int rawid = chamber->geographicalId();
139  unsigned int current = insert_id( rawid );
140  fillShapeAndPlacement( current, chamber );
141  //
142  // CSC layers geometry
143  //
144  for( std::vector< const CSCLayer* >::const_iterator lit = chamber->layers().begin(),
145  lend = chamber->layers().end();
146  lit != lend; ++lit )
147  {
148  const CSCLayer* layer = *lit;
149 
150  if( layer )
151  {
152  unsigned int rawid = layer->geographicalId();
153  unsigned int current = insert_id( rawid );
154  fillShapeAndPlacement( current, layer );
155 
156  const CSCStripTopology* stripTopology = layer->geometry()->topology();
157  m_fwGeometry->idToName[current].topology[0] = stripTopology->yAxisOrientation();
158  m_fwGeometry->idToName[current].topology[1] = stripTopology->centreToIntersection();
159  m_fwGeometry->idToName[current].topology[2] = stripTopology->yCentreOfStripPlane();
160  m_fwGeometry->idToName[current].topology[3] = stripTopology->phiOfOneEdge();
161  m_fwGeometry->idToName[current].topology[4] = stripTopology->stripOffset();
162  m_fwGeometry->idToName[current].topology[5] = stripTopology->angularWidth();
163 
164  const CSCWireTopology* wireTopology = layer->geometry()->wireTopology();
165  m_fwGeometry->idToName[current].topology[6] = wireTopology->wireSpacing();
166  m_fwGeometry->idToName[current].topology[7] = wireTopology->wireAngle();
167  }
168  }
169  }
170  }
171 }
const std::vector< const CSCLayer * > & layers() const
Return all layers.
Definition: CSCChamber.h:57
const CSCWireTopology * wireTopology() const
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const ChamberContainer & chambers() const
Return a vector of all chambers.
Definition: CSCGeometry.cc:106
double wireSpacing() const
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
float wireAngle() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
const CSCStripTopology * topology() const
virtual float stripOffset(void) const
const CSCLayerGeometry * geometry() const
Definition: CSCLayer.h:47
void FWRecoGeometryESProducer::addDTGeometry ( void  )
private

Definition at line 174 of file FWRecoGeometryESProducer.cc.

References DTTopology::cellHeight(), DTTopology::cellLenght(), DTTopology::cellWidth(), DTGeometry::chambers(), DTTopology::channels(), end, fillShapeAndPlacement(), DTTopology::firstChannel(), GeomDet::geographicalId(), DTLayer::id(), insert_id(), DTTopology::lastChannel(), DTGeometry::layers(), m_fwGeometry, m_geomRecord, DetId::Muon, DetId::rawId(), DTLayer::specificTopology(), and GeomDet::surface().

Referenced by produce().

175 {
176  DetId detId( DetId::Muon, 1 );
177  const DTGeometry* dtGeometry = (const DTGeometry*) m_geomRecord->slaveGeometry( detId );
178 
179  //
180  // DT chambers geometry
181  //
182  for( auto it = dtGeometry->chambers().begin(),
183  end = dtGeometry->chambers().end();
184  it != end; ++it )
185  {
186  const DTChamber *chamber = *it;
187 
188  if( chamber )
189  {
190  unsigned int rawid = chamber->geographicalId().rawId();
191  unsigned int current = insert_id( rawid );
192  fillShapeAndPlacement( current, chamber );
193  }
194  }
195 
196  // Fill in DT layer parameters
197  for( auto it = dtGeometry->layers().begin(),
198  end = dtGeometry->layers().end();
199  it != end; ++it )
200  {
201  const DTLayer* layer = *it;
202 
203  if( layer )
204  {
205  unsigned int rawid = layer->id().rawId();
206  unsigned int current = insert_id( rawid );
207  fillShapeAndPlacement( current, layer );
208 
209  const DTTopology& topo = layer->specificTopology();
210  const BoundPlane& surf = layer->surface();
211  // Topology W/H/L:
212  m_fwGeometry->idToName[current].topology[0] = topo.cellWidth();
213  m_fwGeometry->idToName[current].topology[1] = topo.cellHeight();
214  m_fwGeometry->idToName[current].topology[2] = topo.cellLenght();
215  m_fwGeometry->idToName[current].topology[3] = topo.firstChannel();
216  m_fwGeometry->idToName[current].topology[4] = topo.lastChannel();
217  m_fwGeometry->idToName[current].topology[5] = topo.channels();
218 
219  // Bounds W/H/L:
220  m_fwGeometry->idToName[current].topology[6] = surf.bounds().width();
221  m_fwGeometry->idToName[current].topology[7] = surf.bounds().thickness();
222  m_fwGeometry->idToName[current].topology[8] = surf.bounds().length();
223  }
224  }
225 }
const std::vector< const DTChamber * > & chambers() const
Return a vector of all Chamber.
Definition: DTGeometry.cc:85
DTLayerId id() const
Return the DetId of this SL.
Definition: DTLayer.cc:46
float cellWidth() const
Returns the cell width.
Definition: DTTopology.h:68
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
int firstChannel() const
Returns the wire number of the first wire.
Definition: DTTopology.h:78
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
int lastChannel() const
Returns the wire number of the last wire.
Definition: DTTopology.h:80
const DTTopology & specificTopology() const
Definition: DTLayer.cc:42
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
float cellHeight() const
Returns the cell height.
Definition: DTTopology.h:70
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
int channels() const
Returns the number of wires in the layer.
Definition: DTTopology.h:75
const std::vector< const DTLayer * > & layers() const
Return a vector of all SuperLayer.
Definition: DTGeometry.cc:95
float cellLenght() const
Definition: DTTopology.h:73
void FWRecoGeometryESProducer::addGEMGeometry ( void  )
private

Definition at line 265 of file FWRecoGeometryESProducer.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, alignCSCRings::e, GEMGeometry::etaPartitions(), cppFunctionSkipper::exception, fillShapeAndPlacement(), insert_id(), m_fwGeometry, m_geomRecord, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), StripTopology::stripLength(), and cms::Exception::what().

Referenced by produce().

266 {
267  //
268  // GEM geometry
269  //
270  DetId detId( DetId::Muon, 4 );
271 
272  try
273  {
274  const GEMGeometry* gemGeom = (const GEMGeometry*) m_geomRecord->slaveGeometry( detId );
275  for(auto roll : gemGeom->etaPartitions())
276  {
277  if( roll )
278  {
279  unsigned int rawid = roll->geographicalId().rawId();
280  unsigned int current = insert_id( rawid );
281  fillShapeAndPlacement( current, roll );
282 
283  const StripTopology& topo = roll->specificTopology();
284  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
285  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
286  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
287 
288  float height = topo.stripLength()/2;
289  LocalPoint lTop( 0., height, 0.);
290  LocalPoint lBottom( 0., -height, 0.);
291  m_fwGeometry->idToName[current].topology[3] = roll->localPitch(lTop);
292  m_fwGeometry->idToName[current].topology[4] = roll->localPitch(lBottom);
293  m_fwGeometry->idToName[current].topology[5] = roll->npads();
294  }
295  }
296 
297  m_fwGeometry->extraDet.Add(new TNamed("GEM", "GEM muon detector"));
298  try {
299  GEMDetId id(1, 1, 2, 1, 1, 1 );
300  m_geomRecord->slaveGeometry( detId );
301  m_fwGeometry->extraDet.Add(new TNamed("GE2", "GEM endcap station 2"));
302  }
303  catch (std::runtime_error &e) {
304  std::cerr << e.what() << std::endl;
305  }
306 
307  }
308  catch( cms::Exception &exception )
309  {
310  edm::LogError("FWRecoGeometry") << " GEM geometry not found " << exception.what() << std::endl;
311  }
312 }
virtual char const * what() const
Definition: Exception.cc:141
virtual int nstrips() const =0
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
virtual float stripLength() const =0
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:63
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
virtual float pitch() const =0
void FWRecoGeometryESProducer::addME0Geometry ( void  )
private

Definition at line 315 of file FWRecoGeometryESProducer.cc.

References ME0Geometry::etaPartitions(), cppFunctionSkipper::exception, fillShapeAndPlacement(), insert_id(), m_fwGeometry, m_geomRecord, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), StripTopology::stripLength(), and cms::Exception::what().

Referenced by produce().

316 {
317  //
318  // ME0 geometry
319  //
320 
321  DetId detId( DetId::Muon, 5 );
322  try
323  {
324  const ME0Geometry* me0Geom = (const ME0Geometry*) m_geomRecord->slaveGeometry( detId );
325  for(auto roll : me0Geom->etaPartitions())
326  {
327  if( roll )
328  {
329  unsigned int rawid = roll->geographicalId().rawId();
330  unsigned int current = insert_id( rawid );
331  fillShapeAndPlacement( current, roll );
332 
333  const StripTopology& topo = roll->specificTopology();
334  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
335  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
336  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
337 
338  float height = topo.stripLength()/2;
339  LocalPoint lTop( 0., height, 0.);
340  LocalPoint lBottom( 0., -height, 0.);
341  m_fwGeometry->idToName[current].topology[3] = roll->localPitch(lTop);
342  m_fwGeometry->idToName[current].topology[4] = roll->localPitch(lBottom);
343  m_fwGeometry->idToName[current].topology[5] = roll->npads();
344  }
345  }
346  m_fwGeometry->extraDet.Add(new TNamed("ME0", "ME0 muon detector"));
347  }
348  catch( cms::Exception &exception )
349  {
350  edm::LogError("FWRecoGeometry") << " ME0 geometry not found " << exception.what() << std::endl;
351  }
352 }
virtual char const * what() const
Definition: Exception.cc:141
virtual int nstrips() const =0
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
virtual float stripLength() const =0
unsigned int insert_id(unsigned int id)
const std::vector< ME0EtaPartition const * > & etaPartitions() const
Return a vector of all ME0 eta partitions.
Definition: ME0Geometry.cc:57
Definition: DetId.h:18
virtual float pitch() const =0
void FWRecoGeometryESProducer::addPixelBarrelGeometry ( void  )
private

Definition at line 355 of file FWRecoGeometryESProducer.cc.

References ADD_PIXEL_TOPOLOGY, TrackerGeometry::detsPXB(), end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDetUnit(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

356 {
357  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXB().begin(),
358  end = m_trackerGeom->detsPXB().end();
359  it != end; ++it)
360  {
361  const GeomDet *det = *it;
362 
363  if( det )
364  {
365  DetId detid = det->geographicalId();
366  unsigned int rawid = detid.rawId();
367  unsigned int current = insert_id( rawid );
368  fillShapeAndPlacement( current, det );
369 
370  ADD_PIXEL_TOPOLOGY( current, m_trackerGeom->idToDetUnit( detid ));
371  }
372  }
373 }
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
const DetContainer & detsPXB() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
#define ADD_PIXEL_TOPOLOGY(rawid, detUnit)
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
void FWRecoGeometryESProducer::addPixelForwardGeometry ( void  )
private

Definition at line 376 of file FWRecoGeometryESProducer.cc.

References ADD_PIXEL_TOPOLOGY, TrackerGeometry::detsPXF(), end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDetUnit(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

377 {
378  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsPXF().begin(),
379  end = m_trackerGeom->detsPXF().end();
380  it != end; ++it )
381  {
382  const GeomDet *det = *it;
383 
384  if( det )
385  {
386  DetId detid = det->geographicalId();
387  unsigned int rawid = detid.rawId();
388  unsigned int current = insert_id( rawid );
389  fillShapeAndPlacement( current, det );
390 
391  ADD_PIXEL_TOPOLOGY( current, m_trackerGeom->idToDetUnit( detid ));
392  }
393  }
394 }
const TrackerGeomDet * idToDetUnit(DetId) const
Return the pointer to the GeomDetUnit corresponding to a given DetId.
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
#define ADD_PIXEL_TOPOLOGY(rawid, detUnit)
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
const DetContainer & detsPXF() const
void FWRecoGeometryESProducer::addRPCGeometry ( void  )
private

Definition at line 228 of file FWRecoGeometryESProducer.cc.

References ecal_dqm_sourceclient-live_cfg::cerr, alignCSCRings::e, end, fillShapeAndPlacement(), GeomDet::geographicalId(), insert_id(), m_fwGeometry, m_geomRecord, DetId::Muon, StripTopology::nstrips(), StripTopology::pitch(), DetId::rawId(), RPCGeometry::rolls(), RPCRoll::specificTopology(), and StripTopology::stripLength().

Referenced by produce().

229 {
230  //
231  // RPC rolls geometry
232  //
233  DetId detId( DetId::Muon, 3 );
234  const RPCGeometry* rpcGeom = (const RPCGeometry*) m_geomRecord->slaveGeometry( detId );
235  for( auto it = rpcGeom->rolls().begin(),
236  end = rpcGeom->rolls().end();
237  it != end; ++it )
238  {
239  const RPCRoll* roll = (*it);
240  if( roll )
241  {
242  unsigned int rawid = roll->geographicalId().rawId();
243  unsigned int current = insert_id( rawid );
244  fillShapeAndPlacement( current, roll );
245 
246  const StripTopology& topo = roll->specificTopology();
247  m_fwGeometry->idToName[current].topology[0] = topo.nstrips();
248  m_fwGeometry->idToName[current].topology[1] = topo.stripLength();
249  m_fwGeometry->idToName[current].topology[2] = topo.pitch();
250  }
251  }
252 
253 
254  try {
255  RPCDetId id(1, 1, 4, 1, 1, 1, 1 );
256  m_geomRecord->slaveGeometry( detId );
257  m_fwGeometry->extraDet.Add(new TNamed("RE4", "RPC endcap station 4"));
258  }
259  catch (std::runtime_error &e) {
260  std::cerr << e.what() << std::endl;
261  }
262 }
virtual int nstrips() const =0
const std::vector< const RPCRoll * > & rolls() const
Return a vector of all RPC rolls.
Definition: RPCGeometry.cc:67
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const StripTopology & specificTopology() const
Definition: RPCRoll.cc:107
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
virtual float stripLength() const =0
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
virtual float pitch() const =0
void FWRecoGeometryESProducer::addTECGeometry ( void  )
private

Definition at line 460 of file FWRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, TrackerGeometry::detsTEC(), end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

461 {
462  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTEC().begin(),
463  end = m_trackerGeom->detsTEC().end();
464  it != end; ++it )
465  {
466  const GeomDet *det = *it;
467 
468  if( det )
469  {
470  DetId detid = det->geographicalId();
471  unsigned int rawid = detid.rawId();
472  unsigned int current = insert_id( rawid );
473  fillShapeAndPlacement( current, det );
474 
475  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
476  }
477  }
478 }
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
const DetContainer & detsTEC() const
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTIBGeometry ( void  )
private

Definition at line 397 of file FWRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, TrackerGeometry::detsTIB(), end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

398 {
399  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTIB().begin(),
400  end = m_trackerGeom->detsTIB().end();
401  it != end; ++it )
402  {
403  const GeomDet *det = *it;
404 
405  if( det )
406  {
407  DetId detid = det->geographicalId();
408  unsigned int rawid = detid.rawId();
409  unsigned int current = insert_id( rawid );
410  fillShapeAndPlacement( current, det );
411 
412  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
413  }
414  }
415 }
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
const DetContainer & detsTIB() const
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTIDGeometry ( void  )
private

Definition at line 439 of file FWRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, TrackerGeometry::detsTID(), end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

440 {
441  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTID().begin(),
442  end = m_trackerGeom->detsTID().end();
443  it != end; ++it)
444  {
445  const GeomDet *det = *it;
446 
447  if( det )
448  {
449  DetId detid = det->geographicalId();
450  unsigned int rawid = detid.rawId();
451  unsigned int current = insert_id( rawid );
452  fillShapeAndPlacement( current, det );
453 
454  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
455  }
456  }
457 }
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const DetContainer & detsTID() const
const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::addTOBGeometry ( void  )
private

Definition at line 418 of file FWRecoGeometryESProducer.cc.

References ADD_SISTRIP_TOPOLOGY, TrackerGeometry::detsTOB(), end, fillShapeAndPlacement(), GeomDet::geographicalId(), TrackerGeometry::idToDet(), insert_id(), m_trackerGeom, and DetId::rawId().

Referenced by produce().

419 {
420  for( TrackerGeometry::DetContainer::const_iterator it = m_trackerGeom->detsTOB().begin(),
421  end = m_trackerGeom->detsTOB().end();
422  it != end; ++it )
423  {
424  const GeomDet *det = *it;
425 
426  if( det )
427  {
428  DetId detid = det->geographicalId();
429  unsigned int rawid = detid.rawId();
430  unsigned int current = insert_id( rawid );
431  fillShapeAndPlacement( current, det );
432 
433  ADD_SISTRIP_TOPOLOGY( current, m_trackerGeom->idToDet( detid ));
434  }
435  }
436 }
const TrackerGeometry * m_trackerGeom
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
void fillShapeAndPlacement(unsigned int id, const GeomDet *det)
DetId geographicalId() const
The label of this GeomDet.
Definition: GeomDet.h:79
#define end
Definition: vmac.h:37
unsigned int insert_id(unsigned int id)
Definition: DetId.h:18
#define ADD_SISTRIP_TOPOLOGY(rawid, detUnit)
const DetContainer & detsTOB() const
const TrackerGeomDet * idToDet(DetId) const
void FWRecoGeometryESProducer::fillPoints ( unsigned int  id,
std::vector< GlobalPoint >::const_iterator  begin,
std::vector< GlobalPoint >::const_iterator  end 
)
private

Definition at line 514 of file FWRecoGeometryESProducer.cc.

References assert(), end, i, cmsHarvester::index, and m_fwGeometry.

Referenced by addCaloGeometry().

515 {
516  unsigned int index( 0 );
517  for( std::vector<GlobalPoint>::const_iterator i = begin; i != end; ++i )
518  {
519  assert( index < 23 );
520  m_fwGeometry->idToName[id].points[index] = i->x();
521  m_fwGeometry->idToName[id].points[++index] = i->y();
522  m_fwGeometry->idToName[id].points[++index] = i->z();
523  ++index;
524  }
525 }
int i
Definition: DBlmapReader.cc:9
assert(m_qm.get())
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
#define end
Definition: vmac.h:37
#define begin
Definition: vmac.h:30
void FWRecoGeometryESProducer::fillShapeAndPlacement ( unsigned int  id,
const GeomDet det 
)
private

Shape of GeomDet

Definition at line 530 of file FWRecoGeometryESProducer.cc.

References b, m_fwGeometry, GloballyPositioned< T >::position(), GloballyPositioned< T >::rotation(), GeomDet::surface(), PV3DBase< T, PVType, FrameType >::x(), TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), PV3DBase< T, PVType, FrameType >::y(), TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), PV3DBase< T, PVType, FrameType >::z(), TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

Referenced by addCSCGeometry(), addDTGeometry(), addGEMGeometry(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), and addTOBGeometry().

531 {
532  // Trapezoidal
533  const Bounds *b = &((det->surface ()).bounds ());
534  if( const TrapezoidalPlaneBounds *b2 = dynamic_cast<const TrapezoidalPlaneBounds *> (b))
535  {
536  std::array< const float, 4 > const & par = b2->parameters ();
537 
538  // These parameters are half-lengths, as in CMSIM/GEANT3
539  m_fwGeometry->idToName[id].shape[0] = 1;
540  m_fwGeometry->idToName[id].shape[1] = par [0]; // hBottomEdge
541  m_fwGeometry->idToName[id].shape[2] = par [1]; // hTopEdge
542  m_fwGeometry->idToName[id].shape[3] = par [2]; // thickness
543  m_fwGeometry->idToName[id].shape[4] = par [3]; // apothem
544  }
545  if( const RectangularPlaneBounds *b2 = dynamic_cast<const RectangularPlaneBounds *> (b))
546  {
547  // Rectangular
548  m_fwGeometry->idToName[id].shape[0] = 2;
549  m_fwGeometry->idToName[id].shape[1] = b2->width() * 0.5; // half width
550  m_fwGeometry->idToName[id].shape[2] = b2->length() * 0.5; // half length
551  m_fwGeometry->idToName[id].shape[3] = b2->thickness() * 0.5; // half thickness
552  }
553 
554  // Position of the DetUnit's center
555  GlobalPoint pos = det->surface().position();
556  m_fwGeometry->idToName[id].translation[0] = pos.x();
557  m_fwGeometry->idToName[id].translation[1] = pos.y();
558  m_fwGeometry->idToName[id].translation[2] = pos.z();
559 
560  // Add the coeff of the rotation matrix
561  // with a projection on the basis vectors
562  TkRotation<float> detRot = det->surface().rotation();
563  m_fwGeometry->idToName[id].matrix[0] = detRot.xx();
564  m_fwGeometry->idToName[id].matrix[1] = detRot.yx();
565  m_fwGeometry->idToName[id].matrix[2] = detRot.zx();
566  m_fwGeometry->idToName[id].matrix[3] = detRot.xy();
567  m_fwGeometry->idToName[id].matrix[4] = detRot.yy();
568  m_fwGeometry->idToName[id].matrix[5] = detRot.zy();
569  m_fwGeometry->idToName[id].matrix[6] = detRot.xz();
570  m_fwGeometry->idToName[id].matrix[7] = detRot.yz();
571  m_fwGeometry->idToName[id].matrix[8] = detRot.zz();
572 }
T xx() const
T y() const
Definition: PV3DBase.h:63
T yx() const
const Plane & surface() const
The nominal surface of the GeomDet.
Definition: GeomDet.h:42
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
T zx() const
T xy() const
T zz() const
T z() const
Definition: PV3DBase.h:64
T zy() const
T yy() const
double b
Definition: hdecay.h:120
T xz() const
const RotationType & rotation() const
Definition: Bounds.h:22
T x() const
Definition: PV3DBase.h:62
const PositionType & position() const
T yz() const
unsigned int FWRecoGeometryESProducer::insert_id ( unsigned int  id)
private
const FWRecoGeometryESProducer& FWRecoGeometryESProducer::operator= ( const FWRecoGeometryESProducer )
private
boost::shared_ptr< FWRecoGeometry > FWRecoGeometryESProducer::produce ( const FWRecoGeometryRecord record)

Definition at line 84 of file FWRecoGeometryESProducer.cc.

References addCaloGeometry(), addCSCGeometry(), addDTGeometry(), addGEMGeometry(), addME0Geometry(), addPixelBarrelGeometry(), addPixelForwardGeometry(), addRPCGeometry(), addTECGeometry(), addTIBGeometry(), addTIDGeometry(), addTOBGeometry(), edm::eventsetup::DependentRecordImplementation< RecordT, ListT >::getRecord(), m_caloGeom, m_current, m_fwGeometry, m_geomRecord, m_hgcalGeoms, m_trackerGeom, mergeVDriftHistosByStation::name, swap(), ctpps_dqm_sourceclient-live_cfg::test, and DetId::Tracker.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

85 {
86  using namespace edm;
87 
88  m_fwGeometry = boost::shared_ptr<FWRecoGeometry>( new FWRecoGeometry );
89 
91 
92  DetId detId( DetId::Tracker, 0 );
93  m_trackerGeom = (const TrackerGeometry*) m_geomRecord->slaveGeometry( detId );
94 
95  record.getRecord<CaloGeometryRecord>().get( m_caloGeom );
97  for( const auto& name : hgcal_geom_names ) {
98  const auto& calogr = record.getRecord<CaloGeometryRecord>();
99  calogr.getRecord<IdealGeometryRecord>().get( name , test );
100  if( test.isValid() ) {
101  m_hgcalGeoms.push_back(test);
102  }
103  }
104 
107  addTIBGeometry();
108  addTIDGeometry();
109  addTOBGeometry();
110  addTECGeometry();
111  addDTGeometry();
112  addCSCGeometry();
113  addRPCGeometry();
114  addGEMGeometry();
115  addME0Geometry();
116  addCaloGeometry();
117 
118  m_fwGeometry->idToName.resize( m_current + 1 );
119  std::vector<FWRecoGeom::Info>( m_fwGeometry->idToName ).swap( m_fwGeometry->idToName );
120  std::sort( m_fwGeometry->idToName.begin(), m_fwGeometry->idToName.end());
121 
122  return m_fwGeometry;
123 }
void swap(ora::Record &rh, ora::Record &lh)
Definition: Record.h:70
edm::ESHandle< GlobalTrackingGeometry > m_geomRecord
const TrackerGeometry * m_trackerGeom
boost::shared_ptr< FWRecoGeometry > m_fwGeometry
Definition: DetId.h:18
std::vector< edm::ESHandle< HGCalGeometry > > m_hgcalGeoms
edm::ESHandle< CaloGeometry > m_caloGeom

Member Data Documentation

edm::ESHandle<CaloGeometry> FWRecoGeometryESProducer::m_caloGeom
private

Definition at line 53 of file FWRecoGeometryESProducer.h.

Referenced by addCaloGeometry(), and produce().

unsigned int FWRecoGeometryESProducer::m_current
private

Definition at line 58 of file FWRecoGeometryESProducer.h.

Referenced by insert_id(), and produce().

boost::shared_ptr<FWRecoGeometry> FWRecoGeometryESProducer::m_fwGeometry
private
edm::ESHandle<GlobalTrackingGeometry> FWRecoGeometryESProducer::m_geomRecord
private
std::vector<edm::ESHandle<HGCalGeometry> > FWRecoGeometryESProducer::m_hgcalGeoms
private

Definition at line 54 of file FWRecoGeometryESProducer.h.

Referenced by addCaloGeometry(), and produce().

const TrackerGeometry* FWRecoGeometryESProducer::m_trackerGeom
private