ATLAS Offline Software
UserPhotonFlux.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 #include "UserPhotonFlux.h"
5 
6  UserPhotonFlux::UserPhotonFlux(const std::string& type, const std::string& name, const IInterface* parent) :
8  {
9  declareInterface<IPythia8Custom>(this);
10  declareProperty("Process", m_process=1);
11  declareProperty("NuclearCharge", m_flux_Z=82.);
12  declareProperty("MinimumB", m_flux_min_b=13.24);
13  declareProperty("MinimumX", m_flux_min_x=-1);//default applies no cut since sampled x's always >0.
14  }
15 
16 
18  ATH_MSG_INFO( "Initialisation of " << name() << " was successful" );
19  return StatusCode::SUCCESS;
20  }
21 
23 
24  ATH_MSG_INFO( "InitializePythiaInfo " << name() << " with process " << m_process);
25  if (m_process == 1) {
26  PDFPtr photonFlux = PNEW(Lepton2gamma2, -11);
27  pythia.setPhotonFluxPtr(photonFlux, 0);
28  return StatusCode::SUCCESS;
29  }
30  else if(m_process ==2 || m_process ==3) {
31  ATH_MSG_INFO( "InitializePythiaInfo " << name() << " using nuclear photon flux with Z = " << m_flux_Z << ", bmin = " << m_flux_min_b);
32  Nucleus2gammaPtr photonFlux = PNEW(Nucleus2gamma2,-11);
33  photonFlux->setZ(m_flux_Z);
34  photonFlux->setMinB(m_flux_min_b);
35  photonFlux->setMinX(m_flux_min_x);
36  Nucleus2gammaPtr photonFlux2 = nullptr; PNEW(Nucleus2gamma2,-11);
37  if(m_process==3) photonFlux2=photonFlux;
38  pythia.setPhotonFluxPtr(photonFlux, photonFlux2);
39  return StatusCode::SUCCESS;
40  }
41  else {
42  ATH_MSG_ERROR("Unknown process: "<< m_process);
43  return StatusCode::FAILURE;
44  }
45 
46  }
47 
49  ATH_MSG_INFO( "Finalize" << name());
50  return StatusCode::SUCCESS;
51  }
52 
53 
55  return StatusCode::SUCCESS;
56  }
57 
59  ATH_MSG_INFO( "CrossSectionScaleFactor" << name());
60  return 1.0;
61  }
62 
63 
64 
UserPhotonFlux::finalize
StatusCode finalize() override
AlgTool finalize method.
Definition: UserPhotonFlux.cxx:48
UserPhotonFlux::ModifyPythiaEvent
StatusCode ModifyPythiaEvent(Pythia8::Pythia &pythia) const override
Update the pythia event Probably not used for this application.
Definition: UserPhotonFlux.cxx:54
UserPhotonFlux::m_flux_min_x
double m_flux_min_x
Definition: UserPhotonFlux.h:110
Nucleus2gamma2::setMinX
void setMinX(double in_min_x)
Definition: UserPhotonFlux.h:64
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
Lepton2gamma2
Definition: UserPhotonFlux.h:22
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
bTosllAli.Pythia
Pythia
Definition: bTosllAli.py:46
UserPhotonFlux::CrossSectionScaleFactor
virtual double CrossSectionScaleFactor() const override
Return how much the cross section is modified.
Definition: UserPhotonFlux.cxx:58
Nucleus2gamma2::setMinB
void setMinB(double in_min_b)
Definition: UserPhotonFlux.h:63
UserPhotonFlux::m_flux_min_b
double m_flux_min_b
Definition: UserPhotonFlux.h:109
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
Nucleus2gamma2::setZ
void setZ(double in_Z)
Definition: UserPhotonFlux.h:62
test_pyathena.parent
parent
Definition: test_pyathena.py:15
UserPhotonFlux::InitializePythiaInfo
StatusCode InitializePythiaInfo(Pythia8::Pythia &) const override
Definition: UserPhotonFlux.cxx:22
UserPhotonFlux::initialize
StatusCode initialize() override
AlgTool initialize method.
Definition: UserPhotonFlux.cxx:17
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
Nucleus2gamma2
Definition: UserPhotonFlux.h:35
PDFPtr
PDF * PDFPtr
Definition: UserPhotonFlux.h:125
UserPhotonFlux.h
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
UserPhotonFlux::m_process
int m_process
Definition: UserPhotonFlux.h:107
UserPhotonFlux::UserPhotonFlux
UserPhotonFlux(const std::string &, const std::string &, const IInterface *)
AlgTool style constructor.
Definition: UserPhotonFlux.cxx:6
UserPhotonFlux::m_flux_Z
double m_flux_Z
Definition: UserPhotonFlux.h:108
AthAlgTool
Definition: AthAlgTool.h:26
PNEW
#define PNEW(X, Y)
Definition: UserPhotonFlux.h:126