CMS 3D CMS Logo

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

Public Member Functions

CombinedTrajectoryFactoryclone () const override
 
 CombinedTrajectoryFactory (const edm::ParameterSet &config, edm::ConsumesCollector &iC)
 
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, const edm::ConsumesCollector &iC)
 
 TrajectoryFactoryBase (const edm::ParameterSet &config, unsigned int tracksPerTrajectory, const edm::ConsumesCollector &iC)
 
virtual ~TrajectoryFactoryBase (void)
 

Private Member Functions

 CombinedTrajectoryFactory (const CombinedTrajectoryFactory &other)
 

Private Attributes

std::vector< std::unique_ptr< 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() [1/2]

CombinedTrajectoryFactory::CombinedTrajectoryFactory ( const edm::ParameterSet config,
edm::ConsumesCollector iC 
)

Definition at line 59 of file CombinedTrajectoryFactory.cc.

References beamerCreator::create(), Exception, get, and theFactories.

Referenced by clone().

60  : TrajectoryFactoryBase(config, iC), theUseAllFactories(config.getParameter<bool>("useAllFactories")) {
61  vector<string> factoryNames = config.getParameter<vector<string>>("TrajectoryFactoryNames");
62  for (auto const &factoryName : factoryNames) {
63  // auto_ptr to avoid missing a delete due to throw...
64  std::unique_ptr<TObjArray> namePset(TString(factoryName.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 '" << factoryName << "'";
69  }
70  const edm::ParameterSet factoryCfg = config.getParameter<edm::ParameterSet>(namePset->At(1)->GetName());
71  theFactories.emplace_back(TrajectoryFactoryPlugin::get()->create(namePset->At(0)->GetName(), factoryCfg, iC));
72  }
73 }
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: config.py:1
std::vector< std::unique_ptr< TrajectoryFactoryBase > > theFactories
TrajectoryFactoryBase(const edm::ParameterSet &config, const edm::ConsumesCollector &iC)
#define get

◆ ~CombinedTrajectoryFactory()

CombinedTrajectoryFactory::~CombinedTrajectoryFactory ( void  )
override

Definition at line 75 of file CombinedTrajectoryFactory.cc.

75 {}

◆ CombinedTrajectoryFactory() [2/2]

CombinedTrajectoryFactory::CombinedTrajectoryFactory ( const CombinedTrajectoryFactory other)
inlineprivate

Definition at line 41 of file CombinedTrajectoryFactory.cc.

References trackingPlots::other.

42  : TrajectoryFactoryBase(other), theUseAllFactories{other.theUseAllFactories} {
43  theFactories.reserve(other.theFactories.size());
44  for (const auto &f : other.theFactories) {
45  theFactories.emplace_back(f->clone());
46  }
47  }
std::vector< std::unique_ptr< TrajectoryFactoryBase > > theFactories
double f[11][100]
TrajectoryFactoryBase(const edm::ParameterSet &config, const edm::ConsumesCollector &iC)

Member Function Documentation

◆ clone()

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, edm::ConsumesCollector &iC)

◆ trajectories() [1/2]

const CombinedTrajectoryFactory::ReferenceTrajectoryCollection CombinedTrajectoryFactory::trajectories ( const edm::EventSetup setup,
const ConstTrajTrackPairCollection tracks,
const reco::BeamSpot beamSpot 
) const
overridevirtual

Implements TrajectoryFactoryBase.

Definition at line 77 of file CombinedTrajectoryFactory.cc.

References isoTrack_cff::beamSpot, singleTopDQM_cfi::setup, theFactories, theUseAllFactories, and DiMuonV_cfg::tracks.

Referenced by trajectories().

78  {
80  ReferenceTrajectoryCollection tmpTrajectories; // outside loop for efficiency
81 
82  for (auto const &factory : theFactories) {
83  tmpTrajectories = factory->trajectories(setup, tracks, beamSpot);
84  trajectories.insert(trajectories.end(), tmpTrajectories.begin(), tmpTrajectories.end());
85 
86  if (!theUseAllFactories && !trajectories.empty())
87  break;
88  }
89 
90  return trajectories;
91 }
std::vector< std::unique_ptr< TrajectoryFactoryBase > > theFactories
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection

◆ trajectories() [2/2]

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 93 of file CombinedTrajectoryFactory.cc.

References isoTrack_cff::beamSpot, singleTopDQM_cfi::setup, theFactories, theUseAllFactories, DiMuonV_cfg::tracks, and trajectories().

97  {
99  ReferenceTrajectoryCollection tmpTrajectories; // outside loop for efficiency
100 
101  for (auto const &factory : theFactories) {
102  tmpTrajectories = factory->trajectories(setup, tracks, external, beamSpot);
103  trajectories.insert(trajectories.end(), tmpTrajectories.begin(), tmpTrajectories.end());
104 
105  if (!theUseAllFactories && !trajectories.empty())
106  break;
107  }
108 
109  return trajectories;
110 }
std::vector< std::unique_ptr< TrajectoryFactoryBase > > theFactories
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection

Member Data Documentation

◆ theFactories

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

Definition at line 49 of file CombinedTrajectoryFactory.cc.

Referenced by CombinedTrajectoryFactory(), and trajectories().

◆ theUseAllFactories

bool CombinedTrajectoryFactory::theUseAllFactories
private

Definition at line 50 of file CombinedTrajectoryFactory.cc.

Referenced by trajectories().