CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes
TrajectoryFactoryBase Class Referenceabstract

#include <TrajectoryFactoryBase.h>

Inheritance diagram for TrajectoryFactoryBase:
BzeroReferenceTrajectoryFactory CombinedTrajectoryFactory DualBzeroTrajectoryFactory DualTrajectoryFactory ReferenceTrajectoryFactory TwoBodyDecayTrajectoryFactory

Public Types

typedef AlignmentAlgorithmBase::ConstTrajTrackPair ConstTrajTrackPair
 
typedef AlignmentAlgorithmBase::ConstTrajTrackPairCollection ConstTrajTrackPairCollection
 
typedef std::vector< TrajectoryStateOnSurfaceExternalPredictionCollection
 
typedef ReferenceTrajectoryBase::MaterialEffects MaterialEffects
 
typedef std::vector< ReferenceTrajectoryPtrReferenceTrajectoryCollection
 
typedef ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
 
typedef std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainerTrajectoryInput
 

Public Member Functions

virtual TrajectoryFactoryBaseclone (void) const =0
 
const edm::ParameterSetconfiguration () const
 
MaterialEffects materialEffects (void) const
 
PropagationDirection propagationDirection (void) const
 
unsigned int tracksPerTrajectory () const
 
virtual const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const =0
 
virtual const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const =0
 
 TrajectoryFactoryBase (const edm::ParameterSet &config, const edm::ConsumesCollector &iC)
 
 TrajectoryFactoryBase (const edm::ParameterSet &config, unsigned int tracksPerTrajectory, const edm::ConsumesCollector &iC)
 
virtual ~TrajectoryFactoryBase (void)
 

Protected Member Functions

virtual const TrajectoryInput innermostStateAndRecHits (const ConstTrajTrackPair &track) const
 
virtual const Trajectory::DataContainer orderedTrajectoryMeasurements (const Trajectory &trajectory) const
 
bool sameSurface (const Surface &s1, const Surface &s2) const
 
bool useRecHit (const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
 

Protected Attributes

const bool allowZeroMaterial_
 
const bool includeAPEs_
 
const bool useBeamSpot_
 

Private Member Functions

MaterialEffects materialEffects (const std::string &strME) const
 
PropagationDirection propagationDirection (const std::string &strPD) const
 

Private Attributes

const edm::ParameterSet cfg_
 
const MaterialEffects materialEffects_
 
const PropagationDirection propDir_
 
const unsigned int tracksPerTrajectory_
 
const bool useInvalidHits_
 
const bool useProjectedHits_
 
const bool useWithoutDet_
 

Detailed Description

Definition at line 21 of file TrajectoryFactoryBase.h.

Member Typedef Documentation

◆ ConstTrajTrackPair

Definition at line 25 of file TrajectoryFactoryBase.h.

◆ ConstTrajTrackPairCollection

Definition at line 26 of file TrajectoryFactoryBase.h.

◆ ExternalPredictionCollection

Definition at line 29 of file TrajectoryFactoryBase.h.

◆ MaterialEffects

Definition at line 24 of file TrajectoryFactoryBase.h.

◆ ReferenceTrajectoryCollection

Definition at line 27 of file TrajectoryFactoryBase.h.

◆ ReferenceTrajectoryPtr

Definition at line 23 of file TrajectoryFactoryBase.h.

◆ TrajectoryInput

Definition at line 28 of file TrajectoryFactoryBase.h.

Constructor & Destructor Documentation

◆ TrajectoryFactoryBase() [1/2]

TrajectoryFactoryBase::TrajectoryFactoryBase ( const edm::ParameterSet config,
const edm::ConsumesCollector iC 
)

Definition at line 9 of file TrajectoryFactoryBase.cc.

10  : TrajectoryFactoryBase(config, 1, iC) {}
Definition: config.py:1
TrajectoryFactoryBase(const edm::ParameterSet &config, const edm::ConsumesCollector &iC)

◆ TrajectoryFactoryBase() [2/2]

TrajectoryFactoryBase::TrajectoryFactoryBase ( const edm::ParameterSet config,
unsigned int  tracksPerTrajectory,
const edm::ConsumesCollector iC 
)

Definition at line 12 of file TrajectoryFactoryBase.cc.

References allowZeroMaterial_, cfg_, edm::ParameterSet::getParameter(), includeAPEs_, AlCaHLTBitMon_QueryRunRegistry::string, useBeamSpot_, useInvalidHits_, useProjectedHits_, and useWithoutDet_.

15  : cfg_(config),
17  materialEffects_(materialEffects(config.getParameter<std::string>("MaterialEffects"))),
18  propDir_(propagationDirection(config.getParameter<std::string>("PropagationDirection"))),
19  useWithoutDet_(config.getParameter<bool>("UseHitWithoutDet")),
20  useInvalidHits_(config.getParameter<bool>("UseInvalidHits")),
21  useProjectedHits_(config.getParameter<bool>("UseProjectedHits")),
22  useBeamSpot_(config.getParameter<bool>("UseBeamSpot")),
23  includeAPEs_(config.getParameter<bool>("IncludeAPEs")),
24  allowZeroMaterial_(config.getParameter<bool>("AllowZeroMaterial")) {
25  edm::LogInfo("Alignment") << "@SUB=TrajectoryFactoryBase"
26  << "TrajectoryFactory '" << cfg_.getParameter<std::string>("TrajectoryFactoryName")
27  << "' with following settings:"
28  << "\nmaterial effects: " << cfg_.getParameter<std::string>("MaterialEffects")
29  << "\npropagation: " << cfg_.getParameter<std::string>("PropagationDirection")
30  << "\nuse hits without det: " << (useWithoutDet_ ? "yes" : "no")
31  << "\nuse invalid hits: " << (useInvalidHits_ ? "yes" : "no")
32  << "\nuse projected hits: " << (useProjectedHits_ ? "yes" : "no")
33  << "\nuse beamspot: " << (useBeamSpot_ ? "yes" : "no")
34  << "\ninclude APEs: " << (includeAPEs_ ? "yes" : "no")
35  << "\nallow zero material: " << (allowZeroMaterial_ ? "yes" : "no");
36 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
unsigned int tracksPerTrajectory() const
const MaterialEffects materialEffects_
Definition: config.py:1
MaterialEffects materialEffects(void) const
const unsigned int tracksPerTrajectory_
Log< level::Info, false > LogInfo
const PropagationDirection propDir_
const edm::ParameterSet cfg_
PropagationDirection propagationDirection(void) const

◆ ~TrajectoryFactoryBase()

TrajectoryFactoryBase::~TrajectoryFactoryBase ( void  )
virtual

Definition at line 38 of file TrajectoryFactoryBase.cc.

38 {}

Member Function Documentation

◆ clone()

virtual TrajectoryFactoryBase* TrajectoryFactoryBase::clone ( void  ) const
pure virtual

◆ configuration()

const edm::ParameterSet& TrajectoryFactoryBase::configuration ( ) const
inline

Definition at line 50 of file TrajectoryFactoryBase.h.

References cfg_.

50 { return cfg_; }
const edm::ParameterSet cfg_

◆ innermostStateAndRecHits()

const TrajectoryFactoryBase::TrajectoryInput TrajectoryFactoryBase::innermostStateAndRecHits ( const ConstTrajTrackPair track) const
protectedvirtual

Definition at line 40 of file TrajectoryFactoryBase.cc.

References orderedTrajectoryMeasurements(), mps_fire::result, and useRecHit().

Referenced by TwoBodyDecayTrajectoryFactory::constructTrajectories(), BzeroReferenceTrajectoryFactory::trajectories(), and ReferenceTrajectoryFactory::trajectories().

41  {
43 
44  // get the trajectory measurements in the correct order, i.e. reverse if needed
45  Trajectory::DataContainer trajectoryMeasurements = this->orderedTrajectoryMeasurements(*track.first);
46  Trajectory::DataContainer::iterator itM = trajectoryMeasurements.begin();
47 
48  // get the innermost valid trajectory state - the corresponding hit must be o.k. as well
49  while (itM != trajectoryMeasurements.end()) {
50  if ((*itM).updatedState().isValid() && useRecHit((*itM).recHit()))
51  break;
52  ++itM;
53  }
54  if (itM != trajectoryMeasurements.end())
55  result.first = (*itM).updatedState();
56 
57  // get the valid RecHits
58  while (itM != trajectoryMeasurements.end()) {
59  TransientTrackingRecHit::ConstRecHitPointer aRecHit = (*itM).recHit();
60  if (useRecHit(aRecHit))
61  result.second.push_back(aRecHit);
62  ++itM;
63  }
64 
65  return result;
66 }
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:40
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
virtual const Trajectory::DataContainer orderedTrajectoryMeasurements(const Trajectory &trajectory) const

◆ materialEffects() [1/2]

MaterialEffects TrajectoryFactoryBase::materialEffects ( void  ) const
inline

◆ materialEffects() [2/2]

TrajectoryFactoryBase::MaterialEffects TrajectoryFactoryBase::materialEffects ( const std::string &  strME) const
private

Definition at line 113 of file TrajectoryFactoryBase.cc.

References ReferenceTrajectoryBase::breakPoints, ReferenceTrajectoryBase::brokenLinesCoarse, ReferenceTrajectoryBase::brokenLinesFine, ReferenceTrajectoryBase::combined, ReferenceTrajectoryBase::curvlinGBL, ReferenceTrajectoryBase::energyLoss, Exception, ReferenceTrajectoryBase::localGBL, ReferenceTrajectoryBase::multipleScattering, and ReferenceTrajectoryBase::none.

113  {
114  if (strME == "MultipleScattering")
116  if (strME == "EnergyLoss")
118  if (strME == "Combined")
120  if (strME == "None")
122  if (strME == "BreakPoints")
124  if (strME == "BrokenLines")
126  if (strME == "BrokenLinesCoarse")
128  if (strME == "BrokenLinesFine")
130  if (strME == "LocalGBL")
132  if (strME == "CurvlinGBL")
134 
135  throw cms::Exception("BadConfig") << "[TrajectoryFactoryBase::materialEffects] Unknown parameter: " << strME;
136 }

◆ orderedTrajectoryMeasurements()

const Trajectory::DataContainer TrajectoryFactoryBase::orderedTrajectoryMeasurements ( const Trajectory trajectory) const
protectedvirtual

Definition at line 68 of file TrajectoryFactoryBase.cc.

References anyDirection, DeadROC_duringRun::dir, Trajectory::direction(), Trajectory::measurements(), definitions::original, and propDir_.

Referenced by innermostStateAndRecHits(), DualBzeroTrajectoryFactory::referenceStateAndRecHits(), and DualTrajectoryFactory::referenceStateAndRecHits().

69  {
70  const PropagationDirection dir = trajectory.direction();
71  const bool hitsAreReverse = ((dir == propDir_ || propDir_ == anyDirection) ? false : true);
72 
73  const Trajectory::DataContainer& original = trajectory.measurements();
74 
75  if (hitsAreReverse) {
76  // Simply use this line instead of the copying by hand?
77  // const Trajectory::DataContainer reordered(original.rbegin(), original.rend());
78  Trajectory::DataContainer reordered;
79  reordered.reserve(original.size());
80 
81  Trajectory::DataContainer::const_reverse_iterator itM;
82  for (itM = original.rbegin(); itM != original.rend(); ++itM) {
83  reordered.push_back(*itM);
84  }
85  return reordered;
86  }
87 
88  return original;
89 }
PropagationDirection
DataContainer const & measurements() const
Definition: Trajectory.h:178
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:40
PropagationDirection const & direction() const
Definition: Trajectory.cc:133
const PropagationDirection propDir_

◆ propagationDirection() [1/2]

PropagationDirection TrajectoryFactoryBase::propagationDirection ( void  ) const
inline

◆ propagationDirection() [2/2]

PropagationDirection TrajectoryFactoryBase::propagationDirection ( const std::string &  strPD) const
private

Definition at line 138 of file TrajectoryFactoryBase.cc.

References alongMomentum, anyDirection, Exception, and oppositeToMomentum.

138  {
139  if (strPD == "oppositeToMomentum")
140  return oppositeToMomentum;
141  if (strPD == "alongMomentum")
142  return alongMomentum;
143  if (strPD == "anyDirection")
144  return anyDirection;
145 
146  throw cms::Exception("BadConfig") << "[TrajectoryFactoryBase::propagationDirection] Unknown parameter: " << strPD;
147 }

◆ sameSurface()

bool TrajectoryFactoryBase::sameSurface ( const Surface s1,
const Surface s2 
) const
protected

Definition at line 91 of file TrajectoryFactoryBase.cc.

References GloballyPositioned< T >::eta(), PV3DBase< T, PVType, FrameType >::perp(), GloballyPositioned< T >::phi(), and GloballyPositioned< T >::position().

Referenced by BzeroReferenceTrajectoryFactory::trajectories(), and ReferenceTrajectoryFactory::trajectories().

91  {
92  // - Should use perp2() instead of perp()
93  // - Should not rely on floating point equality, but make a minimal range, e.g. 1.e-6 ?
94  return (s1.eta() == s2.eta()) && (s1.phi() == s2.phi()) && (s1.position().perp() == s2.position().perp());
95 }
T perp() const
Definition: PV3DBase.h:69
const PositionType & position() const

◆ tracksPerTrajectory()

unsigned int TrajectoryFactoryBase::tracksPerTrajectory ( ) const
inline

Definition at line 51 of file TrajectoryFactoryBase.h.

References tracksPerTrajectory_.

51 { return tracksPerTrajectory_; }
const unsigned int tracksPerTrajectory_

◆ trajectories() [1/2]

virtual const ReferenceTrajectoryCollection TrajectoryFactoryBase::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const
pure virtual

◆ trajectories() [2/2]

virtual const ReferenceTrajectoryCollection TrajectoryFactoryBase::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const ExternalPredictionCollection external,
const reco::BeamSpot beamSpot 
) const
pure virtual

◆ useRecHit()

bool TrajectoryFactoryBase::useRecHit ( const TransientTrackingRecHit::ConstRecHitPointer hitPtr) const
protected

Definition at line 97 of file TrajectoryFactoryBase.cc.

References trackerHitRTTI::isProjected(), useInvalidHits_, useProjectedHits_, and useWithoutDet_.

Referenced by innermostStateAndRecHits(), DualBzeroTrajectoryFactory::referenceStateAndRecHits(), and DualTrajectoryFactory::referenceStateAndRecHits().

97  {
98  const GeomDet* det = hitPtr->det();
99  if (!det && !useWithoutDet_)
100  return false;
101 
102  if (!(useInvalidHits_ || hitPtr->isValid()))
103  return false;
104 
105  if (!useProjectedHits_) {
106  if (trackerHitRTTI::isProjected(*hitPtr))
107  return false;
108  }
109 
110  return true;
111 }
bool isProjected(TrackingRecHit const &hit)

Member Data Documentation

◆ allowZeroMaterial_

const bool TrajectoryFactoryBase::allowZeroMaterial_
protected

◆ cfg_

const edm::ParameterSet TrajectoryFactoryBase::cfg_
private

Definition at line 63 of file TrajectoryFactoryBase.h.

Referenced by configuration(), and TrajectoryFactoryBase().

◆ includeAPEs_

const bool TrajectoryFactoryBase::includeAPEs_
protected

◆ materialEffects_

const MaterialEffects TrajectoryFactoryBase::materialEffects_
private

Definition at line 65 of file TrajectoryFactoryBase.h.

Referenced by materialEffects().

◆ propDir_

const PropagationDirection TrajectoryFactoryBase::propDir_
private

Definition at line 66 of file TrajectoryFactoryBase.h.

Referenced by orderedTrajectoryMeasurements(), and propagationDirection().

◆ tracksPerTrajectory_

const unsigned int TrajectoryFactoryBase::tracksPerTrajectory_
private

Definition at line 64 of file TrajectoryFactoryBase.h.

Referenced by tracksPerTrajectory().

◆ useBeamSpot_

const bool TrajectoryFactoryBase::useBeamSpot_
protected

◆ useInvalidHits_

const bool TrajectoryFactoryBase::useInvalidHits_
private

Definition at line 69 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

◆ useProjectedHits_

const bool TrajectoryFactoryBase::useProjectedHits_
private

Definition at line 70 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

◆ useWithoutDet_

const bool TrajectoryFactoryBase::useWithoutDet_
private

Definition at line 68 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().