CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
TrajAnnealing Class Reference

#include <TrajAnnealing.h>

Public Member Functions

float getAnnealing () const
 
Trajectory const & getTraj () const
 
 TrajAnnealing ()
 
 TrajAnnealing (const Trajectory &, float)
 
std::vector< float > & weights ()
 
std::vector< float > const & weights () const
 

Private Member Functions

std::pair< float, std::vector< float > > getAnnealingWeight (const TrackingRecHit &aRecHit) const
 

Private Attributes

float annealing_ = 0
 
TrackingRecHit::RecHitContainer theHits_
 
std::vector< float > theWeights
 
Trajectory traj_
 

Detailed Description

This class allow to save all the traj info for each annealing cycle suitable for algorithm like DAF (not used in default options)

Definition at line 13 of file TrajAnnealing.h.

Constructor & Destructor Documentation

◆ TrajAnnealing() [1/2]

TrajAnnealing::TrajAnnealing ( )
inline

Definition at line 15 of file TrajAnnealing.h.

15 {}

◆ TrajAnnealing() [2/2]

TrajAnnealing::TrajAnnealing ( const Trajectory traj,
float  ann 
)

Definition at line 6 of file TrajAnnealing.cc.

6  {
7  traj_ = traj;
8  annealing_ = ann;
9 
10  const Trajectory::DataContainer& measurements = traj_.measurements();
11  if (measurements.size() > 2) {
12  Trajectory::DataContainer::const_iterator ibegin, iend;
13  int increment(0);
14  if (traj.direction() == alongMomentum) {
15  ibegin = measurements.begin() + 1;
16  iend = measurements.end() - 1;
17  increment = 1;
18  } else {
19  ibegin = measurements.end() - 2;
20  iend = measurements.begin();
21  increment = -1;
22  }
23 
24  for (Trajectory::DataContainer::const_iterator imeas = ibegin; imeas != iend; imeas += increment) {
25  theHits_.push_back(imeas->recHit());
26  if (imeas->recHit()->isValid()) {
27  SiTrackerMultiRecHit const& mHit = dynamic_cast<SiTrackerMultiRecHit const&>(*imeas->recHit());
28  std::vector<const TrackingRecHit*> components = mHit.recHits();
29  int iComp = 0;
30  for (std::vector<const TrackingRecHit*>::const_iterator iter = components.begin(); iter != components.end();
31  iter++, iComp++) {
32  theWeights.push_back(mHit.weight(iComp));
33  }
34  }
35  }
36  }
37 }

References alongMomentum, annealing_, makeMuonMisalignmentScenario::components, Trajectory::direction(), Trajectory::measurements(), SiTrackerMultiRecHit::recHits(), theHits_, theWeights, traj_, and SiTrackerMultiRecHit::weight().

Member Function Documentation

◆ getAnnealing()

float TrajAnnealing::getAnnealing ( ) const
inline

Definition at line 18 of file TrajAnnealing.h.

18 { return annealing_; }

References annealing_.

◆ getAnnealingWeight()

std::pair< float, std::vector< float > > TrajAnnealing::getAnnealingWeight ( const TrackingRecHit aRecHit) const
private

Definition at line 39 of file TrajAnnealing.cc.

39  {
40  if (!aRecHit.isValid()) {
41  std::vector<float> dumpyVec = {0.0};
42  return make_pair(0.0, dumpyVec);
43  }
44 
45  SiTrackerMultiRecHit const& mHit = dynamic_cast<SiTrackerMultiRecHit const&>(aRecHit);
46  return make_pair(mHit.getAnnealingFactor(), mHit.weights());
47 }

References SiTrackerMultiRecHit::getAnnealingFactor(), TrackingRecHit::isValid(), and SiTrackerMultiRecHit::weights().

◆ getTraj()

Trajectory const& TrajAnnealing::getTraj ( ) const
inline

Definition at line 19 of file TrajAnnealing.h.

19 { return traj_; }

References traj_.

◆ weights() [1/2]

std::vector<float>& TrajAnnealing::weights ( )
inline

Definition at line 23 of file TrajAnnealing.h.

23 { return theWeights; }

References theWeights.

◆ weights() [2/2]

std::vector<float> const& TrajAnnealing::weights ( ) const
inline

Definition at line 22 of file TrajAnnealing.h.

22 { return theWeights; }

References theWeights.

Member Data Documentation

◆ annealing_

float TrajAnnealing::annealing_ = 0
private

Definition at line 27 of file TrajAnnealing.h.

Referenced by getAnnealing(), and TrajAnnealing().

◆ theHits_

TrackingRecHit::RecHitContainer TrajAnnealing::theHits_
private

Definition at line 29 of file TrajAnnealing.h.

Referenced by TrajAnnealing().

◆ theWeights

std::vector<float> TrajAnnealing::theWeights
private

Definition at line 28 of file TrajAnnealing.h.

Referenced by TrajAnnealing(), and weights().

◆ traj_

Trajectory TrajAnnealing::traj_
private

Definition at line 26 of file TrajAnnealing.h.

Referenced by getTraj(), and TrajAnnealing().

TrajAnnealing::theWeights
std::vector< float > theWeights
Definition: TrajAnnealing.h:28
TrajAnnealing::theHits_
TrackingRecHit::RecHitContainer theHits_
Definition: TrajAnnealing.h:29
Trajectory::direction
PropagationDirection const & direction() const
Definition: Trajectory.cc:133
SiTrackerMultiRecHit::recHits
std::vector< const TrackingRecHit * > recHits() const override
Access to component RecHits (if any)
Definition: SiTrackerMultiRecHit.cc:59
Trajectory::DataContainer
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:40
TrajAnnealing::annealing_
float annealing_
Definition: TrajAnnealing.h:27
SiTrackerMultiRecHit::weight
float weight(unsigned int i) const
Definition: SiTrackerMultiRecHit.h:52
TrajAnnealing::traj_
Trajectory traj_
Definition: TrajAnnealing.h:26
SiTrackerMultiRecHit::getAnnealingFactor
virtual double getAnnealingFactor() const
Definition: SiTrackerMultiRecHit.h:56
SiTrackerMultiRecHit::weights
std::vector< float > const & weights() const
Definition: SiTrackerMultiRecHit.h:47
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
makeMuonMisalignmentScenario.components
string components
Definition: makeMuonMisalignmentScenario.py:58
SiTrackerMultiRecHit
Definition: SiTrackerMultiRecHit.h:13
TrackingRecHit::isValid
bool isValid() const
Definition: TrackingRecHit.h:141
alongMomentum
Definition: PropagationDirection.h:4