CMS 3D CMS Logo

BzeroReferenceTrajectoryFactory.cc
Go to the documentation of this file.
1 // Local include from plugins directory...:
3 
6 
11 
13 
15 
18 
22 
25  theMass(config.getParameter<double>("ParticleMass")),
26  theMomentumEstimate(config.getParameter<double>("MomentumEstimate")) {
27  edm::LogInfo("Alignment") << "@SUB=BzeroReferenceTrajectoryFactory"
28  << "mass: " << theMass << "\nmomentum: " << theMomentumEstimate;
29 }
30 
32 
37 
40 
41  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
42 
43  while (itTracks != tracks.end()) {
45  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
46  if (input.first.isValid()) {
48  config.useBeamSpot = useBeamSpot_;
49  config.includeAPEs = includeAPEs_;
50  config.allowZeroMaterial = allowZeroMaterial_;
51  // set the flag for reversing the RecHits to false, since they are already in the correct order.
52  config.hitsAreReverse = false;
54  new BzeroReferenceTrajectory(input.first, input.second, magneticField.product(), beamSpot, config)));
55  }
56 
57  ++itTracks;
58  }
59 
60  return trajectories;
61 }
62 
65  const edm::EventSetup &setup,
68  const reco::BeamSpot &beamSpot) const {
70 
71  if (tracks.size() != external.size()) {
72  edm::LogInfo("ReferenceTrajectories")
73  << "@SUB=BzeroReferenceTrajectoryFactory::trajectories"
74  << "Inconsistent input:\n"
75  << "\tnumber of tracks = " << tracks.size() << "\tnumber of external predictions = " << external.size();
76  return trajectories;
77  }
78 
81 
82  ConstTrajTrackPairCollection::const_iterator itTracks = tracks.begin();
83  ExternalPredictionCollection::const_iterator itExternal = external.begin();
84 
85  while (itTracks != tracks.end()) {
87  // Check input: If all hits were rejected, the TSOS is initialized as invalid.
88  if (input.first.isValid()) {
89  if ((*itExternal).isValid() && sameSurface((*itExternal).surface(), input.first.surface())) {
91  config.useBeamSpot = useBeamSpot_;
92  config.includeAPEs = includeAPEs_;
93  config.allowZeroMaterial = allowZeroMaterial_;
94  // set the flag for reversing the RecHits to false, since they are already in the correct order.
95  config.hitsAreReverse = false;
96  ReferenceTrajectoryPtr refTraj(
97  new BzeroReferenceTrajectory(*itExternal, input.second, magneticField.product(), beamSpot, config));
98 
99  AlgebraicSymMatrix externalParamErrors(asHepMatrix<5>((*itExternal).localError().matrix()));
100  refTraj->setParameterErrors(externalParamErrors.sub(2, 5));
101 
102  trajectories.push_back(refTraj);
103  } else {
105  config.useBeamSpot = useBeamSpot_;
106  config.includeAPEs = includeAPEs_;
107  config.allowZeroMaterial = allowZeroMaterial_;
108  // set the flag for reversing the RecHits to false, since they are already in the correct order.
109  config.hitsAreReverse = false;
111  new BzeroReferenceTrajectory(input.first, input.second, magneticField.product(), beamSpot, config)));
112  }
113  }
114 
115  ++itTracks;
116  ++itExternal;
117  }
118 
119  return trajectories;
120 }
121 
BzeroReferenceTrajectoryFactory::theMomentumEstimate
double theMomentumEstimate
Definition: BzeroReferenceTrajectoryFactory.h:33
pwdgSkimBPark_cfi.beamSpot
beamSpot
Definition: pwdgSkimBPark_cfi.py:5
input
static const std::string input
Definition: EdmProvDump.cc:48
MessageLogger.h
ESHandle.h
TrajectoryFactoryBase::includeAPEs_
const bool includeAPEs_
Definition: TrajectoryFactoryBase.h:71
ReferenceTrajectoryBase::Config
Definition: ReferenceTrajectoryBase.h:121
ReferenceCountingPointer
Definition: ReferenceCounted.h:60
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
HLT_FULL_cff.magneticField
magneticField
Definition: HLT_FULL_cff.py:348
BzeroReferenceTrajectoryFactory::trajectories
const ReferenceTrajectoryCollection trajectories(const edm::EventSetup &setup, const ConstTrajTrackPairCollection &tracks, const reco::BeamSpot &beamSpot) const override
Produce the reference trajectories.
Definition: BzeroReferenceTrajectoryFactory.cc:34
singleTopDQM_cfi.setup
setup
Definition: singleTopDQM_cfi.py:37
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
config
Definition: config.py:1
external
Definition: HEPTopTaggerV2.h:20
TrajectoryFactoryBase::sameSurface
bool sameSurface(const Surface &s1, const Surface &s2) const
Definition: TrajectoryFactoryBase.cc:88
submitPVResolutionJobs.config
config
parse the configuration file
Definition: submitPVResolutionJobs.py:281
TrajectoryFactoryBase::ReferenceTrajectoryPtr
ReferenceTrajectoryBase::ReferenceTrajectoryPtr ReferenceTrajectoryPtr
Definition: TrajectoryFactoryBase.h:22
TrajectoryFactoryBase::useBeamSpot_
const bool useBeamSpot_
Definition: TrajectoryFactoryBase.h:70
reco::BeamSpot
Definition: BeamSpot.h:21
IdealMagneticFieldRecord.h
edm::ESHandle< MagneticField >
TrajectoryFactoryBase::propagationDirection
PropagationDirection propagationDirection(void) const
Definition: TrajectoryFactoryBase.h:46
DEFINE_EDM_PLUGIN
#define DEFINE_EDM_PLUGIN(factory, type, name)
Definition: PluginFactory.h:124
BzeroReferenceTrajectoryFactory::~BzeroReferenceTrajectoryFactory
~BzeroReferenceTrajectoryFactory() override
Definition: BzeroReferenceTrajectoryFactory.cc:31
BzeroReferenceTrajectory.h
TrajectoryFactoryBase::ReferenceTrajectoryCollection
std::vector< ReferenceTrajectoryPtr > ReferenceTrajectoryCollection
Definition: TrajectoryFactoryBase.h:26
edm::ParameterSet
Definition: ParameterSet.h:47
TrajectoryFactoryBase::innermostStateAndRecHits
virtual const TrajectoryInput innermostStateAndRecHits(const ConstTrajTrackPair &track) const
Definition: TrajectoryFactoryBase.cc:37
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
TrajectoryFactoryBase::TrajectoryInput
std::pair< TrajectoryStateOnSurface, TransientTrackingRecHit::ConstRecHitContainer > TrajectoryInput
Definition: TrajectoryFactoryBase.h:27
TrajectoryFactoryBase
Definition: TrajectoryFactoryBase.h:20
TrajectoryFactoryPlugin.h
edmplugin::PluginFactory
Definition: PluginFactory.h:34
BzeroReferenceTrajectoryFactory
Definition: BzeroReferenceTrajectoryFactory.h:14
AlgebraicSymMatrix
CLHEP::HepSymMatrix AlgebraicSymMatrix
Definition: AlgebraicObjects.h:15
edm::EventSetup
Definition: EventSetup.h:58
TrajectoryFactoryBase::materialEffects
MaterialEffects materialEffects(void) const
Definition: TrajectoryFactoryBase.h:45
BzeroReferenceTrajectoryFactory::theMass
double theMass
Definition: BzeroReferenceTrajectoryFactory.h:32
get
#define get
TrajectoryFactoryBase::allowZeroMaterial_
const bool allowZeroMaterial_
Definition: TrajectoryFactoryBase.h:72
BzeroReferenceTrajectoryFactory::BzeroReferenceTrajectoryFactory
BzeroReferenceTrajectoryFactory(const edm::ParameterSet &config)
Definition: BzeroReferenceTrajectoryFactory.cc:23
TrajectoryFactoryBase::ConstTrajTrackPairCollection
AlignmentAlgorithmBase::ConstTrajTrackPairCollection ConstTrajTrackPairCollection
Definition: TrajectoryFactoryBase.h:25
EventSetup.h
BzeroReferenceTrajectory
Definition: BzeroReferenceTrajectory.h:35
ParameterSet.h
BzeroReferenceTrajectoryFactory.h
TrajectoryFactoryBase.h
TrajectoryFactoryBase::ExternalPredictionCollection
std::vector< TrajectoryStateOnSurface > ExternalPredictionCollection
Definition: TrajectoryFactoryBase.h:28