119 geom_token_ = esConsumes<GEMGeometry, MuonGeometryRecord, edm::Transition::BeginRun>();
121 produces<GEMPadDigiClusterCollection>();
122 consumes<GEMPadDigiCollection>(
pads_);
130 desc.add<
unsigned int>(
"nPartitionsGE11", 4);
131 desc.add<
unsigned int>(
"nPartitionsGE21", 4);
132 desc.add<
unsigned int>(
"maxClustersPartitionGE11", 4);
133 desc.add<
unsigned int>(
"maxClustersPartitionGE21", 4);
134 desc.add<
unsigned int>(
"nOHGE11", 1);
135 desc.add<
unsigned int>(
"nOHGE21", 4);
136 desc.add<
unsigned int>(
"maxClustersOHGE11", 8);
137 desc.add<
unsigned int>(
"maxClustersOHGE21", 8);
138 desc.add<
unsigned int>(
"maxClusterSize", 8);
139 desc.add<
bool>(
"sendOverflowClusters",
false);
141 descriptions.
add(
"simMuonGEMPadDigiClustersDef",
desc);
170 proto_clusters.clear();
181 auto pads = det_pads.get(
part->id());
182 std::vector<uint16_t>
cl;
185 for (
auto d = pads.first;
d != pads.second; ++
d) {
190 unsigned nPart =
d->nPartitions();
193 cl.push_back((*d).pad());
195 if ((*d).bx() == startBX and
196 (*d).pad() ==
cl.back() + 1
198 cl.push_back((*d).pad());
206 all_pad_clusters.emplace_back(pad_cluster);
210 cl.push_back((*d).pad());
217 if (pads.first != pads.second) {
219 unsigned nPart = (pads.first)->nPartitions();
226 all_pad_clusters.emplace_back(pad_cluster);
228 proto_clusters.emplace(
part->id(), all_pad_clusters);
238 const unsigned nEtaPerPartition = ch->nEtaPartitions() / (nPartitions * nOH);
243 for (
unsigned int iOH = 0; iOH < nOH; iOH++) {
244 unsigned int nClustersOH = 0;
246 for (
unsigned int iPart = 0; iPart < nPartitions; iPart++) {
247 unsigned int nClustersPart = 0;
249 for (
unsigned iEta = 1;
iEta <= nEtaPerPartition;
iEta++) {
252 ch->etaPartition(
iEta + iPart * nEtaPerPartition + iOH * nPartitions * nEtaPerPartition)->id();
253 if (proto_clusters.find(iEtaId) != proto_clusters.end()) {
254 for (
const auto& cluster : proto_clusters.at(iEtaId)) {
255 if (nClustersPart < maxClustersPart and nClustersOH < maxClustersOH) {
257 out_clusters.insertDigi(iEtaId, cluster);
T getParameter(std::string const &) const
unsigned int nPartitionsGE21_
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
void produce(edm::Event &, const edm::EventSetup &) override
GEMPadDigiClusterProducer(const edm::ParameterSet &ps)
MuonDigiCollection< GEMDetId, GEMPadDigiCluster > GEMPadDigiClusterCollection
unsigned int nPartitionsGE11_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
unsigned int maxClustersPartitionGE21_
const GEMGeometry * geometry_
unsigned int maxClustersPartitionGE11_
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 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
void selectClusters(const GEMPadDigiClusterContainer &in_clusters, GEMPadDigiClusterCollection &out) const
std::vector< GEMPadDigiCluster > GEMPadDigiClusters
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.