146 using namespace reco;
156 double bestvz = -999.9, bestvx = -999.9, bestvy = -999.9;
157 double bestvzError = -999.9, bestvxError = -999.9, bestvyError = -999.9;
161 if (privtxs->begin() != privtxs->end() && !(pvtx.
isFake()) && pvtx.
position().Rho() <= 2. &&
166 bestvzError = pvtx.
zError();
167 bestvxError = pvtx.
xError();
168 bestvyError = pvtx.
yError();
172 double vertex_sumTrks = 0.0;
174 vertex_sumTrks += (*iTrack)->pt();
188 reco::PFJetCollection::const_iterator pfjetchsclus = pfchsjets->begin();
189 for (pfjetchsclus = pfchsjets->begin(); pfjetchsclus != pfchsjets->end(); ++pfjetchsclus) {
199 std::vector<Jet> recoCastorJets;
200 recoCastorJets.clear();
205 for (
unsigned ijet = 0; ijet < castorJets->size(); ijet++) {
206 recoCastorJets.push_back((*castorJets)[ijet]);
208 for (
unsigned ijet = 0; ijet < recoCastorJets.size(); ijet++) {
220 std::vector<TLorentzVector> T_trackRec_P4;
223 int ntracks_towards = 0;
224 int ntracks_transverse = 0;
225 int ntracks_away = 0;
228 float ptsum_towards = 0;
229 float ptsum_transverse = 0;
230 float ptsum_away = 0;
232 T_trackRec_P4.clear();
233 for (reco::TrackCollection::const_iterator iT = itracks->begin(); iT != itracks->end(); ++iT) {
234 if (iT->quality(hiPurity)) {
236 double dzvtx = iT->dz(bestvtx);
237 double dxyvtx = iT->dxy(bestvtx);
238 double dzerror =
sqrt(iT->dzError() * iT->dzError() + bestvzError * bestvzError);
239 double dxyerror =
sqrt(iT->d0Error() * iT->d0Error() + bestvxError * bestvyError);
240 if ((iT->ptError()) / iT->pt() < 0.05 && dzvtx < 3.0 && dxyvtx < 3.0) {
242 trk.SetPtEtaPhiE(iT->pt(), iT->eta(), iT->phi(), iT->p());
243 T_trackRec_P4.push_back(trk);
254 float highest_pt_track = -999;
256 for (
unsigned int k = 0;
k < T_trackRec_P4.size();
k++) {
257 if (T_trackRec_P4.at(
k).Pt() > highest_pt_track) {
258 highest_pt_track = T_trackRec_P4.at(
k).Pt();
264 if (finalid < T_trackRec_P4.size()) {
266 for (
unsigned int itrk = 0; itrk < T_trackRec_P4.size(); itrk++) {
268 ptsum = ptsum + T_trackRec_P4.at(itrk).Pt();
269 dphi =
deltaPhi(T_trackRec_P4.at(itrk).Phi(), T_trackRec_P4.at(
index).Phi());
270 if (fabs(dphi) < 1.05) {
272 ptsum_towards = ptsum_towards + T_trackRec_P4.at(itrk).Pt();
274 if (fabs(dphi) > 1.05 && fabs(dphi) < 2.09) {
275 ++ntracks_transverse;
276 ptsum_transverse = ptsum_transverse + T_trackRec_P4.at(itrk).Pt();
278 if (fabs(dphi) > 2.09) {
280 ptsum_away = ptsum_away + T_trackRec_P4.at(itrk).Pt();
293 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