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

static const int _threshold = 64
 

Detailed Description

Definition at line 10 of file APVShot.h.

Constructor & Destructor Documentation

APVShot::APVShot ( )

Definition at line 7 of file APVShot.cc.

7  :
8  _zs(true), _apv(-1), _nstrips(0), _median(-1), _detid() { }
DetId _detid
Definition: APVShot.h:32
float _median
Definition: APVShot.h:31
bool _zs
Definition: APVShot.h:28
int _apv
Definition: APVShot.h:29
int _nstrips
Definition: APVShot.h:30
APVShot::APVShot ( const bool  zs = true)

Definition at line 10 of file APVShot.cc.

10  :
11  _zs(zs), _apv(-1), _nstrips(0), _median(-1), _detid() { }
DetId _detid
Definition: APVShot.h:32
float _median
Definition: APVShot.h:31
bool _zs
Definition: APVShot.h:28
int _apv
Definition: APVShot.h:29
int _nstrips
Definition: APVShot.h:30
APVShot::APVShot ( const std::vector< SiStripDigi > &  digis,
const DetId detid,
const bool  zs = true 
)

Definition at line 13 of file APVShot.cc.

References computeShot().

13  :
14  _zs(zs), _apv(-1), _nstrips(0), _median(-1), _detid()
15 {
16  computeShot(digis,detid,zs);
17 }
DetId _detid
Definition: APVShot.h:32
float _median
Definition: APVShot.h:31
bool _zs
Definition: APVShot.h:28
void computeShot(const std::vector< SiStripDigi > &digis, const DetId &detid, const bool zs=true)
Definition: APVShot.cc:19
int _apv
Definition: APVShot.h:29
int _nstrips
Definition: APVShot.h:30

Member Function Documentation

const int APVShot::apvNumber ( ) const

Definition at line 52 of file APVShot.cc.

References _apv.

52 { return _apv; }
int _apv
Definition: APVShot.h:29
void APVShot::computeShot ( const std::vector< SiStripDigi > &  digis,
const DetId detid,
const bool  zs = true 
)

Definition at line 19 of file APVShot.cc.

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

Referenced by APVShot().

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

Definition at line 60 of file APVShot.cc.

References _detid, _threshold, and DetId::rawId().

60 { return _detid.rawId(); }
DetId _detid
Definition: APVShot.h:32
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
const bool APVShot::isGenuine ( ) const

Definition at line 50 of file APVShot.cc.

References _nstrips, and _threshold.

50 { return (_nstrips > _threshold); }
static const int _threshold
Definition: APVShot.h:34
int _nstrips
Definition: APVShot.h:30
const float APVShot::median ( ) const

Definition at line 56 of file APVShot.cc.

References _median.

56 { return _median; }
float _median
Definition: APVShot.h:31
const int APVShot::nStrips ( ) const

Definition at line 54 of file APVShot.cc.

References _nstrips.

54 { return _nstrips; }
int _nstrips
Definition: APVShot.h:30
const int APVShot::subDet ( ) const

Definition at line 58 of file APVShot.cc.

References _detid, and DetId::subdetId().

58 { return _detid.subdetId(); }
DetId _detid
Definition: APVShot.h:32
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:41

Member Data Documentation

int APVShot::_apv
private

Definition at line 29 of file APVShot.h.

Referenced by apvNumber(), and computeShot().

DetId APVShot::_detid
private

Definition at line 32 of file APVShot.h.

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

float APVShot::_median
private

Definition at line 31 of file APVShot.h.

Referenced by computeShot(), and median().

int APVShot::_nstrips
private

Definition at line 30 of file APVShot.h.

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

const int APVShot::_threshold = 64
staticprivate

Definition at line 34 of file APVShot.h.

Referenced by detId(), and isGenuine().

bool APVShot::_zs
private

Definition at line 28 of file APVShot.h.

Referenced by computeShot().