CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
KVFTrackUpdate Class Reference

#include <KVFTrackUpdate.h>

Inheritance diagram for KVFTrackUpdate:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 
 KVFTrackUpdate (const edm::ParameterSet &)
 
 ~KVFTrackUpdate () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecordestoken_TTB
 
edm::EDGetTokenT< reco::BeamSpottoken_beamSpot
 
edm::EDGetTokenT< reco::TrackCollectiontoken_tracks
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

This is a very simple test analyzer to test the update of a track with a vertex constraint with the Kalman filter.

Definition at line 22 of file KVFTrackUpdate.h.

Constructor & Destructor Documentation

◆ KVFTrackUpdate()

KVFTrackUpdate::KVFTrackUpdate ( const edm::ParameterSet iConfig)
explicit

Definition at line 22 of file KVFTrackUpdate.cc.

23  : estoken_TTB(esConsumes(edm::ESInputTag("", "TransientTrackBuilder"))) {
24  token_tracks = consumes<TrackCollection>(iConfig.getParameter<InputTag>("TrackLabel"));
25  token_beamSpot = consumes<BeamSpot>(iConfig.getParameter<InputTag>("beamSpotLabel"));
26 }

References edm::ParameterSet::getParameter(), token_beamSpot, and token_tracks.

◆ ~KVFTrackUpdate()

KVFTrackUpdate::~KVFTrackUpdate ( )
override

Definition at line 28 of file KVFTrackUpdate.cc.

28 {}

Member Function Documentation

◆ analyze()

void KVFTrackUpdate::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 38 of file KVFTrackUpdate.cc.

38  {
39  try {
40  edm::LogInfo("RecoVertex/KVFTrackUpdate") << "Reconstructing event number: " << iEvent.id() << "\n";
41 
42  // get RECO tracks from the event
43  // `tks` can be used as a ptr to a reco::TrackCollection
45  iEvent.getByToken(token_tracks, tks);
46 
47  edm::LogInfo("RecoVertex/KVFTrackUpdate") << "Found: " << (*tks).size() << " reconstructed tracks"
48  << "\n";
49  edm::LogPrint("RecoVertex/KVFTrackUpdate") << "got " << (*tks).size() << " tracks " << std::endl;
50 
51  // Transform Track to TransientTrack
52 
53  //get the builder:
54  const auto& theB = &iSetup.getData(estoken_TTB);
55  //do the conversion:
56  std::vector<TransientTrack> t_tks = theB->build(tks);
57 
58  edm::LogInfo("RecoVertex/KVFTrackUpdate") << "Found: " << t_tks.size() << " reconstructed tracks"
59  << "\n";
60 
61  GlobalPoint glbPos(0., 0., 0.);
62 
64  mat[0][0] = (20.e-04) * (20.e-04);
65  mat[1][1] = (20.e-04) * (20.e-04);
66  mat[2][2] = (5.3) * (5.3);
67  GlobalError glbErrPos(mat);
68 
69  reco::BeamSpot vertexBeamSpot;
70  edm::Handle<reco::BeamSpot> recoBeamSpotHandle;
71  iEvent.getByToken(token_beamSpot, recoBeamSpotHandle);
72 
74  for (unsigned int i = 0; i < t_tks.size(); i++) {
75  SingleTrackVertexConstraint::BTFtuple a = stvc.constrain(t_tks[i], glbPos, glbErrPos);
76  edm::LogPrint("RecoVertex/KVFTrackUpdate") << "Chi2: " << std::get<2>(a) << std::endl;
77  if (recoBeamSpotHandle.isValid()) {
78  SingleTrackVertexConstraint::BTFtuple b = stvc.constrain(t_tks[i], *recoBeamSpotHandle);
79  edm::LogPrint("RecoVertex/KVFTrackUpdate") << "Chi2: " << std::get<2>(b) << std::endl;
80  }
81  }
82  }
83 
84  catch (std::exception& err) {
85  edm::LogInfo("RecoVertex/KVFTrackUpdate") << "Exception during event number: " << iEvent.id() << "\n"
86  << err.what() << "\n";
87  }
88 }

References a, b, SingleTrackVertexConstraint::constrain(), MillePedeFileConverter_cfg::e, submitPVResolutionJobs::err, estoken_TTB, cppFunctionSkipper::exception, edm::EventSetup::getData(), mps_fire::i, iEvent, edm::HandleBase::isValid(), token_beamSpot, and token_tracks.

◆ beginJob()

void KVFTrackUpdate::beginJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 30 of file KVFTrackUpdate.cc.

30 {}

◆ endJob()

void KVFTrackUpdate::endJob ( void  )
overridevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 32 of file KVFTrackUpdate.cc.

32 {}

Member Data Documentation

◆ estoken_TTB

const edm::ESGetToken<TransientTrackBuilder, TransientTrackRecord> KVFTrackUpdate::estoken_TTB
private

Definition at line 33 of file KVFTrackUpdate.h.

Referenced by analyze().

◆ token_beamSpot

edm::EDGetTokenT<reco::BeamSpot> KVFTrackUpdate::token_beamSpot
private

Definition at line 35 of file KVFTrackUpdate.h.

Referenced by analyze(), and KVFTrackUpdate().

◆ token_tracks

edm::EDGetTokenT<reco::TrackCollection> KVFTrackUpdate::token_tracks
private

Definition at line 34 of file KVFTrackUpdate.h.

Referenced by analyze(), and KVFTrackUpdate().

AlgebraicSymMatrix33
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
Definition: AlgebraicROOTObjects.h:21
mps_fire.i
i
Definition: mps_fire.py:428
edm::ESInputTag
Definition: ESInputTag.h:87
edm::LogPrint
Log< level::Warning, true > LogPrint
Definition: MessageLogger.h:130
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
edm::Handle< reco::TrackCollection >
KVFTrackUpdate::token_tracks
edm::EDGetTokenT< reco::TrackCollection > token_tracks
Definition: KVFTrackUpdate.h:34
SingleTrackVertexConstraint::constrain
BTFtuple constrain(const reco::TransientTrack &track, const GlobalPoint &priorPos, const GlobalError &priorError) const
Definition: SingleTrackVertexConstraint.cc:21
reco::BeamSpot
Definition: BeamSpot.h:21
SingleTrackVertexConstraint::BTFtuple
std::tuple< bool, reco::TransientTrack, float > BTFtuple
Definition: SingleTrackVertexConstraint.h:23
KVFTrackUpdate::estoken_TTB
const edm::ESGetToken< TransientTrackBuilder, TransientTrackRecord > estoken_TTB
Definition: KVFTrackUpdate.h:33
Point3DBase< float, GlobalTag >
b
double b
Definition: hdecay.h:118
cppFunctionSkipper.exception
exception
Definition: cppFunctionSkipper.py:10
a
double a
Definition: hdecay.h:119
iEvent
int iEvent
Definition: GenABIO.cc:224
GlobalErrorBase< double, ErrorMatrixTag >
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
KVFTrackUpdate::token_beamSpot
edm::EDGetTokenT< reco::BeamSpot > token_beamSpot
Definition: KVFTrackUpdate.h:35
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:202
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
SingleTrackVertexConstraint
Definition: SingleTrackVertexConstraint.h:20
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37