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  numberPut_(produces<unsigned int>(Prefix + "number" + Suffix)),
14  chi2Put_(produces<std::vector<double>>(Prefix + "chi2" + Suffix)),
15  ndofPut_(produces<std::vector<double>>(Prefix + "ndof" + Suffix)),
16  chi2ndofPut_(produces<std::vector<double>>(Prefix + "chi2ndof" + Suffix)),
17  chargePut_(produces<std::vector<float>>(Prefix + "charge" + Suffix)),
18  momentumPut_(produces<std::vector<float>>(Prefix + "momentum" + Suffix)),
19  ptPut_(produces<std::vector<float>>(Prefix + "pt" + Suffix)),
20  pterrPut_(produces<std::vector<float>>(Prefix + "pterr" + Suffix)),
21  hitsvalidPut_(produces<std::vector<unsigned int>>(Prefix + "hitsvalid" + Suffix)),
22  hitslostPut_(produces<std::vector<unsigned int>>(Prefix + "hitslost" + Suffix)),
23  thetaPut_(produces<std::vector<double>>(Prefix + "theta" + Suffix)),
24  thetaerrPut_(produces<std::vector<double>>(Prefix + "thetaerr" + Suffix)),
25  phiPut_(produces<std::vector<double>>(Prefix + "phi" + Suffix)),
26  phierrPut_(produces<std::vector<double>>(Prefix + "phierr" + Suffix)),
27  etaPut_(produces<std::vector<double>>(Prefix + "eta" + Suffix)),
28  etaerrPut_(produces<std::vector<double>>(Prefix + "etaerr" + Suffix)),
29  dxyPut_(produces<std::vector<double>>(Prefix + "dxy" + Suffix)),
30  dxyerrPut_(produces<std::vector<double>>(Prefix + "dxyerr" + Suffix)),
31  dszPut_(produces<std::vector<double>>(Prefix + "dsz" + Suffix)),
32  dszerrPut_(produces<std::vector<double>>(Prefix + "dszerr" + Suffix)),
33  qoverpPut_(produces<std::vector<double>>(Prefix + "qoverp" + Suffix)),
34  qoverperrPut_(produces<std::vector<double>>(Prefix + "qoverperr" + Suffix)),
35  vxPut_(produces<std::vector<double>>(Prefix + "vx" + Suffix)),
36  vyPut_(produces<std::vector<double>>(Prefix + "vy" + Suffix)),
37  vzPut_(produces<std::vector<double>>(Prefix + "vz" + Suffix)),
38  algoPut_(produces<std::vector<int>>(Prefix + "algo" + Suffix)) {}
39 
42  iEvent.getByToken(tracks_token_, tracks);
43 
44  unsigned int number = tracks->size();
45  std::vector<double> chi2;
46  chi2.reserve(number);
47  std::vector<double> ndof;
48  ndof.reserve(number);
49  std::vector<double> chi2ndof;
50  chi2ndof.reserve(number);
51  std::vector<float> charge;
52  charge.reserve(number);
53  std::vector<float> momentum;
54  momentum.reserve(number);
55  std::vector<float> pt;
56  pt.reserve(number);
57  std::vector<float> pterr;
58  pterr.reserve(number);
59  std::vector<unsigned int> hitsvalid;
60  hitsvalid.reserve(number);
61  std::vector<unsigned int> hitslost;
62  hitslost.reserve(number);
63  std::vector<double> theta;
64  theta.reserve(number);
65  std::vector<double> thetaerr;
66  thetaerr.reserve(number);
67  std::vector<double> phi;
68  phi.reserve(number);
69  std::vector<double> phierr;
70  phierr.reserve(number);
71  std::vector<double> eta;
72  eta.reserve(number);
73  std::vector<double> etaerr;
74  etaerr.reserve(number);
75  std::vector<double> dxy;
76  dxy.reserve(number);
77  std::vector<double> dxyerr;
78  dxyerr.reserve(number);
79  std::vector<double> dsz;
80  dsz.reserve(number);
81  std::vector<double> dszerr;
82  dszerr.reserve(number);
83  std::vector<double> qoverp;
84  qoverp.reserve(number);
85  std::vector<double> qoverperr;
86  qoverperr.reserve(number);
87  std::vector<double> vx;
88  vx.reserve(number);
89  std::vector<double> vy;
90  vy.reserve(number);
91  std::vector<double> vz;
92  vz.reserve(number);
93  std::vector<int> algo;
94  algo.reserve(number);
95 
96  for (auto const& track : *tracks) {
97  chi2.push_back(track.chi2());
98  ndof.push_back(track.ndof());
99  chi2ndof.push_back(track.chi2() / track.ndof());
100  charge.push_back(track.charge());
101  momentum.push_back(track.p());
102  pt.push_back(track.pt());
103  pterr.push_back(track.ptError());
104  hitsvalid.push_back(track.numberOfValidHits());
105  hitslost.push_back(track.numberOfLostHits());
106  theta.push_back(track.theta());
107  thetaerr.push_back(track.thetaError());
108  phi.push_back(track.phi());
109  phierr.push_back(track.phiError());
110  eta.push_back(track.eta());
111  etaerr.push_back(track.etaError());
112  dxy.push_back(track.dxy());
113  dxyerr.push_back(track.dxyError());
114  dsz.push_back(track.dsz());
115  dszerr.push_back(track.dszError());
116  qoverp.push_back(track.qoverp());
117  qoverperr.push_back(track.qoverpError());
118  vx.push_back(track.vx());
119  vy.push_back(track.vy());
120  vz.push_back(track.vz());
121  algo.push_back((int)track.algo());
122  }
123 
124  iEvent.emplace(numberPut_, number);
125  iEvent.emplace(chi2Put_, std::move(chi2));
126  iEvent.emplace(ndofPut_, std::move(ndof));
127  iEvent.emplace(chi2ndofPut_, std::move(chi2ndof));
128  iEvent.emplace(chargePut_, std::move(charge));
129  iEvent.emplace(momentumPut_, std::move(momentum));
130  iEvent.emplace(ptPut_, std::move(pt));
131  iEvent.emplace(pterrPut_, std::move(pterr));
132  iEvent.emplace(hitsvalidPut_, std::move(hitsvalid));
133  iEvent.emplace(hitslostPut_, std::move(hitslost));
134  iEvent.emplace(thetaPut_, std::move(theta));
135  iEvent.emplace(thetaerrPut_, std::move(thetaerr));
136  iEvent.emplace(phiPut_, std::move(phi));
137  iEvent.emplace(phierrPut_, std::move(phierr));
138  iEvent.emplace(etaPut_, std::move(eta));
139  iEvent.emplace(etaerrPut_, std::move(etaerr));
140  iEvent.emplace(dxyPut_, std::move(dxy));
141  iEvent.emplace(dxyerrPut_, std::move(dxyerr));
142  iEvent.emplace(dszPut_, std::move(dsz));
143  iEvent.emplace(dszerrPut_, std::move(dszerr));
144  iEvent.emplace(qoverpPut_, std::move(qoverp));
145  iEvent.emplace(qoverperrPut_, std::move(qoverperr));
146  iEvent.emplace(vxPut_, std::move(vx));
147  iEvent.emplace(vyPut_, std::move(vy));
148  iEvent.emplace(vzPut_, std::move(vz));
149  iEvent.emplace(algoPut_, std::move(algo));
150 }
edm::StreamID
Definition: StreamID.h:30
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
ShallowTracksProducer::thetaerrPut_
const edm::EDPutTokenT< std::vector< double > > thetaerrPut_
Definition: ShallowTracksProducer.h:31
ShallowTracksProducer::chi2Put_
const edm::EDPutTokenT< std::vector< double > > chi2Put_
Definition: ShallowTracksProducer.h:21
HLT_FULL_cff.track
track
Definition: HLT_FULL_cff.py:11713
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
ShallowTracksProducer::dszPut_
const edm::EDPutTokenT< std::vector< double > > dszPut_
Definition: ShallowTracksProducer.h:38
sistrip::View
View
Definition: ConstantsForView.h:26
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
edm
HLT enums.
Definition: AlignableModifier.h:19
ShallowTracksProducer::ShallowTracksProducer
ShallowTracksProducer(const edm::ParameterSet &)
Definition: ShallowTracksProducer.cc:9
ShallowTracksProducer::hitslostPut_
const edm::EDPutTokenT< std::vector< unsigned int > > hitslostPut_
Definition: ShallowTracksProducer.h:29
ShallowTracksProducer::phierrPut_
const edm::EDPutTokenT< std::vector< double > > phierrPut_
Definition: ShallowTracksProducer.h:33
ShallowTracksProducer::qoverpPut_
const edm::EDPutTokenT< std::vector< double > > qoverpPut_
Definition: ShallowTracksProducer.h:40
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
ShallowTracksProducer::qoverperrPut_
const edm::EDPutTokenT< std::vector< double > > qoverperrPut_
Definition: ShallowTracksProducer.h:41
reco
fixed size matrix
Definition: AlignmentAlgorithmBase.h:45
hltPixelTracks_cff.chi2
chi2
Definition: hltPixelTracks_cff.py:25
edm::Handle
Definition: AssociativeIterator.h:50
ndof
Definition: HIMultiTrackSelector.h:49
cmsdt::algo
algo
Definition: constants.h:164
ShallowTracksProducer::ptPut_
const edm::EDPutTokenT< std::vector< float > > ptPut_
Definition: ShallowTracksProducer.h:26
Track.h
TrackFwd.h
contentValuesFiles.number
number
Definition: contentValuesFiles.py:53
PVValHelper::eta
Definition: PVValidationHelpers.h:69
ShallowTracksProducer::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: ShallowTracksProducer.cc:40
ShallowTracksProducer::dszerrPut_
const edm::EDPutTokenT< std::vector< double > > dszerrPut_
Definition: ShallowTracksProducer.h:39
ShallowTracksProducer.h
L1TCaloTriggerNtuples_cff.Prefix
Prefix
Definition: L1TCaloTriggerNtuples_cff.py:8
theta
Geom::Theta< T > theta() const
Definition: Basic3DVectorLD.h:150
ShallowTracksProducer::chi2ndofPut_
const edm::EDPutTokenT< std::vector< double > > chi2ndofPut_
Definition: ShallowTracksProducer.h:23
ShallowTracksProducer::dxyPut_
const edm::EDPutTokenT< std::vector< double > > dxyPut_
Definition: ShallowTracksProducer.h:36
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
ShallowTracksProducer::algoPut_
const edm::EDPutTokenT< std::vector< int > > algoPut_
Definition: ShallowTracksProducer.h:45
ShallowTracksProducer::hitsvalidPut_
const edm::EDPutTokenT< std::vector< unsigned int > > hitsvalidPut_
Definition: ShallowTracksProducer.h:28
ALCARECOTkAlJpsiMuMu_cff.charge
charge
Definition: ALCARECOTkAlJpsiMuMu_cff.py:47
ShallowTracksProducer::numberPut_
const edm::EDPutTokenT< unsigned int > numberPut_
Definition: ShallowTracksProducer.h:20
ShallowTracksProducer::momentumPut_
const edm::EDPutTokenT< std::vector< float > > momentumPut_
Definition: ShallowTracksProducer.h:25
ShallowTracksProducer::etaPut_
const edm::EDPutTokenT< std::vector< double > > etaPut_
Definition: ShallowTracksProducer.h:34
ShallowTracksProducer::vxPut_
const edm::EDPutTokenT< std::vector< double > > vxPut_
Definition: ShallowTracksProducer.h:42
ShallowTracksProducer::thetaPut_
const edm::EDPutTokenT< std::vector< double > > thetaPut_
Definition: ShallowTracksProducer.h:30
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ShallowTracksProducer::ndofPut_
const edm::EDPutTokenT< std::vector< double > > ndofPut_
Definition: ShallowTracksProducer.h:22
ShallowTracksProducer::phiPut_
const edm::EDPutTokenT< std::vector< double > > phiPut_
Definition: ShallowTracksProducer.h:32
ShallowTracksProducer::tracks_token_
const edm::EDGetTokenT< edm::View< reco::Track > > tracks_token_
Definition: ShallowTracksProducer.h:14
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
edm::EventSetup
Definition: EventSetup.h:57
ShallowTracksProducer::dxyerrPut_
const edm::EDPutTokenT< std::vector< double > > dxyerrPut_
Definition: ShallowTracksProducer.h:37
DDAxes::phi
Trajectory.h
ShallowTracksProducer::pterrPut_
const edm::EDPutTokenT< std::vector< float > > pterrPut_
Definition: ShallowTracksProducer.h:27
ShallowTracksProducer::etaerrPut_
const edm::EDPutTokenT< std::vector< double > > etaerrPut_
Definition: ShallowTracksProducer.h:35
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
PVValHelper::dxy
Definition: PVValidationHelpers.h:47
ShallowTracksProducer::vzPut_
const edm::EDPutTokenT< std::vector< double > > vzPut_
Definition: ShallowTracksProducer.h:44
ParameterSet.h
edm::Event
Definition: Event.h:73
ShallowTracksProducer::vyPut_
const edm::EDPutTokenT< std::vector< double > > vyPut_
Definition: ShallowTracksProducer.h:43
ShallowTracksProducer::chargePut_
const edm::EDPutTokenT< std::vector< float > > chargePut_
Definition: ShallowTracksProducer.h:24