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)
 
 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

Definition at line 24 of file TrajectoryFactoryBase.h.

Definition at line 25 of file TrajectoryFactoryBase.h.

Definition at line 28 of file TrajectoryFactoryBase.h.

Definition at line 23 of file TrajectoryFactoryBase.h.

Definition at line 26 of file TrajectoryFactoryBase.h.

Definition at line 22 of file TrajectoryFactoryBase.h.

Definition at line 27 of file TrajectoryFactoryBase.h.

Constructor & Destructor Documentation

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

Definition at line 9 of file TrajectoryFactoryBase.cc.

9 : TrajectoryFactoryBase(config, 1) {}
TrajectoryFactoryBase(const edm::ParameterSet &config)
TrajectoryFactoryBase::TrajectoryFactoryBase ( const edm::ParameterSet config,
unsigned int  tracksPerTrajectory 
)

Definition at line 11 of file TrajectoryFactoryBase.cc.

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

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 }
T getParameter(std::string const &) const
MaterialEffects materialEffects(void) const
const MaterialEffects materialEffects_
const unsigned int tracksPerTrajectory_
const PropagationDirection propDir_
const edm::ParameterSet cfg_
PropagationDirection propagationDirection(void) const
unsigned int tracksPerTrajectory() const
TrajectoryFactoryBase::~TrajectoryFactoryBase ( void  )
virtual

Definition at line 35 of file TrajectoryFactoryBase.cc.

35 {}

Member Function Documentation

virtual TrajectoryFactoryBase* TrajectoryFactoryBase::clone ( void  ) const
pure virtual
const edm::ParameterSet& TrajectoryFactoryBase::configuration ( ) const
inline

Definition at line 47 of file TrajectoryFactoryBase.h.

Referenced by ReferenceTrajectoryFactory::bzeroFactory().

47 { return cfg_; }
const edm::ParameterSet cfg_
const TrajectoryFactoryBase::TrajectoryInput TrajectoryFactoryBase::innermostStateAndRecHits ( const ConstTrajTrackPair track) const
protectedvirtual

Definition at line 37 of file TrajectoryFactoryBase.cc.

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

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

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 }
virtual const Trajectory::DataContainer orderedTrajectoryMeasurements(const Trajectory &trajectory) const
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:44
std::shared_ptr< TrackingRecHit const > ConstRecHitPointer
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
MaterialEffects TrajectoryFactoryBase::materialEffects ( void  ) const
inline
TrajectoryFactoryBase::MaterialEffects TrajectoryFactoryBase::materialEffects ( const std::string &  strME) const
private

Definition at line 110 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.

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 }
const Trajectory::DataContainer TrajectoryFactoryBase::orderedTrajectoryMeasurements ( const Trajectory trajectory) const
protectedvirtual

Definition at line 65 of file TrajectoryFactoryBase.cc.

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

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

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 }
PropagationDirection
PropagationDirection const & direction() const
Definition: Trajectory.cc:140
DataContainer const & measurements() const
Definition: Trajectory.h:196
std::vector< TrajectoryMeasurement > DataContainer
Definition: Trajectory.h:44
const PropagationDirection propDir_
dbl *** dir
Definition: mlp_gen.cc:35
PropagationDirection TrajectoryFactoryBase::propagationDirection ( void  ) const
inline
PropagationDirection TrajectoryFactoryBase::propagationDirection ( const std::string &  strPD) const
private

Definition at line 135 of file TrajectoryFactoryBase.cc.

References alongMomentum, anyDirection, Exception, and oppositeToMomentum.

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 }
bool TrajectoryFactoryBase::sameSurface ( const Surface s1,
const Surface s2 
) const
protected

Definition at line 88 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().

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 }
T perp() const
Definition: PV3DBase.h:72
const PositionType & position() const
unsigned int TrajectoryFactoryBase::tracksPerTrajectory ( ) const
inline
virtual const ReferenceTrajectoryCollection TrajectoryFactoryBase::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const
pure virtual
virtual const ReferenceTrajectoryCollection TrajectoryFactoryBase::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const ExternalPredictionCollection external,
const reco::BeamSpot beamSpot 
) const
pure virtual
bool TrajectoryFactoryBase::useRecHit ( const TransientTrackingRecHit::ConstRecHitPointer hitPtr) const
protected

Definition at line 94 of file TrajectoryFactoryBase.cc.

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

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

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 }
bool isProjected(TrackingRecHit const &hit)

Member Data Documentation

const bool TrajectoryFactoryBase::allowZeroMaterial_
protected
const edm::ParameterSet TrajectoryFactoryBase::cfg_
private

Definition at line 60 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase().

const bool TrajectoryFactoryBase::includeAPEs_
protected
const MaterialEffects TrajectoryFactoryBase::materialEffects_
private

Definition at line 62 of file TrajectoryFactoryBase.h.

const PropagationDirection TrajectoryFactoryBase::propDir_
private

Definition at line 63 of file TrajectoryFactoryBase.h.

Referenced by orderedTrajectoryMeasurements().

const unsigned int TrajectoryFactoryBase::tracksPerTrajectory_
private

Definition at line 61 of file TrajectoryFactoryBase.h.

const bool TrajectoryFactoryBase::useBeamSpot_
protected
const bool TrajectoryFactoryBase::useInvalidHits_
private

Definition at line 66 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

const bool TrajectoryFactoryBase::useProjectedHits_
private

Definition at line 67 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

const bool TrajectoryFactoryBase::useWithoutDet_
private

Definition at line 65 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().