CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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
< TrajectoryStateOnSurface
ExternalPredictionCollection
 
typedef
ReferenceTrajectoryBase::MaterialEffects 
MaterialEffects
 
typedef std::vector
< ReferenceTrajectoryPtr
ReferenceTrajectoryCollection
 
typedef
ReferenceTrajectoryBase::ReferenceTrajectoryPtr 
ReferenceTrajectoryPtr
 
typedef std::pair
< TrajectoryStateOnSurface,
TransientTrackingRecHit::ConstRecHitContainer
TrajectoryInput
 

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 19 of file TrajectoryFactoryBase.h.

Member Typedef Documentation

Definition at line 26 of file TrajectoryFactoryBase.h.

Definition at line 27 of file TrajectoryFactoryBase.h.

Definition at line 30 of file TrajectoryFactoryBase.h.

Definition at line 25 of file TrajectoryFactoryBase.h.

Definition at line 28 of file TrajectoryFactoryBase.h.

Definition at line 24 of file TrajectoryFactoryBase.h.

Definition at line 29 of file TrajectoryFactoryBase.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file TrajectoryFactoryBase.cc.

10  :
11  TrajectoryFactoryBase(config, 1)
12 {
13 }
TrajectoryFactoryBase(const edm::ParameterSet &config)
TrajectoryFactoryBase::TrajectoryFactoryBase ( const edm::ParameterSet config,
unsigned int  tracksPerTrajectory 
)

Definition at line 15 of file TrajectoryFactoryBase.cc.

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

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

43 {}

Member Function Documentation

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

Definition at line 50 of file TrajectoryFactoryBase.h.

References cfg_.

Referenced by ReferenceTrajectoryFactory::bzeroFactory().

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

Definition at line 47 of file TrajectoryFactoryBase.cc.

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

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

48 {
50 
51  // get the trajectory measurements in the correct order, i.e. reverse if needed
52  Trajectory::DataContainer trajectoryMeasurements
53  = this->orderedTrajectoryMeasurements( *track.first );
54  Trajectory::DataContainer::iterator itM = trajectoryMeasurements.begin();
55 
56  // get the innermost valid trajectory state - the corresponding hit must be o.k. as well
57  while ( itM != trajectoryMeasurements.end() )
58  {
59  if ( ( *itM ).updatedState().isValid() && useRecHit( ( *itM ).recHit() ) ) break;
60  ++itM;
61  }
62  if ( itM != trajectoryMeasurements.end() ) result.first = ( *itM ).updatedState();
63 
64  // get the valid RecHits
65  while ( itM != trajectoryMeasurements.end() )
66  {
67  TransientTrackingRecHit::ConstRecHitPointer aRecHit = ( *itM ).recHit();
68  if ( useRecHit( aRecHit ) ) result.second.push_back( aRecHit );
69  ++itM;
70  }
71 
72  return result;
73 }
virtual const Trajectory::DataContainer orderedTrajectoryMeasurements(const Trajectory &trajectory) const
bool useRecHit(const TransientTrackingRecHit::ConstRecHitPointer &hitPtr) const
tuple result
Definition: mps_fire.py:84
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 129 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.

130 {
131  if ( strME == "MultipleScattering" ) return ReferenceTrajectoryBase::multipleScattering;
132  if ( strME == "EnergyLoss" ) return ReferenceTrajectoryBase::energyLoss;
133  if ( strME == "Combined" ) return ReferenceTrajectoryBase::combined;
134  if ( strME == "None" ) return ReferenceTrajectoryBase::none;
135  if ( strME == "BreakPoints" ) return ReferenceTrajectoryBase::breakPoints;
136  if ( strME == "BrokenLines" ) return ReferenceTrajectoryBase::brokenLinesCoarse;
137  if ( strME == "BrokenLinesCoarse" ) return ReferenceTrajectoryBase::brokenLinesCoarse;
138  if ( strME == "BrokenLinesFine" ) return ReferenceTrajectoryBase::brokenLinesFine;
139  if ( strME == "LocalGBL" ) return ReferenceTrajectoryBase::localGBL;
140  if ( strME == "CurvlinGBL" ) return ReferenceTrajectoryBase::curvlinGBL;
141 
142  throw cms::Exception("BadConfig")
143  << "[TrajectoryFactoryBase::materialEffects] Unknown parameter: " << strME;
144 }
const Trajectory::DataContainer TrajectoryFactoryBase::orderedTrajectoryMeasurements ( const Trajectory trajectory) const
protectedvirtual

Definition at line 77 of file TrajectoryFactoryBase.cc.

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

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

78 {
79  const PropagationDirection dir = trajectory.direction();
80  const bool hitsAreReverse = ( ( dir == propDir_ || propDir_ == anyDirection ) ? false : true );
81 
82  const Trajectory::DataContainer & original = trajectory.measurements();
83 
84  if ( hitsAreReverse )
85  {
86  // Simply use this line instead of the copying by hand?
87  // const Trajectory::DataContainer reordered(original.rbegin(), original.rend());
88  Trajectory::DataContainer reordered;
89  reordered.reserve( original.size() );
90 
91  Trajectory::DataContainer::const_reverse_iterator itM;
92  for ( itM = original.rbegin(); itM != original.rend(); ++itM )
93  {
94  reordered.push_back( *itM );
95  }
96  return reordered;
97  }
98 
99  return original;
100 }
list original
Definition: definitions.py:57
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 148 of file TrajectoryFactoryBase.cc.

References alongMomentum, anyDirection, Exception, and oppositeToMomentum.

149 {
150  if ( strPD == "oppositeToMomentum" ) return oppositeToMomentum;
151  if ( strPD == "alongMomentum" ) return alongMomentum;
152  if ( strPD == "anyDirection" ) return anyDirection;
153 
154  throw cms::Exception("BadConfig")
155  << "[TrajectoryFactoryBase::propagationDirection] Unknown parameter: " << strPD;
156 }
bool TrajectoryFactoryBase::sameSurface ( const Surface s1,
const Surface s2 
) const
protected

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

104 {
105  // - Should use perp2() instead of perp()
106  // - Should not rely on floating point equality, but make a minimal range, e.g. 1.e-6 ?
107  return ( s1.eta() == s2.eta() ) && ( s1.phi() == s2.phi() ) && ( s1.position().perp() == s2.position().perp() );
108 }
T perp() const
Definition: PV3DBase.h:72
const PositionType & position() const
unsigned int TrajectoryFactoryBase::tracksPerTrajectory ( ) const
inline

Definition at line 51 of file TrajectoryFactoryBase.h.

References tracksPerTrajectory_.

51 { return tracksPerTrajectory_; }
const unsigned int tracksPerTrajectory_
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 112 of file TrajectoryFactoryBase.cc.

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

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

113 {
114  const GeomDet* det = hitPtr->det();
115  if ( !det && !useWithoutDet_ ) return false;
116 
117  if ( !( useInvalidHits_ || hitPtr->isValid() ) ) return false;
118 
119  if ( !useProjectedHits_ )
120  {
121  if(trackerHitRTTI::isProjected(*hitPtr)) return false;
122  }
123 
124  return true;
125 }
bool isProjected(TrackingRecHit const &hit)

Member Data Documentation

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

Definition at line 65 of file TrajectoryFactoryBase.h.

Referenced by configuration(), and TrajectoryFactoryBase().

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

Definition at line 67 of file TrajectoryFactoryBase.h.

Referenced by materialEffects().

const PropagationDirection TrajectoryFactoryBase::propDir_
private

Definition at line 68 of file TrajectoryFactoryBase.h.

Referenced by orderedTrajectoryMeasurements(), and propagationDirection().

const unsigned int TrajectoryFactoryBase::tracksPerTrajectory_
private

Definition at line 66 of file TrajectoryFactoryBase.h.

Referenced by tracksPerTrajectory().

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

Definition at line 71 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

const bool TrajectoryFactoryBase::useProjectedHits_
private

Definition at line 72 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

const bool TrajectoryFactoryBase::useWithoutDet_
private

Definition at line 70 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().