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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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<Transition Tr = Transition::Event>
auto produces (std::string instanceName) noexcept
 declare what type of product will make and with which optional label More...
 
template<Transition B>
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)
 
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 ()
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
template<Transition Tr = Transition::Event>
auto produces () noexcept
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
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<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 37 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 54 of file MkFitSeedConverter.cc.

◆ SMatrixSym66

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

Definition at line 55 of file MkFitSeedConverter.cc.

◆ SVector3

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

Definition at line 53 of file MkFitSeedConverter.cc.

Constructor & Destructor Documentation

◆ MkFitSeedConverter()

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

Definition at line 65 of file MkFitSeedConverter.cc.

References edm::ParameterSet::getParameter().

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

◆ ~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 92 of file MkFitSeedConverter.cc.

References TransientTrackingRecHitBuilder::build(), mkfit::LayerNumberConverter::convertLayerNumber(), submitPVResolutionJobs::err, Exception, BaseTrackerRecHit::firstClusterRef(), TrajectoryStateOnSurface::globalParameters(), mps_fire::i, cuy::ii, OmniClusterRef::index(), 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().

96  {
98  ret.reserve(seeds.size());
99 
100  auto isPlusSide = [&ttopo](const DetId& detid) {
101  return ttopo.side(detid) == static_cast<unsigned>(TrackerDetSide::PosEndcap);
102  };
103 
104  int seed_index = 0;
105  for (const auto& seed : seeds) {
106  auto const& hitRange = seed.recHits();
107  const auto lastRecHit = ttrhBuilder.build(&*(hitRange.end() - 1));
108  const auto tsos = trajectoryStateTransform::transientState(seed.startingState(), lastRecHit->surface(), &mf);
109  const auto& stateGlobal = tsos.globalParameters();
110  const auto& gpos = stateGlobal.position();
111  const auto& gmom = stateGlobal.momentum();
112  SVector3 pos(gpos.x(), gpos.y(), gpos.z());
113  SVector3 mom(gmom.x(), gmom.y(), gmom.z());
114 
115  const auto& cov = tsos.curvilinearError().matrix();
116  SMatrixSym66 err; //fill a sub-matrix, mkfit::TrackState will convert internally
117  for (int i = 0; i < 5; ++i) {
118  for (int j = i; j < 5; ++j) {
119  err.At(i, j) = cov[i][j];
120  }
121  }
122 
123  mkfit::TrackState state(tsos.charge(), pos, mom, err);
124  state.convertFromGlbCurvilinearToCCS();
125  ret.emplace_back(state, 0, seed_index, 0, nullptr);
126  LogTrace("MkFitSeedConverter") << "Inserted seed with index " << seed_index;
127 
128  // Add hits
129  for (auto const& recHit : hitRange) {
131  throw cms::Exception("Assert") << "Encountered a seed with a hit which is not trackerHitRTTI::isFromDet()";
132  }
133  auto& baseTrkRecHit = static_cast<const BaseTrackerRecHit&>(recHit);
134  if (!baseTrkRecHit.isMatched()) {
135  const auto& clusterRef = baseTrkRecHit.firstClusterRef();
136  const auto detId = recHit.geographicalId();
137  const auto ilay = mkFitGeom.layerNumberConverter().convertLayerNumber(
138  detId.subdetId(), ttopo.layer(detId), false, ttopo.isStereo(detId), isPlusSide(detId));
139  LogTrace("MkFitSeedConverter") << " adding hit detid " << detId.rawId() << " index " << clusterRef.index()
140  << " ilay " << ilay;
141  ret.back().addHitIdx(clusterRef.index(), ilay, 0); // per-hit chi2 is not known
142  } else {
143  auto& matched2D = dynamic_cast<const SiStripMatchedRecHit2D&>(recHit);
144  const OmniClusterRef* const clRefs[2] = {&matched2D.monoClusterRef(), &matched2D.stereoClusterRef()};
145  const DetId detIds[2] = {matched2D.monoId(), matched2D.stereoId()};
146  for (int ii = 0; ii < 2; ++ii) {
147  const auto& detId = detIds[ii];
148  const auto ilay = mkFitGeom.layerNumberConverter().convertLayerNumber(
149  detId.subdetId(), ttopo.layer(detId), false, ttopo.isStereo(detId), isPlusSide(detId));
150  LogTrace("MkFitSeedConverter") << " adding matched hit detid " << detId.rawId() << " index "
151  << clRefs[ii]->index() << " ilay " << ilay;
152  ret.back().addHitIdx(clRefs[ii]->index(), ilay, 0); // per-hit chi2 is not known
153  }
154  }
155  }
156  ++seed_index;
157  }
158  return ret;
159 }
bool isFromDet(TrackingRecHit const &hit)
ret
prodAgent to be discontinued
const GlobalTrajectoryParameters & globalParameters() const
unsigned int index() const
bool isStereo(const DetId &id) const
unsigned int side(const DetId &id) const
unsigned int layer(const DetId &id) const
#define LogTrace(id)
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
ii
Definition: cuy.py:589
mkfit::LayerNumberConverter const & layerNumberConverter() const
Definition: MkFitGeometry.h:32
Definition: DetId.h:17
std::vector< Track > TrackVec
ROOT::Math::SMatrix< float, 6, 6, ROOT::Math::MatRepSym< float, 6 > > SMatrixSym66
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
virtual OmniClusterRef const & firstClusterRef() const =0
ROOT::Math::SVector< double, 3 > SVector3
Definition: V0Fitter.cc:47
int convertLayerNumber(int det, int lay, bool useMatched, int isStereo, bool posZ) const

◆ fillDescriptions()

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

Definition at line 74 of file MkFitSeedConverter.cc.

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

74  {
76 
77  desc.add("seeds", edm::InputTag{"initialStepSeeds"});
78  desc.add("ttrhBuilder", edm::ESInputTag{"", "WithTrackAngle"});
79 
80  descriptions.addWithDefaultLabel(desc);
81 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

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

Implements edm::global::EDProducerBase.

Definition at line 83 of file MkFitSeedConverter.cc.

References convertSeeds(), edm::EventSetup::getData(), iEvent, mfToken_, mkFitGeomToken_, putToken_, seedToken_, ttopoToken_, and ttrhBuilderToken_.

83  {
84  iEvent.emplace(putToken_,
86  iSetup.getData(ttopoToken_),
87  iSetup.getData(ttrhBuilderToken_),
88  iSetup.getData(mfToken_),
89  iSetup.getData(mkFitGeomToken_)));
90 }
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecord > mkFitGeomToken_
const edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > ttopoToken_
mkfit::TrackVec convertSeeds(const edm::View< TrajectorySeed > &seeds, const TrackerTopology &ttopo, const TransientTrackingRecHitBuilder &ttrhBuilder, const MagneticField &mf, const MkFitGeometry &mkFitGeom) const
int iEvent
Definition: GenABIO.cc:224
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > ttrhBuilderToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:122
const edm::EDPutTokenT< MkFitSeedWrapper > putToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_

Member Data Documentation

◆ mfToken_

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

Definition at line 61 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ mkFitGeomToken_

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

Definition at line 60 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ putToken_

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

Definition at line 62 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ seedToken_

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

Definition at line 57 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ ttopoToken_

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

Definition at line 59 of file MkFitSeedConverter.cc.

Referenced by produce().

◆ ttrhBuilderToken_

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

Definition at line 58 of file MkFitSeedConverter.cc.

Referenced by produce().