CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
SiStripFakeAPVParameters Class Reference

#include <SiStripFakeAPVParameters.h>

Public Types

using index = std::pair< int, int >
 

Public Member Functions

double get (const index &idx) const
 
 SiStripFakeAPVParameters ()
 
 SiStripFakeAPVParameters (const edm::ParameterSet &pset, const std::string &parameterName)
 Fills the parameters read from cfg and matching the name in the map. More...
 

Static Public Member Functions

static index getIndex (const TrackerTopology *tTopo, DetId id)
 

Private Types

using LayerParameters = std::vector< double >
 
using SubdetParameters = std::map< int, LayerParameters >
 

Private Member Functions

void fillSubDetParameter (const std::vector< double > &v, const int subDet, const unsigned short layers)
 

Private Attributes

SubdetParameters m_data
 

Detailed Description

Helper that stores one parameter for each layer/ring (wrapper around std::map<std::vector<double>>)

Definition at line 9 of file SiStripFakeAPVParameters.h.

Member Typedef Documentation

◆ index

using SiStripFakeAPVParameters::index = std::pair<int, int>

Definition at line 11 of file SiStripFakeAPVParameters.h.

◆ LayerParameters

using SiStripFakeAPVParameters::LayerParameters = std::vector<double>
private

Definition at line 57 of file SiStripFakeAPVParameters.h.

◆ SubdetParameters

Definition at line 58 of file SiStripFakeAPVParameters.h.

Constructor & Destructor Documentation

◆ SiStripFakeAPVParameters() [1/2]

SiStripFakeAPVParameters::SiStripFakeAPVParameters ( )
inline

Definition at line 13 of file SiStripFakeAPVParameters.h.

13 {}

◆ SiStripFakeAPVParameters() [2/2]

SiStripFakeAPVParameters::SiStripFakeAPVParameters ( const edm::ParameterSet pset,
const std::string &  parameterName 
)
inline

Fills the parameters read from cfg and matching the name in the map.

Definition at line 16 of file SiStripFakeAPVParameters.h.

16  {
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  }

References fillSubDetParameter(), muonDTDigis_cfi::pset, StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

Member Function Documentation

◆ fillSubDetParameter()

void SiStripFakeAPVParameters::fillSubDetParameter ( const std::vector< double > &  v,
const int  subDet,
const unsigned short  layers 
)
inlineprivate

Fills the map with the paramters for the given subdetector.
Each vector "v" holds the parameters for the layers/rings, if the vector has only one parameter all the layers/rings get that parameter.
The only other possibility is that the number of parameters equals the number of layers, otherwise an exception of type "Configuration" will be thrown.

Definition at line 68 of file SiStripFakeAPVParameters.h.

68  {
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  }

References Exception, hgcalTopologyTester_cfi::layers, m_data, and findQualityFiles::v.

Referenced by SiStripFakeAPVParameters().

◆ get()

double SiStripFakeAPVParameters::get ( const index idx) const
inline

◆ getIndex()

static index SiStripFakeAPVParameters::getIndex ( const TrackerTopology tTopo,
DetId  id 
)
inlinestatic

Definition at line 34 of file SiStripFakeAPVParameters.h.

34  {
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  }

References createfilelist::int, DetId::subdetId(), StripSubdetector::TEC, TrackerTopology::tecRing(), StripSubdetector::TIB, TrackerTopology::tibLayer(), StripSubdetector::TID, TrackerTopology::tidRing(), StripSubdetector::TOB, and TrackerTopology::tobLayer().

Referenced by SiStripNoiseNormalizedWithApvGainBuilder::analyze(), SiStripApvGainBuilderFromTag::analyze(), and SiStripNoisesFakeESSource::produce().

Member Data Documentation

◆ m_data

SubdetParameters SiStripFakeAPVParameters::m_data
private

Definition at line 59 of file SiStripFakeAPVParameters.h.

Referenced by fillSubDetParameter(), and get().

StripSubdetector
Definition: StripSubdetector.h:12
findQualityFiles.v
v
Definition: findQualityFiles.py:179
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
SiStripFakeAPVParameters::m_data
SubdetParameters m_data
Definition: SiStripFakeAPVParameters.h:59
SiStripFakeAPVParameters::LayerParameters
std::vector< double > LayerParameters
Definition: SiStripFakeAPVParameters.h:57
StripSubdetector::TIB
static constexpr auto TIB
Definition: StripSubdetector.h:16
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
createfilelist.int
int
Definition: createfilelist.py:10
SiStripFakeAPVParameters::fillSubDetParameter
void fillSubDetParameter(const std::vector< double > &v, const int subDet, const unsigned short layers)
Definition: SiStripFakeAPVParameters.h:68
StripSubdetector::TEC
static constexpr auto TEC
Definition: StripSubdetector.h:19
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:29
Exception
Definition: hltDiff.cc:245
StripSubdetector::TOB
static constexpr auto TOB
Definition: StripSubdetector.h:18
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