CMS 3D CMS Logo

SiStripFakeAPVParameters.h
Go to the documentation of this file.
5 
10 public:
11  using index = std::pair<int, int>;
12 
14 
17  const int layersTIB = 4;
18  const int ringsTID = 3;
19  const int layersTOB = 6;
20  const int ringsTEC = 7;
21 
23  pset.getParameter<std::vector<double>>(parameterName + "TIB"), int(StripSubdetector::TIB), layersTIB);
25  pset.getParameter<std::vector<double>>(parameterName + "TID"), int(StripSubdetector::TID), ringsTID);
27  pset.getParameter<std::vector<double>>(parameterName + "TOB"), int(StripSubdetector::TOB), layersTOB);
29  pset.getParameter<std::vector<double>>(parameterName + "TEC"), int(StripSubdetector::TEC), ringsTEC);
30  }
31 
32  inline double get(const index& idx) const { return m_data.at(idx.first)[idx.second]; }
33 
34  static index getIndex(const TrackerTopology* tTopo, DetId id) {
35  int layerId{0};
36  const int subId = StripSubdetector(id).subdetId();
37  switch (subId) {
39  layerId = tTopo->tibLayer(id) - 1;
40  break;
42  layerId = tTopo->tobLayer(id) - 1;
43  break;
45  layerId = tTopo->tidRing(id) - 1;
46  break;
48  layerId = tTopo->tecRing(id) - 1;
49  break;
50  default:
51  break;
52  }
53  return std::make_pair(subId, layerId);
54  }
55 
56 private:
57  using LayerParameters = std::vector<double>;
58  using SubdetParameters = std::map<int, LayerParameters>;
60 
68  void fillSubDetParameter(const std::vector<double>& v, const int subDet, const unsigned short layers) {
69  if (v.size() == layers) {
70  m_data.insert(std::make_pair(subDet, v));
71  } else if (v.size() == 1) {
72  LayerParameters parV(layers, v[0]);
73  m_data.insert(std::make_pair(subDet, parV));
74  } else {
75  throw cms::Exception("Configuration") << "ERROR: number of parameters for subDet " << subDet << " are "
76  << v.size() << ". They must be either 1 or " << layers << std::endl;
77  }
78  }
79 };
SiStripFakeAPVParameters::getIndex
static index getIndex(const TrackerTopology *tTopo, DetId id)
Definition: SiStripFakeAPVParameters.h:34
SiStripFakeAPVParameters
Definition: SiStripFakeAPVParameters.h:9
SiStripFakeAPVParameters::SubdetParameters
std::map< int, LayerParameters > SubdetParameters
Definition: SiStripFakeAPVParameters.h:58
TrackerTopology
Definition: TrackerTopology.h:16
StripSubdetector
Definition: StripSubdetector.h:12
findQualityFiles.v
v
Definition: findQualityFiles.py:179
TrackerTopology::tidRing
unsigned int tidRing(const DetId &id) const
Definition: TrackerTopology.h:218
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
SiStripFakeAPVParameters::m_data
SubdetParameters m_data
Definition: SiStripFakeAPVParameters.h:59
DetId
Definition: DetId.h:17
TrackerTopology.h
SiStripFakeAPVParameters::LayerParameters
std::vector< double > LayerParameters
Definition: SiStripFakeAPVParameters.h:57
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
SiStripFakeAPVParameters::SiStripFakeAPVParameters
SiStripFakeAPVParameters()
Definition: SiStripFakeAPVParameters.h:13
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
SiStripFakeAPVParameters::index
std::pair< int, int > index
Definition: SiStripFakeAPVParameters.h:11
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::ParameterSet
Definition: ParameterSet.h:47
SiStripFakeAPVParameters::get
double get(const index &idx) const
Definition: SiStripFakeAPVParameters.h:32
SiStripFakeAPVParameters::SiStripFakeAPVParameters
SiStripFakeAPVParameters(const edm::ParameterSet &pset, const std::string &parameterName)
Fills the parameters read from cfg and matching the name in the map.
Definition: SiStripFakeAPVParameters.h:16
createfilelist.int
int
Definition: createfilelist.py:10
TrackerTopology::tecRing
unsigned int tecRing(const DetId &id) const
ring id
Definition: TrackerTopology.h:217
SiStripFakeAPVParameters::fillSubDetParameter
void fillSubDetParameter(const std::vector< double > &v, const int subDet, const unsigned short layers)
Definition: SiStripFakeAPVParameters.h:68
TrackerTopology::tobLayer
unsigned int tobLayer(const DetId &id) const
Definition: TrackerTopology.h:147
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
Exception
Definition: hltDiff.cc:246
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
Exception.h
ParameterSet.h
StripSubdetector.h
hgcalTopologyTester_cfi.layers
layers
Definition: hgcalTopologyTester_cfi.py:8
StripSubdetector::TID
static constexpr auto TID
Definition: StripSubdetector.h:17
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
TrackerTopology::tibLayer
unsigned int tibLayer(const DetId &id) const
Definition: TrackerTopology.h:150