CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ShallowTracksProducer.cc
Go to the documentation of this file.
2 
8 #include "boost/foreach.hpp"
9 
11  : theTracksLabel( iConfig.getParameter<edm::InputTag>("Tracks") ),
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 }
42 
45  std::auto_ptr<unsigned int> number ( new unsigned int(0) );
46  std::auto_ptr<std::vector<double> > chi2 ( new std::vector<double>() );
47  std::auto_ptr<std::vector<double> > ndof ( new std::vector<double>() );
48  std::auto_ptr<std::vector<double> > chi2ndof ( new std::vector<double>() );
49  std::auto_ptr<std::vector<float> > charge ( new std::vector<float>() );
50  std::auto_ptr<std::vector<float> > momentum ( new std::vector<float>() );
51  std::auto_ptr<std::vector<float> > pt ( new std::vector<float>() );
52  std::auto_ptr<std::vector<float> > pterr ( new std::vector<float>() );
53  std::auto_ptr<std::vector<unsigned int> > hitsvalid ( new std::vector<unsigned int>() );
54  std::auto_ptr<std::vector<unsigned int> > hitslost ( new std::vector<unsigned int>() );
55  std::auto_ptr<std::vector<double> > theta ( new std::vector<double>() );
56  std::auto_ptr<std::vector<double> > thetaerr ( new std::vector<double>() );
57  std::auto_ptr<std::vector<double> > phi ( new std::vector<double>() );
58  std::auto_ptr<std::vector<double> > phierr ( new std::vector<double>() );
59  std::auto_ptr<std::vector<double> > eta ( new std::vector<double>() );
60  std::auto_ptr<std::vector<double> > etaerr ( new std::vector<double>() );
61  std::auto_ptr<std::vector<double> > dxy ( new std::vector<double>() );
62  std::auto_ptr<std::vector<double> > dxyerr ( new std::vector<double>() );
63  std::auto_ptr<std::vector<double> > dsz ( new std::vector<double>() );
64  std::auto_ptr<std::vector<double> > dszerr ( new std::vector<double>() );
65  std::auto_ptr<std::vector<double> > qoverp ( new std::vector<double>() );
66  std::auto_ptr<std::vector<double> > qoverperr ( new std::vector<double>() );
67  std::auto_ptr<std::vector<double> > vx ( new std::vector<double>() );
68  std::auto_ptr<std::vector<double> > vy ( new std::vector<double>() );
69  std::auto_ptr<std::vector<double> > vz ( new std::vector<double>() );
70  std::auto_ptr<std::vector<int> > algo ( new 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(number, Prefix + "number" + Suffix );
104  iEvent.put(chi2, Prefix + "chi2" + Suffix );
105  iEvent.put(ndof, Prefix + "ndof" + Suffix );
106  iEvent.put(chi2ndof, Prefix + "chi2ndof" + Suffix );
107  iEvent.put(charge, Prefix + "charge" + Suffix );
108  iEvent.put(momentum, Prefix + "momentum" + Suffix );
109  iEvent.put(pt, Prefix + "pt" + Suffix );
110  iEvent.put(pterr, Prefix + "pterr" + Suffix );
111  iEvent.put(hitsvalid, Prefix + "hitsvalid" + Suffix );
112  iEvent.put(hitslost, Prefix + "hitslost" + Suffix );
113  iEvent.put(theta, Prefix + "theta" + Suffix );
114  iEvent.put(thetaerr, Prefix + "thetaerr" + Suffix );
115  iEvent.put(phi, Prefix + "phi" + Suffix );
116  iEvent.put(phierr, Prefix + "phierr" + Suffix );
117  iEvent.put(eta, Prefix + "eta" + Suffix );
118  iEvent.put(etaerr, Prefix + "etaerr" + Suffix );
119  iEvent.put(dxy, Prefix + "dxy" + Suffix );
120  iEvent.put(dxyerr, Prefix + "dxyerr" + Suffix );
121  iEvent.put(dsz, Prefix + "dsz" + Suffix );
122  iEvent.put(dszerr, Prefix + "dszerr" + Suffix );
123  iEvent.put(qoverp, Prefix + "qoverp" + Suffix );
124  iEvent.put(qoverperr, Prefix + "qoverperr" + Suffix );
125  iEvent.put(vx, Prefix + "vx" + Suffix );
126  iEvent.put(vy, Prefix + "vy" + Suffix );
127  iEvent.put(vz, Prefix + "vz" + Suffix );
128  iEvent.put(algo, Prefix + "algo" + Suffix );
129 
130 }
131 
double qoverp() const
q / p
Definition: TrackBase.h:560
double p() const
momentum vector magnitude
Definition: TrackBase.h:602
double theta() const
polar angle
Definition: TrackBase.h:566
double dxyError() const
error on dxy
Definition: TrackBase.h:783
Geom::Theta< T > theta() const
double etaError() const
error on eta
Definition: TrackBase.h:771
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:632
unsigned short numberOfLostHits() const
number of cases where track crossed a layer without getting a hit.
Definition: TrackBase.h:813
void produce(edm::Event &, const edm::EventSetup &)
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:590
TrackAlgorithm algo() const
Definition: TrackBase.h:484
double dszError() const
error on dsz
Definition: TrackBase.h:795
int iEvent
Definition: GenABIO.cc:230
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:638
double chi2() const
chi-squared of the fit
Definition: TrackBase.h:536
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
double ndof() const
number of degrees of freedom of the fit
Definition: TrackBase.h:542
double pt() const
track transverse momentum
Definition: TrackBase.h:608
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
Definition: TrackBase.h:750
double phiError() const
error on phi
Definition: TrackBase.h:777
unsigned short numberOfValidHits() const
number of valid hits found
Definition: TrackBase.h:807
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:420
ShallowTracksProducer(const edm::ParameterSet &)
double qoverpError() const
error on signed transverse curvature
Definition: TrackBase.h:744
double vz() const
z coordinate of the reference point on track
Definition: TrackBase.h:656
tuple tracks
Definition: testEve_cfg.py:39
double vy() const
y coordinate of the reference point on track
Definition: TrackBase.h:650
int charge() const
track electric charge
Definition: TrackBase.h:554
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:578
double vx() const
x coordinate of the reference point on track
Definition: TrackBase.h:644
double thetaError() const
error on theta
Definition: TrackBase.h:759