CMS 3D CMS Logo

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

#include <ShallowTracksProducer.h>

Inheritance diagram for ShallowTracksProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 ShallowTracksProducer (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () 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
 
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)
 
virtual ~ProducerBase () noexcept(false)
 
- 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
 
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::vector< ModuleDescription const * > &modules, 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 updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

std::string Prefix
 
std::string Suffix
 
edm::InputTag theTracksLabel
 
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer 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::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Definition at line 9 of file ShallowTracksProducer.h.

Constructor & Destructor Documentation

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

Definition at line 10 of file ShallowTracksProducer.cc.

References Prefix, produce(), and Suffix.

12  Prefix ( iConfig.getParameter<std::string>("Prefix") ),
13  Suffix ( iConfig.getParameter<std::string>("Suffix") )
14 {
15  produces <unsigned int> ( Prefix + "number" + Suffix );
16  produces <std::vector<double> > ( Prefix + "chi2" + Suffix );
17  produces <std::vector<double> > ( Prefix + "ndof" + Suffix );
18  produces <std::vector<double> > ( Prefix + "chi2ndof" + Suffix );
19  produces <std::vector<float> > ( Prefix + "charge" + Suffix );
20  produces <std::vector<float> > ( Prefix + "momentum" + Suffix );
21  produces <std::vector<float> > ( Prefix + "pt" + Suffix );
22  produces <std::vector<float> > ( Prefix + "pterr" + Suffix );
23  produces <std::vector<unsigned int> > ( Prefix + "hitsvalid" + Suffix );
24  produces <std::vector<unsigned int> > ( Prefix + "hitslost" + Suffix );
25  produces <std::vector<double> > ( Prefix + "theta" + Suffix );
26  produces <std::vector<double> > ( Prefix + "thetaerr" + Suffix );
27  produces <std::vector<double> > ( Prefix + "phi" + Suffix );
28  produces <std::vector<double> > ( Prefix + "phierr" + Suffix );
29  produces <std::vector<double> > ( Prefix + "eta" + Suffix );
30  produces <std::vector<double> > ( Prefix + "etaerr" + Suffix );
31  produces <std::vector<double> > ( Prefix + "dxy" + Suffix );
32  produces <std::vector<double> > ( Prefix + "dxyerr" + Suffix );
33  produces <std::vector<double> > ( Prefix + "dsz" + Suffix );
34  produces <std::vector<double> > ( Prefix + "dszerr" + Suffix );
35  produces <std::vector<double> > ( Prefix + "qoverp" + Suffix );
36  produces <std::vector<double> > ( Prefix + "qoverperr" + Suffix );
37  produces <std::vector<double> > ( Prefix + "vx" + Suffix );
38  produces <std::vector<double> > ( Prefix + "vy" + Suffix );
39  produces <std::vector<double> > ( Prefix + "vz" + Suffix );
40  produces <std::vector<int> > ( Prefix + "algo" + Suffix );
41 }
T getParameter(std::string const &) const
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_

Member Function Documentation

void ShallowTracksProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 44 of file ShallowTracksProducer.cc.

References patPFMETCorrections_cff::algo, reco::TrackBase::algo(), ALCARECOTkAlJpsiMuMu_cff::charge, reco::TrackBase::charge(), vertices_cff::chi2, reco::TrackBase::chi2(), reco::TrackBase::dsz(), reco::TrackBase::dszError(), PVValHelper::dxy, reco::TrackBase::dxy(), reco::TrackBase::dxyError(), PVValHelper::eta, reco::TrackBase::eta(), reco::TrackBase::etaError(), edm::Event::getByToken(), eostools::move(), ndof, reco::TrackBase::ndof(), reco::TrackBase::numberOfLostHits(), reco::TrackBase::numberOfValidHits(), reco::TrackBase::p(), phi, reco::TrackBase::phi(), reco::TrackBase::phiError(), Prefix, EnergyCorrector::pt, reco::TrackBase::pt(), reco::TrackBase::ptError(), edm::Event::put(), reco::TrackBase::qoverp(), reco::TrackBase::qoverpError(), Suffix, theta(), reco::TrackBase::theta(), reco::TrackBase::thetaError(), HiIsolationCommonParameters_cff::track, l1t::tracks, tracks_token_, reco::TrackBase::vx(), reco::TrackBase::vy(), and reco::TrackBase::vz().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), HTMLExport.HTMLExportStatic::export(), and ShallowTracksProducer().

44  {
45  auto number = std::make_unique<unsigned int>(0);
46  auto chi2 = std::make_unique<std::vector<double>>();
47  auto ndof = std::make_unique<std::vector<double>>();
48  auto chi2ndof = std::make_unique<std::vector<double>>();
49  auto charge = std::make_unique<std::vector<float>>();
50  auto momentum = std::make_unique<std::vector<float>>();
51  auto pt = std::make_unique<std::vector<float>>();
52  auto pterr = std::make_unique<std::vector<float>>();
53  auto hitsvalid = std::make_unique<std::vector<unsigned int>>();
54  auto hitslost = std::make_unique<std::vector<unsigned int>>();
55  auto theta = std::make_unique<std::vector<double>>();
56  auto thetaerr = std::make_unique<std::vector<double>>();
57  auto phi = std::make_unique<std::vector<double>>();
58  auto phierr = std::make_unique<std::vector<double>>();
59  auto eta = std::make_unique<std::vector<double>>();
60  auto etaerr = std::make_unique<std::vector<double>>();
61  auto dxy = std::make_unique<std::vector<double>>();
62  auto dxyerr = std::make_unique<std::vector<double>>();
63  auto dsz = std::make_unique<std::vector<double>>();
64  auto dszerr = std::make_unique<std::vector<double>>();
65  auto qoverp = std::make_unique<std::vector<double>>();
66  auto qoverperr = std::make_unique<std::vector<double>>();
67  auto vx = std::make_unique<std::vector<double>>();
68  auto vy = std::make_unique<std::vector<double>>();
69  auto vz = std::make_unique<std::vector<double>>();
70  auto algo = std::make_unique<std::vector<int>>();
71 
73 
74  *number = tracks->size();
75  BOOST_FOREACH( const reco::Track track, *tracks) {
76  chi2->push_back( track.chi2() );
77  ndof->push_back( track.ndof() );
78  chi2ndof->push_back( track.chi2()/track.ndof() );
79  charge->push_back( track.charge() );
80  momentum->push_back( track.p() );
81  pt->push_back( track.pt() );
82  pterr->push_back( track.ptError() );
83  hitsvalid->push_back( track.numberOfValidHits() );
84  hitslost->push_back( track.numberOfLostHits() );
85  theta->push_back( track.theta() );
86  thetaerr->push_back( track.thetaError() );
87  phi->push_back( track.phi() );
88  phierr->push_back( track.phiError() );
89  eta->push_back( track.eta() );
90  etaerr->push_back( track.etaError() );
91  dxy->push_back( track.dxy() );
92  dxyerr->push_back( track.dxyError() );
93  dsz->push_back( track.dsz() );
94  dszerr->push_back( track.dszError() );
95  qoverp->push_back( track.qoverp() );
96  qoverperr->push_back( track.qoverpError() );
97  vx->push_back( track.vx() );
98  vy->push_back( track.vy() );
99  vz->push_back( track.vz() );
100  algo->push_back( (int) track.algo() );
101  }
102 
103  iEvent.put(std::move(number), Prefix + "number" + Suffix );
104  iEvent.put(std::move(chi2), Prefix + "chi2" + Suffix );
105  iEvent.put(std::move(ndof), Prefix + "ndof" + Suffix );
106  iEvent.put(std::move(chi2ndof), Prefix + "chi2ndof" + Suffix );
107  iEvent.put(std::move(charge), Prefix + "charge" + Suffix );
108  iEvent.put(std::move(momentum), Prefix + "momentum" + Suffix );
109  iEvent.put(std::move(pt), Prefix + "pt" + Suffix );
110  iEvent.put(std::move(pterr), Prefix + "pterr" + Suffix );
111  iEvent.put(std::move(hitsvalid), Prefix + "hitsvalid" + Suffix );
112  iEvent.put(std::move(hitslost), Prefix + "hitslost" + Suffix );
113  iEvent.put(std::move(theta), Prefix + "theta" + Suffix );
114  iEvent.put(std::move(thetaerr), Prefix + "thetaerr" + Suffix );
115  iEvent.put(std::move(phi), Prefix + "phi" + Suffix );
116  iEvent.put(std::move(phierr), Prefix + "phierr" + Suffix );
117  iEvent.put(std::move(eta), Prefix + "eta" + Suffix );
118  iEvent.put(std::move(etaerr), Prefix + "etaerr" + Suffix );
119  iEvent.put(std::move(dxy), Prefix + "dxy" + Suffix );
120  iEvent.put(std::move(dxyerr), Prefix + "dxyerr" + Suffix );
121  iEvent.put(std::move(dsz), Prefix + "dsz" + Suffix );
122  iEvent.put(std::move(dszerr), Prefix + "dszerr" + Suffix );
123  iEvent.put(std::move(qoverp), Prefix + "qoverp" + Suffix );
124  iEvent.put(std::move(qoverperr), Prefix + "qoverperr" + Suffix );
125  iEvent.put(std::move(vx), Prefix + "vx" + Suffix );
126  iEvent.put(std::move(vy), Prefix + "vy" + Suffix );
127  iEvent.put(std::move(vz), Prefix + "vz" + Suffix );
128  iEvent.put(std::move(algo), Prefix + "algo" + Suffix );
129 
130 }
double qoverp() const
q / p
Definition: TrackBase.h:573
double p() const
momentum vector magnitude
Definition: TrackBase.h:615
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:127
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:508
double theta() const
polar angle
Definition: TrackBase.h:579
double dxyError() const
error on dxy
Definition: TrackBase.h:796
Geom::Theta< T > theta() const
double etaError() const
error on eta
Definition: TrackBase.h:784
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:645
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:826
double dsz() const
dsz parameter (THIS IS NOT the SZ impact parameter to (0,0,0) if refPoint is far from (0...
Definition: TrackBase.h:603
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
TrackAlgorithm algo() const
Definition: TrackBase.h:497
double dszError() const
error on dsz
Definition: TrackBase.h:808
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:651
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:549
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:555
double pt() const
track transverse momentum
Definition: TrackBase.h:621
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:763
double phiError() const
error on phi
Definition: TrackBase.h:790
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:820
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:757
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:669
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:663
int charge() const
track electric charge
Definition: TrackBase.h:567
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
Definition: TrackBase.h:591
def move(src, dest)
Definition: eostools.py:510
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:657
double thetaError() const
error on theta
Definition: TrackBase.h:772

Member Data Documentation

std::string ShallowTracksProducer::Prefix
private

Definition at line 15 of file ShallowTracksProducer.h.

Referenced by produce(), and ShallowTracksProducer().

std::string ShallowTracksProducer::Suffix
private

Definition at line 16 of file ShallowTracksProducer.h.

Referenced by produce(), and ShallowTracksProducer().

edm::InputTag ShallowTracksProducer::theTracksLabel
private

Definition at line 14 of file ShallowTracksProducer.h.

const edm::EDGetTokenT<edm::View<reco::Track> > ShallowTracksProducer::tracks_token_
private

Definition at line 13 of file ShallowTracksProducer.h.

Referenced by produce().