CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackerGeometricDetESModule.cc
Go to the documentation of this file.
12 
20 
21 #include <memory>
22 
23 using namespace edm;
24 
26  : fromDDD_( p.getParameter<bool>( "fromDDD" )),
27  layerNumberPXB_( p.exists( "layerNumberPXB" ) ? p.getParameter<unsigned int>( "layerNumberPXB" ) : 16U ),// 16 for current, 18 for SLHC
28  totalBlade_( p.exists( "totalBlade" ) ? p.getParameter<unsigned int>( "totalBlade" ) : 24U ) // 24 for current, 56 for SLHC
29 {
30  setWhatProduced( this );
31 }
32 
34 
35 void
37 {
39  descDB.add<bool>( "fromDDD", false );
40  descDB.addOptional<unsigned int>( "layerNumberPXB", 16U );
41  descDB.addOptional<unsigned int>( "totalBlade", 24U );
42  descriptions.add( "trackerNumberingGeometryDB", descDB );
43 
45  descSLHCDB.add<bool>( "fromDDD", false );
46  descSLHCDB.addOptional<unsigned int>( "layerNumberPXB", 18U );
47  descSLHCDB.addOptional<unsigned int>( "totalBlade", 56U );
48  descriptions.add( "trackerNumberingSLHCGeometryDB", descSLHCDB );
49 
51  desc.add<bool>( "fromDDD", true );
52  desc.addOptional<unsigned int>( "layerNumberPXB", 16U );
53  desc.addOptional<unsigned int>( "totalBlade", 24U );
54  descriptions.add( "trackerNumberingGeometry", desc );
55 
57  descSLHC.add<bool>( "fromDDD", true );
58  descSLHC.addOptional<unsigned int>( "layerNumberPXB", 18U );
59  descSLHC.addOptional<unsigned int>( "totalBlade", 56U );
60  descriptions.add( "trackerNumberingSLHCGeometry", descSLHC );
61 }
62 
63 std::auto_ptr<GeometricDet>
65 {
66  if( fromDDD_ )
67  {
69  iRecord.get( cpv );
70 
71  DDDCmsTrackerContruction theDDDCmsTrackerContruction;
72  return std::auto_ptr<GeometricDet> (const_cast<GeometricDet*>( theDDDCmsTrackerContruction.construct(&(*cpv), layerNumberPXB_, totalBlade_ )));
73  }
74  else
75  {
77  iRecord.get( pgd );
78 
80  return std::auto_ptr<GeometricDet> ( const_cast<GeometricDet*>( cdbtc.construct( *pgd )));
81  }
82 }
83 
ParameterDescriptionBase * addOptional(U const &iLabel, T const &value)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const GeometricDet * construct(const DDCompactView *cpv, unsigned int layerNumberPXB, unsigned int totalBlade)
const GeometricDet * construct(const PGeometricDet &pgd)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::auto_ptr< GeometricDet > produce(const IdealGeometryRecord &)
void get(HolderT &iHolder) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
volatile std::atomic< bool > shutdown_flag false
TrackerGeometricDetESModule(const edm::ParameterSet &p)