19 mInputCollection (iConfig.getParameter<
edm::
InputTag> (
"src")),
20 mInputVtxCollection (iConfig.getUntrackedParameter<
edm::
InputTag>(
"srcVtx",
edm::
InputTag(
"hiSelectedVertex"))),
21 mInputPFCandCollection (iConfig.getParameter<
edm::
InputTag> (
"PFcands")),
22 mInputCsCandCollection (iConfig.exists(
"CScands") ? iConfig.getParameter<
edm::
InputTag>(
"CScands") :
edm::
InputTag()),
23 mOutputFile (iConfig.getUntrackedParameter<
std::
string>(
"OutputFile",
"")),
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"))
79 for(
int ieta=0; ieta<
etaBins_; ieta++){
90 for(
int ieta=0; ieta<
etaBins_; ieta++){
94 for(
int ipt=0; ipt<
ptBins_; ipt++){
149 for(
int ieta=0; ieta<
etaBins_; ieta++){
187 const int nHihfBins = 100;
188 const double hihfBins[nHihfBins+1] = {0, 11.282305, 11.82962, 12.344717, 13.029054, 13.698554, 14.36821, 15.140326, 15.845786, 16.684441, 17.449186, 18.364939, 19.247023, 20.448898, 21.776642, 22.870239, 24.405788, 26.366919, 28.340206, 30.661842, 33.657627, 36.656773, 40.028049, 44.274784, 48.583706, 52.981358, 56.860199, 61.559853, 66.663689, 72.768196, 78.265915, 84.744431, 92.483459, 100.281021, 108.646576, 117.023911, 125.901093, 135.224899, 147.046875, 159.864258, 171.06015, 184.76535, 197.687103, 212.873535, 229.276413, 245.175369, 262.498322, 280.54599, 299.570801, 317.188446, 336.99881, 357.960144, 374.725922, 400.638367, 426.062103, 453.07251, 483.99704, 517.556396, 549.421143, 578.050781, 608.358643, 640.940979, 680.361755, 719.215027, 757.798645, 793.882385, 839.83728, 887.268127, 931.233276, 980.856689, 1023.191833, 1080.281494, 1138.363892, 1191.303345, 1251.439453, 1305.288818, 1368.290894, 1433.700684, 1501.597412, 1557.918335, 1625.636475, 1695.08374, 1761.771484, 1848.941162, 1938.178345, 2027.55603, 2127.364014, 2226.186523, 2315.188965, 2399.225342, 2501.608643, 2611.077881, 2726.316162, 2848.74707, 2972.975342, 3096.565674, 3219.530762, 3361.178223, 3568.028564, 3765.690186, 50000};
191 TH2F *h2D_ptBins_forRho =
new TH2F(
"ptBinsForRho",
"#rho vs. p_{T};p_{T};#rho",300,0,300,500,0,300);
192 TH2F *h2D_centBins_forRho =
new TH2F(
"centBinsForRho",
"dummy;HIHF;#rho",nHihfBins,hihfBins,500,0,300);
195 TH2F *h2D_ptBins_forRhoM =
new TH2F(
"ptBinsForRho",
"#rho_{M} vs. p_{T};p_{T};#rho_{M}",300,0,300,100,0,1.5);
196 TH2F *h2D_centBins_forRhoM =
new TH2F(
"centBinsForRho",
"dummy;HIHF;#rho_{M}",nHihfBins,hihfBins,100,0,1.5);
200 mNPFpart = ibooker.
book1D(
"NPFpart",
"No of particle flow candidates",1000,0,1000);
201 mPFPt = ibooker.
book1D(
"PFPt",
"PF candidate p_{T}",10000,-500,500);
202 mPFEta = ibooker.
book1D(
"PFEta",
"PF candidate #eta",120,-6,6);
203 mPFPhi = ibooker.
book1D(
"PFPhi",
"PF candidate #phi",70,-3.5,3.5);
208 mSumPFPt = ibooker.
book1D(
"SumPFPt",
"Sum of initial PF p_{T}",1000,-10000,10000);
214 mSumPFPt_HF = ibooker.
book2D(
"SumPFPt_HF",
"HF energy (y axis) vs Sum initial PF p_{T} (x axis)",1000,-1000,1000,1000,0,10000);
216 for(
int ieta=0; ieta<
etaBins_; ieta++){
218 if(ieta<2 || etaBins_-ieta<=2) range = 500;
222 for(
int id=0;
id<2;
id++){
if(histoName.find(
".")!=std::string::npos) { histoName.replace(histoName.find(
"."), 1,
"p"); } }
234 for(
int ieta=0; ieta<
etaBins_; ieta++){
235 mCSCandpT_vsPt[ieta]=ibooker.
book1D(Form(
"csCandPt_etaBin%d",ieta),
"CS candidate pt, eta-by-eta",150,0,300);
240 for(
int id=0;
id<2;
id++){
if(histoName.find(
".")!=std::string::npos){ histoName.replace(histoName.find(
"."), 1,
"p"); } }
242 rhoName.append(histoName);
246 rhoMName.append(histoName);
249 for(
int ipt=0; ipt<
ptBins_; ipt++){
250 mSubtractedEFrac[ipt][ieta]= ibooker.
book1D(Form(
"subtractedEFrac_JetPt%d_to_%d_etaBin%d",
ptBin[ipt],
ptBin[ipt+1],ieta),
"subtracted fraction of CS jet",50,0,1);
251 mSubtractedE[ipt][ieta]= ibooker.
book1D(Form(
"subtractedE_JetPt%d_to_%d_etaBin%d",
ptBin[ipt],
ptBin[ipt+1],ieta),
"subtracted total of CS jet",300,0,300);
253 mCSCand_corrPFcand[ieta] = ibooker.
book2D(Form(
"csCandCorrPF%d",ieta),
"CS to PF candidate correlation, eta-by-eta",300,0,300,300,0,300);
297 mNCalopart = ibooker.
book1D(
"NCalopart",
"No of particle flow candidates",1000,0,10000);
298 mCaloPt = ibooker.
book1D(
"CaloPt",
"Calo candidate p_{T}",1000,-5000,5000);
299 mCaloEta = ibooker.
book1D(
"CaloEta",
"Calo candidate #eta",120,-6,6);
300 mCaloPhi = ibooker.
book1D(
"CaloPhi",
"Calo candidate #phi",70,-3.5,3.5);
302 mSumCaloPt = ibooker.
book1D(
"SumCaloPt",
"Sum Calo p_{T}",1000,-10000,10000);
305 mSumSquaredCaloPt = ibooker.
book1D(
"SumSquaredCaloPt",
"Sum of initial Calo tower p_{T} squared",10000,0,10000);
308 mSumCaloPt_HF = ibooker.
book2D(
"SumCaloPt_HF",
"HF Energy (y axis) vs Sum Calo tower p_{T}",1000,-1000,1000,1000,0,10000);
310 for(
int ieta=0; ieta<
etaBins_; ieta++){
312 if(ieta<2 || etaBins_-ieta<=2) range = 5000;
316 for(
int id=0;
id<2;
id++){
if(histoName.find(
".")!=std::string::npos){ histoName.replace(histoName.find(
"."), 1,
"p"); } }
322 mSumpt = ibooker.
book1D(
"SumpT",
"Sum p_{T} of all the PF candidates per event",1000,0,10000);
325 mNvtx = ibooker.
book1D(
"Nvtx",
"number of vertices", 60, 0, 60);
326 mHF = ibooker.
book1D(
"HF",
"HF energy distribution",1000,0,10000);
329 mEta = ibooker.
book1D(
"Eta",
"Eta", 120, -6, 6);
330 mPhi = ibooker.
book1D(
"Phi",
"Phi", 70, -3.5, 3.5);
331 mPt = ibooker.
book1D(
"Pt",
"Pt", 1000, 0, 500);
332 mP = ibooker.
book1D(
"P",
"P", 100, 0, 1000);
334 mMass = ibooker.
book1D(
"Mass",
"Mass", 100, 0, 200);
338 mNJets_40 = ibooker.
book1D(
"NJets_pt_greater_40",
"NJets pT > 40 GeV", 50, 0, 50);
342 LogInfo(
"OutputInfo") <<
" Histograms will NOT be saved";
346 delete h2D_etabins_vs_pt2;
347 delete h2D_etabins_vs_pt;
348 delete h2D_pfcand_etabins_vs_pt;
349 delete h2D_etabins_forRho;
350 delete h2D_ptBins_forRho;
351 delete h2D_centBins_forRho;
352 delete h2D_centBins_forRhoM;
401 int nVertex = vtxs->size();
403 for (
unsigned int i = 0 ;
i< vtxs->size(); ++
i){
404 unsigned int daughter = (*vtxs)[
i].tracksSize();
405 if( daughter > (*vtxs)[greatestvtx].tracksSize()) greatestvtx =
i;
411 vtx = (*vtxs)[greatestvtx].position();
413 int nGoodVertices = 0;
417 for (
unsigned i=0;
i<pvHandle->size();
i++)
419 if ((*pvHandle)[
i].ndof() > 4 &&
420 (fabs((*pvHandle)[
i].
z()) <= 24) &&
454 const int rhoSize = (
int)etaRanges->size();
455 double rhoRange[rhoSize];
456 for(
int irho=0; irho<rhoSize; irho++){ rhoRange[irho]=etaRanges->at(irho); }
457 double yaxisLimits[501];
458 for(
int ibin=0; ibin<501; ibin++) yaxisLimits[ibin] = ibin*2;
460 mRhoDist_vsEta->
getTH2F()->SetBins(rhoSize-1,const_cast<double*>(rhoRange),500,const_cast<double*>(yaxisLimits));
461 mRhoMDist_vsEta->
getTH2F()->SetBins(rhoSize-1,const_cast<double*>(rhoRange),500,const_cast<double*>(yaxisLimits));
501 Int_t NCaloTower = 0;
506 Float_t pfDeltaR = 0;
510 Float_t SumPt_value = 0;
512 vector < vector <float> > numbers;
513 vector <float> tempVector;
528 SumSquaredCaloPt[
i] = 0;
529 hSumCaloPt[
i] =
new TH1F(Form(
"hSumCaloPt_%d",
i),
"",10000,-10000,10000);
533 for(
unsigned icand = 0;icand<caloCandidates->
size(); icand++){
535 const CaloTower & tower = (*caloCandidates)[icand];
538 if(tower.
p4(vtx).Et() < 0.1)
continue;
542 caloPt = tower.
p4(vtx).Et();
543 caloEta = tower.
p4(vtx).Eta();
544 caloPhi = tower.
p4(vtx).Phi();
549 SumCaloPt[
k] = SumCaloPt[
k] + caloPt;
550 SumSquaredCaloPt[
k] = SumSquaredCaloPt[
k] + caloPt*caloPt;
556 SumPt_value = SumPt_value + caloPt;
566 hSumCaloPt[
k]->Fill(SumCaloPt[
k]);
570 Float_t Evt_SumCaloPt = 0;
571 Float_t Evt_SumSquaredCaloPt = 0;
573 for(
int ieta=0; ieta<
etaBins_; ieta++){
577 for(
size_t k = 0;
k<nedge_pseudorapidity-1;
k++){
579 Evt_SumCaloPt = Evt_SumCaloPt + SumCaloPt[
k];
582 Evt_SumSquaredCaloPt = Evt_SumSquaredCaloPt + SumSquaredCaloPt[
k];
585 delete hSumCaloPt[
k];
611 SumSquaredPFPt[
i] = 0;
613 hSumPFPt[
i] =
new TH1F(Form(
"hSumPFPt_%d",
i),
"",10000,-10000,10000);
617 vector<vector <float> > PF_Space(1,vector<float>(3));
622 for(
unsigned iCScand=0; iCScand<csCandidateColl->size(); iCScand++){
623 assert(csCandidateColl->size() <= pfCandidateColl->size());
633 for(
unsigned icand=0;icand<pfCandidateColl->size(); icand++)
637 if(pfCandidate.
pt() < 5)
continue;
640 pfPt = pfCandidate.
pt();
641 pfEta = pfCandidate.
eta();
642 pfPhi = pfCandidate.
phi();
649 if(fabs(pfEta)<
BarrelEta) isBarrel =
true;
698 tempVector.push_back(pfPt);
699 tempVector.push_back(pfEta);
700 tempVector.push_back(pfPhi);
702 numbers.push_back(tempVector);
708 SumPFPt[
k] = SumPFPt[
k] + pfPt;
709 SumSquaredPFPt[
k] = SumSquaredPFPt[
k] + pfPt*pfPt;
715 SumPt_value = SumPt_value + pfPt;
725 hSumPFPt[
k]->Fill(SumPFPt[
k]);
729 Float_t Evt_SumPFPt = 0;
730 Float_t Evt_SumSquaredPFPt = 0;
732 for(
int ieta=0; ieta<
etaBins_; ieta++){
736 for(
size_t k = 0;
k<nedge_pseudorapidity-1;
k++){
738 Evt_SumPFPt = Evt_SumPFPt + SumPFPt[
k];
741 Evt_SumSquaredPFPt = Evt_SumSquaredPFPt + SumSquaredPFPt[
k];
760 for (
unsigned ijet=0; ijet<caloJets->size(); ijet++)
762 recoJets.push_back((*caloJets)[ijet]);
768 for (
unsigned ijet=0; ijet<jptJets->size(); ijet++)
769 recoJets.push_back((*jptJets)[ijet]);
776 for (
unsigned ijet=0; ijet<basicJets->size();ijet++)
778 recoJets.push_back((*basicJets)[ijet]);
782 for(
unsigned ijet=0; ijet<pfJets->size(); ijet++){
783 recoJets.push_back((*pfJets)[ijet]);
808 for (
unsigned ijet=0; ijet<recoJets.size(); ijet++) {
812 if(recoJets[ijet].
pt() > 40)
827 while(recoJets[ijet].
eta()>etaRanges->at(ieta+1) && ieta<(
int)(rho->size()-1)) ieta++;
831 for(
unsigned irho=0; irho<rho->size(); irho++){
841 for(
size_t iii = 0 ; iii < numbers.size() ; iii++)
843 pfDeltaR =
sqrt((numbers[iii][2]-recoJets[ijet].
phi())*(numbers[iii][2]-recoJets[ijet].
phi()) + (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_
T getParameter(std::string const &) const
MonitorElement * mCaloEta
edm::InputTag mInputCsCandCollection
MonitorElement * mSumSquaredPFPt
MonitorElement * mPFCandpT_vs_eta_electron
edm::EDGetTokenT< reco::CandidateView > caloCandViewToken_
double eta() const final
momentum pseudorapidity
MonitorElement * mCaloPhi
MonitorElement * mPFCandpT_Forward_EME_inHF
edm::EDGetTokenT< reco::JPTJetCollection > jptJetsToken_
edm::InputTag centralityTag_
math::PtEtaPhiMLorentzVector p4(double vtxZ) const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * mPFCandpT_Forward_muon
static int nedge_pseudorapidity
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
double pt() const final
transverse momentum
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
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
MonitorElement * rhoEtaRange
MonitorElement * mRhoDist_vsEta
void setCurrentFolder(std::string const &fullpath)
MonitorElement * mPFCandpT_vs_eta_photon
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_
MonitorElement * mRhoDist_vsPt
MonitorElement * mConstituents
MonitorElement * book1D(Args &&...args)
MonitorElement * mPFCandpT_Barrel_photon
Abs< T >::type abs(const T &t)
math::XYZPoint Point
point in the space
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
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]
double EtHFtowerSum() const
edm::InputTag mInputPFCandCollection
T const * product() const
MonitorElement * book2D(Args &&...args)
MonitorElement * mSumCaloPt
MonitorElement * mSumSquaredPFPt_eta
MonitorElement * mPFCandpT_Endcap_EME_inHF
edm::InputTag mInputVtxCollection
MonitorElement * mPFCandpT_vs_eta_HadE_inHF
edm::EDGetTokenT< reco::CandidateView > pfCandViewToken_
edm::EDGetTokenT< CaloTowerCollection > caloTowersToken_
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_]
int getNbinsX() const
get # of bins in X-axis
MonitorElement * mJetArea
virtual ParticleType particleId() const
JetAnalyzer_HeavyIons(const edm::ParameterSet &)
const int ptBin[ptBins_+1]
MonitorElement * mPFCandpT_Barrel_EME_inHF
MonitorElement * mRhoMDist_vsCent[etaBins_]
MonitorElement * mjetpileup
double phi() const final
momentum azimuthal angle
MonitorElement * mPFCandpT_vs_eta_Unknown
Power< A, B >::type pow(const A &a, const B &b)
MonitorElement * mPFCandpT_Forward_NeutralHadron
MonitorElement * mNCalopart
MonitorElement * mPFCandpT_Barrel_muon