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 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 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 {
27  edm::LogInfo("Alignment")
28  << "@SUB=TrajectoryFactoryBase"
29  << "TrajectoryFactory '" << cfg_.getParameter<std::string>("TrajectoryFactoryName")
30  << "' with following settings:"
31  << "\nmaterial effects: " << cfg_.getParameter<std::string>("MaterialEffects")
32  << "\npropagation: " << cfg_.getParameter<std::string>("PropagationDirection")
33  << "\nuse hits without det: " << (useWithoutDet_ ? "yes" : "no")
34  << "\nuse invalid hits: " << (useInvalidHits_ ? "yes" : "no")
35  << "\nuse projected hits: " << (useProjectedHits_ ? "yes" : "no")
36  << "\nuse beamspot: " << (useBeamSpot_ ? "yes" : "no")
37  << "\ninclude APEs: " << (includeAPEs_ ? "yes" : "no");
38 }
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 41 of file TrajectoryFactoryBase.cc.

41 {}

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 45 of file TrajectoryFactoryBase.cc.

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

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

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

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

Definition at line 75 of file TrajectoryFactoryBase.cc.

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

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

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

References alongMomentum, anyDirection, Exception, and oppositeToMomentum.

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

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

102 {
103  // - Should use perp2() instead of perp()
104  // - Should not rely on floating point equality, but make a minimal range, e.g. 1.e-6 ?
105  return ( s1.eta() == s2.eta() ) && ( s1.phi() == s2.phi() ) && ( s1.position().perp() == s2.position().perp() );
106 }
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 110 of file TrajectoryFactoryBase.cc.

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

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

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

Member Data Documentation

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