CMS 3D CMS Logo

SiStripApvSimulationParameters.h
Go to the documentation of this file.
1 #ifndef SiStripApvSimulationParameters_h
2 #define SiStripApvSimulationParameters_h
3 
5 
6 #include <vector>
9 
10 namespace CLHEP {
11  class HepRandomEngine;
12 }
13 
18 public:
19  using layerid = unsigned int;
21 
23  : m_nTIB(nTIB), m_nTOB(nTOB), m_nTID(nTID), m_nTEC(nTEC) {
24  m_barrelParam.resize(m_nTIB + m_nTOB);
26  m_endcapParam.resize(m_nTID + m_nTEC);
28  }
31 
32  void calculateIntegrals(); // make sure integrals have been calculated
33 
36 
39 
42 
45 
46  const LayerParameters& getTIB(layerid layer) const { return m_barrelParam[layer - 1]; }
47  const LayerParameters& getTOB(layerid layer) const { return m_barrelParam[m_nTIB + layer - 1]; }
48  const LayerParameters& getTID(layerid wheel) const { return m_endcapParam[wheel - 1]; }
49  const LayerParameters& getTEC(layerid wheel) const { return m_endcapParam[m_nTID + wheel - 1]; }
50 
51  float sampleTIB(layerid layer, float z, float pu, CLHEP::HepRandomEngine* engine) const {
52  return sampleBarrel(layer - 1, z, pu, engine);
53  }
54  float sampleTOB(layerid layer, float z, float pu, CLHEP::HepRandomEngine* engine) const {
55  return sampleBarrel(m_nTIB + layer - 1, z, pu, engine);
56  };
57  float sampleTID(layerid wheel, float r, float pu, CLHEP::HepRandomEngine* engine) const {
58  return sampleEndcap(wheel - 1, r, pu, engine);
59  }
60  float sampleTEC(layerid wheel, float r, float pu, CLHEP::HepRandomEngine* engine) const {
61  return sampleEndcap(m_nTID + wheel - 1, r, pu, engine);
62  }
63 
64 private:
66  std::vector<PhysicsTools::Calibration::HistogramF3D> m_barrelParam;
67  std::vector<PhysicsTools::Calibration::HistogramF2D> m_barrelParam_xInt;
68  std::vector<PhysicsTools::Calibration::HistogramF3D> m_endcapParam;
69  std::vector<PhysicsTools::Calibration::HistogramF2D> m_endcapParam_xInt;
70 
71  float sampleBarrel(layerid layerIdx, float z, float pu, CLHEP::HepRandomEngine* engine) const;
72  float sampleEndcap(layerid wheelIdx, float r, float pu, CLHEP::HepRandomEngine* engine) const;
73 
75 };
76 
77 #endif
bool putTIB(layerid layer, const LayerParameters &params)
float sampleTOB(layerid layer, float z, float pu, CLHEP::HepRandomEngine *engine) const
float sampleTIB(layerid layer, float z, float pu, CLHEP::HepRandomEngine *engine) const
bool putTID(layerid wheel, const LayerParameters &params)
constexpr std::array< uint8_t, layerIndexSize > layer
std::vector< PhysicsTools::Calibration::HistogramF2D > m_endcapParam_xInt
const LayerParameters & getTID(layerid wheel) const
const LayerParameters & getTIB(layerid layer) const
SiStripApvSimulationParameters(layerid nTIB, layerid nTOB, layerid nTID, layerid nTEC)
std::vector< PhysicsTools::Calibration::HistogramF3D > m_endcapParam
float sampleTID(layerid wheel, float r, float pu, CLHEP::HepRandomEngine *engine) const
const LayerParameters & getTEC(layerid wheel) const
const LayerParameters & getTOB(layerid layer) const
#define COND_SERIALIZABLE
Definition: Serializable.h:39
float sampleEndcap(layerid wheelIdx, float r, float pu, CLHEP::HepRandomEngine *engine) const
std::vector< PhysicsTools::Calibration::HistogramF3D > m_barrelParam
Histogram3D< float > HistogramF3D
Definition: Histogram3D.h:183
PhysicsTools::Calibration::HistogramF3D LayerParameters
bool putTEC(layerid wheel, const LayerParameters &params)
std::vector< PhysicsTools::Calibration::HistogramF2D > m_barrelParam_xInt
float sampleTEC(layerid wheel, float r, float pu, CLHEP::HepRandomEngine *engine) const
bool putTOB(layerid layer, const LayerParameters &params)
float sampleBarrel(layerid layerIdx, float z, float pu, CLHEP::HepRandomEngine *engine) const