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 27 of file DebugDigisPrintout.h.

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

27  {
28  std::ostringstream str;
29  str << "DebugDigisPrintout:";
30  if (!digis) return str.str();
31  typedef DigiContainerIterator<RPCDetId, RPCDigi> DigiRangeIterator;
32  std::vector<MyDigi> myDigis;
33 
34  int nDet = 0;
35  int nDigisAll = 0;
36  for (DigiRangeIterator it=digis->begin(); it != digis->end(); it++) {
37  nDet++;
38  RPCDetId rpcDetId = (*it).first;
39  uint32_t rawDetId = rpcDetId.rawId();
40  RPCDigiCollection::Range range = digis->get(rpcDetId);
41  for (std::vector<RPCDigi>::const_iterator id = range.first; id != range.second; id++) {
42  nDigisAll++;
43  const RPCDigi & digi = (*id);
44  MyDigi myDigi = { rawDetId, digi.strip(), digi.bx() };
45  if (myDigis.end() == std::find(myDigis.begin(), myDigis.end(), myDigi))
46  myDigis.push_back(myDigi);
47  }
48  }
49  std::sort(myDigis.begin(),myDigis.end());
50  str << " dets: "<<nDet<<" allDigis: "<<nDigisAll<<" unigueDigis: "<<myDigis.size()<<std::endl;
51  for (std::vector<MyDigi>::const_iterator it = myDigis.begin(); it != myDigis.end(); ++it)
52  str << "debugDIGI: "<< it->det<<", "<<it->strip<<", "<<it->bx<<std::endl;
53  return str.str();
54  }
int bx() const
Definition: RPCDigi.h:29
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:47
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
int strip() const
Definition: RPCDigi.h:28
std::pair< const_iterator, const_iterator > Range
#define str(s)