CMS 3D CMS Logo

Public Member Functions | Private Attributes | Static Private Attributes

APVShot Class Reference

#include <APVShot.h>

List of all members.

Public Member Functions

const int apvNumber () const
 APVShot (const bool zs=true)
 APVShot ()
 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.

                : 
  _zs(true), _apv(-1), _nstrips(0), _median(-1), _detid() { }
APVShot::APVShot ( const bool  zs = true)

Definition at line 10 of file APVShot.cc.

                             : 
  _zs(zs), _apv(-1), _nstrips(0), _median(-1), _detid() { }
APVShot::APVShot ( const std::vector< SiStripDigi > &  digis,
const DetId detid,
const bool  zs = true 
)

Definition at line 13 of file APVShot.cc.

References computeShot().

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

Member Function Documentation

const int APVShot::apvNumber ( ) const

Definition at line 52 of file APVShot.cc.

References _apv.

{ return _apv; }
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, DeDxDiscriminatorTools::charge(), cond::rpcobgas::detid, Exception, and python::multivaluedict::sort().

Referenced by APVShot().

                                                                                                {

  _zs = zs;
  _detid = detid;

  _nstrips = 0;
  _apv = -1;
  _median = -1;

  std::vector<unsigned int> charge;
  for(std::vector<SiStripDigi>::const_iterator digi=digis.begin();digi!=digis.end();++digi) {

    if(!_zs || digi->adc()>0) {
      int oldapv = _apv;
      _apv = digi->strip()/128;
      if(oldapv>=0 && oldapv!=_apv) throw cms::Exception("WrongDigiVector") << "Digis from Different APVs" ;
      
      charge.push_back(digi->adc());
      ++_nstrips;
    }
  }
  
  // charge to be sorted in descending order

  std::sort(charge.begin(),charge.end()); 
  std::reverse(charge.begin(),charge.end());

  if(charge.size()> 64) { _median = float(charge[64]); }

}
const unsigned int APVShot::detId ( ) const

Definition at line 60 of file APVShot.cc.

References _detid, and DetId::rawId().

{ return _detid.rawId(); }
const bool APVShot::isGenuine ( ) const

Definition at line 50 of file APVShot.cc.

References _nstrips, and _threshold.

{ return (_nstrips > _threshold); }
const float APVShot::median ( ) const

Definition at line 56 of file APVShot.cc.

References _median.

{ return _median; }
const int APVShot::nStrips ( ) const

Definition at line 54 of file APVShot.cc.

References _nstrips.

{ return _nstrips; }
const int APVShot::subDet ( ) const

Definition at line 58 of file APVShot.cc.

References _detid, and DetId::subdetId().

{ return _detid.subdetId(); }

Member Data Documentation

int APVShot::_apv [private]

Definition at line 29 of file APVShot.h.

Referenced by apvNumber(), and computeShot().

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 [static, private]

Definition at line 34 of file APVShot.h.

Referenced by isGenuine().

bool APVShot::_zs [private]

Definition at line 28 of file APVShot.h.

Referenced by computeShot().