CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
GEMPadDigiProducer Class Reference
Inheritance diagram for GEMPadDigiProducer:
edm::stream::EDProducer<>

Public Member Functions

void beginRun (const edm::Run &, const edm::EventSetup &) override
 
 GEMPadDigiProducer (const edm::ParameterSet &ps)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~GEMPadDigiProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void buildPads (const GEMDigiCollection &digis, GEMPadDigiCollection &out_pads) const
 
void buildPads16GE21 (const GEMDigiCollection &digis, GEMPadDigiCollection &out_pads) const
 
void checkGeometry () const
 
void checkValid (const GEMPadDigi &pad, const GEMDetId &id) const
 

Private Attributes

edm::EDGetTokenT< GEMDigiCollectiondigi_token_
 Name of input digi Collection. More...
 
edm::InputTag digis_
 
edm::ESGetToken< GEMGeometry, MuonGeometryRecordgeom_token_
 
const GEMGeometrygeometry_
 
bool use16GE21_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

producer for GEM trigger pads

Definition at line 25 of file GEMPadDigiProducer.cc.

Constructor & Destructor Documentation

◆ GEMPadDigiProducer()

GEMPadDigiProducer::GEMPadDigiProducer ( const edm::ParameterSet ps)
explicit

Definition at line 52 of file GEMPadDigiProducer.cc.

52  : geometry_(nullptr) {
53  digis_ = ps.getParameter<edm::InputTag>("InputCollection");
54 
55  digi_token_ = consumes<GEMDigiCollection>(digis_);
56  geom_token_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
57 
58  produces<GEMPadDigiCollection>();
59  consumes<GEMDigiCollection>(digis_);
60 }

References digi_token_, digis_, geom_token_, and edm::ParameterSet::getParameter().

◆ ~GEMPadDigiProducer()

GEMPadDigiProducer::~GEMPadDigiProducer ( )
override

Definition at line 62 of file GEMPadDigiProducer.cc.

62 {}

Member Function Documentation

◆ beginRun()

void GEMPadDigiProducer::beginRun ( const edm::Run run,
const edm::EventSetup eventSetup 
)
override

Definition at line 71 of file GEMPadDigiProducer.cc.

71  {
73  geometry_ = &*hGeom;
74  // check the number of parititions
75  if (geometry_->hasGE21()) {
76  use16GE21_ = (geometry_->chamber(GEMDetId(1, 1, 2, 1, 1, 0))->nEtaPartitions() ==
77  GEMPadDigi::NumberPartitions::GE21SplitStrip);
78  }
79 
80  checkGeometry();
81 }

References GEMGeometry::chamber(), checkGeometry(), geom_token_, geometry_, edm::EventSetup::getHandle(), GEMGeometry::hasGE21(), GEMChamber::nEtaPartitions(), and use16GE21_.

◆ buildPads()

void GEMPadDigiProducer::buildPads ( const GEMDigiCollection digis,
GEMPadDigiCollection out_pads 
) const
private

Definition at line 99 of file GEMPadDigiProducer.cc.

99  {
100  for (const auto& p : geometry_->etaPartitions()) {
101  // when using the GE2/1 geometry with 16 eta partitions
102  // ->ignore GE2/1
103  if (use16GE21_ and p->isGE21())
104  continue;
105 
106  // set of <pad, bx, part> pairs, sorted first by pad then by bx
107  std::set<std::tuple<int, int, unsigned> > proto_pads;
108 
109  // walk over digis in this partition,
110  // and stuff them into a set of unique pads (equivalent of OR operation)
111  auto digis = det_digis.get(p->id());
112  for (auto d = digis.first; d != digis.second; ++d) {
113  unsigned pad_num = static_cast<unsigned>(p->padOfStrip(d->strip()));
114 
115  auto nPart = GEMPadDigi::NumberPartitions::GE11;
116  if (p->isME0()) {
118  } else if (p->isGE21()) {
119  nPart = GEMPadDigi::NumberPartitions::GE21;
120  }
121  // check that the input digi is valid
122  if ((p->isGE11() and pad_num == GEMPadDigi::GE11InValid) or
123  (p->isGE21() and pad_num == GEMPadDigi::GE21InValid) or (p->isME0() and pad_num == GEMPadDigi::ME0InValid)) {
124  edm::LogWarning("GEMPadDigiProducer") << "Invalid " << pad_num << " from " << *d << " in " << p->id();
125  }
126  proto_pads.emplace(pad_num, d->bx(), nPart);
127  }
128 
129  // fill the output collections
130  for (const auto& d : proto_pads) {
131  GEMPadDigi pad_digi(std::get<0>(d), std::get<1>(d), p->subsystem(), std::get<2>(d));
132  checkValid(pad_digi, p->id());
133  out_pads.insertDigi(p->id(), pad_digi);
134  }
135  }
136 }

References checkValid(), ztail::d, GEMGeometry::etaPartitions(), GEMPadDigi::GE11InValid, GEMPadDigi::GE21InValid, geometry_, l1t::mtf7::ME0, GEMPadDigi::ME0InValid, nPart(), or, AlCaHLTBitMon_ParallelJobs::p, and use16GE21_.

Referenced by produce().

◆ buildPads16GE21()

void GEMPadDigiProducer::buildPads16GE21 ( const GEMDigiCollection digis,
GEMPadDigiCollection out_pads 
) const
private

Definition at line 138 of file GEMPadDigiProducer.cc.

138  {
139  for (const auto& p : geometry_->etaPartitions()) {
140  // when using the GE2/1 geometry with 16 eta partitions
141  // ->ignore GE1/1
142  if (!p->isGE21())
143  continue;
144 
145  // ignore eta partition with even numbers
146  // these are included in the odd numbered pads
147  if (p->id().roll() % 2 == 0)
148  continue;
149 
150  // set of <pad, bx> pairs, sorted first by pad then by bx
151  std::set<std::pair<int, int> > proto_pads;
152 
153  // walk over digis in the first partition,
154  // and stuff them into a set of unique pads (equivalent of OR operation)
155  auto digis = det_digis.get(p->id());
156 
157  GEMDetId gemId2(
158  p->id().region(), p->id().ring(), p->id().station(), p->id().layer(), p->id().chamber(), p->id().roll() + 1);
159  auto digis2 = det_digis.get(gemId2);
160 
161  for (auto d = digis.first; d != digis.second; ++d) {
162  // check if the strip digi in the eta partition below also has a digi
163  for (auto d2 = digis2.first; d2 != digis2.second; ++d2) {
164  if (d->strip() == d2->strip()) {
165  proto_pads.emplace(d->strip(), d->bx());
166  }
167  }
168  }
169 
170  // fill the output collections
171  for (const auto& d : proto_pads) {
172  GEMPadDigi pad_digi(d.first, d.second, p->subsystem(), GEMPadDigi::NumberPartitions::GE21SplitStrip);
173  checkValid(pad_digi, p->id());
174  out_pads.insertDigi(p->id(), pad_digi);
175  }
176  }
177 }

References checkValid(), ztail::d, GEMGeometry::etaPartitions(), geometry_, and AlCaHLTBitMon_ParallelJobs::p.

Referenced by produce().

◆ checkGeometry()

void GEMPadDigiProducer::checkGeometry ( ) const
private

Definition at line 187 of file GEMPadDigiProducer.cc.

187  {
188  // check that ME0 has 8-eta partitions
189  if (geometry_->hasME0()) {
191  edm::LogError("GEMPadDigiProducer") << "ME0 geometry appears corrupted";
192  }
193  }
194 
195  // check that GE1/1 has 8-eta partitions
196  if (geometry_->hasGE11()) {
197  if (geometry_->chamber(GEMDetId(1, 1, 1, 1, 1, 0))->nEtaPartitions() != GEMPadDigi::NumberPartitions::GE11) {
198  edm::LogError("GEMPadDigiProducer") << "GE1/1 geometry appears corrupted";
199  }
200  }
201 
202  if (geometry_->hasGE21()) {
203  if (!use16GE21_) {
204  // check that GE2/1 has 8-eta partitions
205  if (geometry_->chamber(GEMDetId(1, 1, 2, 1, 1, 0))->nEtaPartitions() != GEMPadDigi::NumberPartitions::GE21) {
206  edm::LogError("GEMPadDigiProducer") << "GE2/1 geometry (8 partition) appears corrupted";
207  }
208  } else {
209  // check that GE2/1 has 16-eta partitions
210  if (geometry_->chamber(GEMDetId(1, 1, 2, 1, 1, 0))->nEtaPartitions() !=
211  GEMPadDigi::NumberPartitions::GE21SplitStrip) {
212  edm::LogError("GEMPadDigiProducer") << "GE2/1 geometry (16 partition) appears corrupted";
213  }
214  }
215  }
216 }

References GEMGeometry::chamber(), geometry_, GEMGeometry::hasGE11(), GEMGeometry::hasGE21(), GEMGeometry::hasME0(), l1t::mtf7::ME0, GEMChamber::nEtaPartitions(), and use16GE21_.

Referenced by beginRun().

◆ checkValid()

void GEMPadDigiProducer::checkValid ( const GEMPadDigi pad,
const GEMDetId id 
) const
private

Definition at line 179 of file GEMPadDigiProducer.cc.

179  {
180  // check if the pad is valid
181  // in principle, invalid pads can appear in the CMS raw data
182  if (!pad.isValid()) {
183  edm::LogWarning("GEMPadDigiProducer") << "Invalid " << pad << " in " << id;
184  }
185 }

References triggerObjects_cff::id, and GEMPadDigi::isValid().

Referenced by buildPads(), and buildPads16GE21().

◆ fillDescriptions()

void GEMPadDigiProducer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 64 of file GEMPadDigiProducer.cc.

64  {
66  desc.add<edm::InputTag>("InputCollection", edm::InputTag("simMuonGEMDigis"));
67 
68  descriptions.add("simMuonGEMPadDigisDef", desc);
69 }

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and HLT_FULL_cff::InputTag.

◆ produce()

void GEMPadDigiProducer::produce ( edm::Event e,
const edm::EventSetup eventSetup 
)
override

Definition at line 83 of file GEMPadDigiProducer.cc.

83  {
85  e.getByToken(digi_token_, hdigis);
86 
87  // Create empty output
88  std::unique_ptr<GEMPadDigiCollection> pPads(new GEMPadDigiCollection());
89 
90  // build the pads
91  buildPads(*(hdigis.product()), *pPads);
92  if (use16GE21_)
93  buildPads16GE21(*(hdigis.product()), *pPads);
94 
95  // store them in the event
96  e.put(std::move(pPads));
97 }

References buildPads(), buildPads16GE21(), digi_token_, MillePedeFileConverter_cfg::e, eostools::move(), edm::Handle< T >::product(), and use16GE21_.

Member Data Documentation

◆ digi_token_

edm::EDGetTokenT<GEMDigiCollection> GEMPadDigiProducer::digi_token_
private

Name of input digi Collection.

Definition at line 44 of file GEMPadDigiProducer.cc.

Referenced by GEMPadDigiProducer(), and produce().

◆ digis_

edm::InputTag GEMPadDigiProducer::digis_
private

Definition at line 46 of file GEMPadDigiProducer.cc.

Referenced by GEMPadDigiProducer().

◆ geom_token_

edm::ESGetToken<GEMGeometry, MuonGeometryRecord> GEMPadDigiProducer::geom_token_
private

Definition at line 45 of file GEMPadDigiProducer.cc.

Referenced by beginRun(), and GEMPadDigiProducer().

◆ geometry_

const GEMGeometry* GEMPadDigiProducer::geometry_
private

Definition at line 49 of file GEMPadDigiProducer.cc.

Referenced by beginRun(), buildPads(), buildPads16GE21(), and checkGeometry().

◆ use16GE21_

bool GEMPadDigiProducer::use16GE21_
private

Definition at line 47 of file GEMPadDigiProducer.cc.

Referenced by beginRun(), buildPads(), checkGeometry(), and produce().

GEMPadDigiProducer::checkValid
void checkValid(const GEMPadDigi &pad, const GEMDetId &id) const
Definition: GEMPadDigiProducer.cc:179
l1t::mtf7::ME0
ME0 Data Record : block->header().getID() = 6.
Definition: Block.h:23
GEMPadDigi::ME0InValid
Definition: GEMPadDigi.h:19
GEMPadDigiProducer::use16GE21_
bool use16GE21_
Definition: GEMPadDigiProducer.cc:47
edm::Handle::product
T const * product() const
Definition: Handle.h:70
GEMPadDigi
Definition: GEMPadDigi.h:17
GEMPadDigi::GE11InValid
Definition: GEMPadDigi.h:19
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GEMPadDigiCollection
MuonDigiCollection< GEMDetId, GEMPadDigi > GEMPadDigiCollection
Definition: GEMPadDigiCollection.h:13
GEMGeometry::hasME0
bool hasME0() const
Definition: GEMGeometry.cc:111
edm::Handle< GEMDigiCollection >
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
GEMPadDigiProducer::checkGeometry
void checkGeometry() const
Definition: GEMPadDigiProducer.cc:187
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle< GEMGeometry >
GEMPadDigiProducer::digi_token_
edm::EDGetTokenT< GEMDigiCollection > digi_token_
Name of input digi Collection.
Definition: GEMPadDigiProducer.cc:44
nPart
TString nPart(Int_t part, TString string, TString delimit=";", Bool_t removerest=true)
GEMPadDigiProducer::buildPads16GE21
void buildPads16GE21(const GEMDigiCollection &digis, GEMPadDigiCollection &out_pads) const
Definition: GEMPadDigiProducer.cc:138
GEMDetId
Definition: GEMDetId.h:18
GEMPadDigiProducer::buildPads
void buildPads(const GEMDigiCollection &digis, GEMPadDigiCollection &out_pads) const
Definition: GEMPadDigiProducer.cc:99
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:148
GEMGeometry::hasGE21
bool hasGE21() const
Definition: GEMGeometry.cc:115
GEMPadDigi::GE21InValid
Definition: GEMPadDigi.h:19
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
GEMGeometry::hasGE11
bool hasGE11() const
Definition: GEMGeometry.cc:113
GEMPadDigiProducer::geometry_
const GEMGeometry * geometry_
Definition: GEMPadDigiProducer.cc:49
GEMChamber::nEtaPartitions
int nEtaPartitions() const
Retunr numbers of eta partitions.
Definition: GEMChamber.cc:31
GEMPadDigiProducer::digis_
edm::InputTag digis_
Definition: GEMPadDigiProducer.cc:46
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
GEMGeometry::etaPartitions
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
Definition: GEMGeometry.cc:40
ztail.d
d
Definition: ztail.py:151
GEMPadDigi::isValid
bool isValid() const
Definition: GEMPadDigi.cc:26
GEMGeometry::chamber
const GEMChamber * chamber(GEMDetId id) const
Definition: GEMGeometry.cc:73
edm::InputTag
Definition: InputTag.h:15
GEMPadDigiProducer::geom_token_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geom_token_
Definition: GEMPadDigiProducer.cc:45
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37