13 mInputCollection (iConfig.getParameter<edm::
InputTag> (
"src")),
15 JetType (iConfig.getUntrackedParameter<std::
string>(
"JetType")),
16 mRecoJetPtThreshold (iConfig.getParameter<double> (
"recoJetPtThreshold")),
17 mMatchGenPtThreshold (iConfig.getParameter<double> (
"matchGenPtThreshold")),
18 mRThreshold (iConfig.getParameter<double> (
"RThreshold"))
248 double log10PtMin = 0.50;
249 double log10PtMax = 3.75;
250 int log10PtBins = 26;
252 double etaRange[91] = {-6.0, -5.8, -5.6, -5.4, -5.2, -5.0, -4.8, -4.6, -4.4, -4.2,
253 -4.0, -3.8, -3.6, -3.4, -3.2, -3.0, -2.9, -2.8, -2.7, -2.6,
254 -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6,
255 -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6,
256 -0.5, -0.4, -0.3, -0.2, -0.1,
257 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
258 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
259 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
260 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8,
261 5.0, 5.2, 5.4, 5.6, 5.8, 6.0};
264 mNvtx = ibooker.
book1D(
"Nvtx",
"number of vertices", 60, 0, 60);
267 mEta = ibooker.
book1D(
"Eta",
"Eta", 120, -6, 6);
268 mPhi = ibooker.
book1D(
"Phi",
"Phi", 70, -3.5, 3.5);
269 mPt = ibooker.
book1D(
"Pt",
"Pt", 100, 0, 1000);
270 mP = ibooker.
book1D(
"P",
"P", 100, 0, 1000);
272 mMass = ibooker.
book1D(
"Mass",
"Mass", 100, 0, 200);
308 mGenPt = ibooker.
book1D(
"GenPt",
"GenPt", 100, 0, 1000);
311 mPtHat = ibooker.
book1D(
"PtHat",
"PtHat", 100, 0, 1000);
350 mMjj = ibooker.
book1D(
"Mjj",
"Mjj", 100, 0, 2000);
356 mNJets1 = ibooker.
bookProfile(
"NJets1",
"Number of jets above Pt threshold", 100, 0, 200, 100, 0, 50,
"s");
357 mNJets2 = ibooker.
bookProfile(
"NJets2",
"Number of jets above Pt threshold", 100, 0, 4000, 100, 0, 50,
"s");
373 n90 = ibooker.
book1D(
"n90",
"n90", 30,0,30);
374 n60 = ibooker.
book1D(
"n60",
"n60", 30,0,30);
429 int nGoodVertices = 0;
433 for (
unsigned i=0;
i<pvHandle->size();
i++)
435 if ((*pvHandle)[
i].ndof() > 4 &&
436 (fabs((*pvHandle)[
i].
z()) <= 24) &&
482 for (
unsigned ijet=0; ijet<caloJets->size(); ijet++)
483 recoJets.push_back((*caloJets)[ijet]);
493 for (
unsigned ijet=0; ijet<pfJets->size(); ijet++)
494 recoJets.push_back((*pfJets)[ijet]);
497 for (
unsigned ijet=0; ijet<patJets->size(); ijet++)
498 recoJets.push_back((*patJets)[ijet]);
502 int nJet_E_20_40 = 0;
503 int nJet_B_20_40 = 0;
508 int index_first_jet=-1;
511 int index_second_jet=-1;
514 for (
unsigned ijet=0; ijet<recoJets.size(); ijet++) {
515 bool pass_lowjet=
false;
516 bool pass_mediumjet =
false;
523 if((recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected"))>20. && ((recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected")) <
mRecoJetPtThreshold)){
528 if (fabs(recoJets[ijet].
eta()) > 1.5)
535 pass_mediumjet =
true;
543 if (pass_mediumjet) {
545 if( (recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected"))>pt_first){
547 pt_first=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor(
"Uncorrected");
548 index_second_jet=index_first_jet;
549 index_first_jet=ijet;
550 }
else if( (recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected"))>pt_second){
551 index_second_jet=ijet;
552 pt_second=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor(
"Uncorrected");
556 if (fabs(recoJets[ijet].
eta()) > 1.5)
573 if (
mP)
mP ->
Fill(recoJets[ijet].
p()*(*patJets)[ijet].jecFactor(
"Uncorrected"));
574 if (
mPt)
mPt ->
Fill(recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected"));
575 if (
mMass)
mMass ->
Fill(recoJets[ijet].mass()*(*patJets)[ijet].jecFactor(
"Uncorrected"));
585 if (ijet == 0) {nJet++; p4tmp[0] = recoJets[ijet].p4();}
586 if (ijet == 1) {nJet++; p4tmp[1] = recoJets[ijet].p4();}
696 if(index_first_jet>-1){
699 if (
mPtFirst)
mPtFirst ->
Fill(recoJets[index_first_jet].
pt()*(*patJets)[index_first_jet].jecFactor(
"Uncorrected"));
700 nJet++; p4tmp[0] = recoJets[index_first_jet].p4()*(*patJets)[index_first_jet].jecFactor(
"Uncorrected");
702 if(index_second_jet>-1){
703 nJet++; p4tmp[1] = recoJets[index_second_jet].p4()*(*patJets)[index_second_jet].jecFactor(
"Uncorrected");
713 for (
int istep=0; istep<100; ++istep)
718 float ptStep1 = (istep * ( 200. / 100.));
719 float ptStep2 = (istep * (4000. / 100.));
721 for (
unsigned ijet=0; ijet<recoJets.size(); ijet++) {
723 if (recoJets[ijet].
pt() > ptStep1) njets1++;
724 if (recoJets[ijet].
pt() > ptStep2) njets2++;
726 if ((recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected")) > ptStep1) njets1++;
727 if ((recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected")) > ptStep2) njets2++;
739 bool pass_correction_flag =
false;
743 pass_correction_flag=
true;
747 pass_correction_flag =
true;
749 for (
unsigned ijet=0; ijet<recoJets.size(); ijet++) {
750 Jet correctedJet = recoJets[ijet];
751 if(pass_correction_flag){
752 if (
isCaloJet) scale = jetCorr->correction((*caloJets)[ijet]);
753 if (
isPFJet) scale = jetCorr->correction((*pfJets)[ijet]);
759 if (correctedJet.
pt() < 20)
continue;
764 if (correctedJet.
pt() >= 40) {
769 double ijetEta = recoJets[ijet].eta();
770 double ijetPt = recoJets[ijet].pt();
772 ijetPt=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor(
"Uncorrected");
774 double ratio = correctedJet.
pt() / ijetPt;
776 ratio =1./(*patJets)[ijet].jecFactor(
"Uncorrected");
804 if(myGenEvt->hasBinningValues()){
805 double ptHat = myGenEvt->binningValues()[0];
814 if (!genJets.
isValid())
return;
816 for (GenJetCollection::const_iterator gjet=genJets->begin(); gjet!=genJets->end(); gjet++) {
822 if (gjet == genJets->begin()) {
830 for (GenJetCollection::const_iterator gjet=genJets->begin(); gjet!=genJets->end(); gjet++) {
831 if (fabs(gjet->eta()) > 6.)
continue;
833 if (recoJets.size() <= 0)
continue;
837 double CorrdeltaRBest = 999;
838 double CorrJetPtBest = 0;
839 for (
unsigned ijet=0; ijet<recoJets.size(); ++ijet) {
840 Jet correctedJet = recoJets[ijet];
842 if (
isCaloJet) scale = jetCorr->correction((*caloJets)[ijet]);
843 if (
isPFJet) scale = jetCorr->correction((*pfJets)[ijet]);
846 double CorrJetPt = correctedJet.
pt();
847 if (CorrJetPt > 10) {
848 double CorrdR =
deltaR(gjet->eta(), gjet->phi(), correctedJet.
eta(), correctedJet.
phi());
849 if (CorrdR < CorrdeltaRBest) {
850 CorrdeltaRBest = CorrdR;
851 CorrJetPtBest = CorrJetPt;
856 if (iMatch<0)
continue;
858 fillMatchHists(gjet->eta(), gjet->phi(), gjet->pt(), recoJets[iMatch].eta(), recoJets[iMatch].phi(), recoJets[iMatch].pt());
860 fillMatchHists(gjet->eta(), gjet->phi(), gjet->pt(), (*patJets)[iMatch].eta(), (*patJets)[iMatch].phi(),(*patJets)[iMatch].pt()*(*patJets)[iMatch].jecFactor(
"Uncorrected"));
862 if (pass_correction_flag) {
864 double response = CorrJetPtBest / gjet->pt();
870 if (gjet->pt() > 20) {
891 const double RecoEta,
892 const double RecoPhi,
901 if (fabs(GenEta) < 1.5)
912 else if (fabs(GenEta) < 3.0)
923 else if (fabs(GenEta) < 6.0)
T getParameter(std::string const &) const
MonitorElement * mNJetsEta_B_40
MonitorElement * mPtRecoOverGen_E_20_40
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
MonitorElement * mPtCorrOverGen_GenEta_40_200
MonitorElement * mPtCorrOverReco_Pt_E
MonitorElement * hadEnergyInHE
MonitorElement * HFHadronEnergyFraction
MonitorElement * mPtRecoOverGen_B_20_40
MonitorElement * mPtCorrOverGen_GenPt_F
MonitorElement * mPtRecoOverGen_F_40_200
edm::EDGetTokenT< reco::GenJetCollection > genJetsToken_
MonitorElement * HOEnergy
virtual void scaleEnergy(double fScale)
scale energy of the jet
MonitorElement * neutralHadronEnergy
MonitorElement * electronEnergyFraction
MonitorElement * mPtRecoOverGen_B_200_600
virtual void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * HFEMEnergyFraction
MonitorElement * mPtRecoOverGen_GenPt_F
edm::InputTag mInputGenCollection
MonitorElement * mPtFirst
MonitorElement * bookProfile(Args &&...args)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken_
MonitorElement * photonEnergyFraction
edm::EDGetTokenT< pat::JetCollection > patJetsToken_
MonitorElement * neutralMultiplicity
MonitorElement * mDeltaPhi
Base class for all types of Jets.
edm::InputTag mJetCorrector
MonitorElement * mPtRecoOverGen_GenPhi_E
MonitorElement * mPtRecoOverGen_GenEta_20_40
MonitorElement * hadEnergyInHB
MonitorElement * mPtCorrOverReco_Eta_40_200
MonitorElement * photonMultiplicity
MonitorElement * mCorrJetPhi
MonitorElement * energyFractionHadronic
double mMatchGenPtThreshold
MonitorElement * mPtRecoOverGen_E_40_200
edm::EDGetTokenT< reco::JetCorrector > jetCorrectorToken_
MonitorElement * mPtCorrOverReco_Eta_200_600
MonitorElement * muonEnergyFraction
MonitorElement * mPtRecoOverGen_GenPhi_B
MonitorElement * mEtaFirst
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
MonitorElement * emEnergyFraction
MonitorElement * mCorrJetEta
MonitorElement * photonEnergy
MonitorElement * towersArea
MonitorElement * hadEnergyInHF
MonitorElement * HFHadronMultiplicity
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * muonEnergy
MonitorElement * electronMultiplicity
MonitorElement * mPtRecoOverGen_B_600_1500
MonitorElement * mPtRecoOverGen_GenPt_E
MonitorElement * mNJetsEta_E_40
MonitorElement * mGenEtaFirst
MonitorElement * mNJetsEta_B_20_40
MonitorElement * chargedMuEnergy
MonitorElement * mPtRecoOverGen_F_1500_3500
MonitorElement * mDeltaEta
MonitorElement * mNJets_40
MonitorElement * HFHadronEnergy
MonitorElement * mNJetsEta_E_20_40
MonitorElement * mDeltaPt
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
MonitorElement * mPtRecoOverGen_B_40_200
MonitorElement * mPtRecoOverGen_B_1500_3500
MonitorElement * mPtRecoOverGen_F_200_600
MonitorElement * mPhiFirst
void fillMatchHists(const double GenEta, const double GenPhi, const double GenPt, const double RecoEta, const double RecoPhi, const double RecoPt)
edm::EDGetTokenT< GenEventInfoProduct > evtToken_
MonitorElement * mPtCorrOverGen_GenPt_B
MonitorElement * mPtCorrOverReco_Eta_600_1500
MonitorElement * book1D(Args &&...args)
MonitorElement * HOEnergyFraction
MonitorElement * hadEnergyInHO
MonitorElement * mPtCorrOverGen_GenEta_200_600
edm::InputTag mInputCollection
MonitorElement * emEnergyInHF
MonitorElement * mPtRecoOverGen_E_200_600
JetTester(const edm::ParameterSet &)
MonitorElement * mPtRecoOverGen_GenPhi_F
MonitorElement * chargedHadronEnergyFraction
MonitorElement * mPtRecoOverGen_E_600_1500
MonitorElement * chargedHadronEnergy
MonitorElement * mPtCorrOverReco_Pt_B
MonitorElement * mPtRecoOverGen_GenPt_B
double deltaR(double eta1, double eta2, double phi1, double phi2)
MonitorElement * mPtCorrOverReco_Eta_1500_3500
MonitorElement * mJetArea
MonitorElement * HFEMMultiplicity
MonitorElement * chargedEmEnergy
MonitorElement * mPtRecoOverGen_GenEta_40_200
MonitorElement * mPtRecoOverGen_E_1500_3500
void setCurrentFolder(const std::string &fullpath)
MonitorElement * mPtRecoOverGen_F_600_1500
MonitorElement * chargedMuEnergyFraction
MonitorElement * electronEnergy
MonitorElement * emEnergyInEE
MonitorElement * mPtCorrOverGen_GenEta_20_40
double mRecoJetPtThreshold
MonitorElement * mPtCorrOverGen_GenEta_1500_3500
MonitorElement * maxEInHadTowers
MonitorElement * mCorrJetEta_Pt40
MonitorElement * emEnergyInEB
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
MonitorElement * mConstituents
MonitorElement * maxEInEmTowers
MonitorElement * mPtRecoOverGen_F_20_40
MonitorElement * mGenPhiFirst
MonitorElement * mCorrJetPt
MonitorElement * mPtCorrOverGen_GenPt_E
MonitorElement * mPtRecoOverGen_GenEta_600_1500
static int position[264][3]
MonitorElement * mPtRecoOverGen_GenEta_200_600
MonitorElement * mPtCorrOverReco_Eta_20_40
MonitorElement * chargedEmEnergyFraction
MonitorElement * mPtCorrOverReco_Pt_F
MonitorElement * muonMultiplicity
MonitorElement * neutralHadronEnergyFraction
MonitorElement * neutralEmEnergy
MonitorElement * chargedHadronMultiplicity
MonitorElement * mPtRecoOverGen_GenEta_1500_3500
MonitorElement * mPtCorrOverGen_GenEta_600_1500
MonitorElement * chargedMultiplicity
virtual double phi() const
momentum azimuthal angle
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * HFEMEnergy
MonitorElement * mCorrJetPhi_Pt40
MonitorElement * neutralHadronMultiplicity
MonitorElement * neutralEmEnergyFraction