46 bool is_B (
const reco::Jet& fJet) {
return fabs (fJet.
eta()) < 1.3;}
47 bool is_E (
const reco::Jet& fJet) {
return fabs (fJet.
eta()) >= 1.3 && fabs (fJet.
eta()) < 3.;}
48 bool is_F (
const reco::Jet& fJet) {
return fabs (fJet.
eta()) >= 3.;}
54 : mInputCollection (iConfig.getParameter<edm::
InputTag>(
"src" )),
55 mInputGenCollection (iConfig.getParameter<edm::
InputTag>(
"srcGen" )),
56 mOutputFile (iConfig.getUntrackedParameter<std::string>(
"outputFile",
"")),
57 mMatchGenPtThreshold (iConfig.getParameter<double>(
"genPtThreshold")),
58 mGenEnergyFractionThreshold (iConfig.getParameter<double>(
"genEnergyFractionThreshold")),
59 mReverseEnergyFractionThreshold (iConfig.getParameter<double>(
"reverseEnergyFractionThreshold")),
60 mRThreshold (iConfig.getParameter<double>(
"RThreshold")),
62 mTurnOnEverything (iConfig.getUntrackedParameter<std::string>(
"TurnOnEverything",
"")){
67 if (iConfig.
tbl().find(
"JetCorrectionService")!=iConfig.
tbl().end()){
139 mPhi = dbe->
book1D(
"Phi",
"Phi", 70, -3.5, 3.5);
142 mE = dbe->
book1D(
"E",
"E", 100, 0, 500);
145 mP = dbe->
book1D(
"P",
"P", 100, 0, 500);
148 mPt = dbe->
book1D(
"Pt",
"Pt", 100, 0, 150);
163 mMjj = dbe->
book1D(
"Mjj",
"Mjj", 100, 0, 2000);
269 double log10PtMin = 0.5;
270 double log10PtMax = 3.75;
271 int log10PtBins = 26;
272 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};
282 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
284 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
286 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
289 70, -3.5, 3.5, 0, 2,
" ");
291 70, -3.5, 3.5, 0, 2,
" ");
293 70, -3.5, 3.5, 0, 2,
" ");
297 90,etaRange, 0., 2.,
" ");
299 90,etaRange, 0., 2.,
" ");
301 90,etaRange, 0., 2.,
" ");
303 90,etaRange, 0., 2.,
" ");
335 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
337 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
339 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
341 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
343 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
345 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
347 log10PtBins, log10PtMin, log10PtMax, 0, 2,
" ");
350 log10PtBins, log10PtMin, log10PtMax, 100, 0.,5.,
" ");
352 log10PtBins, log10PtMin, log10PtMax, 0, 5,
" ");
354 log10PtBins, log10PtMin, log10PtMax, 0, 5,
" ");
356 log10PtBins, log10PtMin, log10PtMax, 0, 5,
" ");
358 90,etaRange, 0., 5.,
" ");
360 90,etaRange, 0., 5.,
" ");
362 90,etaRange, 0., 5.,
" ");
364 90,etaRange, 0., 5.,
" ");
366 log10PtBins, log10PtMin, log10PtMax, 100, 0.8,1.2,
" ");
368 log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2,
" ");
370 log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2,
" ");
372 log10PtBins, log10PtMin, log10PtMax, 0.8, 1.2,
" ");
374 90,etaRange, 0.8, 1.2,
" ");
376 90,etaRange, 0.8, 1.2,
" ");
378 90,etaRange, 0.8, 1.2,
" ");
380 90,etaRange, 0.8, 1.2,
" ");
382 90,etaRange, 0.8, 1.2,
" ");
394 LogInfo(
"OutputInfo") <<
" CaloJet histograms will NOT be saved";
415 double countsfornumberofevents = 1;
423 bool offlinePrimaryVerticesPresent=mEvent.
getByLabel(
"offlinePrimaryVertices",pvHandle);
433 if(offlinePrimaryVerticesPresent){
434 for (
unsigned i = 0;
i < pvHandle->size();
i++) {
435 if ( (*pvHandle)[
i].ndof() > 4 &&
436 ( fabs((*pvHandle)[
i].
z()) <= 24. ) &&
438 goodVertices.push_back((*pvHandle)[
i]);
451 HepMC::GenEvent * myGenEvent =
new HepMC::GenEvent(*(evt->GetEvent()));
453 double pthat = myGenEvent->event_scale();
481 mEvent.
getByLabel(
"towerMaker", caloTowers );
498 std::vector<edm::Handle<HBHERecHitCollection> > colls;
500 std::vector<edm::Handle<HBHERecHitCollection> >::iterator
i;
501 for (i=colls.begin(); i!=colls.end(); i++) {
511 std::vector<edm::Handle<HFRecHitCollection> > colls;
513 std::vector<edm::Handle<HFRecHitCollection> >::iterator
i;
514 for (i=colls.begin(); i!=colls.end(); i++) {
524 std::vector<edm::Handle<HORecHitCollection> > colls;
526 std::vector<edm::Handle<HORecHitCollection> >::iterator
i;
527 for (i=colls.begin(); i!=colls.end(); i++) {
535 std::vector<edm::Handle<EBRecHitCollection> > colls;
537 std::vector<edm::Handle<EBRecHitCollection> >::iterator
i;
538 for (i=colls.begin(); i!=colls.end(); i++) {
547 std::vector<edm::Handle<EERecHitCollection> > colls;
549 std::vector<edm::Handle<EERecHitCollection> >::iterator
i;
550 for (i=colls.begin(); i!=colls.end(); i++) {
565 if (!caloJets.
isValid())
return;
566 CaloJetCollection::const_iterator
jet = caloJets->begin ();
572 for (; jet != caloJets->end (); jet++, jetIndex++) {
574 if (jet->pt() > 10.) {
575 if (fabs(jet->eta()) > 1.5)
580 if (jet->pt() > 30.) nJetF_30++;
581 if (jet->pt() > 10.) {
598 if (jet == caloJets->begin ()) {
607 p4tmp[0] = jet->p4();
611 p4tmp[1] = jet->p4();
658 for (
int istep = 0; istep < 100; ++istep) {
660 float ptStep = (istep * (200./100.));
662 for ( CaloJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) {
663 if ( cal->pt() > ptStep ) njet++;
668 for (
int istep = 0; istep < 100; ++istep) {
670 float ptStep = (istep * (4000./100.));
671 for ( CaloJetCollection::const_iterator cal = caloJets->begin(); cal != caloJets->end(); ++ cal ) {
672 if ( cal->pt() > ptStep ) njet++;
682 for (CaloJetCollection::const_iterator jet = caloJets->begin(); jet !=caloJets ->end(); jet++){
688 scale = corrector->
correction(*jet,mEvent,mSetup);
691 if(correctedJet.
pt()>30){
698 if (fabs(jet->eta())<1.5) {
702 if (fabs(jet->eta())>1.5 && fabs(jet->eta())<3.0) {
705 if (fabs(jet->eta())>3.0 && fabs(jet->eta())<6.0) {
708 if (jet->pt()>30.0 && jet->pt()<200.0) {
711 if (jet->pt()>200.0 && jet->pt()<600.0) {
714 if (jet->pt()>600.0 && jet->pt()<1500.0) {
717 if (jet->pt()>1500.0 && jet->pt()<3500.0) {
729 if (!genJets.
isValid())
return;
730 GenJetCollection::const_iterator gjet = genJets->begin ();
732 for (; gjet != genJets->end (); gjet++, gjetIndex++) {
737 if (gjet == genJets->begin ()) {
750 std::vector <std::vector <const reco::GenParticle*> > genJetConstituents (genJets->size());
751 std::vector <std::vector <const reco::GenParticle*> > caloJetConstituents (caloJets->size());
755 for (
unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
756 genJetConstituents [iGenJet] = jetMatching.
getGenParticles ((*genJets) [iGenJet]);
759 for (
unsigned iCaloJet = 0; iCaloJet < caloJets->size(); ++iCaloJet) {
760 caloJetConstituents [iCaloJet] = jetMatching.
getGenParticles ((*caloJets) [iCaloJet],
false);
764 for (
unsigned iGenJet = 0; iGenJet < genJets->size(); ++iGenJet) {
766 const GenJet& genJet = (*genJets) [iGenJet];
767 double genJetPt = genJet.
pt();
771 if (fabs(genJet.
eta()) > 6.)
continue;
776 if (caloJets->size() <= 0)
continue;
778 unsigned iCaloJetBest = 0;
779 double deltaRBest = 999.;
780 for (
unsigned iCaloJet = 0; iCaloJet < caloJets->size(); ++iCaloJet) {
781 double dR =
deltaR (genJet.
eta(), genJet.
phi(), (*caloJets) [iCaloJet].eta(), (*caloJets) [iCaloJet].phi());
790 if (dR < deltaRBest) {
791 iCaloJetBest = iCaloJet;
803 double CorrdeltaRBest = 999.;
804 double CorrJetPtBest = 0;
805 for (CaloJetCollection::const_iterator jet = caloJets->begin(); jet !=caloJets ->end(); jet++) {
810 scale = corrector->
correction(*jet,mEvent,mSetup);
813 double CorrJetPt = correctedJet.
pt();
815 double CorrdR =
deltaR (genJet.
eta(), genJet.
phi(), correctedJet.
eta(), correctedJet.
phi());
816 if (CorrdR < CorrdeltaRBest) {
817 CorrdeltaRBest = CorrdR;
818 CorrJetPtBest = CorrJetPt;
832 if (fabs(genJet.
eta())<1.5) {
836 if (fabs(genJet.
eta())>1.5 && fabs(genJet.
eta())<3.0) {
839 if (fabs(genJet.
eta())>3.0 && fabs(genJet.
eta())<6.0) {
842 if (genJet.
pt()>30.0 && genJet.
pt()<200.0) {
845 if (genJet.
pt()>200.0 && genJet.
pt()<600.0) {
848 if (genJet.
pt()>600.0 && genJet.
pt()<1500.0) {
851 if (genJet.
pt()>1500.0 && genJet.
pt()<3500.0) {
854 if (genJet.
pt()>30.0) {
862 unsigned iCaloJetBest = 0;
863 double energyFractionBest = 0.;
864 for (
unsigned iCaloJet = 0; iCaloJet < caloJets->size(); ++iCaloJet) {
866 caloJetConstituents [iCaloJet]);
867 if (energyFraction > energyFractionBest) {
868 iCaloJetBest = iCaloJet;
869 energyFractionBest = energyFraction;
876 double reverseEnergyFraction = jetMatching.
overlapEnergyFraction (caloJetConstituents [iCaloJetBest],
877 genJetConstituents [iGenJet]);
882 fillMatchHists (genJet, (*caloJets) [iCaloJetBest], goodVertices);
893 double logPtGen = log10 (fGenJet.
pt());
894 double PtGen = fGenJet.
pt();
895 double PtCalo = fCaloJet.
pt();
899 double PtThreshold = 10.;
907 if (fGenJet.
pt()>PtThreshold) {
913 if (fCaloJet.
pt() > PtThreshold) {
919 if (fabs(fGenJet.
eta())<1.5) {
925 if (PtGen>30.0 && PtGen<200.0) {
928 if (PtGen>200.0 && PtGen<600.0) {
931 if (PtGen>300.0 && PtGen<1500.0) {
934 if (PtGen>1500.0 && PtGen<3500.0) {
940 if (fabs(fGenJet.
eta())>1.5 && fabs(fGenJet.
eta())<3.0) {
946 if (PtGen>30.0 && PtGen<200.0) {
949 if (PtGen>200.0 && PtGen<600.0) {
952 if (PtGen>600.0 && PtGen<1500.0) {
955 if (PtGen>1500.0 && PtGen<3500.0) {
961 if (fabs(fGenJet.
eta())>3.0 && fabs(fGenJet.
eta())<6.0) {
967 if (PtGen>30.0 && PtGen<200.0) {
970 if (PtGen>200.0 && PtGen<600.0) {
973 if (PtGen>600.0 && PtGen<1500.0) {
976 if (PtGen>1500.0 && PtGen<3500.0) {
982 if (fGenJet.
pt()>30.0 && fGenJet.
pt()<200.0) {
986 if (fGenJet.
pt()>200.0 && fGenJet.
pt()<600.0) {
990 if (fGenJet.
pt()>600.0 && fGenJet.
pt()<1500.0) {
994 if (fGenJet.
pt()>1500.0 && fGenJet.
pt()<3500.0) {
998 if (fabs(fGenJet.
eta())<1.3) {
999 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
1002 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
1005 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
1009 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
1012 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
1015 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
1019 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
1022 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
1025 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
1029 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
1032 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
1035 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
1039 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
1042 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
1045 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
1049 if(fGenJet.
pt()>60.0 && fGenJet.
pt()<120.0) {
1052 if(fGenJet.
pt()>200.0 && fGenJet.
pt()<300.0) {
1055 if(fGenJet.
pt()>600.0 && fGenJet.
pt()<900.0) {
1060 if(goodVertices.size()>5 && goodVertices.size()<=10)
mpTScale_nvtx_5_10->
Fill(log10(PtGen),PtCalo/PtGen);
1066 if (fabs(fGenJet.
eta())<1.3) {
MonitorElement * mpTScale_1500_3500_d
MonitorElement * mpTScale_c_nvtx_5_10
void getManyByType(std::vector< Handle< PROD > > &results) const
MonitorElement * mpTScale1DF_600_1500
T getParameter(std::string const &) const
MonitorElement * mpTScale1DB_30_200
Jets made from CaloTowers.
MonitorElement * mjetArea
MonitorElement * mpTResponse_1500_3500_d
MonitorElement * mpTResponse_30_d
edm::InputTag mInputCollection
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * mHadEnergyInHE_80
MonitorElement * mHadEnergyInHB_80
MonitorElement * mpTScale_a_nvtx_5_10
MonitorElement * mMaxEInHadTowers
double mReverseEnergyFractionThreshold
MonitorElement * mpTResponse_nvtx_5_10
MonitorElement * mpTScale1DF_30_200
MonitorElement * mpTScale_c_nvtx_30_inf
MonitorElement * mConstituents
MonitorElement * mpTScale1DB_1500_3500
MonitorElement * mPtFirst
MonitorElement * mpTRatio_1500_3500_d
MonitorElement * mpTScale_a
virtual double correction(const LorentzVector &fJet) const =0
get correction using Jet information only
MonitorElement * mHadEnergyInHE
MonitorElement * mpTScale_a_nvtx_20_30
Base class for all types of Jets.
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * mNJetsEtaF
MonitorElement * mEtaFineBin
void fillMatchHists(const reco::GenJet &fGenJet, const reco::CaloJet &fCaloJet, std::vector< reco::Vertex > goodVertices)
MonitorElement * mEnergyFractionHadronic_E
MonitorElement * mpTScaleB_d
std::vector< CaloTower >::const_iterator const_iterator
MonitorElement * mpTScale_nvtx_0_5
MonitorElement * mpTScale1DE_600_1500
MonitorElement * mHFTotal_80
MonitorElement * mPtFirst_3000
MonitorElement * mpTRatioF_d
std::string mTurnOnEverything
MonitorElement * mHadEnergyInHB
MonitorElement * mpTScale_b_nvtx_0_5
MonitorElement * mpTScale1DE_30_200
virtual void scaleEnergy(double fScale)
scale energy of the jet
MonitorElement * mpTRatioE_d
MonitorElement * mNJetsEtaF_30
MonitorElement * mpTScale_c_nvtx_20_30
MonitorElement * mEScale_pt10
MonitorElement * mpTScalePhiB_d
MonitorElement * mEnergyFractionEm_E
MonitorElement * mHFShort_80
double mMatchGenPtThreshold
MonitorElement * mEmEnergyInHF
MonitorElement * mpTRatioB_d
MonitorElement * mHadEnergyInHO_3000
virtual double eta() const
momentum pseudorapidity
static int position[TOTALCHAMBERS][3]
MonitorElement * mpTResponse_nvtx_30_inf
MonitorElement * mpTScale_b
MonitorElement * mEmTiming
MonitorElement * mHadTiming
MonitorElement * mpTScale_nvtx_5_10
MonitorElement * mpTRatio_600_1500_d
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
MonitorElement * mEnergyFractionHadronic_B
virtual double energy() const
energy
MonitorElement * mPhiFirst
MonitorElement * mpTResponseF_d
MonitorElement * mpTScale_b_nvtx_10_15
MonitorElement * mpTScale_c_nvtx_0_5
MonitorElement * mpTScale_pT
MonitorElement * mGenEtaFirst
MonitorElement * mpTResponse_200_600_d
MonitorElement * mpTResponse_nvtx_20_30
MonitorElement * nvtx_0_60
MonitorElement * mpTRatio
MonitorElement * mConstituents_80
MonitorElement * mEmEnergyInEB_80
MonitorElement * mPhiFineBin
MonitorElement * mpTResponse_nvtx_15_20
MonitorElement * mEmEnergyInEE_80
MonitorElement * mpTScale_b_nvtx_15_20
MonitorElement * mpTResponse
MonitorElement * mCorrJetPt
MonitorElement * mpTRatio_200_600_d
MonitorElement * mHadEnergyInHO
Jets made from MC generator particles.
MonitorElement * mpTScale_c
MonitorElement * mCorrJetEta
MonitorElement * mCorrJetPhi
MonitorElement * mpTScale1DB_600_1500
MonitorElement * mHadEnergyInHO_80
MonitorElement * mpTScalePhiE_d
MonitorElement * mEnergyFractionEm_F
MonitorElement * bookProfile(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, const char *option="s")
tuple goodVertices
The Good vertices collection needed by the tracking failure filter ________||.
MonitorElement * mpTScale_a_nvtx_15_20
MonitorElement * mpTScale_a_nvtx_10_15
MonitorElement * mpTScale1DE_200_600
MonitorElement * mHadEnergyInHF
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
MonitorElement * mMjj_3000
MonitorElement * mEnergyFractionHadronic_F
MonitorElement * mpTResponse_nvtx_0_5
MonitorElement * mpTScale_nvtx_30_inf
double deltaR(double eta1, double eta2, double phi1, double phi2)
MonitorElement * mPthat_3000
MonitorElement * mHFShort
MonitorElement * mEScaleFineBin
MonitorElement * mpTScale_b_nvtx_30_inf
MonitorElement * numberofevents
MonitorElement * mpTScale_nvtx_10_15
MonitorElement * mpTScalePhiF_d
MonitorElement * mpTScale_200_600_d
MonitorElement * mpTResponse_600_1500_d
MonitorElement * mpTScaleE_d
MonitorElement * mPthat_80
MonitorElement * mpTScale1DF_200_600
virtual double pt() const
transverse momentum
MonitorElement * mpTScale_b_nvtx_20_30
MonitorElement * mpTScale_a_nvtx_0_5
MonitorElement * mGenPt_80
MonitorElement * nvtx_0_30
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 * mDeltaEta
MonitorElement * mpTResponseE_d
MonitorElement * mCorrJetPt_80
MonitorElement * mpTScale_c_nvtx_15_20
MonitorElement * mHFLong_80
MonitorElement * mHFTotal
MonitorElement * mpTScale_a_nvtx_30_inf
MonitorElement * mEmEnergyInEE
MonitorElement * mMass_80
MonitorElement * mNJetsEtaC
MonitorElement * mpTRatio_30_200_d
MonitorElement * mEnergyFractionEm_B
MonitorElement * mpTScale1DF_1500_3500
MonitorElement * mpTScale1DB_200_600
MonitorElement * mpTScale_600_1500_d
MonitorElement * mpTScale1DE_1500_3500
MonitorElement * mPtFirst_80
MonitorElement * mGenPhiFirst
MonitorElement * mMaxEInEmTowers
MonitorElement * mpTResponseB_d
MonitorElement * mEtaFirst
MonitorElement * mpTScale_b_nvtx_5_10
MonitorElement * mpTResponse_nvtx_10_15
MonitorElement * mpTScaleF_d
double mGenEnergyFractionThreshold
table const & tbl() const
MonitorElement * mpTScale_nvtx_20_30
virtual double phi() const
momentum azimuthal angle
MonitorElement * mpTScale_30_200_d
MonitorElement * mpTScale_c_nvtx_10_15
void setCurrentFolder(const std::string &fullpath)
MonitorElement * mDeltaPhi
MonitorElement * mpTScale_nvtx_15_20
MonitorElement * mEmEnergyInEB
std::string JetCorrectionService
MonitorElement * mpTResponse_30_200_d
CaloJetTester(const edm::ParameterSet &)
edm::InputTag mInputGenCollection