CMS 3D CMS Logo

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

Public Types

typedef std::map< GEMDetId, GEMPadDigiClustersGEMPadDigiClusterContainer
 
typedef std::vector< GEMPadDigiClusterGEMPadDigiClusters
 
typedef std::map< GEMDetId, std::vector< std::vector< std::pair< GEMDetId, GEMPadDigiClusters > > > > GEMPadDigiClusterSortedContainer
 
- 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
 

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void buildClusters (const GEMPadDigiCollection &pads, GEMPadDigiClusterContainer &out_clusters) const
 
void selectClusters (const GEMPadDigiClusterSortedContainer &in, GEMPadDigiClusterCollection &out) const
 
void sortClusters (const GEMPadDigiClusterContainer &in_clusters, GEMPadDigiClusterSortedContainer &out_clusters) const
 

Private Attributes

const GEMGeometrygeometry_
 
unsigned int maxClusterSize_
 
unsigned int maxClustersOHGE11_
 
unsigned int maxClustersOHGE21_
 
unsigned int nOHGE11_
 
unsigned int nOHGE21_
 
edm::EDGetTokenT< GEMPadDigiCollectionpad_token_
 Name of input digi Collection. More...
 
edm::InputTag pads_
 

Detailed Description

Produces GEM pad clusters from at most 8 adjacent GEM pads. Clusters are used downstream in the CSC local trigger to build GEM-CSC triggers and in the muon trigger to build EMTF tracks

Based on documentation provided by the GEM firmware architects

Author
Sven Dildick (TAMU)

Definition at line 38 of file GEMPadDigiClusterProducer.cc.

Member Typedef Documentation

◆ GEMPadDigiClusterContainer

Definition at line 42 of file GEMPadDigiClusterProducer.cc.

◆ GEMPadDigiClusters

Definition at line 41 of file GEMPadDigiClusterProducer.cc.

◆ GEMPadDigiClusterSortedContainer

typedef std::map<GEMDetId, std::vector<std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > > > GEMPadDigiClusterProducer::GEMPadDigiClusterSortedContainer

Definition at line 46 of file GEMPadDigiClusterProducer.cc.

Constructor & Destructor Documentation

◆ GEMPadDigiClusterProducer()

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

Definition at line 115 of file GEMPadDigiClusterProducer.cc.

115  : geometry_(nullptr) {
116  pads_ = ps.getParameter<edm::InputTag>("InputCollection");
117  maxClustersOHGE11_ = ps.getParameter<unsigned int>("maxClustersOHGE11");
118  maxClustersOHGE21_ = ps.getParameter<unsigned int>("maxClustersOHGE21");
119  nOHGE11_ = ps.getParameter<unsigned int>("nOHGE11");
120  nOHGE21_ = ps.getParameter<unsigned int>("nOHGE21");
121  maxClusterSize_ = ps.getParameter<unsigned int>("maxClusterSize");
122 
123  pad_token_ = consumes<GEMPadDigiCollection>(pads_);
124 
125  produces<GEMPadDigiClusterCollection>();
126  consumes<GEMPadDigiCollection>(pads_);
127 }

References edm::ParameterSet::getParameter(), maxClusterSize_, maxClustersOHGE11_, maxClustersOHGE21_, nOHGE11_, nOHGE21_, pad_token_, and pads_.

◆ ~GEMPadDigiClusterProducer()

GEMPadDigiClusterProducer::~GEMPadDigiClusterProducer ( )
override

Definition at line 129 of file GEMPadDigiClusterProducer.cc.

129 {}

Member Function Documentation

◆ beginRun()

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

Definition at line 143 of file GEMPadDigiClusterProducer.cc.

143  {
145  eventSetup.get<MuonGeometryRecord>().get(hGeom);
146  geometry_ = &*hGeom;
147 }

References geometry_, edm::EventSetup::get(), and get.

◆ buildClusters()

void GEMPadDigiClusterProducer::buildClusters ( const GEMPadDigiCollection pads,
GEMPadDigiClusterContainer out_clusters 
) const
private

Light Cluster Packing Algorithm **

Based on: https://github.com/cms-gem-daq-project/OptoHybridv3/raw/master/doc/OH_modules.docx (Andrew Peck, Thomas Lenzi, Evaldas Juska)

In the current version of the algorithm, cluster finding is segmented into two separate halves of the GE1/1 chambers. Thus, each one of the trigger fibers can transmit clusters only from the half of the chamber that it corresponds to. For GE2/1, there are four separate quarts of the GE2/1 chamber.

This has the downside of being unable to transmit more than 4 clusters when they occur within that side of the chamber, so there will be a slightly higher rate of cluster overflow. For GE2/1 each OH can transmit up to 5 clusters.

The benefit, however, is in terms of (1) latency and (2) resource usage.

The burden of finding clusters on of the chamber is significantly less, and allows the cluster packer to operate in a simple, pipelined architecture which returns up to 4 (or 5) clusters per half-chamber per bunch crossing.

This faster architecture allows the mechanism to operate with only a single copy of the cluster finding priority encoder and cluster truncator (instead of two multiplexed copies), so the total resource usage of these stages is approximately half.

Further, a second step of cluster merging that is required in the full algorithm is avoided, which reduces latency by an additional bunch crossing and significantly reduces resource usage as well.

The sorting of the clusters favors lower eta partitions and lower pad numbers

Definition at line 171 of file GEMPadDigiClusterProducer.cc.

172  {
173  // clear the container
174  proto_clusters.clear();
175 
176  // construct clusters
177  for (const auto& part : geometry_->etaPartitions()) {
178  // clusters are not build for ME0
179  // -> ignore hits from station 0
180  if (part->id().station() == 0)
181  continue;
182 
183  GEMPadDigiClusters all_pad_clusters;
184 
185  auto pads = det_pads.get(part->id());
186  std::vector<uint16_t> cl;
187  int startBX = 99;
188 
189  for (auto d = pads.first; d != pads.second; ++d) {
190  if (cl.empty()) {
191  cl.push_back((*d).pad());
192  } else {
193  if ((*d).bx() == startBX and // same bunch crossing
194  (*d).pad() == cl.back() + 1 // pad difference is 1
195  and cl.size() < maxClusterSize_) { // max 8 in cluster
196  cl.push_back((*d).pad());
197  } else {
198  // put the current cluster in the proto collection
199  GEMPadDigiCluster pad_cluster(cl, startBX);
200 
201  all_pad_clusters.emplace_back(pad_cluster);
202 
203  // start a new cluster
204  cl.clear();
205  cl.push_back((*d).pad());
206  }
207  }
208  startBX = (*d).bx();
209  }
210 
211  // put the last cluster in the proto collection
212  if (pads.first != pads.second) {
213  GEMPadDigiCluster pad_cluster(cl, startBX);
214  all_pad_clusters.emplace_back(pad_cluster);
215  }
216  proto_clusters.emplace(part->id(), all_pad_clusters);
217 
218  } // end of partition loop
219 }

References GetRecoTauVFromDQM_MC_cff::cl, ztail::d, GEMGeometry::etaPartitions(), geometry_, and maxClusterSize_.

Referenced by produce().

◆ fillDescriptions()

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

Definition at line 131 of file GEMPadDigiClusterProducer.cc.

131  {
133  desc.add<edm::InputTag>("InputCollection", edm::InputTag("simMuonGEMPadDigis"));
134  desc.add<unsigned int>("maxClustersOHGE11", 4);
135  desc.add<unsigned int>("maxClustersOHGE21", 5);
136  desc.add<unsigned int>("nOHGE11", 2);
137  desc.add<unsigned int>("nOHGE21", 4);
138  desc.add<unsigned int>("maxClusterSize", 8);
139 
140  descriptions.add("simMuonGEMPadDigiClustersDef", desc);
141 }

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), and HLT_2018_cff::InputTag.

◆ produce()

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

Definition at line 149 of file GEMPadDigiClusterProducer.cc.

149  {
151  e.getByToken(pad_token_, hpads);
152 
153  // Create empty output
154  std::unique_ptr<GEMPadDigiClusterCollection> pClusters(new GEMPadDigiClusterCollection());
155 
156  // build the proto clusters (per partition)
157  GEMPadDigiClusterContainer proto_clusters;
158  buildClusters(*(hpads.product()), proto_clusters);
159 
160  // // sort clusters per chamber, per OH, per partition number and per pad number
161  GEMPadDigiClusterSortedContainer sorted_clusters;
162  sortClusters(proto_clusters, sorted_clusters);
163 
164  // select the clusters from sorted clusters
165  selectClusters(sorted_clusters, *pClusters);
166 
167  // store them in the event
168  e.put(std::move(pClusters));
169 }

References buildClusters(), MillePedeFileConverter_cfg::e, eostools::move(), pad_token_, edm::Handle< T >::product(), selectClusters(), and sortClusters().

◆ selectClusters()

void GEMPadDigiClusterProducer::selectClusters ( const GEMPadDigiClusterSortedContainer in,
GEMPadDigiClusterCollection out 
) const
private

Definition at line 257 of file GEMPadDigiClusterProducer.cc.

258  {
259  // loop over chambers
260  for (const auto& ch : geometry_->chambers()) {
261  const int station = ch->id().station();
262  const bool isGE11 = (station == 1);
263  const unsigned maxClustersOH = isGE11 ? maxClustersOHGE11_ : maxClustersOHGE21_;
264 
265  // loop over the optohybrids
266  for (const auto& optohybrid : sorted_clusters.at(ch->id())) {
267  // at most maxClustersOH per OH!
268  unsigned nClusters = 0;
269 
270  // loop over the eta partitions for this OH
271  for (const auto& etapart : optohybrid) {
272  const auto& detid(etapart.first);
273  const auto& clusters(etapart.second);
274 
275  // pick the clusters with lowest pad number
276  for (const auto& clus : clusters) {
277  if (nClusters < maxClustersOH) {
278  out_clusters.insertDigi(detid, clus);
279  nClusters++;
280  }
281  } // end of cluster loop
282  } // end of eta partition loop
283  } // end of OH loop
284  } // end of chamber loop
285 }

References GEMGeometry::chambers(), bsc_activity_cfg::clusters, geometry_, maxClustersOHGE11_, maxClustersOHGE21_, heavyionUCCDQM_cfi::nClusters, and relativeConstraints::station.

Referenced by produce().

◆ sortClusters()

void GEMPadDigiClusterProducer::sortClusters ( const GEMPadDigiClusterContainer in_clusters,
GEMPadDigiClusterSortedContainer out_clusters 
) const
private

Definition at line 221 of file GEMPadDigiClusterProducer.cc.

222  {
223  // The sorting of the clusters favors lower eta partitions and lower pad numbers
224  // By default the eta partitions are sorted by Id
225 
226  sorted_clusters.clear();
227 
228  for (const auto& ch : geometry_->chambers()) {
229  // check the station number
230  const int station = ch->id().station();
231  const bool isGE11 = (station == 1);
232  const unsigned nOH = isGE11 ? nOHGE11_ : nOHGE21_;
233  const unsigned nPartOH = ch->nEtaPartitions() / nOH;
234 
235  std::vector<std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > > temp_clustersCH;
236 
237  for (unsigned int iOH = 0; iOH < nOH; iOH++) {
238  // all clusters for a set of eta partitions
239  std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > temp_clustersOH;
240 
241  // loop over the 4 or 2 eta partitions for this optohybrid
242  for (unsigned iPart = 1; iPart <= nPartOH; iPart++) {
243  // get the clusters for this eta partition
244  const GEMDetId& partId = ch->etaPartition(iPart + iOH * nPartOH)->id();
245  if (proto_clusters.find(partId) != proto_clusters.end()) {
246  temp_clustersOH.emplace_back(partId, proto_clusters.at(partId));
247  }
248  } // end of eta partition loop
249 
250  temp_clustersCH.emplace_back(temp_clustersOH);
251  } // end of OH loop
252 
253  sorted_clusters.emplace(ch->id(), temp_clustersCH);
254  } // end of chamber loop
255 }

References GEMGeometry::chambers(), geometry_, nOHGE11_, nOHGE21_, and relativeConstraints::station.

Referenced by produce().

Member Data Documentation

◆ geometry_

const GEMGeometry* GEMPadDigiClusterProducer::geometry_
private

◆ maxClusterSize_

unsigned int GEMPadDigiClusterProducer::maxClusterSize_
private

Definition at line 110 of file GEMPadDigiClusterProducer.cc.

Referenced by buildClusters(), and GEMPadDigiClusterProducer().

◆ maxClustersOHGE11_

unsigned int GEMPadDigiClusterProducer::maxClustersOHGE11_
private

Definition at line 106 of file GEMPadDigiClusterProducer.cc.

Referenced by GEMPadDigiClusterProducer(), and selectClusters().

◆ maxClustersOHGE21_

unsigned int GEMPadDigiClusterProducer::maxClustersOHGE21_
private

Definition at line 107 of file GEMPadDigiClusterProducer.cc.

Referenced by GEMPadDigiClusterProducer(), and selectClusters().

◆ nOHGE11_

unsigned int GEMPadDigiClusterProducer::nOHGE11_
private

Definition at line 108 of file GEMPadDigiClusterProducer.cc.

Referenced by GEMPadDigiClusterProducer(), and sortClusters().

◆ nOHGE21_

unsigned int GEMPadDigiClusterProducer::nOHGE21_
private

Definition at line 109 of file GEMPadDigiClusterProducer.cc.

Referenced by GEMPadDigiClusterProducer(), and sortClusters().

◆ pad_token_

edm::EDGetTokenT<GEMPadDigiCollection> GEMPadDigiClusterProducer::pad_token_
private

Name of input digi Collection.

Definition at line 103 of file GEMPadDigiClusterProducer.cc.

Referenced by GEMPadDigiClusterProducer(), and produce().

◆ pads_

edm::InputTag GEMPadDigiClusterProducer::pads_
private

Definition at line 104 of file GEMPadDigiClusterProducer.cc.

Referenced by GEMPadDigiClusterProducer().

heavyionUCCDQM_cfi.nClusters
nClusters
Definition: heavyionUCCDQM_cfi.py:9
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
GEMPadDigiClusterProducer::GEMPadDigiClusters
std::vector< GEMPadDigiCluster > GEMPadDigiClusters
Definition: GEMPadDigiClusterProducer.cc:41
edm::Handle::product
T const * product() const
Definition: Handle.h:70
GEMPadDigiClusterProducer::geometry_
const GEMGeometry * geometry_
Definition: GEMPadDigiClusterProducer.cc:112
GEMPadDigiClusterProducer::pads_
edm::InputTag pads_
Definition: GEMPadDigiClusterProducer.cc:104
relativeConstraints.station
station
Definition: relativeConstraints.py:67
GEMPadDigiCluster
Definition: GEMPadDigiCluster.h:17
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
GEMPadDigiClusterContainer
std::vector< GEMPadDigiCluster > GEMPadDigiClusterContainer
Definition: GEMDigiMatcher.h:25
GEMPadDigiClusterProducer::nOHGE11_
unsigned int nOHGE11_
Definition: GEMPadDigiClusterProducer.cc:108
edm::Handle< GEMPadDigiCollection >
GetRecoTauVFromDQM_MC_cff.cl
cl
Definition: GetRecoTauVFromDQM_MC_cff.py:38
part
part
Definition: HCALResponse.h:20
GEMPadDigiClusterCollection
MuonDigiCollection< GEMDetId, GEMPadDigiCluster > GEMPadDigiClusterCollection
Definition: GEMPadDigiClusterCollection.h:13
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
edm::ESHandle< GEMGeometry >
GEMPadDigiClusterProducer::maxClustersOHGE11_
unsigned int maxClustersOHGE11_
Definition: GEMPadDigiClusterProducer.cc:106
GEMPadDigiClusterProducer::sortClusters
void sortClusters(const GEMPadDigiClusterContainer &in_clusters, GEMPadDigiClusterSortedContainer &out_clusters) const
Definition: GEMPadDigiClusterProducer.cc:221
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
GEMGeometry::chambers
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
Definition: GEMGeometry.cc:38
GEMPadDigiClusterProducer::maxClustersOHGE21_
unsigned int maxClustersOHGE21_
Definition: GEMPadDigiClusterProducer.cc:107
GEMPadDigiClusterProducer::GEMPadDigiClusterSortedContainer
std::map< GEMDetId, std::vector< std::vector< std::pair< GEMDetId, GEMPadDigiClusters > > > > GEMPadDigiClusterSortedContainer
Definition: GEMPadDigiClusterProducer.cc:46
GEMDetId
Definition: GEMDetId.h:17
GEMPadDigiClusterProducer::selectClusters
void selectClusters(const GEMPadDigiClusterSortedContainer &in, GEMPadDigiClusterCollection &out) const
Definition: GEMPadDigiClusterProducer.cc:257
get
#define get
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
GEMPadDigiClusterProducer::nOHGE21_
unsigned int nOHGE21_
Definition: GEMPadDigiClusterProducer.cc:109
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
GEMPadDigiClusterProducer::maxClusterSize_
unsigned int maxClusterSize_
Definition: GEMPadDigiClusterProducer.cc:110
GEMPadDigiClusterProducer::pad_token_
edm::EDGetTokenT< GEMPadDigiCollection > pad_token_
Name of input digi Collection.
Definition: GEMPadDigiClusterProducer.cc:103
MuonGeometryRecord
Definition: MuonGeometryRecord.h:34
edm::InputTag
Definition: InputTag.h:15
GEMPadDigiClusterProducer::buildClusters
void buildClusters(const GEMPadDigiCollection &pads, GEMPadDigiClusterContainer &out_clusters) const
Definition: GEMPadDigiClusterProducer.cc:171
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37