149 using namespace reco;
159 double bestvz = -999.9, bestvx = -999.9, bestvy = -999.9;
160 double bestvzError = -999.9, bestvxError = -999.9, bestvyError = -999.9;
164 if (privtxs->begin() != privtxs->end() && !(pvtx.
isFake()) && pvtx.
position().Rho() <= 2. &&
169 bestvzError = pvtx.
zError();
170 bestvxError = pvtx.
xError();
171 bestvyError = pvtx.
yError();
175 double vertex_sumTrks = 0.0;
177 vertex_sumTrks += (*iTrack)->pt();
191 reco::PFJetCollection::const_iterator pfjetchsclus = pfchsjets->begin();
192 for (pfjetchsclus = pfchsjets->begin(); pfjetchsclus != pfchsjets->end(); ++pfjetchsclus) {
202 std::vector<Jet> recoCastorJets;
203 recoCastorJets.clear();
208 for (
unsigned ijet = 0; ijet < castorJets->size(); ijet++) {
209 recoCastorJets.push_back((*castorJets)[ijet]);
211 for (
unsigned ijet = 0; ijet < recoCastorJets.size(); ijet++) {
223 std::vector<TLorentzVector> T_trackRec_P4;
226 int ntracks_towards = 0;
227 int ntracks_transverse = 0;
228 int ntracks_away = 0;
231 float ptsum_towards = 0;
232 float ptsum_transverse = 0;
233 float ptsum_away = 0;
235 T_trackRec_P4.clear();
236 for (reco::TrackCollection::const_iterator iT = itracks->begin(); iT != itracks->end(); ++iT) {
237 if (iT->quality(hiPurity)) {
239 double dzvtx = iT->dz(bestvtx);
240 double dxyvtx = iT->dxy(bestvtx);
241 double dzerror =
sqrt(iT->dzError() * iT->dzError() + bestvzError * bestvzError);
242 double dxyerror =
sqrt(iT->d0Error() * iT->d0Error() + bestvxError * bestvyError);
243 if ((iT->ptError()) / iT->pt() < 0.05 && dzvtx < 3.0 && dxyvtx < 3.0) {
245 trk.SetPtEtaPhiE(iT->pt(), iT->eta(), iT->phi(), iT->p());
246 T_trackRec_P4.push_back(trk);
257 float highest_pt_track = -999;
259 for (
unsigned int k = 0;
k < T_trackRec_P4.size();
k++) {
260 if (T_trackRec_P4.at(
k).Pt() > highest_pt_track) {
261 highest_pt_track = T_trackRec_P4.at(
k).Pt();
267 if (finalid < T_trackRec_P4.size()) {
269 for (
unsigned int itrk = 0; itrk < T_trackRec_P4.size(); itrk++) {
271 ptsum = ptsum + T_trackRec_P4.at(itrk).Pt();
272 dphi =
deltaPhi(T_trackRec_P4.at(itrk).Phi(), T_trackRec_P4.at(
index).Phi());
273 if (fabs(dphi) < 1.05) {
275 ptsum_towards = ptsum_towards + T_trackRec_P4.at(itrk).Pt();
277 if (fabs(dphi) > 1.05 && fabs(dphi) < 2.09) {
278 ++ntracks_transverse;
279 ptsum_transverse = ptsum_transverse + T_trackRec_P4.at(itrk).Pt();
281 if (fabs(dphi) > 2.09) {
283 ptsum_away = ptsum_away + T_trackRec_P4.at(itrk).Pt();
296 if (!T_trackRec_P4.empty()) {
edm::EDGetTokenT< reco::BasicJetCollection > tok_castorjet_
MonitorElement * h_leadingtrkpt_ntrk_transverse
double z() const
z coordinate
TrackQuality
track quality
const Point & position() const
position
MonitorElement * PV_numTrks
MonitorElement * Track_HP_dxyvtx_over_dxyerror
MonitorElement * h_ptsum_transverse
MonitorElement * h_ntracks_away
T const * product() const
MonitorElement * h_ptsum_towards
MonitorElement * h_ntracks
MonitorElement * PFJetMulti
MonitorElement * h_ntracks_towards
double zError() const
error on z
MonitorElement * Track_HP_Phi
double xError() const
error on x
trackRef_iterator tracks_end() const
last iterator over tracks
size_t tracksSize() const
number of tracks
MonitorElement * PV_sumTrks
MonitorElement * Track_HP_Eta
MonitorElement * PFJetRapidity
MonitorElement * h_trkptsum
MonitorElement * h_leadingtrkpt_ptsum_away
MonitorElement * PFJetphi
edm::EDGetTokenT< edm::View< reco::Vertex > > pvs_
edm::EDGetTokenT< reco::PFJetCollection > tok_pfjet_
Abs< T >::type abs(const T &t)
trackRef_iterator tracks_begin() const
first iterator over tracks
double x() const
x coordinate
MonitorElement * h_leadingtrkpt_ptsum_towards
unsigned int eventNumber_
double y() const
y coordinate
MonitorElement * PFJeteta
MonitorElement * CastorJetphi
MonitorElement * h_leadingtrkpt_ntrk_towards
double normalizedChi2() const
chi-squared divided by n.d.o.f.
static TrackQuality qualityByName(const std::string &name)
MonitorElement * h_leadingtrkpt_ptsum_transverse
XYZPointD XYZPoint
point in space with cartesian internal representation
MonitorElement * Track_HP_Pt
edm::EDGetTokenT< reco::TrackCollection > tok_track_
std::vector< PFJet > PFJetCollection
collection of PFJet objects
MonitorElement * Track_HP_dzvtx_over_dzerr
double yError() const
error on y
MonitorElement * CastorJetMulti
MonitorElement * h_ptsum_away
MonitorElement * h_leadingtrkpt_ntrk_away
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
MonitorElement * h_ntracks_transverse
MonitorElement * Track_HP_ptErr_over_pt