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.
14 
15 #include <memory>
16 
17 using namespace edm;
18 
20  : fromDDD_( p.getParameter<bool>( "fromDDD" ))
21 {
22  setWhatProduced( this );
23 }
24 
26 
27 void
29 {
31  descDB.add<bool>( "fromDDD", false );
32  descriptions.add( "trackerNumberingGeometryDB", descDB );
33 
35  desc.add<bool>( "fromDDD", true );
36  descriptions.add( "trackerNumberingGeometry", desc );
37 }
38 
39 std::unique_ptr<GeometricDet>
41 {
42  if( fromDDD_ )
43  {
45  iRecord.get( cpv );
46 
47  DDDCmsTrackerContruction theDDDCmsTrackerContruction;
48  return std::unique_ptr<GeometricDet> (const_cast<GeometricDet*>( theDDDCmsTrackerContruction.construct(&(*cpv), dbl_to_int( DDVectorGetter::get( "detIdShifts" )))));
49  }
50  else
51  {
53  iRecord.get( pgd );
54 
56  return std::unique_ptr<GeometricDet> ( const_cast<GeometricDet*>( cdbtc.construct( *pgd )));
57  }
58 }
59 
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const GeometricDet * construct(const PGeometricDet &pgd)
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.h:7
void get(HolderT &iHolder) const
std::unique_ptr< GeometricDet > produce(const IdealGeometryRecord &)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::vector< double > get(const std::string &)
#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
const GeometricDet * construct(const DDCompactView *cpv, std::vector< int > detidShifts)
TrackerGeometricDetESModule(const edm::ParameterSet &p)