ATLAS Offline Software
Loading...
Searching...
No Matches
HllgamRepeatTimeShower Class Reference

Tool that will repeatedly perform time showering on the intial photons from a Higgs decay until at least one is offshell. More...

#include <HllgamRepeatTimeShower.h>

Inheritance diagram for HllgamRepeatTimeShower:
Collaboration diagram for HllgamRepeatTimeShower:

Public Member Functions

virtual ~HllgamRepeatTimeShower ()
 Destructor.
StatusCode initialize () override
 AlgTool initialize method.
StatusCode finalize () override
 AlgTool finalize method.
StatusCode ModifyPythiaEvent (Pythia8::Pythia &pythia) const override
 Update the pythia event.
virtual double CrossSectionScaleFactor () const override
 Return how much the cross section is modified.

Private Attributes

unsigned long m_nPass {0}
unsigned long m_nVetos {0}

Detailed Description

Tool that will repeatedly perform time showering on the intial photons from a Higgs decay until at least one is offshell.

Definition at line 16 of file HllgamRepeatTimeShower.h.

Constructor & Destructor Documentation

◆ ~HllgamRepeatTimeShower()

virtual HllgamRepeatTimeShower::~HllgamRepeatTimeShower ( )
inlinevirtual

Destructor.

Definition at line 24 of file HllgamRepeatTimeShower.h.

24{};

Member Function Documentation

◆ CrossSectionScaleFactor()

double HllgamRepeatTimeShower::CrossSectionScaleFactor ( ) const
overridevirtual

Return how much the cross section is modified.

Should only be called once all events have been processed

Definition at line 33 of file HllgamRepeatTimeShower.cxx.

33 {
34 unsigned long sum = m_nVetos + m_nPass;
35 if(sum == 0 || m_nPass==0 ){
36 ATH_MSG_WARNING( "Are you sure that this code has been called correctly?? " );
37 return 1.;
38 }
39
40 return double (m_nPass)/double ( sum );
41 }
#define ATH_MSG_WARNING(x)

◆ finalize()

StatusCode HllgamRepeatTimeShower::finalize ( )
override

AlgTool finalize method.

Definition at line 22 of file HllgamRepeatTimeShower.cxx.

22 {
23
24 ATH_MSG_INFO( "*************************************************************" );
25 ATH_MSG_INFO( "N retries " << m_nVetos );
26 ATH_MSG_INFO( "N pass " << m_nPass );
27 ATH_MSG_INFO( "*************************************************************" );
28
29 ATH_MSG_INFO( "Finalisation of " << name() << " was successful" );
30 return StatusCode::SUCCESS;
31 }
#define ATH_MSG_INFO(x)

◆ initialize()

StatusCode HllgamRepeatTimeShower::initialize ( )
override

AlgTool initialize method.

Definition at line 8 of file HllgamRepeatTimeShower.cxx.

8 {
9 ATH_MSG_INFO( "Initialisation of " << name() << " was successful" );
10
11 ATH_MSG_INFO( "********************************************************************************" );
12 ATH_MSG_INFO( "********************************************************************************" );
13 ATH_MSG_INFO( "*** Will run with repeated time showers of H decay ***" );
14 ATH_MSG_INFO( "*** N.B. only make sense for gamma gamma decays ***" );
15 ATH_MSG_INFO( "********************************************************************************" );
16 ATH_MSG_INFO( "********************************************************************************" );
17
18 return StatusCode::SUCCESS;
19 }

◆ ModifyPythiaEvent()

StatusCode HllgamRepeatTimeShower::ModifyPythiaEvent ( Pythia8::Pythia & pythia) const
override

Update the pythia event.

Definition at line 43 of file HllgamRepeatTimeShower.cxx.

43 {
44
45 //Index of the photons for the Higgs decay
46 std::vector<int> photons;
47
48 int trials = 0;
49
50 bool checkEvent = true;
51
52 Pythia8::Event& event = pythia.event;
53
54 while(checkEvent){
55
56 int higgsIndex = -1;
57 for(int ii=0; ii != event.size(); ++ii){
58 // status 22 is intermediate hard process.
59 // I think that is correct here because although the output
60 // from Powheg is the Higgs, Pythia should still consider the
61 // decay products of the Higgs to be part of the hard process
62 if(event[ii].id() == 25 && abs(event[ii].status()) == 22){
63 higgsIndex = ii;
64 break;
65 }
66 }
67
68 if(higgsIndex <0){
69 // didn't find a Higgs - barf
70 ATH_MSG_ERROR("No Higgs in event record");
71 return StatusCode::FAILURE;
72 }
73
74 std::vector<int> daughters = event[higgsIndex].daughterList();
75 while(daughters.size()==1){
76 daughters=event[daughters[0]].daughterList();
77 }
78
79 std::vector<int> photons;
80
81 for(const auto d: daughters){
82 if(event[d].id() == 22){
83 photons.push_back(d);
84 }
85 }
86
87 if(photons.size() < 2){
88 ATH_MSG_ERROR("Wrong number of photons from H decay. Expected >= 2, got " + std::to_string(photons.size()));
89 return StatusCode::FAILURE;
90 }
91
92 for(const auto p: photons){
93 daughters = event[p].daughterList();
94 while(daughters.size() == 1){
95 daughters = event[daughters[0]].daughterList();
96 }
97
98 if(daughters.size() < 2) continue;
99 size_t nLeptons=0;
100
101 for(const auto d: daughters){
102 if(event[d].isLepton()) ++nLeptons;
103 }
104
105 if(nLeptons >= 2){
106 checkEvent = false;
107 break;
108 }
109 }
110
111 if(checkEvent){
112 pythia.forceTimeShower( photons[0], photons[1], 1000000);
113 ++trials;
114 ++m_nVetos;
115 if(trials % 1000 == 0 ){
116 ATH_MSG_WARNING("Has the decay been setup in Pythia correctly? Possibly stuck in loop so far " << trials << " attempts have been made");
117 }
118 }else{
119 pythia.forceHadronLevel();
120 ++m_nPass;
121 }
122 }
123
124 return StatusCode::SUCCESS;
125 }
#define ATH_MSG_ERROR(x)
bool isLepton(const T &p)
APID: the fourth generation leptons are leptons.
Definition AtlasPID.h:189
status
Definition merge.py:16

Member Data Documentation

◆ m_nPass

unsigned long HllgamRepeatTimeShower::m_nPass {0}
mutableprivate

Definition at line 40 of file HllgamRepeatTimeShower.h.

40{0};

◆ m_nVetos

unsigned long HllgamRepeatTimeShower::m_nVetos {0}
mutableprivate

Definition at line 41 of file HllgamRepeatTimeShower.h.

41{0};

The documentation for this class was generated from the following files: