41 debug =
pset.getUntrackedParameter<
bool>(
"debug");
44 recHits1DToken_ = consumes<DTRecHitCollection>(
pset.getParameter<
InputTag>(
"recHits1DLabel"));
46 theMinHits =
pset.getParameter<
unsigned int>(
"minHits");
48 theMinLayers =
pset.getParameter<
unsigned int>(
"minLayers");
51 cout <<
"[DTClusterer] Constructor called" << endl;
53 produces<DTRecClusterCollection>();
62 cout <<
"[DTClusterer] produce called" << endl;
69 event.getByToken(recHits1DToken_, allHits);
72 auto clusters = std::make_unique<DTRecClusterCollection>();
77 for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt) {
86 cout <<
"Reconstructing the clusters in " << SLId << endl;
94 vector<DTRecHit1DPair> pairs(
range.first,
range.second);
96 cout <<
"Number of 1D-RecHit pairs " << pairs.size() << endl;
97 vector<DTSLRecCluster> clus = buildClusters(sl, pairs);
99 cout <<
"Number of clusters build " << clus.size() << endl;
101 clusters->put(sl->
id(), clus.begin(), clus.end());
108 vector<pair<float, DTRecHit1DPair> >
hits = initHits(sl, pairs);
110 vector<DTSLRecCluster>
result;
112 vector<DTRecHit1DPair> adiacentPairs;
113 float lastPos =
hits.front().first;
114 const float cellWidth = 4.2;
118 for (vector<pair<float, DTRecHit1DPair> >::const_iterator
hit =
hits.begin();
hit !=
hits.end(); ++
hit) {
120 cout <<
"Hit: " << (*hit).first <<
" lastPos: " << lastPos << endl;
123 if (
abs((*hit).first - lastPos) > cellWidth) {
124 if (adiacentPairs.size() >= theMinHits && differentLayers(adiacentPairs) >= theMinLayers) {
126 float mean = sum / adiacentPairs.size();
130 cout <<
"Cluster " << cluster << endl;
131 result.push_back(cluster);
134 adiacentPairs.clear();
139 adiacentPairs.push_back((*hit).second);
141 cout <<
"adiacentPairs " << adiacentPairs.size() << endl;
143 sum2 += (*hit).first * (*hit).first;
145 lastPos = (*hit).first;
148 if (adiacentPairs.size() >= theMinHits && differentLayers(adiacentPairs) >= theMinLayers) {
149 float mean = sum / adiacentPairs.size();
153 cout <<
"Cluster " << cluster << endl;
154 result.push_back(cluster);
161 vector<pair<float, DTRecHit1DPair> >
result;
162 for (vector<DTRecHit1DPair>::const_iterator pair = pairs.begin(); pair != pairs.end(); ++pair) {
171 result.push_back(make_pair(posInSL.
x(), *pair));
183 for (vector<DTRecHit1DPair>::const_iterator
hit =
hits.begin();
hit !=
hits.end(); ++
hit) {
184 int pos = (1 << ((*hit).wireId().layer() - 1));