46 typedef std::map<GEMDetId, std::vector<std::vector<std::pair<GEMDetId, GEMPadDigiClusters> > > >
129 if (sendOverflowClusters_) {
130 maxClustersOHGE11_ *= 2;
131 maxClustersOHGE21_ *= 2;
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())) {
292 unsigned nClusters = 0;
295 for (
const auto& etapart : optohybrid) {
296 const auto& detid(etapart.first);
297 const auto&
clusters(etapart.second);
301 if (nClusters < maxClustersOH) {
305 out_clusters.insertDigi(detid, clus);
319 edm::LogWarning(
"GEMPadDigiClusterProducer") <<
"Invalid " << tp <<
" in " <<
id;
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
void sortClusters(const GEMPadDigiClusterContainer &in_clusters, GEMPadDigiClusterSortedContainer &out_clusters) const
uint16_t *__restrict__ id
edm::ESGetToken< GEMGeometry, MuonGeometryRecord > geom_token_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
~GEMPadDigiClusterProducer() override
#define DEFINE_FWK_MODULE(type)
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)
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_
TString nPart(Int_t part, TString string, TString delimit=";", Bool_t removerest=true)
unsigned int maxClustersOHGE21_
T const * product() const
void buildClusters(const GEMPadDigiCollection &pads, GEMPadDigiClusterContainer &out_clusters) const
T getParameter(std::string const &) 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.
bool sendOverflowClusters_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Log< level::Warning, false > LogWarning
void checkValid(const T &cluster, const GEMDetId &id) const
std::vector< GEMPadDigiCluster > GEMPadDigiClusters