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()) {