ATLAS Offline Software
Classes | Functions
Pythia8_UserHooks Namespace Reference

Some common functions for determining pTs and navigating event records for the PoWHEG + Pythia user hooks. More...

Classes

class  UserHooksFactory
 
class  UserSetting
 

Functions

double pTProj (const Pythia8::Particle &leg, const Pythia8::Particle &comparison)
 
double pTProj (size_t legIndex, size_t comparedIndex, const Pythia8::Event &evt)
 
double pT2Leg (const Pythia8::Particle &leg, const Pythia8::Particle &comparison)
 
double pT2Leg (size_t legIndex, size_t comparedIndex, const Pythia8::Event &evt)
 
double pTLeg (const Pythia8::Particle &leg, const Pythia8::Particle &comparison)
 
double pTLeg (size_t legIndex, size_t comparedIndex, const Pythia8::Event &evt)
 
size_t findLastEmission (const Pythia8::Event &evt, int status)
 Return the index of the most recent emission in a. More...
 
size_t findLastISREmission (const Pythia8::Event &evt)
 
size_t findLastFSREmission (const Pythia8::Event &evt)
 
size_t findLastISRRadiator (const Pythia8::Event &evt)
 
size_t findLastFSRRadiator (const Pythia8::Event &evt)
 
std::map< std::string, double > & userParams ()
 
std::map< std::string, bool > & userFlags ()
 
std::map< std::string, int > & userModes ()
 
std::map< std::string, std::string > & userWords ()
 

Detailed Description

Some common functions for determining pTs and navigating event records for the PoWHEG + Pythia user hooks.

Function Documentation

◆ findLastEmission()

size_t Pythia8_UserHooks::findLastEmission ( const Pythia8::Event &  evt,
int  status 
)
inline

Return the index of the most recent emission in a.

Parameters
evtwith a given
status

Definition at line 65 of file UserHooksUtils.h.

65  {
66  size_t emission = evt.size() - 1;
67 
68  while(emission != 0){
69  if (evt[emission].isFinal() && evt[emission].status() == status) return emission;
70 
71  --emission;
72  }
73 
74  return 0;
75  }

◆ findLastFSREmission()

size_t Pythia8_UserHooks::findLastFSREmission ( const Pythia8::Event &  evt)
inline
Returns
the index of the most recent FSR emission in an
Parameters
evt

Definition at line 89 of file UserHooksUtils.h.

89  {
90  size_t emission = findLastEmission(evt, 51);
91  if(emission == 0) throw std::runtime_error("findLastFSREmission:: Could not find FSR emission");
92  return emission;
93  }

◆ findLastFSRRadiator()

size_t Pythia8_UserHooks::findLastFSRRadiator ( const Pythia8::Event &  evt)
inline
Returns
the index of the most recent particle to radiate a FSR emission in an
Parameters
evt

Definition at line 109 of file UserHooksUtils.h.

109  {
110  size_t emitted = findLastFSREmission(evt);
111  return evt[emitted].mother1();
112  }

◆ findLastISREmission()

size_t Pythia8_UserHooks::findLastISREmission ( const Pythia8::Event &  evt)
inline
Returns
the index of the most recent ISR emission in an
Parameters
evt

Definition at line 80 of file UserHooksUtils.h.

80  {
81  size_t emission = findLastEmission(evt, 43);
82  if(emission == 0) throw std::runtime_error("findLastISREmission:: Could not find ISR emission");
83  return emission;
84  }

◆ findLastISRRadiator()

size_t Pythia8_UserHooks::findLastISRRadiator ( const Pythia8::Event &  evt)
inline
Returns
the index of the most recent particle to radiate an ISR emission in an
Parameters
evt

Definition at line 99 of file UserHooksUtils.h.

99  {
100  size_t radiator = findLastEmission(evt, -41);
101  if(radiator == 0) throw std::runtime_error("findLastISRRadiator:: Could not find ISR radiator");
102  return radiator;
103  }

◆ pT2Leg() [1/2]

double Pythia8_UserHooks::pT2Leg ( const Pythia8::Particle &  leg,
const Pythia8::Particle &  comparison 
)
inline
Returns
the pT squared of
Parameters
legrelative to
comparison

Definition at line 34 of file UserHooksUtils.h.

34  {
35  double proj = pTProj(leg, comparison);
36  return leg.pAbs2() - (proj*proj) / comparison.pAbs2();
37  }

◆ pT2Leg() [2/2]

double Pythia8_UserHooks::pT2Leg ( size_t  legIndex,
size_t  comparedIndex,
const Pythia8::Event &  evt 
)
inline
Returns
the pT squared of the leg with index
Parameters
legIndexcompared to the leg with index
comparedIndexin Event
evt

Definition at line 43 of file UserHooksUtils.h.

43  {
44  return pT2Leg(evt[legIndex], evt[comparedIndex]);
45  }

◆ pTLeg() [1/2]

double Pythia8_UserHooks::pTLeg ( const Pythia8::Particle &  leg,
const Pythia8::Particle &  comparison 
)
inline
Returns
the pT of
Parameters
legrelative to
comparison

Definition at line 50 of file UserHooksUtils.h.

50  {
51  return std::sqrt(pT2Leg(leg, comparison));
52  }

◆ pTLeg() [2/2]

double Pythia8_UserHooks::pTLeg ( size_t  legIndex,
size_t  comparedIndex,
const Pythia8::Event &  evt 
)
inline
Returns
the pT of the leg with index
Parameters
legIndexcompared to the leg with index
comparedIndexin Event
evt

Definition at line 58 of file UserHooksUtils.h.

58  {
59  return std::sqrt(pT2Leg(legIndex, comparedIndex, evt));
60  }

◆ pTProj() [1/2]

double Pythia8_UserHooks::pTProj ( const Pythia8::Particle &  leg,
const Pythia8::Particle &  comparison 
)
inline
Returns
the dot product of
Parameters
legand
comparison

Definition at line 19 of file UserHooksUtils.h.

19  {
20  return leg.px()*comparison.px() + leg.py()*comparison.py() + leg.pz()*comparison.pz();
21  }

◆ pTProj() [2/2]

double Pythia8_UserHooks::pTProj ( size_t  legIndex,
size_t  comparedIndex,
const Pythia8::Event &  evt 
)
inline
Returns
the dot product of the legs in the
Parameters
evtwith indices
legIndexand
comparedIndex

Definition at line 27 of file UserHooksUtils.h.

27  {
28  return pTProj(evt[legIndex], evt[comparedIndex]);
29  }

◆ userFlags()

std::map<std::string, bool>& Pythia8_UserHooks::userFlags ( )

Definition at line 55 of file UserHooksFactory.cxx.

55  {
56  static std::map<std::string, bool> flags;
57  return flags;
58  }

◆ userModes()

std::map<std::string, int>& Pythia8_UserHooks::userModes ( )

Definition at line 61 of file UserHooksFactory.cxx.

61  {
62  static std::map<std::string, int> modes;
63  return modes;
64  }

◆ userParams()

std::map<std::string, double>& Pythia8_UserHooks::userParams ( )

Definition at line 50 of file UserHooksFactory.cxx.

50  {
51  static std::map<std::string, double> params;
52  return params;
53  }

◆ userWords()

std::map<std::string, std::string>& Pythia8_UserHooks::userWords ( )

Definition at line 66 of file UserHooksFactory.cxx.

66  {
67  static std::map<std::string, std::string> words;
68  return words;
69  }
AthenaPoolTestRead.flags
flags
Definition: AthenaPoolTestRead.py:8
Pythia8_UserHooks::pTProj
double pTProj(size_t legIndex, size_t comparedIndex, const Pythia8::Event &evt)
Definition: UserHooksUtils.h:27
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
Pythia8_UserHooks::pT2Leg
double pT2Leg(size_t legIndex, size_t comparedIndex, const Pythia8::Event &evt)
Definition: UserHooksUtils.h:43
compute_lumi.leg
leg
Definition: compute_lumi.py:95
Pythia8_UserHooks::findLastEmission
size_t findLastEmission(const Pythia8::Event &evt, int status)
Return the index of the most recent emission in a.
Definition: UserHooksUtils.h:65
make_coralServer_rep.proj
proj
Definition: make_coralServer_rep.py:48
merge.status
status
Definition: merge.py:17
PowhegControl_ttFCNC_NLO.params
params
Definition: PowhegControl_ttFCNC_NLO.py:226
checkFileSG.words
words
Definition: checkFileSG.py:76
Pythia8_UserHooks::findLastFSREmission
size_t findLastFSREmission(const Pythia8::Event &evt)
Definition: UserHooksUtils.h:89