ATLAS Offline Software
EnhanceMPI.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "UserHooksUtils.h"
6 #include "UserSetting.h"
8 #include <stdexcept>
9 #include <iostream>
10 
11 namespace Pythia8{
12  class EnhanceMPI;
13 }
14 
16 
17 namespace Pythia8{
18 
19  class EnhanceMPI : public UserHooks{
20 
21  public:
22 
23  EnhanceMPI(): m_pTCut("EnhanceMPI:PTCut", 10.), m_nMPIVeto(3){
24 
25  std::cout<<"**********************************************************"<<std::endl;
26  std::cout<<"* *"<<std::endl;
27  std::cout<<"* Enhancing MPI emissions with UserHook! *"<<std::endl;
28  std::cout<<"* *"<<std::endl;
29  std::cout<<"**********************************************************"<<std::endl;
30 
31  m_passedEvent = 0;
32  }
33 
35 
36  bool doVetoMPIStep(int nMPI, const Event &event){
37 
38  // MPI 1 is the hard process. We do not veto that!
39  if(nMPI < 2){
40  m_passedEvent = false;
41  return false;
42  }
43 
44  if(m_passedEvent) return false;
45 
46  // start at the end of the event record and work back
47  // This is prior to showering, so there should be at most 2 new MPI emissions
48  // event[0] is documentation, so stop before that.
49  size_t nEmissions=0;
50  for(int ii=event.size()-1; ii > 0 && nEmissions != 2; --ii){
51  if(event[ii].status() != 33) continue;
52  if(event[ii].pT() > m_pTCut(settingsPtr)){
53  m_passedEvent = true;
54  return false;
55  }
56 
57  ++nEmissions;
58  }
59 
60  if(nMPI == m_nMPIVeto && !m_passedEvent){
61  // std::cout<<"Vetoing event on too-little MPI"<<std::endl;
62  return true;
63  }
64 
65  return false;
66  }
67 
68  bool doVetoPartonLevel(const Event&){
69  if(m_passedEvent) return false;
70 
71  return true;
72  }
73 
75  bool canVetoMPIStep(){return true;}
86  bool canVetoISREmission(){return false;}
88  bool canVetoFSREmission(){return false;}
90  bool canVetoPartonLevel(){return true;}
91 
92  private:
93 
95 
97 
99 
100  };
101 
102 
103 
104 }
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
Pythia8::EnhanceMPI::m_nMPIVeto
int m_nMPIVeto
Definition: EnhanceMPI.cxx:98
Pythia8::EnhanceMPI::m_pTCut
Pythia8_UserHooks::UserSetting< double > m_pTCut
Definition: EnhanceMPI.cxx:94
Event
Definition: trigbs_orderedMerge.cxx:42
Pythia8::EnhanceMPI::canVetoISREmission
bool canVetoISREmission()
Switch on veto of ISR.
Definition: EnhanceMPI.cxx:86
Pythia8::EnhanceMPI::canVetoFSREmission
bool canVetoFSREmission()
Switch off veto of FSR.
Definition: EnhanceMPI.cxx:88
Pythia8::EnhanceMPI::m_passedEvent
bool m_passedEvent
Definition: EnhanceMPI.cxx:96
Pythia8_UserHooks::UserHooksFactory::Creator
Definition: UserHooksFactory.h:54
UserHooksFactory.h
Pythia8
Author: James Monk (jmonk@cern.ch)
Definition: IPythia8Custom.h:13
Pythia8_UserHooks::UserSetting< double >
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
Pythia8::EnhanceMPI::doVetoPartonLevel
bool doVetoPartonLevel(const Event &)
Definition: EnhanceMPI.cxx:68
UserSetting.h
UserHooksUtils.h
Pythia8::EnhanceMPI
Definition: EnhanceMPI.cxx:19
Pythia8::EnhanceMPI::EnhanceMPI
EnhanceMPI()
Definition: EnhanceMPI.cxx:23
Pythia8::EnhanceMPI::numberVetoMPIStep
int numberVetoMPIStep()
Call doVetoMIStep three times First is the hard process second is first MPI emission or the second pa...
Definition: EnhanceMPI.cxx:84
merge.status
status
Definition: merge.py:17
Pythia8::EnhanceMPI::canVetoPartonLevel
bool canVetoPartonLevel()
Check the event after the generation of the parton level but before hadronisation.
Definition: EnhanceMPI.cxx:90
Pythia8::EnhanceMPI::~EnhanceMPI
~EnhanceMPI()
Definition: EnhanceMPI.cxx:34
Pythia8::EnhanceMPI::canVetoMPIStep
bool canVetoMPIStep()
Switch on calling of doVetoMPIStep.
Definition: EnhanceMPI.cxx:75
Pythia8::EnhanceMPI::doVetoMPIStep
bool doVetoMPIStep(int nMPI, const Event &event)
Definition: EnhanceMPI.cxx:36
EnhanceMPICreator
Pythia8_UserHooks::UserHooksFactory::Creator< Pythia8::EnhanceMPI > EnhanceMPICreator("EnhanceMPI")