CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMPadDigiReader Class Reference
Inheritance diagram for GEMPadDigiReader:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 GEMPadDigiReader (const edm::ParameterSet &pset)
 
 ~GEMPadDigiReader () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< GEMDigiCollectiongemDigiToken_
 
edm::EDGetTokenT< GEMPadDigiCollectiongemPadToken_
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 25 of file GEMPadDigiReader.cc.

Constructor & Destructor Documentation

◆ GEMPadDigiReader()

GEMPadDigiReader::GEMPadDigiReader ( const edm::ParameterSet pset)
explicit

Definition at line 38 of file GEMPadDigiReader.cc.

39  : gemDigiToken_(consumes<GEMDigiCollection>(pset.getParameter<edm::InputTag>("gemDigiToken"))),
40  gemPadToken_(consumes<GEMPadDigiCollection>(pset.getParameter<edm::InputTag>("gemPadToken"))) {}

◆ ~GEMPadDigiReader()

GEMPadDigiReader::~GEMPadDigiReader ( )
inlineoverride

Definition at line 29 of file GEMPadDigiReader.cc.

29 {}

Member Function Documentation

◆ analyze()

void GEMPadDigiReader::analyze ( const edm::Event event,
const edm::EventSetup eventSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 42 of file GEMPadDigiReader.cc.

42  {
43  //cout << "--- Run: " << event.id().run() << " Event: " << event.id().event() << endl;
44 
46  eventSetup.get<MuonGeometryRecord>().get(geometry);
47 
49  event.getByToken(gemDigiToken_, digis);
50 
52  event.getByToken(gemPadToken_, pads);
53 
54  if (pads->begin() == pads->end())
55  return; // no pads in event
56 
57  for (auto pad_range_it = pads->begin(); pad_range_it != pads->end(); ++pad_range_it) {
58  const auto& id = (*pad_range_it).first;
59  const auto& roll = geometry->etaPartition(id);
60 
61  // GEMDetId print-out
62  cout << "--------------" << endl;
63  //cout<<"id: "<<id.rawId()<<" #strips "<<roll->nstrips()<<" #pads "<<roll->npads()<<endl;
64 
65  // retrieve this DetUnit's digis
66  std::map<std::pair<int, int>, // #pad (starting from 1), BX
67  std::vector<int> // digi strip numbers (starting from 1)
68  >
69  digi_map;
70  auto digis_in_det = digis->get(id);
71  cout << "strip digis in detid: ";
72  for (auto d = digis_in_det.first; d != digis_in_det.second; ++d) {
73  int pad_num = 1 + static_cast<int>(roll->padOfStrip(d->strip())); // d->strip() is int
74  digi_map[{pad_num, d->bx()}].push_back(d->strip());
75  cout << " (" << d->strip() << "," << d->bx() << ") -> " << pad_num;
76  }
77  cout << endl;
78 
79  // loop over pads of this DetUnit and print stuff
80  auto pads_range = (*pad_range_it).second;
81  for (auto p = pads_range.first; p != pads_range.second; ++p) {
82  int first_strip = roll->firstStripInPad(p->pad()); // p->pad() is int, firstStripInPad returns int
83  int last_strip = roll->lastStripInPad(p->pad());
84 
85  if (p->pad() < 1 || p->pad() > roll->npads()) {
86  cout << " XXXXXXXXXXXXX Problem! " << id << " has pad digi with too large pad# = " << p->pad() << endl;
87  }
88 
89  auto& strips = digi_map[{p->pad(), p->bx()}];
90  std::vector<int> pads_strips;
91  remove_copy_if(
92  strips.begin(), strips.end(), inserter(pads_strips, pads_strips.end()), [first_strip, last_strip](int s) {
93  return s < first_strip || s > last_strip;
94  });
95  cout << id << " paddigi(pad,bx) " << *p << " has " << pads_strips.size() << " strip digis strips in range ["
96  << first_strip << "," << last_strip << "]: ";
97  copy(pads_strips.begin(), pads_strips.end(), ostream_iterator<int>(cout, " "));
98  cout << endl;
99  }
100 
101  } // for (detids with pads)
102 }

References filterCSVwithJSON::copy, gather_cfg::cout, ztail::d, gemDigiToken_, gemPadToken_, geometry, edm::EventSetup::get(), get, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::s, and DigiDM_cff::strips.

Member Data Documentation

◆ gemDigiToken_

edm::EDGetTokenT<GEMDigiCollection> GEMPadDigiReader::gemDigiToken_
private

Definition at line 34 of file GEMPadDigiReader.cc.

Referenced by analyze().

◆ gemPadToken_

edm::EDGetTokenT<GEMPadDigiCollection> GEMPadDigiReader::gemPadToken_
private

Definition at line 35 of file GEMPadDigiReader.cc.

Referenced by analyze().

geometry
ESHandle< TrackerGeometry > geometry
Definition: TkLasBeamFitter.cc:200
filterCSVwithJSON.copy
copy
Definition: filterCSVwithJSON.py:36
GEMPadDigiReader::gemPadToken_
edm::EDGetTokenT< GEMPadDigiCollection > gemPadToken_
Definition: GEMPadDigiReader.cc:35
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
gather_cfg.cout
cout
Definition: gather_cfg.py:144
geometry
Definition: geometry.py:1
edm::Handle< GEMDigiCollection >
alignCSCRings.s
s
Definition: alignCSCRings.py:92
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ESHandle< GEMGeometry >
get
#define get
GEMPadDigiReader::gemDigiToken_
edm::EDGetTokenT< GEMDigiCollection > gemDigiToken_
Definition: GEMPadDigiReader.cc:34
ztail.d
d
Definition: ztail.py:151
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
DigiDM_cff.strips
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers....
Definition: DigiDM_cff.py:32
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27