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 ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const =0
 
virtual const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const =0
 
 TrajectoryFactoryBase (const edm::ParameterSet &config)
 
 TrajectoryFactoryBase (const edm::ParameterSet &config, unsigned int tracksPerTrajectory)
 
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 20 of file TrajectoryFactoryBase.h.

Member Typedef Documentation

◆ ConstTrajTrackPair

Definition at line 24 of file TrajectoryFactoryBase.h.

◆ ConstTrajTrackPairCollection

Definition at line 25 of file TrajectoryFactoryBase.h.

◆ ExternalPredictionCollection

Definition at line 28 of file TrajectoryFactoryBase.h.

◆ MaterialEffects

Definition at line 23 of file TrajectoryFactoryBase.h.

◆ ReferenceTrajectoryCollection

Definition at line 26 of file TrajectoryFactoryBase.h.

◆ ReferenceTrajectoryPtr

Definition at line 22 of file TrajectoryFactoryBase.h.

◆ TrajectoryInput

Definition at line 27 of file TrajectoryFactoryBase.h.

Constructor & Destructor Documentation

◆ TrajectoryFactoryBase() [1/2]

TrajectoryFactoryBase::TrajectoryFactoryBase ( const edm::ParameterSet config)

Definition at line 9 of file TrajectoryFactoryBase.cc.

◆ TrajectoryFactoryBase() [2/2]

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

Definition at line 11 of file TrajectoryFactoryBase.cc.

12  : cfg_(config),
14  materialEffects_(materialEffects(config.getParameter<std::string>("MaterialEffects"))),
15  propDir_(propagationDirection(config.getParameter<std::string>("PropagationDirection"))),
16  useWithoutDet_(config.getParameter<bool>("UseHitWithoutDet")),
17  useInvalidHits_(config.getParameter<bool>("UseInvalidHits")),
18  useProjectedHits_(config.getParameter<bool>("UseProjectedHits")),
19  useBeamSpot_(config.getParameter<bool>("UseBeamSpot")),
20  includeAPEs_(config.getParameter<bool>("IncludeAPEs")),
21  allowZeroMaterial_(config.getParameter<bool>("AllowZeroMaterial")) {
22  edm::LogInfo("Alignment") << "@SUB=TrajectoryFactoryBase"
23  << "TrajectoryFactory '" << cfg_.getParameter<std::string>("TrajectoryFactoryName")
24  << "' with following settings:"
25  << "\nmaterial effects: " << cfg_.getParameter<std::string>("MaterialEffects")
26  << "\npropagation: " << cfg_.getParameter<std::string>("PropagationDirection")
27  << "\nuse hits without det: " << (useWithoutDet_ ? "yes" : "no")
28  << "\nuse invalid hits: " << (useInvalidHits_ ? "yes" : "no")
29  << "\nuse projected hits: " << (useProjectedHits_ ? "yes" : "no")
30  << "\nuse beamspot: " << (useBeamSpot_ ? "yes" : "no")
31  << "\ninclude APEs: " << (includeAPEs_ ? "yes" : "no")
32  << "\nallow zero material: " << (allowZeroMaterial_ ? "yes" : "no");
33 }

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

◆ ~TrajectoryFactoryBase()

TrajectoryFactoryBase::~TrajectoryFactoryBase ( void  )
virtual

Definition at line 35 of file TrajectoryFactoryBase.cc.

35 {}

Member Function Documentation

◆ clone()

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

◆ configuration()

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

Definition at line 47 of file TrajectoryFactoryBase.h.

47 { return cfg_; }

References cfg_.

Referenced by ReferenceTrajectoryFactory::bzeroFactory().

◆ innermostStateAndRecHits()

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

Definition at line 37 of file TrajectoryFactoryBase.cc.

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

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

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

◆ materialEffects() [1/2]

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

Definition at line 110 of file TrajectoryFactoryBase.cc.

110  {
111  if (strME == "MultipleScattering")
113  if (strME == "EnergyLoss")
115  if (strME == "Combined")
117  if (strME == "None")
119  if (strME == "BreakPoints")
121  if (strME == "BrokenLines")
123  if (strME == "BrokenLinesCoarse")
125  if (strME == "BrokenLinesFine")
127  if (strME == "LocalGBL")
129  if (strME == "CurvlinGBL")
131 
132  throw cms::Exception("BadConfig") << "[TrajectoryFactoryBase::materialEffects] Unknown parameter: " << strME;
133 }

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

◆ materialEffects() [2/2]

MaterialEffects TrajectoryFactoryBase::materialEffects ( void  ) const
inline

◆ orderedTrajectoryMeasurements()

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

Definition at line 65 of file TrajectoryFactoryBase.cc.

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

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

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

◆ propagationDirection() [1/2]

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

Definition at line 135 of file TrajectoryFactoryBase.cc.

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

References alongMomentum, anyDirection, Exception, and oppositeToMomentum.

◆ propagationDirection() [2/2]

PropagationDirection TrajectoryFactoryBase::propagationDirection ( void  ) const
inline

◆ sameSurface()

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

Definition at line 88 of file TrajectoryFactoryBase.cc.

88  {
89  // - Should use perp2() instead of perp()
90  // - Should not rely on floating point equality, but make a minimal range, e.g. 1.e-6 ?
91  return (s1.eta() == s2.eta()) && (s1.phi() == s2.phi()) && (s1.position().perp() == s2.position().perp());
92 }

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

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

◆ tracksPerTrajectory()

unsigned int TrajectoryFactoryBase::tracksPerTrajectory ( ) const
inline

Definition at line 48 of file TrajectoryFactoryBase.h.

48 { return tracksPerTrajectory_; }

References tracksPerTrajectory_.

◆ trajectories() [1/2]

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

◆ trajectories() [2/2]

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

◆ useRecHit()

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

Definition at line 94 of file TrajectoryFactoryBase.cc.

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

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

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

Member Data Documentation

◆ allowZeroMaterial_

const bool TrajectoryFactoryBase::allowZeroMaterial_
protected

◆ cfg_

const edm::ParameterSet TrajectoryFactoryBase::cfg_
private

Definition at line 60 of file TrajectoryFactoryBase.h.

Referenced by configuration(), and TrajectoryFactoryBase().

◆ includeAPEs_

const bool TrajectoryFactoryBase::includeAPEs_
protected

◆ materialEffects_

const MaterialEffects TrajectoryFactoryBase::materialEffects_
private

Definition at line 62 of file TrajectoryFactoryBase.h.

Referenced by materialEffects().

◆ propDir_

const PropagationDirection TrajectoryFactoryBase::propDir_
private

Definition at line 63 of file TrajectoryFactoryBase.h.

Referenced by orderedTrajectoryMeasurements(), and propagationDirection().

◆ tracksPerTrajectory_

const unsigned int TrajectoryFactoryBase::tracksPerTrajectory_
private

Definition at line 61 of file TrajectoryFactoryBase.h.

Referenced by tracksPerTrajectory().

◆ useBeamSpot_

const bool TrajectoryFactoryBase::useBeamSpot_
protected

◆ useInvalidHits_

const bool TrajectoryFactoryBase::useInvalidHits_
private

Definition at line 66 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

◆ useProjectedHits_

const bool TrajectoryFactoryBase::useProjectedHits_
private

Definition at line 67 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

◆ useWithoutDet_

const bool TrajectoryFactoryBase::useWithoutDet_
private

Definition at line 65 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

TrajectoryFactoryBase::useRecHit
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
Definition: TrajectoryFactoryBase.cc:94
anyDirection
Definition: PropagationDirection.h:4
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11779
GeomDet
Definition: GeomDet.h:27
ReferenceTrajectoryBase::curvlinGBL
Definition: ReferenceTrajectoryBase.h:118
TrajectoryFactoryBase::tracksPerTrajectory
unsigned int tracksPerTrajectory() const
Definition: TrajectoryFactoryBase.h:48
Trajectory::direction
PropagationDirection const & direction() const
Definition: Trajectory.cc:133
ReferenceTrajectoryBase::combined
Definition: ReferenceTrajectoryBase.h:113
trackerHitRTTI::isProjected
bool isProjected(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:29
oppositeToMomentum
Definition: PropagationDirection.h:4
TrajectoryFactoryBase::includeAPEs_
const bool includeAPEs_
Definition: TrajectoryFactoryBase.h:71
indexGen.s2
s2
Definition: indexGen.py:107
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
ReferenceTrajectoryBase::energyLoss
Definition: ReferenceTrajectoryBase.h:112
config
Definition: config.py:1
TrajectoryFactoryBase::useInvalidHits_
const bool useInvalidHits_
Definition: TrajectoryFactoryBase.h:66
Trajectory::DataContainer
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:40
TrajectoryFactoryBase::useBeamSpot_
const bool useBeamSpot_
Definition: TrajectoryFactoryBase.h:70
TrajectoryFactoryBase::propagationDirection
PropagationDirection propagationDirection(void) const
Definition: TrajectoryFactoryBase.h:46
ReferenceTrajectoryBase::brokenLinesFine
Definition: ReferenceTrajectoryBase.h:116
TrajectoryFactoryBase::tracksPerTrajectory_
const unsigned int tracksPerTrajectory_
Definition: TrajectoryFactoryBase.h:61
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrajectoryFactoryBase::useProjectedHits_
const bool useProjectedHits_
Definition: TrajectoryFactoryBase.h:67
ReferenceTrajectoryBase::multipleScattering
Definition: ReferenceTrajectoryBase.h:111
TrajectoryFactoryBase::TrajectoryInput
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
Definition: TrajectoryFactoryBase.h:27
ReferenceTrajectoryBase::breakPoints
Definition: ReferenceTrajectoryBase.h:114
definitions.original
original
Definition: definitions.py:57
TrajectoryFactoryBase::useWithoutDet_
const bool useWithoutDet_
Definition: TrajectoryFactoryBase.h:65
GloballyPositioned::eta
T eta() const
Definition: GloballyPositioned.h:41
TrackingRecHit::ConstRecHitPointer
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
Definition: TrackingRecHit.h:25
GloballyPositioned::phi
T phi() const
Definition: GloballyPositioned.h:40
TrajectoryFactoryBase::propDir_
const PropagationDirection propDir_
Definition: TrajectoryFactoryBase.h:63
ReferenceTrajectoryBase::brokenLinesCoarse
Definition: ReferenceTrajectoryBase.h:115
TrajectoryFactoryBase::materialEffects
MaterialEffects materialEffects(void) const
Definition: TrajectoryFactoryBase.h:45
Trajectory::measurements
DataContainer const & measurements() const
Definition: Trajectory.h:178
ReferenceTrajectoryBase::none
Definition: ReferenceTrajectoryBase.h:110
TrajectoryFactoryBase::allowZeroMaterial_
const bool allowZeroMaterial_
Definition: TrajectoryFactoryBase.h:72
GloballyPositioned::position
const PositionType & position() const
Definition: GloballyPositioned.h:36
Exception
Definition: hltDiff.cc:246
TrajectoryFactoryBase::cfg_
const edm::ParameterSet cfg_
Definition: TrajectoryFactoryBase.h:60
PropagationDirection
PropagationDirection
Definition: PropagationDirection.h:4
TrajectoryFactoryBase::materialEffects_
const MaterialEffects materialEffects_
Definition: TrajectoryFactoryBase.h:62
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ReferenceTrajectoryBase::localGBL
Definition: ReferenceTrajectoryBase.h:117
mps_fire.result
result
Definition: mps_fire.py:311
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
TrajectoryFactoryBase::TrajectoryFactoryBase
TrajectoryFactoryBase(const edm::ParameterSet &config)
Definition: TrajectoryFactoryBase.cc:9
alongMomentum
Definition: PropagationDirection.h:4
TrajectoryFactoryBase::orderedTrajectoryMeasurements
virtual const Trajectory::DataContainer orderedTrajectoryMeasurements(const Trajectory &trajectory) const
Definition: TrajectoryFactoryBase.cc:65
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23