CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
MTDParametersFromDD Class Reference

#include <MTDParametersFromDD.h>

Public Member Functions

bool build (const DDCompactView *, PMTDParameters &)
 
 MTDParametersFromDD ()
 
virtual ~MTDParametersFromDD ()
 

Private Member Functions

void putOne (int, std::vector< int > &, PMTDParameters &)
 

Detailed Description

Definition at line 11 of file MTDParametersFromDD.h.

Constructor & Destructor Documentation

MTDParametersFromDD::MTDParametersFromDD ( )
inline

Definition at line 13 of file MTDParametersFromDD.h.

13 {}
virtual MTDParametersFromDD::~MTDParametersFromDD ( )
inlinevirtual

Definition at line 14 of file MTDParametersFromDD.h.

References build(), and putOne().

14 {}

Member Function Documentation

bool MTDParametersFromDD::build ( const DDCompactView cvp,
PMTDParameters ptp 
)

Definition at line 31 of file MTDParametersFromDD.cc.

References DDVectorGetter::check(), dbl_to_int(), Exception, DDFilteredView::firstChild(), DDVectorGetter::get(), DDFilteredView::mergedSpecifics(), dataset::name, convertSQLiteXML::ok, AlCaHLTBitMon_QueryRunRegistry::string, pfDeepBoostedJetPreprocessParams_cfi::sv, PMTDParameters::topologyMode_, and PMTDParameters::vpars_.

Referenced by MTDParametersESModule::produce(), and ~MTDParametersFromDD().

33 {
34  std::array<std::string,2> mtdSubdet { { "BTL", "ETL" } };
35  int subdet(0);
36  for( const auto& name : mtdSubdet )
37  {
39  {
40  subdet += 1;
41  std::vector<int> subdetPars = dbl_to_int( DDVectorGetter::get( name ));
42  putOne( subdet, subdetPars, ptp );
43  }
44  }
45 
46  ptp.vpars_ = dbl_to_int( DDVectorGetter::get( "vPars" ));
47 
48  std::string attribute = "OnlyForMTDRecNumbering";
49  DDSpecificsHasNamedValueFilter filter1{attribute};
50  DDFilteredView fv1(*cvp,filter1);
51  bool ok = fv1.firstChild();
52  if (ok) {
53  DDsvalues_type sv(fv1.mergedSpecifics());
54  int topoMode = getMTDTopologyMode("TopologyMode", sv);
55  ptp.topologyMode_ = topoMode;
56  } else {
57  throw cms::Exception( "MTDParametersFromDD" ) << "Not found "<< attribute.c_str() << " but needed."; }
58 
59  return true;
60 }
void putOne(int, std::vector< int > &, PMTDParameters &)
std::vector< int > vpars_
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
bool check(const std::string &)
std::vector< double > get(const std::string &)
std::vector< std::pair< unsigned int, DDValue > > DDsvalues_type
Definition: DDsvalues.h:12
void MTDParametersFromDD::putOne ( int  subdet,
std::vector< int > &  vpars,
PMTDParameters ptp 
)
private

Definition at line 63 of file MTDParametersFromDD.cc.

References PMTDParameters::Item::id_, PMTDParameters::vitems_, and PMTDParameters::Item::vpars_.

Referenced by ~MTDParametersFromDD().

64 {
66  item.id_ = subdet;
67  item.vpars_ = vpars;
68  ptp.vitems_.emplace_back( item );
69 }
std::vector< Item > vitems_
std::vector< int > vpars_