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

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

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

Definition at line 34 of file TrajectoryFactoryBase.cc.

34 {}

Member Function Documentation

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

Definition at line 48 of file TrajectoryFactoryBase.h.

References cfg_.

Referenced by ReferenceTrajectoryFactory::bzeroFactory().

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

Definition at line 38 of file TrajectoryFactoryBase.cc.

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

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

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

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

Definition at line 68 of file TrajectoryFactoryBase.cc.

References anyDirection, 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  {
77  // Simply use this line instead of the copying by hand?
78  // const Trajectory::DataContainer reordered(original.rbegin(), original.rend());
79  Trajectory::DataContainer reordered;
80  reordered.reserve( original.size() );
81 
82  Trajectory::DataContainer::const_reverse_iterator itM;
83  for ( itM = original.rbegin(); itM != original.rend(); ++itM )
84  {
85  reordered.push_back( *itM );
86  }
87  return reordered;
88  }
89 
90  return original;
91 }
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 139 of file TrajectoryFactoryBase.cc.

References alongMomentum, anyDirection, Exception, and oppositeToMomentum.

140 {
141  if ( strPD == "oppositeToMomentum" ) return oppositeToMomentum;
142  if ( strPD == "alongMomentum" ) return alongMomentum;
143  if ( strPD == "anyDirection" ) return anyDirection;
144 
145  throw cms::Exception("BadConfig")
146  << "[TrajectoryFactoryBase::propagationDirection] Unknown parameter: " << strPD;
147 }
bool TrajectoryFactoryBase::sameSurface ( const Surface s1,
const Surface s2 
) const
protected

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

95 {
96  // - Should use perp2() instead of perp()
97  // - Should not rely on floating point equality, but make a minimal range, e.g. 1.e-6 ?
98  return ( s1.eta() == s2.eta() ) && ( s1.phi() == s2.phi() ) && ( s1.position().perp() == s2.position().perp() );
99 }
T perp() const
Definition: PV3DBase.h:72
const PositionType & position() const
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 103 of file TrajectoryFactoryBase.cc.

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

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

104 {
105  const GeomDet* det = hitPtr->det();
106  if ( !det && !useWithoutDet_ ) return false;
107 
108  if ( !( useInvalidHits_ || hitPtr->isValid() ) ) return false;
109 
110  if ( !useProjectedHits_ )
111  {
112  if(trackerHitRTTI::isProjected(*hitPtr)) return false;
113  }
114 
115  return true;
116 }
bool isProjected(TrackingRecHit const &hit)

Member Data Documentation

const edm::ParameterSet TrajectoryFactoryBase::cfg_
private

Definition at line 62 of file TrajectoryFactoryBase.h.

Referenced by configuration(), and TrajectoryFactoryBase().

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

Definition at line 63 of file TrajectoryFactoryBase.h.

Referenced by materialEffects().

const PropagationDirection TrajectoryFactoryBase::propDir_
private

Definition at line 64 of file TrajectoryFactoryBase.h.

Referenced by orderedTrajectoryMeasurements(), and propagationDirection().

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

Definition at line 67 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

const bool TrajectoryFactoryBase::useProjectedHits_
private

Definition at line 68 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().

const bool TrajectoryFactoryBase::useWithoutDet_
private

Definition at line 66 of file TrajectoryFactoryBase.h.

Referenced by TrajectoryFactoryBase(), and useRecHit().