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)
 
const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const ExternalPredictionCollection &external, const reco::BeamSpot &beamSpot) const override
 
const ReferenceTrajectoryCollection trajectories (const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, 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 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)

Definition at line 59 of file CombinedTrajectoryFactory.cc.

60  : TrajectoryFactoryBase(config), 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));
72  }
73 }

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

Referenced by clone().

◆ ~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.

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  }

References trackingPlots::other.

Member Function Documentation

◆ clone()

CombinedTrajectoryFactory* CombinedTrajectoryFactory::clone ( void  ) const
inlineoverridevirtual

Implements TrajectoryFactoryBase.

Definition at line 38 of file CombinedTrajectoryFactory.cc.

38 { return new CombinedTrajectoryFactory(*this); }

References CombinedTrajectoryFactory().

◆ trajectories() [1/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.

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 }

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

◆ trajectories() [2/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.

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 }

References pwdgSkimBPark_cfi::beamSpot, singleTopDQM_cfi::setup, theFactories, theUseAllFactories, and tracks.

Referenced by trajectories().

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

CombinedTrajectoryFactory::theFactories
std::vector< std::unique_ptr< TrajectoryFactoryBase > > theFactories
Definition: CombinedTrajectoryFactory.cc:49
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
CombinedTrajectoryFactory::trajectories
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Definition: CombinedTrajectoryFactory.cc:77
config
Definition: config.py:1
external
Definition: HEPTopTaggerV2.h:20
trackingPlots.other
other
Definition: trackingPlots.py:1464
TrajectoryFactoryBase::ReferenceTrajectoryCollection
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
Definition: TrajectoryFactoryBase.h:26
edm::ParameterSet
Definition: ParameterSet.h:47
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:176
get
#define get
CombinedTrajectoryFactory::CombinedTrajectoryFactory
CombinedTrajectoryFactory(const edm::ParameterSet &config)
Definition: CombinedTrajectoryFactory.cc:59
Exception
Definition: hltDiff.cc:245
CombinedTrajectoryFactory::theUseAllFactories
bool theUseAllFactories
Definition: CombinedTrajectoryFactory.cc:50
TrajectoryFactoryBase::TrajectoryFactoryBase
TrajectoryFactoryBase(const edm::ParameterSet &config)
Definition: TrajectoryFactoryBase.cc:9