CMS 3D CMS Logo

CSCStripData.h
Go to the documentation of this file.
1 #ifndef CSCRecHitD_CSCStripData_h
2 #define CSCRecHitD_CSCStripData_h
3 
10 #include <algorithm>
11 #include <functional>
12 #include <vector>
13 #include <iosfwd>
14 
15 class CSCStripData {
16 public:
24  CSCStripData(float phmax, int tmax, const std::vector<int>& phRaw, const std::vector<float>& ph)
25  : phmax_(phmax), tmax_(tmax), phRaw_(phRaw), ph_(ph) {}
26 
27  CSCStripData(float phmax, int tmax, std::vector<int>&& phRaw, std::vector<float>&& ph)
29 
30  void reset() {
31  phmax_ = 0.f;
32  tmax_ = -1;
33  }
34  bool valid() const { return tmax_ >= 0; }
35 
37  float phmax() const { return phmax_; }
39  int tmax() const { return tmax_; }
40 
44  const std::vector<float>& ph() const { return ph_; }
45 
49  const std::vector<int>& phRaw() const { return phRaw_; }
50 
54  void operator*=(float factor) {
55  // scale all elements of ph by 'factor'. Leaves phRaw_ unchanged.
56  std::transform(ph_.begin(), ph_.end(), ph_.begin(), [&factor](auto c) { return c * factor; });
57  phmax_ *= factor;
58  }
59 
60  bool operator<(const CSCStripData& data) const { return phmax_ < data.phmax_; }
61 
63  friend std::ostream& operator<<(std::ostream&, const CSCStripData&);
64 
65  // private:
66 
67  static constexpr int ntbins_ = 8; //@@ Number of time bins & hence length of ph vectors
68  float phmax_;
69  int tmax_;
70  std::vector<int> phRaw_;
71  std::vector<float> ph_;
72 };
73 
74 #endif
CSCStripData::ph_
std::vector< float > ph_
Definition: CSCStripData.h:71
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
CSCStripData::phmax_
float phmax_
Definition: CSCStripData.h:68
CSCStripData::operator<
bool operator<(const CSCStripData &data) const
Definition: CSCStripData.h:60
CSCStripData::phRaw_
std::vector< int > phRaw_
Definition: CSCStripData.h:70
CSCStripData::valid
bool valid() const
Definition: CSCStripData.h:34
CSCStripData::operator*=
void operator*=(float factor)
Definition: CSCStripData.h:54
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
CSCStripData
Definition: CSCStripData.h:15
CSCStripData::reset
void reset()
Definition: CSCStripData.h:30
CSCStripData::CSCStripData
CSCStripData(float phmax, int tmax, std::vector< int > &&phRaw, std::vector< float > &&ph)
Definition: CSCStripData.h:27
CSCStripData::tmax_
int tmax_
Definition: CSCStripData.h:69
CSCStripData::operator<<
friend std::ostream & operator<<(std::ostream &, const CSCStripData &)
for debugging purposes
Definition: CSCStripData.cc:9
CSCStripData::CSCStripData
CSCStripData()
Definition: CSCStripData.h:23
CSCStripData::phRaw
const std::vector< int > & phRaw() const
Definition: CSCStripData.h:49
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
CSCStripData::CSCStripData
CSCStripData(float phmax, int tmax, const std::vector< int > &phRaw, const std::vector< float > &ph)
Definition: CSCStripData.h:24
CSCStripData::tmax
int tmax() const
the time bin in which the maximum pulseheight occurs (counts from 0)
Definition: CSCStripData.h:39
CSCStripData::phmax
float phmax() const
maximum pulseheight in one SCA time bin
Definition: CSCStripData.h:37
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
CSCStripData::ph
const std::vector< float > & ph() const
Definition: CSCStripData.h:44
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:46
CSCStripData::ntbins_
static constexpr int ntbins_
Definition: CSCStripData.h:67