CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
APVShotFinder.cc
Go to the documentation of this file.
1 #include <vector>
9 
11  _zs(zs), _shots() { }
12 
14  _zs(zs), _shots() {
15 
16  computeShots(digis);
17 
18 }
19 
21  _zs(zs), _shots() {
22 
23  computeShots(digicoll);
24 
25 }
26 
28 
29  _shots.clear();
30  addShots(digis);
31 
32 }
33 
35 
36  _shots.clear();
37 
39  it!=digicoll.end();++it) {
40 
41  addShots(*it);
42  }
43 
44 }
45 
47 
48  DetId detid(digis.detId());
49 
50  int laststrip = -1;
51  int apv = -1;
52  std::vector<SiStripDigi> temp;
53 
54  for(edm::DetSet<SiStripDigi>::const_iterator digi=digis.begin();digi!=digis.end();digi++) {
55 
56  if(!_zs || digi->adc()>0) {
57  if(laststrip >= digi->strip()) edm::LogWarning("StripNotInOrder") << "Strips not in order in DetSet<SiStripDigi>";
58  laststrip = digi->strip();
59 
60  int newapv = digi->strip()/128;
61  if( newapv!=apv) {
62  if(apv>=0) {
63  if(temp.size() > 64) {
64  APVShot shot(temp,detid,_zs);
65  _shots.push_back(shot);
66  }
67  temp.clear();
68  }
69  apv = newapv;
70  }
71 
72  temp.push_back(*digi);
73  }
74  }
75  // last strip
76  if(temp.size() > 64) {
77  APVShot shot(temp,detid,_zs);
78  _shots.push_back(shot);
79  }
80  temp.clear();
81 
82 }
83 
84 const std::vector<APVShot>& APVShotFinder::getShots() const { return _shots; }
85 
86 
iterator end()
Definition: DetSet.h:61
void computeShots(const edm::DetSet< SiStripDigi > &digis)
det_id_type detId() const
Definition: DetSet.h:73
APVShotFinder(const bool zs=true)
void addShots(const edm::DetSet< SiStripDigi > &digis)
const std::vector< APVShot > & getShots() const
iterator end()
Return the off-the-end iterator.
Definition: DetSetVector.h:356
iterator begin()
Definition: DetSet.h:60
Definition: DetId.h:20
iterator begin()
Return an iterator to the first DetSet.
Definition: DetSetVector.h:341
collection_type::const_iterator const_iterator
Definition: DetSet.h:34
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:106
std::vector< APVShot > _shots
Definition: APVShotFinder.h:32