test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
ME0SegmentAlgorithm Class Reference

#include <ME0SegmentAlgorithm.h>

Inheritance diagram for ME0SegmentAlgorithm:
ME0SegmentAlgorithmBase

Public Types

typedef std::vector< const
ME0RecHit * > 
EnsembleHitContainer
 Typedefs. More...
 
typedef std::vector
< EnsembleHitContainer
ProtoSegments
 
- Public Types inherited from ME0SegmentAlgorithmBase
typedef std::pair< const
ME0Chamber *, std::map
< uint32_t, const
ME0EtaPartition * > > 
ME0Ensemble
 

Public Member Functions

 ME0SegmentAlgorithm (const edm::ParameterSet &ps)
 Constructor. More...
 
std::vector< ME0Segmentrun (const ME0Ensemble &ensemble, const EnsembleHitContainer &rechits)
 
virtual ~ME0SegmentAlgorithm ()
 Destructor. More...
 
- Public Member Functions inherited from ME0SegmentAlgorithmBase
 ME0SegmentAlgorithmBase (const edm::ParameterSet &)
 Constructor. More...
 
virtual std::vector< ME0Segmentrun (const ME0Ensemble &ensemble, const std::vector< const ME0RecHit * > &rechits)=0
 
virtual ~ME0SegmentAlgorithmBase ()
 Destructor. More...
 

Private Member Functions

void buildSegments (const ME0Ensemble &ensemble, const EnsembleHitContainer &rechits, std::vector< ME0Segment > &me0segs)
 
ProtoSegments chainHits (const ME0Ensemble &ensemble, const EnsembleHitContainer &rechits)
 
ProtoSegments clusterHits (const EnsembleHitContainer &rechits)
 Utility functions. More...
 
bool isGoodToMerge (const ME0Ensemble &ensemble, const EnsembleHitContainer &newChain, const EnsembleHitContainer &oldChain)
 

Private Attributes

bool debug
 
double dEtaChainBoxMax
 
double dPhiChainBoxMax
 
double dTimeChainBoxMax
 
double dXclusBoxMax
 
double dYclusBoxMax
 
int maxRecHitsInCluster
 
unsigned int minHitsPerSegment
 
const std::string myName
 
bool preClustering
 
bool preClustering_useChaining
 
EnsembleHitContainer proto_segment
 
std::unique_ptr< MuonSegFitsfit_
 

Static Private Attributes

static float running_max =std::numeric_limits<float>::max()
 

Detailed Description

This algorithm is very basic no attemp to deal with ambiguities , noise etc. The ME0 track segments is built out of the rechit's in a the 6 ME0 Layer denoted as the ME0 Ensabmle .

Authors
Marcello Maggi

Definition at line 24 of file ME0SegmentAlgorithm.h.

Member Typedef Documentation

Typedefs.

Definition at line 30 of file ME0SegmentAlgorithm.h.

Definition at line 31 of file ME0SegmentAlgorithm.h.

Constructor & Destructor Documentation

ME0SegmentAlgorithm::ME0SegmentAlgorithm ( const edm::ParameterSet ps)
explicit

Constructor.

Definition at line 25 of file ME0SegmentAlgorithm.cc.

References debug, dEtaChainBoxMax, dPhiChainBoxMax, dTimeChainBoxMax, dXclusBoxMax, dYclusBoxMax, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), maxRecHitsInCluster, minHitsPerSegment, preClustering, and preClustering_useChaining.

25  : ME0SegmentAlgorithmBase(ps), myName("ME0SegmentAlgorithm")
26 {
27  debug = ps.getUntrackedParameter<bool>("ME0Debug");
28  minHitsPerSegment = ps.getParameter<unsigned int>("minHitsPerSegment");
29  preClustering = ps.getParameter<bool>("preClustering");
30  dXclusBoxMax = ps.getParameter<double>("dXclusBoxMax");
31  dYclusBoxMax = ps.getParameter<double>("dYclusBoxMax");
32  preClustering_useChaining = ps.getParameter<bool>("preClusteringUseChaining");
33  dPhiChainBoxMax = ps.getParameter<double>("dPhiChainBoxMax");
34  dEtaChainBoxMax = ps.getParameter<double>("dEtaChainBoxMax");
35  dTimeChainBoxMax = ps.getParameter<double>("dTimeChainBoxMax");
36  maxRecHitsInCluster = ps.getParameter<int>("maxRecHitsInCluster");
37 
38  edm::LogVerbatim("ME0SegmentAlgorithm") << "[ME0SegmentAlgorithm::ctor] Parameters to build segments :: "
39  << "preClustering = "<<preClustering<<" preClustering_useChaining = "<<preClustering_useChaining
40  <<" dPhiChainBoxMax = "<<dPhiChainBoxMax<<" dEtaChainBoxMax = "<<dEtaChainBoxMax<<" dTimeChainBoxMax = "<<dTimeChainBoxMax
41  <<" minHitsPerSegment = "<<minHitsPerSegment<<" maxRecHitsInCluster = "<<maxRecHitsInCluster;
42 }
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
unsigned int minHitsPerSegment
const std::string myName
ME0SegmentAlgorithmBase(const edm::ParameterSet &)
Constructor.
ME0SegmentAlgorithm::~ME0SegmentAlgorithm ( )
virtual

Destructor.

Definition at line 47 of file ME0SegmentAlgorithm.cc.

47  {
48 }

Member Function Documentation

void ME0SegmentAlgorithm::buildSegments ( const ME0Ensemble ensemble,
const EnsembleHitContainer rechits,
std::vector< ME0Segment > &  me0segs 
)
private

Definition at line 289 of file ME0SegmentAlgorithm.cc.

References ME0RecHit::clone(), runTauDisplay::gp, minHitsPerSegment, funct::pow(), proto_segment, ME0RecHit::setPosition(), sfit_, mathSSE::sqrt(), tmp, GeomDet::toGlobal(), and GeomDet::toLocal().

Referenced by run().

289  {
290  if (rechits.size() < minHitsPerSegment) return;
291 
292 #ifdef EDM_ML_DEBUG // have lines below only compiled when in debug mode
293  edm::LogVerbatim("ME0SegmentAlgorithm") << "[ME0SegmentAlgorithm::buildSegments] will now try to fit a ME0Segment from collection of "<<rechits.size()<<" ME0 RecHits";
294  for (auto rh=rechits.begin(); rh!=rechits.end(); ++rh){
295  auto me0id = (*rh)->me0Id();
296  auto rhLP = (*rh)->localPosition();
297  edm::LogVerbatim("ME0SegmentAlgorithm") << "[RecHit :: Loc x = "<<std::showpos<<std::setw(9)<<rhLP.x()<<" Loc y = "<<std::showpos<<std::setw(9)<<rhLP.y()<<" Time = "<<std::showpos<<(*rh)->tof()<<" -- "<<me0id.rawId()<<" = "<<me0id<<" ]";
298  }
299 #endif
300 
302  proto_segment.clear();
303 
304  // select hits from the ensemble and sort it
305  const ME0Chamber * chamber = ensemble.first;
306  for (auto rh=rechits.begin(); rh!=rechits.end();rh++){
307  proto_segment.push_back(*rh);
308  // for segFit - using local point in chamber frame
309  const ME0EtaPartition * thePartition = (ensemble.second.find((*rh)->me0Id()))->second;
310  GlobalPoint gp = thePartition->toGlobal((*rh)->localPosition());
311  const LocalPoint lp = chamber->toLocal(gp);
312  ME0RecHit *newRH = (*rh)->clone();
313  newRH->setPosition(lp);
314 
315  MuonSegFit::MuonRecHitPtr trkRecHit(newRH);
316  muonRecHits.push_back(trkRecHit);
317  }
318 
319  // The actual fit on all hits of the vector of the selected Tracking RecHits:
320  sfit_ = std::make_unique<MuonSegFit>(muonRecHits);
321  bool goodfit = sfit_->fit();
322  edm::LogVerbatim("ME0SegmentAlgorithm") << "[ME0SegmentAlgorithm::buildSegments] ME0Segment fit done";
323 
324  // quit function if fit was not OK
325  if(!goodfit){
326  for (auto rh:muonRecHits) rh.reset();
327  return;
328  }
329 
330  // obtain all information necessary to make the segment:
331  LocalPoint protoIntercept = sfit_->intercept();
332  LocalVector protoDirection = sfit_->localdir();
333  AlgebraicSymMatrix protoErrors = sfit_->covarianceMatrix();
334  double protoChi2 = sfit_->chi2();
335  // Calculate the central value and uncertainty of the segment time
336  float averageTime=0.;
337  for (auto rh=rechits.begin(); rh!=rechits.end(); ++rh){
338  averageTime += (*rh)->tof();
339  }
340  if(rechits.size() != 0) averageTime=averageTime/(rechits.size());
341  float timeUncrt=0.;
342  for (auto rh=rechits.begin(); rh!=rechits.end(); ++rh){
343  timeUncrt += pow((*rh)->tof()-averageTime,2);
344  }
345  if(rechits.size() > 1) timeUncrt=timeUncrt/(rechits.size()-1);
346  timeUncrt = sqrt(timeUncrt);
347 
348  // save all information inside GEMCSCSegment
349  edm::LogVerbatim("ME0SegmentAlgorithm") << "[ME0SegmentAlgorithm::buildSegments] will now try to make ME0Segment from collection of "<<rechits.size()<<" ME0 RecHits";
350  ME0Segment tmp(proto_segment, protoIntercept, protoDirection, protoErrors, protoChi2, averageTime, timeUncrt);
351 
352  edm::LogVerbatim("ME0SegmentAlgorithm") << "[ME0SegmentAlgorithm::buildSegments] ME0Segment made";
353  edm::LogVerbatim("ME0SegmentAlgorithm") << "[ME0SegmentAlgorithm::buildSegments] "<<tmp;
354 
355  for (auto rh:muonRecHits) rh.reset();
356  me0segs.push_back(tmp);
357  return;
358 }
std::shared_ptr< TrackingRecHit > MuonRecHitPtr
Definition: MuonSegFit.h:41
virtual ME0RecHit * clone() const
Definition: ME0RecHit.cc:47
void setPosition(LocalPoint pos)
Set local position.
Definition: ME0RecHit.h:72
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:54
unsigned int minHitsPerSegment
LocalPoint toLocal(const GlobalPoint &gp) const
Conversion to the R.F. of the GeomDet.
Definition: GeomDet.h:69
std::unique_ptr< MuonSegFit > sfit_
T sqrt(T t)
Definition: SSEVec.h:18
std::vector< MuonRecHitPtr > MuonRecHitContainer
Definition: MuonSegFit.h:42
EnsembleHitContainer proto_segment
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
CLHEP::HepSymMatrix AlgebraicSymMatrix
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40
ME0SegmentAlgorithm::ProtoSegments ME0SegmentAlgorithm::chainHits ( const ME0Ensemble ensemble,
const EnsembleHitContainer rechits 
)
private

Definition at line 196 of file ME0SegmentAlgorithm.cc.

References funct::abs(), begin, dTimeChainBoxMax, end, i, and isGoodToMerge().

Referenced by run().

196  {
197 
198  ProtoSegments rechits_chains;
199  ProtoSegments seeds;
200  seeds.reserve(rechits.size());
201  std::vector<bool> usedCluster(rechits.size(),false);
202 
203  // split rechits into subvectors and return vector of vectors:
204  // Loop over rechits
205  // Create one seed per hit
206  for ( unsigned int i=0; i<rechits.size(); ++i){
207  if(std::abs(rechits[i]->tof()) > dTimeChainBoxMax) continue;
208  seeds.push_back(EnsembleHitContainer(1,rechits[i]));
209  }
210 
211  // merge chains that are too close ("touch" each other)
212  for(size_t NNN = 0; NNN < seeds.size(); ++NNN) {
213  for(size_t MMM = NNN+1; MMM < seeds.size(); ++MMM) {
214  if(usedCluster[MMM] || usedCluster[NNN]){
215  continue;
216  }
217  // all is in the way we define "good";
218  // try not to "cluster" the hits but to "chain" them;
219  // it does the clustering but also does a better job
220  // for inclined tracks (not clustering them together;
221  // crossed tracks would be still clustered together)
222  // 22.12.09: In fact it is not much more different
223  // than the "clustering", we just introduce another
224  // variable in the game - Z. And it makes sense
225  // to re-introduce Y (or actually wire group mumber)
226  // in a similar way as for the strip number - see
227  // the code below.
228  bool goodToMerge = isGoodToMerge(ensemble, seeds[NNN], seeds[MMM]);
229  if(goodToMerge){
230  // merge chains!
231  // merge by adding seed NNN to seed MMM and erasing seed NNN
232 
233  // add seed NNN to MMM (lower to larger number)
234  seeds[MMM].insert(seeds[MMM].end(),seeds[NNN].begin(),seeds[NNN].end());
235 
236  // mark seed NNN as used
237  usedCluster[NNN] = true;
238  // we have merged a seed (NNN) to the highter seed (MMM) - need to contimue to
239  // next seed (NNN+1)
240  break;
241  }
242 
243  }
244  }
245 
246  // hand over the final seeds to the output
247  // would be more elegant if we could do the above step with
248  // erasing the merged ones, rather than the
249 
250  for(size_t NNN = 0; NNN < seeds.size(); ++NNN) {
251  if(usedCluster[NNN]) continue; //skip seeds that have been marked as used up in merging
252  rechits_chains.push_back(seeds[NNN]);
253  }
254 
255  //***************************************************************
256 
257  return rechits_chains;
258 }
int i
Definition: DBlmapReader.cc:9
bool isGoodToMerge(const ME0Ensemble &ensemble, const EnsembleHitContainer &newChain, const EnsembleHitContainer &oldChain)
std::vector< const ME0RecHit * > EnsembleHitContainer
Typedefs.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define end
Definition: vmac.h:37
std::vector< EnsembleHitContainer > ProtoSegments
#define begin
Definition: vmac.h:30
ME0SegmentAlgorithm::ProtoSegments ME0SegmentAlgorithm::clusterHits ( const EnsembleHitContainer rechits)
private

Utility functions.

Definition at line 99 of file ME0SegmentAlgorithm.cc.

References begin, dXclusBoxMax, dYclusBoxMax, end, i, LogDebug, running_max, findQualityFiles::size, x, and y.

Referenced by run().

99  {
100 
101  ProtoSegments rechits_clusters; // this is a collection of groups of rechits
102 
103  float dXclus_box = 0.0;
104  float dYclus_box = 0.0;
105 
106  ProtoSegments seeds; seeds.reserve(rechits.size());
107 
108  std::vector<float> running_meanX; running_meanX.reserve(rechits.size());
109  std::vector<float> running_meanY; running_meanY.reserve(rechits.size());
110 
111  std::vector<float> seed_minX; seed_minX.reserve(rechits.size());
112  std::vector<float> seed_maxX; seed_maxX.reserve(rechits.size());
113  std::vector<float> seed_minY; seed_minY.reserve(rechits.size());
114  std::vector<float> seed_maxY; seed_maxY.reserve(rechits.size());
115 
116  // split rechits into subvectors and return vector of vectors:
117  // Loop over rechits
118  // Create one seed per hit
119  for(unsigned int i = 0; i < rechits.size(); ++i) {
120  seeds.push_back(EnsembleHitContainer(1,rechits[i]));
121 
122  // First added hit in seed defines the mean to which the next hit is compared
123  // for this seed.
124 
125  running_meanX.push_back( rechits[i]->localPosition().x() );
126  running_meanY.push_back( rechits[i]->localPosition().y() );
127 
128  // set min/max X and Y for box containing the hits in the precluster:
129  seed_minX.push_back( rechits[i]->localPosition().x() );
130  seed_maxX.push_back( rechits[i]->localPosition().x() );
131  seed_minY.push_back( rechits[i]->localPosition().y() );
132  seed_maxY.push_back( rechits[i]->localPosition().y() );
133  }
134 
135  // merge clusters that are too close
136  // measure distance between final "running mean"
137  for(size_t NNN = 0; NNN < seeds.size(); ++NNN) {
138  for(size_t MMM = NNN+1; MMM < seeds.size(); ++MMM) {
139  if(running_meanX[MMM] == running_max || running_meanX[NNN] == running_max ) {
140  LogDebug("ME0SegmentAlgorithm") << "[ME0SegmentAlgorithm::clusterHits]: ALARM! Skipping used seeds, this should not happen - inform developers!";
141  continue; //skip seeds that have been used
142  }
143 
144  // calculate cut criteria for simple running mean distance cut:
145  //dXclus = fabs(running_meanX[NNN] - running_meanX[MMM]);
146  //dYclus = fabs(running_meanY[NNN] - running_meanY[MMM]);
147  // calculate minmal distance between precluster boxes containing the hits:
148  if ( running_meanX[NNN] > running_meanX[MMM] ) dXclus_box = seed_minX[NNN] - seed_maxX[MMM];
149  else dXclus_box = seed_minX[MMM] - seed_maxX[NNN];
150  if ( running_meanY[NNN] > running_meanY[MMM] ) dYclus_box = seed_minY[NNN] - seed_maxY[MMM];
151  else dYclus_box = seed_minY[MMM] - seed_maxY[NNN];
152 
153 
154  if( dXclus_box < dXclusBoxMax && dYclus_box < dYclusBoxMax ) {
155  // merge clusters!
156  // merge by adding seed NNN to seed MMM and erasing seed NNN
157 
158  // calculate running mean for the merged seed:
159  if(seeds[NNN].size()+seeds[MMM].size() != 0) {
160  running_meanX[MMM] = (running_meanX[NNN]*seeds[NNN].size() + running_meanX[MMM]*seeds[MMM].size()) / (seeds[NNN].size()+seeds[MMM].size());
161  running_meanY[MMM] = (running_meanY[NNN]*seeds[NNN].size() + running_meanY[MMM]*seeds[MMM].size()) / (seeds[NNN].size()+seeds[MMM].size());
162  }
163 
164  // update min/max X and Y for box containing the hits in the merged cluster:
165  if ( seed_minX[NNN] < seed_minX[MMM] ) seed_minX[MMM] = seed_minX[NNN];
166  if ( seed_maxX[NNN] > seed_maxX[MMM] ) seed_maxX[MMM] = seed_maxX[NNN];
167  if ( seed_minY[NNN] < seed_minY[MMM] ) seed_minY[MMM] = seed_minY[NNN];
168  if ( seed_maxY[NNN] > seed_maxY[MMM] ) seed_maxY[MMM] = seed_maxY[NNN];
169 
170  // add seed NNN to MMM (lower to larger number)
171  seeds[MMM].insert(seeds[MMM].end(),seeds[NNN].begin(),seeds[NNN].end());
172 
173  // mark seed NNN as used (at the moment just set running mean to 999999.)
174  running_meanX[NNN] = running_max;
175  running_meanY[NNN] = running_max;
176  // we have merged a seed (NNN) to the highter seed (MMM) - need to contimue to
177  // next seed (NNN+1)
178  break;
179  }
180  }
181  }
182 
183  // hand over the final seeds to the output
184  // would be more elegant if we could do the above step with
185  // erasing the merged ones, rather than the
186  for(size_t NNN = 0; NNN < seeds.size(); ++NNN) {
187  if(running_meanX[NNN] == running_max) continue; //skip seeds that have been marked as used up in merging
188  rechits_clusters.push_back(seeds[NNN]);
189  }
190 
191  return rechits_clusters;
192 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::vector< const ME0RecHit * > EnsembleHitContainer
Typedefs.
#define end
Definition: vmac.h:37
std::vector< EnsembleHitContainer > ProtoSegments
#define begin
Definition: vmac.h:30
tuple size
Write out results.
bool ME0SegmentAlgorithm::isGoodToMerge ( const ME0Ensemble ensemble,
const EnsembleHitContainer newChain,
const EnsembleHitContainer oldChain 
)
private

Definition at line 260 of file ME0SegmentAlgorithm.cc.

References funct::abs(), reco::deltaPhi(), dEtaChainBoxMax, dPhiChainBoxMax, dTimeChainBoxMax, PV3DBase< T, PVType, FrameType >::eta(), and PV3DBase< T, PVType, FrameType >::phi().

Referenced by chainHits().

260  {
261  for(size_t iRH_new = 0;iRH_new<newChain.size();++iRH_new){
262  GlobalPoint pos_new = ensemble.first->toGlobal(newChain[iRH_new]->localPosition());
263 
264  for(size_t iRH_old = 0;iRH_old<oldChain.size();++iRH_old){
265  GlobalPoint pos_old = ensemble.first->toGlobal(oldChain[iRH_old]->localPosition());
266  // to be chained, two hits need to be in neighbouring layers...
267  // or better allow few missing layers (upto 3 to avoid inefficiencies);
268  // however we'll not make an angle correction because it
269  // worsen the situation in some of the "regular" cases
270  // (not making the correction means that the conditions for
271  // forming a cluster are different if we have missing layers -
272  // this could affect events at the boundaries )
273 
274  // to be chained, two hits need also to be "close" in phi and eta
275  if (std::abs(reco::deltaPhi( float(pos_new.phi()), float(pos_old.phi()) )) >= dPhiChainBoxMax) continue;
276  if (std::abs(pos_new.eta()-pos_old.eta()) >= dEtaChainBoxMax) continue;
277  // and the difference in layer index should be < (nlayers-1)
278  if (std::abs(newChain[iRH_new]->me0Id().layer() - oldChain[iRH_old]->me0Id().layer()) >= (ensemble.first->id().nlayers()-1)) continue;
279  // and they should have a time difference compatible with the hypothesis
280  // that the rechits originate from the same particle, but were detected in different layers
281  if (std::abs(newChain[iRH_new]->tof() - oldChain[iRH_old]->tof()) >= dTimeChainBoxMax) continue;
282 
283  return true;
284  }
285  }
286  return false;
287 }
Geom::Phi< T > phi() const
Definition: PV3DBase.h:69
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double deltaPhi(double phi1, double phi2)
Definition: deltaPhi.h:22
T eta() const
Definition: PV3DBase.h:76
std::vector< ME0Segment > ME0SegmentAlgorithm::run ( const ME0Ensemble ensemble,
const EnsembleHitContainer rechits 
)

Build segments for all desired groups of hits

Definition at line 51 of file ME0SegmentAlgorithm.cc.

References buildSegments(), chainHits(), clusterHits(), preClustering, and preClustering_useChaining.

51  {
52 
53  #ifdef EDM_ML_DEBUG // have lines below only compiled when in debug mode
54  ME0DetId chId((ensemble.first)->id());
55  edm::LogVerbatim("ME0SegAlgoMM") << "[ME0SegmentAlgorithm::run] build segments in chamber " << chId << " which contains "<<rechits.size()<<" rechits";
56  for (auto rh=rechits.begin(); rh!=rechits.end(); ++rh){
57  auto me0id = (*rh)->me0Id();
58  auto rhLP = (*rh)->localPosition();
59  edm::LogVerbatim("ME0SegmentAlgorithm") << "[RecHit :: Loc x = "<<std::showpos<<std::setw(9)<<rhLP.x()<<" Loc y = "<<std::showpos<<std::setw(9)<<rhLP.y()<<" Time = "<<std::showpos<<(*rh)->tof()<<" -- "<<me0id.rawId()<<" = "<<me0id<<" ]";
60  }
61  #endif
62 
63  // pre-cluster rechits and loop over all sub clusters separately
64  std::vector<ME0Segment> segments_temp;
65  std::vector<ME0Segment> segments;
66  ProtoSegments rechits_clusters; // this is a collection of groups of rechits
67 
68  if(preClustering) {
69  // run a pre-clusterer on the given rechits to split obviously separated segment seeds:
71  // it uses X,Y,Z information; there are no configurable parameters used;
72  // the X, Y, Z "cuts" are just (much) wider than reasonable high pt segments
73  rechits_clusters = this->chainHits(ensemble, rechits );
74  }
75  else{
76  // it uses X,Y information + configurable parameters
77  rechits_clusters = this->clusterHits(rechits );
78  }
79  // loop over the found clusters:
80  for(auto sub_rechits = rechits_clusters.begin(); sub_rechits != rechits_clusters.end(); ++sub_rechits ) {
81  // clear the buffer for the subset of segments:
82  segments_temp.clear();
83  // build the subset of segments:
84  this->buildSegments(ensemble, (*sub_rechits), segments_temp );
85  // add the found subset of segments to the collection of all segments in this chamber:
86  segments.insert( segments.end(), segments_temp.begin(), segments_temp.end() );
87  }
88  return segments;
89  }
90  else {
91  this->buildSegments(ensemble, rechits, segments);
92  return segments;
93  }
94 }
ProtoSegments clusterHits(const EnsembleHitContainer &rechits)
Utility functions.
void buildSegments(const ME0Ensemble &ensemble, const EnsembleHitContainer &rechits, std::vector< ME0Segment > &me0segs)
std::vector< EnsembleHitContainer > ProtoSegments
ProtoSegments chainHits(const ME0Ensemble &ensemble, const EnsembleHitContainer &rechits)

Member Data Documentation

bool ME0SegmentAlgorithm::debug
private

Definition at line 61 of file ME0SegmentAlgorithm.h.

Referenced by ME0SegmentAlgorithm().

double ME0SegmentAlgorithm::dEtaChainBoxMax
private

Definition at line 68 of file ME0SegmentAlgorithm.h.

Referenced by isGoodToMerge(), and ME0SegmentAlgorithm().

double ME0SegmentAlgorithm::dPhiChainBoxMax
private

Definition at line 67 of file ME0SegmentAlgorithm.h.

Referenced by isGoodToMerge(), and ME0SegmentAlgorithm().

double ME0SegmentAlgorithm::dTimeChainBoxMax
private

Definition at line 69 of file ME0SegmentAlgorithm.h.

Referenced by chainHits(), isGoodToMerge(), and ME0SegmentAlgorithm().

double ME0SegmentAlgorithm::dXclusBoxMax
private

Definition at line 64 of file ME0SegmentAlgorithm.h.

Referenced by clusterHits(), and ME0SegmentAlgorithm().

double ME0SegmentAlgorithm::dYclusBoxMax
private

Definition at line 65 of file ME0SegmentAlgorithm.h.

Referenced by clusterHits(), and ME0SegmentAlgorithm().

int ME0SegmentAlgorithm::maxRecHitsInCluster
private

Definition at line 70 of file ME0SegmentAlgorithm.h.

Referenced by ME0SegmentAlgorithm().

unsigned int ME0SegmentAlgorithm::minHitsPerSegment
private

Definition at line 62 of file ME0SegmentAlgorithm.h.

Referenced by buildSegments(), and ME0SegmentAlgorithm().

const std::string ME0SegmentAlgorithm::myName
private

Definition at line 58 of file ME0SegmentAlgorithm.h.

bool ME0SegmentAlgorithm::preClustering
private

Definition at line 63 of file ME0SegmentAlgorithm.h.

Referenced by ME0SegmentAlgorithm(), and run().

bool ME0SegmentAlgorithm::preClustering_useChaining
private

Definition at line 66 of file ME0SegmentAlgorithm.h.

Referenced by ME0SegmentAlgorithm(), and run().

EnsembleHitContainer ME0SegmentAlgorithm::proto_segment
private

Definition at line 72 of file ME0SegmentAlgorithm.h.

Referenced by buildSegments().

float ME0SegmentAlgorithm::running_max =std::numeric_limits<float>::max()
staticprivate

Definition at line 74 of file ME0SegmentAlgorithm.h.

Referenced by clusterHits().

std::unique_ptr<MuonSegFit> ME0SegmentAlgorithm::sfit_
private

Definition at line 75 of file ME0SegmentAlgorithm.h.

Referenced by buildSegments().