CMS 3D CMS Logo

Classes | Public Member Functions

rpcrawtodigi::DebugDigisPrintout Class Reference

#include <DebugDigisPrintout.h>

List of all members.

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().

                                                          {
      std::ostringstream str;
      str << "DebugDigisPrintout:";
      if (!digis) return str.str();
      typedef  DigiContainerIterator<RPCDetId, RPCDigi> DigiRangeIterator;
      std::vector<MyDigi> myDigis;

      int nDet = 0;
      int nDigisAll = 0;
      for (DigiRangeIterator it=digis->begin(); it != digis->end(); it++) {
        nDet++;
        RPCDetId rpcDetId = (*it).first;
        uint32_t rawDetId = rpcDetId.rawId();
        RPCDigiCollection::Range range = digis->get(rpcDetId);
        for (std::vector<RPCDigi>::const_iterator  id = range.first; id != range.second; id++) {
          nDigisAll++;
          const RPCDigi & digi = (*id);
          MyDigi myDigi = { rawDetId, digi.strip(), digi.bx() };
          if (myDigis.end() == std::find(myDigis.begin(), myDigis.end(), myDigi)) 
              myDigis.push_back(myDigi);
        } 
      }
      std::sort(myDigis.begin(),myDigis.end());
      str << " dets: "<<nDet<<" allDigis: "<<nDigisAll<<" unigueDigis: "<<myDigis.size()<<std::endl;
      for (std::vector<MyDigi>::const_iterator it = myDigis.begin(); it != myDigis.end(); ++it)
           str << "debugDIGI: "<< it->det<<", "<<it->strip<<", "<<it->bx<<std::endl;
      return str.str();
    }