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"))
264 double log10PtMin = 0.50;
265 double log10PtMax = 3.75;
266 int log10PtBins = 26;
269 double etaRange[91] = {-6.0, -5.8, -5.6, -5.4, -5.2, -5.0, -4.8, -4.6, -4.4, -4.2,
270 -4.0, -3.8, -3.6, -3.4, -3.2, -3.0, -2.9, -2.8, -2.7, -2.6,
271 -2.5, -2.4, -2.3, -2.2, -2.1, -2.0, -1.9, -1.8, -1.7, -1.6,
272 -1.5, -1.4, -1.3, -1.2, -1.1, -1.0, -0.9, -0.8, -0.7, -0.6,
273 -0.5, -0.4, -0.3, -0.2, -0.1,
274 0.0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9,
275 1.0, 1.1, 1.2, 1.3, 1.4, 1.5, 1.6, 1.7, 1.8, 1.9,
276 2.0, 2.1, 2.2, 2.3, 2.4, 2.5, 2.6, 2.7, 2.8, 2.9,
277 3.0, 3.2, 3.4, 3.6, 3.8, 4.0, 4.2, 4.4, 4.6, 4.8,
278 5.0, 5.2, 5.4, 5.6, 5.8, 6.0};
281 mNvtx = ibooker.
book1D(
"Nvtx",
"number of vertices", 60, 0, 60);
284 mEta = ibooker.
book1D(
"Eta",
"Eta", 120, -6, 6);
285 mPhi = ibooker.
book1D(
"Phi",
"Phi", 70, -3.5, 3.5);
286 mPt = ibooker.
book1D(
"Pt",
"Pt", 100, 0, 1000);
287 mP = ibooker.
book1D(
"P",
"P", 100, 0, 1000);
289 mMass = ibooker.
book1D(
"Mass",
"Mass", 100, 0, 200);
331 mGenPt = ibooker.
book1D(
"GenPt",
"GenPt", 100, 0, 1000);
334 mPtHat = ibooker.
book1D(
"PtHat",
"PtHat", 100, 0, 1000);
384 mMjj = ibooker.
book1D(
"Mjj",
"Mjj", 100, 0, 2000);
390 mNJets1 = ibooker.
bookProfile(
"NJets1",
"Number of jets above Pt threshold", 100, 0, 200, 100, 0, 50,
"s");
391 mNJets2 = ibooker.
bookProfile(
"NJets2",
"Number of jets above Pt threshold", 100, 0, 4000, 100, 0, 50,
"s");
407 n90 = ibooker.
book1D(
"n90",
"n90", 30,0,30);
408 n60 = ibooker.
book1D(
"n60",
"n60", 30,0,30);
463 int nGoodVertices = 0;
467 for (
unsigned i=0;
i<pvHandle->size();
i++)
469 if ((*pvHandle)[
i].ndof() > 4 &&
470 (fabs((*pvHandle)[
i].
z()) <= 24) &&
516 for (
unsigned ijet=0; ijet<caloJets->size(); ijet++)
517 recoJets.push_back((*caloJets)[ijet]);
527 for (
unsigned ijet=0; ijet<pfJets->size(); ijet++)
528 recoJets.push_back((*pfJets)[ijet]);
531 for (
unsigned ijet=0; ijet<patJets->size(); ijet++)
532 recoJets.push_back((*patJets)[ijet]);
536 int nJet_E_20_40 = 0;
537 int nJet_B_20_40 = 0;
542 int index_first_jet=-1;
545 int index_second_jet=-1;
548 for (
unsigned ijet=0; ijet<recoJets.size(); ijet++) {
549 bool pass_lowjet=
false;
550 bool pass_mediumjet =
false;
557 if((recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected"))>20. && ((recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected")) <
mRecoJetPtThreshold)){
562 if (fabs(recoJets[ijet].
eta()) > 1.5)
569 pass_mediumjet =
true;
577 if (pass_mediumjet) {
579 if( (recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected"))>pt_first){
581 pt_first=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor(
"Uncorrected");
582 index_second_jet=index_first_jet;
583 index_first_jet=ijet;
584 }
else if( (recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected"))>pt_second){
585 index_second_jet=ijet;
586 pt_second=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor(
"Uncorrected");
590 if (fabs(recoJets[ijet].
eta()) > 1.5)
607 if (
mP)
mP ->
Fill(recoJets[ijet].
p()*(*patJets)[ijet].jecFactor(
"Uncorrected"));
608 if (
mPt)
mPt ->
Fill(recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected"));
609 if (
mMass)
mMass ->
Fill(recoJets[ijet].mass()*(*patJets)[ijet].jecFactor(
"Uncorrected"));
619 if (ijet == 0) {nJet++; p4tmp[0] = recoJets[ijet].p4();}
620 if (ijet == 1) {nJet++; p4tmp[1] = recoJets[ijet].p4();}
730 if(index_first_jet>-1){
733 if (
mPtFirst)
mPtFirst ->
Fill(recoJets[index_first_jet].
pt()*(*patJets)[index_first_jet].jecFactor(
"Uncorrected"));
734 nJet++; p4tmp[0] = recoJets[index_first_jet].p4()*(*patJets)[index_first_jet].jecFactor(
"Uncorrected");
736 if(index_second_jet>-1){
737 nJet++; p4tmp[1] = recoJets[index_second_jet].p4()*(*patJets)[index_second_jet].jecFactor(
"Uncorrected");
747 for (
int istep=0; istep<100; ++istep)
752 float ptStep1 = (istep * ( 200. / 100.));
753 float ptStep2 = (istep * (4000. / 100.));
755 for (
unsigned ijet=0; ijet<recoJets.size(); ijet++) {
757 if (recoJets[ijet].
pt() > ptStep1) njets1++;
758 if (recoJets[ijet].
pt() > ptStep2) njets2++;
760 if ((recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected")) > ptStep1) njets1++;
761 if ((recoJets[ijet].
pt()*(*patJets)[ijet].jecFactor(
"Uncorrected")) > ptStep2) njets2++;
773 bool pass_correction_flag =
false;
777 pass_correction_flag=
true;
781 pass_correction_flag =
true;
783 for (
unsigned ijet=0; ijet<recoJets.size(); ijet++) {
784 Jet correctedJet = recoJets[ijet];
785 if(pass_correction_flag){
786 if (
isCaloJet) scale = jetCorr->correction((*caloJets)[ijet]);
787 if (
isPFJet) scale = jetCorr->correction((*pfJets)[ijet]);
793 if (correctedJet.
pt() < 20)
continue;
798 if (correctedJet.
pt() >= 40) {
803 double ijetEta = recoJets[ijet].eta();
804 double ijetPt = recoJets[ijet].pt();
806 ijetPt=recoJets[ijet].pt()*(*patJets)[ijet].jecFactor(
"Uncorrected");
808 double ratio = correctedJet.
pt() / ijetPt;
810 ratio =1./(*patJets)[ijet].jecFactor(
"Uncorrected");
841 if(myGenEvt->hasBinningValues()){
842 double ptHat = myGenEvt->binningValues()[0];
851 if (!genJets.
isValid())
return;
853 for (GenJetCollection::const_iterator gjet=genJets->begin(); gjet!=genJets->end(); gjet++) {
859 if (gjet == genJets->begin()) {
867 for (GenJetCollection::const_iterator gjet=genJets->begin(); gjet!=genJets->end(); gjet++) {
868 if (fabs(gjet->eta()) > 6.)
continue;
870 if (recoJets.size() <= 0)
continue;
874 double CorrdeltaRBest = 999;
875 double CorrJetPtBest = 0;
876 for (
unsigned ijet=0; ijet<recoJets.size(); ++ijet) {
877 Jet correctedJet = recoJets[ijet];
879 if (
isCaloJet) scale = jetCorr->correction((*caloJets)[ijet]);
880 if (
isPFJet) scale = jetCorr->correction((*pfJets)[ijet]);
883 double CorrJetPt = correctedJet.
pt();
884 if (CorrJetPt > 10) {
885 double CorrdR =
deltaR(gjet->eta(), gjet->phi(), correctedJet.
eta(), correctedJet.
phi());
886 if (CorrdR < CorrdeltaRBest) {
887 CorrdeltaRBest = CorrdR;
888 CorrJetPtBest = CorrJetPt;
893 if (iMatch<0)
continue;
895 fillMatchHists(gjet->eta(), gjet->phi(), gjet->pt(), recoJets[iMatch].eta(), recoJets[iMatch].phi(), recoJets[iMatch].pt());
897 fillMatchHists(gjet->eta(), gjet->phi(), gjet->pt(), (*patJets)[iMatch].eta(), (*patJets)[iMatch].phi(),(*patJets)[iMatch].pt()*(*patJets)[iMatch].jecFactor(
"Uncorrected"));
899 if (pass_correction_flag) {
901 double response = CorrJetPtBest / gjet->pt();
907 if (gjet->pt() > 20) {
931 const double RecoEta,
932 const double RecoPhi,
941 if (fabs(GenEta) < 1.5)
955 else if (fabs(GenEta) < 3.0)
969 else if (fabs(GenEta) < 6.0)
T getParameter(std::string const &) const
MonitorElement * mNJetsEta_B_40
MonitorElement * mPtRecoOverGen_E_20_40
MonitorElement * mPtRecoOverGen_B_5000_6500
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 * mPtRecoOverGen_GenEta_3500
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_E_3500_5000
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 * mPtRecoOverGen_F_3500
MonitorElement * mDeltaPhi
MonitorElement * mPtRecoOverGen_GenEta_3500_5000
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
MonitorElement * mPtRecoOverGen_E_5000_6500
MonitorElement * mPtCorrOverGen_GenEta_3500_5000
virtual double eta() const
momentum pseudorapidity
virtual double pt() const
transverse momentum
MonitorElement * emEnergyFraction
MonitorElement * mCorrJetEta
MonitorElement * mPtCorrOverReco_Eta_3500
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 * mPtRecoOverGen_B_3500
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 * mPtCorrOverReco_Eta_5000_6500
MonitorElement * book1D(Args &&...args)
MonitorElement * mPtCorrOverReco_Eta_3500_5000
MonitorElement * HOEnergyFraction
MonitorElement * hadEnergyInHO
MonitorElement * mPtRecoOverGen_E_3500
MonitorElement * mPtCorrOverGen_GenEta_3500
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_B_3500_5000
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
MonitorElement * mPtRecoOverGen_GenEta_5000_6500
MonitorElement * mPtCorrOverGen_GenEta_5000_6500