59 #include "TLorentzVector.h" 77 bool operator()(
const TLorentzVector&
a,
const TLorentzVector&
b)
const {
return a.Pt() >
b.Pt(); }
87 tok_pfjet_ = consumes<reco::PFJetCollection>(labelPFJet_);
88 tok_track_ = consumes<reco::TrackCollection>(labelTrack_);
89 tok_castorjet_ = consumes<reco::BasicJetCollection>(labelCastorJet_);
100 PFJetpt = bei.
book1D(
"PFJetpt",
";p_{T}(PFJet)", 100, 0.0, 100);
101 PFJeteta = bei.
book1D(
"PFJeteta",
";#eta(PFJet)", 50, -2.5, 2.5);
102 PFJetphi = bei.
book1D(
"PFJetphi",
";#phi(PFJet)", 50, -3.14, 3.14);
103 PFJetMulti = bei.
book1D(
"PFJetMulti",
";No. of PFJets", 10, -0.5, 9.5);
104 PFJetRapidity = bei.
book1D(
"PFJetRapidity",
";PFJetRapidity", 50, -6.0, 6.0);
105 CastorJetphi = bei.
book1D(
"CastorJetphi",
";#phi(CastorJet)", 50, -3.14, 3.14);
106 CastorJetMulti = bei.
book1D(
"CastorJetMulti",
";No. of CastorJets", 10, -0.5, 9.5);
107 Track_HP_Phi = bei.
book1D(
"Track_HP_Phi",
";#phi(HPtrack)", 50, -3.14, 3.14);
108 Track_HP_Eta = bei.
book1D(
"Track_HP_Eta",
";#eta(HPtrack)", 50, -2.5, 2.5);
109 Track_HP_Pt = bei.
book1D(
"Track_HP_Pt",
";p_{T}(HPtrack)", 500, 0.0, 50);
110 Track_HP_ptErr_over_pt = bei.
book1D(
"Track_HP_ptErr_over_pt",
";{p_{T}Err}/p_{T}", 100, 0, 0.1);
111 Track_HP_dzvtx_over_dzerr = bei.
book1D(
"Track_HP_dzvtx_over_dzerr",
";dZerr/dZ", 100, -10, 10);
112 Track_HP_dxyvtx_over_dxyerror = bei.
book1D(
"Track_HP_dxyvtx_over_dxyerror",
";dxyErr/dxy", 100, -10, 10);
113 NPV = bei.
book1D(
"NPV",
";NPV", 10, -0.5, 9.5);
114 PV_chi2 = bei.
book1D(
"PV_chi2",
";PV_chi2", 100, 0.0, 2.0);
115 PV_d0 = bei.
book1D(
"PV_d0",
";PV_d0", 100, -10.0, 10.0);
116 PV_numTrks = bei.
book1D(
"PV_numTrks",
";PV_numTrks", 100, -0.5, 99.5);
117 PV_sumTrks = bei.
book1D(
"PV_sumTrks",
";PV_sumTrks", 100, 0, 100);
118 h_ptsum_towards = bei.
book1D(
"h_ptsum_towards",
";h_ptsum_towards", 100, 0, 100);
119 h_ptsum_transverse = bei.
book1D(
"h_ptsum_transverse",
";h_ptsum_transverse", 100, 0, 100);
121 h_ntracks = bei.
book1D(
"h_ntracks",
";h_ntracks", 50, -0.5, 49.5);
122 h_trkptsum = bei.
book1D(
"h_trkptsum",
";h_trkptsum", 100, 0, 100);
123 h_ptsum_away = bei.
book1D(
"h_ptsum_away",
";h_ptsum_away", 100, 0, 100);
124 h_ntracks_towards = bei.
book1D(
"h_ntracks_towards",
";h_ntracks_towards", 50, -0.5, 49.5);
125 h_ntracks_transverse = bei.
book1D(
"h_ntracks_transverse",
";h_ntracks_transverse", 50, -0.5, 49.5);
126 h_ntracks_away = bei.
book1D(
"h_ntracks_away",
";h_ntracks_away", 50, -0.5, 49.5);
128 h_leadingtrkpt_ntrk_away =
129 bei.
bookProfile(
"h_leadingtrkpt_ntrk_away",
"h_leadingtrkpt_ntrk_away", 50, 0.0, 50, 0, 30,
" ");
130 h_leadingtrkpt_ntrk_towards =
131 bei.
bookProfile(
"h_leadingtrkpt_ntrk_towards",
"h_leadingtrkpt_ntrk_towards", 50, 0.0, 50, 0, 30,
" ");
132 h_leadingtrkpt_ntrk_transverse =
133 bei.
bookProfile(
"h_leadingtrkpt_ntrk_transverse",
"h_leadingtrkpt_ntrk_transverse", 50, 0.0, 50, 0, 30,
" ");
134 h_leadingtrkpt_ptsum_away =
135 bei.
bookProfile(
"h_leadingtrkpt_ptsum_away",
"h_leadingtrkpt_ptsum_away", 50, 0.0, 50, 0, 30,
" ");
136 h_leadingtrkpt_ptsum_towards =
137 bei.
bookProfile(
"h_leadingtrkpt_ptsum_towards",
"h_leadingtrkpt_ptsum_towards", 50, 0.0, 50, 0, 30,
" ");
138 h_leadingtrkpt_ptsum_transverse =
139 bei.
bookProfile(
"h_leadingtrkpt_ptsum_transverse",
"h_leadingtrkpt_ptsum_transverse", 50, 0.0, 50, 0, 30,
" ");
146 using namespace reco;
149 eventNumber_ =
iEvent.id().event();
150 lumiNumber_ =
iEvent.id().luminosityBlock();
151 bxNumber_ =
iEvent.bunchCrossing();
155 iEvent.getByToken(pvs_, privtxs);
156 double bestvz = -999.9, bestvx = -999.9, bestvy = -999.9;
157 double bestvzError = -999.9, bestvxError = -999.9, bestvyError = -999.9;
160 NPV->Fill(privtxs->size());
161 if (privtxs->begin() != privtxs->end() && !(pvtx.
isFake()) && pvtx.
position().Rho() <= 2. &&
166 bestvzError = pvtx.
zError();
167 bestvxError = pvtx.
xError();
168 bestvyError = pvtx.
yError();
170 PV_d0->Fill(
sqrt(pvtx.
x() * pvtx.
x() + pvtx.
y() * pvtx.
y()));
172 double vertex_sumTrks = 0.0;
174 vertex_sumTrks += (*iTrack)->pt();
176 PV_sumTrks->Fill(vertex_sumTrks);
185 iEvent.getByToken(tok_pfjet_, pfjetchscoll);
188 reco::PFJetCollection::const_iterator pfjetchsclus = pfchsjets->begin();
189 for (pfjetchsclus = pfchsjets->begin(); pfjetchsclus != pfchsjets->end(); ++pfjetchsclus) {
190 PFJetpt->Fill(pfjetchsclus->pt());
191 PFJeteta->Fill(pfjetchsclus->eta());
192 PFJetphi->Fill(pfjetchsclus->phi());
193 PFJetRapidity->Fill(pfjetchsclus->rapidity());
196 PFJetMulti->Fill(nPFCHSJet);
199 std::vector<Jet> recoCastorJets;
200 recoCastorJets.clear();
203 iEvent.getByToken(tok_castorjet_, castorJets);
205 for (
unsigned ijet = 0; ijet < castorJets->size(); ijet++) {
206 recoCastorJets.push_back((*castorJets)[ijet]);
208 for (
unsigned ijet = 0; ijet < recoCastorJets.size(); ijet++) {
210 CastorJetphi->Fill(recoCastorJets[ijet].phi());
212 CastorJetMulti->Fill(recoCastorJets.size());
217 iEvent.getByToken(tok_track_, itracks);
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);
244 Track_HP_Eta->Fill(iT->eta());
245 Track_HP_Phi->Fill(iT->phi());
246 Track_HP_Pt->Fill(iT->pt());
247 Track_HP_ptErr_over_pt->Fill((iT->ptError()) / iT->pt());
248 Track_HP_dzvtx_over_dzerr->Fill(dzvtx / dzerror);
249 Track_HP_dxyvtx_over_dxyerror->Fill(dxyvtx / dxyerror);
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();
285 h_trkptsum->Fill(ptsum);
286 h_ptsum_towards->Fill(ptsum_towards);
287 h_ptsum_transverse->Fill(ptsum_transverse);
288 h_ptsum_away->Fill(ptsum_away);
289 h_ntracks_towards->Fill(ntracks_towards);
290 h_ntracks_transverse->Fill(ntracks_transverse);
291 h_ntracks_away->Fill(ntracks_away);
293 if (!T_trackRec_P4.empty()) {
294 h_leadingtrkpt_ntrk_towards->Fill(T_trackRec_P4.at(
index).Pt(), ntracks_towards / 8.37);
295 h_leadingtrkpt_ntrk_transverse->Fill(T_trackRec_P4.at(
index).Pt(), ntracks_transverse / 8.37);
296 h_leadingtrkpt_ntrk_away->Fill(T_trackRec_P4.at(
index).Pt(), ntracks_away / 8.37);
297 h_leadingtrkpt_ptsum_towards->Fill(T_trackRec_P4.at(
index).Pt(), ptsum_towards / 8.37);
298 h_leadingtrkpt_ptsum_transverse->Fill(T_trackRec_P4.at(
index).Pt(), ptsum_transverse / 8.37);
299 h_leadingtrkpt_ptsum_away->Fill(T_trackRec_P4.at(
index).Pt(), ptsum_away / 8.37);
static const char runNumber_[]
T getParameter(std::string const &) const
double z() const
z coordinate
virtual void setCurrentFolder(std::string const &fullpath)
TrackQuality
track quality
const Point & position() const
position
T const * product() const
FSQDQM(const edm::ParameterSet &ps)
double zError() const
error on z
double xError() const
error on x
void bookHistograms(DQMStore::IBooker &bei, edm::Run const &, edm::EventSetup const &) override
trackRef_iterator tracks_end() const
last iterator over tracks
size_t tracksSize() const
number of tracks
bool operator()(const TLorentzVector &a, const TLorentzVector &b) const
MonitorElement * bookProfile(TString const &name, TString const &title, int nchX, double lowX, double highX, int, double lowY, double highY, char const *option="s", FUNC onbooking=NOOP())
Abs< T >::type abs(const T &t)
trackRef_iterator tracks_begin() const
first iterator over tracks
double x() const
x coordinate
double y() const
y coordinate
void analyze(edm::Event const &e, edm::EventSetup const &eSetup) override
Log< level::Info, false > LogInfo
double normalizedChi2() const
chi-squared divided by n.d.o.f.
static TrackQuality qualityByName(const std::string &name)
XYZPointD XYZPoint
point in space with cartesian internal representation
std::vector< PFJet > PFJetCollection
collection of PFJet objects
double yError() const
error on y
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>