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

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

Definition at line 11 of file SiStripFakeAPVParameters.h.

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

Definition at line 57 of file SiStripFakeAPVParameters.h.

Definition at line 58 of file SiStripFakeAPVParameters.h.

Constructor & Destructor Documentation

SiStripFakeAPVParameters::SiStripFakeAPVParameters ( )
inline

Definition at line 13 of file SiStripFakeAPVParameters.h.

13 {}
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(), edm::ParameterSet::getParameter(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

17  {
18  const int layersTIB = 4;
19  const int ringsTID = 3;
20  const int layersTOB = 6;
21  const int ringsTEC = 7;
22 
23  fillSubDetParameter(pset.getParameter<std::vector<double>>(parameterName+"TIB"), int(StripSubdetector::TIB), layersTIB );
24  fillSubDetParameter(pset.getParameter<std::vector<double>>(parameterName+"TID"), int(StripSubdetector::TID), ringsTID );
25  fillSubDetParameter(pset.getParameter<std::vector<double>>(parameterName+"TOB"), int(StripSubdetector::TOB), layersTOB );
26  fillSubDetParameter(pset.getParameter<std::vector<double>>(parameterName+"TEC"), int(StripSubdetector::TEC), ringsTEC );
27  }
T getParameter(std::string const &) const
void fillSubDetParameter(const std::vector< double > &v, const int subDet, const unsigned short layers)

Member Function Documentation

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, and LayerTriplets::layers().

Referenced by SiStripFakeAPVParameters().

69  {
70  if( v.size() == layers ) {
71  m_data.insert(std::make_pair( subDet, v ));
72  }
73  else if( v.size() == 1 ) {
74  LayerParameters parV(layers, v[0]);
75  m_data.insert(std::make_pair( subDet, parV ));
76  }
77  else {
78  throw cms::Exception("Configuration") << "ERROR: number of parameters for subDet " << subDet << " are " << v.size() << ". They must be either 1 or " << layers << std::endl;
79  }
80  }
std::vector< LayerSetAndLayers > layers(const SeedingLayerSetsHits &sets)
Definition: LayerTriplets.cc:4
std::vector< double > LayerParameters
double SiStripFakeAPVParameters::get ( const index idx) const
inline
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().

35  {
36  int layerId{0};
37  const int subId = StripSubdetector(id).subdetId();
38  switch(subId) {
40  layerId = tTopo->tibLayer(id) - 1;
41  break;
43  layerId = tTopo->tobLayer(id) - 1;
44  break;
46  layerId = tTopo->tidRing(id) - 1;
47  break;
49  layerId = tTopo->tecRing(id) - 1;
50  break;
51  default:
52  break;
53  }
54  return std::make_pair(subId, layerId);
55  }
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41

Member Data Documentation

SubdetParameters SiStripFakeAPVParameters::m_data
private

Definition at line 59 of file SiStripFakeAPVParameters.h.

Referenced by get().