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>>;
67 ttrhBuilderToken_{esConsumes<TransientTrackingRecHitBuilder, TransientRecHitRecord>(
69 ttopoToken_{esConsumes<TrackerTopology, TrackerTopologyRcd>()},
70 mkFitGeomToken_{esConsumes<MkFitGeometry, TrackerRecoGeometryRecord>()},
71 mfToken_{esConsumes<MagneticField, IdealMagneticFieldRecord>()},
72 putToken_{produces<MkFitSeedWrapper>()} {}
98 ret.reserve(seeds.
size());
100 auto isPlusSide = [&ttopo](
const DetId& detid) {
105 for (
const auto&
seed : seeds) {
106 auto const& hitRange =
seed.recHits();
107 const auto lastRecHit = ttrhBuilder.
build(&*(hitRange.end() - 1));
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());
115 const auto& cov = tsos.curvilinearError().matrix();
117 for (
int i = 0;
i < 5; ++
i) {
118 for (
int j =
i;
j < 5; ++
j) {
119 err.At(
i,
j) = cov[
i][
j];
124 state.convertFromGlbCurvilinearToCCS();
125 ret.emplace_back(
state, 0, seed_index, 0,
nullptr);
126 LogTrace(
"MkFitSeedConverter") <<
"Inserted seed with index " << seed_index;
129 for (
auto const& recHit : hitRange) {
131 throw cms::Exception(
"Assert") <<
"Encountered a seed with a hit which is not trackerHitRTTI::isFromDet()";
134 if (!baseTrkRecHit.isMatched()) {
136 const auto detId = recHit.geographicalId();
138 detId.subdetId(), ttopo.
layer(detId),
false, ttopo.
isStereo(detId), isPlusSide(detId));
139 LogTrace(
"MkFitSeedConverter") <<
" adding hit detid " << detId.rawId() <<
" index " << clusterRef.index()
141 ret.back().addHitIdx(clusterRef.index(), ilay, 0);
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];
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);
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
tuple ret
prodAgent to be discontinued
mkfit::LayerNumberConverter const & layerNumberConverter() const
bool isFromDet(TrackingRecHit const &hit)
const edm::ESGetToken< MkFitGeometry, TrackerRecoGeometryRecord > mkFitGeomToken_
const edm::EDGetTokenT< edm::View< TrajectorySeed > > seedToken_
#define DEFINE_FWK_MODULE(type)
unsigned int side(const DetId &id) const
ROOT::Math::SMatrix< float, 3, 3, ROOT::Math::MatRepSym< float, 3 >> SMatrixSym33
bool isStereo(const DetId &id) 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
MkFitSeedConverter(edm::ParameterSet const &iConfig)
bool getData(T &iHolder) const
virtual RecHitPointer build(const TrackingRecHit *p) const =0
build a tracking rechit from an existing rechit
const edm::ESGetToken< TransientTrackingRecHitBuilder, TransientRecHitRecord > ttrhBuilderToken_
bool get(ProductID const &oid, Handle< PROD > &result) const
ParameterDescriptionBase * add(U const &iLabel, T const &value)
const edm::EDPutTokenT< MkFitSeedWrapper > putToken_
GlobalPoint position() const
std::vector< Track > TrackVec
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
const GlobalTrajectoryParameters & globalParameters() const
int convertLayerNumber(int det, int lay, bool useMatched, int isStereo, bool posZ) const
virtual OmniClusterRef const & firstClusterRef() const =0
T getParameter(std::string const &) const
unsigned int layer(const DetId &id) const
unsigned int index() const
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
ROOT::Math::SMatrix< float, 6, 6, ROOT::Math::MatRepSym< float, 6 >> SMatrixSym66
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > mfToken_
~MkFitSeedConverter() override=default