45 typedef std::map<GEMDetId, std::vector<std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > > >
98 void sortClusters(
const GEMPadDigiClusterContainer& in_clusters,
125 produces<GEMPadDigiClusterCollection>();
126 consumes<GEMPadDigiCollection>(
pads_);
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);
140 descriptions.
add(
"simMuonGEMPadDigiClustersDef", desc);
174 proto_clusters.clear();
180 auto pads = det_pads.get(
part->id());
181 std::vector<uint16_t>
cl;
184 for (
auto d = pads.first;
d != pads.second; ++
d) {
186 cl.push_back((*d).pad());
188 if ((*d).bx() == startBX and
189 (*d).pad() == cl.back() + 1
191 cl.push_back((*d).pad());
196 all_pad_clusters.emplace_back(pad_cluster);
200 cl.push_back((*d).pad());
207 if (pads.first != pads.second) {
209 all_pad_clusters.emplace_back(pad_cluster);
211 proto_clusters.emplace(
part->id(), all_pad_clusters);
221 sorted_clusters.clear();
225 const int station = ch->id().station();
226 const bool isGE11 = (station == 1);
228 const unsigned nPartOH = ch->nEtaPartitions() / nOH;
230 std::vector<std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > > temp_clustersCH;
232 for (
unsigned int iOH = 0; iOH < nOH; iOH++) {
234 std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > temp_clustersOH;
237 for (
unsigned iPart = 1; iPart <= nPartOH; iPart++) {
239 const GEMDetId& partId = ch->etaPartition(iPart + iOH * nPartOH)->id();
240 if (proto_clusters.find(partId) != proto_clusters.end()) {
241 temp_clustersOH.emplace_back(partId, proto_clusters.at(partId));
245 temp_clustersCH.emplace_back(temp_clustersOH);
248 sorted_clusters.emplace(ch->id(), temp_clustersCH);
256 const int station = ch->id().station();
257 const bool isGE11 = (station == 1);
261 for (
const auto& optohybrid : sorted_clusters.at(ch->id())) {
266 for (
const auto& etapart : optohybrid) {
267 const auto& detid(etapart.first);
268 const auto&
clusters(etapart.second);
272 if (nClusters < maxClustersOH) {
273 out_clusters.insertDigi(detid, clus);
T getParameter(std::string const &) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void sortClusters(const GEMPadDigiClusterContainer &in_clusters, GEMPadDigiClusterSortedContainer &out_clusters) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~GEMPadDigiClusterProducer() override
unsigned int maxClustersOHGE11_
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)
#define DEFINE_FWK_MODULE(type)
const GEMGeometry * geometry_
const std::vector< const GEMEtaPartition * > & etaPartitions() const
Return a vector of all GEM eta partitions.
ParameterDescriptionBase * add(U const &iLabel, T const &value)
std::map< GEMDetId, GEMPadDigiClusters > GEMPadDigiClusterContainer
unsigned int maxClusterSize_
unsigned int maxClustersOHGE21_
T const * product() const
void buildClusters(const GEMPadDigiCollection &pads, GEMPadDigiClusterContainer &out_clusters) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void selectClusters(const GEMPadDigiClusterSortedContainer &in, GEMPadDigiClusterCollection &out) const
const std::vector< const GEMChamber * > & chambers() const
Return a vector of all GEM chambers.
void beginRun(const edm::Run &, const edm::EventSetup &) override
edm::EDGetTokenT< GEMPadDigiCollection > pad_token_
Name of input digi Collection.
std::vector< GEMPadDigiCluster > GEMPadDigiClusters