CMS 3D CMS Logo

DebugDigisPrintout.h
Go to the documentation of this file.
1 #ifndef EventFilter_RPCRawToDigi_debugDigisPrintout_h
2 #define EventFilter_RPCRawToDigi_debugDigisPrintout_h
3 
4 #include <algorithm>
5 #include <string>
6 #include <sstream>
7 #include <vector>
9 
10 namespace rpcrawtodigi {
12  struct MyDigi {
13  uint32_t det;
14  int strip;
15  int bx;
16  bool operator==(const MyDigi& o) const { return (det == o.det && strip == o.strip && bx == o.bx); }
17  bool operator<(const MyDigi& o) const {
18  if (this->det < o.det)
19  return true;
20  if (this->det > o.det)
21  return false;
22  if (this->strip < o.strip)
23  return true;
24  return false;
25  }
26  };
27 
28  public:
30  std::ostringstream str;
31  str << "DebugDigisPrintout:";
32  if (!digis)
33  return str.str();
34  typedef DigiContainerIterator<RPCDetId, RPCDigi> DigiRangeIterator;
35  std::vector<MyDigi> myDigis;
36 
37  int nDet = 0;
38  int nDigisAll = 0;
39  for (DigiRangeIterator it = digis->begin(); it != digis->end(); it++) {
40  nDet++;
41  RPCDetId rpcDetId = (*it).first;
42  uint32_t rawDetId = rpcDetId.rawId();
43  RPCDigiCollection::Range range = digis->get(rpcDetId);
44  for (std::vector<RPCDigi>::const_iterator id = range.first; id != range.second; id++) {
45  nDigisAll++;
46  const RPCDigi& digi = (*id);
47  MyDigi myDigi = {rawDetId, digi.strip(), digi.bx()};
48  if (myDigis.end() == std::find(myDigis.begin(), myDigis.end(), myDigi))
49  myDigis.push_back(myDigi);
50  }
51  }
52  std::sort(myDigis.begin(), myDigis.end());
53  str << " dets: " << nDet << " allDigis: " << nDigisAll << " unigueDigis: " << myDigis.size() << std::endl;
54  for (std::vector<MyDigi>::const_iterator it = myDigis.begin(); it != myDigis.end(); ++it)
55  str << "debugDIGI: " << it->det << ", " << it->strip << ", " << it->bx << std::endl;
56  return str.str();
57  }
58  };
59 } // namespace rpcrawtodigi
60 #endif
FastTimerService_cff.range
range
Definition: FastTimerService_cff.py:34
rpcrawtodigi::DebugDigisPrintout::operator()
std::string operator()(const RPCDigiCollection *digis)
Definition: DebugDigisPrintout.h:29
RPCDetId
Definition: RPCDetId.h:16
rpcrawtodigi::DebugDigisPrintout::MyDigi::operator==
bool operator==(const MyDigi &o) const
Definition: DebugDigisPrintout.h:16
spr::find
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
rpcrawtodigi
Definition: DataRecord.h:9
EcalTangentSkim_cfg.o
o
Definition: EcalTangentSkim_cfg.py:36
RPCDigi::bx
int bx() const
Definition: RPCDigi.h:28
RPCDigiCollection
rpcrawtodigi::DebugDigisPrintout::MyDigi::bx
int bx
Definition: DebugDigisPrintout.h:15
str
#define str(s)
Definition: TestProcessor.cc:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
rpcrawtodigi::DebugDigisPrintout::MyDigi::strip
int strip
Definition: DebugDigisPrintout.h:14
RPCDigi::strip
int strip() const
Definition: RPCDigi.h:27
DetId::rawId
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
rpcrawtodigi::DebugDigisPrintout::MyDigi::det
uint32_t det
Definition: DebugDigisPrintout.h:13
RPCDigi
Definition: RPCDigi.h:19
MuonDigiCollection< RPCDetId, RPCDigi >::Range
std::pair< const_iterator, const_iterator > Range
Definition: MuonDigiCollection.h:95
RPCDigiCollection.h
rpcrawtodigi::DebugDigisPrintout
Definition: DebugDigisPrintout.h:11
DigiContainerIterator
Definition: MuonDigiCollection.h:30
rpcrawtodigi::DebugDigisPrintout::MyDigi::operator<
bool operator<(const MyDigi &o) const
Definition: DebugDigisPrintout.h:17
rpcrawtodigi::DebugDigisPrintout::MyDigi
Definition: DebugDigisPrintout.h:12