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 ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
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)
 
 ~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
 
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
 
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 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)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
ProducesCollector producesCollector ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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 9 of file ShallowTracksProducer.cc.

References Prefix, and Suffix.

11  Prefix(iConfig.getParameter<std::string>("Prefix")),
12  Suffix(iConfig.getParameter<std::string>("Suffix")) {
13  produces<unsigned int>(Prefix + "number" + Suffix);
14  produces<std::vector<double>>(Prefix + "chi2" + Suffix);
15  produces<std::vector<double>>(Prefix + "ndof" + Suffix);
16  produces<std::vector<double>>(Prefix + "chi2ndof" + Suffix);
17  produces<std::vector<float>>(Prefix + "charge" + Suffix);
18  produces<std::vector<float>>(Prefix + "momentum" + Suffix);
19  produces<std::vector<float>>(Prefix + "pt" + Suffix);
20  produces<std::vector<float>>(Prefix + "pterr" + Suffix);
21  produces<std::vector<unsigned int>>(Prefix + "hitsvalid" + Suffix);
22  produces<std::vector<unsigned int>>(Prefix + "hitslost" + Suffix);
23  produces<std::vector<double>>(Prefix + "theta" + Suffix);
24  produces<std::vector<double>>(Prefix + "thetaerr" + Suffix);
25  produces<std::vector<double>>(Prefix + "phi" + Suffix);
26  produces<std::vector<double>>(Prefix + "phierr" + Suffix);
27  produces<std::vector<double>>(Prefix + "eta" + Suffix);
28  produces<std::vector<double>>(Prefix + "etaerr" + Suffix);
29  produces<std::vector<double>>(Prefix + "dxy" + Suffix);
30  produces<std::vector<double>>(Prefix + "dxyerr" + Suffix);
31  produces<std::vector<double>>(Prefix + "dsz" + Suffix);
32  produces<std::vector<double>>(Prefix + "dszerr" + Suffix);
33  produces<std::vector<double>>(Prefix + "qoverp" + Suffix);
34  produces<std::vector<double>>(Prefix + "qoverperr" + Suffix);
35  produces<std::vector<double>>(Prefix + "vx" + Suffix);
36  produces<std::vector<double>>(Prefix + "vy" + Suffix);
37  produces<std::vector<double>>(Prefix + "vz" + Suffix);
38  produces<std::vector<int>>(Prefix + "algo" + Suffix);
39 }
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 41 of file ShallowTracksProducer.cc.

References ecalcalib_dqm_sourceclient-live_cfg::algo, ALCARECOTkAlJpsiMuMu_cff::charge, hltPixelTracks_cff::chi2, PVValHelper::dxy, PVValHelper::eta, edm::Event::getByToken(), eostools::move(), ndof, contentValuesFiles::number, phi, Prefix, DiDispStaMuonMonitor_cfi::pt, edm::Event::put(), Suffix, theta(), HLT_2018_cff::track, PDWG_EXOHSCP_cff::tracks, and tracks_token_.

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

41  {
42  auto number = std::make_unique<unsigned int>(0);
43  auto chi2 = std::make_unique<std::vector<double>>();
44  auto ndof = std::make_unique<std::vector<double>>();
45  auto chi2ndof = std::make_unique<std::vector<double>>();
46  auto charge = std::make_unique<std::vector<float>>();
47  auto momentum = std::make_unique<std::vector<float>>();
48  auto pt = std::make_unique<std::vector<float>>();
49  auto pterr = std::make_unique<std::vector<float>>();
50  auto hitsvalid = std::make_unique<std::vector<unsigned int>>();
51  auto hitslost = std::make_unique<std::vector<unsigned int>>();
52  auto theta = std::make_unique<std::vector<double>>();
53  auto thetaerr = std::make_unique<std::vector<double>>();
54  auto phi = std::make_unique<std::vector<double>>();
55  auto phierr = std::make_unique<std::vector<double>>();
56  auto eta = std::make_unique<std::vector<double>>();
57  auto etaerr = std::make_unique<std::vector<double>>();
58  auto dxy = std::make_unique<std::vector<double>>();
59  auto dxyerr = std::make_unique<std::vector<double>>();
60  auto dsz = std::make_unique<std::vector<double>>();
61  auto dszerr = std::make_unique<std::vector<double>>();
62  auto qoverp = std::make_unique<std::vector<double>>();
63  auto qoverperr = std::make_unique<std::vector<double>>();
64  auto vx = std::make_unique<std::vector<double>>();
65  auto vy = std::make_unique<std::vector<double>>();
66  auto vz = std::make_unique<std::vector<double>>();
67  auto algo = std::make_unique<std::vector<int>>();
68 
70  iEvent.getByToken(tracks_token_, tracks);
71 
72  *number = tracks->size();
73  for (auto const& track : *tracks) {
74  chi2->push_back(track.chi2());
75  ndof->push_back(track.ndof());
76  chi2ndof->push_back(track.chi2() / track.ndof());
77  charge->push_back(track.charge());
78  momentum->push_back(track.p());
79  pt->push_back(track.pt());
80  pterr->push_back(track.ptError());
81  hitsvalid->push_back(track.numberOfValidHits());
82  hitslost->push_back(track.numberOfLostHits());
83  theta->push_back(track.theta());
84  thetaerr->push_back(track.thetaError());
85  phi->push_back(track.phi());
86  phierr->push_back(track.phiError());
87  eta->push_back(track.eta());
88  etaerr->push_back(track.etaError());
89  dxy->push_back(track.dxy());
90  dxyerr->push_back(track.dxyError());
91  dsz->push_back(track.dsz());
92  dszerr->push_back(track.dszError());
93  qoverp->push_back(track.qoverp());
94  qoverperr->push_back(track.qoverpError());
95  vx->push_back(track.vx());
96  vy->push_back(track.vy());
97  vz->push_back(track.vz());
98  algo->push_back((int)track.algo());
99  }
100 
101  iEvent.put(std::move(number), Prefix + "number" + Suffix);
102  iEvent.put(std::move(chi2), Prefix + "chi2" + Suffix);
103  iEvent.put(std::move(ndof), Prefix + "ndof" + Suffix);
104  iEvent.put(std::move(chi2ndof), Prefix + "chi2ndof" + Suffix);
105  iEvent.put(std::move(charge), Prefix + "charge" + Suffix);
106  iEvent.put(std::move(momentum), Prefix + "momentum" + Suffix);
107  iEvent.put(std::move(pt), Prefix + "pt" + Suffix);
108  iEvent.put(std::move(pterr), Prefix + "pterr" + Suffix);
109  iEvent.put(std::move(hitsvalid), Prefix + "hitsvalid" + Suffix);
110  iEvent.put(std::move(hitslost), Prefix + "hitslost" + Suffix);
111  iEvent.put(std::move(theta), Prefix + "theta" + Suffix);
112  iEvent.put(std::move(thetaerr), Prefix + "thetaerr" + Suffix);
113  iEvent.put(std::move(phi), Prefix + "phi" + Suffix);
114  iEvent.put(std::move(phierr), Prefix + "phierr" + Suffix);
115  iEvent.put(std::move(eta), Prefix + "eta" + Suffix);
116  iEvent.put(std::move(etaerr), Prefix + "etaerr" + Suffix);
117  iEvent.put(std::move(dxy), Prefix + "dxy" + Suffix);
118  iEvent.put(std::move(dxyerr), Prefix + "dxyerr" + Suffix);
119  iEvent.put(std::move(dsz), Prefix + "dsz" + Suffix);
120  iEvent.put(std::move(dszerr), Prefix + "dszerr" + Suffix);
121  iEvent.put(std::move(qoverp), Prefix + "qoverp" + Suffix);
122  iEvent.put(std::move(qoverperr), Prefix + "qoverperr" + Suffix);
123  iEvent.put(std::move(vx), Prefix + "vx" + Suffix);
124  iEvent.put(std::move(vy), Prefix + "vy" + Suffix);
125  iEvent.put(std::move(vz), Prefix + "vz" + Suffix);
126  iEvent.put(std::move(algo), Prefix + "algo" + Suffix);
127 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:131
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:525
Geom::Theta< T > theta() const
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

std::string ShallowTracksProducer::Prefix
private

Definition at line 16 of file ShallowTracksProducer.h.

Referenced by produce(), and ShallowTracksProducer().

std::string ShallowTracksProducer::Suffix
private

Definition at line 17 of file ShallowTracksProducer.h.

Referenced by produce(), and ShallowTracksProducer().

edm::InputTag ShallowTracksProducer::theTracksLabel
private

Definition at line 15 of file ShallowTracksProducer.h.

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

Definition at line 14 of file ShallowTracksProducer.h.

Referenced by produce().