CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
GEMPadDigiReader Class Reference
Inheritance diagram for GEMPadDigiReader:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase 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::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeomToken_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, 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)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 26 of file GEMPadDigiReader.cc.

Constructor & Destructor Documentation

◆ GEMPadDigiReader()

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

Definition at line 40 of file GEMPadDigiReader.cc.

41  : gemDigiToken_(consumes<GEMDigiCollection>(pset.getParameter<edm::InputTag>("gemDigiToken"))),
42  gemPadToken_(consumes<GEMPadDigiCollection>(pset.getParameter<edm::InputTag>("gemPadToken"))),
43  geomToken_(esConsumes<GEMGeometry, MuonGeometryRecord>()) {}
edm::EDGetTokenT< GEMPadDigiCollection > gemPadToken_
edm::EDGetTokenT< GEMDigiCollection > gemDigiToken_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_

◆ ~GEMPadDigiReader()

GEMPadDigiReader::~GEMPadDigiReader ( )
inlineoverride

Definition at line 30 of file GEMPadDigiReader.cc.

30 {}

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 45 of file GEMPadDigiReader.cc.

References filterCSVwithJSON::copy, gather_cfg::cout, ztail::d, options_cfi::eventSetup, gemDigiToken_, gemPadToken_, geomToken_, AlCaHLTBitMon_ParallelJobs::p, alignCSCRings::s, and DigiDM_cff::strips.

45  {
46  //cout << "--- Run: " << event.id().run() << " Event: " << event.id().event() << endl;
47 
49 
51  event.getByToken(gemDigiToken_, digis);
52 
54  event.getByToken(gemPadToken_, pads);
55 
56  if (pads->begin() == pads->end())
57  return; // no pads in event
58 
59  for (auto pad_range_it = pads->begin(); pad_range_it != pads->end(); ++pad_range_it) {
60  const auto& id = (*pad_range_it).first;
61  const auto& roll = geometry->etaPartition(id);
62 
63  // GEMDetId print-out
64  cout << "--------------" << endl;
65  //cout<<"id: "<<id.rawId()<<" #strips "<<roll->nstrips()<<" #pads "<<roll->npads()<<endl;
66 
67  // retrieve this DetUnit's digis
68  std::map<std::pair<int, int>, // #pad (starting from 1), BX
69  std::vector<int> // digi strip numbers (starting from 1)
70  >
71  digi_map;
72  auto digis_in_det = digis->get(id);
73  cout << "strip digis in detid: ";
74  for (auto d = digis_in_det.first; d != digis_in_det.second; ++d) {
75  int pad_num = 1 + static_cast<int>(roll->padOfStrip(d->strip())); // d->strip() is int
76  digi_map[{pad_num, d->bx()}].push_back(d->strip());
77  cout << " (" << d->strip() << "," << d->bx() << ") -> " << pad_num;
78  }
79  cout << endl;
80 
81  // loop over pads of this DetUnit and print stuff
82  auto pads_range = (*pad_range_it).second;
83  for (auto p = pads_range.first; p != pads_range.second; ++p) {
84  int first_strip = roll->firstStripInPad(p->pad()); // p->pad() is int, firstStripInPad returns int
85  int last_strip = roll->lastStripInPad(p->pad());
86 
87  if (p->pad() < 1 || p->pad() > roll->npads()) {
88  cout << " XXXXXXXXXXXXX Problem! " << id << " has pad digi with too large pad# = " << p->pad() << endl;
89  }
90 
91  auto& strips = digi_map[{p->pad(), p->bx()}];
92  std::vector<int> pads_strips;
93  remove_copy_if(
94  strips.begin(), strips.end(), inserter(pads_strips, pads_strips.end()), [first_strip, last_strip](int s) {
95  return s < first_strip || s > last_strip;
96  });
97  cout << id << " paddigi(pad,bx) " << *p << " has " << pads_strips.size() << " strip digis strips in range ["
98  << first_strip << "," << last_strip << "]: ";
99  copy(pads_strips.begin(), pads_strips.end(), ostream_iterator<int>(cout, " "));
100  cout << endl;
101  }
102 
103  } // for (detids with pads)
104 }
edm::EDGetTokenT< GEMPadDigiCollection > gemPadToken_
edm::EDGetTokenT< GEMDigiCollection > gemDigiToken_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geomToken_
d
Definition: ztail.py:151
strips
#turn off noise in all subdetectors simHcalUnsuppressedDigis.doNoise = False mix.digitizers.hcal.doNoise = False simEcalUnsuppressedDigis.doNoise = False mix.digitizers.ecal.doNoise = False simEcalUnsuppressedDigis.doESNoise = False simSiPixelDigis.AddNoise = False mix.digitizers.pixel.AddNoise = False simSiStripDigis.Noise = False mix.digitizers.strip.AddNoise = False
Definition: DigiDM_cff.py:32

Member Data Documentation

◆ gemDigiToken_

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

Definition at line 35 of file GEMPadDigiReader.cc.

Referenced by analyze().

◆ gemPadToken_

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

Definition at line 36 of file GEMPadDigiReader.cc.

Referenced by analyze().

◆ geomToken_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMPadDigiReader::geomToken_
private

Definition at line 37 of file GEMPadDigiReader.cc.

Referenced by analyze().