10 #include "CLHEP/Units/defs.h"
11 #include "CLHEP/Units/PhysicalConstants.h"
12 #include "CLHEP/Units/SystemOfUnits.h"
14 #include "fastjet/JetDefinition.hh"
15 #include "fastjet/ClusterSequence.hh"
20 wmanager_(iPSet,consumesCollector()),
21 hepmcCollection_(iPSet.getParameter<edm::
InputTag>(
"hepmcCollection")),
22 genchjetCollection_(iPSet.getParameter<edm::
InputTag>(
"genChjetsCollection")),
23 genjetCollection_(iPSet.getParameter<edm::
InputTag>(
"genjetsCollection")),
24 verbosity_(iPSet.getUntrackedParameter<unsigned int>(
"verbosity",0))
97 nCha =
dbe->
book1D(
"nCha",
"n charged QCD-10-001", 100, 0., 100.);
106 nChj =
dbe->
book1D(
"nChj",
"n charged jets QCD-10-001", 30, 0, 30.);
122 nL0 =
dbe->
book1D(
"nL0",
"nL0 QCD-10-001", 30, 0., 30.);
126 pPPbar =
dbe->
book1D(
"pPPbar",
"Log10(pt) PPbar QCD-10-001", 25, -2., 3.);
127 pKpm =
dbe->
book1D(
"pKpm",
"Log10(pt) Kpm QCD-10-001", 25, -2., 3.);
128 pK0s =
dbe->
book1D(
"pK0s",
"Log10(pt) K0s QCD-10-001", 25, -2., 3.);
129 pL0 =
dbe->
book1D(
"pL0",
"Log10(pt) L0 QCD-10-001", 25, -2., 3.);
130 pXim =
dbe->
book1D(
"pXim",
"Log10(pt) Xim QCD-10-001", 25, -2., 3.);
131 pOmega =
dbe->
book1D(
"pOmega",
"Log10(pt) Omega QCD-10-001", 25, -2., 3.);
137 pNNbar =
dbe->
book1D(
"pNNbar",
"Log10(pt) NNbar QCD-10-001", 25, -2., 3.);
138 pGamma =
dbe->
book1D(
"pGamma",
"Log10(pt) Gamma QCD-10-001", 25, -2., 3.);
141 elePt =
dbe->
book1D(
"elePt",
"highest pt electron Log10(pt)", 30, -2., 4.);
144 muoPt =
dbe->
book1D(
"muoPt",
"highest pt muon Log10(pt)", 30, -2., 4.);
179 dEdetaHFdj =
dbe->
bookProfile(
"dEdetaHFdj",
"dEdeta HF QCD dijet", (
int)CaloCellManager::nForwardEta, 0, (
double)CaloCellManager::nForwardEta, 0., 300.,
" ");
182 nHFSD =
dbe->
book1D(
"nHFSD",
"n single diffraction in HF", 1, 0., 1.);
186 ntHFm =
dbe->
book1D(
"ntHFm",
"number of HF- tower SD", 20, 0., 20.);
207 djr10 =
dbe->
book1D(
"djr10",
"Differential Jet Rate 1#rightarrow0", 60, -1., 5.);
208 djr21 =
dbe->
book1D(
"djr21",
"Differential Jet Rate 2#rightarrow1", 60, -1., 5.);
209 djr32 =
dbe->
book1D(
"djr32",
"Differential Jet Rate 3#rightarrow2", 60, -1., 5.);
210 djr43 =
dbe->
book1D(
"djr43",
"Differential Jet Rate 4#rightarrow3", 60, -1., 5.);
213 _sumEt =
dbe->
book1D(
"sumET",
"Sum of stable particles Et", 150, 0, 600.);
214 _sumEt1 =
dbe->
book1D(
"sumET1",
"Sum of stable particles Et (eta<0.5)", 150, 0, 200.);
215 _sumEt2 =
dbe->
book1D(
"sumET2",
"Sum of stable particles Et (0.5<eta<1.0)", 150, 0, 200.);
216 _sumEt3 =
dbe->
book1D(
"sumET3",
"Sum of stable particles Et (1.0<eta<1.5)", 150, 0, 200.);
217 _sumEt4 =
dbe->
book1D(
"sumET4",
"Sum of stable particles Et (1.5<eta<2.0)", 150, 0, 200.);
218 _sumEt5 =
dbe->
book1D(
"sumET5",
"Sum of stable particles Et (2.0<eta<5.0)", 150, 0, 200.);
240 HepMC::GenEvent *myGenEvent =
new HepMC::GenEvent(*(evt->GetEvent()));
245 if (
verbosity_ > 0 ) { myGenEvent->print(); }
259 for (HepMC::GenEvent::particle_const_iterator iter = myGenEvent->particles_begin(); iter != myGenEvent->particles_end(); ++iter){
260 if ( std::fabs((*iter)->pdg_id()) == 4 ) { nc++; }
261 if ( std::fabs((*iter)->pdg_id()) == 5 ) { nb++; }
262 if ( (*iter)->status() == 1) {
265 if(PData==0) { charge = -999.; }
267 charge = PData->charge();
272 std::cout <<
"HepMC " << std::setw(14) << std::fixed << (*iter)->barcode()
273 << std::setw(14) << std::fixed << (*iter)->pdg_id()
274 << std::setw(14) << std::fixed << (*iter)->momentum().perp()
275 << std::setw(14) << std::fixed << (*iter)->momentum().eta()
276 << std::setw(14) << std::fixed << (*iter)->momentum().phi() << std::endl;
282 int nBSCp = 0;
int nBSCm = 0;
double eneHFp = 0.;
double eneHFm = 0.;
int nChapt05 = 0;
int nChaVtx = 0;
309 if ( (nBSCp > 0 || nBSCm > 0) && eneHFp >= 3. && eneHFm >= 3. ) { sel1 =
true; }
313 if ( (nBSCp >0 || nBSCm > 0) && nChaVtx >= 3 && nChapt05 > 1 ) { sel2 =
true; }
317 if ( nBSCp == 0 && nBSCm == 0 ) { sel3 =
true; }
321 if ( ( nBSCp>0 && nBSCm == 0 ) || ( nBSCm>0 && nBSCp == 0 ) ) { sel4 =
true; }
325 if ( nBSCp > 0 && nBSCm > 0 ) { sel5 =
true; }
329 if ( sel5 && nChaVtx > 3 ) { sel6 =
true; }
333 if ( nChaVtx >= 3 && nBSCm > 0 && eneHFp < 8. ) { sel7 =
true; }
349 unsigned int iMax = 0;
351 unsigned int ppbar = 0;
unsigned int nnbar = 0;
unsigned int kpm = 0;
unsigned int k0s = 0;
unsigned int l0 = 0;
unsigned int gamma = 0;
352 unsigned int xim = 0;
unsigned int omega = 0;
353 unsigned int ele = 0;
unsigned int muo = 0;
354 unsigned int eleMax = 0;
355 unsigned int muoMax = 0;
374 if ( pt > ptMax ) { ptMax =
pt; iMax =
i; }
404 else if ( sel2 &&
isNeutral(
i) && std::fabs(eta) < 2.5 ) {
411 pL0->
Fill(std::log10(pt),weight);
414 else if ( sel2 &&
isNeutral(
i) && std::fabs(eta) < 5.19 ) {
456 unsigned int nCellOvTh = 0;
459 for (
unsigned int icell = 0; icell <
eneInCell.size(); icell++ ) {
462 else { threshold = 4.; }
479 std::vector<unsigned int> nchvsphi (
nphiBin,0);
480 std::vector<double> sptvsphi (
nphiBin,0.);
481 unsigned int nChaTra = 0;
489 if ( thePhi < -180. ) { thePhi += 360.; }
490 else if ( thePhi > 180. ) { thePhi -= 360.; }
491 unsigned int thePhiBin = (int)((thePhi+180.)/binPhiW);
492 if ( thePhiBin ==
nphiBin ) { thePhiBin -= 1; }
493 nchvsphi[thePhiBin]++;
496 if ( std::fabs(thePhi) > 60. && std::fabs(thePhi) < 120. ) {
512 for (
unsigned int i = 0;
i <
nphiBin;
i++ ) {
513 double thisPhi = -180.+(
i+0.5)*binPhiW;
523 unsigned int nJets = 0;
526 reco::GenJetCollection::const_iterator ij1 = genChJets->begin();
527 reco::GenJetCollection::const_iterator ij2 = genChJets->begin();
529 for (reco::GenJetCollection::const_iterator iter=genChJets->begin();iter!=genChJets->end();++iter){
530 double eta = (*iter).eta();
531 double pt = (*iter).pt();
533 std::cout <<
"GenJet " << std::setw(14) << std::fixed << (*iter).pt()
534 << std::setw(14) << std::fixed << (*iter).eta()
535 << std::setw(14) << std::fixed << (*iter).phi() << std::endl;
537 if ( std::fabs(eta) < 2. ) {
543 if ( pt >= pt1 ) { pt1 =
pt; ij1 = iter; }
544 if ( pt < pt1 && pt >= pt2 ) { pt2 =
pt; ij2 = iter; }
549 if ( nJets > 0 && ij1 != genChJets->end() ) {
552 if ( nJets > 1 && ij2 != genChJets->end() ) {
586 reco::GenJetCollection::const_iterator ij3 = genJets->begin();
588 for (reco::GenJetCollection::const_iterator iter=genJets->begin();iter!=genJets->end();++iter){
589 double eta = (*iter).eta();
590 double pt = (*iter).pt();
592 std::cout <<
"GenJet " << std::setw(14) << std::fixed << (*iter).pt()
593 << std::setw(14) << std::fixed << (*iter).eta()
594 << std::setw(14) << std::fixed << (*iter).phi() << std::endl;
596 if ( std::fabs(eta) < 5. ) {
598 if ( pt >= pt1 ) { pt1 =
pt; ij1 = iter; }
599 if ( pt < pt1 && pt >= pt2 ) { pt2 =
pt; ij2 = iter; }
600 if ( pt < pt2 && pt >= pt3 ) { pt3 =
pt; ij3 = iter; }
604 if(fabs(iter->eta()) < 3. && iter->pt()>25.) {
606 jm25HT += iter->pt();
607 if(iter->pt()>jm25pt1) {
611 jm25pt1 = iter->pt();
612 }
else if(iter->pt()>jm25pt2) {
615 jm25pt2 = iter->pt();
616 }
else if(iter->pt()>jm25pt3) {
618 jm25pt3 = iter->pt();
619 }
else if(iter->pt()>jm25pt4) {
620 jm25pt4 = iter->pt();
625 jm80HT += iter->pt();
626 if(iter->pt()>jm80pt1) {
630 jm80pt1 = iter->pt();
631 }
else if(iter->pt()>jm80pt2) {
634 jm80pt2 = iter->pt();
635 }
else if(iter->pt()>jm80pt3) {
637 jm80pt3 = iter->pt();
638 }
else if(iter->pt()>jm80pt4) {
639 jm80pt4 = iter->pt();
664 double sumJetEt = 0;
double sumPartPt = 0.;
double sumChPartPt = 0.;
665 double jpx = 0;
double jpy = 0;
666 if ( nJets >= 2 && ij1 != genJets->end() && ij2 != genJets->end() ) {
667 if ( (*ij1).pt() > 25. && (*ij1).pt() > 25. ) {
668 double deltaPhi = std::fabs((*ij1).phi()-(*ij2).phi())/CLHEP::degree;
669 if ( deltaPhi > 180. ) deltaPhi = 360.-
deltaPhi;
671 if ( std::fabs(deltaPhi) > 2.5*CLHEP::degree ) {
678 if ( !
isNeutrino(
i) && iBin < CaloCellManager::nForwardEta ) {
693 double invMass = (*ij1).energy()*(*ij2).energy()-(*ij1).px()*(*ij2).px()-(*ij1).py()*(*ij2).py()-(*ij1).pz()*(*ij2).pz();
700 unsigned int nSelJets = 0;
701 for (reco::GenJetCollection::const_iterator iter=genJets->begin();iter!=genJets->end();++iter){
702 double pt = (*iter).pt();
703 double eta = (*iter).eta();
704 if ( std::fabs(eta) < 5. ) {
710 sumJetEt += (*iter).pt();
716 nj->
Fill(nSelJets,weight);
721 if ( nSelJets >= 3 ) {
pt3Frac->
Fill((*ij3).pt()/(pt1+pt2),weight); }
732 std::vector<const HepMC::GenParticle*> qcdActivity;
736 std::vector<fastjet::PseudoJet> vecs;
738 std::vector<const HepMC::GenParticle*>::const_iterator iqcdact;
739 for (iqcdact = qcdActivity.begin(); iqcdact != qcdActivity.end(); ++iqcdact){
740 const HepMC::FourVector& fmom = (*iqcdact)->momentum();
741 fastjet::PseudoJet pseudoJet(fmom.px(), fmom.py(), fmom.pz(), fmom.e());
742 pseudoJet.set_user_index(counterUser);
743 vecs.push_back(pseudoJet);
747 fastjet::ClusterSequence cseq(vecs, fastjet::JetDefinition(fastjet::kt_algorithm, 1., fastjet::E_scheme));
756 std::vector<const HepMC::GenParticle*> allStable;
766 for(std::vector<const HepMC::GenParticle*>::const_iterator iter=allStable.begin();
767 iter != allStable.end(); ++iter) {
769 double thisEta=fabs((*iter)->momentum().eta());
772 const HepMC::FourVector mom=(*iter)->momentum();
778 sqrt(px*px + py*py)*E /
779 sqrt(px*px + py*py + pz*pz)
782 if(thisEta<1.0) sumEt1 += thisSumEt;
783 else if(thisEta<2.0) sumEt2 += thisSumEt;
784 else if(thisEta<3.0) sumEt3 += thisSumEt;
785 else if(thisEta<4.0) sumEt4 += thisSumEt;
786 else sumEt5 += thisSumEt;
821 else { status = (
hepmcCharge[
i] == 0. && pdgId != 12 && pdgId != 14 && pdgId != 16) ; }
831 else { status = (pdgId == 12 || pdgId == 14 || pdgId == 16) ; }
838 unsigned int iBin = 999;
844 if ( std::fabs(eta) >= theEtaRanges[
i] && std::fabs(eta) < theEtaRanges[
i+1] )
bool isCharged(unsigned int i)
MonitorElement * ncnobquark
MonitorElement * _JM25pt3
MonitorElement * _JM80pt1
static const unsigned int nphiBin
std::vector< const HepMC::GenParticle * > hepmcGPCollection
status 1 GenParticle collection
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * sptDenLpt
MonitorElement * leadTracketa
bool getByToken(EDGetToken token, Handle< PROD > &result) const
static const unsigned int nForwardEta
MonitorElement * leadTrackpt
MBUEandQCDValidation(const edm::ParameterSet &)
static const unsigned int nBarrelCell
MonitorElement * dSptdphi
MonitorElement * dNchdpt1
MonitorElement * dNchdSpt
MonitorElement * _JM25pt1
MonitorElement * _JM80njets
DQMStore * dbe
ME's "container".
void allStatus1(const HepMC::GenEvent *all, std::vector< const HepMC::GenParticle * > &status1)
MonitorElement * dNchjdeta
CaloCellManager * theCalo
manager of calorimetric cell structure
MonitorElement * dNchdeta1
static const unsigned int nEndcapEta
edm::InputTag genjetCollection_
MonitorElement * pt1pt2Dphi
MonitorElement * dNchdeta2
void getData(T &iHolder) const
MonitorElement * _JM25njets
std::vector< double > hepmcCharge
bool isNeutrino(unsigned int i)
MonitorElement * pt1pt2InvM
edm::ESHandle< HepPDT::ParticleDataTable > fPDGTable
PDT table.
std::vector< double > getEtaRanges()
CaloCellId * getCellFromIndex(unsigned int id)
void removeIsolatedLeptons(const HepMC::GenEvent *all, double deltaR, double sumPt, std::vector< const HepMC::GenParticle * > &pruned)
MonitorElement * eneHFmSel
MonitorElement * nSaFwdTrig
MonitorElement * pt1pt2optot
MonitorElement * pt1pt2optotch
static const unsigned int nCaloCell
MonitorElement * leadChjpt
MonitorElement * dNchjdpt
MonitorElement * _JM25pt2
Cos< T >::type cos(const T &t)
MonitorElement * dNchdpt2
MonitorElement * nEvt1
QCD-09-010 analysis.
Abs< T >::type abs(const T &t)
MonitorElement * dNchdphi
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 * dEdetaHFdj
std::vector< double > eneInCell
static const unsigned int nEndcapCell
MonitorElement * pt1pt2balance
edm::InputTag hepmcCollection_
HepPDT::ParticleData ParticleData
static const unsigned int nBarrelEta
edm::InputTag genchjetCollection_
MonitorElement * leadChjeta
edm::EDGetTokenT< reco::GenJetCollection > genchjetCollectionToken_
virtual void endRun(const edm::Run &, const edm::EventSetup &)
MonitorElement * _JM80pt2
MonitorElement * nNoFwdTrig
edm::EDGetTokenT< reco::GenJetCollection > genjetCollectionToken_
MonitorElement * _JM80pt3
MonitorElement * _JM25pt4
edm::EDGetTokenT< edm::HepMCProduct > hepmcCollectionToken_
virtual void analyze(const edm::Event &, const edm::EventSetup &)
MonitorElement * ncandbquark
unsigned int getHFbin(double eta)
MonitorElement * _JM80pt4
bool isNeutral(unsigned int i)
T perp() const
Magnitude of transverse component.
MonitorElement * dEdetaHFmb
MonitorElement * nChaDenLpt
unsigned int getCellIndexFromAngle(double eta, double phi)
double weight(const edm::Event &)
virtual void beginRun(const edm::Run &, const edm::EventSetup &)
void setCurrentFolder(const std::string &fullpath)
static const unsigned int initSize
virtual ~MBUEandQCDValidation()
MonitorElement * missEtosumJEt