CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes
MkFitSeedConverter Class Reference
Inheritance diagram for MkFitSeedConverter:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 MkFitSeedConverter (edm::ParameterSet const &iConfig)
 
 ~MkFitSeedConverter () override=default
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
EDProduceroperator= (const EDProducer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Types

using SMatrixSym33 = ROOT::Math::SMatrix< float, 3, 3, ROOT::Math::MatRepSym< float, 3 > >
 
using SMatrixSym66 = ROOT::Math::SMatrix< float, 6, 6, ROOT::Math::MatRepSym< float, 6 > >
 
using SVector3 = ROOT::Math::SVector< float, 3 >
 

Private Member Functions

mkfit::TrackVec convertSeeds (const edm::View< TrajectorySeed > &seeds, const TrackerTopology &ttopo, const TransientTrackingRecHitBuilder &ttrhBuilder, const MagneticField &mf, const MkFitGeometry &mkFitGeom) const
 
void produce (edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
 

Private Attributes

const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordmfToken_
 
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecordmkFitGeomToken_
 
const edm::EDPutTokenT< MkFitSeedWrapperputToken_
 
const edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
 
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcdttopoToken_
 
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecordttrhBuilderToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- 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

Definition at line 36 of file MkFitSeedConverter.cc.

Member Typedef Documentation

◆ SMatrixSym33

using MkFitSeedConverter::SMatrixSym33 = ROOT::Math::SMatrix<float, 3, 3, ROOT::Math::MatRepSym<float, 3> >
private

Definition at line 53 of file MkFitSeedConverter.cc.

◆ SMatrixSym66

using MkFitSeedConverter::SMatrixSym66 = ROOT::Math::SMatrix<float, 6, 6, ROOT::Math::MatRepSym<float, 6> >
private

Definition at line 54 of file MkFitSeedConverter.cc.

◆ SVector3

using MkFitSeedConverter::SVector3 = ROOT::Math::SVector<float, 3>
private

Definition at line 52 of file MkFitSeedConverter.cc.

Constructor & Destructor Documentation

◆ MkFitSeedConverter()

MkFitSeedConverter::MkFitSeedConverter ( edm::ParameterSet const &  iConfig)
explicit

Definition at line 64 of file MkFitSeedConverter.cc.

65  : seedToken_{consumes<edm::View<TrajectorySeed>>(iConfig.getParameter<edm::InputTag>("seeds"))},
66  ttrhBuilderToken_{esConsumes<TransientTrackingRecHitBuilder, TransientRecHitRecord>(
67  iConfig.getParameter<edm::ESInputTag>("ttrhBuilder"))},
68  ttopoToken_{esConsumes<TrackerTopology, TrackerTopologyRcd>()},
69  mkFitGeomToken_{esConsumes<MkFitGeometry, TrackerRecoGeometryRecord>()},
70  mfToken_{esConsumes<MagneticField, IdealMagneticFieldRecord>()},
71  putToken_{produces<MkFitSeedWrapper>()} {}

References edm::ParameterSet::getParameter().

◆ ~MkFitSeedConverter()

MkFitSeedConverter::~MkFitSeedConverter ( )
overridedefault

Member Function Documentation

◆ convertSeeds()

mkfit::TrackVec MkFitSeedConverter::convertSeeds ( const edm::View< TrajectorySeed > &  seeds,
const TrackerTopology ttopo,
const TransientTrackingRecHitBuilder ttrhBuilder,
const MagneticField mf,
const MkFitGeometry mkFitGeom 
) const
private

Definition at line 91 of file MkFitSeedConverter.cc.

95  {
97  ret.reserve(seeds.size());
98 
99  auto isPlusSide = [&ttopo](const DetId& detid) {
100  return ttopo.side(detid) == static_cast<unsigned>(TrackerDetSide::PosEndcap);
101  };
102 
103  int seed_index = 0;
104  for (const auto& seed : seeds) {
105  auto const& hitRange = seed.recHits();
106  const auto lastRecHit = ttrhBuilder.build(&*(hitRange.end() - 1));
107  const auto tsos = trajectoryStateTransform::transientState(seed.startingState(), lastRecHit->surface(), &mf);
108  const auto& stateGlobal = tsos.globalParameters();
109  const auto& gpos = stateGlobal.position();
110  const auto& gmom = stateGlobal.momentum();
111  SVector3 pos(gpos.x(), gpos.y(), gpos.z());
112  SVector3 mom(gmom.x(), gmom.y(), gmom.z());
113 
114  const auto& cov = tsos.curvilinearError().matrix();
115  SMatrixSym66 err; //fill a sub-matrix, mkfit::TrackState will convert internally
116  for (int i = 0; i < 5; ++i) {
117  for (int j = i; j < 5; ++j) {
118  err.At(i, j) = cov[i][j];
119  }
120  }
121 
122  mkfit::TrackState state(tsos.charge(), pos, mom, err);
123  state.convertFromGlbCurvilinearToCCS();
124  ret.emplace_back(state, 0, seed_index, 0, nullptr);
125  LogTrace("MkFitSeedConverter") << "Inserted seed with index " << seed_index;
126 
127  // Add hits
128  for (auto const& recHit : hitRange) {
130  throw cms::Exception("Assert") << "Encountered a seed with a hit which is not trackerHitRTTI::isFromDet()";
131  }
132  const auto& clusterRef = static_cast<const BaseTrackerRecHit&>(recHit).firstClusterRef();
133  const auto detId = recHit.geographicalId();
134  const auto ilay = mkFitGeom.layerNumberConverter().convertLayerNumber(
135  detId.subdetId(), ttopo.layer(detId), false, ttopo.isStereo(detId), isPlusSide(detId));
136  LogTrace("MkFitSeedConverter") << " addin hit detid " << detId.rawId() << " index " << clusterRef.index()
137  << " ilay " << ilay;
138  ret.back().addHitIdx(clusterRef.index(), ilay, 0); // per-hit chi2 is not known
139  }
140  ++seed_index;
141  }
142  return ret;
143 }

References TransientTrackingRecHitBuilder::build(), submitPVResolutionJobs::err, Exception, TrajectoryStateOnSurface::globalParameters(), mps_fire::i, trackerHitRTTI::isFromDet(), TrackerTopology::isStereo(), dqmiolumiharvest::j, TrackerTopology::layer(), MkFitGeometry::layerNumberConverter(), LogTrace, PosEndcap, GlobalTrajectoryParameters::position(), rpcPointValidation_cfi::recHit, runTheMatrix::ret, fileCollector::seed, DetachedQuadStep_cff::seeds, TrackerTopology::side(), and trajectoryStateTransform::transientState().

Referenced by produce().

◆ fillDescriptions()

void MkFitSeedConverter::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 73 of file MkFitSeedConverter.cc.

73  {
75 
76  desc.add("seeds", edm::InputTag{"initialStepSeeds"});
77  desc.add("ttrhBuilder", edm::ESInputTag{"", "WithTrackAngle"});
78 
79  descriptions.addWithDefaultLabel(desc);
80 }

References edm::ConfigurationDescriptions::addWithDefaultLabel(), and submitPVResolutionJobs::desc.

◆ produce()

void MkFitSeedConverter::produce ( edm::StreamID  iID,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Member Data Documentation

◆ mfToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> MkFitSeedConverter::mfToken_
private

Definition at line 60 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ mkFitGeomToken_

const edm::ESGetToken<MkFitGeometry, TrackerRecoGeometryRecord> MkFitSeedConverter::mkFitGeomToken_
private

Definition at line 59 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ putToken_

const edm::EDPutTokenT<MkFitSeedWrapper> MkFitSeedConverter::putToken_
private

Definition at line 61 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ seedToken_

const edm::EDGetTokenT<edm::View<TrajectorySeed> > MkFitSeedConverter::seedToken_
private

Definition at line 56 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ ttopoToken_

const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> MkFitSeedConverter::ttopoToken_
private

Definition at line 58 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ ttrhBuilderToken_

const edm::ESGetToken<TransientTrackingRecHitBuilder, TransientRecHitRecord> MkFitSeedConverter::ttrhBuilderToken_
private

Definition at line 57 of file MkFitSeedConverter.cc.

Referenced by produce().

MkFitSeedConverter::ttrhBuilderToken_
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > ttrhBuilderToken_
Definition: MkFitSeedConverter.cc:57
runTheMatrix.ret
ret
prodAgent to be discontinued
Definition: runTheMatrix.py:543
TrackerTopology::side
unsigned int side(const DetId &id) const
Definition: TrackerTopology.cc:28
mps_fire.i
i
Definition: mps_fire.py:428
edm::ESInputTag
Definition: ESInputTag.h:87
GlobalTrajectoryParameters::position
GlobalPoint position() const
Definition: GlobalTrajectoryParameters.h:60
MkFitSeedConverter::putToken_
const edm::EDPutTokenT< MkFitSeedWrapper > putToken_
Definition: MkFitSeedConverter.cc:61
MkFitSeedConverter::convertSeeds
mkfit::TrackVec convertSeeds(const edm::View< TrajectorySeed > &seeds, const TrackerTopology &ttopo, const TransientTrackingRecHitBuilder &ttrhBuilder, const MagneticField &mf, const MkFitGeometry &mkFitGeom) const
Definition: MkFitSeedConverter.cc:91
pos
Definition: PixelAliasList.h:18
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
TransientTrackingRecHitBuilder::build
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
MkFitSeedConverter::seedToken_
const edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
Definition: MkFitSeedConverter.cc:56
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
MkFitSeedConverter::mkFitGeomToken_
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecord > mkFitGeomToken_
Definition: MkFitSeedConverter.cc:59
fileCollector.seed
seed
Definition: fileCollector.py:127
DetId
Definition: DetId.h:17
MkFitSeedConverter::SMatrixSym66
ROOT::Math::SMatrix< float, 6, 6, ROOT::Math::MatRepSym< float, 6 > > SMatrixSym66
Definition: MkFitSeedConverter.cc:54
TrackerTopology::isStereo
bool isStereo(const DetId &id) const
Definition: TrackerTopology.cc:158
MkFitGeometry::layerNumberConverter
mkfit::LayerNumberConverter const & layerNumberConverter() const
Definition: MkFitGeometry.h:34
MkFitSeedConverter::ttopoToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
Definition: MkFitSeedConverter.cc:58
SVector3
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
mkfit::TrackVec
std::vector< Track > TrackVec
Definition: MkFitOutputWrapper.h:8
iEvent
int iEvent
Definition: GenABIO.cc:224
trajectoryStateTransform::transientState
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
Definition: TrajectoryStateTransform.cc:35
trackerHitRTTI::isFromDet
bool isFromDet(TrackingRecHit const &hit)
Definition: trackerHitRTTI.h:36
submitPVResolutionJobs.err
err
Definition: submitPVResolutionJobs.py:85
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
TrackerDetSide::PosEndcap
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
DetachedQuadStep_cff.seeds
seeds
Definition: DetachedQuadStep_cff.py:195
MkFitSeedConverter::mfToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
Definition: MkFitSeedConverter.cc:60
RunInfoPI::state
state
Definition: RunInfoPayloadInspectoHelper.h:16
Exception
Definition: hltDiff.cc:245
LogTrace
#define LogTrace(id)
Definition: MessageLogger.h:234
TrajectoryStateOnSurface::globalParameters
const GlobalTrajectoryParameters & globalParameters() const
Definition: TrajectoryStateOnSurface.h:64
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::InputTag
Definition: InputTag.h:15
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87