CMS 3D CMS Logo

List of all members | Public Member Functions | Public Attributes | Static Public Attributes | Friends
CSCStripData Class Reference

#include <CSCStripData.h>

Public Member Functions

 CSCStripData ()
 
 CSCStripData (float phmax, int tmax, const std::vector< int > &phRaw, const std::vector< float > &ph)
 
 CSCStripData (float phmax, int tmax, std::vector< int > &&phRaw, std::vector< float > &&ph)
 
void operator*= (float factor)
 
bool operator< (const CSCStripData &data) const
 
const std::vector< float > & ph () const
 
float phmax () const
 maximum pulseheight in one SCA time bin More...
 
const std::vector< int > & phRaw () const
 
void reset ()
 
int tmax () const
 the time bin in which the maximum pulseheight occurs (counts from 0) More...
 
bool valid () const
 

Public Attributes

std::vector< float > ph_
 
float phmax_
 
std::vector< int > phRaw_
 
int tmax_
 

Static Public Attributes

static constexpr int ntbins_ = 8
 

Friends

std::ostream & operator<< (std::ostream &, const CSCStripData &)
 for debugging purposes More...
 

Detailed Description

Hold strip data while building strip hits in CSCHitFromStripOnly.

Definition at line 15 of file CSCStripData.h.

Constructor & Destructor Documentation

◆ CSCStripData() [1/3]

CSCStripData::CSCStripData ( )
inline

The default ctor initializes all elements of thePulseHeightMap for which explicit digis do not exist. Use sentinel value for istrip and tmax.

Note that raw pulseheights are int.

Definition at line 23 of file CSCStripData.h.

23 : phmax_(0.f), tmax_(-1), phRaw_(ntbins_), ph_(ntbins_) {}

◆ CSCStripData() [2/3]

CSCStripData::CSCStripData ( float  phmax,
int  tmax,
const std::vector< int > &  phRaw,
const std::vector< float > &  ph 
)
inline

Definition at line 24 of file CSCStripData.h.

25  : phmax_(phmax), tmax_(tmax), phRaw_(phRaw), ph_(ph) {}

◆ CSCStripData() [3/3]

CSCStripData::CSCStripData ( float  phmax,
int  tmax,
std::vector< int > &&  phRaw,
std::vector< float > &&  ph 
)
inline

Definition at line 27 of file CSCStripData.h.

Member Function Documentation

◆ operator*=()

void CSCStripData::operator*= ( float  factor)
inline

scale pulseheights by argument, but leave raw pulseheights unchanged.

Definition at line 54 of file CSCStripData.h.

54  {
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  }

References c, DQMScaleToClient_cfi::factor, ph_, phmax_, and HcalDetIdTransform::transform().

◆ operator<()

bool CSCStripData::operator< ( const CSCStripData data) const
inline

Definition at line 60 of file CSCStripData.h.

60 { return phmax_ < data.phmax_; }

References data, and phmax_.

◆ ph()

const std::vector<float>& CSCStripData::ph ( ) const
inline

pulseheights in the 8 SCA time bins, after pedestal subtraction and (possibly) gain-correction

Definition at line 44 of file CSCStripData.h.

44 { return ph_; }

References ph_.

◆ phmax()

float CSCStripData::phmax ( ) const
inline

maximum pulseheight in one SCA time bin

Definition at line 37 of file CSCStripData.h.

37 { return phmax_; }

References phmax_.

◆ phRaw()

const std::vector<int>& CSCStripData::phRaw ( ) const
inline

pulseheights in the 8 SCA time bins, after pedestal subtraction but without gain-correction

Definition at line 49 of file CSCStripData.h.

49 { return phRaw_; }

References phRaw_.

◆ reset()

void CSCStripData::reset ( void  )
inline

Definition at line 30 of file CSCStripData.h.

30  {
31  phmax_ = 0.f;
32  tmax_ = -1;
33  }

References phmax_, and tmax_.

◆ tmax()

int CSCStripData::tmax ( ) const
inline

the time bin in which the maximum pulseheight occurs (counts from 0)

Definition at line 39 of file CSCStripData.h.

39 { return tmax_; }

References tmax_.

◆ valid()

bool CSCStripData::valid ( ) const
inline

Definition at line 34 of file CSCStripData.h.

34 { return tmax_ >= 0; }

References tmax_.

Friends And Related Function Documentation

◆ operator<<

std::ostream& operator<< ( std::ostream &  os,
const CSCStripData data 
)
friend

for debugging purposes

Definition at line 9 of file CSCStripData.cc.

9  {
10  os << "CSCStripData " << std::endl
11  << "------------ " << std::endl
12  << "no. of time bins = " << data.ntbins_ << std::endl
13  << ", phmax = " << data.phmax_ << ", tmax = " << data.tmax_ << std::endl
14  << "phraw: " << std::endl;
15  std::copy(data.phRaw_.begin(), data.phRaw_.end(), std::ostream_iterator<int>(os, "\n"));
16  os << "ph: " << std::endl;
17  std::copy(data.ph_.begin(), data.ph_.end(), std::ostream_iterator<float>(os, "\n"));
18  return os;
19 }

Member Data Documentation

◆ ntbins_

constexpr int CSCStripData::ntbins_ = 8
staticconstexpr

Definition at line 67 of file CSCStripData.h.

◆ ph_

std::vector<float> CSCStripData::ph_

Definition at line 71 of file CSCStripData.h.

Referenced by operator*=(), and ph().

◆ phmax_

float CSCStripData::phmax_

Definition at line 68 of file CSCStripData.h.

Referenced by operator*=(), operator<(), phmax(), and reset().

◆ phRaw_

std::vector<int> CSCStripData::phRaw_

Definition at line 70 of file CSCStripData.h.

Referenced by phRaw().

◆ tmax_

int CSCStripData::tmax_

Definition at line 69 of file CSCStripData.h.

Referenced by reset(), tmax(), and valid().

CSCStripData::ph_
std::vector< float > ph_
Definition: CSCStripData.h:71
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
CSCStripData::phmax_
float phmax_
Definition: CSCStripData.h:68
CSCStripData::phRaw_
std::vector< int > phRaw_
Definition: CSCStripData.h:70
DQMScaleToClient_cfi.factor
factor
Definition: DQMScaleToClient_cfi.py:8
HcalDetIdTransform::transform
unsigned transform(const HcalDetId &id, unsigned transformCode)
Definition: HcalDetIdTransform.cc:7
CSCStripData::tmax_
int tmax_
Definition: CSCStripData.h:69
CSCStripData::phRaw
const std::vector< int > & phRaw() const
Definition: CSCStripData.h:49
eostools.move
def move(src, dest)
Definition: eostools.py:511
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:56
CSCStripData::ntbins_
static constexpr int ntbins_
Definition: CSCStripData.h:67