CMS 3D CMS Logo

ShallowTracksProducer.cc
Go to the documentation of this file.
2 
8 
10  : tracks_token_( consumes<edm::View<reco::Track> >( iConfig.getParameter<edm::InputTag>("Tracks") )),
11  Prefix ( iConfig.getParameter<std::string>("Prefix") ),
12  Suffix ( iConfig.getParameter<std::string>("Suffix") )
13 {
14  produces <unsigned int> ( Prefix + "number" + Suffix );
15  produces <std::vector<double> > ( Prefix + "chi2" + Suffix );
16  produces <std::vector<double> > ( Prefix + "ndof" + Suffix );
17  produces <std::vector<double> > ( Prefix + "chi2ndof" + Suffix );
18  produces <std::vector<float> > ( Prefix + "charge" + Suffix );
19  produces <std::vector<float> > ( Prefix + "momentum" + Suffix );
20  produces <std::vector<float> > ( Prefix + "pt" + Suffix );
21  produces <std::vector<float> > ( Prefix + "pterr" + Suffix );
22  produces <std::vector<unsigned int> > ( Prefix + "hitsvalid" + Suffix );
23  produces <std::vector<unsigned int> > ( Prefix + "hitslost" + Suffix );
24  produces <std::vector<double> > ( Prefix + "theta" + Suffix );
25  produces <std::vector<double> > ( Prefix + "thetaerr" + Suffix );
26  produces <std::vector<double> > ( Prefix + "phi" + Suffix );
27  produces <std::vector<double> > ( Prefix + "phierr" + Suffix );
28  produces <std::vector<double> > ( Prefix + "eta" + Suffix );
29  produces <std::vector<double> > ( Prefix + "etaerr" + Suffix );
30  produces <std::vector<double> > ( Prefix + "dxy" + Suffix );
31  produces <std::vector<double> > ( Prefix + "dxyerr" + Suffix );
32  produces <std::vector<double> > ( Prefix + "dsz" + Suffix );
33  produces <std::vector<double> > ( Prefix + "dszerr" + Suffix );
34  produces <std::vector<double> > ( Prefix + "qoverp" + Suffix );
35  produces <std::vector<double> > ( Prefix + "qoverperr" + Suffix );
36  produces <std::vector<double> > ( Prefix + "vx" + Suffix );
37  produces <std::vector<double> > ( Prefix + "vy" + Suffix );
38  produces <std::vector<double> > ( Prefix + "vz" + Suffix );
39  produces <std::vector<int> > ( Prefix + "algo" + Suffix );
40 }
41 
44  auto number = std::make_unique<unsigned int>(0);
45  auto chi2 = std::make_unique<std::vector<double>>();
46  auto ndof = std::make_unique<std::vector<double>>();
47  auto chi2ndof = std::make_unique<std::vector<double>>();
48  auto charge = std::make_unique<std::vector<float>>();
49  auto momentum = std::make_unique<std::vector<float>>();
50  auto pt = std::make_unique<std::vector<float>>();
51  auto pterr = std::make_unique<std::vector<float>>();
52  auto hitsvalid = std::make_unique<std::vector<unsigned int>>();
53  auto hitslost = std::make_unique<std::vector<unsigned int>>();
54  auto theta = std::make_unique<std::vector<double>>();
55  auto thetaerr = std::make_unique<std::vector<double>>();
56  auto phi = std::make_unique<std::vector<double>>();
57  auto phierr = std::make_unique<std::vector<double>>();
58  auto eta = std::make_unique<std::vector<double>>();
59  auto etaerr = std::make_unique<std::vector<double>>();
60  auto dxy = std::make_unique<std::vector<double>>();
61  auto dxyerr = std::make_unique<std::vector<double>>();
62  auto dsz = std::make_unique<std::vector<double>>();
63  auto dszerr = std::make_unique<std::vector<double>>();
64  auto qoverp = std::make_unique<std::vector<double>>();
65  auto qoverperr = std::make_unique<std::vector<double>>();
66  auto vx = std::make_unique<std::vector<double>>();
67  auto vy = std::make_unique<std::vector<double>>();
68  auto vz = std::make_unique<std::vector<double>>();
69  auto algo = std::make_unique<std::vector<int>>();
70 
72 
73  *number = tracks->size();
74  for(auto const& track : *tracks) {
75  chi2->push_back( track.chi2() );
76  ndof->push_back( track.ndof() );
77  chi2ndof->push_back( track.chi2()/track.ndof() );
78  charge->push_back( track.charge() );
79  momentum->push_back( track.p() );
80  pt->push_back( track.pt() );
81  pterr->push_back( track.ptError() );
82  hitsvalid->push_back( track.numberOfValidHits() );
83  hitslost->push_back( track.numberOfLostHits() );
84  theta->push_back( track.theta() );
85  thetaerr->push_back( track.thetaError() );
86  phi->push_back( track.phi() );
87  phierr->push_back( track.phiError() );
88  eta->push_back( track.eta() );
89  etaerr->push_back( track.etaError() );
90  dxy->push_back( track.dxy() );
91  dxyerr->push_back( track.dxyError() );
92  dsz->push_back( track.dsz() );
93  dszerr->push_back( track.dszError() );
94  qoverp->push_back( track.qoverp() );
95  qoverperr->push_back( track.qoverpError() );
96  vx->push_back( track.vx() );
97  vy->push_back( track.vy() );
98  vz->push_back( track.vz() );
99  algo->push_back( (int) track.algo() );
100  }
101 
102  iEvent.put(std::move(number), Prefix + "number" + Suffix );
103  iEvent.put(std::move(chi2), Prefix + "chi2" + Suffix );
104  iEvent.put(std::move(ndof), Prefix + "ndof" + Suffix );
105  iEvent.put(std::move(chi2ndof), Prefix + "chi2ndof" + Suffix );
106  iEvent.put(std::move(charge), Prefix + "charge" + Suffix );
107  iEvent.put(std::move(momentum), Prefix + "momentum" + Suffix );
108  iEvent.put(std::move(pt), Prefix + "pt" + Suffix );
109  iEvent.put(std::move(pterr), Prefix + "pterr" + Suffix );
110  iEvent.put(std::move(hitsvalid), Prefix + "hitsvalid" + Suffix );
111  iEvent.put(std::move(hitslost), Prefix + "hitslost" + Suffix );
112  iEvent.put(std::move(theta), Prefix + "theta" + Suffix );
113  iEvent.put(std::move(thetaerr), Prefix + "thetaerr" + Suffix );
114  iEvent.put(std::move(phi), Prefix + "phi" + Suffix );
115  iEvent.put(std::move(phierr), Prefix + "phierr" + Suffix );
116  iEvent.put(std::move(eta), Prefix + "eta" + Suffix );
117  iEvent.put(std::move(etaerr), Prefix + "etaerr" + Suffix );
118  iEvent.put(std::move(dxy), Prefix + "dxy" + Suffix );
119  iEvent.put(std::move(dxyerr), Prefix + "dxyerr" + Suffix );
120  iEvent.put(std::move(dsz), Prefix + "dsz" + Suffix );
121  iEvent.put(std::move(dszerr), Prefix + "dszerr" + Suffix );
122  iEvent.put(std::move(qoverp), Prefix + "qoverp" + Suffix );
123  iEvent.put(std::move(qoverperr), Prefix + "qoverperr" + Suffix );
124  iEvent.put(std::move(vx), Prefix + "vx" + Suffix );
125  iEvent.put(std::move(vy), Prefix + "vy" + Suffix );
126  iEvent.put(std::move(vz), Prefix + "vz" + Suffix );
127  iEvent.put(std::move(algo), Prefix + "algo" + Suffix );
128 
129 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
void produce(edm::Event &, const edm::EventSetup &) override
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
Geom::Theta< T > theta() const
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
int iEvent
Definition: GenABIO.cc:224
ShallowTracksProducer(const edm::ParameterSet &)
fixed size matrix
HLT enums.
def move(src, dest)
Definition: eostools.py:511