CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
SeedToTrackProducer Class Reference

#include <SeedToTrackProducer.h>

Inheritance diagram for SeedToTrackProducer:
edm::one::EDProducer<> edm::one::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 SeedToTrackProducer (const edm::ParameterSet &)
 
 ~SeedToTrackProducer () override
 
- Public Member Functions inherited from edm::one::EDProducer<>
 EDProducer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 
virtual TrajectoryStateOnSurface seedTransientState (const TrajectorySeed &)
 

Private Attributes

edm::EDGetTokenT< edm::View< TrajectorySeed > > L2seedsTagS_
 
edm::EDGetTokenT< TrajectorySeedCollectionL2seedsTagT_
 
edm::ESHandle< MagneticFieldtheMGField
 
edm::ESHandle< GlobalTrackingGeometrytheTrackingGeometry
 

Additional Inherited Members

- Public Types inherited from edm::one::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
 
- Static Public Member Functions inherited from edm::one::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

hugues/SeedToTrackProducer/plugins/SeedToTrackProducer.cc

Description: [one line class summary]

Implementation: [Notes on implementation]

hugues/SeedToTrackProducer/plugins/SeedToTrackProducer.cc

Description:

Definition at line 50 of file SeedToTrackProducer.h.

Constructor & Destructor Documentation

◆ SeedToTrackProducer()

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

Definition at line 29 of file SeedToTrackProducer.cc.

29  {
30  L2seedsTagT_ = consumes<TrajectorySeedCollection>(iConfig.getParameter<edm::InputTag>("L2seedsCollection"));
31  L2seedsTagS_ = consumes<edm::View<TrajectorySeed>>(iConfig.getParameter<edm::InputTag>("L2seedsCollection"));
32 
33  produces<reco::TrackCollection>();
34  produces<reco::TrackExtraCollection>();
35  produces<TrackingRecHitCollection>();
36 }

References edm::ParameterSet::getParameter(), L2seedsTagS_, and L2seedsTagT_.

◆ ~SeedToTrackProducer()

SeedToTrackProducer::~SeedToTrackProducer ( )
override

Definition at line 38 of file SeedToTrackProducer.cc.

38 {}

Member Function Documentation

◆ beginJob()

void SeedToTrackProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 162 of file SeedToTrackProducer.cc.

162 {}

◆ endJob()

void SeedToTrackProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDProducerBase.

Definition at line 166 of file SeedToTrackProducer.cc.

166 {}

◆ produce()

void SeedToTrackProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDProducerBase.

Definition at line 45 of file SeedToTrackProducer.cc.

45  {
46  using namespace edm;
47  using namespace std;
48 
49  std::unique_ptr<reco::TrackCollection> selectedTracks(new reco::TrackCollection);
50  std::unique_ptr<reco::TrackExtraCollection> selectedTrackExtras(new reco::TrackExtraCollection());
51  std::unique_ptr<TrackingRecHitCollection> selectedTrackHits(new TrackingRecHitCollection());
52 
53  reco::TrackRefProd rTracks = iEvent.getRefBeforePut<reco::TrackCollection>();
54  reco::TrackExtraRefProd rTrackExtras = iEvent.getRefBeforePut<reco::TrackExtraCollection>();
55  TrackingRecHitRefProd rHits = iEvent.getRefBeforePut<TrackingRecHitCollection>();
56 
59 
60  // magnetic fied and detector geometry
63 
65  iSetup.get<TrackerTopologyRcd>().get(httopo);
66  const TrackerTopology &ttopo = *httopo;
67 
68  // now read the L2 seeds collection :
71  const std::vector<TrajectorySeed> *L2seeds = nullptr;
72  if (L2seedsCollection.isValid())
73  L2seeds = L2seedsCollection.product();
74  else
75  edm::LogError("SeedToTrackProducer") << "L2 seeds collection not found !! " << endl;
76 
78  iEvent.getByToken(L2seedsTagS_, seedHandle);
79 
80  // now loop on the seeds :
81  for (unsigned int i = 0; i < L2seeds->size(); i++) {
82  // get the kinematic extrapolation from the seed
83  TrajectoryStateOnSurface theTrajectory = seedTransientState(L2seeds->at(i));
84  float seedEta = theTrajectory.globalMomentum().eta();
85  float seedPhi = theTrajectory.globalMomentum().phi();
86  float seedPt = theTrajectory.globalMomentum().perp();
87  CovarianceMatrix matrixSeedErr = theTrajectory.curvilinearError().matrix();
88  edm::LogVerbatim("SeedToTrackProducer")
89  << "seedPt=" << seedPt << " seedEta=" << seedEta << " seedPhi=" << seedPhi << endl;
90  /*AlgebraicSymMatrix66 errors = theTrajectory.cartesianError().matrix();
91  double partialPterror =
92  errors(3,3)*pow(theTrajectory.globalMomentum().x(),2) +
93  errors(4,4)*pow(theTrajectory.globalMomentum().y(),2);
94  edm::LogVerbatim("SeedToTrackProducer") << "seedPtError=" <<
95  sqrt(partialPterror)/theTrajectory.globalMomentum().perp() <<
96  "seedPhiError=" << theTrajectory.curvilinearError().matrix()(2,2) << endl;*/
97  // fill the track in a way that its pt, phi and eta will be the same as the
98  // seed
99  math::XYZPoint initPoint(0, 0, 0);
100  math::XYZVector initMom(seedPt * cos(seedPhi), seedPt * sin(seedPhi), seedPt * sinh(seedEta));
101  reco::Track theTrack(1,
102  1, // dummy Chi2 and ndof
103  initPoint,
104  initMom,
105  1,
106  matrixSeedErr,
108  reco::TrackBase::TrackQuality::tight);
109 
110  // fill the extra track with dummy information
111  math::XYZPoint dummyFinalPoint(1, 1, 1);
112  math::XYZVector dummyFinalMom(0, 0, 10);
114  CovarianceMatrix matrixExtra = ROOT::Math::SMatrixIdentity();
115  reco::TrackExtra theTrackExtra(dummyFinalPoint,
116  dummyFinalMom,
117  true,
118  initPoint,
119  initMom,
120  true,
121  matrixSeedErr,
122  1,
123  matrixExtra,
124  2,
125  (L2seeds->at(i)).direction(),
126  seed);
127  theTrack.setExtra(reco::TrackExtraRef(rTrackExtras, idx++));
128  edm::LogVerbatim("SeedToTrackProducer")
129  << "trackPt=" << theTrack.pt() << " trackEta=" << theTrack.eta() << " trackPhi=" << theTrack.phi() << endl;
130  edm::LogVerbatim("SeedToTrackProducer")
131  << "trackPtError=" << theTrack.ptError() << "trackPhiError=" << theTrack.phiError() << endl;
132 
133  // fill the seed segments in the track
134  unsigned int nHitsAdded = 0;
135  for (auto const &recHit : L2seeds->at(i).recHits()) {
136  TrackingRecHit *hit = recHit.clone();
137  theTrack.appendHitPattern(*hit, ttopo);
138  selectedTrackHits->push_back(hit);
139  nHitsAdded++;
140  }
141  theTrackExtra.setHits(rHits, hidx, nHitsAdded);
142  hidx += nHitsAdded;
143  selectedTracks->push_back(theTrack);
144  selectedTrackExtras->push_back(theTrackExtra);
145  }
147  iEvent.put(std::move(selectedTrackExtras));
148  iEvent.put(std::move(selectedTrackHits));
149 }

References reco::TrackBase::appendHitPattern(), funct::cos(), TrajectoryStateOnSurface::curvilinearError(), PV3DBase< T, PVType, FrameType >::eta(), reco::TrackBase::eta(), edm::EventSetup::get(), get, TrajectoryStateOnSurface::globalMomentum(), susybsm::HSCParticleType::globalMuon, mps_fire::i, heavyIonCSV_trainingSettings::idx, iEvent, SeedToTrackProducer_cfi::L2seedsCollection, L2seedsTagS_, L2seedsTagT_, CurvilinearTrajectoryError::matrix(), eostools::move(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), reco::TrackBase::phi(), reco::TrackBase::phiError(), reco::TrackBase::pt(), reco::TrackBase::ptError(), rpcPointValidation_cfi::recHit, fileCollector::seed, seedTransientState(), TrackCollections2monitor_cff::selectedTracks, reco::Track::setExtra(), funct::sin(), theMGField, and theTrackingGeometry.

◆ seedTransientState()

TrajectoryStateOnSurface SeedToTrackProducer::seedTransientState ( const TrajectorySeed tmpSeed)
privatevirtual

Definition at line 151 of file SeedToTrackProducer.cc.

151  {
152  PTrajectoryStateOnDet tmpTSOD = tmpSeed.startingState();
153  DetId tmpDetId(tmpTSOD.detId());
154  const GeomDet *tmpGeomDet = theTrackingGeometry->idToDet(tmpDetId);
155  TrajectoryStateOnSurface tmpTSOS =
156  trajectoryStateTransform::transientState(tmpTSOD, &(tmpGeomDet->surface()), &(*theMGField));
157  return tmpTSOS;
158 }

References PTrajectoryStateOnDet::detId(), GlobalTrackingGeometry::idToDet(), TrajectorySeed::startingState(), theMGField, theTrackingGeometry, and trajectoryStateTransform::transientState().

Referenced by produce().

Member Data Documentation

◆ L2seedsTagS_

edm::EDGetTokenT<edm::View<TrajectorySeed> > SeedToTrackProducer::L2seedsTagS_
private

Definition at line 63 of file SeedToTrackProducer.h.

Referenced by produce(), and SeedToTrackProducer().

◆ L2seedsTagT_

edm::EDGetTokenT<TrajectorySeedCollection> SeedToTrackProducer::L2seedsTagT_
private

Definition at line 62 of file SeedToTrackProducer.h.

Referenced by produce(), and SeedToTrackProducer().

◆ theMGField

edm::ESHandle<MagneticField> SeedToTrackProducer::theMGField
private

Definition at line 65 of file SeedToTrackProducer.h.

Referenced by produce(), and seedTransientState().

◆ theTrackingGeometry

edm::ESHandle<GlobalTrackingGeometry> SeedToTrackProducer::theTrackingGeometry
private

Definition at line 66 of file SeedToTrackProducer.h.

Referenced by produce(), and seedTransientState().

edm::RefProd< TrackCollection >
mps_fire.i
i
Definition: mps_fire.py:428
GeomDet
Definition: GeomDet.h:27
SeedToTrackProducer::seedTransientState
virtual TrajectoryStateOnSurface seedTransientState(const TrajectorySeed &)
Definition: SeedToTrackProducer.cc:151
edm
HLT enums.
Definition: AlignableModifier.h:19
TrackerTopology
Definition: TrackerTopology.h:16
GlobalTrackingGeometryRecord
Definition: GlobalTrackingGeometryRecord.h:17
CovarianceMatrix
Definition: CovarianceMatrix.h:28
edm::Handle
Definition: AssociativeIterator.h:50
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
edm::Ref< TrackExtraCollection >
heavyIonCSV_trainingSettings.idx
idx
Definition: heavyIonCSV_trainingSettings.py:5
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
SeedToTrackProducer_cfi.L2seedsCollection
L2seedsCollection
Definition: SeedToTrackProducer_cfi.py:4
fileCollector.seed
seed
Definition: fileCollector.py:127
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
DetId
Definition: DetId.h:17
reco::TrackExtra
Definition: TrackExtra.h:26
TrajectoryStateOnSurface
Definition: TrajectoryStateOnSurface.h:16
PTrajectoryStateOnDet::detId
unsigned int detId() const
Definition: PTrajectoryStateOnDet.h:65
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
reco::Track
Definition: Track.h:27
edm::ESHandle< TrackerTopology >
reco::TrackExtraCollection
std::vector< TrackExtra > TrackExtraCollection
collection of TrackExtra objects
Definition: TrackExtraFwd.h:10
SeedToTrackProducer::L2seedsTagS_
edm::EDGetTokenT< edm::View< TrajectorySeed > > L2seedsTagS_
Definition: SeedToTrackProducer.h:63
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
SeedToTrackProducer::theTrackingGeometry
edm::ESHandle< GlobalTrackingGeometry > theTrackingGeometry
Definition: SeedToTrackProducer.h:66
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
PV3DBase::eta
T eta() const
Definition: PV3DBase.h:73
iEvent
int iEvent
Definition: GenABIO.cc:224
trajectoryStateTransform::transientState
TrajectoryStateOnSurface transientState(const PTrajectoryStateOnDet &ts, const Surface *surface, const MagneticField *field)
Definition: TrajectoryStateTransform.cc:35
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
get
#define get
edm::Ref::key_type
std::remove_cv< typename std::remove_reference< argument_type >::type >::type key_type
Definition: Ref.h:164
TrackingRecHit
Definition: TrackingRecHit.h:21
TrajectoryStateOnSurface::globalMomentum
GlobalVector globalMomentum() const
Definition: TrajectoryStateOnSurface.h:66
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
SeedToTrackProducer::L2seedsTagT_
edm::EDGetTokenT< TrajectorySeedCollection > L2seedsTagT_
Definition: SeedToTrackProducer.h:62
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
TrajectoryStateOnSurface::curvilinearError
const CurvilinearTrajectoryError & curvilinearError() const
Definition: TrajectoryStateOnSurface.h:72
GlobalTrackingGeometry::idToDet
const GeomDet * idToDet(DetId) const override
Definition: GlobalTrackingGeometry.cc:44
TrackingRecHitCollection
edm::OwnVector< TrackingRecHit > TrackingRecHitCollection
collection of TrackingRecHits
Definition: TrackingRecHitFwd.h:10
SeedToTrackProducer::theMGField
edm::ESHandle< MagneticField > theMGField
Definition: SeedToTrackProducer.h:65
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::RefToBase< TrajectorySeed >
TrajectorySeed::startingState
PTrajectoryStateOnDet const & startingState() const
Definition: TrajectorySeed.h:55
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
PTrajectoryStateOnDet
Definition: PTrajectoryStateOnDet.h:10
PV3DBase::perp
T perp() const
Definition: PV3DBase.h:69
edm::InputTag
Definition: InputTag.h:15
reco::TrackCollection
std::vector< Track > TrackCollection
collection of Tracks
Definition: TrackFwd.h:14
PV3DBase::phi
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
CurvilinearTrajectoryError::matrix
const AlgebraicSymMatrix55 & matrix() const
Definition: CurvilinearTrajectoryError.h:61
hit
Definition: SiStripHitEffFromCalibTree.cc:88
edm::OwnVector< TrackingRecHit >
TrackCollections2monitor_cff.selectedTracks
selectedTracks
Definition: TrackCollections2monitor_cff.py:32
susybsm::HSCParticleType::globalMuon
Definition: HSCParticle.h:20