CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 10 of file DebugDigisPrintout.h.

Member Function Documentation

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

Definition at line 26 of file DebugDigisPrintout.h.

References RPCDigi::bx(), spr::find(), DetId::rawId(), python.multivaluedict::sort(), and RPCDigi::strip().

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