CMS 3D CMS Logo

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

Public Member Functions

 SeedProducerFromSoAT (const edm::ParameterSet &iConfig)
 
 ~SeedProducerFromSoAT () 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 Member Functions

void produce (edm::StreamID streamID, edm::Event &iEvent, const edm::EventSetup &iSetup) const override
 

Private Attributes

const edm::ESGetToken< MagneticField, IdealMagneticFieldRecordidealMagneticFieldToken_
 
int32_t minNumberOfHits_
 
const edm::EDGetTokenT< reco::BeamSpottBeamSpot_
 
const edm::EDGetTokenT< TrackSoAHeterogeneousHost< TrackerTraits > > tokenTrack_
 
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecordtrackerDigiGeometryToken_
 
const edm::ESGetToken< Propagator, TrackingComponentsRecordtrackerPropagatorToken_
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
template<typename T >
using BranchAliasSetterT = ProductRegistryHelper::BranchAliasSetterT< T >
 
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

template<typename TrackerTraits>
class SeedProducerFromSoAT< TrackerTraits >

Definition at line 37 of file SeedProducerFromSoA.cc.

Constructor & Destructor Documentation

◆ SeedProducerFromSoAT()

template<typename TrackerTraits >
SeedProducerFromSoAT< TrackerTraits >::SeedProducerFromSoAT ( const edm::ParameterSet iConfig)
explicit

Definition at line 58 of file SeedProducerFromSoA.cc.

59  : tBeamSpot_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"))),
63  trackerPropagatorToken_(esConsumes(edm::ESInputTag("PropagatorWithMaterial"))),
64  minNumberOfHits_(iConfig.getParameter<int>("minNumberOfHits"))
65 
66 {
67  produces<TrajectorySeedCollection>();
68 }
const edm::ESGetToken< Propagator, TrackingComponentsRecord > trackerPropagatorToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::EDGetTokenT< reco::BeamSpot > tBeamSpot_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > idealMagneticFieldToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerDigiGeometryToken_
const edm::EDGetTokenT< TrackSoAHeterogeneousHost< TrackerTraits > > tokenTrack_

◆ ~SeedProducerFromSoAT()

template<typename TrackerTraits >
SeedProducerFromSoAT< TrackerTraits >::~SeedProducerFromSoAT ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

template<typename TrackerTraits >
void SeedProducerFromSoAT< TrackerTraits >::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 71 of file SeedProducerFromSoA.cc.

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

71  {
73  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
74  desc.add<edm::InputTag>("src", edm::InputTag("pixelTrackSoA"));
75  desc.add<int>("minNumberOfHits", 0);
76 
77  descriptions.addWithDefaultLabel(desc);
78 }
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)

◆ produce()

template<typename TrackerTraits >
void SeedProducerFromSoAT< TrackerTraits >::produce ( edm::StreamID  streamID,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 81 of file SeedProducerFromSoA.cc.

References alongMomentum, b, TrackingRecHit::bad, cms::cuda::bs, LocalTrajectoryParameters::charge(), funct::cos(), f, edm::EventSetup::getHandle(), runTauDisplay::gp, hfClusterShapes_cfi::hits, mps_fire::i, iEvent, TrajectoryStateOnSurface::isValid(), dqmiolumiharvest::j, pixelTrack::loose, visualization-live-secondInstance_cfg::m, DMR_cfg::maxTracks, LocalTrajectoryParameters::momentum(), eostools::move(), nHits, nt, trajectoryStateTransform::persistentState(), PVValHelper::phi, LocalTrajectoryParameters::position(), TrackCandidateProducer_cfi::propagator, submitPVResolutionJobs::q, quality, mps_fire::result, makeMuonMisalignmentScenario::rot, funct::sin(), Surface::toGlobal(), PbPb_ZMuSkimMuonDPG_cff::tracker, and riemannFit::transformToPerigeePlane().

83  {
84  // std::cout << "Converting gpu helix to trajectory seed" << std::endl;
85  auto result = std::make_unique<TrajectorySeedCollection>();
86 
87  using trackHelper = TracksUtilities<TrackerTraits>;
88 
89  auto const& fieldESH = iSetup.getHandle(idealMagneticFieldToken_);
90  auto const& tracker = iSetup.getHandle(trackerDigiGeometryToken_);
91  auto const& dus = tracker->detUnits();
92 
93  auto const& propagatorHandle = iSetup.getHandle(trackerPropagatorToken_);
94  const Propagator* propagator = &(*propagatorHandle);
95 
96  const auto& bsh = iEvent.get(tBeamSpot_);
97  // std::cout << "beamspot " << bsh.x0() << ' ' << bsh.y0() << ' ' << bsh.z0() << std::endl;
98  GlobalPoint bs(bsh.x0(), bsh.y0(), bsh.z0());
99 
100  auto const& tsoa = iEvent.get(tokenTrack_);
101 
102  auto const* quality = tsoa.view().quality();
103  auto const& detIndices = tsoa.view().detIndices();
104  auto maxTracks = tsoa.view().metadata().size();
105 
106  int32_t nt = 0;
107  for (int32_t it = 0; it < maxTracks; ++it) {
108  auto nHits = trackHelper::nHits(tsoa.view(), it);
109  if (nHits == 0)
110  break; // this is a guard: maybe we need to move to nTracks...
111 
112  auto q = quality[it];
114  continue; // FIXME
115  if (nHits < minNumberOfHits_)
116  continue;
117  ++nt;
118 
119  // fill hits with invalid just to hold the detId
120  auto b = detIndices.begin(it);
122  for (int iHit = 0; iHit < nHits; ++iHit) {
123  auto const* det = dus[*(b + iHit)];
124  // FIXME at some point get a proper type ...
125  hits.push_back(new InvalidTrackingRecHit(*det, TrackingRecHit::bad));
126  }
127 
128  // mind: this values are respect the beamspot!
129 
130  float phi = trackHelper::nHits(tsoa.view(), it);
131 
132  riemannFit::Vector5d ipar, opar;
133  riemannFit::Matrix5d icov, ocov;
134  trackHelper::copyToDense(tsoa.view(), ipar, icov, it);
135  riemannFit::transformToPerigeePlane(ipar, icov, opar, ocov);
136 
137  LocalTrajectoryParameters lpar(opar(0), opar(1), opar(2), opar(3), opar(4), 1.);
139  for (int i = 0; i < 5; ++i)
140  for (int j = i; j < 5; ++j)
141  m(i, j) = ocov(i, j);
142 
143  float sp = std::sin(phi);
144  float cp = std::cos(phi);
145  Surface::RotationType rot(sp, -cp, 0, 0, 0, -1.f, cp, sp, 0);
146 
147  Plane impPointPlane(bs, rot);
148  GlobalTrajectoryParameters gp(impPointPlane.toGlobal(lpar.position()),
149  impPointPlane.toGlobal(lpar.momentum()),
150  lpar.charge(),
151  fieldESH.product());
152 
153  JacobianLocalToCurvilinear jl2c(impPointPlane, lpar, *fieldESH.product());
154 
155  AlgebraicSymMatrix55 mo = ROOT::Math::Similarity(jl2c.jacobian(), m);
156 
158 
159  auto const& lastHit = hits.back();
160 
161  TrajectoryStateOnSurface outerState = propagator->propagate(fts, *lastHit.surface());
162 
163  if (!outerState.isValid()) {
164  edm::LogError("SeedFromGPU") << " was trying to create a seed from:\n"
165  << fts << "\n propagating to: " << lastHit.geographicalId().rawId();
166  continue;
167  }
168 
169  auto const& pTraj = trajectoryStateTransform::persistentState(outerState, lastHit.geographicalId().rawId());
170 
171  result->emplace_back(pTraj, hits, alongMomentum);
172  }
173 
174  iEvent.put(std::move(result));
175 }
const edm::ESGetToken< Propagator, TrackingComponentsRecord > trackerPropagatorToken_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
const edm::EDGetTokenT< reco::BeamSpot > tBeamSpot_
Log< level::Error, false > LogError
Definition: Plane.h:16
string quality
Eigen::Matrix< double, 5, 1 > Vector5d
Definition: FitResult.h:16
int iEvent
Definition: GenABIO.cc:224
__host__ __device__ void transformToPerigeePlane(VI5 const &ip, MI5 const &icov, VO5 &op, MO5 &ocov)
Definition: FitUtils.h:218
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
double f[11][100]
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:130
int nt
Definition: AMPTWrapper.h:42
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > idealMagneticFieldToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerDigiGeometryToken_
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
double b
Definition: hdecay.h:118
maxTracks
Definition: DMR_cfg.py:158
Eigen::Matrix< double, 5, 5 > Matrix5d
Definition: FitResult.h:20
TupleMultiplicity< TrackerTraits > const *__restrict__ uint32_t nHits
def move(src, dest)
Definition: eostools.py:511
const edm::EDGetTokenT< TrackSoAHeterogeneousHost< TrackerTraits > > tokenTrack_

Member Data Documentation

◆ idealMagneticFieldToken_

template<typename TrackerTraits >
const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SeedProducerFromSoAT< TrackerTraits >::idealMagneticFieldToken_
private

Definition at line 51 of file SeedProducerFromSoA.cc.

◆ minNumberOfHits_

template<typename TrackerTraits >
int32_t SeedProducerFromSoAT< TrackerTraits >::minNumberOfHits_
private

Definition at line 54 of file SeedProducerFromSoA.cc.

◆ tBeamSpot_

template<typename TrackerTraits >
const edm::EDGetTokenT<reco::BeamSpot> SeedProducerFromSoAT< TrackerTraits >::tBeamSpot_
private

Definition at line 48 of file SeedProducerFromSoA.cc.

◆ tokenTrack_

template<typename TrackerTraits >
const edm::EDGetTokenT<TrackSoAHeterogeneousHost<TrackerTraits> > SeedProducerFromSoAT< TrackerTraits >::tokenTrack_
private

Definition at line 49 of file SeedProducerFromSoA.cc.

◆ trackerDigiGeometryToken_

template<typename TrackerTraits >
const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SeedProducerFromSoAT< TrackerTraits >::trackerDigiGeometryToken_
private

Definition at line 52 of file SeedProducerFromSoA.cc.

◆ trackerPropagatorToken_

template<typename TrackerTraits >
const edm::ESGetToken<Propagator, TrackingComponentsRecord> SeedProducerFromSoAT< TrackerTraits >::trackerPropagatorToken_
private

Definition at line 53 of file SeedProducerFromSoA.cc.