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 30 of file MTDParametersFromDD.cc.

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

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

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

Definition at line 58 of file MTDParametersFromDD.cc.

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

Referenced by ~MTDParametersFromDD().

58  {
60  item.id_ = subdet;
61  item.vpars_ = vpars;
62  ptp.vitems_.emplace_back(item);
63 }
std::vector< Item > vitems_
std::vector< int > vpars_