17 #include <boost/foreach.hpp> 18 #define foreach BOOST_FOREACH 39 src_(iConfig.getParameter<
edm::InputTag>(
"src")),
40 maxHoleSize_(iConfig.getParameter<uint32_t>(
"maxHoleSize"))
42 produces<StripCompactDigiSimLinks>();
59 int previousLinkStrip;
60 std::vector<StripCompactDigiSimLinks::key_type> thisStripSignals;
61 std::vector<StripCompactDigiSimLinks::key_type> previousStripSignals;
66 previousLinkStrip = -2;
67 thisStripSignals.clear();
68 previousStripSignals.clear();
70 DEBUG(
std::cerr <<
" processing digiSimLink on strip " << it->channel() <<
" left by particle " << it->SimTrackId() <<
", event " << it->eventId().rawId() << std::endl;)
71 if (
int(it->channel()) != previousLinkStrip) {
72 previousStrip = previousLinkStrip;
74 swap(thisStripSignals, previousStripSignals);
75 thisStripSignals.clear();
77 DEBUG(
std::cerr <<
" previous strip " << previousStrip <<
", previous link strip " << previousLinkStrip << std::endl;)
81 bool alreadyClusterized =
false;
82 if (
int(it->channel()) == previousStrip+1) {
84 if (
std::find(previousStripSignals.begin(), previousStripSignals.end(),
key) != previousStripSignals.end()) {
85 alreadyClusterized =
true;
89 if (!alreadyClusterized) {
91 unsigned int size = 1;
92 int myLastStrip = it->channel();
94 DEBUG(
std::cerr <<
" digiSimLink on strip " << it2->channel() <<
" left by particle " << it2->SimTrackId() <<
", event " << it2->eventId().rawId() << std::endl;)
96 DEBUG(
std::cerr <<
" found hole of size " << (it2->channel() - myLastStrip) <<
", stopping." << std::endl;)
99 if ((it2->eventId() ==
key.first) && (it2->SimTrackId() ==
key.second)) {
102 myLastStrip = it2->channel();
107 if (
int(it->channel()) != previousLinkStrip) {
108 previousLinkStrip = it->channel();
110 thisStripSignals.push_back(
key);
111 DEBUG(
std::cerr <<
" ending state " << previousStrip <<
", previous link strip " << previousLinkStrip << std::endl;)
virtual ~StripCompactDigiSimLinksProducer()
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
det_id_type detId() const
#define DEFINE_FWK_MODULE(type)
void insert(const key_type &key, const HitRecord &record)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void swap(Association< C > &lhs, Association< C > &rhs)
StripCompactDigiSimLinksProducer(const edm::ParameterSet &iConfig)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
virtual void produce(edm::Event &, const edm::EventSetup &) override
std::pair< EncodedEventId, unsigned int > key_type