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.

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

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  }
static constexpr auto TEC
static constexpr auto TOB
static constexpr auto TIB
void fillSubDetParameter(const std::vector< double > &v, const int subDet, const unsigned short layers)
static constexpr auto TID

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.

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

Referenced by SiStripFakeAPVParameters().

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  }
std::vector< double > LayerParameters

◆ 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.

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().

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  }
static constexpr auto TEC
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
static constexpr auto TOB
static constexpr auto TIB
static constexpr auto TID

Member Data Documentation

◆ m_data

SubdetParameters SiStripFakeAPVParameters::m_data
private

Definition at line 59 of file SiStripFakeAPVParameters.h.

Referenced by fillSubDetParameter(), and get().