30 #include "Math/SVector.h" 31 #include "Math/SMatrix.h" 53 using SVector3 = ROOT::Math::SVector<float, 3>;
54 using SMatrixSym33 = ROOT::Math::SMatrix<float, 3, 3, ROOT::Math::MatRepSym<float, 3>>;
55 using SMatrixSym66 = ROOT::Math::SMatrix<float, 6, 6, ROOT::Math::MatRepSym<float, 6>>;
68 ttrhBuilderToken_{esConsumes<TransientTrackingRecHitBuilder, TransientRecHitRecord>(
70 ttopoToken_{esConsumes<TrackerTopology, TrackerTopologyRcd>()},
71 mkFitGeomToken_{esConsumes<MkFitGeometry, TrackerRecoGeometryRecord>()},
72 mfToken_{esConsumes<MagneticField, IdealMagneticFieldRecord>()},
73 putToken_{produces<MkFitSeedWrapper>()},
74 maxNSeeds_{iConfig.getParameter<
unsigned int>(
"maxNSeeds")} {}
81 desc.add(
"maxNSeeds", 500000
U);
103 <<
" nSeed=" <<
seeds.size();
108 auto isPlusSide = [&ttopo](
const DetId& detid) {
114 auto const& hitRange =
seed.recHits();
115 const auto lastRecHit = ttrhBuilder.
build(&*(hitRange.end() - 1));
118 const auto& gpos = stateGlobal.
position();
119 const auto& gmom = stateGlobal.momentum();
121 SVector3 mom(gmom.x(), gmom.y(), gmom.z());
123 const auto& cov = tsos.curvilinearError().matrix();
125 for (
int i = 0;
i < 5; ++
i) {
126 for (
int j =
i;
j < 5; ++
j) {
132 state.convertFromGlbCurvilinearToCCS();
133 ret.emplace_back(
state, 0, seed_index, 0,
nullptr);
134 LogTrace(
"MkFitSeedConverter") <<
"Inserted seed with index " << seed_index;
137 for (
auto const&
recHit : hitRange) {
139 throw cms::Exception(
"Assert") <<
"Encountered a seed with a hit which is not trackerHitRTTI::isFromDet()";
142 if (!baseTrkRecHit.isMatched()) {
147 LogTrace(
"MkFitSeedConverter") <<
" adding hit detid " <<
detId.rawId() <<
" index " << clusterRef.index()
149 ret.back().addHitIdx(clusterRef.index(), ilay, 0);
152 const OmniClusterRef*
const clRefs[2] = {&matched2D.monoClusterRef(), &matched2D.stereoClusterRef()};
153 const DetId detIds[2] = {matched2D.monoId(), matched2D.stereoId()};
154 for (
int ii = 0;
ii < 2; ++
ii) {
155 const auto&
detId = detIds[
ii];
158 LogTrace(
"MkFitSeedConverter") <<
" adding matched hit detid " <<
detId.rawId() <<
" index " 159 << clRefs[
ii]->
index() <<
" ilay " << ilay;
160 ret.back().addHitIdx(clRefs[
ii]->
index(), ilay, 0);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
T getParameter(std::string const &) const
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
bool isFromDet(TrackingRecHit const &hit)
GlobalPoint position() const
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecord > mkFitGeomToken_
const edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
ret
prodAgent to be discontinued
const GlobalTrajectoryParameters & globalParameters() const
const unsigned int maxNSeeds_
ROOT::Math::SMatrix< float, 3, 3, ROOT::Math::MatRepSym< float, 3 > > SMatrixSym33
unsigned int index() const
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
bool isStereo(const DetId &id) const
Log< level::Error, false > LogError
unsigned int side(const DetId &id) const
unsigned int layer(const DetId &id) const
MkFitSeedConverter(edm::ParameterSet const &iConfig)
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > ttrhBuilderToken_
#define DEFINE_FWK_MODULE(type)
const edm::EDPutTokenT< MkFitSeedWrapper > putToken_
mkfit::LayerNumberConverter const & layerNumberConverter() const
std::vector< Track > TrackVec
ROOT::Math::SMatrix< float, 6, 6, ROOT::Math::MatRepSym< float, 6 > > SMatrixSym66
virtual OmniClusterRef const & firstClusterRef() const =0
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
void produce(edm::StreamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
ROOT::Math::SVector< float, 3 > SVector3
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
int convertLayerNumber(int det, int lay, bool useMatched, int isStereo, bool posZ) const
~MkFitSeedConverter() override=default