18 : mInputCollection(iConfig.getParameter<edm::
InputTag>(
"src")),
19 mInputVtxCollection(iConfig.getUntrackedParameter<edm::
InputTag>(
"srcVtx", edm::
InputTag(
"hiSelectedVertex"))),
20 mInputPFCandCollection(iConfig.getParameter<edm::
InputTag>(
"PFcands")),
21 mInputCsCandCollection(iConfig.exists(
"CScands") ? iConfig.getParameter<edm::
InputTag>(
"CScands")
23 mOutputFile(iConfig.getUntrackedParameter<std::
string>(
"OutputFile",
"")),
24 JetType(iConfig.getUntrackedParameter<std::
string>(
"JetType")),
25 UEAlgo(iConfig.getUntrackedParameter<std::
string>(
"UEAlgo")),
26 mRecoJetPtThreshold(iConfig.getParameter<double>(
"recoJetPtThreshold")),
27 mReverseEnergyFractionThreshold(iConfig.getParameter<double>(
"reverseEnergyFractionThreshold")),
28 mRThreshold(iConfig.getParameter<double>(
"RThreshold")),
29 JetCorrectionService(iConfig.getParameter<std::
string>(
"JetCorrections")) {
87 for (
int ieta = 0; ieta <
etaBins_; ieta++) {
98 for (
int ieta = 0; ieta <
etaBins_; ieta++) {
102 for (
int ipt = 0; ipt <
ptBins_; ipt++) {
156 for (
int ieta = 0; ieta <
etaBins_; ieta++) {
188 TH2F *h2D_etabins_vs_pt2 =
190 TH2F *h2D_etabins_vs_pt =
192 TH2F *h2D_pfcand_etabins_vs_pt =
195 const int nHihfBins = 100;
196 const double hihfBins[nHihfBins + 1] = {
197 0, 11.282305, 11.82962, 12.344717, 13.029054, 13.698554, 14.36821, 15.140326,
198 15.845786, 16.684441, 17.449186, 18.364939, 19.247023, 20.448898, 21.776642, 22.870239,
199 24.405788, 26.366919, 28.340206, 30.661842, 33.657627, 36.656773, 40.028049, 44.274784,
200 48.583706, 52.981358, 56.860199, 61.559853, 66.663689, 72.768196, 78.265915, 84.744431,
201 92.483459, 100.281021, 108.646576, 117.023911, 125.901093, 135.224899, 147.046875, 159.864258,
202 171.06015, 184.76535, 197.687103, 212.873535, 229.276413, 245.175369, 262.498322, 280.54599,
203 299.570801, 317.188446, 336.99881, 357.960144, 374.725922, 400.638367, 426.062103, 453.07251,
204 483.99704, 517.556396, 549.421143, 578.050781, 608.358643, 640.940979, 680.361755, 719.215027,
205 757.798645, 793.882385, 839.83728, 887.268127, 931.233276, 980.856689, 1023.191833, 1080.281494,
206 1138.363892, 1191.303345, 1251.439453, 1305.288818, 1368.290894, 1433.700684, 1501.597412, 1557.918335,
207 1625.636475, 1695.08374, 1761.771484, 1848.941162, 1938.178345, 2027.55603, 2127.364014, 2226.186523,
208 2315.188965, 2399.225342, 2501.608643, 2611.077881, 2726.316162, 2848.74707, 2972.975342, 3096.565674,
209 3219.530762, 3361.178223, 3568.028564, 3765.690186, 50000};
211 TH2F *h2D_etabins_forRho =
213 TH2F *h2D_ptBins_forRho =
new TH2F(
"ptBinsForRho",
"#rho vs. p_{T};p_{T};#rho", 300, 0, 300, 500, 0, 300);
214 TH2F *h2D_centBins_forRho =
new TH2F(
"centBinsForRho",
"dummy;HIHF;#rho", nHihfBins, hihfBins, 500, 0, 300);
216 TH2F *h2D_etabins_forRhoM =
218 TH2F *h2D_ptBins_forRhoM =
new TH2F(
"ptBinsForRho",
"#rho_{M} vs. p_{T};p_{T};#rho_{M}", 300, 0, 300, 100, 0, 1.5);
219 TH2F *h2D_centBins_forRhoM =
new TH2F(
"centBinsForRho",
"dummy;HIHF;#rho_{M}", nHihfBins, hihfBins, 100, 0, 1.5);
222 mNPFpart = ibooker.
book1D(
"NPFpart",
"No of particle flow candidates", 1000, 0, 1000);
223 mPFPt = ibooker.
book1D(
"PFPt",
"PF candidate p_{T}", 10000, -500, 500);
224 mPFEta = ibooker.
book1D(
"PFEta",
"PF candidate #eta", 120, -6, 6);
225 mPFPhi = ibooker.
book1D(
"PFPhi",
"PF candidate #phi", 70, -3.5, 3.5);
227 mPFDeltaR = ibooker.
book1D(
"PFDeltaR",
"PF candidate DeltaR", 100, 0, 4);
229 ibooker.
book1D(
"PFDeltaR_Scaled_R",
"PF candidate DeltaR Divided by DeltaR square", 100, 0, 4);
231 mSumPFPt = ibooker.
book1D(
"SumPFPt",
"Sum of initial PF p_{T}", 1000, -10000, 10000);
234 mSumSquaredPFPt = ibooker.
book1D(
"SumSquaredPFPt",
"Sum of initial PF p_{T} squared", 10000, 0, 10000);
238 "SumPFPt_HF",
"HF energy (y axis) vs Sum initial PF p_{T} (x axis)", 1000, -1000, 1000, 1000, 0, 10000);
240 for (
int ieta = 0; ieta <
etaBins_; ieta++) {
242 if (ieta < 2 || etaBins_ - ieta <= 2)
248 for (
int id = 0;
id < 2;
id++) {
249 if (histoName.find(
'.') != std::string::npos) {
250 histoName.replace(histoName.find(
'.'), 1,
"p");
269 for (
int ieta = 0; ieta <
etaBins_; ieta++) {
271 ibooker.
book1D(Form(
"csCandPt_etaBin%d", ieta),
"CS candidate pt, eta-by-eta", 150, 0, 300);
277 for (
int id = 0;
id < 2;
id++) {
278 if (histoName.find(
'.') != std::string::npos) {
279 histoName.replace(histoName.find(
'.'), 1,
"p");
283 rhoName.append(histoName);
284 h2D_centBins_forRho->SetTitle(Form(
288 rhoMName.append(histoName);
289 h2D_centBins_forRhoM->SetTitle(Form(
"#rho_{M} vs. HIHF in the range %.3g < #eta < %.3g",
293 for (
int ipt = 0; ipt <
ptBins_; ipt++) {
295 ibooker.
book1D(Form(
"subtractedEFrac_JetPt%d_to_%d_etaBin%d",
ptBin[ipt],
ptBin[ipt + 1], ieta),
296 "subtracted fraction of CS jet",
301 ibooker.
book1D(Form(
"subtractedE_JetPt%d_to_%d_etaBin%d",
ptBin[ipt],
ptBin[ipt + 1], ieta),
302 "subtracted total of CS jet",
308 Form(
"csCandCorrPF%d", ieta),
"CS to PF candidate correlation, eta-by-eta", 300, 0, 300, 300, 0, 300);
322 Form(
";PF candidate p_{T}, |#eta|<%2.2f; counts",
BarrelEta),
327 Form(
";PF candidate p_{T}, |#eta|<%2.2f; counts",
BarrelEta),
332 Form(
";PF candidate p_{T}, |#eta|<%2.2f; counts",
BarrelEta),
337 Form(
";PF candidate p_{T}, |#eta|<%2.2f; counts",
BarrelEta),
342 Form(
";PF candidate p_{T}, |#eta|<%2.2f; counts",
BarrelEta),
347 Form(
";PF candidate p_{T}, |#eta|<%2.2f; counts",
BarrelEta),
352 Form(
";PF candidate p_{T}, |#eta|<%2.2f; counts",
BarrelEta),
357 Form(
";PF candidate p_{T}, |#eta|<%2.2f; counts",
BarrelEta),
363 ibooker.
book1D(
"mPFCandpT_Endcap_Unknown",
369 ibooker.
book1D(
"mPFCandpT_Endcap_ChargedHadron",
375 ibooker.
book1D(
"mPFCandpT_Endcap_electron",
381 ibooker.
book1D(
"mPFCandpT_Endcap_muon",
387 ibooker.
book1D(
"mPFCandpT_Endcap_photon",
393 ibooker.
book1D(
"mPFCandpT_Endcap_NeutralHadron",
399 ibooker.
book1D(
"mPFCandpT_Endcap_HadE_inHF",
405 ibooker.
book1D(
"mPFCandpT_Endcap_EME_inHF",
412 ibooker.
book1D(
"mPFCandpT_Forward_Unknown",
418 ibooker.
book1D(
"mPFCandpT_Forward_ChargedHadron",
424 ibooker.
book1D(
"mPFCandpT_Forward_electron",
430 ibooker.
book1D(
"mPFCandpT_Forward_muon",
436 ibooker.
book1D(
"mPFCandpT_Forward_photon",
442 ibooker.
book1D(
"mPFCandpT_Forward_NeutralHadron",
448 ibooker.
book1D(
"mPFCandpT_Forward_HadE_inHF",
454 ibooker.
book1D(
"mPFCandpT_Forward_EME_inHF",
462 mNCalopart = ibooker.
book1D(
"NCalopart",
"No of particle flow candidates", 1000, 0, 10000);
463 mCaloPt = ibooker.
book1D(
"CaloPt",
"Calo candidate p_{T}", 1000, -5000, 5000);
464 mCaloEta = ibooker.
book1D(
"CaloEta",
"Calo candidate #eta", 120, -6, 6);
465 mCaloPhi = ibooker.
book1D(
"CaloPhi",
"Calo candidate #phi", 70, -3.5, 3.5);
467 mSumCaloPt = ibooker.
book1D(
"SumCaloPt",
"Sum Calo p_{T}", 1000, -10000, 10000);
470 mSumSquaredCaloPt = ibooker.
book1D(
"SumSquaredCaloPt",
"Sum of initial Calo tower p_{T} squared", 10000, 0, 10000);
474 ibooker.
book2D(
"SumCaloPt_HF",
"HF Energy (y axis) vs Sum Calo tower p_{T}", 1000, -1000, 1000, 1000, 0, 10000);
476 for (
int ieta = 0; ieta <
etaBins_; ieta++) {
478 if (ieta < 2 || etaBins_ - ieta <= 2)
484 for (
int id = 0;
id < 2;
id++) {
485 if (histoName.find(
'.') != std::string::npos) {
486 histoName.replace(histoName.find(
'.'), 1,
"p");
490 Form(
"Sum Calo tower Pt in the eta range %.3g to %.3g",
500 mSumpt = ibooker.
book1D(
"SumpT",
"Sum p_{T} of all the PF candidates per event", 1000, 0, 10000);
503 mNvtx = ibooker.
book1D(
"Nvtx",
"number of vertices", 60, 0, 60);
504 mHF = ibooker.
book1D(
"HF",
"HF energy distribution", 1000, 0, 10000);
507 mEta = ibooker.
book1D(
"Eta",
"Eta", 120, -6, 6);
508 mPhi = ibooker.
book1D(
"Phi",
"Phi", 70, -3.5, 3.5);
509 mPt = ibooker.
book1D(
"Pt",
"Pt", 1000, 0, 500);
510 mP = ibooker.
book1D(
"P",
"P", 100, 0, 1000);
512 mMass = ibooker.
book1D(
"Mass",
"Mass", 100, 0, 200);
516 mNJets_40 = ibooker.
book1D(
"NJets_pt_greater_40",
"NJets pT > 40 GeV", 50, 0, 50);
520 LogInfo(
"OutputInfo") <<
" Histograms will NOT be saved";
524 delete h2D_etabins_vs_pt2;
525 delete h2D_etabins_vs_pt;
526 delete h2D_pfcand_etabins_vs_pt;
527 delete h2D_etabins_forRho;
528 delete h2D_ptBins_forRho;
529 delete h2D_centBins_forRho;
530 delete h2D_centBins_forRhoM;
571 int nVertex = vtxs->size();
573 for (
unsigned int i = 0;
i < vtxs->size(); ++
i) {
574 unsigned int daughter = (*vtxs)[
i].tracksSize();
575 if (daughter > (*vtxs)[greatestvtx].tracksSize())
582 vtx = (*vtxs)[greatestvtx].position();
584 int nGoodVertices = 0;
587 for (
unsigned i = 0;
i < pvHandle->size();
i++) {
588 if ((*pvHandle)[
i].ndof() > 4 && (fabs((*pvHandle)[
i].
z()) <= 24) && (fabs((*pvHandle)[
i].
position().
rho()) <= 2))
621 const int rhoSize = (int)etaRanges->size();
622 double rhoRange[rhoSize];
623 for (
int irho = 0; irho < rhoSize; irho++) {
624 rhoRange[irho] = etaRanges->at(irho);
626 double yaxisLimits[501];
627 for (
int ibin = 0; ibin < 501; ibin++)
628 yaxisLimits[ibin] = ibin * 2;
631 rhoSize - 1, const_cast<double *>(rhoRange), 500, const_cast<double *>(yaxisLimits));
633 rhoSize - 1, const_cast<double *>(rhoRange), 500, const_cast<double *>(yaxisLimits));
662 mHF->
Fill(cent->EtHFtowerSum());
663 Float_t HF_energy = cent->EtHFtowerSum();
680 Int_t NCaloTower = 0;
685 Float_t pfDeltaR = 0;
689 Float_t SumPt_value = 0;
691 vector<vector<float>> numbers;
692 vector<float> tempVector;
705 SumSquaredCaloPt[
i] = 0;
706 hSumCaloPt[
i] =
new TH1F(Form(
"hSumCaloPt_%d",
i),
"", 10000, -10000, 10000);
709 for (
unsigned icand = 0; icand < caloCandidates->size(); icand++) {
713 if (tower.
p4(vtx).Et() < 0.1)
718 caloPt = tower.
p4(vtx).Et();
719 caloEta = tower.
p4(vtx).Eta();
720 caloPhi = tower.
p4(vtx).Phi();
724 SumCaloPt[
k] = SumCaloPt[
k] + caloPt;
725 SumSquaredCaloPt[
k] = SumSquaredCaloPt[
k] + caloPt * caloPt;
731 SumPt_value = SumPt_value + caloPt;
740 hSumCaloPt[
k]->Fill(SumCaloPt[
k]);
744 Float_t Evt_SumCaloPt = 0;
745 Float_t Evt_SumSquaredCaloPt = 0;
747 for (
int ieta = 0; ieta <
etaBins_; ieta++) {
751 for (
size_t k = 0;
k < nedge_pseudorapidity - 1;
k++) {
752 Evt_SumCaloPt = Evt_SumCaloPt + SumCaloPt[
k];
755 Evt_SumSquaredCaloPt = Evt_SumSquaredCaloPt + SumSquaredCaloPt[
k];
758 delete hSumCaloPt[
k];
782 SumSquaredPFPt[
i] = 0;
784 hSumPFPt[
i] =
new TH1F(Form(
"hSumPFPt_%d",
i),
"", 10000, -10000, 10000);
787 vector<vector<float>> PF_Space(1, vector<float>(3));
792 for (
unsigned iCScand = 0; iCScand < csCandidateColl->size(); iCScand++) {
793 assert(csCandidateColl->size() <= pfCandidateColl->size());
804 for (
unsigned icand = 0; icand < pfCandidateColl->size(); icand++) {
807 if (pfCandidate.
pt() < 5)
811 pfPt = pfCandidate.
pt();
812 pfEta = pfCandidate.
eta();
813 pfPhi = pfCandidate.
phi();
903 tempVector.push_back(pfPt);
904 tempVector.push_back(pfEta);
905 tempVector.push_back(pfPhi);
907 numbers.push_back(tempVector);
912 SumPFPt[
k] = SumPFPt[
k] + pfPt;
913 SumSquaredPFPt[
k] = SumSquaredPFPt[
k] + pfPt * pfPt;
919 SumPt_value = SumPt_value + pfPt;
928 hSumPFPt[
k]->Fill(SumPFPt[
k]);
932 Float_t Evt_SumPFPt = 0;
933 Float_t Evt_SumSquaredPFPt = 0;
935 for (
int ieta = 0; ieta <
etaBins_; ieta++) {
939 for (
size_t k = 0;
k < nedge_pseudorapidity - 1;
k++) {
940 Evt_SumPFPt = Evt_SumPFPt + SumPFPt[
k];
943 Evt_SumSquaredPFPt = Evt_SumSquaredPFPt + SumSquaredPFPt[
k];
960 for (
unsigned ijet = 0; ijet < caloJets->size(); ijet++) {
961 recoJets.push_back((*caloJets)[ijet]);
966 for (
unsigned ijet = 0; ijet < jptJets->size(); ijet++)
967 recoJets.push_back((*jptJets)[ijet]);
972 for (
unsigned ijet = 0; ijet < basicJets->size(); ijet++) {
973 recoJets.push_back((*basicJets)[ijet]);
977 for (
unsigned ijet = 0; ijet < pfJets->size(); ijet++) {
978 recoJets.push_back((*pfJets)[ijet]);
1007 for (
unsigned ijet = 0; ijet < recoJets.size(); ijet++) {
1011 if (recoJets[ijet].
pt() > 40)
1033 int ipt = 0, ieta = 0;
1034 while (recoJets[ijet].
pt() >
ptBin[ipt + 1] && ipt <
ptBins_ - 1)
1036 while (recoJets[ijet].
eta() > etaRanges->at(ieta + 1) && ieta < (int)(rho->size() - 1))
1041 for (
unsigned irho = 0; irho < rho->size(); irho++) {
1051 for (
size_t iii = 0; iii < numbers.size(); iii++) {
1052 pfDeltaR =
sqrt((numbers[iii][2] - recoJets[ijet].
phi()) * (numbers[iii][2] - recoJets[ijet].
phi()) +
1053 (numbers[iii][1] - recoJets[ijet].
eta()) * (numbers[iii][1] - recoJets[ijet].
eta()));
MonitorElement * mPFCandpT_Forward_photon
edm::EDGetTokenT< reco::CaloJetCollection > caloJetsToken_
edm::EDGetTokenT< reco::PFCandidateCollection > pfCandToken_
MonitorElement * mCaloEta
edm::InputTag mInputCsCandCollection
MonitorElement * mSumSquaredPFPt
MonitorElement * mPFCandpT_vs_eta_electron
edm::EDGetTokenT< reco::CandidateView > caloCandViewToken_
MonitorElement * mCaloPhi
MonitorElement * mPFCandpT_Forward_EME_inHF
edm::EDGetTokenT< reco::JPTJetCollection > jptJetsToken_
double pt() const final
transverse momentum
edm::InputTag centralityTag_
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken_
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
virtual void setCurrentFolder(std::string const &fullpath)
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * mPFCandpT_Forward_muon
edm::EDGetTokenT< reco::PFJetCollection > pfJetsToken_
MonitorElement * mCSCandpT_vsPt[etaBins_]
MonitorElement * mPFCandpT_Endcap_NeutralHadron
MonitorElement * mPFCandpT_vs_eta_EME_inHF
MonitorElement * mSumSquaredCaloPt
bool isForward(DetId const &)
bool exists(std::string const ¶meterName) const
checks if a parameter exists
MonitorElement * mSubtractedEFrac[ptBins_][etaBins_]
void analyze(const edm::Event &, const edm::EventSetup &) override
MonitorElement * mSumPFPtEtaDep[etaBins_]
MonitorElement * mPFCandpT_Forward_electron
MonitorElement * mRhoMDist_vsEta
edm::EDGetTokenT< std::vector< reco::Vertex > > pvToken_
MonitorElement * mSumCaloPt_eta
MonitorElement * mPFCandpT_vs_eta_muon
const uint16_t range(const Frame &aFrame)
MonitorElement * mCSCand_corrPFcand[etaBins_]
MonitorElement * mPFCandpT_Endcap_HadE_inHF
edm::EDGetTokenT< int > centralityBinToken
MonitorElement * mSumPFPt_HF
MonitorElement * mPFCandpT_Endcap_ChargedHadron
MonitorElement * mRhoMDist_vsPt
MonitorElement * mPFCandpT_vs_eta_NeutralHadron
MonitorElement * mSumCaloPtEtaDep[etaBins_]
MonitorElement * mSumCaloPt_HF
static constexpr int etaBins_
MonitorElement * rhoEtaRange
MonitorElement * mRhoDist_vsEta
MonitorElement * mPFCandpT_vs_eta_photon
virtual int getNbinsX() const
get # of bins in X-axis
edm::EDGetTokenT< reco::Centrality > centralityToken
MonitorElement * mPFCandpT_Forward_ChargedHadron
MonitorElement * mSubtractedE[ptBins_][etaBins_]
MonitorElement * mPFCandpT_Endcap_muon
MonitorElement * mPFCandpT_Endcap_photon
MonitorElement * mPFDeltaR_Scaled_R
MonitorElement * mSumPFPt
edm::EDGetTokenT< std::vector< reco::Vertex > > hiVertexToken_
static constexpr int ptBins_
MonitorElement * mRhoDist_vsPt
MonitorElement * mConstituents
MonitorElement * mPFCandpT_Barrel_photon
Abs< T >::type abs(const T &t)
math::XYZPoint Point
point in the space
static constexpr int nedge_pseudorapidity
edm::InputTag mInputCollection
MonitorElement * mSumSquaredCaloPt_eta
MonitorElement * mPFCandpT_Barrel_Unknown
edm::EDGetTokenT< std::vector< double > > rhoToken_
edm::EDGetTokenT< std::vector< double > > rhomToken_
MonitorElement * mPFCandpT_Barrel_NeutralHadron
bool isEndcap(GeomDetEnumerators::SubDetector m)
MonitorElement * mPFCandpT_Endcap_Unknown
const Double_t ForwardEta
Log< level::Info, false > LogInfo
MonitorElement * mPFCandpT_vs_eta_ChargedHadron
MonitorElement * mPFCandpT_Forward_HadE_inHF
edm::EDGetTokenT< reco::BasicJetCollection > basicJetsToken_
MonitorElement * mPFCandpT_Barrel_ChargedHadron
MonitorElement * mPFCandpT_Barrel_HadE_inHF
MonitorElement * mPFDeltaR
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< reco::PFCandidateCollection > csCandToken_
const double edge_pseudorapidity[etaBins_+1]
edm::InputTag mInputPFCandCollection
T const * product() const
MonitorElement * mSumCaloPt
MonitorElement * mSumSquaredPFPt_eta
MonitorElement * mPFCandpT_Endcap_EME_inHF
edm::InputTag mInputVtxCollection
MonitorElement * mPFCandpT_vs_eta_HadE_inHF
MonitorElement * book2D(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
T getParameter(std::string const &) const
edm::EDGetTokenT< reco::CandidateView > pfCandViewToken_
void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override
MonitorElement * mPFCandpT_Forward_Unknown
~JetAnalyzer_HeavyIons() override
Particle reconstructed by the particle flow algorithm.
MonitorElement * mPFCandpT_Barrel_electron
static int position[264][3]
MonitorElement * mPFCandpT_Endcap_electron
MonitorElement * mNPFpart
MonitorElement * mSumPFPt_eta
edm::EDGetTokenT< std::vector< double > > etaToken_
MonitorElement * mNJets_40
double mRecoJetPtThreshold
MonitorElement * mRhoDist_vsCent[etaBins_]
MonitorElement * mJetArea
virtual ParticleType particleId() const
MonitorElement * book1D(TString const &name, TString const &title, int const nchX, double const lowX, double const highX, FUNC onbooking=NOOP())
JetAnalyzer_HeavyIons(const edm::ParameterSet &)
const int ptBin[ptBins_+1]
MonitorElement * mPFCandpT_Barrel_EME_inHF
MonitorElement * mRhoMDist_vsCent[etaBins_]
double phi() const final
momentum azimuthal angle
MonitorElement * mjetpileup
MonitorElement * mPFCandpT_vs_eta_Unknown
Power< A, B >::type pow(const A &a, const B &b)
MonitorElement * mPFCandpT_Forward_NeutralHadron
MonitorElement * mNCalopart
double eta() const final
momentum pseudorapidity
MonitorElement * mPFCandpT_Barrel_muon