CMS 3D CMS Logo

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

#include <APVShotFinder.h>

Public Member Functions

 APVShotFinder (const bool zs=true)
 
 APVShotFinder (const edm::DetSet< SiStripDigi > &digis, const bool zs=true)
 
 APVShotFinder (const edm::DetSetVector< SiStripDigi > &digicoll, const bool zs=true)
 
void computeShots (const edm::DetSet< SiStripDigi > &digis)
 
void computeShots (const edm::DetSetVector< SiStripDigi > &digicoll)
 
const std::vector< APVShot > & getShots () const
 

Private Member Functions

void addShots (const edm::DetSet< SiStripDigi > &digis)
 

Private Attributes

std::vector< APVShot_shots
 
bool _zs
 

Detailed Description

Definition at line 16 of file APVShotFinder.h.

Constructor & Destructor Documentation

◆ APVShotFinder() [1/3]

APVShotFinder::APVShotFinder ( const bool  zs = true)

Definition at line 10 of file APVShotFinder.cc.

10 : _zs(zs), _shots() {}

◆ APVShotFinder() [2/3]

APVShotFinder::APVShotFinder ( const edm::DetSet< SiStripDigi > &  digis,
const bool  zs = true 
)

Definition at line 12 of file APVShotFinder.cc.

12  : _zs(zs), _shots() {
13  computeShots(digis);
14 }

References computeShots().

◆ APVShotFinder() [3/3]

APVShotFinder::APVShotFinder ( const edm::DetSetVector< SiStripDigi > &  digicoll,
const bool  zs = true 
)

Definition at line 16 of file APVShotFinder.cc.

16  : _zs(zs), _shots() {
17  computeShots(digicoll);
18 }

References computeShots().

Member Function Documentation

◆ addShots()

void APVShotFinder::addShots ( const edm::DetSet< SiStripDigi > &  digis)
private

Definition at line 33 of file APVShotFinder.cc.

33  {
34  DetId detid(digis.detId());
35 
36  int laststrip = -1;
37  int apv = -1;
38  std::vector<SiStripDigi> temp;
39 
40  for (edm::DetSet<SiStripDigi>::const_iterator digi = digis.begin(); digi != digis.end(); digi++) {
41  if (!_zs || digi->adc() > 0) {
42  if (laststrip >= digi->strip())
43  edm::LogWarning("StripNotInOrder") << "Strips not in order in DetSet<SiStripDigi>";
44  laststrip = digi->strip();
45 
46  int newapv = digi->strip() / 128;
47  if (newapv != apv) {
48  if (apv >= 0) {
49  if (temp.size() > 64) {
50  APVShot shot(temp, detid, _zs);
51  _shots.push_back(shot);
52  }
53  temp.clear();
54  }
55  apv = newapv;
56  }
57 
58  temp.push_back(*digi);
59  }
60  }
61  // last strip
62  if (temp.size() > 64) {
63  APVShot shot(temp, detid, _zs);
64  _shots.push_back(shot);
65  }
66  temp.clear();
67 }

References _shots, _zs, edm::DetSet< T >::begin(), edm::DetSet< T >::detId(), edm::DetSet< T >::end(), and groupFilesInBlocks::temp.

Referenced by computeShots().

◆ computeShots() [1/2]

void APVShotFinder::computeShots ( const edm::DetSet< SiStripDigi > &  digis)

Definition at line 20 of file APVShotFinder.cc.

20  {
21  _shots.clear();
22  addShots(digis);
23 }

References _shots, and addShots().

Referenced by APVShotFinder().

◆ computeShots() [2/2]

void APVShotFinder::computeShots ( const edm::DetSetVector< SiStripDigi > &  digicoll)

Definition at line 25 of file APVShotFinder.cc.

25  {
26  _shots.clear();
27 
28  for (edm::DetSetVector<SiStripDigi>::const_iterator it = digicoll.begin(); it != digicoll.end(); ++it) {
29  addShots(*it);
30  }
31 }

References _shots, addShots(), edm::DetSetVector< T >::begin(), and edm::DetSetVector< T >::end().

◆ getShots()

const std::vector< APVShot > & APVShotFinder::getShots ( ) const

Member Data Documentation

◆ _shots

std::vector<APVShot> APVShotFinder::_shots
private

Definition at line 31 of file APVShotFinder.h.

Referenced by addShots(), computeShots(), and getShots().

◆ _zs

bool APVShotFinder::_zs
private

Definition at line 30 of file APVShotFinder.h.

Referenced by addShots().

edm::DetSetVector::end
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:325
APVShot
Definition: APVShot.h:9
edm::DetSet::begin
iterator begin()
Definition: DetSet.h:57
edm::DetSetVector::begin
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:314
groupFilesInBlocks.temp
list temp
Definition: groupFilesInBlocks.py:142
DetId
Definition: DetId.h:17
APVShotFinder::_zs
bool _zs
Definition: APVShotFinder.h:30
edm::DetSetVector::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:102
APVShotFinder::addShots
void addShots(const edm::DetSet< SiStripDigi > &digis)
Definition: APVShotFinder.cc:33
edm::DetSet::detId
det_id_type detId() const
Definition: DetSet.h:74
APVShotFinder::_shots
std::vector< APVShot > _shots
Definition: APVShotFinder.h:31
edm::DetSet::end
iterator end()
Definition: DetSet.h:58
edm::Log
Definition: MessageLogger.h:70
APVShotFinder::computeShots
void computeShots(const edm::DetSet< SiStripDigi > &digis)
Definition: APVShotFinder.cc:20
edm::DetSet::const_iterator
collection_type::const_iterator const_iterator
Definition: DetSet.h:31