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;
161 if (privtxs.isValid()) {
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();
189 if (pfjetchscoll.isValid()) {
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();
207 if (castorJets.isValid()) {
208 for (
unsigned ijet = 0; ijet < castorJets->size(); ijet++) {
209 recoCastorJets.push_back((*castorJets)[ijet]);
211 for (
unsigned ijet = 0; ijet < recoCastorJets.size(); ijet++) {
221 if (itracks.isValid()) {
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();
265 unsigned int finalid =
abs(index);
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 zError() const
error on z
TrackQuality
track quality
MonitorElement * PV_numTrks
double y() const
y coordinate
MonitorElement * Track_HP_dxyvtx_over_dxyerror
MonitorElement * h_ptsum_transverse
MonitorElement * h_ntracks_away
MonitorElement * h_ptsum_towards
MonitorElement * h_ntracks
MonitorElement * PFJetMulti
MonitorElement * h_ntracks_towards
MonitorElement * Track_HP_Phi
const Point & position() const
position
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_end() const
last iterator over tracks
double z() const
z coordinate
trackRef_iterator tracks_begin() const
first iterator over tracks
MonitorElement * h_leadingtrkpt_ptsum_towards
size_t tracksSize() const
number of tracks
unsigned int eventNumber_
MonitorElement * PFJeteta
MonitorElement * CastorJetphi
MonitorElement * h_leadingtrkpt_ntrk_towards
double x() const
x coordinate
static TrackQuality qualityByName(const std::string &name)
double xError() const
error on x
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
MonitorElement * CastorJetMulti
MonitorElement * h_ptsum_away
double normalizedChi2() const
chi-squared divided by n.d.o.f.
MonitorElement * h_leadingtrkpt_ntrk_away
double yError() const
error on y
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
MonitorElement * h_ntracks_transverse
MonitorElement * Track_HP_ptErr_over_pt