CMS 3D CMS Logo

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

#include <DAFTrackProducerAlgorithm.h>

Public Member Functions

 DAFTrackProducerAlgorithm (const edm::ParameterSet &conf)
 
void runWithCandidate (const TrackingGeometry *, const MagneticField *, const std::vector< Trajectory > &, const MeasurementTrackerEvent *measTk, const TrajectoryFitter *, const TransientTrackingRecHitBuilder *, const MultiRecHitCollector *measurementTracker, const SiTrackerMultiRecHitUpdator *, const reco::BeamSpot &, AlgoProductCollection &, TrajAnnealingCollection &, bool) const
 Run the Final Fit taking TrackCandidates as input. More...
 
 ~DAFTrackProducerAlgorithm ()
 

Private Types

typedef std::pair< Trajectory
*, std::pair< reco::Track
*, PropagationDirection > > 
AlgoProduct
 
typedef std::vector< AlgoProductAlgoProductCollection
 
typedef std::vector
< TrajAnnealing
TrajAnnealingCollection
 

Private Member Functions

bool buildTrack (const Trajectory, AlgoProductCollection &algoResults, float, const reco::BeamSpot &) const
 Construct Tracks to be put in the event. More...
 
float calculateNdof (const Trajectory vtraj) const
 
int checkHits (Trajectory iInitTraj, const Trajectory iFinalTraj) const
 
std::pair
< TransientTrackingRecHit::RecHitContainer,
TrajectoryStateOnSurface
collectHits (const Trajectory vtraj, const MultiRecHitCollector *measurementCollector, const MeasurementTrackerEvent *measTk) const
 
void filter (const TrajectoryFitter *fitter, std::vector< Trajectory > &input, int minhits, std::vector< Trajectory > &output, const TransientTrackingRecHitBuilder *builder) const
 
Trajectory fit (const std::pair< TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface > &hits, const TrajectoryFitter *theFitter, Trajectory vtraj) const
 accomplishes the fitting-smoothing step for each annealing value More...
 
std::pair
< TransientTrackingRecHit::RecHitContainer,
TrajectoryStateOnSurface
updateHits (const Trajectory vtraj, const SiTrackerMultiRecHitUpdator *updator, double annealing) const
 

Private Attributes

edm::ParameterSet conf_
 
int minHits_
 

Detailed Description

All is needed to run the deterministic annealing algorithm. Ported from ORCA.

Author
tropiano, genta in May 2014 by brondolin

Definition at line 31 of file DAFTrackProducerAlgorithm.h.

Member Typedef Documentation

Definition at line 33 of file DAFTrackProducerAlgorithm.h.

Definition at line 34 of file DAFTrackProducerAlgorithm.h.

Definition at line 35 of file DAFTrackProducerAlgorithm.h.

Constructor & Destructor Documentation

DAFTrackProducerAlgorithm::DAFTrackProducerAlgorithm ( const edm::ParameterSet conf)

Definition at line 27 of file DAFTrackProducerAlgorithm.cc.

27  :
28  conf_(conf),
29  minHits_(conf.getParameter<int>("MinHits")){}
T getParameter(std::string const &) const
DAFTrackProducerAlgorithm::~DAFTrackProducerAlgorithm ( )
inline

Definition at line 40 of file DAFTrackProducerAlgorithm.h.

40 {}

Member Function Documentation

bool DAFTrackProducerAlgorithm::buildTrack ( const Trajectory  vtraj,
AlgoProductCollection algoResults,
float  ndof,
const reco::BeamSpot bs 
) const
private

Construct Tracks to be put in the event.

Definition at line 208 of file DAFTrackProducerAlgorithm.cc.

References alongMomentum, FreeTrajectoryState::charge(), Trajectory::chiSquared(), FreeTrajectoryState::curvilinearError(), Trajectory::direction(), Trajectory::firstMeasurement(), TrajectoryStateOnSurface::freeState(), TrajectoryStateClosestToBeamLine::isValid(), Trajectory::isValid(), Trajectory::lastMeasurement(), LogDebug, FreeTrajectoryState::momentum(), AlCaHLTBitMon_ParallelJobs::p, FreeTrajectoryState::position(), TrajectoryStateClosestToBeamLine::trackStateAtPCA(), TrajectoryMeasurement::updatedState(), findQualityFiles::v, PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by runWithCandidate().

212 {
213  //variable declarations
214  reco::Track * theTrack;
215  Trajectory * theTraj;
216 
217  LogDebug("DAFTrackProducerAlgorithm") <<" BUILDER " << std::endl;;
218  TrajectoryStateOnSurface innertsos;
219 
220  if ( vtraj.isValid() ){
221 
222  theTraj = new Trajectory( vtraj );
223 
224  if (vtraj.direction() == alongMomentum) {
225  //if (theTraj->direction() == oppositeToMomentum) {
226  innertsos = vtraj.firstMeasurement().updatedState();
227  } else {
228  innertsos = vtraj.lastMeasurement().updatedState();
229  }
230 
231  TSCBLBuilderNoMaterial tscblBuilder;
232  TrajectoryStateClosestToBeamLine tscbl = tscblBuilder(*(innertsos.freeState()),bs);
233 
234  if (tscbl.isValid()==false) return false;
235 
237  math::XYZPoint pos( v.x(), v.y(), v.z() );
239  math::XYZVector mom( p.x(), p.y(), p.z() );
240 
241  // LogDebug("TrackProducer") <<v<<p<<std::endl;
242 
243  theTrack = new reco::Track(vtraj.chiSquared(),
244  ndof, //in the DAF the ndof is not-integer
245  pos, mom, tscbl.trackStateAtPCA().charge(),
247 
248  AlgoProduct aProduct(theTraj,std::make_pair(theTrack,vtraj.direction()));
249  algoResults.push_back(aProduct);
250 
251  return true;
252  }
253  else
254  return false;
255 }
#define LogDebug(id)
std::pair< Trajectory *, std::pair< reco::Track *, PropagationDirection > > AlgoProduct
T y() const
Definition: PV3DBase.h:63
TrackCharge charge() const
const CurvilinearTrajectoryError & curvilinearError() const
PropagationDirection const & direction() const
Definition: Trajectory.cc:118
TrajectoryMeasurement const & lastMeasurement() const
Definition: Trajectory.h:181
FreeTrajectoryState const * freeState(bool withErrors=true) const
T z() const
Definition: PV3DBase.h:64
GlobalVector momentum() const
GlobalPoint position() const
bool isValid() const
Definition: Trajectory.h:269
TrajectoryMeasurement const & firstMeasurement() const
Definition: Trajectory.h:194
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:30
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
float chiSquared() const
Definition: Trajectory.h:252
TrajectoryStateOnSurface const & updatedState() const
T x() const
Definition: PV3DBase.h:62
float DAFTrackProducerAlgorithm::calculateNdof ( const Trajectory  vtraj) const
private

Definition at line 312 of file DAFTrackProducerAlgorithm.cc.

References makeMuonMisalignmentScenario::components, Trajectory::isValid(), getDQMSummary::iter, Trajectory::measurements(), SiTrackerMultiRecHit::recHits(), and SiTrackerMultiRecHit::weight().

Referenced by runWithCandidate().

313 {
314 
315  if (!vtraj.isValid()) return 0;
316  float ndof = 0;
317  const std::vector<TrajectoryMeasurement>& meas = vtraj.measurements();
318  for (std::vector<TrajectoryMeasurement>::const_iterator iter = meas.begin(); iter != meas.end(); iter++){
319  if (iter->recHit()->isValid()){
320  SiTrackerMultiRecHit const & mHit = dynamic_cast<SiTrackerMultiRecHit const &>(*iter->recHit());
321  std::vector<const TrackingRecHit*> components = mHit.recHits();
322  int iComp = 0;
323  for(std::vector<const TrackingRecHit*>::const_iterator iter2 = components.begin(); iter2 != components.end(); iter2++, iComp++){
324  if ((*iter2)->isValid())
325  ndof += ((*iter2)->dimension())*mHit.weight(iComp);
326  }
327 
328  }
329  }
330 
331  return ndof-5;
332 
333 }
float weight(unsigned int i) const
DataContainer const & measurements() const
Definition: Trajectory.h:203
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
bool isValid() const
Definition: Trajectory.h:269
int DAFTrackProducerAlgorithm::checkHits ( Trajectory  iInitTraj,
const Trajectory  iFinalTraj 
) const
private

Definition at line 335 of file DAFTrackProducerAlgorithm.cc.

References makeMuonMisalignmentScenario::components, TrackingRecHit::hit(), TrackingRecHit::isValid(), LogDebug, Trajectory::measurements(), TrajectoryMeasurement::recHit(), SiTrackerMultiRecHit::recHits(), histoStyle::weight, and SiTrackerMultiRecHit::weight().

Referenced by runWithCandidate().

335  {
336 
337  std::vector<TrajectoryMeasurement> initmeasurements = iInitTraj.measurements();
338  std::vector<TrajectoryMeasurement> finalmeasurements = iFinalTraj.measurements();
339  std::vector<TrajectoryMeasurement>::iterator imeas;
340  std::vector<TrajectoryMeasurement>::iterator jmeas;
341  int nSame = 0;
342  int ihit = 0;
343 
344  if( initmeasurements.empty() || finalmeasurements.empty() ){
345  LogDebug("DAFTrackProducerAlgorithm") << "Initial or Final Trajectory empty.";
346  return 0;
347  }
348 
349  if( initmeasurements.size() != finalmeasurements.size() ) {
350  LogDebug("DAFTrackProducerAlgorithm") << "Initial and Final Trajectory have different size.";
351  return 0;
352  }
353 
354  for(jmeas = initmeasurements.begin(); jmeas != initmeasurements.end(); jmeas++){
355 
356  const TrackingRecHit* initHit = jmeas->recHit()->hit();
357 
358  if(!initHit->isValid() && ihit == 0 ) continue;
359 
360  if(initHit->isValid()){
361 
362  TrajectoryMeasurement imeas = finalmeasurements.at(ihit);
363  const TrackingRecHit* finalHit = imeas.recHit()->hit();
364  const TrackingRecHit* MaxWeightHit=0;
365  float maxweight = 0;
366 
367  const SiTrackerMultiRecHit* mrh = dynamic_cast<const SiTrackerMultiRecHit*>(finalHit);
368  if (mrh){
369  std::vector<const TrackingRecHit*> components = mrh->recHits();
370  std::vector<const TrackingRecHit*>::const_iterator icomp;
371  int hitcounter=0;
372 
373  for (icomp = components.begin(); icomp != components.end(); icomp++) {
374  if((*icomp)->isValid()) {
375  double weight = mrh->weight(hitcounter);
376  if(weight > maxweight) {
377  MaxWeightHit = *icomp;
378  maxweight = weight;
379  }
380  }
381  hitcounter++;
382  }
383 
384  auto myref1 = reinterpret_cast<const BaseTrackerRecHit *>(initHit)->firstClusterRef();
385  auto myref2 = reinterpret_cast<const BaseTrackerRecHit *>(MaxWeightHit)->firstClusterRef();
386 
387  if( myref1 == myref2 ){
388  nSame++;
389  }
390  }
391  } else {
392 
393  TrajectoryMeasurement imeas = finalmeasurements.at(ihit);
394  const TrackingRecHit* finalHit = imeas.recHit()->hit();
395  if(!finalHit->isValid()){
396  nSame++;
397  }
398  }
399 
400  ihit++;
401  }
402 
403  return nSame;
404 }
#define LogDebug(id)
ConstRecHitPointer const & recHit() const
float weight(unsigned int i) const
DataContainer const & measurements() const
Definition: Trajectory.h:203
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
virtual TrackingRecHit const * hit() const
bool isValid() const
int weight
Definition: histoStyle.py:50
std::pair< TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface > DAFTrackProducerAlgorithm::collectHits ( const Trajectory  vtraj,
const MultiRecHitCollector measurementCollector,
const MeasurementTrackerEvent measTk 
) const
private

Definition at line 128 of file DAFTrackProducerAlgorithm.cc.

References getDQMSummary::iter, LogDebug, and MultiRecHitCollector::recHits().

Referenced by runWithCandidate().

131 {
132 
133  LogDebug("DAFTrackProducerAlgorithm") << "Calling DAFTrackProducerAlgorithm::collectHits";
134 
135  //getting the traj measurements from the MeasurementCollector
136  int nHits = 0;
138  std::vector<TrajectoryMeasurement> collectedmeas = measurementCollector->recHits(vtraj, measTk);
139 
140  //if the MeasurementCollector is empty, make an "empty" pair
141  //else taking the collected measured hits and building the pair
142  if( collectedmeas.empty() )
144 
145  for( std::vector<TrajectoryMeasurement>::const_iterator iter = collectedmeas.begin();
146  iter!=collectedmeas.end(); iter++ ){
147 
148  nHits++;
149  hits.push_back(iter->recHit());
150 
151  }
152 
153 
154  //TrajectoryStateWithArbitraryError() == Creates a TrajectoryState with the same parameters
155  // as the input one, but with "infinite" errors, i.e. errors so big that they don't
156  // bias a fit starting with this state.
157  //return std::make_pair(hits,TrajectoryStateWithArbitraryError()(collectedmeas.front().predictedState()));
158 
159  // I do not have to rescale the error because it is already rescaled in the fit code
160  TrajectoryStateOnSurface initialStateFromTrack = collectedmeas.front().predictedState();
161 
162  return std::make_pair(hits, initialStateFromTrack);
163 
164 }
#define LogDebug(id)
std::vector< ConstRecHitPointer > RecHitContainer
virtual std::vector< TrajectoryMeasurement > recHits(const Trajectory &, const MeasurementTrackerEvent *theMTE) const =0
void DAFTrackProducerAlgorithm::filter ( const TrajectoryFitter fitter,
std::vector< Trajectory > &  input,
int  minhits,
std::vector< Trajectory > &  output,
const TransientTrackingRecHitBuilder builder 
) const
private

Definition at line 257 of file DAFTrackProducerAlgorithm.cc.

References makeMuonMisalignmentScenario::components, alignCSCRings::e, TrajectoryFitter::fit(), edm::OwnVector< T, P >::front(), AnalysisDataFormats_SUSYBSMObjects::hc, getDQMSummary::iter, LogDebug, TkClonerImpl::makeShared(), TrackingRecHit::missing, SiTrackerMultiRecHit::recHits(), and SiTrackerMultiRecHit::weight().

260 {
261  if (input.empty()) return;
262 
263  int ngoodhits = 0;
264  std::vector<TrajectoryMeasurement> vtm = input[0].measurements();
266 
267  //count the number of non-outlier and non-invalid hits
268  for (std::vector<TrajectoryMeasurement>::reverse_iterator tm=vtm.rbegin(); tm!=vtm.rend();tm++){
269  //if the rechit is valid
270  if (tm->recHit()->isValid()) {
271  SiTrackerMultiRecHit const & mHit = dynamic_cast<SiTrackerMultiRecHit const &>(*tm->recHit());
272  std::vector<const TrackingRecHit*> components = mHit.recHits();
273  int iComp = 0;
274  bool isGood = false;
275  for(std::vector<const TrackingRecHit*>::const_iterator iter = components.begin(); iter != components.end(); iter++, iComp++){
276  //if there is at least one component with weight higher than 1e-6 then the hit is not an outlier
277  if (mHit.weight(iComp)>1e-6) {ngoodhits++; iComp++; isGood = true; break;}
278  }
279  if (isGood) {
280  TkClonerImpl hc = static_cast<TkTransientTrackingRecHitBuilder const *>(builder)->cloner();
281  auto tempHit = hc.makeShared(tm->recHit(),tm->updatedState());
282  hits.push_back(tempHit);
283  }
284  else hits.push_back(std::make_shared<InvalidTrackingRecHit>(*tm->recHit()->det(), TrackingRecHit::missing));
285  } else {
286  TkClonerImpl hc = static_cast<TkTransientTrackingRecHitBuilder const *>(builder)->cloner();
287  auto tempHit = hc.makeShared(tm->recHit(),tm->updatedState());
288  hits.push_back(tempHit);
289  }
290  }
291 
292 
293  LogDebug("DAFTrackProducerAlgorithm") << "Original number of valid hits " << input[0].foundHits() << "; after filtering " << ngoodhits;
294  //debug
295  if (ngoodhits>input[0].foundHits()) edm::LogError("DAFTrackProducerAlgorithm") << "Something wrong: the number of good hits from DAFTrackProducerAlgorithm::filter " << ngoodhits << " is higher than the original one " << input[0].foundHits();
296 
297  if (ngoodhits < minhits) return;
298 
299  TrajectoryStateOnSurface curstartingTSOS = input.front().lastMeasurement().updatedState();
300  LogDebug("DAFTrackProducerAlgorithm") << "starting tsos for final refitting " << curstartingTSOS ;
301  //curstartingTSOS.rescaleError(100);
302 
305  input.front().seed().direction()),
306  hits,
307  TrajectoryStateWithArbitraryError()(curstartingTSOS));
308  LogDebug("DAFTrackProducerAlgorithm") << "After filtering " << output.size() << " trajectories";
309 
310 }
#define LogDebug(id)
std::vector< ConstRecHitPointer > RecHitContainer
virtual TrackingRecHit::ConstRecHitPointer makeShared(SiPixelRecHit const &hit, TrajectoryStateOnSurface const &tsos) const override
Definition: TkClonerImpl.cc:47
float weight(unsigned int i) const
static std::string const input
Definition: EdmProvDump.cc:43
virtual std::vector< const TrackingRecHit * > recHits() const
Access to component RecHits (if any)
susybsm::HSCParticleCollection hc
Definition: classes.h:25
std::vector< Trajectory > fit(const Trajectory &traj, fitType type=standard) const
Trajectory DAFTrackProducerAlgorithm::fit ( const std::pair< TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface > &  hits,
const TrajectoryFitter theFitter,
Trajectory  vtraj 
) const
private

accomplishes the fitting-smoothing step for each annealing value

Definition at line 189 of file DAFTrackProducerAlgorithm.cc.

References TrajectorySeed::direction(), TrajectoryFitter::fitOne(), Trajectory::isValid(), LogDebug, and Trajectory::seed().

Referenced by runWithCandidate().

192  {
193 
194  //creating a new trajectory starting from the direction of the seed of the input one and the hits
197  vtraj.seed().direction()),
198  hits.first, hits.second);
199 
200  if( newVec.isValid() ) return newVec;
201  else{
202  LogDebug("DAFTrackProducerAlgorithm") << "Fit no valid.";
203  return Trajectory();
204  }
205 
206 }
#define LogDebug(id)
PropagationDirection direction() const
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:275
virtual Trajectory fitOne(const Trajectory &traj, fitType type=standard) const =0
bool isValid() const
Definition: Trajectory.h:269
void DAFTrackProducerAlgorithm::runWithCandidate ( const TrackingGeometry theG,
const MagneticField theMF,
const std::vector< Trajectory > &  theTrajectoryCollection,
const MeasurementTrackerEvent measTk,
const TrajectoryFitter theFitter,
const TransientTrackingRecHitBuilder builder,
const MultiRecHitCollector measurementTracker,
const SiTrackerMultiRecHitUpdator updator,
const reco::BeamSpot bs,
AlgoProductCollection algoResults,
TrajAnnealingCollection trajann,
bool  TrajAnnSaving_ 
) const

Run the Final Fit taking TrackCandidates as input.

Definition at line 32 of file DAFTrackProducerAlgorithm.cc.

References buildTrack(), calculateNdof(), checkHits(), collectHits(), generateEDF::cont, TrajectorySeed::direction(), Trajectory::direction(), fit(), Trajectory::foundHits(), SiTrackerMultiRecHitUpdator::getAnnealingProgram(), Trajectory::isValid(), LogDebug, minHits_, convertSQLiteXML::ok, Trajectory::seed(), groupFilesInBlocks::temp, and updateHits().

Referenced by DAFTrackProducer::produce().

44 {
45  LogDebug("DAFTrackProducerAlgorithm") << "Number of Trajectories: " << theTrajectoryCollection.size() << "\n";
46  int cont = 0;
47 
48  //running on src trajectory collection
49  for (std::vector<Trajectory>::const_iterator ivtraj = theTrajectoryCollection.begin();
50  ivtraj != theTrajectoryCollection.end(); ivtraj++)
51  {
52 
53  float ndof = 0;
54  Trajectory currentTraj;
55 
56  //getting trajectory
57  //no need to have std::vector<Trajectory> vtraj !
58  if ( (*ivtraj).isValid() ){
59 
60  LogDebug("DAFTrackProducerAlgorithm") << "The trajectory is valid. \n";
61 
62  //getting the MultiRecHit collection and the trajectory with a first fit-smooth round
63  std::pair<TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface> hits =
64  collectHits(*ivtraj, measurementCollector, &*measTk);
65 
66  currentTraj = fit(hits, theFitter, *ivtraj);
67 
68  //starting the annealing program
69  for (std::vector<double>::const_iterator ian = updator->getAnnealingProgram().begin();
70  ian != updator->getAnnealingProgram().end(); ian++){
71 
72  if (currentTraj.isValid()){
73 
74  LogDebug("DAFTrackProducerAlgorithm") << "Seed direction is " << currentTraj.seed().direction()
75  << ".Traj direction is " << currentTraj.direction();
76 
77  //updating MultiRecHits and fit-smooth again
78  std::pair<TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface> curiterationhits =
79  updateHits(currentTraj,updator,*ian);
80  currentTraj = fit(curiterationhits, theFitter, currentTraj);
81 
82  //saving trajectory for each annealing cycle ...
83  if(TrajAnnSaving_){
84  TrajAnnealing temp(currentTraj, *ian);
85  trajann.push_back(temp);
86  }
87 
88  LogDebug("DAFTrackProducerAlgorithm") << "done annealing value " << (*ian) ;
89 
90  }
91  else break;
92 
93 
94  } //end of annealing program
95 
96  LogDebug("DAFTrackProducerAlgorithm") << "Ended annealing program with " << (1.*checkHits(*ivtraj, currentTraj))/(1.*(*ivtraj).measurements().size())*100. << " unchanged." << std::endl;
97 
98  //computing the ndof keeping into account the weights
99  ndof = calculateNdof(currentTraj);
100 
101  //checking if the trajectory has the minimum number of valid hits ( weight (>1e-6) )
102  //in order to remove tracks with too many outliers.
103 
104  //std::vector<Trajectory> filtered;
105  //filter(theFitter, vtraj, minHits_, filtered, builder);
106 
107  if(currentTraj.foundHits() >= minHits_) {
108 
109  bool ok = buildTrack(currentTraj, algoResults, ndof, bs) ;
110  if(ok) cont++;
111 
112  }
113  else{
114  LogDebug("DAFTrackProducerAlgorithm") << "Rejecting trajectory with "
115  << currentTraj.foundHits()<<" hits";
116  }
117  }
118  else
119  LogDebug("DAFTrackProducerAlgorithm") << "Rejecting empty trajectory" << std::endl;
120 
121  } //end run on track collection
122 
123  LogDebug("DAFTrackProducerAlgorithm") << "Number of Tracks found: " << cont << "\n";
124 
125 }
#define LogDebug(id)
PropagationDirection direction() const
int foundHits() const
Definition: Trajectory.h:234
tuple cont
load Luminosity info ##
Definition: generateEDF.py:622
TrajectorySeed const & seed() const
Access to the seed used to reconstruct the Trajectory.
Definition: Trajectory.h:275
int checkHits(Trajectory iInitTraj, const Trajectory iFinalTraj) const
const std::vector< double > & getAnnealingProgram() const
PropagationDirection const & direction() const
Definition: Trajectory.cc:118
std::pair< TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface > updateHits(const Trajectory vtraj, const SiTrackerMultiRecHitUpdator *updator, double annealing) const
Trajectory fit(const std::pair< TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface > &hits, const TrajectoryFitter *theFitter, Trajectory vtraj) const
accomplishes the fitting-smoothing step for each annealing value
bool isValid() const
Definition: Trajectory.h:269
std::pair< TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface > collectHits(const Trajectory vtraj, const MultiRecHitCollector *measurementCollector, const MeasurementTrackerEvent *measTk) const
bool buildTrack(const Trajectory, AlgoProductCollection &algoResults, float, const reco::BeamSpot &) const
Construct Tracks to be put in the event.
float calculateNdof(const Trajectory vtraj) const
std::pair< TransientTrackingRecHit::RecHitContainer, TrajectoryStateOnSurface > DAFTrackProducerAlgorithm::updateHits ( const Trajectory  vtraj,
const SiTrackerMultiRecHitUpdator updator,
double  annealing 
) const
private

Definition at line 167 of file DAFTrackProducerAlgorithm.cc.

References Trajectory::measurements(), and SiTrackerMultiRecHitUpdator::update().

Referenced by runWithCandidate().

170 {
172  std::vector<TrajectoryMeasurement> vmeas = vtraj.measurements();
173  std::vector<TrajectoryMeasurement>::reverse_iterator imeas;
174 
175  //I run inversely on the trajectory obtained and update the state
176  for (imeas = vmeas.rbegin(); imeas != vmeas.rend(); imeas++){
177  TransientTrackingRecHit::RecHitPointer updated = updator->update(imeas->recHit(),
178  imeas->updatedState(), annealing);
179  hits.push_back(updated);
180  }
181 
182  TrajectoryStateOnSurface updatedStateFromTrack = vmeas.back().predictedState();
183  //updatedStateFromTrack.rescaleError(10);
184 
185  //return std::make_pair(hits,TrajectoryStateWithArbitraryError()(vmeas.back().updatedState()));
186  return std::make_pair(hits,updatedStateFromTrack);
187 }
virtual TransientTrackingRecHit::RecHitPointer update(TransientTrackingRecHit::ConstRecHitPointer original, const TrajectoryStateOnSurface &tsos, double annealing=1.) const
std::vector< ConstRecHitPointer > RecHitContainer
DataContainer const & measurements() const
Definition: Trajectory.h:203
std::shared_ptr< TrackingRecHit const > RecHitPointer

Member Data Documentation

edm::ParameterSet DAFTrackProducerAlgorithm::conf_
private

Definition at line 93 of file DAFTrackProducerAlgorithm.h.

int DAFTrackProducerAlgorithm::minHits_
private

Definition at line 94 of file DAFTrackProducerAlgorithm.h.

Referenced by runWithCandidate().