46 typedef std::map<GEMDetId, std::vector<std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > > >
135 geom_token_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
137 produces<GEMPadDigiClusterCollection>();
138 consumes<GEMPadDigiCollection>(
pads_);
146 desc.add<
unsigned int>(
"maxClustersOHGE11", 4);
147 desc.add<
unsigned int>(
"maxClustersOHGE21", 5);
148 desc.add<
unsigned int>(
"nOHGE11", 2);
149 desc.add<
unsigned int>(
"nOHGE21", 4);
150 desc.add<
unsigned int>(
"maxClusterSize", 8);
151 desc.add<
bool>(
"sendOverflowClusters",
false);
153 descriptions.
add(
"simMuonGEMPadDigiClustersDef",
desc);
186 proto_clusters.clear();
197 auto pads = det_pads.get(
part->id());
198 std::vector<uint16_t>
cl;
201 for (
auto d = pads.first;
d != pads.second; ++
d) {
206 unsigned nPart =
d->nPartitions();
209 cl.push_back((*d).pad());
211 if ((*d).bx() == startBX and
212 (*d).pad() ==
cl.back() + 1
214 cl.push_back((*d).pad());
222 all_pad_clusters.emplace_back(pad_cluster);
226 cl.push_back((*d).pad());
233 if (pads.first != pads.second) {
235 unsigned nPart = (pads.first)->nPartitions();
242 all_pad_clusters.emplace_back(pad_cluster);
244 proto_clusters.emplace(
part->id(), all_pad_clusters);
254 sorted_clusters.clear();
259 const unsigned nPartOH = ch->nEtaPartitions() / nOH;
261 std::vector<std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > > temp_clustersCH;
263 for (
unsigned int iOH = 0; iOH < nOH; iOH++) {
265 std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > temp_clustersOH;
268 for (
unsigned iPart = 1; iPart <= nPartOH; iPart++) {
270 const GEMDetId& partId = ch->etaPartition(iPart + iOH * nPartOH)->id();
271 if (proto_clusters.find(partId) != proto_clusters.end()) {
272 temp_clustersOH.emplace_back(partId, proto_clusters.at(partId));
276 temp_clustersCH.emplace_back(temp_clustersOH);
279 sorted_clusters.emplace(ch->id(), temp_clustersCH);
290 for (
const auto& optohybrid : sorted_clusters.at(ch->id())) {
295 for (
const auto& etapart : optohybrid) {
296 const auto& detid(etapart.first);
297 const auto&
clusters(etapart.second);
305 out_clusters.insertDigi(detid, clus);
T getParameter(std::string const &) const
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geom_token_
~GEMPadDigiClusterProducer() override
#define DEFINE_FWK_MODULE(type)
unsigned int maxClustersOHGE11_
T const * product() const
void checkValid(const T &cluster, const GEMDetId &id) const
std::map< GEMDetId, std::vector< std::vector< std::pair< GEMDetId, GEMPadDigiClusters > > > > GEMPadDigiClusterSortedContainer
void produce(edm::Event &, const edm::EventSetup &) override
GEMPadDigiClusterProducer(const edm::ParameterSet &ps)
MuonDigiCollection< GEMDetId, GEMPadDigiCluster > GEMPadDigiClusterCollection
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
const GEMGeometry * geometry_
std::map< GEMDetId, GEMPadDigiClusters > GEMPadDigiClusterContainer
unsigned int maxClusterSize_
void buildClusters(const GEMPadDigiCollection &pads, GEMPadDigiClusterContainer &out_clusters) const
TString nPart(Int_t part, TString string, TString delimit=";", Bool_t removerest=true)
unsigned int maxClustersOHGE21_
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void selectClusters(const GEMPadDigiClusterSortedContainer &in, GEMPadDigiClusterCollection &out) const
void beginRun(const edm::Run &, const edm::EventSetup &) override
edm::EDGetTokenT< GEMPadDigiCollection > pad_token_
Name of input digi Collection.
bool sendOverflowClusters_
Log< level::Warning, false > LogWarning
std::vector< GEMPadDigiCluster > GEMPadDigiClusters
void sortClusters(const GEMPadDigiClusterContainer &in_clusters, GEMPadDigiClusterSortedContainer &out_clusters) const
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.