CMS 3D CMS Logo

List of all members | Classes | Public Member Functions
rpcrawtodigi::DebugDigisPrintout Class Reference

#include <DebugDigisPrintout.h>

Classes

struct  MyDigi
 

Public Member Functions

std::string operator() (const RPCDigiCollection *digis)
 

Detailed Description

Definition at line 11 of file DebugDigisPrintout.h.

Member Function Documentation

std::string rpcrawtodigi::DebugDigisPrintout::operator() ( const RPCDigiCollection digis)
inline

Definition at line 29 of file DebugDigisPrintout.h.

References RPCDigi::bx(), spr::find(), FastTimerService_cff::range, DetId::rawId(), str, and RPCDigi::strip().

29  {
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  }
int bx() const
Definition: RPCDigi.h:28
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:19
int strip() const
Definition: RPCDigi.h:27
std::pair< const_iterator, const_iterator > Range
#define str(s)