CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CombinedTrajectoryFactory Class Reference
Inheritance diagram for CombinedTrajectoryFactory:
TrajectoryFactoryBase

Public Member Functions

virtual CombinedTrajectoryFactoryclone () const override
 
 CombinedTrajectoryFactory (const edm::ParameterSet &config)
 
virtual const
ReferenceTrajectoryCollection 
trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
 
virtual const
ReferenceTrajectoryCollection 
trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const override
 
virtual ~CombinedTrajectoryFactory ()
 
- Public Member Functions inherited from TrajectoryFactoryBase
const edm::ParameterSetconfiguration () const
 
MaterialEffects materialEffects (void) const
 
PropagationDirection propagationDirection (void) const
 
unsigned int tracksPerTrajectory () const
 
 TrajectoryFactoryBase (const edm::ParameterSet &config)
 
 TrajectoryFactoryBase (const edm::ParameterSet &config, unsigned int tracksPerTrajectory)
 
virtual ~TrajectoryFactoryBase (void)
 

Private Attributes

std::vector
< TrajectoryFactoryBase * > 
theFactories
 
bool theUseAllFactories
 

Additional Inherited Members

- Public Types inherited from TrajectoryFactoryBase
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
 
- Protected Member Functions inherited from TrajectoryFactoryBase
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 inherited from TrajectoryFactoryBase
const bool includeAPEs_
 
const bool useBeamSpot_
 

Detailed Description

A factory that can combine the functionality of several 'trajectory factories'. At construction time, it is given an ordered list of what kinds factories it should use. When called, all the factories are called one after each other,

Example: Combine TwoBodyDecayTrajectoryFactory and ReferenceTrajectoryFactory with useAllFactories = false. In case the former can't produce a trajectory from two given tracks, the tracks can still be used for 'ordinary' reference trajectories (see also TrajectoryFactories.cff).

Definition at line 25 of file CombinedTrajectoryFactory.cc.

Constructor & Destructor Documentation

CombinedTrajectoryFactory::CombinedTrajectoryFactory ( const edm::ParameterSet config)

Definition at line 56 of file CombinedTrajectoryFactory.cc.

References beamerCreator::create(), Exception, reco::get(), edm::ParameterSet::getParameter(), and theFactories.

Referenced by clone().

56  :
57  TrajectoryFactoryBase( config ), theUseAllFactories(config.getParameter<bool>("useAllFactories"))
58 {
59  vector<string> factoryNames = config.getParameter< vector<string> >( "TrajectoryFactoryNames" );
60  vector<string>::iterator itFactoryName;
61  for ( itFactoryName = factoryNames.begin(); itFactoryName != factoryNames.end(); ++itFactoryName )
62  {
63  // auto_ptr to avoid missing a delete due to throw...
64  std::auto_ptr<TObjArray> namePset(TString((*itFactoryName).c_str()).Tokenize(","));
65  if (namePset->GetEntriesFast() != 2) {
66  throw cms::Exception("BadConfig") << "@SUB=CombinedTrajectoryFactory"
67  << "TrajectoryFactoryNames must contain 2 comma "
68  << "separated strings, but is '" << *itFactoryName << "'";
69  }
70  const edm::ParameterSet factoryCfg
71  = config.getParameter<edm::ParameterSet>(namePset->At(1)->GetName());
72  theFactories.push_back(TrajectoryFactoryPlugin::get()->create(namePset->At(0)->GetName(),
73  factoryCfg));
74  }
75 }
T getParameter(std::string const &) const
std::vector< TrajectoryFactoryBase * > theFactories
TrajectoryFactoryBase(const edm::ParameterSet &config)
T get(const Candidate &c)
Definition: component.h:55
CombinedTrajectoryFactory::~CombinedTrajectoryFactory ( void  )
virtual

Definition at line 78 of file CombinedTrajectoryFactory.cc.

78 {}

Member Function Documentation

virtual CombinedTrajectoryFactory* CombinedTrajectoryFactory::clone ( void  ) const
inlineoverridevirtual

Implements TrajectoryFactoryBase.

Definition at line 42 of file CombinedTrajectoryFactory.cc.

References CombinedTrajectoryFactory().

42 { return new CombinedTrajectoryFactory(*this); }
CombinedTrajectoryFactory(const edm::ParameterSet &config)
const CombinedTrajectoryFactory::ReferenceTrajectoryCollection CombinedTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const
overridevirtual

Implements TrajectoryFactoryBase.

Definition at line 82 of file CombinedTrajectoryFactory.cc.

References theFactories, and theUseAllFactories.

Referenced by trajectories().

85 {
87  ReferenceTrajectoryCollection tmpTrajectories; // outside loop for efficiency
88 
89  vector< TrajectoryFactoryBase* >::const_iterator itFactory;
90  for ( itFactory = theFactories.begin(); itFactory != theFactories.end(); ++itFactory )
91  {
92  tmpTrajectories = ( *itFactory )->trajectories(setup, tracks, beamSpot);
93  trajectories.insert(trajectories.end(), tmpTrajectories.begin(), tmpTrajectories.end());
94 
95  if (!theUseAllFactories && !trajectories.empty()) break;
96  }
97 
98  return trajectories;
99 }
std::vector< TrajectoryFactoryBase * > theFactories
virtual const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
tuple tracks
Definition: testEve_cfg.py:39
const CombinedTrajectoryFactory::ReferenceTrajectoryCollection CombinedTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const ExternalPredictionCollection external,
const reco::BeamSpot beamSpot 
) const
overridevirtual

Implements TrajectoryFactoryBase.

Definition at line 102 of file CombinedTrajectoryFactory.cc.

References theFactories, theUseAllFactories, and trajectories().

106 {
108  ReferenceTrajectoryCollection tmpTrajectories; // outside loop for efficiency
109 
110  vector< TrajectoryFactoryBase* >::const_iterator itFactory;
111  for ( itFactory = theFactories.begin(); itFactory != theFactories.end(); ++itFactory )
112  {
113  tmpTrajectories = ( *itFactory )->trajectories(setup, tracks, external, beamSpot);
114  trajectories.insert(trajectories.end(), tmpTrajectories.begin(), tmpTrajectories.end());
115 
116  if (!theUseAllFactories && !trajectories.empty()) break;
117  }
118 
119  return trajectories;
120 }
std::vector< TrajectoryFactoryBase * > theFactories
virtual const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
tuple tracks
Definition: testEve_cfg.py:39

Member Data Documentation

std::vector<TrajectoryFactoryBase*> CombinedTrajectoryFactory::theFactories
private

Definition at line 46 of file CombinedTrajectoryFactory.cc.

Referenced by CombinedTrajectoryFactory(), and trajectories().

bool CombinedTrajectoryFactory::theUseAllFactories
private

Definition at line 47 of file CombinedTrajectoryFactory.cc.

Referenced by trajectories().