116 geom_token_ = esConsumes<GEMGeometry, MuonGeometryRecord>();
118 put_token_ = produces<GEMPadDigiClusterCollection>();
126 desc.add<
unsigned int>(
"nPartitionsGE11", 4);
127 desc.add<
unsigned int>(
"nPartitionsGE21", 4);
128 desc.add<
unsigned int>(
"maxClustersPartitionGE11", 4);
129 desc.add<
unsigned int>(
"maxClustersPartitionGE21", 4);
130 desc.add<
unsigned int>(
"nOHGE11", 1);
131 desc.add<
unsigned int>(
"nOHGE21", 4);
132 desc.add<
unsigned int>(
"maxClustersOHGE11", 8);
133 desc.add<
unsigned int>(
"maxClustersOHGE21", 8);
134 desc.add<
unsigned int>(
"maxClusterSize", 8);
135 desc.add<
bool>(
"sendOverflowClusters",
false);
137 descriptions.
add(
"simMuonGEMPadDigiClustersDef",
desc);
165 auto pads = det_pads.get(
part->id());
166 std::vector<uint16_t>
cl;
169 for (
auto d = pads.first;
d != pads.second; ++
d) {
174 unsigned nPart =
d->nPartitions();
177 cl.push_back((*d).pad());
179 if ((*d).bx() == startBX and
180 (*d).pad() ==
cl.back() + 1
182 cl.push_back((*d).pad());
190 all_pad_clusters.emplace_back(pad_cluster);
194 cl.push_back((*d).pad());
201 if (pads.first != pads.second) {
203 unsigned nPart = (pads.first)->nPartitions();
210 all_pad_clusters.emplace_back(pad_cluster);
212 proto_clusters.emplace(
part->id(), all_pad_clusters);
215 return proto_clusters;
221 for (
const auto& ch :
geometry.chambers()) {
224 const unsigned nEtaPerPartition = ch->nEtaPartitions() / (nPartitions * nOH);
229 for (
unsigned int iOH = 0; iOH < nOH; iOH++) {
230 unsigned int nClustersOH = 0;
232 for (
unsigned int iPart = 0; iPart < nPartitions; iPart++) {
233 unsigned int nClustersPart = 0;
235 for (
unsigned iEta = 1;
iEta <= nEtaPerPartition;
iEta++) {
238 ch->etaPartition(
iEta + iPart * nEtaPerPartition + iOH * nPartitions * nEtaPerPartition)->id();
239 if (proto_clusters.find(iEtaId) != proto_clusters.end()) {
240 for (
const auto& cluster : proto_clusters.at(iEtaId)) {
241 if (nClustersPart < maxClustersPart and nClustersOH < maxClustersOH) {
243 out_clusters.insertDigi(iEtaId, cluster);
T getParameter(std::string const &) const
GEMPadDigiClusterCollection selectClusters(const GEMPadDigiClusterContainer &in_clusters, const GEMGeometry &) const
unsigned int nPartitionsGE21_
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geom_token_
~GEMPadDigiClusterProducer() override
unsigned int maxClustersOHGE11_
edm::EDPutTokenT< GEMPadDigiClusterCollection > put_token_
void checkValid(const T &cluster, const GEMDetId &id) const
GEMPadDigiClusterProducer(const edm::ParameterSet &ps)
unsigned int nPartitionsGE11_
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned int maxClustersPartitionGE21_
unsigned int maxClustersPartitionGE11_
#define DEFINE_FWK_MODULE(type)
std::map< GEMDetId, GEMPadDigiClusters > GEMPadDigiClusterContainer
unsigned int maxClusterSize_
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 produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
edm::EDGetTokenT< GEMPadDigiCollection > pad_token_
Name of input digi Collection.
bool sendOverflowClusters_
Log< level::Warning, false > LogWarning
GEMPadDigiClusterContainer buildClusters(const GEMPadDigiCollection &pads, const GEMGeometry &) const
std::vector< GEMPadDigiCluster > GEMPadDigiClusters