CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CombinedTrajectoryFactory Class Reference
Inheritance diagram for CombinedTrajectoryFactory:
TrajectoryFactoryBase

Public Member Functions

CombinedTrajectoryFactoryclone () const override
 
 CombinedTrajectoryFactory (const edm::ParameterSet &config)
 
const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
 
const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const override
 
 ~CombinedTrajectoryFactory () override
 
- 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< TrajectoryStateOnSurfaceExternalPredictionCollection
 
typedef ReferenceTrajectoryBase::MaterialEffects MaterialEffects
 
typedef std::vector< ReferenceTrajectoryPtrReferenceTrajectoryCollection
 
typedef ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
 
typedef std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainerTrajectoryInput
 
- 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 allowZeroMaterial_
 
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 24 of file CombinedTrajectoryFactory.cc.

Constructor & Destructor Documentation

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

Definition at line 51 of file CombinedTrajectoryFactory.cc.

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

Referenced by clone().

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

Definition at line 68 of file CombinedTrajectoryFactory.cc.

68 {}

Member Function Documentation

CombinedTrajectoryFactory* CombinedTrajectoryFactory::clone ( void  ) const
inlineoverridevirtual

Implements TrajectoryFactoryBase.

Definition at line 38 of file CombinedTrajectoryFactory.cc.

References CombinedTrajectoryFactory().

38 { 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 70 of file CombinedTrajectoryFactory.cc.

References theFactories, and theUseAllFactories.

Referenced by trajectories().

71  {
73  ReferenceTrajectoryCollection tmpTrajectories; // outside loop for efficiency
74 
75  vector<TrajectoryFactoryBase *>::const_iterator itFactory;
76  for (itFactory = theFactories.begin(); itFactory != theFactories.end(); ++itFactory) {
77  tmpTrajectories = (*itFactory)->trajectories(setup, tracks, beamSpot);
78  trajectories.insert(trajectories.end(), tmpTrajectories.begin(), tmpTrajectories.end());
79 
80  if (!theUseAllFactories && !trajectories.empty())
81  break;
82  }
83 
84  return trajectories;
85 }
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
std::vector< TrajectoryFactoryBase * > theFactories
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
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 87 of file CombinedTrajectoryFactory.cc.

References DEFINE_EDM_PLUGIN, theFactories, theUseAllFactories, and trajectories().

91  {
93  ReferenceTrajectoryCollection tmpTrajectories; // outside loop for efficiency
94 
95  vector<TrajectoryFactoryBase *>::const_iterator itFactory;
96  for (itFactory = theFactories.begin(); itFactory != theFactories.end(); ++itFactory) {
97  tmpTrajectories = (*itFactory)->trajectories(setup, tracks, external, beamSpot);
98  trajectories.insert(trajectories.end(), tmpTrajectories.begin(), tmpTrajectories.end());
99 
100  if (!theUseAllFactories && !trajectories.empty())
101  break;
102  }
103 
104  return trajectories;
105 }
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
std::vector< TrajectoryFactoryBase * > theFactories
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection

Member Data Documentation

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

Definition at line 41 of file CombinedTrajectoryFactory.cc.

Referenced by CombinedTrajectoryFactory(), and trajectories().

bool CombinedTrajectoryFactory::theUseAllFactories
private

Definition at line 42 of file CombinedTrajectoryFactory.cc.

Referenced by trajectories().