CMS 3D CMS Logo

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

#include <TrackerParametersFromDD.h>

Public Member Functions

bool build (const cms::DDCompactView *, PTrackerParameters &)
 
bool build (const DDCompactView *, PTrackerParameters &)
 
 TrackerParametersFromDD ()
 
virtual ~TrackerParametersFromDD ()
 

Private Member Functions

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

Detailed Description

Definition at line 14 of file TrackerParametersFromDD.h.

Constructor & Destructor Documentation

◆ TrackerParametersFromDD()

TrackerParametersFromDD::TrackerParametersFromDD ( )
inline

Definition at line 16 of file TrackerParametersFromDD.h.

16 {}

◆ ~TrackerParametersFromDD()

virtual TrackerParametersFromDD::~TrackerParametersFromDD ( )
inlinevirtual

Definition at line 17 of file TrackerParametersFromDD.h.

17 {}

Member Function Documentation

◆ build() [1/2]

bool TrackerParametersFromDD::build ( const cms::DDCompactView cvp,
PTrackerParameters ptp 
)

Definition at line 26 of file TrackerParametersFromDD.cc.

26  {
27  cms::DDVectorsMap vmap = cvp->detector()->vectors();
28  for (int subdet = 1; subdet <= 6; ++subdet) {
29  std::stringstream sstm;
30  sstm << "Subdetector" << subdet;
31  std::string name = sstm.str();
32  for (auto const& it : vmap) {
34  std::vector<int> subdetPars;
35  for (const auto& i : it.second)
36  subdetPars.emplace_back(std::round(i));
37  putOne(subdet, subdetPars, ptp);
38  }
39  }
40  }
41 
42  auto it = vmap.find("vPars");
43  if (it != end(vmap)) {
44  std::vector<int> tmpVec;
45  for (const auto& i : it->second)
46  tmpVec.emplace_back(std::round(i));
47  ptp.vpars = tmpVec;
48  }
49 
50  return true;
51 }

References cms::dd::compareEqual(), cms::DDCompactView::detector(), end, mps_fire::i, Skims_PA_cff::name, cms::dd::noNamespace(), putOne(), AlCaHLTBitMon_QueryRunRegistry::string, cms::DDDetector::vectors(), and PTrackerParameters::vpars.

◆ build() [2/2]

bool TrackerParametersFromDD::build ( const DDCompactView cvp,
PTrackerParameters ptp 
)

Definition at line 9 of file TrackerParametersFromDD.cc.

9  {
10  for (int subdet = 1; subdet <= 6; ++subdet) {
11  std::stringstream sstm;
12  sstm << "Subdetector" << subdet;
13  std::string name = sstm.str();
14 
16  std::vector<int> subdetPars = dbl_to_int(DDVectorGetter::get(name));
17  putOne(subdet, subdetPars, ptp);
18  }
19  }
20 
21  ptp.vpars = dbl_to_int(DDVectorGetter::get("vPars"));
22 
23  return true;
24 }

References DDVectorGetter::check(), dbl_to_int(), DDVectorGetter::get(), Skims_PA_cff::name, putOne(), AlCaHLTBitMon_QueryRunRegistry::string, and PTrackerParameters::vpars.

Referenced by PTrackerParametersDBBuilder::beginRun(), TrackerParametersESModule::produce(), and TrackerParametersESProducer::produce().

◆ putOne()

void TrackerParametersFromDD::putOne ( int  subdet,
std::vector< int > &  vpars,
PTrackerParameters ptp 
)
private

Definition at line 53 of file TrackerParametersFromDD.cc.

53  {
55  item.id = subdet;
56  item.vpars = vpars;
57  ptp.vitems.emplace_back(item);
58 }

References B2GTnPMonitor_cfi::item, and PTrackerParameters::vitems.

Referenced by build().

mps_fire.i
i
Definition: mps_fire.py:355
TrackerParametersFromDD::putOne
void putOne(int, std::vector< int > &, PTrackerParameters &)
Definition: TrackerParametersFromDD.cc:53
cms::DDVectorsMap
tbb::concurrent_unordered_map< std::string, tbb::concurrent_vector< double > > DDVectorsMap
Definition: DDNamespace.h:14
dbl_to_int
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
DDVectorGetter::get
std::vector< double > get(const std::string &)
Definition: DDVectorGetter.h:28
end
#define end
Definition: vmac.h:39
cms::dd::noNamespace
std::string_view noNamespace(std::string_view)
Definition: Filter.cc:63
PTrackerParameters::vitems
std::vector< Item > vitems
Definition: PTrackerParameters.h:18
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
DDVectorGetter::check
bool check(const std::string &)
Definition: DDVectorGetter.h:13
PTrackerParameters::vpars
std::vector< int > vpars
Definition: PTrackerParameters.h:19
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
cms::dd::compareEqual
bool compareEqual(std::string_view, std::string_view)
Skims_PA_cff.name
name
Definition: Skims_PA_cff.py:17
cms::DDDetector::vectors
DDVectorsMap const & vectors() const
Definition: DDDetector.h:22
PTrackerParameters::Item
Definition: PTrackerParameters.h:11
cms::DDCompactView::detector
const cms::DDDetector * detector() const
Definition: DDCompactView.h:32