CMS 3D CMS Logo

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

Public Member Functions

 SeedProducerFromSoA (const edm::ParameterSet &iConfig)
 
 ~SeedProducerFromSoA () 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 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< PixelTrackHeterogeneoustokenTrack_
 
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
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 SeedProducerFromSoA.cc.

Constructor & Destructor Documentation

◆ SeedProducerFromSoA()

SeedProducerFromSoA::SeedProducerFromSoA ( const edm::ParameterSet iConfig)
explicit

Definition at line 56 of file SeedProducerFromSoA.cc.

57  : tBeamSpot_(consumes<reco::BeamSpot>(iConfig.getParameter<edm::InputTag>("beamSpot"))),
58  tokenTrack_(consumes<PixelTrackHeterogeneous>(iConfig.getParameter<edm::InputTag>("src"))),
61  trackerPropagatorToken_(esConsumes(edm::ESInputTag("PropagatorWithMaterial"))),
62  minNumberOfHits_(iConfig.getParameter<int>("minNumberOfHits"))
63 
64 {
65  produces<TrajectorySeedCollection>();
66 }

◆ ~SeedProducerFromSoA()

SeedProducerFromSoA::~SeedProducerFromSoA ( )
overridedefault

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 68 of file SeedProducerFromSoA.cc.

68  {
70  desc.add<edm::InputTag>("beamSpot", edm::InputTag("offlineBeamSpot"));
71  desc.add<edm::InputTag>("src", edm::InputTag("pixelTrackSoA"));
72  desc.add<int>("minNumberOfHits", 0);
73 
74  descriptions.addWithDefaultLabel(desc);
75 }

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

◆ produce()

void SeedProducerFromSoA::produce ( edm::StreamID  streamID,
edm::Event iEvent,
const edm::EventSetup iSetup 
) const
overrideprivatevirtual

Implements edm::global::EDProducerBase.

Definition at line 77 of file SeedProducerFromSoA.cc.

77  {
78  // std::cout << "Converting gpu helix to trajectory seed" << std::endl;
79  auto result = std::make_unique<TrajectorySeedCollection>();
80 
81  auto const& fieldESH = iSetup.getHandle(idealMagneticFieldToken_);
82  auto const& tracker = iSetup.getHandle(trackerDigiGeometryToken_);
83  auto const& dus = tracker->detUnits();
84 
85  auto const& propagatorHandle = iSetup.getHandle(trackerPropagatorToken_);
86  const Propagator* propagator = &(*propagatorHandle);
87 
88  const auto& bsh = iEvent.get(tBeamSpot_);
89  // std::cout << "beamspot " << bsh.x0() << ' ' << bsh.y0() << ' ' << bsh.z0() << std::endl;
90  GlobalPoint bs(bsh.x0(), bsh.y0(), bsh.z0());
91 
92  const auto& tsoa = *(iEvent.get(tokenTrack_));
93 
94  auto const* quality = tsoa.qualityData();
95  auto const& fit = tsoa.stateAtBS;
96  auto const& detIndices = tsoa.detIndices;
97  auto maxTracks = tsoa.stride();
98 
99  int32_t nt = 0;
100  for (int32_t it = 0; it < maxTracks; ++it) {
101  auto nHits = tsoa.nHits(it);
102  if (nHits == 0)
103  break; // this is a guard: maybe we need to move to nTracks...
104 
105  auto q = quality[it];
107  continue; // FIXME
108  if (nHits < minNumberOfHits_)
109  continue;
110  ++nt;
111 
112  // fill hits with invalid just to hold the detId
113  auto b = detIndices.begin(it);
115  for (int iHit = 0; iHit < nHits; ++iHit) {
116  auto const* det = dus[*(b + iHit)];
117  // FIXME at some point get a proper type ...
118  hits.push_back(new InvalidTrackingRecHit(*det, TrackingRecHit::bad));
119  }
120 
121  // mind: this values are respect the beamspot!
122 
123  float phi = tsoa.phi(it);
124 
125  riemannFit::Vector5d ipar, opar;
126  riemannFit::Matrix5d icov, ocov;
127  fit.copyToDense(ipar, icov, it);
128  riemannFit::transformToPerigeePlane(ipar, icov, opar, ocov);
129 
130  LocalTrajectoryParameters lpar(opar(0), opar(1), opar(2), opar(3), opar(4), 1.);
132  for (int i = 0; i < 5; ++i)
133  for (int j = i; j < 5; ++j)
134  m(i, j) = ocov(i, j);
135 
136  float sp = std::sin(phi);
137  float cp = std::cos(phi);
138  Surface::RotationType rot(sp, -cp, 0, 0, 0, -1.f, cp, sp, 0);
139 
140  Plane impPointPlane(bs, rot);
141  GlobalTrajectoryParameters gp(impPointPlane.toGlobal(lpar.position()),
142  impPointPlane.toGlobal(lpar.momentum()),
143  lpar.charge(),
144  fieldESH.product());
145 
146  JacobianLocalToCurvilinear jl2c(impPointPlane, lpar, *fieldESH.product());
147 
148  AlgebraicSymMatrix55 mo = ROOT::Math::Similarity(jl2c.jacobian(), m);
149 
151 
152  auto const& lastHit = hits.back();
153 
154  TrajectoryStateOnSurface outerState = propagator->propagate(fts, *lastHit.surface());
155 
156  if (!outerState.isValid()) {
157  edm::LogError("SeedFromGPU") << " was trying to create a seed from:\n"
158  << fts << "\n propagating to: " << lastHit.geographicalId().rawId();
159  continue;
160  }
161 
162  auto const& pTraj = trajectoryStateTransform::persistentState(outerState, lastHit.geographicalId().rawId());
163 
164  result->emplace_back(pTraj, hits, alongMomentum);
165  }
166 
167  iEvent.put(std::move(result));
168 }

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

Member Data Documentation

◆ idealMagneticFieldToken_

const edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> SeedProducerFromSoA::idealMagneticFieldToken_
private

Definition at line 50 of file SeedProducerFromSoA.cc.

Referenced by produce().

◆ minNumberOfHits_

int32_t SeedProducerFromSoA::minNumberOfHits_
private

Definition at line 53 of file SeedProducerFromSoA.cc.

Referenced by produce().

◆ tBeamSpot_

const edm::EDGetTokenT<reco::BeamSpot> SeedProducerFromSoA::tBeamSpot_
private

Definition at line 47 of file SeedProducerFromSoA.cc.

Referenced by produce().

◆ tokenTrack_

const edm::EDGetTokenT<PixelTrackHeterogeneous> SeedProducerFromSoA::tokenTrack_
private

Definition at line 48 of file SeedProducerFromSoA.cc.

Referenced by produce().

◆ trackerDigiGeometryToken_

const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> SeedProducerFromSoA::trackerDigiGeometryToken_
private

Definition at line 51 of file SeedProducerFromSoA.cc.

Referenced by produce().

◆ trackerPropagatorToken_

const edm::ESGetToken<Propagator, TrackingComponentsRecord> SeedProducerFromSoA::trackerPropagatorToken_
private

Definition at line 52 of file SeedProducerFromSoA.cc.

Referenced by produce().

TkRotation< float >
mps_fire.i
i
Definition: mps_fire.py:428
edm::ESInputTag
Definition: ESInputTag.h:87
SeedProducerFromSoA::trackerDigiGeometryToken_
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerDigiGeometryToken_
Definition: SeedProducerFromSoA.cc:51
InvalidTrackingRecHit
Definition: InvalidTrackingRecHit.h:8
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
nt
int nt
Definition: AMPTWrapper.h:42
SeedProducerFromSoA::minNumberOfHits_
int32_t minNumberOfHits_
Definition: SeedProducerFromSoA.cc:53
trajectoryStateTransform::persistentState
PTrajectoryStateOnDet persistentState(const TrajectoryStateOnSurface &ts, unsigned int detid)
Definition: TrajectoryStateTransform.cc:14
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
riemannFit::Vector5d
Eigen::Matrix< double, 5, 1 > Vector5d
Definition: FitResult.h:16
hgcal_conditions::parameters
Definition: HGCConditions.h:86
SeedProducerFromSoA::trackerPropagatorToken_
const edm::ESGetToken< Propagator, TrackingComponentsRecord > trackerPropagatorToken_
Definition: SeedProducerFromSoA.cc:52
quality
const uint32_t *__restrict__ Quality * quality
Definition: CAHitNtupletGeneratorKernelsImpl.h:122
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
LocalTrajectoryParameters
Definition: LocalTrajectoryParameters.h:25
Propagator
Definition: Propagator.h:44
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
cms::cuda::bs
bs
Definition: HistoContainer.h:76
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
riemannFit::transformToPerigeePlane
__host__ __device__ void transformToPerigeePlane(VI5 const &ip, MI5 const &icov, VO5 &op, MO5 &ocov)
Definition: FitUtils.h:218
CurvilinearTrajectoryError
Definition: CurvilinearTrajectoryError.h:27
TrackCandidateProducer_cfi.propagator
propagator
Definition: TrackCandidateProducer_cfi.py:17
nHits
const caConstants::TupleMultiplicity *__restrict__ const HitsOnGPU *__restrict__ double *__restrict__ float *__restrict__ double *__restrict__ uint32_t nHits
Definition: BrokenLineFitOnGPU.h:27
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
SeedProducerFromSoA::tokenTrack_
const edm::EDGetTokenT< PixelTrackHeterogeneous > tokenTrack_
Definition: SeedProducerFromSoA.cc:48
GlobalTrajectoryParameters
Definition: GlobalTrajectoryParameters.h:15
Point3DBase< float, GlobalTag >
b
double b
Definition: hdecay.h:118
SeedProducerFromSoA::idealMagneticFieldToken_
const edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > idealMagneticFieldToken_
Definition: SeedProducerFromSoA.cc:50
TrackingRecHit::bad
Definition: TrackingRecHit.h:49
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
runTauDisplay.gp
gp
Definition: runTauDisplay.py:431
HLT_FULL_cff.maxTracks
maxTracks
Definition: HLT_FULL_cff.py:33266
iEvent
int iEvent
Definition: GenABIO.cc:224
SeedProducerFromSoA::tBeamSpot_
const edm::EDGetTokenT< reco::BeamSpot > tBeamSpot_
Definition: SeedProducerFromSoA.cc:47
edm::EventSetup::getHandle
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Definition: EventSetup.h:155
submitPVResolutionJobs.q
q
Definition: submitPVResolutionJobs.py:84
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
DDAxes::phi
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
FreeTrajectoryState
Definition: FreeTrajectoryState.h:27
Plane
Definition: Plane.h:16
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
riemannFit::Matrix5d
Eigen::Matrix< double, 5, 5 > Matrix5d
Definition: FitResult.h:20
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
mps_fire.result
result
Definition: mps_fire.py:311
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
JacobianLocalToCurvilinear
Definition: JacobianLocalToCurvilinear.h:21
pixelTrack::Quality::loose
AlgebraicSymMatrix55
ROOT::Math::SMatrix< double, 5, 5, ROOT::Math::MatRepSym< double, 5 > > AlgebraicSymMatrix55
Definition: AlgebraicROOTObjects.h:23
edm::InputTag
Definition: InputTag.h:15
alongMomentum
Definition: PropagationDirection.h:4
fit
Definition: CombinedChiSquaredLikelihood.h:6
TrajectoryStateOnSurface::isValid
bool isValid() const
Definition: TrajectoryStateOnSurface.h:54
edm::ConfigurationDescriptions::addWithDefaultLabel
void addWithDefaultLabel(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:87
edm::OwnVector< TrackingRecHit >