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

◆ operator()()

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

Definition at line 29 of file DebugDigisPrintout.h.

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