CMS 3D CMS Logo

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

#include <DTCombinatorialPatternReco.h>

Inheritance diagram for DTCombinatorialPatternReco:
DTRecSegment2DBaseAlgo

Classes

class  TriedPattern
 

Public Types

typedef boost::unordered_set
< TriedPattern
TriedPatterns
 

Public Member Functions

virtual std::string algoName () const
 return the algo name More...
 
 DTCombinatorialPatternReco (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual edm::OwnVector
< DTSLRecSegment2D
reconstruct (const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits)
 this function is called in the producer More...
 
virtual void setES (const edm::EventSetup &setup)
 
virtual ~DTCombinatorialPatternReco ()
 Destructor. More...
 
- Public Member Functions inherited from DTRecSegment2DBaseAlgo
 DTRecSegment2DBaseAlgo (const edm::ParameterSet &)
 Constructor. More...
 
virtual ~DTRecSegment2DBaseAlgo ()
 Destructor. More...
 

Private Member Functions

DTSegmentCandbuildBestSegment (std::vector< DTSegmentCand::AssPoint > &assHits, const DTSuperLayer *sl)
 
void buildPointsCollection (std::vector< DTSegmentCand::AssPoint > &points, std::deque< std::shared_ptr< DTHitPairForFit > > &pointsNoLR, std::vector< DTSegmentCand * > &candidates, const DTSuperLayer *sl)
 
std::vector< DTSegmentCand * > buildSegments (const DTSuperLayer *sl, const std::vector< std::shared_ptr< DTHitPairForFit >> &hits)
 
bool checkDoubleCandidates (std::vector< DTSegmentCand * > &segs, DTSegmentCand *seg)
 
std::vector
< DTSegmentCand::AssPoint
findCompatibleHits (const LocalPoint &pos, const LocalVector &dir, const std::vector< std::shared_ptr< DTHitPairForFit >> &hits)
 
std::vector< std::shared_ptr
< DTHitPairForFit > > 
initHits (const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits)
 

Private Attributes

bool debug
 
std::string theAlgoName
 
double theAlphaMaxPhi
 
double theAlphaMaxTheta
 
DTSegmentCleanertheCleaner
 
edm::ESHandle< DTGeometrytheDTGeometry
 
unsigned int theMaxAllowedHits
 
TriedPatterns theTriedPattern
 
DTSegmentUpdatortheUpdator
 
bool usePairs
 

Friends

class DTCombinatorialPatternReco4D
 

Detailed Description

Algo for reconstructing 2d segment in DT using a combinatorial approach

Author
Stefano Lacaprara - INFN Legnaro stefa.nosp@m.no.l.nosp@m.acapr.nosp@m.ara@.nosp@m.pd.in.nosp@m.fn.i.nosp@m.t
Riccardo Bellan - INFN TO ricca.nosp@m.rdo..nosp@m.bella.nosp@m.n@ce.nosp@m.rn.ch

Definition at line 41 of file DTCombinatorialPatternReco.h.

Member Typedef Documentation

Definition at line 144 of file DTCombinatorialPatternReco.h.

Constructor & Destructor Documentation

DTCombinatorialPatternReco::DTCombinatorialPatternReco ( const edm::ParameterSet pset)

Constructor.

Definition at line 34 of file DTCombinatorialPatternReco.cc.

References debug, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), theAlphaMaxPhi, theAlphaMaxTheta, theCleaner, theMaxAllowedHits, theUpdator, and usePairs.

34  :
35 DTRecSegment2DBaseAlgo(pset), theAlgoName("DTCombinatorialPatternReco")
36 {
37  theMaxAllowedHits = pset.getParameter<unsigned int>("MaxAllowedHits"); // 100
38  theAlphaMaxTheta = pset.getParameter<double>("AlphaMaxTheta");// 0.1 ;
39  theAlphaMaxPhi = pset.getParameter<double>("AlphaMaxPhi");// 1.0 ;
40  debug = pset.getUntrackedParameter<bool>("debug"); //true;
41  theUpdator = new DTSegmentUpdator(pset);
42  theCleaner = new DTSegmentCleaner(pset);
43  string theHitAlgoName = pset.getParameter<string>("recAlgo");
44  usePairs = !(theHitAlgoName=="DTNoDriftAlgo");
45 }
DTRecSegment2DBaseAlgo(const edm::ParameterSet &)
Constructor.
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
DTCombinatorialPatternReco::~DTCombinatorialPatternReco ( )
virtual

Destructor.

Definition at line 48 of file DTCombinatorialPatternReco.cc.

References theCleaner, and theUpdator.

48  {
49  delete theUpdator;
50  delete theCleaner;
51 }

Member Function Documentation

virtual std::string DTCombinatorialPatternReco::algoName ( void  ) const
inlinevirtual

return the algo name

Implements DTRecSegment2DBaseAlgo.

Definition at line 59 of file DTCombinatorialPatternReco.h.

References theAlgoName.

DTSegmentCand * DTCombinatorialPatternReco::buildBestSegment ( std::vector< DTSegmentCand::AssPoint > &  assHits,
const DTSuperLayer sl 
)
private

Definition at line 313 of file DTCombinatorialPatternReco.cc.

References buildPointsCollection(), objects.IsoTrackAnalyzer::candidates, gather_cfg::cout, debug, and DTEnums::undefLR.

Referenced by buildSegments().

314  {
315  if (hits.size()<3) {
316  //cout << "buildBestSegment: hits " << hits.size()<< endl;
317  return 0; // a least 3 point
318  }
319 
320  // hits with defined LR
321  vector<DTSegmentCand::AssPoint> points;
322 
323  // without: I store both L and R, a deque since I need front insertion and
324  // deletion
325  deque<std::shared_ptr<DTHitPairForFit> > pointsNoLR;
326 
327  // first add only the hits with LR assigned
328  for (vector<DTSegmentCand::AssPoint>::const_iterator hit=hits.begin();
329  hit!=hits.end(); ++hit) {
330  if ((*hit).second != DTEnums::undefLR) {
331  points.push_back(*hit);
332  } else { // then also for the undef'd one
333  pointsNoLR.push_back((*hit).first);
334  }
335  }
336 
337  if(debug) {
338  cout << "points " << points.size() << endl;
339  cout << "pointsNoLR " << pointsNoLR.size() << endl;
340  }
341 
342  // build all possible candidates using L/R ambiguity
343  vector<DTSegmentCand*> candidates ;
344 
345  buildPointsCollection(points, pointsNoLR, candidates, sl);
346 
347  if(debug)
348  cout << "candidates " << candidates.size() << endl;
349 
350  // so now I have build a given number of segments, I should find the best one,
351  // by #hits and chi2.
352  vector<DTSegmentCand*>::const_iterator bestCandIter = candidates.end();
353  double minChi2=999999.;
354  unsigned int maxNumHits=0;
355  for (vector<DTSegmentCand*>::const_iterator iter=candidates.begin();
356  iter!=candidates.end(); ++iter) {
357  if ((*iter)->nHits()==maxNumHits && (*iter)->chi2()<minChi2) {
358  minChi2=(*iter)->chi2();
359  bestCandIter=iter;
360  } else if ((*iter)->nHits()>maxNumHits) {
361  maxNumHits=(*iter)->nHits();
362  minChi2=(*iter)->chi2();
363  bestCandIter=iter;
364  }
365  }
366 
367  // delete all candidates but the best one!
368  for (vector<DTSegmentCand*>::iterator iter=candidates.begin();
369  iter!=candidates.end(); ++iter) if (iter!=bestCandIter) delete *iter;
370 
371  // return the best candate if any
372  if (bestCandIter != candidates.end()) {
373  return (*bestCandIter);
374  }
375  return 0;
376 }
void buildPointsCollection(std::vector< DTSegmentCand::AssPoint > &points, std::deque< std::shared_ptr< DTHitPairForFit > > &pointsNoLR, std::vector< DTSegmentCand * > &candidates, const DTSuperLayer *sl)
tuple cout
Definition: gather_cfg.py:145
void DTCombinatorialPatternReco::buildPointsCollection ( std::vector< DTSegmentCand::AssPoint > &  points,
std::deque< std::shared_ptr< DTHitPairForFit > > &  pointsNoLR,
std::vector< DTSegmentCand * > &  candidates,
const DTSuperLayer sl 
)
private

build collection of compatible hits for L/R hits: the candidates is updated with the segment candidates found

Definition at line 379 of file DTCombinatorialPatternReco.cc.

References filterCSVwithJSON::copy, gather_cfg::cout, debug, DTSegmentUpdator::fit(), DTEnums::Left, DTEnums::Right, and theUpdator.

Referenced by buildBestSegment().

382  {
383 
384  if(debug) {
385  cout << "buildPointsCollection " << endl;
386  cout << "points: " << points.size() << " NOLR: " << pointsNoLR.size()<< endl;
387  }
388  if (pointsNoLR.size()>0) { // still unassociated points!
389  std::shared_ptr<DTHitPairForFit> unassHit = pointsNoLR.front();
390  // try with the right
391  if(debug)
392  cout << "Right hit" << endl;
393  points.push_back(DTSegmentCand::AssPoint(unassHit, DTEnums::Right));
394  pointsNoLR.pop_front();
395  buildPointsCollection(points, pointsNoLR, candidates, sl);
396  pointsNoLR.push_front((unassHit));
397  points.pop_back();
398 
399  // try with the left
400  if(debug)
401  cout << "Left hit" << endl;
402  points.push_back(DTSegmentCand::AssPoint(unassHit, DTEnums::Left));
403  pointsNoLR.pop_front();
404  buildPointsCollection(points, pointsNoLR, candidates, sl);
405  pointsNoLR.push_front((unassHit));
406  points.pop_back();
407  } else { // all associated
408 
409  if(debug) {
410  cout << "The Hits were" << endl;
411  copy(points.begin(), points.end(),
412  ostream_iterator<DTSegmentCand::AssPoint>(std::cout));
413  cout << "----" << endl;
414  cout << "All associated " << endl;
415  }
416  DTSegmentCand::AssPointCont pointsSet;
417 
418  // for (vector<DTSegmentCand::AssPoint>::const_iterator point=points.begin();
419  // point!=points.end(); ++point)
420  pointsSet.insert(points.begin(),points.end());
421 
422  if(debug) {
423  cout << "The Hits are" << endl;
424  copy(pointsSet.begin(), pointsSet.end(),
425  ostream_iterator<DTSegmentCand::AssPoint>(std::cout));
426  cout << "----" << endl;
427  }
428 
429  DTSegmentCand* newCand = new DTSegmentCand(pointsSet,sl);
430  if (theUpdator->fit(newCand,0,0)) candidates.push_back(newCand);
431  else delete newCand; // bad seg, too few hits
432  }
433 }
void buildPointsCollection(std::vector< DTSegmentCand::AssPoint > &points, std::deque< std::shared_ptr< DTHitPairForFit > > &pointsNoLR, std::vector< DTSegmentCand * > &candidates, const DTSuperLayer *sl)
std::pair< std::shared_ptr< DTHitPairForFit >, DTEnums::DTCellSide > AssPoint
Definition: DTSegmentCand.h:38
std::set< AssPoint, AssPointLessZ > AssPointCont
Definition: DTSegmentCand.h:40
tuple cout
Definition: gather_cfg.py:145
bool fit(DTSegmentCand *seg, bool allow3par, const bool fitdebug) const
vector< DTSegmentCand * > DTCombinatorialPatternReco::buildSegments ( const DTSuperLayer sl,
const std::vector< std::shared_ptr< DTHitPairForFit >> &  hits 
)
private

get two hits in different layers and see if there are other / hits

Definition at line 101 of file DTCombinatorialPatternReco.cc.

References buildBestSegment(), checkDoubleCandidates(), DTSegmentCleaner::clean(), gather_cfg::cout, debug, findCompatibleHits(), DTSegmentCand::good(), DTSuperLayer::id(), listHistos::IP, DTEnums::Left, query::result, DTEnums::Right, theAlphaMaxPhi, theAlphaMaxTheta, theCleaner, theMaxAllowedHits, PV3DBase< T, PVType, FrameType >::theta(), theTriedPattern, GeomDet::toGlobal(), and csvLumiCalc::unit.

Referenced by DTCombinatorialPatternReco4D::buildPhiSuperSegmentsCandidates(), and reconstruct().

102  {
103  // clear the patterns tried
104  if (debug) {
105  cout << "theTriedPattern.size is " << theTriedPattern.size() << "\n";
106  }
107  theTriedPattern.clear();
108 
109  typedef vector<std::shared_ptr<DTHitPairForFit>> hitCont;
110  typedef hitCont::const_iterator hitIter;
111  vector<DTSegmentCand*> result;
112 
113  if(debug) {
114  cout << "buildSegments: " << sl->id() << " nHits " << hits.size() << endl;
115  for (vector<std::shared_ptr<DTHitPairForFit>>::const_iterator hit=hits.begin();
116  hit!=hits.end(); ++hit) cout << **hit<< endl;
117  }
118 
119  // 10-Mar-2004 SL
120  // put a protection against heavily populated chambers, for which the segment
121  // building could lead to infinite memory usage...
122  if (hits.size() > theMaxAllowedHits ) {
123  if(debug) {
124  cout << "Warning: this SuperLayer " << sl->id() << " has too many hits : "
125  << hits.size() << " max allowed is " << theMaxAllowedHits << endl;
126  cout << "Skipping segment reconstruction... " << endl;
127  }
128  return result;
129  }
130 
132  // compatible with them
133  for (hitCont::const_iterator firstHit=hits.begin(); firstHit!=hits.end();
134  ++firstHit) {
135  for (hitCont::const_reverse_iterator lastHit=hits.rbegin();
136  (*lastHit)!=(*firstHit); ++lastHit) {
137  //if ( (*lastHit)->id().layerId() == (*firstHit)->id().layerId() ) continue; // hits must be in different layers!
138  // hits must nor in the same nor in adiacent layers
139  if ( fabs((*lastHit)->id().layerId()-(*firstHit)->id().layerId())<=1 ) continue;
140  if(debug) {
141  cout << "Selected these two hits pair " << endl;
142  cout << "First " << *(*firstHit) << " Layer Id: " << (*firstHit)->id().layerId() << endl;
143  cout << "Last " << *(*lastHit) << " Layer Id: " << (*lastHit)->id().layerId() << endl;
144  }
145 
146  GlobalPoint IP;
147  float DAlphaMax;
148  if ((sl->id()).superlayer()==2) // Theta SL
149  DAlphaMax=theAlphaMaxTheta;
150  else // Phi SL
151  DAlphaMax=theAlphaMaxPhi;
152 
154  for (int firstLR=0; firstLR<2; ++firstLR) {
155  for (int lastLR=0; lastLR<2; ++lastLR) {
156  // TODO move the global transformation in the DTHitPairForFit class
157  // when it will be moved I will able to remove the sl from the input parameter
158  GlobalPoint gposFirst=sl->toGlobal( (*firstHit)->localPosition(codes[firstLR]) );
159  GlobalPoint gposLast= sl->toGlobal( (*lastHit)->localPosition(codes[lastLR]) );
160 
161  GlobalVector gvec=gposLast-gposFirst;
162  GlobalVector gvecIP=gposLast-IP;
163 
164  // difference in angle measured
165  float DAlpha=fabs(gvec.theta()-gvecIP.theta());
166 
167  // cout << "DAlpha " << DAlpha << endl;
168  if (DAlpha<DAlphaMax) {
169 
170  // create a segment hypotesis
171  // I don't need a true segment, just direction and position
172  LocalPoint posIni = (*firstHit)->localPosition(codes[firstLR]);
173  LocalVector dirIni =
174  ((*lastHit)->localPosition(codes[lastLR])-posIni).unit();
175 
176  // search for other compatible hits, with or without the L/R solved
177  vector<DTSegmentCand::AssPoint> assHits = findCompatibleHits(posIni, dirIni, hits);
178  if(debug)
179  cout << "compatible hits " << assHits.size() << endl;
180 
181  // get the best segment with these hits: it's just one!
182  // (is it correct?)
183  DTSegmentCand* seg = buildBestSegment(assHits, sl);
184 
185  if (seg) {
186  if(debug)
187  cout << "segment " << *seg<< endl;
188 
189  // check if the chi2 and #hits are ok
190  if (!seg->good()) {
191  delete seg;
192  } else {
193 
194  // remove duplicated segments (I know, would be better to do it before the
195  // fit...)
196  if (checkDoubleCandidates(result,seg)) {
197  // add to the vector of hypotesis
198  result.push_back(seg);
199  if(debug)
200  cout << "result is now " << result.size() << endl;
201  } else { // delete it!
202  delete seg;
203  if(debug)
204  cout << "already existing" << endl;
205  }
206  }
207  }
208  }
209  }
210  }
211  }
212  }
213  if (debug) {
214  for (vector<DTSegmentCand*>::const_iterator seg=result.begin();
215  seg!=result.end(); ++seg)
216  cout << *(*seg) << endl;
217  }
218 
219  // now I have a couple of segment hypotesis, should check for ghost
220  result = theCleaner->clean(result);
221  if (debug) {
222  cout << "result no ghost " << result.size() << endl;
223  for (vector<DTSegmentCand*>::const_iterator seg=result.begin();
224  seg!=result.end(); ++seg)
225  cout << *(*seg) << endl;
226  }
227 
228  return result;
229 }
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:52
DTCellSide
Which side of the DT cell.
Definition: DTEnums.h:15
std::vector< DTSegmentCand * > clean(const std::vector< DTSegmentCand * > &inputCands) const
do the cleaning
virtual bool good() const
std::vector< std::shared_ptr< DTHitPairForFit > > hitCont
bool checkDoubleCandidates(std::vector< DTSegmentCand * > &segs, DTSegmentCand *seg)
Geom::Theta< T > theta() const
Definition: PV3DBase.h:75
DTSuperLayerId id() const
Return the DetId of this SL.
Definition: DTSuperLayer.cc:36
string unit
Definition: csvLumiCalc.py:46
tuple result
Definition: query.py:137
tuple IP
Definition: listHistos.py:76
hitCont::const_iterator hitIter
DTSegmentCand * buildBestSegment(std::vector< DTSegmentCand::AssPoint > &assHits, const DTSuperLayer *sl)
std::vector< DTSegmentCand::AssPoint > findCompatibleHits(const LocalPoint &pos, const LocalVector &dir, const std::vector< std::shared_ptr< DTHitPairForFit >> &hits)
tuple cout
Definition: gather_cfg.py:145
bool DTCombinatorialPatternReco::checkDoubleCandidates ( std::vector< DTSegmentCand * > &  segs,
DTSegmentCand seg 
)
private

Definition at line 436 of file DTCombinatorialPatternReco.cc.

Referenced by buildSegments().

437  {
438  for (vector<DTSegmentCand*>::iterator cand=cands.begin();
439  cand!=cands.end(); ++cand)
440  if (*(*cand)==*seg) return false;
441  return true;
442 }
vector< DTSegmentCand::AssPoint > DTCombinatorialPatternReco::findCompatibleHits ( const LocalPoint pos,
const LocalVector dir,
const std::vector< std::shared_ptr< DTHitPairForFit >> &  hits 
)
private

Definition at line 233 of file DTCombinatorialPatternReco.cc.

References DTCombinatorialPatternReco::TriedPattern::begin(), filterCSVwithJSON::copy, gather_cfg::cout, debug, DTCombinatorialPatternReco::TriedPattern::end(), DTEnums::Left, DTCombinatorialPatternReco::TriedPattern::push_back(), query::result, DTEnums::Right, theTriedPattern, DTEnums::undefLR, and usePairs.

Referenced by buildSegments().

235  {
236  if (debug) cout << "Pos: " << posIni << " Dir: "<< dirIni << endl;
237  vector<DTSegmentCand::AssPoint> result;
238 
239  // counter to early-avoid double counting in hits pattern
240  TriedPattern tried;
241  int nCompatibleHits=0;
242 
243  typedef vector<std::shared_ptr<DTHitPairForFit>> hitCont;
244  typedef hitCont::const_iterator hitIter;
245  for (hitIter hit=hits.begin(); hit!=hits.end(); ++hit) {
246  pair<bool,bool> isCompatible = (*hit)->isCompatible(posIni, dirIni);
247  if (debug)
248  cout << "isCompatible " << isCompatible.first << " " <<
249  isCompatible.second << endl;
250 
251  // if only one of the two is compatible, then the LR is assigned,
252  // otherwise is undefined
253 
254  DTEnums::DTCellSide lrcode;
255  if (isCompatible.first && isCompatible.second) {
256  usePairs ? lrcode=DTEnums::undefLR : lrcode=DTEnums::Left ; // if not usePairs then only use single side
257  tried.push_back(3);
258  nCompatibleHits++;
259  }
260  else if (isCompatible.first) {
261  lrcode=DTEnums::Left;
262  tried.push_back(2);
263  nCompatibleHits++;
264  }
265  else if (isCompatible.second) {
266  lrcode=DTEnums::Right;
267  tried.push_back(1);
268  nCompatibleHits++;
269  }
270  else {
271  tried.push_back(0);
272  continue; // neither is compatible
273  }
274  result.push_back(DTSegmentCand::AssPoint(*hit, lrcode));
275  }
276 
277 
278  // check if too few associated hits or pattern already tried
279  // TODO: two different if for nCompatibleHits < 3 =>printout and find ->
280  // printour
281  if (nCompatibleHits < 3) {
282  if (debug) {
283  cout << "Less than 3 hits " ;
284  copy(tried.begin(), tried.end(), ostream_iterator<int>(std::cout));
285  cout << endl;
286  }
287  // No need to insert into the list of patterns, as you will never search for it.
288  //theTriedPattern.insert(tried);
289  } else {
290  // try to insert, return bool if already there
291  bool isnew = theTriedPattern.insert(tried).second;
292  if (isnew) {
293  if (debug) {
294  cout << "NOT Already tried " ;
295  copy(tried.begin(), tried.end(), ostream_iterator<int>(std::cout));
296  cout << endl;
297  }
298  } else {
299  if (debug) {
300  cout << "Already tried " ;
301  copy(tried.begin(), tried.end(), ostream_iterator<int>(std::cout));
302  cout << endl;
303 
304  }
305  // empty the result vector
306  result.clear();
307  }
308  }
309  return result;
310 }
std::pair< std::shared_ptr< DTHitPairForFit >, DTEnums::DTCellSide > AssPoint
Definition: DTSegmentCand.h:38
DTCellSide
Which side of the DT cell.
Definition: DTEnums.h:15
std::vector< std::shared_ptr< DTHitPairForFit > > hitCont
tuple result
Definition: query.py:137
hitCont::const_iterator hitIter
tuple cout
Definition: gather_cfg.py:145
vector< std::shared_ptr< DTHitPairForFit > > DTCombinatorialPatternReco::initHits ( const DTSuperLayer sl,
const std::vector< DTRecHit1DPair > &  hits 
)
private

Definition at line 89 of file DTCombinatorialPatternReco.cc.

References query::result, and theDTGeometry.

Referenced by DTCombinatorialPatternReco4D::buildPhiSuperSegmentsCandidates(), and reconstruct().

90  {
91 
92  vector<std::shared_ptr<DTHitPairForFit>> result;
93  for (vector<DTRecHit1DPair>::const_iterator hit=hits.begin();
94  hit!=hits.end(); ++hit) {
95  result.push_back(std::make_shared<DTHitPairForFit>(*hit, *sl, theDTGeometry));
96  }
97  return result;
98 }
tuple result
Definition: query.py:137
edm::ESHandle< DTGeometry > theDTGeometry
edm::OwnVector< DTSLRecSegment2D > DTCombinatorialPatternReco::reconstruct ( const DTSuperLayer sl,
const std::vector< DTRecHit1DPair > &  hits 
)
virtual

this function is called in the producer

Implements DTRecSegment2DBaseAlgo.

Definition at line 55 of file DTCombinatorialPatternReco.cc.

References edm::OwnVector< T, P >::back(), buildSegments(), objects.IsoTrackAnalyzer::candidates, gather_cfg::cout, debug, initHits(), edm::OwnVector< T, P >::push_back(), query::result, theUpdator, and DTSegmentUpdator::update().

Referenced by DTCombinatorialPatternReco4D::reconstruct().

56  {
57 
59  vector<std::shared_ptr<DTHitPairForFit>> hitsForFit = initHits(sl, pairs);
60 
61  vector<DTSegmentCand*> candidates = buildSegments(sl, hitsForFit);
62 
63  vector<DTSegmentCand*>::const_iterator cand=candidates.begin();
64  while (cand<candidates.end()) {
65 
66  DTSLRecSegment2D *segment = (**cand);
67 
68  theUpdator->update(segment,0);
69 
70  result.push_back(segment);
71 
72  if (debug) {
73  cout<<"Reconstructed 2D segments "<< result.back() <<endl;
74  }
75 
76  delete *(cand++); // delete the candidate!
77  }
78 
79  return result;
80 }
reference back()
Definition: OwnVector.h:401
std::vector< std::shared_ptr< DTHitPairForFit > > initHits(const DTSuperLayer *sl, const std::vector< DTRecHit1DPair > &hits)
void push_back(D *&d)
Definition: OwnVector.h:290
tuple result
Definition: query.py:137
std::vector< DTSegmentCand * > buildSegments(const DTSuperLayer *sl, const std::vector< std::shared_ptr< DTHitPairForFit >> &hits)
tuple cout
Definition: gather_cfg.py:145
void update(DTRecSegment4D *seg, const bool calcT0, bool allow3par) const
recompute hits position and refit the segment4D
void DTCombinatorialPatternReco::setES ( const edm::EventSetup setup)
virtual

Through this function the EventSetup is percolated to the objs which request it

Implements DTRecSegment2DBaseAlgo.

Definition at line 82 of file DTCombinatorialPatternReco.cc.

References edm::EventSetup::get(), DTSegmentUpdator::setES(), theDTGeometry, and theUpdator.

Referenced by DTCombinatorialPatternReco4D::setES().

82  {
83  // Get the DT Geometry
84  setup.get<MuonGeometryRecord>().get(theDTGeometry);
85  theUpdator->setES(setup);
86 }
void setES(const edm::EventSetup &setup)
set the setup
edm::ESHandle< DTGeometry > theDTGeometry
const T & get() const
Definition: EventSetup.h:56

Friends And Related Function Documentation

friend class DTCombinatorialPatternReco4D
friend

Definition at line 68 of file DTCombinatorialPatternReco.h.

Member Data Documentation

bool DTCombinatorialPatternReco::debug
private
std::string DTCombinatorialPatternReco::theAlgoName
private

Definition at line 100 of file DTCombinatorialPatternReco.h.

Referenced by algoName().

double DTCombinatorialPatternReco::theAlphaMaxPhi
private

Definition at line 103 of file DTCombinatorialPatternReco.h.

Referenced by buildSegments(), and DTCombinatorialPatternReco().

double DTCombinatorialPatternReco::theAlphaMaxTheta
private

Definition at line 102 of file DTCombinatorialPatternReco.h.

Referenced by buildSegments(), and DTCombinatorialPatternReco().

DTSegmentCleaner* DTCombinatorialPatternReco::theCleaner
private
edm::ESHandle<DTGeometry> DTCombinatorialPatternReco::theDTGeometry
private

Definition at line 109 of file DTCombinatorialPatternReco.h.

Referenced by initHits(), and setES().

unsigned int DTCombinatorialPatternReco::theMaxAllowedHits
private

Definition at line 101 of file DTCombinatorialPatternReco.h.

Referenced by buildSegments(), and DTCombinatorialPatternReco().

TriedPatterns DTCombinatorialPatternReco::theTriedPattern
private

Definition at line 147 of file DTCombinatorialPatternReco.h.

Referenced by buildSegments(), and findCompatibleHits().

DTSegmentUpdator* DTCombinatorialPatternReco::theUpdator
private
bool DTCombinatorialPatternReco::usePairs
private

Definition at line 105 of file DTCombinatorialPatternReco.h.

Referenced by DTCombinatorialPatternReco(), and findCompatibleHits().