19 mInputCollection (iConfig.getParameter<
edm::
InputTag> (
"src")),
20 mInputPFCandCollection (iConfig.getParameter<
edm::
InputTag> (
"PFcands")),
21 mInputCsCandCollection (iConfig.exists(
"CScands") ? iConfig.getParameter<
edm::
InputTag>(
"CScands") :
edm::
InputTag()),
22 mOutputFile (iConfig.getUntrackedParameter<
std::
string>(
"OutputFile",
"")),
25 mRecoJetPtThreshold (iConfig.getParameter<double> (
"recoJetPtThreshold")),
26 mReverseEnergyFractionThreshold(iConfig.getParameter<double> (
"reverseEnergyFractionThreshold")),
27 mRThreshold (iConfig.getParameter<double> (
"RThreshold")),
28 JetCorrectionService (iConfig.getParameter<
std::
string> (
"JetCorrections"))
78 for(
int ieta=0; ieta<
etaBins_; ieta++){
91 for(
int ieta=0; ieta<
etaBins_; ieta++){
93 for(
int ipt=0; ipt<
ptBins_; ipt++){
148 for(
int ieta=0; ieta<
etaBins_; ieta++){
187 TH2F *h2D_ptBins_forRho =
new TH2F(
"ptBinsForRho",
"",300,0,300,500,0,300);
188 TH2F *h2D_centBins_forRho =
new TH2F(
"centBinsForRho",
"",200,0,200,500,0,300);
191 TH2F *h2D_ptBins_forRhoM =
new TH2F(
"ptBinsForRho",
"",300,0,300,100,0,1.5);
196 mNPFpart = ibooker.
book1D(
"NPFpart",
"No of particle flow candidates",1000,0,1000);
197 mPFPt = ibooker.
book1D(
"PFPt",
"PF candidate p_{T}",10000,-500,500);
198 mPFEta = ibooker.
book1D(
"PFEta",
"PF candidate #eta",120,-6,6);
199 mPFPhi = ibooker.
book1D(
"PFPhi",
"PF candidate #phi",70,-3.5,3.5);
204 mSumPFPt = ibooker.
book1D(
"SumPFPt",
"Sum of initial PF p_{T}",1000,-10000,10000);
210 mSumPFPt_HF = ibooker.
book2D(
"SumPFPt_HF",
"HF energy (y axis) vs Sum initial PF p_{T} (x axis)",1000,-1000,1000,1000,0,10000);
212 for(
int ieta=0; ieta<
etaBins_; ieta++){
214 if(ieta<2 || etaBins_-ieta<=2) range = 500;
218 for(
int id=0;
id<2;
id++){
if(histoName.find(
".")!=std::string::npos) { histoName.replace(histoName.find(
"."), 1,
"p"); } }
232 for(
int ieta=0; ieta<
etaBins_; ieta++){
233 mCSCandpT_vsPt[ieta]=ibooker.
book1D(Form(
"csCandPt_etaBin%d",ieta),
"CS candidate pt, eta-by-eta",150,0,300);
234 for(
int ipt=0; ipt<
ptBins_; ipt++){
235 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);
236 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);
238 mCSCand_corrPFcand[ieta] = ibooker.
book2D(Form(
"csCandCorrPF%d",ieta),
"CS to PF candidate correlation, eta-by-eta",300,0,300,300,0,300);
282 mNCalopart = ibooker.
book1D(
"NCalopart",
"No of particle flow candidates",1000,0,10000);
283 mCaloPt = ibooker.
book1D(
"CaloPt",
"Calo candidate p_{T}",1000,-5000,5000);
284 mCaloEta = ibooker.
book1D(
"CaloEta",
"Calo candidate #eta",120,-6,6);
285 mCaloPhi = ibooker.
book1D(
"CaloPhi",
"Calo candidate #phi",70,-3.5,3.5);
287 mSumCaloPt = ibooker.
book1D(
"SumCaloPt",
"Sum Calo p_{T}",1000,-10000,10000);
290 mSumSquaredCaloPt = ibooker.
book1D(
"SumSquaredCaloPt",
"Sum of initial Calo tower p_{T} squared",10000,0,10000);
293 mSumCaloPt_HF = ibooker.
book2D(
"SumCaloPt_HF",
"HF Energy (y axis) vs Sum Calo tower p_{T}",1000,-1000,1000,1000,0,10000);
295 for(
int ieta=0; ieta<
etaBins_; ieta++){
297 if(ieta<2 || etaBins_-ieta<=2) range = 5000;
301 for(
int id=0;
id<2;
id++){
if(histoName.find(
".")!=std::string::npos){ histoName.replace(histoName.find(
"."), 1,
"p"); } }
307 mSumpt = ibooker.
book1D(
"SumpT",
"Sum p_{T} of all the PF candidates per event",1000,0,10000);
310 mNvtx = ibooker.
book1D(
"Nvtx",
"number of vertices", 60, 0, 60);
311 mHF = ibooker.
book1D(
"HF",
"HF energy distribution",1000,0,10000);
314 mEta = ibooker.
book1D(
"Eta",
"Eta", 120, -6, 6);
315 mPhi = ibooker.
book1D(
"Phi",
"Phi", 70, -3.5, 3.5);
316 mPt = ibooker.
book1D(
"Pt",
"Pt", 1000, 0, 500);
317 mP = ibooker.
book1D(
"P",
"P", 100, 0, 1000);
319 mMass = ibooker.
book1D(
"Mass",
"Mass", 100, 0, 200);
323 mNJets_40 = ibooker.
book1D(
"NJets_pt_greater_40",
"NJets pT > 40 GeV", 50, 0, 50);
327 LogInfo(
"OutputInfo") <<
" Histograms will NOT be saved";
331 delete h2D_etabins_vs_pt2;
332 delete h2D_etabins_vs_pt;
333 delete h2D_pfcand_etabins_vs_pt;
334 delete h2D_etabins_forRho;
335 delete h2D_ptBins_forRho;
336 delete h2D_centBins_forRho;
385 int nVertex = vtxs->size();
387 for (
unsigned int i = 0 ;
i< vtxs->size(); ++
i){
388 unsigned int daughter = (*vtxs)[
i].tracksSize();
389 if( daughter > (*vtxs)[greatestvtx].tracksSize()) greatestvtx =
i;
395 vtx = (*vtxs)[greatestvtx].position();
397 int nGoodVertices = 0;
401 for (
unsigned i=0;
i<pvHandle->size();
i++)
403 if ((*pvHandle)[
i].ndof() > 4 &&
404 (fabs((*pvHandle)[
i].
z()) <= 24) &&
438 const int rhoSize = (
int)etaRanges->size();
439 double rhoRange[rhoSize];
440 for(
int irho=0; irho<rhoSize; irho++){ rhoRange[irho]=etaRanges->at(irho); }
441 double yaxisLimits[501];
442 for(
int ibin=0; ibin<501; ibin++) yaxisLimits[ibin] = ibin*2;
444 mRhoDist_vsEta->
getTH2F()->SetBins(rhoSize-1,const_cast<double*>(rhoRange),500,const_cast<double*>(yaxisLimits));
445 mRhoMDist_vsEta->
getTH2F()->SetBins(rhoSize-1,const_cast<double*>(rhoRange),500,const_cast<double*>(yaxisLimits));
485 Int_t NCaloTower = 0;
490 Float_t pfDeltaR = 0;
494 Float_t SumPt_value = 0;
496 vector < vector <float> > numbers;
497 vector <float> tempVector;
512 SumSquaredCaloPt[
i] = 0;
513 hSumCaloPt[
i] =
new TH1F(Form(
"hSumCaloPt_%d",
i),
"",10000,-10000,10000);
517 for(
unsigned icand = 0;icand<caloCandidates->
size(); icand++){
519 const CaloTower & tower = (*caloCandidates)[icand];
522 if(tower.
p4(vtx).Et() < 0.1)
continue;
526 caloPt = tower.
p4(vtx).Et();
527 caloEta = tower.
p4(vtx).Eta();
528 caloPhi = tower.
p4(vtx).Phi();
533 SumCaloPt[
k] = SumCaloPt[
k] + caloPt;
534 SumSquaredCaloPt[
k] = SumSquaredCaloPt[
k] + caloPt*caloPt;
540 SumPt_value = SumPt_value + caloPt;
550 hSumCaloPt[
k]->Fill(SumCaloPt[
k]);
554 Float_t Evt_SumCaloPt = 0;
555 Float_t Evt_SumSquaredCaloPt = 0;
557 for(
int ieta=0; ieta<
etaBins_; ieta++){
561 for(
size_t k = 0;
k<nedge_pseudorapidity-1;
k++){
563 Evt_SumCaloPt = Evt_SumCaloPt + SumCaloPt[
k];
566 Evt_SumSquaredCaloPt = Evt_SumSquaredCaloPt + SumSquaredCaloPt[
k];
569 delete hSumCaloPt[
k];
595 SumSquaredPFPt[
i] = 0;
597 hSumPFPt[
i] =
new TH1F(Form(
"hSumPFPt_%d",
i),
"",10000,-10000,10000);
601 vector<vector <float> > PF_Space(1,vector<float>(3));
606 for(
unsigned iCScand=0; iCScand<csCandidateColl->size(); iCScand++){
607 assert(csCandidateColl->size() <= pfCandidateColl->size());
617 for(
unsigned icand=0;icand<pfCandidateColl->size(); icand++)
621 if(pfCandidate.
pt() < 5)
continue;
624 pfPt = pfCandidate.
pt();
625 pfEta = pfCandidate.
eta();
626 pfPhi = pfCandidate.
phi();
633 if(fabs(pfEta)<
BarrelEta) isBarrel =
true;
682 tempVector.push_back(pfPt);
683 tempVector.push_back(pfEta);
684 tempVector.push_back(pfPhi);
686 numbers.push_back(tempVector);
692 SumPFPt[
k] = SumPFPt[
k] + pfPt;
693 SumSquaredPFPt[
k] = SumSquaredPFPt[
k] + pfPt*pfPt;
699 SumPt_value = SumPt_value + pfPt;
709 hSumPFPt[
k]->Fill(SumPFPt[
k]);
713 Float_t Evt_SumPFPt = 0;
714 Float_t Evt_SumSquaredPFPt = 0;
716 for(
int ieta=0; ieta<
etaBins_; ieta++){
720 for(
size_t k = 0;
k<nedge_pseudorapidity-1;
k++){
722 Evt_SumPFPt = Evt_SumPFPt + SumPFPt[
k];
725 Evt_SumSquaredPFPt = Evt_SumSquaredPFPt + SumSquaredPFPt[
k];
744 for (
unsigned ijet=0; ijet<caloJets->size(); ijet++)
746 recoJets.push_back((*caloJets)[ijet]);
752 for (
unsigned ijet=0; ijet<jptJets->size(); ijet++)
753 recoJets.push_back((*jptJets)[ijet]);
760 for (
unsigned ijet=0; ijet<basicJets->size();ijet++)
762 recoJets.push_back((*basicJets)[ijet]);
766 for(
unsigned ijet=0; ijet<pfJets->size(); ijet++){
767 recoJets.push_back((*pfJets)[ijet]);
792 for (
unsigned ijet=0; ijet<recoJets.size(); ijet++) {
796 if(recoJets[ijet].
pt() > 40)
811 while(recoJets[ijet].
eta()>etaRanges->at(ieta+1) && ieta<(
int)(rho->size()-1)) ieta++;
815 for(
unsigned irho=0; irho<rho->size(); irho++){
825 for(
size_t iii = 0 ; iii < numbers.size() ; iii++)
827 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
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_
void setCurrentFolder(const std::string &fullpath)
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
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
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 * 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