166 using namespace reco;
176 double bestvz=-999.9, bestvx=-999.9, bestvy=-999.9;
177 double bestvzError=-999.9, bestvxError=-999.9, bestvyError=-999.9;
181 if(privtxs->begin() !=privtxs->end() && !(pvtx.
isFake()) && pvtx.
position().Rho() <= 2. && fabs(pvtx.
position().z()) <= 24){
185 bestvzError = pvtx.
zError();
186 bestvxError = pvtx.
xError();
187 bestvyError = pvtx.
yError();
191 double vertex_sumTrks = 0.0;
194 vertex_sumTrks += (*iTrack)->pt();
208 reco::PFJetCollection::const_iterator pfjetchsclus = pfchsjets->begin();
209 for(pfjetchsclus = pfchsjets->begin(); pfjetchsclus!= pfchsjets->end() ; ++pfjetchsclus){
219 std::vector<Jet> recoCastorJets;
220 recoCastorJets.clear();
225 for (
unsigned ijet=0; ijet<castorJets->size();ijet++) {
226 recoCastorJets.push_back((*castorJets)[ijet]);
228 for (
unsigned ijet=0; ijet<recoCastorJets.size(); ijet++) {
240 std::vector<TLorentzVector> T_trackRec_P4;
243 int ntracks_towards = 0;
244 int ntracks_transverse = 0;
245 int ntracks_away = 0;
248 float ptsum_towards = 0;
249 float ptsum_transverse = 0;
250 float ptsum_away = 0;
252 T_trackRec_P4.clear();
253 for(reco::TrackCollection::const_iterator iT = itracks->begin(); iT != itracks->end(); ++iT){
254 if(iT->quality(hiPurity)){
256 double dzvtx = iT->dz(bestvtx);
257 double dxyvtx = iT->dxy(bestvtx);
258 double dzerror =
sqrt(iT->dzError()*iT->dzError()+bestvzError*bestvzError);
259 double dxyerror =
sqrt(iT->d0Error()*iT->d0Error()+bestvxError*bestvyError);
260 if((iT->ptError())/iT->pt() < 0.05 && dzvtx < 3.0 && dxyvtx < 3.0){
262 trk.SetPtEtaPhiE(iT->pt(),iT->eta(),iT->phi(),iT->p());
263 T_trackRec_P4.push_back(trk);
274 float highest_pt_track=-999;
276 for(
unsigned int k=0;
k<T_trackRec_P4.size();
k++){
277 if(T_trackRec_P4.at(
k).Pt() > highest_pt_track){
278 highest_pt_track=T_trackRec_P4.at(
k).Pt();
283 unsigned int finalid=
abs(index);
285 if(finalid < T_trackRec_P4.size()){
287 for(
unsigned int itrk=0;itrk<T_trackRec_P4.size();itrk++){
289 ptsum= ptsum + T_trackRec_P4.at(itrk).Pt();
290 dphi =
deltaPhi(T_trackRec_P4.at(itrk).Phi(),T_trackRec_P4.at(index).Phi());
291 if(fabs(dphi) < 1.05){
293 ptsum_towards = ptsum_towards + T_trackRec_P4.at(itrk).Pt();}
294 if(fabs(dphi) > 1.05 && fabs(dphi) < 2.09){
295 ++ntracks_transverse;
296 ptsum_transverse = ptsum_transverse + T_trackRec_P4.at(itrk).Pt();}
297 if(fabs(dphi) > 2.09){
299 ptsum_away = ptsum_away + T_trackRec_P4.at(itrk).Pt();}
313 if(!T_trackRec_P4.empty()){
edm::EDGetTokenT< reco::BasicJetCollection > tok_castorjet_
MonitorElement * h_leadingtrkpt_ntrk_transverse
trackRef_iterator tracks_end() const
last iterator over tracks
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)
double z() const
z coordinate
MonitorElement * h_leadingtrkpt_ptsum_towards
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
T const * product() const
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
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
MonitorElement * CastorJetMulti
MonitorElement * h_ptsum_away
double normalizedChi2() const
chi-squared divided by n.d.o.f.
trackRef_iterator tracks_begin() const
first iterator over tracks
MonitorElement * h_leadingtrkpt_ntrk_away
double yError() const
error on y
size_t tracksSize() const
number of tracks
MonitorElement * h_ntracks_transverse
MonitorElement * Track_HP_ptErr_over_pt