CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes | Static Private Attributes
APVShot Class Reference

#include <APVShot.h>

Public Member Functions

const int apvNumber () const
 
 APVShot ()
 
 APVShot (const bool zs=true)
 
 APVShot (const std::vector< SiStripDigi > &digis, const DetId &detid, const bool zs=true)
 
void computeShot (const std::vector< SiStripDigi > &digis, const DetId &detid, const bool zs=true)
 
const unsigned int detId () const
 
const bool isGenuine () const
 
const float median () const
 
const int nStrips () const
 
const int subDet () const
 

Private Attributes

int _apv
 
DetId _detid
 
float _median
 
int _nstrips
 
bool _zs
 

Static Private Attributes

const static int _threshold = 64
 

Detailed Description

Definition at line 9 of file APVShot.h.

Constructor & Destructor Documentation

◆ APVShot() [1/3]

APVShot::APVShot ( )

Definition at line 7 of file APVShot.cc.

7 : _zs(true), _apv(-1), _nstrips(0), _median(-1), _detid() {}

◆ APVShot() [2/3]

APVShot::APVShot ( const bool  zs = true)

Definition at line 9 of file APVShot.cc.

9 : _zs(zs), _apv(-1), _nstrips(0), _median(-1), _detid() {}

◆ APVShot() [3/3]

APVShot::APVShot ( const std::vector< SiStripDigi > &  digis,
const DetId detid,
const bool  zs = true 
)

Definition at line 11 of file APVShot.cc.

12  : _zs(zs), _apv(-1), _nstrips(0), _median(-1), _detid() {
13  computeShot(digis, detid, zs);
14 }

References computeShot().

Member Function Documentation

◆ apvNumber()

const int APVShot::apvNumber ( ) const

Definition at line 49 of file APVShot.cc.

49 { return _apv; }

References _apv.

◆ computeShot()

void APVShot::computeShot ( const std::vector< SiStripDigi > &  digis,
const DetId detid,
const bool  zs = true 
)

Definition at line 16 of file APVShot.cc.

16  {
17  _zs = zs;
18  _detid = detid;
19 
20  _nstrips = 0;
21  _apv = -1;
22  _median = -1;
23 
24  std::vector<unsigned int> charge;
25  for (std::vector<SiStripDigi>::const_iterator digi = digis.begin(); digi != digis.end(); ++digi) {
26  if (!_zs || digi->adc() > 0) {
27  int oldapv = _apv;
28  _apv = digi->strip() / 128;
29  if (oldapv >= 0 && oldapv != _apv)
30  throw cms::Exception("WrongDigiVector") << "Digis from Different APVs";
31 
32  charge.push_back(digi->adc());
33  ++_nstrips;
34  }
35  }
36 
37  // charge to be sorted in descending order
38 
39  std::sort(charge.begin(), charge.end());
40  std::reverse(charge.begin(), charge.end());
41 
42  if (charge.size() > 64) {
43  _median = float(charge[64]);
44  }
45 }

References _apv, _detid, _median, _nstrips, _zs, ALCARECOTkAlJpsiMuMu_cff::charge, Exception, dqmMemoryStats::float, and groupFilesInBlocks::reverse.

Referenced by APVShot().

◆ detId()

const unsigned int APVShot::detId ( ) const

Definition at line 57 of file APVShot.cc.

57 { return _detid.rawId(); }

References _detid, and DetId::rawId().

◆ isGenuine()

const bool APVShot::isGenuine ( ) const

Definition at line 47 of file APVShot.cc.

47 { return (_nstrips > _threshold); }

References _nstrips, and _threshold.

◆ median()

const float APVShot::median ( ) const

Definition at line 53 of file APVShot.cc.

53 { return _median; }

References _median.

◆ nStrips()

const int APVShot::nStrips ( ) const

Definition at line 51 of file APVShot.cc.

51 { return _nstrips; }

References _nstrips.

◆ subDet()

const int APVShot::subDet ( ) const

Definition at line 55 of file APVShot.cc.

55 { return _detid.subdetId(); }

References _detid, and DetId::subdetId().

Member Data Documentation

◆ _apv

int APVShot::_apv
private

Definition at line 26 of file APVShot.h.

Referenced by apvNumber(), and computeShot().

◆ _detid

DetId APVShot::_detid
private

Definition at line 29 of file APVShot.h.

Referenced by computeShot(), detId(), and subDet().

◆ _median

float APVShot::_median
private

Definition at line 28 of file APVShot.h.

Referenced by computeShot(), and median().

◆ _nstrips

int APVShot::_nstrips
private

Definition at line 27 of file APVShot.h.

Referenced by computeShot(), isGenuine(), and nStrips().

◆ _threshold

const int APVShot::_threshold = 64
staticprivate

Definition at line 31 of file APVShot.h.

Referenced by isGenuine().

◆ _zs

bool APVShot::_zs
private

Definition at line 25 of file APVShot.h.

Referenced by computeShot().

dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
APVShot::computeShot
void computeShot(const std::vector< SiStripDigi > &digis, const DetId &detid, const bool zs=true)
Definition: APVShot.cc:16
APVShot::_nstrips
int _nstrips
Definition: APVShot.h:27
APVShot::_apv
int _apv
Definition: APVShot.h:26
groupFilesInBlocks.reverse
reverse
Definition: groupFilesInBlocks.py:131
APVShot::_detid
DetId _detid
Definition: APVShot.h:29
APVShot::_threshold
const static int _threshold
Definition: APVShot.h:31
APVShot::_median
float _median
Definition: APVShot.h:28
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
APVShot::_zs
bool _zs
Definition: APVShot.h:25
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
Exception
Definition: hltDiff.cc:246