ATLAS Offline Software
VetoedShower.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 #include <stdexcept>
7 #include <iostream>
8 
9 namespace Pythia8{
10  class VetoedShower;
11 }
12 
14 
15 namespace Pythia8{
16 
17 
18  class VetoedShower : public UserHooks{
19 
20  public:
21 
23  std::cout<<std::endl;
24  std::cout<<"************************************************************************************************"<<std::endl;
25  std::cout<<"Pythia8::VetoedShower: *** WARNING: THIS USER HOOK IS NOT VALIDATED FOR QCD JET PRODUCTION!! ***"<<std::endl;
26  std::cout<<"************************************************************************************************"<<std::endl;
27  std::cout<<std::endl;
28  }
29 
31 
38  bool doVetoMPIStep(int, const Event&){
39 
40  m_pTVeto = infoPtr->QFac();
41  m_doneISR = false;
42 
43 // std::cout<<" ******** veto scale = "<<m_pTVeto<<" *********"<<std::endl;
44 
45  return false;
46  }
47 
59  bool doVetoISREmission(int, const Event &e, int){
60  // Note ignoring new iSys param for now (addition required to fix compilation against >= 8.157
61 
62  if(m_doneISR) return false;
63 
64  int i = e.size() - 1;
65 
66  while(i != -1){
67 
68  if(e[i].isFinal() && e[i].status() == 43) break;
69 
70  --i;
71 
72  if(i == 0){
73  e.list();
74  throw std::runtime_error("Pythia8::VetoedShower::doVetoISREmission: Could not find ISR emission");
75  }
76  }
77 
78  //check the leg is connected to the hard system
79  int iMother = e[i].mother1();
80  if(e[iMother].status() != -41)
81  throw std::runtime_error("Pythia8::VetoedShower::doVetoISREmission: Unexpected status code in ISR");
82 
83  iMother = e[iMother].daughter2();
84  if(iMother != partonSystemsPtr->getInA(0) &&
85  iMother != partonSystemsPtr->getInB(0)) return false;
86 
87  // Veto emission above the veto scale
88  if(e[i].pT() > m_pTVeto) return true;
89 
90  m_doneISR = true;
91  return false;
92  }
99  bool doVetoFSREmission(int, const Event &e, int, bool){
100  // Note ignoring new iSys and isResonance params for now (addition required to fix compilation against >= 8.157
101 
102  int i = e.size() - 1;
103 
104  while(i != -1){
105  if (e[i].isFinal() && e[i].status() == 51) break;
106 
107  --i;
108 
109  if(i == 0){
110  e.list();
111  throw std::runtime_error("Pythia8::VetoedShower::doVetoFSREmission: Could not find FSR emission");
112  }
113  }
114 
115  // Make sure radiation from the hard system
116  int iMother = e[i].mother1();
117  int sysSize = partonSystemsPtr->sizeOut(0);
118  bool hardSys = false;
119 
120  for (int j = 0; j < sysSize; ++j){
121  int iOut = partonSystemsPtr->getOut(0, j);
122  if (iOut == iMother) {
123  hardSys = true;
124  break;
125  }
126  }
127 
128  if (!hardSys) return false;
129 
130  // Veto if above the POWHEG scale
131  if (e[i].pT() > m_pTVeto) return true;
132 
133  return false;
134  }
135 
137  bool canVetoMPIStep(){return true;}
139  int numberVetoMPIStep(){return 1;}
141  bool canVetoISREmission(){return true;}
143  bool canVetoFSREmission(){return true;}
144 
145  private:
146 
147  double m_pTVeto;
148  bool m_doneISR;
149  };
150 }
151 
Pythia8::VetoedShower::canVetoMPIStep
bool canVetoMPIStep()
Switch on calling of doVetoMPIStep.
Definition: VetoedShower.cxx:137
vetoedShowerCreator
Pythia8_UserHooks::UserHooksFactory::Creator< Pythia8::VetoedShower > vetoedShowerCreator("VetoedShower")
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
Pythia8::VetoedShower
Definition: VetoedShower.cxx:18
Pythia8::VetoedShower::doVetoISREmission
bool doVetoISREmission(int, const Event &e, int)
This is called after the generation of each new ISR emission Can use it to test if the last generated...
Definition: VetoedShower.cxx:59
Event
Definition: trigbs_orderedMerge.cxx:42
Pythia8_UserHooks::UserHooksFactory::Creator
Definition: UserHooksFactory.h:54
UserHooksFactory.h
Pythia8
Author: James Monk (jmonk@cern.ch)
Definition: IPythia8Custom.h:13
Pythia8::VetoedShower::canVetoISREmission
bool canVetoISREmission()
Switch on veto of ISR.
Definition: VetoedShower.cxx:141
lumiFormat.i
int i
Definition: lumiFormat.py:92
Pythia8::VetoedShower::m_doneISR
bool m_doneISR
Definition: VetoedShower.cxx:148
Pythia8::VetoedShower::~VetoedShower
~VetoedShower()
Definition: VetoedShower.cxx:30
Pythia8::VetoedShower::canVetoFSREmission
bool canVetoFSREmission()
Switch off veto of FSR.
Definition: VetoedShower.cxx:143
DiTauMassTools::MaxHistStrategyV2::e
e
Definition: PhysicsAnalysis/TauID/DiTauMassTools/DiTauMassTools/HelperFunctions.h:26
Pythia8::VetoedShower::VetoedShower
VetoedShower()
Definition: VetoedShower.cxx:22
merge.status
status
Definition: merge.py:17
Pythia8::VetoedShower::doVetoMPIStep
bool doVetoMPIStep(int, const Event &)
doVetoMPIStep is called immediately after the MPI generation In this case it nver actually vetoes the...
Definition: VetoedShower.cxx:38
Pythia8::VetoedShower::m_pTVeto
double m_pTVeto
Definition: VetoedShower.cxx:147
Pythia8::VetoedShower::doVetoFSREmission
bool doVetoFSREmission(int, const Event &e, int, bool)
This is similar to the ISR veto, with the exception that since the ordering is in a slightly differen...
Definition: VetoedShower.cxx:99
Pythia8::VetoedShower::numberVetoMPIStep
int numberVetoMPIStep()
Call doVetoMIStep once.
Definition: VetoedShower.cxx:139