49 theMinLayers = pset.
getParameter<
unsigned int>(
"minLayers");
52 cout <<
"[DTClusterer] Constructor called" << endl;
54 produces<DTRecClusterCollection>();
64 cout <<
"[DTClusterer] produce called" << endl;
71 event.getByLabel(theRecHits1DLabel, allHits);
79 for (dtLayerIt = allHits->id_begin(); dtLayerIt != allHits->id_end(); ++dtLayerIt){
83 if (SLId==oldSlId)
continue;
86 if(
debug)
cout <<
"Reconstructing the clusters in "<< SLId << endl;
95 vector<DTRecHit1DPair> pairs(range.first,range.second);
96 if(
debug)
cout <<
"Number of 1D-RecHit pairs " << pairs.size() << endl;
97 vector<DTSLRecCluster> clus=buildClusters(sl, pairs);
98 if(
debug)
cout <<
"Number of clusters build " << clus.size() << endl;
100 clusters->put(sl->
id(), clus.begin(), clus.end());
106 vector<DTRecHit1DPair>& pairs) {
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();
120 if(
debug)
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();
127 float err2=sum2/adiacentPairs.size()-mean*
mean;
132 if(
debug)
cout <<
"Cluster " << cluster << endl;
133 result.push_back(cluster);
136 adiacentPairs.clear();
141 adiacentPairs.push_back((*hit).second);
142 if(
debug)
cout <<
"adiacentPairs " << adiacentPairs.size() << endl;
144 sum2+=(*hit).first*(*hit).first;
146 lastPos=(*hit).first;
149 if (adiacentPairs.size() >= theMinHits && differentLayers(adiacentPairs)>=theMinLayers) {
150 float mean=sum/adiacentPairs.size();
151 float err2=sum2/adiacentPairs.size()-mean*
mean;
156 if(
debug)
cout <<
"Cluster " << cluster << endl;
157 result.push_back(cluster);
164 vector<DTRecHit1DPair>& pairs) {
165 vector<pair<float, DTRecHit1DPair> >
result;
166 for (vector<DTRecHit1DPair>::const_iterator pair=pairs.begin();
167 pair!=pairs.end(); ++pair ) {
178 result.push_back(make_pair(posInSL.
x(), *pair));
190 for (vector<DTRecHit1DPair>::const_iterator
hit=hits.begin();
hit!=hits.end();
192 int pos = (1 << ((*hit).wireId().layer() -1 ));
193 if (! (pos & layers)) {
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
float wirePosition(int wireNumber) const
Returns the x position in the layer of a given wire number.
unsigned int differentLayers(std::vector< DTRecHit1DPair > &hits)
std::pair< const_iterator, const_iterator > range
iterator range
virtual void produce(edm::Event &event, const edm::EventSetup &setup)
edm::RangeMap< DTSuperLayerId, edm::OwnVector< DTSLRecCluster > > DTRecClusterCollection
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
static std::pair< DTLayerId, DTSuperLayerIdComparator > layersBySuperLayer(DTSuperLayerId slId)
Access by SL objects written into a RangeMap by layer.
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
int layer() const
Return the layer number.
DTSuperLayerId superlayerId() const
Return the corresponding SuperLayerId.
DTSuperLayerId id() const
Return the DetId of this SL.
const DTTopology & specificTopology() const
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
std::vector< DTSLRecCluster > buildClusters(const DTSuperLayer *sl, std::vector< DTRecHit1DPair > &pairs)
const DTLayer * layer(DTLayerId id) const
Return the layer corresponding to the given id.
int wire() const
Return the wire number.
DTClusterer(const edm::ParameterSet &)
std::vector< std::pair< float, DTRecHit1DPair > > initHits(const DTSuperLayer *sl, std::vector< DTRecHit1DPair > &pairs)
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")