41 bool is_B (
const reco::Jet& fJet) {
return fabs (fJet.
eta()) < 1.3;}
42 bool is_E (
const reco::Jet& fJet) {
return fabs (fJet.
eta()) >= 1.3 && fabs (fJet.
eta()) < 3.;}
43 bool is_F (
const reco::Jet& fJet) {
return fabs (fJet.
eta()) >= 3.;}
47 : mInputCollection (iConfig.getParameter<edm::
InputTag>(
"src" )),
48 mInputGenCollection (iConfig.getParameter<edm::
InputTag>(
"srcGen" )),
49 mOutputFile (iConfig.getUntrackedParameter<std::string>(
"outputFile",
"")),
50 mMatchGenPtThreshold (iConfig.getParameter<double>(
"genPtThreshold")),
51 mGenEnergyFractionThreshold (iConfig.getParameter<double>(
"genEnergyFractionThreshold")),
52 mReverseEnergyFractionThreshold (iConfig.getParameter<double>(
"reverseEnergyFractionThreshold")),
53 mRThreshold (iConfig.getParameter<double>(
"RThreshold")),
54 JetCorrectionService (iConfig.getParameter<std::string> (
"JetCorrectionService" )),
55 mTurnOnEverything (iConfig.getUntrackedParameter<std::string>(
"TurnOnEverything",
""))
109 mPhi = dbe->
book1D(
"Phi",
"Phi", 70, -3.5, 3.5);
112 mE = dbe->
book1D(
"E",
"E", 100, 0, 500);
115 mP = dbe->
book1D(
"P",
"P", 100, 0, 500);
118 mPt = dbe->
book1D(
"Pt",
"Pt", 100, 0, 150);
129 mMjj = dbe->
book1D(
"Mjj",
"Mjj", 100, 0, 2000);
194 double log10PtMin = 0.5;
195 double log10PtMax = 3.75;
196 int log10PtBins = 26;
197 double etaRange[91] = {-6.0,-5.8,-5.6,-5.4,-5.2,-5.0,-4.8,-4.6,-4.4,-4.2,-4.0,-3.8,-3.6,-3.4,-3.2,-3.0,-2.9,-2.8,-2.7,-2.6,-2.5,-2.4,-2.3,-2.2,-2.1,-2.0,-1.9,-1.8,-1.7,-1.6,-1.5,-1.4,-1.3,-1.2,-1.1,-1.0,-0.9,-0.8,-0.7,-0.6,-0.5,-0.4,-0.3,-0.2,-0.1,0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0,5.2,5.4,5.6,5.8,6.0};
209 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
211 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
213 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
215 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
217 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
219 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
221 90,etaRange, 0., 2.,
" ");
223 90,etaRange, 0., 2.,
" ");
225 90,etaRange, 0., 2.,
" ");
227 90,etaRange, 0., 2.,
" ");
258 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
260 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
262 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
264 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
266 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
268 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
270 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
273 log10PtBins, log10PtMin, log10PtMax, 100, 0.,5.,
" ");
275 log10PtBins, log10PtMin, log10PtMax, 0, 5,
" ");
277 log10PtBins, log10PtMin, log10PtMax, 0, 5,
" ");
279 log10PtBins, log10PtMin, log10PtMax, 0, 5,
" ");
281 90,etaRange, 0., 5.,
" ");
283 90,etaRange, 0., 5.,
" ");
285 90,etaRange, 0., 5.,
" ");
287 90,etaRange, 0., 5.,
" ");
289 log10PtBins, log10PtMin, log10PtMax, 100, 0.8,1.2,
" ");
291 log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2,
" ");
293 log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2,
" ");
295 log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2,
" ");
297 90,etaRange, 0.8, 1.2,
" ");
299 90,etaRange, 0.8, 1.2,
" ");
301 90,etaRange, 0.8, 1.2,
" ");
303 90,etaRange, 0.8, 1.2,
" ");
305 90,etaRange, 0.8, 1.2,
" ");
318 LogInfo(
"OutputInfo") <<
" JPTJet histograms will NOT be saved";
339 double countsfornumberofevents = 1;
345 mEvent.
getByLabel(
"offlinePrimaryVertices", pvHandle );
350 for (
unsigned i = 0;
i < pvHandle->size();
i++) {
351 if ( (*pvHandle)[
i].ndof() > 4 &&
352 ( fabs((*pvHandle)[
i].
z()) <= 24. ) &&
354 goodVertices.push_back((*pvHandle)[
i]);
367 HepMC::GenEvent * myGenEvent =
new HepMC::GenEvent(*(evt->GetEvent()));
369 double pthat = myGenEvent->event_scale();
396 mEvent.
getByLabel(
"towerMaker", caloTowers );
413 std::vector<edm::Handle<HBHERecHitCollection> > colls;
415 std::vector<edm::Handle<HBHERecHitCollection> >::iterator
i;
416 for (i=colls.begin(); i!=colls.end(); i++) {
426 std::vector<edm::Handle<HFRecHitCollection> > colls;
428 std::vector<edm::Handle<HFRecHitCollection> >::iterator
i;
429 for (i=colls.begin(); i!=colls.end(); i++) {
439 std::vector<edm::Handle<HORecHitCollection> > colls;
441 std::vector<edm::Handle<HORecHitCollection> >::iterator
i;
442 for (i=colls.begin(); i!=colls.end(); i++) {
450 std::vector<edm::Handle<EBRecHitCollection> > colls;
452 std::vector<edm::Handle<EBRecHitCollection> >::iterator
i;
453 for (i=colls.begin(); i!=colls.end(); i++) {
462 std::vector<edm::Handle<EERecHitCollection> > colls;
464 std::vector<edm::Handle<EERecHitCollection> >::iterator
i;
465 for (i=colls.begin(); i!=colls.end(); i++) {
479 if (!jptJets.
isValid())
return;
480 JPTJetCollection::const_iterator
jet = jptJets->begin ();
486 for (; jet != jptJets->end (); jet++, jetIndex++) {
487 if (jet->pt() > 10.) {
488 if (fabs(jet->eta()) > 1.5)
493 if (jet->pt() > 30.) nJetF_30++;
494 if (jet->pt() > 10.) {
509 if (jet == jptJets->begin ()) {
518 p4tmp[0] = jet->p4();
522 p4tmp[1] = jet->p4();
539 for (JPTJetCollection::const_iterator jet = jptJets->begin(); jet !=jptJets ->end(); jet++)
547 if(correctedJet.
pt()>30){
554 if (fabs(jet->eta())<1.5) {
558 if (fabs(jet->eta())>1.5 && fabs(jet->eta())<3.0) {
561 if (fabs(jet->eta())>3.0 && fabs(jet->eta())<6.0) {
564 if (jet->pt()>30.0 && jet->pt()<200.0) {
567 if (jet->pt()>200.0 && jet->pt()<600.0) {
570 if (jet->pt()>600.0 && jet->pt()<1500.0) {
573 if (jet->pt()>1500.0 && jet->pt()<3500.0) {
580 for (
int istep = 0; istep < 100; ++istep) {
582 float ptStep = (istep * (200./100.));
584 for ( JPTJetCollection::const_iterator jpt = jptJets->begin(); jpt != jptJets->end(); ++ jpt ) {
585 if ( jpt->pt() > ptStep ) njet++;
590 for (
int istep = 0; istep < 100; ++istep) {
592 float ptStep = (istep * (4000./100.));
593 for ( JPTJetCollection::const_iterator jpt = jptJets->begin(); jpt != jptJets->end(); ++ jpt ) {
594 if ( jpt->pt() > ptStep ) njet++;
603 if (!genJets.
isValid())
return;
604 GenJetCollection::const_iterator gjet = genJets->begin ();
606 for (; gjet != genJets->end (); gjet++, gjetIndex++) {
611 if (gjet == genJets->begin ()) {
624 std::vector <std::vector <const reco::GenParticle*> > genJetConstituents (genJets->size());
625 std::vector <std::vector <const reco::GenParticle*> > jptJetConstituents (jptJets->size());
627 for (
unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
629 const GenJet& genJet = (*genJets) [iGenJet];
630 double genJetPt = genJet.
pt();
634 if (fabs(genJet.
eta()) > 6.)
continue;
639 if (jptJets->size() <= 0)
continue;
641 unsigned iJPTJetBest = 0;
642 double deltaRBest = 999.;
643 for (
unsigned iJPTJet = 0; iJPTJet < jptJets->size(); ++iJPTJet) {
644 double dR =
deltaR (genJet.
eta(), genJet.
phi(), (*jptJets) [iJPTJet].eta(), (*jptJets) [iJPTJet].phi());
653 if (dR < deltaRBest) {
654 iJPTJetBest = iJPTJet;
666 double CorrdeltaRBest = 999.;
667 double CorrJetPtBest = 0;
668 for (JPTJetCollection::const_iterator jet = jptJets->begin(); jet !=jptJets ->end(); jet++) {
674 double CorrJetPt = correctedJet.
pt();
676 double CorrdR =
deltaR (genJet.
eta(), genJet.
phi(), correctedJet.
eta(), correctedJet.
phi());
677 if (CorrdR < CorrdeltaRBest) {
678 CorrdeltaRBest = CorrdR;
679 CorrJetPtBest = CorrJetPt;
686 if (fabs(genJet.
eta())<1.5) {
690 if (fabs(genJet.
eta())>1.5 && fabs(genJet.
eta())<3.0) {
694 if (fabs(genJet.
eta())>3.0 && fabs(genJet.
eta())<6.0) {
697 if (genJet.
pt()>30.0 && genJet.
pt()<200.0) {
700 if (genJet.
pt()>200.0 && genJet.
pt()<600.0) {
703 if (genJet.
pt()>600.0 && genJet.
pt()<1500.0) {
706 if (genJet.
pt()>1500.0 && genJet.
pt()<3500.0) {
709 if (genJet.
pt()>30.0) {
732 double logPtGen = log10 (fGenJet.
pt());
733 double PtGen = fGenJet.
pt();
734 double PtJpt = fJPTJet.
pt();
736 double PtThreshold = 10.;
744 if (fGenJet.
pt()>PtThreshold) {
750 if (fJPTJet.
pt() > PtThreshold) {
756 if (fabs(fGenJet.
eta())<1.5) {
761 if (PtGen>30.0 && PtGen<200.0) {
764 if (PtGen>200.0 && PtGen<600.0) {
767 if (PtGen>600.0 && PtGen<1500.0) {
770 if (PtGen>1500.0 && PtGen<3500.0) {
776 if (fabs(fGenJet.
eta())>1.5 && fabs(fGenJet.
eta())<3.0) {
780 if (PtGen>30.0 && PtGen<200.0) {
783 if (PtGen>200.0 && PtGen<600.0) {
786 if (PtGen>600.0 && PtGen<1500.0) {
789 if (PtGen>1500.0 && PtGen<3500.0) {
795 if (fabs(fGenJet.
eta())>3.0 && fabs(fGenJet.
eta())<6.0) {
800 if (PtGen>30.0 && PtGen<200.0) {
803 if (PtGen>200.0 && PtGen<600.0) {
806 if (PtGen>600.0 && PtGen<1500.0) {
809 if (PtGen>1500.0 && PtGen<3500.0) {
815 if (fGenJet.
pt()>30.0 && fGenJet.
pt()<200.0) {
821 if (fGenJet.
pt()>200.0 && fGenJet.
pt()<600.0) {
825 if (fGenJet.
pt()>600.0 && fGenJet.
pt()<1500.0) {
829 if (fGenJet.
pt()>1500.0 && fGenJet.
pt()<3500.0) {
833 if (fabs(fGenJet.
eta())<1.3) {
834 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
837 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
840 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
844 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
847 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
850 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
854 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
857 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
860 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
864 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
867 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
870 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
874 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
877 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
880 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
884 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
887 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
890 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
901 if (fabs(fGenJet.
eta())<1.3) {
void getManyByType(std::vector< Handle< PROD > > &results) const
MonitorElement * mpTScale_a_nvtx_20_30
MonitorElement * mpTScale_a_nvtx_5_10
MonitorElement * mPtFirst
MonitorElement * mpTScale_c
MonitorElement * mMass_80
MonitorElement * mpTScale_a
MonitorElement * mpTResponse_1500_3500_d
MonitorElement * mpTScale_b_nvtx_20_30
MonitorElement * mpTResponse_nvtx_5_10
MonitorElement * mpTResponse_nvtx_10_15
double mMatchGenPtThreshold
MonitorElement * mpTScaleE_d
MonitorElement * mpTScale_c_nvtx_0_5
MonitorElement * mpTResponse_nvtx_30_inf
MonitorElement * mpTScale1DF_600_1500
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * mEScaleFineBin
MonitorElement * mPtFirst_80
MonitorElement * mpTScale1DE_200_600
MonitorElement * numberofevents
MonitorElement * mpTScalePhiB_d
MonitorElement * mPthat_3000
MonitorElement * mpTScale_600_1500_d
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
MonitorElement * mpTScale1DE_600_1500
MonitorElement * mpTResponseF_d
Base class for all types of Jets.
MonitorElement * mpTScale_pT
MonitorElement * mpTScale_200_600_d
MonitorElement * mpTRatio_200_600_d
MonitorElement * mpTResponseB_d
std::vector< CaloTower >::const_iterator const_iterator
MonitorElement * mpTResponse_nvtx_0_5
MonitorElement * mpTScale1DF_30_200
MonitorElement * mHadTiming
MonitorElement * mpTScalePhiE_d
MonitorElement * mpTScale_c_nvtx_20_30
MonitorElement * mpTScalePhiF_d
MonitorElement * mDeltaEta
MonitorElement * mpTRatio_30_200_d
MonitorElement * mpTScale_nvtx_20_30
virtual void scaleEnergy(double fScale)
scale energy of the jet
MonitorElement * mpTResponse_nvtx_15_20
MonitorElement * mpTScale1DF_200_600
MonitorElement * mCorrJetPt
MonitorElement * mpTScale1DB_600_1500
MonitorElement * mpTScale1DF_1500_3500
MonitorElement * mpTScale1DE_1500_3500
const_iterator end() const
Termination of iteration.
MonitorElement * mpTScale1DE_30_200
std::string mTurnOnEverything
MonitorElement * mNJetsEtaC
virtual double eta() const
momentum pseudorapidity
static int position[TOTALCHAMBERS][3]
MonitorElement * mpTScale_a_nvtx_30_inf
const_iterator begin() const
Initialize an iterator over the RefVector.
MonitorElement * mpTScale_b
MonitorElement * mCorrJetPhi
MonitorElement * mPhiFirst
MonitorElement * mpTRatio_1500_3500_d
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * mpTScale_c_nvtx_30_inf
virtual double energy() const
energy
MonitorElement * mpTScale_nvtx_5_10
MonitorElement * mpTRatioB_d
MonitorElement * mpTScale1DB_1500_3500
MonitorElement * mpTScale_a_nvtx_0_5
MonitorElement * mGenPt_80
MonitorElement * mpTScale_b_nvtx_15_20
Jets made from CaloJets corrected for ZSP and tracks.
double pt() const
track transverse momentum
MonitorElement * mpTScaleB_d
MonitorElement * mCorrJetPt_80
Jets made from MC generator particles.
MonitorElement * mpTResponse_30_d
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
MonitorElement * mpTResponse_30_200_d
MonitorElement * mEScale_pt10
tuple goodVertices
The Good vertices collection needed by the tracking failure filter ________||.
MonitorElement * mpTRatioE_d
MonitorElement * mEtaFineBin
MonitorElement * mpTScale_nvtx_15_20
MonitorElement * mpTScale_c_nvtx_5_10
MonitorElement * nvtx_0_60
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * mpTRatioF_d
double deltaR(double eta1, double eta2, double phi1, double phi2)
MonitorElement * mpTScale_nvtx_30_inf
MonitorElement * mNJetsEtaF_30
double getSumPt(const reco::TrackRefVector &tracks)
MonitorElement * mJetEnergyProfile
MonitorElement * mpTResponse
MonitorElement * mpTScale_b_nvtx_30_inf
MonitorElement * mpTScale_nvtx_0_5
MonitorElement * mpTRatio_600_1500_d
MonitorElement * mPthat_80
edm::InputTag mInputCollection
virtual double pt() const
transverse momentum
MonitorElement * mNJetsEtaF
MonitorElement * mPtFirst_3000
static const JetCorrector * getJetCorrector(const std::string &fName, const edm::EventSetup &fSetup)
retrieve corrector from the event setup. troughs exception if something is missing ...
MonitorElement * mpTScale_1500_3500_d
MonitorElement * mpTScale_a_nvtx_15_20
MonitorElement * mpTScale_b_nvtx_5_10
MonitorElement * mpTResponseE_d
MonitorElement * nvtx_0_30
MonitorElement * mpTScale_b_nvtx_10_15
MonitorElement * mpTResponse_nvtx_20_30
MonitorElement * mpTResponse_600_1500_d
MonitorElement * mGenEtaFirst
MonitorElement * mMjj_3000
MonitorElement * mpTScale1DB_30_200
MonitorElement * mEmEnergyProfile
MonitorElement * mpTResponse_200_600_d
edm::InputTag mInputGenCollection
MonitorElement * mEmTiming
std::string JetCorrectionService
MonitorElement * mPhiFineBin
MonitorElement * mpTScale_nvtx_10_15
MonitorElement * mpTScale_c_nvtx_10_15
MonitorElement * mEtaFirst
MonitorElement * mCorrJetEta
JPTJetTester(const edm::ParameterSet &)
MonitorElement * mpTScale1DB_200_600
MonitorElement * mGenPhiFirst
virtual double phi() const
momentum azimuthal angle
void fillMatchHists(const reco::GenJet &fGenJet, const reco::JPTJet &fJPTJet, std::vector< reco::Vertex > goodVertices)
MonitorElement * mpTScale_c_nvtx_15_20
MonitorElement * mpTScale_30_200_d
MonitorElement * mpTScale_b_nvtx_0_5
MonitorElement * mpTScale_a_nvtx_10_15
void setCurrentFolder(const std::string &fullpath)
MonitorElement * mpTScaleF_d
MonitorElement * mHadEnergyProfile
MonitorElement * mDeltaPhi
MonitorElement * mpTRatio
virtual void analyze(const edm::Event &, const edm::EventSetup &)