CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
Rivet::HiggsTemplateCrossSections Class Reference

Rivet routine for classifying MC events according to the Higgs template cross section categories. More...

Inheritance diagram for Rivet::HiggsTemplateCrossSections:

Public Member Functions

HiggsClassification classifyEvent (const Event &event, const HTXS::HiggsProdMode prodMode)
 Main classificaion method. More...
 
 HiggsTemplateCrossSections ()
 
Utility methods

Methods to identify the Higgs boson and associated vector boson and to build jets

Particle getLastInstance (Particle ptcl)
 follow a "propagating" particle and return its last instance More...
 
bool originateFrom (const Particle &p, const Particles &ptcls)
 Whether particle p originate from any of the ptcls. More...
 
bool originateFrom (const Particle &p, const Particle &p2)
 Whether particle p originates from p2. More...
 
bool hasChild (const GenParticle *ptcl, int pdgID)
 Checks whether the input particle has a child with a given PDGID. More...
 
bool hasParent (const GenParticle *ptcl, int pdgID)
 Checks whether the input particle has a parent with a given PDGID. More...
 
bool quarkDecay (const Particle &p)
 Return true is particle decays to quarks. More...
 
HiggsClassification error (HiggsClassification &cat, HTXS::ErrorCode err, std::string msg="", int NmaxWarnings=20)
 Returns the classification object with the error code set. Prints an warning message, and keeps track of number of errors. More...
 
Categorization methods

Methods to assign the truth category based on the identified Higgs boson and associated vector bosons and/or reconstructed jets

int getBin (double x, std::vector< double > bins)
 Return bin index of x given the provided bin edges. 0=first bin, -1=underflow bin. More...
 
int vbfTopology (const Jets &jets, const Particle &higgs)
 VBF topolog selection 0 = fail loose selction: m_jj > 400 GeV and Dy_jj > 2.8 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass tight selection. More...
 
bool isVH (HTXS::HiggsProdMode p)
 Whether the Higgs is produced in association with a vector boson (VH) More...
 
HTXS::Stage0::Category getStage0Category (const HTXS::HiggsProdMode prodMode, const Particle &higgs, const Particle &V)
 Stage-0 HTXS categorization. More...
 
HTXS::Stage1::Category getStage1Category (const HTXS::HiggsProdMode prodMode, const Particle &higgs, const Jets &jets, const Particle &V)
 Stage-1 categorization. More...
 
Default Rivet analysis methods and steering methods
void setHiggsProdMode (HTXS::HiggsProdMode prodMode)
 Sets the Higgs production mode. More...
 
void init () override
 default Rivet Analysis::init method Booking of histograms, initializing Rivet projection Extracts Higgs production mode from shell variable if not set manually using setHiggsProdMode More...
 
void analyze (const Event &event) override
 
void printClassificationSummary ()
 
void finalize () override
 
void initializeHistos ()
 

Private Attributes

Histo1DPtr hist_deltay_jj
 
Histo1DPtr hist_dijet_mass
 
Histo1DPtr hist_Njets25
 
Histo1DPtr hist_Njets30
 
Histo1DPtr hist_pT_Higgs
 
Histo1DPtr hist_pT_Hjj
 
Histo1DPtr hist_pT_jet1
 
Histo1DPtr hist_pT_V
 
Histo1DPtr hist_stage0
 
Histo1DPtr hist_stage1_pTjet25
 
Histo1DPtr hist_stage1_pTjet30
 
Histo1DPtr hist_y_Higgs
 
std::map< HTXS::ErrorCode, size_t > m_errorCount
 
HTXS::HiggsProdMode m_HiggsProdMode
 
double m_sumw
 

Detailed Description

Rivet routine for classifying MC events according to the Higgs template cross section categories.

Author
Jim Lacey (DESY) <james.nosp@m..lac.nosp@m.ey@ce.nosp@m.rn.c.nosp@m.h,jlace.nosp@m.y@de.nosp@m.sy.de>
Dag Gillberg (Carleton University) dag.g.nosp@m.illb.nosp@m.erg@c.nosp@m.ern..nosp@m.ch

Definition at line 19 of file HiggsTemplateCrossSections.cc.

Constructor & Destructor Documentation

Rivet::HiggsTemplateCrossSections::HiggsTemplateCrossSections ( )
inline

Definition at line 22 of file HiggsTemplateCrossSections.cc.

23  : Analysis("HiggsTemplateCrossSections"),

Member Function Documentation

void Rivet::HiggsTemplateCrossSections::analyze ( const Event event)
inlineoverride

Definition at line 435 of file HiggsTemplateCrossSections.cc.

References funct::abs(), eostools::cat(), classifyEvent(), F(), hist_deltay_jj, hist_dijet_mass, hist_Njets25, hist_Njets30, hist_pT_Higgs, hist_pT_Hjj, hist_pT_jet1, hist_pT_V, hist_stage0, hist_stage1_pTjet25, hist_stage1_pTjet30, hist_y_Higgs, m_HiggsProdMode, m_sumw, ResonanceBuilder::mass, PFRecoTauDiscriminationByIsolation_cfi::offset, EnergyCorrector::pt, and mps_merge::weight.

435  {
436 
437  // get the classification
438  HiggsClassification cat = classifyEvent(event,m_HiggsProdMode);
439 
440  // Fill histograms: categorization --> linerize the categories
441  const double weight = event.weight();
442  m_sumw += weight;
443 
444  int F=cat.stage0_cat%10, P=cat.stage1_cat_pTjet30GeV/100;
445  hist_stage0->fill( cat.stage0_cat/10*2+F, weight );
446 
447  // Stage 1 enum offsets for each production mode: GGF=12, VBF=6, WH= 5, QQ2ZH=5, GG2ZH=4, TTH=2, BBH=2, TH=2
448  vector<int> offset({0,1,13,19,24,29,33,35,37,39});
449  int off = offset[P];
450  hist_stage1_pTjet25->fill(cat.stage1_cat_pTjet25GeV%100 + off, weight);
451  hist_stage1_pTjet30->fill(cat.stage1_cat_pTjet30GeV%100 + off, weight);
452 
453  // Fill histograms: variables used in the categorization
454  hist_pT_Higgs->fill(cat.higgs.pT(),weight);
455  hist_y_Higgs->fill(cat.higgs.rapidity(),weight);
456  hist_pT_V->fill(cat.V.pT(),weight);
457 
458  hist_Njets25->fill(cat.jets25.size(),weight);
459  hist_Njets30->fill(cat.jets30.size(),weight);
460 
461  // Jet variables. Use jet collection with pT threshold at 30 GeV
462  if (!cat.jets30.empty()) hist_pT_jet1->fill(cat.jets30[0].pt(),weight);
463  if (cat.jets30.size()>=2) {
464  const FourMomentum &j1 = cat.jets30[0].momentum(), &j2 = cat.jets30[1].momentum();
465  hist_deltay_jj->fill(std::abs(j1.rapidity()-j2.rapidity()),weight);
466  hist_dijet_mass->fill((j1+j2).mass(),weight);
467  hist_pT_Hjj->fill((j1+j2+cat.higgs.momentum()).pt(),weight);
468  }
469  }
Definition: weight.py:1
def cat(path)
Definition: eostools.py:400
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
HiggsClassification classifyEvent(const Event &event, const HTXS::HiggsProdMode prodMode)
Main classificaion method.
std::pair< OmniClusterRef, TrackingParticleRef > P
static uInt32 F(BLOWFISH_CTX *ctx, uInt32 x)
Definition: blowfish.cc:281
Definition: event.py:1
HiggsClassification Rivet::HiggsTemplateCrossSections::classifyEvent ( const Event event,
const HTXS::HiggsProdMode  prodMode 
)
inline

Main classificaion method.

Definition at line 99 of file HiggsTemplateCrossSections.cc.

References eostools::cat(), class-composition::child, class-composition::children, error(), event(), getLastInstance(), getStage0Category(), getStage1Category(), HTXS::GG2ZH, hasChild(), hasParent(), HTXS::HIGGS_DECAY_IDENTIFICATION, HTXS::HIGGS_IDENTIFICATION, HTXS::HS_VTX_IDENTIFICATION, isVH(), fwrapper::jets, m_errorCount, m_HiggsProdMode, originateFrom(), AlCaHLTBitMon_ParallelJobs::p, HadronAndPartonSelector_cfi::particles, HTXS::PRODMODE_DEFINED, PVValHelper::pT, HTXS::QQ2ZH, quarkDecay(), HTXS::SUCCESS, HTXS::TH, HTXS::TOP_W_IDENTIFICATION, HTXS::TTH, HTXS::UNDEFINED, HTXS::UNKNOWN, HTXS::Stage0::UNKNOWN, HTXS::Stage1::UNKNOWN, HTXS::VH_DECAY_IDENTIFICATION, HTXS::VH_IDENTIFICATION, and HTXS::WH.

Referenced by analyze().

99  {
100 
102 
103  // the classification object
104  HiggsClassification cat;
105  cat.prodMode = prodMode;
106  cat.errorCode = HTXS::UNDEFINED;
107  cat.stage0_cat = HTXS::Stage0::UNKNOWN;
108  cat.stage1_cat_pTjet25GeV = HTXS::Stage1::UNKNOWN;
109  cat.stage1_cat_pTjet30GeV = HTXS::Stage1::UNKNOWN;
110 
111  if (prodMode == HTXS::UNKNOWN)
112  return error(cat,HTXS::PRODMODE_DEFINED,
113  "Unkown Higgs production mechanism. Cannot classify event."
114  " Classification for all events will most likely fail.");
115 
116  /*****
117  * Step 1.
118  * Idenfify the Higgs boson and the hard scatter vertex
119  * There should be only one of each.
120  */
121 
122  GenVertex *HSvtx = event.genEvent()->signal_process_vertex();
123  int Nhiggs=0;
124  for ( const GenParticle *ptcl : Rivet::particles(event.genEvent()) ) {
125 
126  // a) Reject all non-Higgs particles
127  if ( !PID::isHiggs(ptcl->pdg_id()) ) continue;
128  // b) select only the final Higgs boson copy, prior to decay
129  if ( ptcl->end_vertex() && !hasChild(ptcl,PID::HIGGS) ) {
130  cat.higgs = Particle(ptcl); ++Nhiggs;
131  }
132  // c) if HepMC::signal_proces_vertex is missing
133  // set hard-scatter vertex based on first Higgs boson
134  if ( HSvtx==nullptr && ptcl->production_vertex() && !hasParent(ptcl,PID::HIGGS) )
135  HSvtx = ptcl->production_vertex();
136  }
137 
138  // Make sure things are in order so far
139  if (Nhiggs!=1)
141  "Current event has "+std::to_string(Nhiggs)+" Higgs bosons. There must be only one.");
142  if (cat.higgs.children().size()<2)
144  "Could not identify Higgs boson decay products.");
145 
146  if (HSvtx == nullptr)
147  return error(cat,HTXS::HS_VTX_IDENTIFICATION,"Cannot find hard-scatter vertex of current event.");
148 
149  /*****
150  * Step 2.
151  * Identify associated vector bosons
152  */
153 
154  // Find associated vector bosons
155  bool is_uncatdV = false;
156  Particles uncatV_decays;
157  FourMomentum uncatV_p4(0,0,0,0);
158  FourVector uncatV_v4(0,0,0,0);
159  int nWs=0, nZs=0, nTop=0;
160  if ( isVH(prodMode) ) {
161  for (auto ptcl:particles(HSvtx,HepMC::children)) {
162  if (PID::isW(ptcl->pdg_id())) { ++nWs; cat.V=Particle(ptcl); }
163  if (PID::isZ(ptcl->pdg_id())) { ++nZs; cat.V=Particle(ptcl); }
164  }
165  if(nWs+nZs>0) cat.V = getLastInstance(cat.V);
166  else {
167  for (auto ptcl:particles(HSvtx,HepMC::children)) {
168  if (!PID::isHiggs(ptcl->pdg_id())) {
169  uncatV_decays += Particle(ptcl);
170  uncatV_p4 += Particle(ptcl).momentum();
171  // uncatV_v4 += Particle(ptcl).origin();
172  }
173  }
174  // is_uncatdV = true; cat.V = Particle(24,uncatV_p4,uncatV_v4);
175  is_uncatdV = true; cat.V = Particle(24,uncatV_p4);
176  }
177  }
178 
179  if ( !is_uncatdV ){
180 
181  if ( isVH(prodMode) && !cat.V.genParticle()->end_vertex() )
182  return error(cat,HTXS::VH_DECAY_IDENTIFICATION,"Vector boson does not decay!");
183 
184  if ( isVH(prodMode) && cat.V.children().size()<2 )
185  return error(cat,HTXS::VH_DECAY_IDENTIFICATION,"Vector boson does not decay!");
186 
187  if ( ( prodMode==HTXS::WH && (nZs>0||nWs!=1) ) ||
188  ( (prodMode==HTXS::QQ2ZH||prodMode==HTXS::GG2ZH) && (nZs!=1||nWs>0) ) )
189  return error(cat,HTXS::VH_IDENTIFICATION,"Found "+std::to_string(nWs)+" W-bosons and "+
190  std::to_string(nZs)+" Z-bosons. Inconsitent with VH expectation.");
191  }
192 
193  // Find and store the W-bosons from ttH->WbWbH
194  Particles Ws;
195  if ( prodMode==HTXS::TTH || prodMode==HTXS::TH ){
196  // loop over particles produced in hard-scatter vertex
197  for ( auto ptcl : particles(HSvtx,HepMC::children) ) {
198  if ( !PID::isTop(ptcl->pdg_id()) ) continue;
199  ++nTop;
200  Particle top = getLastInstance(Particle(ptcl));
201  if ( top.genParticle()->end_vertex() )
202  for (auto child:top.children())
203  if ( PID::isW(child.pdgId()) ) Ws += child;
204  }
205  }
206 
207  // Make sure result make sense
208  if ( (prodMode==HTXS::TTH && Ws.size()<2) || (prodMode==HTXS::TH && Ws.empty() ) )
209  return error(cat,HTXS::TOP_W_IDENTIFICATION,"Failed to identify W-boson(s) from t-decay!");
210 
211  /*****
212  * Step 3.
213  * Build jets
214  * Make sure all stable particles are present
215  */
216 
217  // Create a list of the vector bosons that decay leptonically
218  // Either the vector boson produced in association with the Higgs boson,
219  // or the ones produced from decays of top quarks produced with the Higgs
220  Particles leptonicVs;
221  if ( !is_uncatdV ){
222  if ( isVH(prodMode) && !quarkDecay(cat.V) ) leptonicVs += cat.V;
223  }else leptonicVs = uncatV_decays;
224  for ( auto W:Ws ) if ( W.genParticle()->end_vertex() && !quarkDecay(W) ) leptonicVs += W;
225 
226  // Obtain all stable, final-state particles
227  const ParticleVector FS = applyProjection<FinalState>(event, "FS").particles();
228  Particles hadrons;
229  FourMomentum sum(0,0,0,0), vSum(0,0,0,0), hSum(0,0,0,0);
230  for ( const Particle &p : FS ) {
231  // Add up the four momenta of all stable particles as a cross check
232  sum += p.momentum();
233  // ignore particles from the Higgs boson
234  if ( originateFrom(p,cat.higgs) ) { hSum += p.momentum(); continue; }
235  // Cross-check the V decay products for VH
236  if ( isVH(prodMode) && !is_uncatdV && originateFrom(p,Ws) ) vSum += p.momentum();
237  // ignore final state particles from leptonic V decays
238  if ( !leptonicVs.empty() && originateFrom(p,leptonicVs) ) continue;
239  // All particles reaching here are considered hadrons and will be used to build jets
240  hadrons += p;
241  }
242 
243  cat.p4decay_higgs = hSum;
244  cat.p4decay_V = vSum;
245 
246  FinalState fps_temp;
247  FastJets jets(fps_temp, FastJets::ANTIKT, 0.4 );
248  jets.calc(hadrons);
249 
250  cat.jets25 = jets.jetsByPt( Cuts::pT > 25.0 );
251  cat.jets30 = jets.jetsByPt( Cuts::pT > 30.0 );
252 
253  // check that four mometum sum of all stable particles satisfies momentum consevation
254 /*
255  if ( sum.pt()>0.1 )
256  return error(cat,HTXS::MOMENTUM_CONSERVATION,"Four vector sum does not amount to pT=0, m=E=sqrt(s), but pT="+
257  std::to_string(sum.pt())+" GeV and m = "+std::to_string(sum.mass())+" GeV");
258 */
259  // check if V-boson was not included in the event record but decay particles were
260  // EFT contact interaction: return UNKNOWN for category but set all event/particle kinematics
261  if(is_uncatdV)
262  return error(cat,HTXS::VH_IDENTIFICATION,"Failed to identify associated V-boson!");
263 
264  /*****
265  * Step 4.
266  * Classify and save output
267  */
268 
269  // Apply the categorization categorization
270  cat.stage0_cat = getStage0Category(prodMode,cat.higgs,cat.V);
271  cat.stage1_cat_pTjet25GeV = getStage1Category(prodMode,cat.higgs,cat.jets25,cat.V);
272  cat.stage1_cat_pTjet30GeV = getStage1Category(prodMode,cat.higgs,cat.jets30,cat.V);
273  cat.errorCode = HTXS::SUCCESS; ++m_errorCount[HTXS::SUCCESS];
274 
275  return cat;
276  }
std::map< HTXS::ErrorCode, size_t > m_errorCount
bool isVH(HTXS::HiggsProdMode p)
Whether the Higgs is produced in association with a vector boson (VH)
failed to identify associated vector boson
successful classification
bool hasParent(const GenParticle *ptcl, int pdgID)
Checks whether the input particle has a parent with a given PDGID.
HTXS::Stage1::Category getStage1Category(const HTXS::HiggsProdMode prodMode, const Particle &higgs, const Jets &jets, const Particle &V)
Stage-1 categorization.
failed to identify Higgs boson decay products
def cat(path)
Definition: eostools.py:400
bool hasChild(const GenParticle *ptcl, int pdgID)
Checks whether the input particle has a child with a given PDGID.
bool quarkDecay(const Particle &p)
Return true is particle decays to quarks.
vector< PseudoJet > jets
Particle getLastInstance(Particle ptcl)
follow a "propagating" particle and return its last instance
failed to identify associated vector boson decay products
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
failed to identify Higgs boson
failed to identify hard scatter vertex
HTXS::Stage0::Category getStage0Category(const HTXS::HiggsProdMode prodMode, const Particle &higgs, const Particle &V)
Stage-0 HTXS categorization.
HiggsClassification error(HiggsClassification &cat, HTXS::ErrorCode err, std::string msg="", int NmaxWarnings=20)
Returns the classification object with the error code set. Prints an warning message, and keeps track of number of errors.
bool originateFrom(const Particle &p, const Particles &ptcls)
Whether particle p originate from any of the ptcls.
production mode not defined
Definition: event.py:1
failed to identify top decay
HiggsClassification Rivet::HiggsTemplateCrossSections::error ( HiggsClassification &  cat,
HTXS::ErrorCode  err,
std::string  msg = "",
int  NmaxWarnings = 20 
)
inline

Returns the classification object with the error code set. Prints an warning message, and keeps track of number of errors.

Definition at line 83 of file HiggsTemplateCrossSections.cc.

References eostools::cat(), m_errorCount, and mps_check::msg.

Referenced by argparse.ArgumentParser::_get_option_tuples(), python.rootplot.argparse.ArgumentParser::_get_option_tuples(), argparse.ArgumentParser::_parse_known_args(), python.rootplot.argparse.ArgumentParser::_parse_known_args(), argparse.ArgumentParser::_parse_optional(), python.rootplot.argparse.ArgumentParser::_parse_optional(), argparse.ArgumentParser::_read_args_from_files(), python.rootplot.argparse.ArgumentParser::_read_args_from_files(), argparse.ArgumentParser::add_subparsers(), python.rootplot.argparse.ArgumentParser::add_subparsers(), Page1Parser.Page1Parser::check_for_whole_start_tag(), classifyEvent(), argparse.ArgumentParser::parse_args(), python.rootplot.argparse.ArgumentParser::parse_args(), argparse.ArgumentParser::parse_known_args(), and python.rootplot.argparse.ArgumentParser::parse_known_args().

84  {
85  // Set the error, and keep statistics
86  cat.errorCode = err;
87  ++m_errorCount[err];
88 
89  // Print warning message to the screen/log
90  static int Nwarnings = 0;
91  if ( msg!="" && ++Nwarnings < NmaxWarnings )
92  MSG_WARNING(msg);
93 
94  return cat;
95  }
std::map< HTXS::ErrorCode, size_t > m_errorCount
def cat(path)
Definition: eostools.py:400
tuple msg
Definition: mps_check.py:277
void Rivet::HiggsTemplateCrossSections::finalize ( void  )
inlineoverride

Definition at line 493 of file HiggsTemplateCrossSections.cc.

References create_public_lumi_plots::hist, hist_deltay_jj, hist_dijet_mass, hist_Njets25, hist_Njets30, hist_pT_Higgs, hist_pT_Hjj, hist_pT_jet1, hist_pT_V, hist_stage0, hist_stage1_pTjet25, hist_stage1_pTjet30, hist_y_Higgs, m_sumw, printClassificationSummary(), and Scenarios_cff::scale.

493  {
495  double sf = m_sumw>0?1.0/m_sumw:1.0;
498  scale(hist, sf);
499  }
int Rivet::HiggsTemplateCrossSections::getBin ( double  x,
std::vector< double >  bins 
)
inline

Return bin index of x given the provided bin edges. 0=first bin, -1=underflow bin.

Definition at line 285 of file HiggsTemplateCrossSections.cc.

References mps_fire::i.

Referenced by BTagWeightCalculator.BTagWeightCalculator::calcJetWeightImpl(), and getStage1Category().

285  {
286  for (size_t i=1;i<bins.size();++i)
287  if (x<bins[i]) return i-1;
288  return bins.size()-1;
289  }
Particle Rivet::HiggsTemplateCrossSections::getLastInstance ( Particle  ptcl)
inline

follow a "propagating" particle and return its last instance

Definition at line 34 of file HiggsTemplateCrossSections.cc.

References hasChild().

Referenced by classifyEvent().

34  {
35  if ( ptcl.genParticle()->end_vertex() ) {
36  if ( !hasChild(ptcl.genParticle(),ptcl.pdgId()) ) return ptcl;
37  else return getLastInstance(ptcl.children()[0]);
38  }
39  return ptcl;
40  }
bool hasChild(const GenParticle *ptcl, int pdgID)
Checks whether the input particle has a child with a given PDGID.
Particle getLastInstance(Particle ptcl)
follow a "propagating" particle and return its last instance
HTXS::Stage0::Category Rivet::HiggsTemplateCrossSections::getStage0Category ( const HTXS::HiggsProdMode  prodMode,
const Particle higgs,
const Particle V 
)
inline

Stage-0 HTXS categorization.

Definition at line 305 of file HiggsTemplateCrossSections.cc.

References funct::abs(), HTXS::GG2ZH, HTXS::GGF, HTXS::QQ2ZH, quarkDecay(), HTXS::Stage0::VH2HQQ, HTXS::Stage0::VH2HQQ_FWDH, and HTXS::WH.

Referenced by classifyEvent().

307  {
308  using namespace HTXS::Stage0;
309  int ctrlHiggs = std::abs(higgs.rapidity())<2.5;
310  // Special cases first, qq→Hqq
311  if ( (prodMode==HTXS::WH||prodMode==HTXS::QQ2ZH) && quarkDecay(V) ) {
312  return ctrlHiggs ? VH2HQQ : VH2HQQ_FWDH;
313  } else if ( prodMode==HTXS::GG2ZH && quarkDecay(V) ) {
314  return Category(HTXS::GGF*10 + ctrlHiggs);
315  }
316  // General case after
317  return Category(prodMode*10 + ctrlHiggs);
318  }
bool quarkDecay(const Particle &p)
Return true is particle decays to quarks.
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
Namespace for Stage0 categorization.
HTXS::Stage1::Category Rivet::HiggsTemplateCrossSections::getStage1Category ( const HTXS::HiggsProdMode  prodMode,
const Particle higgs,
const Jets &  jets,
const Particle V 
)
inline

Stage-1 categorization.

Definition at line 321 of file HiggsTemplateCrossSections.cc.

References funct::abs(), HTXS::BBH, HTXS::Stage0::BBH_FWDH, getBin(), HTXS::Stage1::GG2H_0J, HTXS::Stage1::GG2H_1J_PTH_0_60, HTXS::Stage0::GG2H_FWDH, HTXS::Stage1::GG2H_GE2J_PTH_0_60, HTXS::Stage1::GG2H_VBFTOPO_JET3, HTXS::Stage1::GG2H_VBFTOPO_JET3VETO, HTXS::Stage0::GG2HLL_FWDH, HTXS::Stage1::GG2HLL_PTV_0_150, HTXS::Stage1::GG2HLL_PTV_GT150_0J, HTXS::Stage1::GG2HLL_PTV_GT150_GE1J, HTXS::GG2ZH, HTXS::GGF, isVH(), ResonanceBuilder::mass, ECF_cff::Njets, HTXS::Stage0::QQ2HLL_FWDH, HTXS::Stage1::QQ2HLL_PTV_0_150, HTXS::Stage1::QQ2HLL_PTV_150_250_0J, HTXS::Stage1::QQ2HLL_PTV_150_250_GE1J, HTXS::Stage1::QQ2HLL_PTV_GT250, HTXS::Stage0::QQ2HLNU_FWDH, HTXS::Stage1::QQ2HLNU_PTV_0_150, HTXS::Stage1::QQ2HLNU_PTV_150_250_0J, HTXS::Stage1::QQ2HLNU_PTV_150_250_GE1J, HTXS::Stage1::QQ2HLNU_PTV_GT250, HTXS::Stage1::QQ2HQQ_FWDH, HTXS::Stage1::QQ2HQQ_PTJET1_GT200, HTXS::Stage1::QQ2HQQ_REST, HTXS::Stage1::QQ2HQQ_VBFTOPO_JET3, HTXS::Stage1::QQ2HQQ_VBFTOPO_JET3VETO, HTXS::Stage1::QQ2HQQ_VH2JET, HTXS::QQ2ZH, quarkDecay(), HTXS::TH, HTXS::Stage0::TH_FWDH, HTXS::TTH, HTXS::Stage0::TTH_FWDH, pat::UNKNOWN, HTXS::VBF, vbfTopology(), and HTXS::WH.

Referenced by classifyEvent().

324  {
325  using namespace HTXS::Stage1;
326  int Njets=jets.size(), ctrlHiggs = std::abs(higgs.rapidity())<2.5, fwdHiggs = !ctrlHiggs;
327  double pTj1 = !jets.empty() ? jets[0].momentum().pt() : 0;
328  int vbfTopo = vbfTopology(jets,higgs);
329 
330  // 1. GGF Stage 1 categories
331  // Following YR4 write-up: XXXXX
332  if (prodMode==HTXS::GGF || (prodMode==HTXS::GG2ZH && quarkDecay(V)) ) {
333  if (fwdHiggs) return GG2H_FWDH;
334  if (Njets==0) return GG2H_0J;
335  else if (Njets==1) return Category(GG2H_1J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200}));
336  else if (Njets>=2) {
337  // events with pT_H>200 get priority over VBF cuts
338  if(higgs.pt()<=200){
339  if (vbfTopo==2) return GG2H_VBFTOPO_JET3VETO;
340  else if (vbfTopo==1) return GG2H_VBFTOPO_JET3;
341  }
342  // Njets >= 2jets without VBF topology
343  return Category(GG2H_GE2J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200}));
344  }
345  }
346  // 2. Electroweak qq->Hqq Stage 1 categories
347  else if (prodMode==HTXS::VBF || ( isVH(prodMode) && quarkDecay(V)) ) {
348  if (std::abs(higgs.rapidity())>2.5) return QQ2HQQ_FWDH;
349  if (pTj1>200) return QQ2HQQ_PTJET1_GT200;
350  if (vbfTopo==2) return QQ2HQQ_VBFTOPO_JET3VETO;
351  if (vbfTopo==1) return QQ2HQQ_VBFTOPO_JET3;
352  double mjj = jets.size()>1 ? (jets[0].mom()+jets[1].mom()).mass():0;
353  if ( 60 < mjj && mjj < 120 ) return QQ2HQQ_VH2JET;
354  return QQ2HQQ_REST;
355  }
356  // 3. WH->Hlv categories
357  else if (prodMode==HTXS::WH) {
358  if (fwdHiggs) return QQ2HLNU_FWDH;
359  else if (V.pt()<150) return QQ2HLNU_PTV_0_150;
360  else if (V.pt()>250) return QQ2HLNU_PTV_GT250;
361  // 150 < pTV/GeV < 250
363  }
364  // 4. qq->ZH->llH categories
365  else if (prodMode==HTXS::QQ2ZH) {
366  if (fwdHiggs) return QQ2HLL_FWDH;
367  else if (V.pt()<150) return QQ2HLL_PTV_0_150;
368  else if (V.pt()>250) return QQ2HLL_PTV_GT250;
369  // 150 < pTV/GeV < 250
371  }
372  // 5. gg->ZH->llH categories
373  else if (prodMode==HTXS::GG2ZH ) {
374  if (fwdHiggs) return GG2HLL_FWDH;
375  if (V.pt()<150) return GG2HLL_PTV_0_150;
376  else if (jets.empty()) return GG2HLL_PTV_GT150_0J;
377  return GG2HLL_PTV_GT150_GE1J;
378  }
379  // 6.ttH,bbH,tH categories
380  else if (prodMode==HTXS::TTH) return Category(TTH_FWDH+ctrlHiggs);
381  else if (prodMode==HTXS::BBH) return Category(BBH_FWDH+ctrlHiggs);
382  else if (prodMode==HTXS::TH ) return Category(TH_FWDH+ctrlHiggs);
383  return UNKNOWN;
384  }
int vbfTopology(const Jets &jets, const Particle &higgs)
VBF topolog selection 0 = fail loose selction: m_jj > 400 GeV and Dy_jj > 2.8 1 pass loose...
bool isVH(HTXS::HiggsProdMode p)
Whether the Higgs is produced in association with a vector boson (VH)
int getBin(double x, std::vector< double > bins)
Return bin index of x given the provided bin edges. 0=first bin, -1=underflow bin.
0: Unidentified isolated particle
Definition: ParticleCode.h:19
bool quarkDecay(const Particle &p)
Return true is particle decays to quarks.
vector< PseudoJet > jets
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool Rivet::HiggsTemplateCrossSections::hasChild ( const GenParticle *  ptcl,
int  pdgID 
)
inline

Checks whether the input particle has a child with a given PDGID.

Definition at line 61 of file HiggsTemplateCrossSections.cc.

Referenced by classifyEvent(), and getLastInstance().

61  {
62  for (auto child:Particle(*ptcl).children())
63  if (child.pdgId()==pdgID) return true;
64  return false;
65  }
bool Rivet::HiggsTemplateCrossSections::hasParent ( const GenParticle *  ptcl,
int  pdgID 
)
inline

Checks whether the input particle has a parent with a given PDGID.

Definition at line 68 of file HiggsTemplateCrossSections.cc.

References class-composition::parent, parents, and HadronAndPartonSelector_cfi::particles.

Referenced by classifyEvent().

68  {
69  for (auto parent:particles(ptcl->production_vertex(),HepMC::parents))
70  if (parent->pdg_id()==pdgID) return true;
71  return false;
72  }
TPRegexp parents
Definition: eve_filter.cc:21
void Rivet::HiggsTemplateCrossSections::init ( void  )
inlineoverride

default Rivet Analysis::init method Booking of histograms, initializing Rivet projection Extracts Higgs production mode from shell variable if not set manually using setHiggsProdMode

Definition at line 398 of file HiggsTemplateCrossSections.cc.

References HTXS::BBH, HTXS::GG2ZH, HTXS::GGF, initializeHistos(), m_HiggsProdMode, m_sumw, HTXS::QQ2ZH, HTXS::TH, HTXS::TTH, HTXS::UNKNOWN, HTXS::VBF, and HTXS::WH.

398  {
399  printf("==============================================================\n");
400  printf("======== HiggsTemplateCrossSections Initialization =========\n");
401  printf("==============================================================\n");
402  // check that the production mode has been set
403  // if running in standalone Rivet the production mode is set through an env variable
405  char *pm_env = getenv("HIGGSPRODMODE");
406  string pm(pm_env==nullptr?"":pm_env);
407  if ( pm == "GGF" ) m_HiggsProdMode = HTXS::GGF;
408  else if ( pm == "VBF" ) m_HiggsProdMode = HTXS::VBF;
409  else if ( pm == "WH" ) m_HiggsProdMode = HTXS::WH;
410  else if ( pm == "ZH" ) m_HiggsProdMode = HTXS::QQ2ZH;
411  else if ( pm == "QQ2ZH" ) m_HiggsProdMode = HTXS::QQ2ZH;
412  else if ( pm == "GG2ZH" ) m_HiggsProdMode = HTXS::GG2ZH;
413  else if ( pm == "TTH" ) m_HiggsProdMode = HTXS::TTH;
414  else if ( pm == "BBH" ) m_HiggsProdMode = HTXS::BBH;
415  else if ( pm == "TH" ) m_HiggsProdMode = HTXS::TH;
416  else {
417  MSG_WARNING("No HIGGSPRODMODE shell variable found. Needed when running Rivet stand-alone.");
418  }
419  }
420 
421  // Projections for final state particles
422  const FinalState FS;
423  addProjection(FS,"FS");
424 
425  // initialize the histograms with for each of the stages
427  m_sumw = 0.0;
428  printf("==============================================================\n");
429  printf("======== Higgs prod mode %d =========\n",m_HiggsProdMode);
430  printf("======== Sucessful Initialization =========\n");
431  printf("==============================================================\n");
432  }
void Rivet::HiggsTemplateCrossSections::initializeHistos ( )
inline

Definition at line 505 of file HiggsTemplateCrossSections.cc.

References hist_deltay_jj, hist_dijet_mass, hist_Njets25, hist_Njets30, hist_pT_Higgs, hist_pT_Hjj, hist_pT_jet1, hist_pT_V, hist_stage0, hist_stage1_pTjet25, hist_stage1_pTjet30, and hist_y_Higgs.

Referenced by init().

505  {
506  hist_stage0 = bookHisto1D("HTXS_stage0",20,0,20);
507  hist_stage1_pTjet25 = bookHisto1D("HTXS_stage1_pTjet25",40,0,40);
508  hist_stage1_pTjet30 = bookHisto1D("HTXS_stage1_pTjet30",40,0,40);
509  hist_pT_Higgs = bookHisto1D("pT_Higgs",80,0,400);
510  hist_y_Higgs = bookHisto1D("y_Higgs",80,-4,4);
511  hist_pT_V = bookHisto1D("pT_V",80,0,400);
512  hist_pT_jet1 = bookHisto1D("pT_jet1",80,0,400);
513  hist_deltay_jj = bookHisto1D("deltay_jj",50,0,10);
514  hist_dijet_mass = bookHisto1D("m_jj",50,0,2000);
515  hist_pT_Hjj = bookHisto1D("pT_Hjj",50,0,250);
516  hist_Njets25 = bookHisto1D("Njets25",10,0,10);
517  hist_Njets30 = bookHisto1D("Njets30",10,0,10);
518  }
bool Rivet::HiggsTemplateCrossSections::isVH ( HTXS::HiggsProdMode  p)
inline

Whether the Higgs is produced in association with a vector boson (VH)

Definition at line 302 of file HiggsTemplateCrossSections.cc.

References HTXS::GG2ZH, HTXS::QQ2ZH, and HTXS::WH.

Referenced by classifyEvent(), and getStage1Category().

bool Rivet::HiggsTemplateCrossSections::originateFrom ( const Particle p,
const Particles &  ptcls 
)
inline

Whether particle p originate from any of the ptcls.

Definition at line 43 of file HiggsTemplateCrossSections.cc.

References HadronAndPartonSelector_cfi::particles.

Referenced by classifyEvent(), and originateFrom().

43  {
44  const GenVertex* prodVtx = p.genParticle()->production_vertex();
45  if (prodVtx == nullptr) return false;
46  // for each ancestor, check if it matches any of the input particles
47  for (const auto & ancestor:particles(prodVtx, HepMC::ancestors)){
48  for ( auto part:ptcls )
49  if ( ancestor==part.genParticle() ) return true;
50  }
51  // if we get here, no ancetor matched any input particle
52  return false;
53  }
part
Definition: HCALResponse.h:20
bool Rivet::HiggsTemplateCrossSections::originateFrom ( const Particle p,
const Particle p2 
)
inline

Whether particle p originates from p2.

Definition at line 56 of file HiggsTemplateCrossSections.cc.

References originateFrom().

56  {
57  Particles ptcls = {p2}; return originateFrom(p,ptcls);
58  }
double p2[4]
Definition: TauolaWrapper.h:90
bool originateFrom(const Particle &p, const Particles &ptcls)
Whether particle p originate from any of the ptcls.
void Rivet::HiggsTemplateCrossSections::printClassificationSummary ( )
inline

Definition at line 471 of file HiggsTemplateCrossSections.cc.

References HTXS::HIGGS_IDENTIFICATION, HTXS::HS_VTX_IDENTIFICATION, m_errorCount, HTXS::MOMENTUM_CONSERVATION, simpleEdmComparison::numEvents, HTXS::PRODMODE_DEFINED, HTXS::SUCCESS, HTXS::TOP_W_IDENTIFICATION, and HTXS::VH_IDENTIFICATION.

Referenced by finalize().

471  {
472  MSG_INFO (" ====================================================== ");
473  MSG_INFO (" Higgs Template X-Sec Categorization Tool ");
474  MSG_INFO (" Status Code Summary ");
475  MSG_INFO (" ====================================================== ");
476  bool allSuccess = (numEvents()==m_errorCount[HTXS::SUCCESS]);
477  if ( allSuccess ) MSG_INFO (" >>>> All "<< m_errorCount[HTXS::SUCCESS] <<" events successfully categorized!");
478  else{
479  MSG_INFO (" >>>> "<< m_errorCount[HTXS::SUCCESS] <<" events successfully categorized");
480  MSG_INFO (" >>>> --> the following errors occured:");
481  MSG_INFO (" >>>> "<< m_errorCount[HTXS::PRODMODE_DEFINED] <<" had an undefined Higgs production mode.");
482  MSG_INFO (" >>>> "<< m_errorCount[HTXS::MOMENTUM_CONSERVATION] <<" failed momentum conservation.");
483  MSG_INFO (" >>>> "<< m_errorCount[HTXS::HIGGS_IDENTIFICATION] <<" failed to identify a valid Higgs boson.");
484  MSG_INFO (" >>>> "<< m_errorCount[HTXS::HS_VTX_IDENTIFICATION] <<" failed to identify the hard scatter vertex.");
485  MSG_INFO (" >>>> "<< m_errorCount[HTXS::VH_IDENTIFICATION] <<" VH: to identify a valid V-boson.");
486  MSG_INFO (" >>>> "<< m_errorCount[HTXS::TOP_W_IDENTIFICATION] <<" failed to identify valid Ws from top decay.");
487  }
488  MSG_INFO (" ====================================================== ");
489  MSG_INFO (" ====================================================== ");
490  }
std::map< HTXS::ErrorCode, size_t > m_errorCount
failed to identify associated vector boson
successful classification
failed momentum conservation
failed to identify Higgs boson
failed to identify hard scatter vertex
production mode not defined
failed to identify top decay
bool Rivet::HiggsTemplateCrossSections::quarkDecay ( const Particle p)
inline

Return true is particle decays to quarks.

Definition at line 75 of file HiggsTemplateCrossSections.cc.

Referenced by classifyEvent(), getStage0Category(), and getStage1Category().

75  {
76  for (auto child:p.children())
77  if (PID::isQuark(child.pdgId())) return true;
78  return false;
79  }
void Rivet::HiggsTemplateCrossSections::setHiggsProdMode ( HTXS::HiggsProdMode  prodMode)
inline

Sets the Higgs production mode.

Definition at line 393 of file HiggsTemplateCrossSections.cc.

References m_HiggsProdMode.

393 { m_HiggsProdMode = prodMode; }
int Rivet::HiggsTemplateCrossSections::vbfTopology ( const Jets &  jets,
const Particle higgs 
)
inline

VBF topolog selection 0 = fail loose selction: m_jj > 400 GeV and Dy_jj > 2.8 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass tight selection.

Definition at line 294 of file HiggsTemplateCrossSections.cc.

References funct::abs(), ResonanceBuilder::mass, and EnergyCorrector::pt.

Referenced by getStage1Category().

294  {
295  if (jets.size()<2) return 0;
296  const FourMomentum &j1=jets[0].momentum(), &j2=jets[1].momentum();
297  bool VBFtopo = (j1+j2).mass() > 400.0 && std::abs(j1.rapidity()-j2.rapidity()) > 2.8;
298  return VBFtopo ? (j1+j2+higgs.momentum()).pt()<25 ? 2 : 1 : 0;
299  }
vector< PseudoJet > jets
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

Member Data Documentation

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_deltay_jj
private

Definition at line 533 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_dijet_mass
private

Definition at line 533 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_Njets25
private

Definition at line 534 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_Njets30
private

Definition at line 534 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_pT_Higgs
private

Definition at line 531 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_pT_Hjj
private

Definition at line 533 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_pT_jet1
private

Definition at line 532 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_pT_V
private

Definition at line 532 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_stage0
private

Definition at line 529 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_stage1_pTjet25
private

Definition at line 530 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_stage1_pTjet30
private

Definition at line 530 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_y_Higgs
private

Definition at line 531 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and initializeHistos().

std::map<HTXS::ErrorCode,size_t> Rivet::HiggsTemplateCrossSections::m_errorCount
private

Definition at line 528 of file HiggsTemplateCrossSections.cc.

Referenced by classifyEvent(), error(), and printClassificationSummary().

HTXS::HiggsProdMode Rivet::HiggsTemplateCrossSections::m_HiggsProdMode
private

Definition at line 527 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), classifyEvent(), init(), and setHiggsProdMode().

double Rivet::HiggsTemplateCrossSections::m_sumw
private

Definition at line 526 of file HiggsTemplateCrossSections.cc.

Referenced by analyze(), finalize(), and init().