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 7 of file SiStripFakeAPVParameters.h.

Member Typedef Documentation

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

Definition at line 9 of file SiStripFakeAPVParameters.h.

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

Definition at line 55 of file SiStripFakeAPVParameters.h.

Definition at line 56 of file SiStripFakeAPVParameters.h.

Constructor & Destructor Documentation

SiStripFakeAPVParameters::SiStripFakeAPVParameters ( )
inline

Definition at line 11 of file SiStripFakeAPVParameters.h.

11 {}
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 14 of file SiStripFakeAPVParameters.h.

References fillSubDetParameter(), edm::ParameterSet::getParameter(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.

15  {
16  const int layersTIB = 4;
17  const int ringsTID = 3;
18  const int layersTOB = 6;
19  const int ringsTEC = 7;
20 
21  fillSubDetParameter(pset.getParameter<std::vector<double>>(parameterName+"TIB"), int(StripSubdetector::TIB), layersTIB );
22  fillSubDetParameter(pset.getParameter<std::vector<double>>(parameterName+"TID"), int(StripSubdetector::TID), ringsTID );
23  fillSubDetParameter(pset.getParameter<std::vector<double>>(parameterName+"TOB"), int(StripSubdetector::TOB), layersTOB );
24  fillSubDetParameter(pset.getParameter<std::vector<double>>(parameterName+"TEC"), int(StripSubdetector::TEC), ringsTEC );
25  }
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 66 of file SiStripFakeAPVParameters.h.

References Exception, and LayerTriplets::layers().

Referenced by SiStripFakeAPVParameters().

67  {
68  if( v.size() == layers ) {
69  m_data.insert(std::make_pair( subDet, v ));
70  }
71  else if( v.size() == 1 ) {
72  LayerParameters parV(layers, v[0]);
73  m_data.insert(std::make_pair( subDet, parV ));
74  }
75  else {
76  throw cms::Exception("Configuration") << "ERROR: number of parameters for subDet " << subDet << " are " << v.size() << ". They must be either 1 or " << layers << std::endl;
77  }
78  }
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 32 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().

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

Member Data Documentation

SubdetParameters SiStripFakeAPVParameters::m_data
private

Definition at line 57 of file SiStripFakeAPVParameters.h.

Referenced by get().