CMS 3D CMS Logo

MTDGeometricTimingDetESModule.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( "mtdNumberingGeometryDB", descDB );
33 
35  desc.add<bool>( "fromDDD", true );
36  descriptions.add( "mtdNumberingGeometry", desc );
37 }
38 
39 std::unique_ptr<GeometricTimingDet>
41 {
42  if( fromDDD_ )
43  {
45  iRecord.get( cpv );
46 
47  DDDCmsMTDConstruction theDDDCmsMTDConstruction;
48  return std::unique_ptr<GeometricTimingDet> (const_cast<GeometricTimingDet*>( theDDDCmsMTDConstruction.construct(&(*cpv), dbl_to_int( DDVectorGetter::get( "detIdShifts" )))));
49 
50  }
51  else
52  {
54  iRecord.get( pgd );
55 
57  return std::unique_ptr<GeometricTimingDet> ( const_cast<GeometricTimingDet*>( cdbtc.construct( *pgd )));
58  }
59 }
60 
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:124
const GeometricTimingDet * construct(const PGeometricTimingDet &pgd)
const GeometricTimingDet * construct(const DDCompactView *cpv, std::vector< int > detidShifts)
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
ProductT const & get(ESGetToken< ProductT, DepRecordT > const &iToken) const
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::unique_ptr< GeometricTimingDet > produce(const IdealGeometryRecord &)
std::vector< double > get(const std::string &)
MTDGeometricTimingDetESModule(const edm::ParameterSet &p)
#define DEFINE_FWK_EVENTSETUP_MODULE(type)
Definition: ModuleFactory.h:60
void add(std::string const &label, ParameterSetDescription const &psetDescription)
HLT enums.