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...
 
int vbfTopology_Stage1_1 (const Jets &jets, const Particle &higgs)
 VBF topology selection Stage1.1 0 = fail loose selection: m_jj > 350 GeV 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass pT(Hjj)>25 selection 3 pass tight (m_jj>700 GeV), but fail additional cut pT(Hjj)<25. 4 pass pT(Hjj)>25 selection. More...
 
int vbfTopology_Stage1_1_Fine (const Jets &jets, const Particle &higgs)
 VBF topology selection for Stage1.1 Fine 0 = fail loose selection: m_jj > 350 GeV 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass pT(Hjj)>25 selection 3 pass 700<m_jj<1000 GeV, but fail additional cut pT(Hjj)<25. 4 pass pT(Hjj)>25 selection 5 pass 1000<m_jj<1500 GeV, but fail additional cut pT(Hjj)<25. 6 pass pT(Hjj)>25 selection 7 pass m_jj>1500 GeV, but fail additional cut pT(Hjj)<25. 8 pass pT(Hjj)>25 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...
 
HTXS::Stage1_1::Category getStage1_1_Category (const HTXS::HiggsProdMode prodMode, const Particle &higgs, const Jets &jets, const Particle &V)
 Stage-1.1 categorization. More...
 
HTXS::Stage1_1_Fine::Category getStage1_1_Fine_Category (const HTXS::HiggsProdMode prodMode, const Particle &higgs, const Jets &jets, const Particle &V)
 Stage-1_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 21 of file HiggsTemplateCrossSections.cc.

Constructor & Destructor Documentation

Rivet::HiggsTemplateCrossSections::HiggsTemplateCrossSections ( )
inline

Definition at line 24 of file HiggsTemplateCrossSections.cc.

25  : Analysis("HiggsTemplateCrossSections"),

Member Function Documentation

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

Definition at line 630 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.

630  {
631 
632  // get the classification
633  HiggsClassification cat = classifyEvent(event,m_HiggsProdMode);
634 
635  // Fill histograms: categorization --> linerize the categories
636  const double weight = event.weight();
637  m_sumw += weight;
638 
639  int F=cat.stage0_cat%10, P=cat.stage1_cat_pTjet30GeV/100;
640  hist_stage0->fill( cat.stage0_cat/10*2+F, weight );
641 
642  // Stage 1 enum offsets for each production mode: GGF=12, VBF=6, WH= 5, QQ2ZH=5, GG2ZH=4, TTH=2, BBH=2, TH=2
643  vector<int> offset({0,1,13,19,24,29,33,35,37,39});
644  int off = offset[P];
645  hist_stage1_pTjet25->fill(cat.stage1_cat_pTjet25GeV%100 + off, weight);
646  hist_stage1_pTjet30->fill(cat.stage1_cat_pTjet30GeV%100 + off, weight);
647 
648  // Fill histograms: variables used in the categorization
649  hist_pT_Higgs->fill(cat.higgs.pT(),weight);
650  hist_y_Higgs->fill(cat.higgs.rapidity(),weight);
651  hist_pT_V->fill(cat.V.pT(),weight);
652 
653  hist_Njets25->fill(cat.jets25.size(),weight);
654  hist_Njets30->fill(cat.jets30.size(),weight);
655 
656  // Jet variables. Use jet collection with pT threshold at 30 GeV
657  if (!cat.jets30.empty()) hist_pT_jet1->fill(cat.jets30[0].pt(),weight);
658  if (cat.jets30.size()>=2) {
659  const FourMomentum &j1 = cat.jets30[0].momentum(), &j2 = cat.jets30[1].momentum();
660  hist_deltay_jj->fill(std::abs(j1.rapidity()-j2.rapidity()),weight);
661  hist_dijet_mass->fill((j1+j2).mass(),weight);
662  hist_pT_Hjj->fill((j1+j2+cat.higgs.momentum()).pt(),weight);
663  }
664  }
Definition: weight.py:1
def cat(path)
Definition: eostools.py:401
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 101 of file HiggsTemplateCrossSections.cc.

References eostools::cat(), class-composition::child, class-composition::children, error(), event(), getLastInstance(), getStage0Category(), getStage1_1_Category(), getStage1_1_Fine_Category(), 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::Stage1_1::UNKNOWN, HTXS::Stage1_1_Fine::UNKNOWN, HTXS::VH_DECAY_IDENTIFICATION, HTXS::VH_IDENTIFICATION, and HTXS::WH.

Referenced by analyze().

101  {
102 
104 
105  // the classification object
106  HiggsClassification cat;
107  cat.prodMode = prodMode;
108  cat.errorCode = HTXS::UNDEFINED;
109  cat.stage0_cat = HTXS::Stage0::UNKNOWN;
110  cat.stage1_cat_pTjet25GeV = HTXS::Stage1::UNKNOWN;
111  cat.stage1_cat_pTjet30GeV = HTXS::Stage1::UNKNOWN;
112  cat.stage1_1_cat_pTjet25GeV = HTXS::Stage1_1::UNKNOWN;
113  cat.stage1_1_cat_pTjet30GeV = HTXS::Stage1_1::UNKNOWN;
114  cat.stage1_1_fine_cat_pTjet25GeV = HTXS::Stage1_1_Fine::UNKNOWN;
115  cat.stage1_1_fine_cat_pTjet30GeV = HTXS::Stage1_1_Fine::UNKNOWN;
116 
117  if (prodMode == HTXS::UNKNOWN)
118  return error(cat,HTXS::PRODMODE_DEFINED,
119  "Unkown Higgs production mechanism. Cannot classify event."
120  " Classification for all events will most likely fail.");
121 
122  /*****
123  * Step 1.
124  * Idenfify the Higgs boson and the hard scatter vertex
125  * There should be only one of each.
126  */
127 
128  GenVertex *HSvtx = event.genEvent()->signal_process_vertex();
129  int Nhiggs=0;
130  for ( const GenParticle *ptcl : Rivet::particles(event.genEvent()) ) {
131 
132  // a) Reject all non-Higgs particles
133  if ( !PID::isHiggs(ptcl->pdg_id()) ) continue;
134  // b) select only the final Higgs boson copy, prior to decay
135  if ( ptcl->end_vertex() && !hasChild(ptcl,PID::HIGGS) ) {
136  cat.higgs = Particle(ptcl); ++Nhiggs;
137  }
138  // c) if HepMC::signal_proces_vertex is missing
139  // set hard-scatter vertex based on first Higgs boson
140  if ( HSvtx==nullptr && ptcl->production_vertex() && !hasParent(ptcl,PID::HIGGS) )
141  HSvtx = ptcl->production_vertex();
142  }
143 
144  // Make sure things are in order so far
145  if (Nhiggs!=1)
147  "Current event has "+std::to_string(Nhiggs)+" Higgs bosons. There must be only one.");
148  if (cat.higgs.children().size()<2)
150  "Could not identify Higgs boson decay products.");
151 
152  if (HSvtx == nullptr)
153  return error(cat,HTXS::HS_VTX_IDENTIFICATION,"Cannot find hard-scatter vertex of current event.");
154 
155  /*****
156  * Step 2.
157  * Identify associated vector bosons
158  */
159 
160  // Find associated vector bosons
161  bool is_uncatdV = false;
162  Particles uncatV_decays;
163  FourMomentum uncatV_p4(0,0,0,0);
164  FourVector uncatV_v4(0,0,0,0);
165  int nWs=0, nZs=0, nTop=0;
166  if ( isVH(prodMode) ) {
167  for (auto ptcl:particles(HSvtx,HepMC::children)) {
168  if (PID::isW(ptcl->pdg_id())) { ++nWs; cat.V=Particle(ptcl); }
169  if (PID::isZ(ptcl->pdg_id())) { ++nZs; cat.V=Particle(ptcl); }
170  }
171  if(nWs+nZs>0) cat.V = getLastInstance(cat.V);
172  else {
173  for (auto ptcl:particles(HSvtx,HepMC::children)) {
174  if (!PID::isHiggs(ptcl->pdg_id())) {
175  uncatV_decays += Particle(ptcl);
176  uncatV_p4 += Particle(ptcl).momentum();
177  // uncatV_v4 += Particle(ptcl).origin();
178  }
179  }
180  // is_uncatdV = true; cat.V = Particle(24,uncatV_p4,uncatV_v4);
181  is_uncatdV = true; cat.V = Particle(24,uncatV_p4);
182  }
183  }
184 
185  if ( !is_uncatdV ){
186 
187  if ( isVH(prodMode) && !cat.V.genParticle()->end_vertex() )
188  return error(cat,HTXS::VH_DECAY_IDENTIFICATION,"Vector boson does not decay!");
189 
190  if ( isVH(prodMode) && cat.V.children().size()<2 )
191  return error(cat,HTXS::VH_DECAY_IDENTIFICATION,"Vector boson does not decay!");
192 
193  if ( ( prodMode==HTXS::WH && (nZs>0||nWs!=1) ) ||
194  ( (prodMode==HTXS::QQ2ZH||prodMode==HTXS::GG2ZH) && (nZs!=1||nWs>0) ) )
195  return error(cat,HTXS::VH_IDENTIFICATION,"Found "+std::to_string(nWs)+" W-bosons and "+
196  std::to_string(nZs)+" Z-bosons. Inconsitent with VH expectation.");
197  }
198 
199  // Find and store the W-bosons from ttH->WbWbH
200  Particles Ws;
201  if ( prodMode==HTXS::TTH || prodMode==HTXS::TH ){
202  // loop over particles produced in hard-scatter vertex
203  for ( auto ptcl : particles(HSvtx,HepMC::children) ) {
204  if ( !PID::isTop(ptcl->pdg_id()) ) continue;
205  ++nTop;
206  Particle top = getLastInstance(Particle(ptcl));
207  if ( top.genParticle()->end_vertex() )
208  for (auto child:top.children())
209  if ( PID::isW(child.pdgId()) ) Ws += child;
210  }
211  }
212 
213  // Make sure result make sense
214  if ( (prodMode==HTXS::TTH && Ws.size()<2) || (prodMode==HTXS::TH && Ws.empty() ) )
215  return error(cat,HTXS::TOP_W_IDENTIFICATION,"Failed to identify W-boson(s) from t-decay!");
216 
217  /*****
218  * Step 3.
219  * Build jets
220  * Make sure all stable particles are present
221  */
222 
223  // Create a list of the vector bosons that decay leptonically
224  // Either the vector boson produced in association with the Higgs boson,
225  // or the ones produced from decays of top quarks produced with the Higgs
226  Particles leptonicVs;
227  if ( !is_uncatdV ){
228  if ( isVH(prodMode) && !quarkDecay(cat.V) ) leptonicVs += cat.V;
229  }else leptonicVs = uncatV_decays;
230  for ( auto W:Ws ) if ( W.genParticle()->end_vertex() && !quarkDecay(W) ) leptonicVs += W;
231 
232  // Obtain all stable, final-state particles
233  const ParticleVector FS = applyProjection<FinalState>(event, "FS").particles();
234  Particles hadrons;
235  FourMomentum sum(0,0,0,0), vSum(0,0,0,0), hSum(0,0,0,0);
236  for ( const Particle &p : FS ) {
237  // Add up the four momenta of all stable particles as a cross check
238  sum += p.momentum();
239  // ignore particles from the Higgs boson
240  if ( originateFrom(p,cat.higgs) ) { hSum += p.momentum(); continue; }
241  // Cross-check the V decay products for VH
242  if ( isVH(prodMode) && !is_uncatdV && originateFrom(p,Ws) ) vSum += p.momentum();
243  // ignore final state particles from leptonic V decays
244  if ( !leptonicVs.empty() && originateFrom(p,leptonicVs) ) continue;
245  // All particles reaching here are considered hadrons and will be used to build jets
246  hadrons += p;
247  }
248 
249  cat.p4decay_higgs = hSum;
250  cat.p4decay_V = vSum;
251 
252  FinalState fps_temp;
253  FastJets jets(fps_temp, FastJets::ANTIKT, 0.4 );
254  jets.calc(hadrons);
255 
256  cat.jets25 = jets.jetsByPt( Cuts::pT > 25.0 );
257  cat.jets30 = jets.jetsByPt( Cuts::pT > 30.0 );
258 
259  // check that four mometum sum of all stable particles satisfies momentum consevation
260 /*
261  if ( sum.pt()>0.1 )
262  return error(cat,HTXS::MOMENTUM_CONSERVATION,"Four vector sum does not amount to pT=0, m=E=sqrt(s), but pT="+
263  std::to_string(sum.pt())+" GeV and m = "+std::to_string(sum.mass())+" GeV");
264 */
265  // check if V-boson was not included in the event record but decay particles were
266  // EFT contact interaction: return UNKNOWN for category but set all event/particle kinematics
267  if(is_uncatdV)
268  return error(cat,HTXS::VH_IDENTIFICATION,"Failed to identify associated V-boson!");
269 
270  /*****
271  * Step 4.
272  * Classify and save output
273  */
274 
275  // Apply the categorization categorization
276  cat.stage0_cat = getStage0Category(prodMode,cat.higgs,cat.V);
277  cat.stage1_cat_pTjet25GeV = getStage1Category(prodMode,cat.higgs,cat.jets25,cat.V);
278  cat.stage1_cat_pTjet30GeV = getStage1Category(prodMode,cat.higgs,cat.jets30,cat.V);
279  cat.stage1_1_cat_pTjet25GeV = getStage1_1_Category(prodMode,cat.higgs,cat.jets25,cat.V);
280  cat.stage1_1_cat_pTjet30GeV = getStage1_1_Category(prodMode,cat.higgs,cat.jets30,cat.V);
281  cat.stage1_1_fine_cat_pTjet25GeV = getStage1_1_Fine_Category(prodMode,cat.higgs,cat.jets25,cat.V);
282  cat.stage1_1_fine_cat_pTjet30GeV = getStage1_1_Fine_Category(prodMode,cat.higgs,cat.jets30,cat.V);
283 
284  cat.errorCode = HTXS::SUCCESS; ++m_errorCount[HTXS::SUCCESS];
285 
286  return cat;
287  }
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
HTXS::Stage1_1::Category getStage1_1_Category(const HTXS::HiggsProdMode prodMode, const Particle &higgs, const Jets &jets, const Particle &V)
Stage-1.1 categorization.
def cat(path)
Definition: eostools.py:401
HTXS::Stage1_1_Fine::Category getStage1_1_Fine_Category(const HTXS::HiggsProdMode prodMode, const Particle &higgs, const Jets &jets, const Particle &V)
Stage-1_1 categorization.
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 85 of file HiggsTemplateCrossSections.cc.

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

Referenced by Page1Parser.Page1Parser::check_for_whole_start_tag(), and classifyEvent().

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

Definition at line 688 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.

688  {
690  double sf = m_sumw>0?1.0/m_sumw:1.0;
693  scale(hist, sf);
694  }
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 296 of file HiggsTemplateCrossSections.cc.

References mps_fire::i.

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

296  {
297  for (size_t i=1;i<bins.size();++i)
298  if (x<bins[i]) return i-1;
299  return bins.size()-1;
300  }
Particle Rivet::HiggsTemplateCrossSections::getLastInstance ( Particle  ptcl)
inline

follow a "propagating" particle and return its last instance

Definition at line 36 of file HiggsTemplateCrossSections.cc.

References hasChild().

Referenced by classifyEvent().

36  {
37  if ( ptcl.genParticle()->end_vertex() ) {
38  if ( !hasChild(ptcl.genParticle(),ptcl.pdgId()) ) return ptcl;
39  else return getLastInstance(ptcl.children()[0]);
40  }
41  return ptcl;
42  }
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 346 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().

348  {
349  using namespace HTXS::Stage0;
350  int ctrlHiggs = std::abs(higgs.rapidity())<2.5;
351  // Special cases first, qq→Hqq
352  if ( (prodMode==HTXS::WH||prodMode==HTXS::QQ2ZH) && quarkDecay(V) ) {
353  return ctrlHiggs ? VH2HQQ : VH2HQQ_FWDH;
354  } else if ( prodMode==HTXS::GG2ZH && quarkDecay(V) ) {
355  return Category(HTXS::GGF*10 + ctrlHiggs);
356  }
357  // General case after
358  return Category(prodMode*10 + ctrlHiggs);
359  }
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_1::Category Rivet::HiggsTemplateCrossSections::getStage1_1_Category ( const HTXS::HiggsProdMode  prodMode,
const Particle higgs,
const Jets &  jets,
const Particle V 
)
inline

Stage-1.1 categorization.

Definition at line 428 of file HiggsTemplateCrossSections.cc.

References funct::abs(), HTXS::BBH, HTXS::Stage0::BBH_FWDH, getBin(), HTXS::Stage1_1::GG2H_0J_PTH_0_10, HTXS::Stage1_1::GG2H_0J_PTH_GT10, HTXS::Stage1::GG2H_1J_PTH_0_60, HTXS::Stage0::GG2H_FWDH, HTXS::Stage1_1::GG2H_GE2J_MJJ_0_350_PTH_0_60, HTXS::Stage1_1::GG2H_MJJ_350_700_PTHJJ_0_25, HTXS::Stage1_1::GG2H_PTH_GT200, HTXS::Stage0::GG2HLL_FWDH, HTXS::Stage1_1::GG2HLL_PTV_0_75, HTXS::Stage1_1::GG2HLL_PTV_150_250_0J, HTXS::Stage1_1::GG2HLL_PTV_150_250_GE1J, HTXS::Stage1_1::GG2HLL_PTV_75_150, HTXS::Stage1_1::GG2HLL_PTV_GT250, HTXS::GG2ZH, HTXS::GGF, isVH(), ResonanceBuilder::mass, ECF_cff::Njets, HTXS::Stage0::QQ2HLL_FWDH, HTXS::Stage1_1::QQ2HLL_PTV_0_75, HTXS::Stage1::QQ2HLL_PTV_150_250_0J, HTXS::Stage1::QQ2HLL_PTV_150_250_GE1J, HTXS::Stage1_1::QQ2HLL_PTV_75_150, HTXS::Stage1::QQ2HLL_PTV_GT250, HTXS::Stage0::QQ2HLNU_FWDH, HTXS::Stage1_1::QQ2HLNU_PTV_0_75, HTXS::Stage1::QQ2HLNU_PTV_150_250_0J, HTXS::Stage1::QQ2HLNU_PTV_150_250_GE1J, HTXS::Stage1_1::QQ2HLNU_PTV_75_150, HTXS::Stage1::QQ2HLNU_PTV_GT250, HTXS::Stage1_1::QQ2HQQ_0J, HTXS::Stage1_1::QQ2HQQ_1J, HTXS::Stage1::QQ2HQQ_FWDH, HTXS::Stage1_1::QQ2HQQ_MJJ_0_60, HTXS::Stage1_1::QQ2HQQ_MJJ_120_350, HTXS::Stage1_1::QQ2HQQ_MJJ_60_120, HTXS::Stage1_1::QQ2HQQ_MJJ_GT350_PTH_GT200, HTXS::QQ2ZH, quarkDecay(), HTXS::TH, HTXS::Stage0::TH_FWDH, HTXS::TTH, HTXS::Stage0::TTH_FWDH, pat::UNKNOWN, HTXS::VBF, vbfTopology_Stage1_1(), and HTXS::WH.

Referenced by classifyEvent().

431  {
432  using namespace HTXS::Stage1_1;
433  int Njets=jets.size(), ctrlHiggs = std::abs(higgs.rapidity())<2.5, fwdHiggs = !ctrlHiggs;
434  int vbfTopo = vbfTopology_Stage1_1(jets,higgs);
435 
436  // 1. GGF Stage 1 categories
437  // Following YR4 write-up: XXXXX
438  if (prodMode==HTXS::GGF || (prodMode==HTXS::GG2ZH && quarkDecay(V)) ) {
439  if (fwdHiggs) return GG2H_FWDH;
440  if ( higgs.pt()>200 ) return GG2H_PTH_GT200;
441  if (Njets==0) return higgs.pt()<10 ? GG2H_0J_PTH_0_10 : GG2H_0J_PTH_GT10;
442  if (Njets==1) return Category(GG2H_1J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200}));
443  if (Njets>1){
444  //VBF topology
445  if(vbfTopo) return Category(GG2H_MJJ_350_700_PTHJJ_0_25+vbfTopo-1);
446  //Njets >= 2jets without VBF topology (mjj<350)
447  return Category(GG2H_GE2J_MJJ_0_350_PTH_0_60+getBin(higgs.pt(),{0,60,120,200}));
448  }
449  }
450 
451  // 2. Electroweak qq->Hqq Stage 1.1 categories
452  else if (prodMode==HTXS::VBF || ( isVH(prodMode) && quarkDecay(V)) ) {
453  if (std::abs(higgs.rapidity())>2.5) return QQ2HQQ_FWDH;
454  int Njets=jets.size();
455  if (Njets==0) return QQ2HQQ_0J;
456  else if (Njets==1) return QQ2HQQ_1J;
457  else if (Njets>=2) {
458  double mjj = (jets[0].mom()+jets[1].mom()).mass();
459  if ( mjj < 60 ) return QQ2HQQ_MJJ_0_60;
460  else if ( 60 < mjj && mjj < 120 ) return QQ2HQQ_MJJ_60_120;
461  else if ( 120 < mjj && mjj < 350 ) return QQ2HQQ_MJJ_120_350;
462  else if ( mjj > 350 ) {
463  if (higgs.pt()>200) return QQ2HQQ_MJJ_GT350_PTH_GT200;
464  if(vbfTopo) return Category(QQ2HQQ_MJJ_GT350_PTH_GT200+vbfTopo);
465  }
466  }
467  }
468  // 3. WH->Hlv categories
469  else if (prodMode==HTXS::WH) {
470  if (fwdHiggs) return QQ2HLNU_FWDH;
471  else if (V.pt()<75) return QQ2HLNU_PTV_0_75;
472  else if (V.pt()<150) return QQ2HLNU_PTV_75_150;
473  else if (V.pt()>250) return QQ2HLNU_PTV_GT250;
474  // 150 < pTV/GeV < 250
476  }
477  // 4. qq->ZH->llH categories
478  else if (prodMode==HTXS::QQ2ZH) {
479  if (fwdHiggs) return QQ2HLL_FWDH;
480  else if (V.pt()<75) return QQ2HLL_PTV_0_75;
481  else if (V.pt()<150) return QQ2HLL_PTV_75_150;
482  else if (V.pt()>250) return QQ2HLL_PTV_GT250;
483  // 150 < pTV/GeV < 250
485  }
486  // 5. gg->ZH->llH categories
487  else if (prodMode==HTXS::GG2ZH ) {
488  if (fwdHiggs) return GG2HLL_FWDH;
489  else if (V.pt()<75) return GG2HLL_PTV_0_75;
490  else if (V.pt()<150) return GG2HLL_PTV_75_150;
491  else if (V.pt()>250) return GG2HLL_PTV_GT250;
493  }
494  // 6.ttH,bbH,tH categories
495  else if (prodMode==HTXS::TTH) return Category(TTH_FWDH+ctrlHiggs);
496  else if (prodMode==HTXS::BBH) return Category(BBH_FWDH+ctrlHiggs);
497  else if (prodMode==HTXS::TH ) return Category(TH_FWDH+ctrlHiggs);
498  return UNKNOWN;
499  }
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.
int vbfTopology_Stage1_1(const Jets &jets, const Particle &higgs)
VBF topology selection Stage1.1 0 = fail loose selection: m_jj > 350 GeV 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass pT(Hjj)>25 selection 3 pass tight (m_jj>700 GeV), but fail additional cut pT(Hjj)<25. 4 pass pT(Hjj)>25 selection.
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
HTXS::Stage1_1_Fine::Category Rivet::HiggsTemplateCrossSections::getStage1_1_Fine_Category ( const HTXS::HiggsProdMode  prodMode,
const Particle higgs,
const Jets &  jets,
const Particle V 
)
inline

Stage-1_1 categorization.

Definition at line 502 of file HiggsTemplateCrossSections.cc.

References funct::abs(), HTXS::BBH, HTXS::Stage0::BBH_FWDH, getBin(), HTXS::Stage1_1::GG2H_0J_PTH_0_10, HTXS::Stage1_1::GG2H_0J_PTH_GT10, HTXS::Stage1::GG2H_1J_PTH_0_60, HTXS::Stage0::GG2H_FWDH, HTXS::Stage1_1_Fine::GG2H_GE2J_MJJ_0_350_PTH_0_60_PTHJJ_0_25, HTXS::Stage1_1_Fine::GG2H_GE2J_MJJ_0_350_PTH_0_60_PTHJJ_GT25, HTXS::Stage1_1::GG2H_MJJ_350_700_PTHJJ_0_25, HTXS::Stage1_1::GG2H_PTH_GT200, HTXS::Stage0::GG2HLL_FWDH, HTXS::Stage1_1_Fine::GG2HLL_PTV_0_75_0J, HTXS::Stage1_1_Fine::GG2HLL_PTV_0_75_1J, HTXS::Stage1_1_Fine::GG2HLL_PTV_0_75_GE2J, HTXS::GG2ZH, HTXS::GGF, isVH(), ResonanceBuilder::mass, ECF_cff::Njets, EnergyCorrector::pt, HTXS::Stage0::QQ2HLL_FWDH, HTXS::Stage1_1_Fine::QQ2HLL_PTV_0_75_0J, HTXS::Stage1_1_Fine::QQ2HLL_PTV_0_75_1J, HTXS::Stage1_1_Fine::QQ2HLL_PTV_0_75_GE2J, HTXS::Stage0::QQ2HLNU_FWDH, HTXS::Stage1_1_Fine::QQ2HLNU_PTV_0_75_0J, HTXS::Stage1_1_Fine::QQ2HLNU_PTV_0_75_1J, HTXS::Stage1_1_Fine::QQ2HLNU_PTV_0_75_GE2J, HTXS::Stage1_1::QQ2HQQ_0J, HTXS::Stage1_1::QQ2HQQ_1J, HTXS::Stage1::QQ2HQQ_FWDH, HTXS::Stage1_1_Fine::QQ2HQQ_MJJ_0_60_PTHJJ_0_25, HTXS::Stage1_1_Fine::QQ2HQQ_MJJ_0_60_PTHJJ_GT25, HTXS::Stage1_1::QQ2HQQ_MJJ_350_700_PTHJJ_0_25, HTXS::Stage1_1_Fine::QQ2HQQ_PTH_GT200_MJJ_350_700_PTHJJ_0_25, HTXS::QQ2ZH, quarkDecay(), HTXS::TH, HTXS::Stage0::TH_FWDH, HTXS::TTH, HTXS::Stage0::TTH_FWDH, pat::UNKNOWN, HTXS::VBF, vbfTopology_Stage1_1_Fine(), and HTXS::WH.

Referenced by classifyEvent().

505  {
506  using namespace HTXS::Stage1_1_Fine;
507  int Njets=jets.size(), ctrlHiggs = std::abs(higgs.rapidity())<2.5, fwdHiggs = !ctrlHiggs;
508  int vbfTopo = vbfTopology_Stage1_1_Fine(jets,higgs);
509 
510  // 1. GGF Stage 1.1 categories
511  // Following YR4 write-up: XXXXX
512  if (prodMode==HTXS::GGF || (prodMode==HTXS::GG2ZH && quarkDecay(V)) ) {
513  if (fwdHiggs) return GG2H_FWDH;
514  if ( higgs.pt()>200 ) return GG2H_PTH_GT200;
515  if (Njets==0) return higgs.pt()<10 ? GG2H_0J_PTH_0_10 : GG2H_0J_PTH_GT10;
516  if (Njets==1) return Category(GG2H_1J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200}));
517  if (Njets>1){
518  //double mjj = (jets[0].mom()+jets[1].mom()).mass();
519  double pTHjj = (jets[0].momentum()+jets[1].momentum()+higgs.momentum()).pt();
520  //VBF topology
521  if(vbfTopo) return Category(GG2H_MJJ_350_700_PTHJJ_0_25+vbfTopo-1);
522  //Njets >= 2jets without VBF topology (mjj<350)
523  if (pTHjj<25) return Category(GG2H_GE2J_MJJ_0_350_PTH_0_60_PTHJJ_0_25+getBin(higgs.pt(),{0,60,120,200}));
524  else return Category(GG2H_GE2J_MJJ_0_350_PTH_0_60_PTHJJ_GT25+getBin(higgs.pt(),{0,60,120,200}));
525  }
526  }
527 
528  // 2. Electroweak qq->Hqq Stage 1.1 categories
529  else if (prodMode==HTXS::VBF || ( isVH(prodMode) && quarkDecay(V)) ) {
530  if (std::abs(higgs.rapidity())>2.5) return QQ2HQQ_FWDH;
531  int Njets=jets.size();
532  if (Njets==0) return QQ2HQQ_0J;
533  else if (Njets==1) return QQ2HQQ_1J;
534  else if (Njets>=2) {
535  double mjj = (jets[0].mom()+jets[1].mom()).mass();
536  double pTHjj = (jets[0].momentum()+jets[1].momentum()+higgs.momentum()).pt();
537  if (mjj<350){
538  if (pTHjj<25) return Category(QQ2HQQ_MJJ_0_60_PTHJJ_0_25+getBin(mjj,{0,60,120,350}));
539  else return Category(QQ2HQQ_MJJ_0_60_PTHJJ_GT25+getBin(mjj,{0,60,120,350}));
540  } else { //mjj>350 GeV
541  if (higgs.pt()<200){
542  return Category(QQ2HQQ_MJJ_350_700_PTHJJ_0_25+vbfTopo-1);
543  } else {
545  }
546  }
547  }
548  }
549  // 3. WH->Hlv categories
550  else if (prodMode==HTXS::WH) {
551  if (fwdHiggs) return QQ2HLNU_FWDH;
552  int Njets=jets.size();
553  if (Njets==0) return Category(QQ2HLNU_PTV_0_75_0J+getBin(V.pt(),{0,75,150,250,400}));
554  if (Njets==1) return Category(QQ2HLNU_PTV_0_75_1J+getBin(V.pt(),{0,75,150,250,400}));
555  return Category(QQ2HLNU_PTV_0_75_GE2J+getBin(V.pt(),{0,75,150,250,400}));
556  }
557  // 4. qq->ZH->llH categories
558  else if (prodMode==HTXS::QQ2ZH) {
559  if (fwdHiggs) return QQ2HLL_FWDH;
560  int Njets=jets.size();
561  if (Njets==0) return Category(QQ2HLL_PTV_0_75_0J+getBin(V.pt(),{0,75,150,250,400}));
562  if (Njets==1) return Category(QQ2HLL_PTV_0_75_1J+getBin(V.pt(),{0,75,150,250,400}));
563  return Category(QQ2HLL_PTV_0_75_GE2J+getBin(V.pt(),{0,75,150,250,400}));
564  }
565  // 5. gg->ZH->llH categories
566  else if (prodMode==HTXS::GG2ZH ) {
567  if (fwdHiggs) return GG2HLL_FWDH;
568  int Njets=jets.size();
569  if (Njets==0) return Category(GG2HLL_PTV_0_75_0J+getBin(V.pt(),{0,75,150,250,400}));
570  if (Njets==1) return Category(GG2HLL_PTV_0_75_1J+getBin(V.pt(),{0,75,150,250,400}));
571  return Category(GG2HLL_PTV_0_75_GE2J+getBin(V.pt(),{0,75,150,250,400}));
572  }
573  // 6.ttH,bbH,tH categories
574  else if (prodMode==HTXS::TTH) return Category(TTH_FWDH+ctrlHiggs);
575  else if (prodMode==HTXS::BBH) return Category(BBH_FWDH+ctrlHiggs);
576  else if (prodMode==HTXS::TH ) return Category(TH_FWDH+ctrlHiggs);
577  return UNKNOWN;
578  }
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
int vbfTopology_Stage1_1_Fine(const Jets &jets, const Particle &higgs)
VBF topology selection for Stage1.1 Fine 0 = fail loose selection: m_jj > 350 GeV 1 pass loose...
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
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 362 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().

365  {
366  using namespace HTXS::Stage1;
367  int Njets=jets.size(), ctrlHiggs = std::abs(higgs.rapidity())<2.5, fwdHiggs = !ctrlHiggs;
368  double pTj1 = !jets.empty() ? jets[0].momentum().pt() : 0;
369  int vbfTopo = vbfTopology(jets,higgs);
370 
371  // 1. GGF Stage 1 categories
372  // Following YR4 write-up: XXXXX
373  if (prodMode==HTXS::GGF || (prodMode==HTXS::GG2ZH && quarkDecay(V)) ) {
374  if (fwdHiggs) return GG2H_FWDH;
375  if (Njets==0) return GG2H_0J;
376  else if (Njets==1) return Category(GG2H_1J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200}));
377  else if (Njets>=2) {
378  // events with pT_H>200 get priority over VBF cuts
379  if(higgs.pt()<=200){
380  if (vbfTopo==2) return GG2H_VBFTOPO_JET3VETO;
381  else if (vbfTopo==1) return GG2H_VBFTOPO_JET3;
382  }
383  // Njets >= 2jets without VBF topology
384  return Category(GG2H_GE2J_PTH_0_60+getBin(higgs.pt(),{0,60,120,200}));
385  }
386  }
387  // 2. Electroweak qq->Hqq Stage 1 categories
388  else if (prodMode==HTXS::VBF || ( isVH(prodMode) && quarkDecay(V)) ) {
389  if (std::abs(higgs.rapidity())>2.5) return QQ2HQQ_FWDH;
390  if (pTj1>200) return QQ2HQQ_PTJET1_GT200;
391  if (vbfTopo==2) return QQ2HQQ_VBFTOPO_JET3VETO;
392  if (vbfTopo==1) return QQ2HQQ_VBFTOPO_JET3;
393  double mjj = jets.size()>1 ? (jets[0].mom()+jets[1].mom()).mass():0;
394  if ( 60 < mjj && mjj < 120 ) return QQ2HQQ_VH2JET;
395  return QQ2HQQ_REST;
396  }
397  // 3. WH->Hlv categories
398  else if (prodMode==HTXS::WH) {
399  if (fwdHiggs) return QQ2HLNU_FWDH;
400  else if (V.pt()<150) return QQ2HLNU_PTV_0_150;
401  else if (V.pt()>250) return QQ2HLNU_PTV_GT250;
402  // 150 < pTV/GeV < 250
404  }
405  // 4. qq->ZH->llH categories
406  else if (prodMode==HTXS::QQ2ZH) {
407  if (fwdHiggs) return QQ2HLL_FWDH;
408  else if (V.pt()<150) return QQ2HLL_PTV_0_150;
409  else if (V.pt()>250) return QQ2HLL_PTV_GT250;
410  // 150 < pTV/GeV < 250
412  }
413  // 5. gg->ZH->llH categories
414  else if (prodMode==HTXS::GG2ZH ) {
415  if (fwdHiggs) return GG2HLL_FWDH;
416  if (V.pt()<150) return GG2HLL_PTV_0_150;
417  else if (jets.empty()) return GG2HLL_PTV_GT150_0J;
418  return GG2HLL_PTV_GT150_GE1J;
419  }
420  // 6.ttH,bbH,tH categories
421  else if (prodMode==HTXS::TTH) return Category(TTH_FWDH+ctrlHiggs);
422  else if (prodMode==HTXS::BBH) return Category(BBH_FWDH+ctrlHiggs);
423  else if (prodMode==HTXS::TH ) return Category(TH_FWDH+ctrlHiggs);
424  return UNKNOWN;
425  }
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 63 of file HiggsTemplateCrossSections.cc.

Referenced by classifyEvent(), and getLastInstance().

63  {
64  for (auto child:Particle(*ptcl).children())
65  if (child.pdgId()==pdgID) return true;
66  return false;
67  }
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 70 of file HiggsTemplateCrossSections.cc.

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

Referenced by classifyEvent().

70  {
71  for (auto parent:particles(ptcl->production_vertex(),HepMC::parents))
72  if (parent->pdg_id()==pdgID) return true;
73  return false;
74  }
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 593 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.

593  {
594  printf("==============================================================\n");
595  printf("======== HiggsTemplateCrossSections Initialization =========\n");
596  printf("==============================================================\n");
597  // check that the production mode has been set
598  // if running in standalone Rivet the production mode is set through an env variable
600  char *pm_env = getenv("HIGGSPRODMODE");
601  string pm(pm_env==nullptr?"":pm_env);
602  if ( pm == "GGF" ) m_HiggsProdMode = HTXS::GGF;
603  else if ( pm == "VBF" ) m_HiggsProdMode = HTXS::VBF;
604  else if ( pm == "WH" ) m_HiggsProdMode = HTXS::WH;
605  else if ( pm == "ZH" ) m_HiggsProdMode = HTXS::QQ2ZH;
606  else if ( pm == "QQ2ZH" ) m_HiggsProdMode = HTXS::QQ2ZH;
607  else if ( pm == "GG2ZH" ) m_HiggsProdMode = HTXS::GG2ZH;
608  else if ( pm == "TTH" ) m_HiggsProdMode = HTXS::TTH;
609  else if ( pm == "BBH" ) m_HiggsProdMode = HTXS::BBH;
610  else if ( pm == "TH" ) m_HiggsProdMode = HTXS::TH;
611  else {
612  MSG_WARNING("No HIGGSPRODMODE shell variable found. Needed when running Rivet stand-alone.");
613  }
614  }
615 
616  // Projections for final state particles
617  const FinalState FS;
618  addProjection(FS,"FS");
619 
620  // initialize the histograms with for each of the stages
622  m_sumw = 0.0;
623  printf("==============================================================\n");
624  printf("======== Higgs prod mode %d =========\n",m_HiggsProdMode);
625  printf("======== Sucessful Initialization =========\n");
626  printf("==============================================================\n");
627  }
void Rivet::HiggsTemplateCrossSections::initializeHistos ( )
inline

Definition at line 700 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().

700  {
701  hist_stage0 = bookHisto1D("HTXS_stage0",20,0,20);
702  hist_stage1_pTjet25 = bookHisto1D("HTXS_stage1_pTjet25",40,0,40);
703  hist_stage1_pTjet30 = bookHisto1D("HTXS_stage1_pTjet30",40,0,40);
704  hist_pT_Higgs = bookHisto1D("pT_Higgs",80,0,400);
705  hist_y_Higgs = bookHisto1D("y_Higgs",80,-4,4);
706  hist_pT_V = bookHisto1D("pT_V",80,0,400);
707  hist_pT_jet1 = bookHisto1D("pT_jet1",80,0,400);
708  hist_deltay_jj = bookHisto1D("deltay_jj",50,0,10);
709  hist_dijet_mass = bookHisto1D("m_jj",50,0,2000);
710  hist_pT_Hjj = bookHisto1D("pT_Hjj",50,0,250);
711  hist_Njets25 = bookHisto1D("Njets25",10,0,10);
712  hist_Njets30 = bookHisto1D("Njets30",10,0,10);
713  }
bool Rivet::HiggsTemplateCrossSections::isVH ( HTXS::HiggsProdMode  p)
inline
bool Rivet::HiggsTemplateCrossSections::originateFrom ( const Particle p,
const Particles &  ptcls 
)
inline

Whether particle p originate from any of the ptcls.

Definition at line 45 of file HiggsTemplateCrossSections.cc.

References HadronAndPartonSelector_cfi::particles.

Referenced by classifyEvent(), and originateFrom().

45  {
46  const GenVertex* prodVtx = p.genParticle()->production_vertex();
47  if (prodVtx == nullptr) return false;
48  // for each ancestor, check if it matches any of the input particles
49  for (const auto & ancestor:particles(prodVtx, HepMC::ancestors)){
50  for ( auto part:ptcls )
51  if ( ancestor==part.genParticle() ) return true;
52  }
53  // if we get here, no ancetor matched any input particle
54  return false;
55  }
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 58 of file HiggsTemplateCrossSections.cc.

References originateFrom().

58  {
59  Particles ptcls = {p2}; return originateFrom(p,ptcls);
60  }
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 666 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().

666  {
667  MSG_INFO (" ====================================================== ");
668  MSG_INFO (" Higgs Template X-Sec Categorization Tool ");
669  MSG_INFO (" Status Code Summary ");
670  MSG_INFO (" ====================================================== ");
671  bool allSuccess = (numEvents()==m_errorCount[HTXS::SUCCESS]);
672  if ( allSuccess ) MSG_INFO (" >>>> All "<< m_errorCount[HTXS::SUCCESS] <<" events successfully categorized!");
673  else{
674  MSG_INFO (" >>>> "<< m_errorCount[HTXS::SUCCESS] <<" events successfully categorized");
675  MSG_INFO (" >>>> --> the following errors occured:");
676  MSG_INFO (" >>>> "<< m_errorCount[HTXS::PRODMODE_DEFINED] <<" had an undefined Higgs production mode.");
677  MSG_INFO (" >>>> "<< m_errorCount[HTXS::MOMENTUM_CONSERVATION] <<" failed momentum conservation.");
678  MSG_INFO (" >>>> "<< m_errorCount[HTXS::HIGGS_IDENTIFICATION] <<" failed to identify a valid Higgs boson.");
679  MSG_INFO (" >>>> "<< m_errorCount[HTXS::HS_VTX_IDENTIFICATION] <<" failed to identify the hard scatter vertex.");
680  MSG_INFO (" >>>> "<< m_errorCount[HTXS::VH_IDENTIFICATION] <<" VH: to identify a valid V-boson.");
681  MSG_INFO (" >>>> "<< m_errorCount[HTXS::TOP_W_IDENTIFICATION] <<" failed to identify valid Ws from top decay.");
682  }
683  MSG_INFO (" ====================================================== ");
684  MSG_INFO (" ====================================================== ");
685  }
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 77 of file HiggsTemplateCrossSections.cc.

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

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

Sets the Higgs production mode.

Definition at line 588 of file HiggsTemplateCrossSections.cc.

References m_HiggsProdMode.

588 { 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 305 of file HiggsTemplateCrossSections.cc.

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

Referenced by getStage1Category().

305  {
306  if (jets.size()<2) return 0;
307  const FourMomentum &j1=jets[0].momentum(), &j2=jets[1].momentum();
308  bool VBFtopo = (j1+j2).mass() > 400.0 && std::abs(j1.rapidity()-j2.rapidity()) > 2.8;
309  return VBFtopo ? (j1+j2+higgs.momentum()).pt()<25 ? 2 : 1 : 0;
310  }
vector< PseudoJet > jets
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int Rivet::HiggsTemplateCrossSections::vbfTopology_Stage1_1 ( const Jets &  jets,
const Particle higgs 
)
inline

VBF topology selection Stage1.1 0 = fail loose selection: m_jj > 350 GeV 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass pT(Hjj)>25 selection 3 pass tight (m_jj>700 GeV), but fail additional cut pT(Hjj)<25. 4 pass pT(Hjj)>25 selection.

Definition at line 316 of file HiggsTemplateCrossSections.cc.

References ResonanceBuilder::mass, and EnergyCorrector::pt.

Referenced by getStage1_1_Category().

316  {
317  if (jets.size()<2) return 0;
318  const FourMomentum &j1=jets[0].momentum(), &j2=jets[1].momentum();
319  double mjj = (j1+j2).mass();
320  if(mjj>350 && mjj<=700) return (j1+j2+higgs.momentum()).pt()<25 ? 1 : 2;
321  else if(mjj>700) return (j1+j2+higgs.momentum()).pt()<25 ? 3 : 4;
322  else return 0;
323  }
vector< PseudoJet > jets
int Rivet::HiggsTemplateCrossSections::vbfTopology_Stage1_1_Fine ( const Jets &  jets,
const Particle higgs 
)
inline

VBF topology selection for Stage1.1 Fine 0 = fail loose selection: m_jj > 350 GeV 1 pass loose, but fail additional cut pT(Hjj)<25. 2 pass pT(Hjj)>25 selection 3 pass 700<m_jj<1000 GeV, but fail additional cut pT(Hjj)<25. 4 pass pT(Hjj)>25 selection 5 pass 1000<m_jj<1500 GeV, but fail additional cut pT(Hjj)<25. 6 pass pT(Hjj)>25 selection 7 pass m_jj>1500 GeV, but fail additional cut pT(Hjj)<25. 8 pass pT(Hjj)>25 selection.

Definition at line 331 of file HiggsTemplateCrossSections.cc.

References ResonanceBuilder::mass, and EnergyCorrector::pt.

Referenced by getStage1_1_Fine_Category().

331  {
332  if (jets.size()<2) return 0;
333  const FourMomentum &j1=jets[0].momentum(), &j2=jets[1].momentum();
334  double mjj = (j1+j2).mass();
335  if(mjj>350 && mjj<=700) return (j1+j2+higgs.momentum()).pt()<25 ? 1 : 2;
336  else if(mjj>700 && mjj<=1000) return (j1+j2+higgs.momentum()).pt()<25 ? 3 : 4;
337  else if(mjj>1000 && mjj<=1500) return (j1+j2+higgs.momentum()).pt()<25 ? 5 : 6;
338  else if(mjj>1500) return (j1+j2+higgs.momentum()).pt()<25 ? 7 : 8;
339  else return 0;
340  }
vector< PseudoJet > jets

Member Data Documentation

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_deltay_jj
private

Definition at line 728 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_dijet_mass
private

Definition at line 728 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_Njets25
private

Definition at line 729 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_Njets30
private

Definition at line 729 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_pT_Higgs
private

Definition at line 726 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_pT_Hjj
private

Definition at line 728 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_pT_jet1
private

Definition at line 727 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_pT_V
private

Definition at line 727 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_stage0
private

Definition at line 724 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_stage1_pTjet25
private

Definition at line 725 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_stage1_pTjet30
private

Definition at line 725 of file HiggsTemplateCrossSections.cc.

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

Histo1DPtr Rivet::HiggsTemplateCrossSections::hist_y_Higgs
private

Definition at line 726 of file HiggsTemplateCrossSections.cc.

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

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

Definition at line 723 of file HiggsTemplateCrossSections.cc.

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

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

Definition at line 722 of file HiggsTemplateCrossSections.cc.

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

double Rivet::HiggsTemplateCrossSections::m_sumw
private

Definition at line 721 of file HiggsTemplateCrossSections.cc.

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