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

#include <Starlight_i.h>

Inheritance diagram for Starlight_i:
Collaboration diagram for Starlight_i:

Public Member Functions

 Starlight_i (const std::string &name, ISvcLocator *pSvcLocator)
virtual ~Starlight_i ()
virtual StatusCode genInitialize ()
 For initializing the generator, if required.
virtual StatusCode callGenerator ()
 For calling the generator on each iteration of the event loop.
virtual StatusCode genFinalize ()
 For finalising the generator, if required.
virtual StatusCode fillEvt (HepMC::GenEvent *evt)
 For filling the HepMC event object.
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const
Event loop algorithm methods: not to be overloaded
StatusCode initialize ()
StatusCode execute (const EventContext &ctx)
 Execute method.
StatusCode finalize ()
Gen-specific event loop methods: to be overloaded
virtual StatusCode genuserInitialize ()
 For initialization of user code, if required. Called after genInitialize.
Event collection accessors (const and non-const)
HepMC::GenEvent *event ATLAS_NOT_CONST_THREAD_SAFE ()
 Access the current signal event (first in the McEventCollection).
McEventCollection *events ATLAS_NOT_CONST_THREAD_SAFE ()
 Access the current event's McEventCollection.
const HepMC::GenEvent * event_const (const EventContext &ctx) const
 Access the current signal event (const).
const McEventCollection * events_const (const EventContext &ctx) const
 Access the current event's McEventCollection (const).

Protected Member Functions

bool starlight2lhef ()
bool set_user_params ()
bool prepare_params_file ()
virtual bool isReEntrant () const override final
 Legacy algorithms are not thread-safe.
void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

IntegerProperty m_dsid {this, "Dsid", 999999, "Dataset ID number"}
StringProperty m_configFileName {this, "ConfigFileName", ""}
BooleanProperty m_lheOutput {this, "lheOutput", false}
UnsignedIntegerProperty m_maxevents {this, "maxevents", 5500}
BooleanProperty m_doTauolappLheFormat {this, "doTauolappLheFormat", false}
BooleanProperty m_suppressVMdecay {this, "suppressVMdecay", false}
StringArrayProperty m_InitializeVector
int m_events {0}
std::unique_ptr< starlight > m_starlight {}
std::shared_ptr< randomGenerator > m_randomGenerator {}
inputParameters m_inputParameters
double m_axionMass {1.}
std::variant< std::unique_ptr< upcEvent >, std::unique_ptr< upcXEvent > > m_event {}
DoubleProperty m_beam1_energy {this,"beam1Energy", 2.51e+03}
DoubleProperty m_beam2_energy {this,"beam2Energy", 2.51e+03}
unsigned int m_beam1Z {0}
unsigned int m_beam1A {0}
unsigned int m_beam2Z {0}
unsigned int m_beam2A {0}
double m_beam1Gamma {0.}
double m_beam2Gamma {0.}
double m_maxW {0.}
double m_minW {0.}
unsigned int m_nmbWBins {0}
double m_maxRapidity {0.}
unsigned int m_nmbRapidityBins {0}
bool m_accCutPt {false}
double m_minPt {0.}
double m_maxPt {0.}
bool m_accCutEta {false}
double m_minEta {0.}
double m_maxEta {0.}
int m_productionMode {0}
unsigned int m_nmbEventsTot {0}
int m_prodParticleId {0}
int m_outputFormat {0}
int m_beamBreakupMode {0}
bool m_interferenceEnabled {false}
double m_interferenceStrength {0.}
bool m_coherentProduction {false}
double m_incoherentFactor {0.}
double m_maxPtInterference {0.}
int m_nmbPtBinsInterference {0}
double m_ptBinWidthInterference {0.}
bool m_xsecMethod {false}
int m_nThreads {1}
bool m_pythFullRec {false}

Private Types

typedef ServiceHandle< StoreGateSvc > StoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Features for derived classes to use internally

IntegerProperty m_randomSeed {this, "RandomSeed", 1234567, "Random seed for the built-in random engine"}
 Seed for random number engine.
BooleanProperty m_isAfterburner {this, "IsAfterburner", false, "Set true if generator modifies existing events rather than creating new ones"}
 Flag for normal vs. afterburner generators.
std::shared_ptr< HepMC3::GenRunInfo > m_runinfo {}
 The run info for HepMC3.
CLHEP::HepRandomEngine * getRandomEngine (const std::string &streamName, const EventContext &ctx) const
CLHEP::HepRandomEngine * getRandomEngine (const std::string &streamName, unsigned long int randomSeedOffset, const EventContext &ctx) const
CLHEP::HepRandomEngine * getRandomEngineDuringInitialize (const std::string &streamName, unsigned long int randomSeedOffset, unsigned int conditionsRun=1, unsigned int lbn=1) const
ServiceHandle< IAthRNGSvc > m_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
 Data members.
ServiceHandle< IIncidentSvc > m_incidentSvc {this, "IncidentSvc", "IncidentSvc"}
 Handle on the incident service.

Properties

std::string m_mcEventKey {}
 StoreGate key for the MC event collection (defaults to GEN_EVENT).
BooleanProperty m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"}
 Flag to determine if a new MC event collection should be made if it doesn't exist.
SG::ReadHandleKey< McEventCollection > m_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" }
 Const handle to the MC event collection.

Detailed Description

Definition at line 31 of file Starlight_i.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 376 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ Starlight_i()

Starlight_i::Starlight_i ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 45 of file Starlight_i.cxx.

45 :
46 GenModule(name,pSvcLocator)
47{
48}
GenModule(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
Definition GenModule.cxx:14

◆ ~Starlight_i()

Starlight_i::~Starlight_i ( )
virtual

Definition at line 50 of file Starlight_i.cxx.

50 {
51}

Member Function Documentation

◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/2]

McEventCollection *events GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inherited

Access the current event's McEventCollection.

Note
This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.

◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]

HepMC::GenEvent *event GenBase::ATLAS_NOT_CONST_THREAD_SAFE ( )
inlineinherited

Access the current signal event (first in the McEventCollection).

Note
This function will make a new McEventCollection if there is not already a valid one and MakeMcEvent=True.

Definition at line 72 of file GenBase.h.

72 {
73 if (events()->empty())
74 ATH_MSG_ERROR("McEventCollection is empty during first event access");
75 return *(events()->begin());
76 }
#define ATH_MSG_ERROR(x,...)
static const Attributes_t empty

◆ callGenerator()

StatusCode Starlight_i::callGenerator ( )
virtual

For calling the generator on each iteration of the event loop.

Reimplemented from GenModule.

Definition at line 91 of file Starlight_i.cxx.

92{
93 if(m_lheOutput) return StatusCode::SUCCESS;
94 ATH_MSG_DEBUG( " STARLIGHT generating. \n" );
95
96 //Re-seed the random number stream
97 long seeds[7];
98 const EventContext& ctx = Gaudi::Hive::currentContext();
99 ATHRNG::calculateSeedsMC21(seeds, starlight_stream, ctx.eventID().event_number(),
101 m_randomGenerator->SetSeed(seeds[0]);
102
103 // Generate event
104 if(m_productionMode >= starlightConstants::PHOTONUCLEARSINGLE)
105 m_event = std::make_unique<upcEvent>(m_starlight->produceUpcEvent());
106 else
107 m_event = std::make_unique<upcXEvent>(m_starlight->produceEvent());
108
109 // get particle vector from m_event whether it is upcEvent or upcXEvent
110 const std::vector<starlightParticle>* particleCollection = std::visit(
111 [](auto& _evt) { return _evt->getParticles(); }, m_event
112 );
113
114 // update event counter
115 ++m_events;
116
117 int numberofTracks = particleCollection->size();
118 int numberOfVertices = 1; //m_event->getVertices()->size();
119
120 ATH_MSG_DEBUG( "EVENT: " << m_events << " "
121 << " with " << numberOfVertices << " vertices "
122 << " and " << numberofTracks << " tracks" );
123 ATH_MSG_DEBUG( "VERTEX: "<< 0. << " " << 0. << " " << 0.
124 << " with " << numberofTracks << " tracks" );
125
126 int ipart = 0;
127 std::vector<starlightParticle>::const_iterator part =
128 particleCollection->begin();
129 for (part = particleCollection->begin();
130 part != particleCollection->end(); ++part, ++ipart) {
131 ATH_MSG_DEBUG( "TRACK: " << " "
132 << starlightParticleCodes::jetsetToGeant((*part).getCharge() * (*part).getPdgCode()) << " "
133 << (*part).GetPx() << " " << (*part).GetPy() << " "<< (*part).GetPz()
134 << " " << m_events << " " << ipart << " " << 0 << " "
135 << (*part).getCharge() * (*part).getPdgCode() );
136 }
137
138 ATH_MSG_DEBUG( " Starlight generating done. \n" );
139
140 return StatusCode::SUCCESS;
141}
#define ATH_MSG_DEBUG(x,...)
IntegerProperty m_randomSeed
Seed for random number engine.
Definition GenModule.h:84
int m_productionMode
Definition Starlight_i.h:86
BooleanProperty m_lheOutput
Definition Starlight_i.h:44
IntegerProperty m_dsid
Definition Starlight_i.h:42
std::unique_ptr< starlight > m_starlight
Definition Starlight_i.h:56
std::variant< std::unique_ptr< upcEvent >, std::unique_ptr< upcXEvent > > m_event
Definition Starlight_i.h:63
std::shared_ptr< randomGenerator > m_randomGenerator
Definition Starlight_i.h:57
void calculateSeedsMC21(long *seeds, const std::string &algName, uint64_t ev, uint64_t run, uint64_t offset=0)
Set the random seed using a string (e.g.

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ event_const()

const HepMC::GenEvent * GenBase::event_const ( const EventContext & ctx) const
inlineinherited

Access the current signal event (const).

Definition at line 79 of file GenBase.h.

79 {
80 const McEventCollection* coll = events_const(ctx);
81 if (coll->empty())
82 ATH_MSG_ERROR("Const McEventCollection is empty during first event access");
83 return *(coll->begin());
84 }
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
bool empty() const noexcept
Returns true if the collection is empty.
const McEventCollection * events_const(const EventContext &ctx) const
Access the current event's McEventCollection (const).
Definition GenBase.h:93

◆ events_const()

const McEventCollection * GenBase::events_const ( const EventContext & ctx) const
inlineinherited

Access the current event's McEventCollection (const).

Definition at line 93 of file GenBase.h.

93 {
94 SG::ReadHandle<McEventCollection> ret = SG::makeHandle(m_mcevents_const, ctx);
95 if (!ret.isValid())
96 ATH_MSG_ERROR("No McEventCollection found in StoreGate with key " << m_mcevents_const.key());
97 return ret.cptr();
98 }
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition GenBase.h:117
virtual bool isValid() override final
Can the handle be successfully dereferenced?
const_pointer_type cptr()
Dereference the pointer.
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode GenModule::execute ( const EventContext & ctx)
virtualinherited

Execute method.

Todo
Remove hard-coded alg name checking (already incomplete)

Reimplemented from GenBase.

Definition at line 70 of file GenModule.cxx.

70 {
71 // Examples of how to retrieve the random number engine for a given
72 // stream.
73 // NB getRandomEngine should only be called once per event for a
74 // given stream, as it causes the stream to be re-seeded each time
75 // it is called.
76
77 // Example 1 - seeded based on the current event number (+ slot, run, streamName)
78 //CLHEP::HepRandomEngine* rndmEngine = this->getRandomEngine("MyStream", ctx);
79
80 // Example 2 - seeded based on the m_randomSeed property (+ slot, run, streamName)
81 //CLHEP::HepRandomEngine* rndmEngine = this->getRandomEngine("MyStream", m_randomSeed.value(), ctx);
82
83 // Call the code that generates an event
84 CHECK(this->callGenerator());
85
86 // Create the MC event and send the GeneratorEvent stored in it to fillEvt
88 CHECK(this->fillEvt(evt));
90
91 // Add the event to the MC event collection
92 if (events()) {
93 // If this is an "afterburner" generator, replace the last event rather than add a new one
95 if (m_isAfterburner.value() || name() == "Tauola" || name() == "Photos") {
96 events()->pop_back();
97 }
98 // Add the event to the end of the collection
99 events()->push_back(evt);
100 ATH_MSG_DEBUG("MC event added to McEventCollection");
101
102 // remove the empty event in case of ParticleDecayer
103 if (name() == "ParticleDecayer") {
104 events()->pop_back();
105 }
106 }
107
108 // Call the incident service to notify that an event has been made
109 m_incidentSvc->fireIncident( Incident(name(), "McEventGenerated") );
110 return StatusCode::SUCCESS;
111}
#define CHECK(...)
Evaluate an expression and check for errors.
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle on the incident service.
Definition GenModule.h:99
virtual StatusCode callGenerator()
For calling the generator on each iteration of the event loop.
Definition GenModule.h:66
virtual StatusCode fillEvt(HepMC::GenEvent *evt)=0
For filling the HepMC event object.
BooleanProperty m_isAfterburner
Flag for normal vs. afterburner generators.
Definition GenModule.h:87
void fillBarcodesAttribute(GenEvent *e)
Definition GenEvent.h:396
GenEvent * newGenEvent(const int signal_process_id, const int event_number)
Definition GenEvent.h:363
HepMC3::GenEvent GenEvent
Definition GenEvent.h:39

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ fillEvt()

StatusCode Starlight_i::fillEvt ( HepMC::GenEvent * evt)
virtual

For filling the HepMC event object.

Implements GenModule.

Definition at line 152 of file Starlight_i.cxx.

153{
154 if(m_lheOutput) return StatusCode::SUCCESS;
155 ATH_MSG_DEBUG( " STARLIGHT Filing. \n" );
156
157 // Set the event number
158 evt->set_event_number( m_events );
159
160 // Create the event vertex
162 evt->add_vertex( v1 );
163
164 // get all final particles
165 const std::vector<starlightParticle>* particleCollection = std::visit(
166 [](auto& _evt) { return _evt->getParticles(); }, m_event
167 );
168
169 // Loop on all final particles and
170 // put them all as outgoing from the event vertex
171 int ipart = 0;
172 std::vector<starlightParticle>::const_iterator part =
173 particleCollection->begin();
174 double px_tot=0;
175 double py_tot=0;
176 double pz_tot=0;
177 for (part = particleCollection->begin();
178 part != particleCollection->end(); ++part, ++ipart)
179 {
180 int pid = (*part).getPdgCode();
181 int charge = (*part).getCharge();
182 //AO special for pid sign stored in charge
183 int pidsign = pid/std::abs(pid);
184 int chsign = 0;
185 if (charge !=0) chsign = charge/std::abs(charge);
186 if( chsign != pidsign && chsign != 0) pid = -pid;
187
188 double px = (*part).GetPx();
189 double py = (*part).GetPy();
190 double pz = (*part).GetPz();
191 double e = (*part).GetE();
192 // mass fix implemented only for muons
193 if(std::abs(pid)==13) {
194 float mass = m_inputParameters.muonMass();//0.1056583715;// starlightConstants::muonMass;
195 e = std::sqrt(px*px + py*py + pz*pz + mass*mass);
196 }
197 // mass fix for photons (ALPs)
198 if(std::abs(pid)==22) {
199 e = std::sqrt(px*px + py*py + pz*pz);
200 }
201
202 ATH_MSG_DEBUG( "saving particle " << ipart );
203 px_tot+=px;
204 py_tot+=py;
205 pz_tot+=pz;
206
207 if(!m_suppressVMdecay) v1->add_particle_out(
208 HepMC::newGenParticlePtr(HepMC::FourVector(px, py, pz, e), pid, 1) );
209 }
211 int pid = 113;
212 double mass = 0.770;
213 if(m_prodParticleId == 443011 || m_prodParticleId == 443013){
214 pid = 443;
215 mass = 3.0969;
216 }
217 if(m_prodParticleId == 444011 || m_prodParticleId == 444013){
218 pid = 100443;
219 mass = 3.6861;
220 }
221 if(m_prodParticleId == 553011 || m_prodParticleId == 553013){
222 pid = 553;
223 mass = 9.4604;
224 }
225 if(m_prodParticleId == 554011 || m_prodParticleId == 554013){
226 pid = 100553;
227 mass = 10.023;
228 }
229 if(m_prodParticleId == 555011 || m_prodParticleId == 555013){
230 pid = 200553;
231 mass = 10.355;
232 }
233 double e = sqrt(px_tot*px_tot + py_tot*py_tot + pz_tot*pz_tot + mass*mass);
234 v1->add_particle_out(
235 HepMC::newGenParticlePtr(HepMC::FourVector(px_tot, py_tot, pz_tot, e), pid, 1) );
236 }
237 ATH_MSG_DEBUG( "Saved " << ipart << " tracks " );
238
239 // Add beam particles
240 int beam1pid = 1000000000 + m_beam1Z*10000 + m_beam1A*10;
241 int beam2pid = 1000000000 + m_beam2Z*10000 + m_beam2A*10;
242
243 HepMC::GenParticlePtr b1 = std::make_shared<HepMC::GenParticle>(HepMC::FourVector(0, 0, m_beam1_energy.value(), m_beam1_energy.value()), beam1pid, 4);
244 HepMC::GenParticlePtr b2 = std::make_shared<HepMC::GenParticle>(HepMC::FourVector(0, 0, -m_beam2_energy.value(), m_beam2_energy.value()), beam2pid, 4);
245
246 v1->add_particle_in(b1);
247 v1->add_particle_in(b2);
248
249 // Conversion GeV -> MeV to ensure correct units
250 evt->set_units(HepMC3::Units::MEV, HepMC3::Units::MM);
251
252 return StatusCode::SUCCESS;
253}
double charge(const T &p)
Definition AtlasPID.h:1008
unsigned int m_beam1A
Definition Starlight_i.h:70
unsigned int m_beam2A
Definition Starlight_i.h:72
DoubleProperty m_beam1_energy
Definition Starlight_i.h:66
DoubleProperty m_beam2_energy
Definition Starlight_i.h:67
unsigned int m_beam2Z
Definition Starlight_i.h:71
int m_prodParticleId
Definition Starlight_i.h:88
inputParameters m_inputParameters
Definition Starlight_i.h:58
unsigned int m_beam1Z
Definition Starlight_i.h:69
BooleanProperty m_suppressVMdecay
Definition Starlight_i.h:47
HepMC3::FourVector FourVector
GenParticlePtr newGenParticlePtr(const HepMC3::FourVector &mom=HepMC3::FourVector::ZERO_VECTOR(), int pid=0, int status=0)
Definition GenParticle.h:21
HepMC3::GenParticlePtr GenParticlePtr
Definition GenParticle.h:19
GenVertexPtr newGenVertexPtr(const HepMC3::FourVector &pos=HepMC3::FourVector::ZERO_VECTOR(), const int i=0)
Definition GenVertex.h:25
HepMC3::GenVertexPtr GenVertexPtr
Definition GenVertex.h:23

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ finalize()

StatusCode GenModule::finalize ( )
inlineinherited

Definition at line 55 of file GenModule.h.

55{ return genFinalize(); }
virtual StatusCode genFinalize()
For finalising the generator, if required.
Definition GenModule.h:70

◆ genFinalize()

StatusCode Starlight_i::genFinalize ( )
virtual

For finalising the generator, if required.

Reimplemented from GenModule.

Definition at line 144 of file Starlight_i.cxx.

145{
146 ATH_MSG_DEBUG( " STARLIGHT Ending. \n" );
147
148 return StatusCode::SUCCESS;
149}

◆ genInitialize()

StatusCode Starlight_i::genInitialize ( )
virtual

For initializing the generator, if required.

Reimplemented from GenModule.

Definition at line 53 of file Starlight_i.cxx.

54{
55 // Initialisation of input parameters
56 //
57 ATH_MSG_INFO( "===> January 20 2011 STARLIGHT INTERFACE VERSION. \n" );
58 ATH_MSG_INFO( "===> STARLIGHT INITIALISING. \n" );
59
60 //Re-seed the random number stream
61 long seeds[7];
62 ATHRNG::calculateSeedsMC21(seeds, starlight_stream, 0, m_dsid, m_randomSeed);
63
64 // Create inputParameters and
65 // set the users' initialisation parameters choices
66 bool res = set_user_params();
67 if( !res ) {
68 return StatusCode::FAILURE;
69 }
70
71 // create the starlight object
72 m_starlight = std::make_unique<starlight>();
73 // Set random generator to prevent crash in tests.
74 m_randomGenerator = std::make_shared<randomGenerator>();
75 m_randomGenerator->SetSeed(seeds[0]);
76 m_starlight->setRandomGenerator(m_randomGenerator.get());
77 // set input parameters
78 m_starlight->setInputParameters(&m_inputParameters);
79 // and initialize
80 m_starlight->init();
81
82 // dump events to lhef (needed for QED showering with Pythia8
83 if(m_lheOutput){
84 ATH_MSG_INFO("===> dumping starlight events to lhef format. \n" );
85 if(!starlight2lhef()) return StatusCode::FAILURE;
86 }
87
88 return StatusCode::SUCCESS;
89}
#define ATH_MSG_INFO(x,...)
std::pair< std::vector< unsigned int >, bool > res
bool set_user_params()
bool starlight2lhef()

◆ genuserInitialize()

virtual StatusCode GenModule::genuserInitialize ( )
inlinevirtualinherited

For initialization of user code, if required. Called after genInitialize.

Reimplemented in Pythia8B_i.

Definition at line 64 of file GenModule.h.

64{ return StatusCode::SUCCESS; }

◆ getRandomEngine() [1/2]

CLHEP::HepRandomEngine * GenModule::getRandomEngine ( const std::string & streamName,
const EventContext & ctx ) const
protectedinherited

Definition at line 34 of file GenModule.cxx.

36{
37 ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, streamName);
38 std::string rngName = name()+streamName;
39 rngWrapper->setSeed( rngName, ctx );
40 return rngWrapper->getEngine(ctx);
41}
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
Definition RNGWrapper.h:154
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:108
ServiceHandle< IAthRNGSvc > m_rndmSvc
Data members.
Definition GenModule.h:97

◆ getRandomEngine() [2/2]

CLHEP::HepRandomEngine * GenModule::getRandomEngine ( const std::string & streamName,
unsigned long int randomSeedOffset,
const EventContext & ctx ) const
protectedinherited

Definition at line 44 of file GenModule.cxx.

46{
47 ATHRNG::RNGWrapper* rngWrapper = m_rndmSvc->getEngine(this, streamName);
48 rngWrapper->setSeed( streamName, ctx.slot(), randomSeedOffset, ctx.eventID().run_number() );
49 return rngWrapper->getEngine(ctx);
50}

◆ getRandomEngineDuringInitialize()

CLHEP::HepRandomEngine * GenModule::getRandomEngineDuringInitialize ( const std::string & streamName,
unsigned long int randomSeedOffset,
unsigned int conditionsRun = 1,
unsigned int lbn = 1 ) const
protectedinherited

Definition at line 53 of file GenModule.cxx.

54{
55 const size_t slot=0;
56 EventContext ctx;
57 ctx.setSlot( slot );
58 ctx.setEventID (EventIDBase (conditionsRun,
59 EventIDBase::UNDEFEVT, // event
60 EventIDBase::UNDEFNUM, // timestamp
61 EventIDBase::UNDEFNUM, // timestamp ns
62 lbn));
64 Atlas::ExtendedEventContext( evtStore()->hiveProxyDict(),
65 conditionsRun) );
66 return getRandomEngine(streamName, randomSeedOffset, ctx);
67}
ServiceHandle< StoreGateSvc > & evtStore()
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
Definition GenModule.cxx:34
void setExtendedEventContext(EventContext &ctx, ExtendedEventContext &&ectx)
Move an extended context into a context object.

◆ initialize()

StatusCode GenModule::initialize ( )
virtualinherited

Reimplemented from GenBase.

Definition at line 21 of file GenModule.cxx.

21 {
22 // Base class initializations
24 // Get the random number service
25 CHECK(m_rndmSvc.retrieve());
26 // Get the incident service
27 CHECK(m_incidentSvc.retrieve());
30 return StatusCode::SUCCESS;
31}
virtual StatusCode initialize() override
Definition GenBase.cxx:17
virtual StatusCode genuserInitialize()
For initialization of user code, if required. Called after genInitialize.
Definition GenModule.h:64
virtual StatusCode genInitialize()
For initializing the generator, if required.
Definition GenModule.h:62

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ isReEntrant()

virtual bool AthAlgorithm::isReEntrant ( ) const
inlinefinaloverrideprotectedvirtualinherited

Legacy algorithms are not thread-safe.

Definition at line 47 of file AthAlgorithm.h.

47{ return false; }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ prepare_params_file()

bool Starlight_i::prepare_params_file ( )
protected

Definition at line 394 of file Starlight_i.cxx.

395{
396 // Write initialization parameters to tmp file
397
398 for(CommandVector::iterator i = m_InitializeVector.begin(); i != m_InitializeVector.end(); ++i )
399 {
400 ATH_MSG_INFO( " Command is: " << *i );
401
402 StringParse mystring(*i);
403 std::string myparam = mystring.piece<std::string>(1);
404 if (myparam == "beam1Z")
405 {
406 m_beam1Z = mystring.piece<double>(2);
407 }
408 else if (myparam == "beam1A")
409 {
410 m_beam1A = mystring.piece<double>(2);
411 }
412 else if (myparam == "beam2Z")
413 {
414 m_beam2Z = mystring.piece<double>(2);
415 }
416 else if (myparam == "beam2A")
417 {
418 m_beam2A = mystring.piece<double>(2);
419 }
420 else if (myparam == "beam1Gamma")
421 {
422 m_beam1Gamma = mystring.piece<double>(2);
423 }
424 else if (myparam == "beam2Gamma")
425 {
426 m_beam2Gamma = mystring.piece<double>(2);
427 }
428 else if (myparam == "maxW")
429 {
430 m_maxW = mystring.piece<double>(2);
431 }
432 else if (myparam == "minW")
433 {
434 m_minW = mystring.piece<double>(2);
435 }
436 else if (myparam == "nmbWBins")
437 {
438 m_nmbWBins = mystring.piece<double>(2);
439 }
440 else if (myparam == "maxRapidity")
441 {
442 m_maxRapidity = mystring.piece<double>(2);
443 }
444 else if (myparam == "nmbRapidityBins")
445 {
446 m_nmbRapidityBins = mystring.piece<double>(2);
447 }
448 else if (myparam == "accCutPt")
449 {
450 m_accCutPt = mystring.piece<double>(2);
451 }
452 else if (myparam == "minPt")
453 {
454 m_minPt = mystring.piece<double>(2);
455 }
456 else if (myparam == "maxPt")
457 {
458 m_maxPt = mystring.piece<double>(2);
459 }
460 else if (myparam == "accCutEta")
461 {
462 m_accCutEta = mystring.piece<double>(2);
463 }
464 else if (myparam == "minEta")
465 {
466 m_minEta = mystring.piece<double>(2);
467 }
468 else if (myparam == "maxEta")
469 {
470 m_maxEta = mystring.piece<double>(2);
471 }
472 else if (myparam == "productionMode")
473 {
474 m_productionMode = mystring.piece<double>(2);
475 }
476 else if (myparam == "axionMass")
477 {
478 m_axionMass = mystring.piece<double>(2);
479 }
480 else if (myparam == "nmbEventsTot")
481 {
482 m_nmbEventsTot = mystring.piece<double>(2);
483 }
484 else if (myparam == "prodParticleId")
485 {
486 m_prodParticleId = mystring.piece<double>(2);
487 }
488 else if (myparam == "randomSeed")
489 {
490 m_randomSeed = mystring.piece<double>(2);
491 }
492 else if (myparam == "outputFormat")
493 {
494 m_outputFormat = mystring.piece<double>(2);
495 }
496 else if (myparam == "beamBreakupMode")
497 {
498 m_beamBreakupMode = mystring.piece<double>(2);
499 }
500 else if (myparam == "interferenceEnabled")
501 {
502 m_interferenceEnabled = mystring.piece<double>(2);
503 }
504 else if (myparam == "interferenceStrength")
505 {
506 m_interferenceStrength = mystring.piece<double>(2);
507 }
508 else if (myparam == "coherentProduction")
509 {
510 m_coherentProduction = mystring.piece<double>(2);
511 }
512 else if (myparam == "incoherentFactor")
513 {
514 m_incoherentFactor = mystring.piece<double>(2);
515 }
516 else if (myparam == "maxPtInterference")
517 {
518 m_maxPtInterference = mystring.piece<double>(2);
519 }
520 else if (myparam == "nmbPtBinsInterference")
521 {
522 m_nmbPtBinsInterference = mystring.piece<double>(2);
523 }
524 else if (myparam == "xsecMethod")
525 {
526 m_xsecMethod = mystring.piece<double>(2);
527 }
528 else if (myparam == "nThreads")
529 {
530 m_nThreads = mystring.piece<double>(2);
531 }
532 else if (myparam == "pythFullRec")
533 {
534 m_pythFullRec = mystring.piece<double>(2);
535 }
536 else
537 {
538 ATH_MSG_ERROR( " ERROR in STARLIGHT INITIALIZATION PARAMETERS "
539 << myparam << " is an invalid parameter !" );
540 return false;
541 }
542 }
543
544 std::ofstream configFile;
545 configFile.open(m_configFileName.value().c_str());
546
547 configFile << "BEAM_1_Z = " << m_beam1Z << std::endl;
548 configFile << "BEAM_1_A = " << m_beam1A << std::endl;
549 configFile << "BEAM_2_Z = " << m_beam2Z << std::endl;
550 configFile << "BEAM_2_A = " << m_beam2A << std::endl;
551 configFile << "BEAM_1_GAMMA = " << m_beam1Gamma << std::endl;
552 configFile << "BEAM_2_GAMMA = " << m_beam2Gamma << std::endl;
553 configFile << "W_MAX = " << m_maxW << std::endl;
554 configFile << "W_MIN = " << m_minW << std::endl;
555 configFile << "W_N_BINS = " << m_nmbWBins << std::endl;
556 configFile << "RAP_MAX = " << m_maxRapidity << std::endl;
557 configFile << "RAP_N_BINS = " << m_nmbRapidityBins << std::endl;
558 configFile << "CUT_PT = " << m_accCutPt << std::endl;
559 configFile << "PT_MIN = " << m_minPt << std::endl;
560 configFile << "PT_MAX = " << m_maxPt << std::endl;
561 configFile << "CUT_ETA = " << m_accCutEta << std::endl;
562 configFile << "ETA_MIN = " << m_minEta << std::endl;
563 configFile << "ETA_MAX = " << m_maxEta << std::endl;
564 configFile << "PROD_MODE = " << m_productionMode << std::endl;
565 configFile << "AXION_MASS = " << m_axionMass << std::endl;
566 configFile << "N_EVENTS = " << m_nmbEventsTot << std::endl;
567 configFile << "PROD_PID = " << m_prodParticleId << std::endl;
568 configFile << "RND_SEED = " << m_randomSeed.value() << std::endl;
569 configFile << "BREAKUP_MODE = " << m_beamBreakupMode << std::endl;
570 configFile << "INTERFERENCE = " << m_interferenceEnabled << std::endl;
571 configFile << "IF_STRENGTH = " << m_interferenceStrength << std::endl;
572 configFile << "INT_PT_MAX = " << m_maxPtInterference << std::endl;
573 configFile << "INT_PT_N_BINS = " << m_nmbPtBinsInterference << std::endl;
574 configFile << "COHERENT = " << m_coherentProduction << std::endl;
575 configFile << "INCO_FACTOR = " << m_incoherentFactor << std::endl;
576 configFile << "XSEC_METHOD = " << m_xsecMethod << std::endl;
577 configFile << "N_THREADS = " << m_nThreads << std::endl;
578 configFile << "PYTHIA_FULL_EVENTRECORD = " << m_pythFullRec << std::endl;
579
580 configFile.close();
581 return true;
582}
int m_beamBreakupMode
Definition Starlight_i.h:90
double m_interferenceStrength
Definition Starlight_i.h:92
unsigned int m_nmbRapidityBins
Definition Starlight_i.h:79
double m_maxW
Definition Starlight_i.h:75
int m_nmbPtBinsInterference
Definition Starlight_i.h:96
bool m_accCutEta
Definition Starlight_i.h:83
double m_incoherentFactor
Definition Starlight_i.h:94
double m_maxEta
Definition Starlight_i.h:85
StringArrayProperty m_InitializeVector
Definition Starlight_i.h:49
unsigned int m_nmbWBins
Definition Starlight_i.h:77
int m_outputFormat
Definition Starlight_i.h:89
unsigned int m_nmbEventsTot
Definition Starlight_i.h:87
double m_axionMass
Definition Starlight_i.h:59
double m_beam1Gamma
Definition Starlight_i.h:73
bool m_xsecMethod
Definition Starlight_i.h:98
double m_minEta
Definition Starlight_i.h:84
bool m_accCutPt
Definition Starlight_i.h:80
double m_minPt
Definition Starlight_i.h:81
double m_maxRapidity
Definition Starlight_i.h:78
double m_maxPt
Definition Starlight_i.h:82
double m_minW
Definition Starlight_i.h:76
StringProperty m_configFileName
Definition Starlight_i.h:43
bool m_coherentProduction
Definition Starlight_i.h:93
bool m_pythFullRec
bool m_interferenceEnabled
Definition Starlight_i.h:91
double m_beam2Gamma
Definition Starlight_i.h:74
double m_maxPtInterference
Definition Starlight_i.h:95

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 368 of file AthCommonDataStore.h.

369 {
370 h.renounce();
372 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 352 of file AthCommonDataStore.h.

352 {
354 }

◆ set_user_params()

bool Starlight_i::set_user_params ( )
protected

Definition at line 370 of file Starlight_i.cxx.

371{
372 // Set starlight user initialization parameters
373
374 // write python starlight config parameters to tmp file
375 // if external config file not specified
376 if (m_configFileName.empty()) {
377 m_configFileName = "tmp.slight.in";
378 if (!prepare_params_file()) {
379 printWarn <<
380 "problems initializing input parameters. cannot initialize starlight.";
381 return false;
382 }
383 }
384
385 m_inputParameters.configureFromFile(m_configFileName);
386 if (!m_inputParameters.init()) {
387 ATH_MSG_WARNING( "problems initializing input parameters. cannot initialize starlight. " );
388 return false;
389 }
390
391 return true;
392}
#define ATH_MSG_WARNING(x,...)
bool prepare_params_file()

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ starlight2lhef()

bool Starlight_i::starlight2lhef ( )
protected

Definition at line 256 of file Starlight_i.cxx.

257{
258
259 std::string lheFilename = "events.lhe";
260 std::ofstream lheStream;
261 lheStream.open(lheFilename.c_str(), std::ofstream::trunc);
262 if(!lheStream) {
263 ATH_MSG_ERROR("error: Failed to open file "+lheFilename);
264 return false;
265 }
266
267 lheStream << "<LesHouchesEvents version=\"1.0\">\n";
268 lheStream << "<!--\n";
269 lheStream << "File generated using Starlight \n";
270 lheStream << "-->\n";
271
272 lheStream << "<init>\n";
273 lheStream << " 13 -13 "<<m_beam1_energy.value()<<" "<<m_beam2_energy.value()<<" 0 0 0 0 3 1\n";
274 lheStream << " 1.000000e+00 0.000000e+00 1.000000e+00 9999\n";
275 lheStream << "</init>\n";
276
277 // Starting from version r330 uevent can be either
278 // upcEvent or upcXEvent depending on the process
279 std::variant<
280 std::unique_ptr<upcEvent>,
281 std::unique_ptr<upcXEvent>> uevent;
282
283 for(unsigned int i=0; i<m_maxevents; i++) {
284 lheStream << "<event>\n";
285
286 // Generate event
287 if(m_productionMode >= starlightConstants::PHOTONUCLEARSINGLE)
288 uevent = std::make_unique<upcEvent>(m_starlight->produceUpcEvent());
289 else
290 uevent = std::make_unique<upcXEvent>(m_starlight->produceEvent());
291
292 // get particle vector from m_event whether it is upcEvent or upcXEvent
293 const std::vector<starlightParticle>* particleCollection = std::visit(
294 [](auto& _evt) { return _evt->getParticles(); }, uevent
295 );
296
297 int ipart = 0;
298 CLHEP::HepLorentzVector photon_system(0);
299 double ptscale =0;
300 std::vector<starlightParticle>::const_iterator part = particleCollection->begin();
301 for (part = particleCollection->begin(); part != particleCollection->end(); ++part, ++ipart)
302 {
303 CLHEP::HepLorentzVector particle_sl((*part).GetPx(), (*part).GetPy(), (*part).GetPz(), (*part).GetE());
304 photon_system += particle_sl;
305 ptscale += std::sqrt((*part).GetPx()*(*part).GetPx() + (*part).GetPy()*(*part).GetPy());
306 }
307
308 // avg pt is the correct scale here
309 if (ipart == 0)[[unlikely]]{
310 ATH_MSG_WARNING( "Starlight_i::starlight2lhef: ipart is zero.");
311 ptscale = 0;
312 } else {
313 ptscale /= static_cast<float> (ipart);
314 }
315 lheStream << " 4 9999 1.000000e+00 "<<ptscale<<" 7.297e-03 2.569093e-01\n";
316
318 lheStream << " -11 -1 0 0 0 0 0.0000000000e+00 0.0000000000e+00 "
319 << photon_system.m()/2.*std::exp(photon_system.rapidity())<<" "
320 <<photon_system.m()/2.*std::exp(photon_system.rapidity())
321 << " 0.0000000000e+00 0. 9.\n";
322 lheStream << " 11 -1 0 0 0 0 0.0000000000e+00 0.0000000000e+00 "
323 << -photon_system.m()/2.*std::exp(-photon_system.rapidity())<<" "
324 <<photon_system.m()/2.*std::exp(-photon_system.rapidity())
325 << " 0.0000000000e+00 0. 9.\n";
326 }
327
328 else{
329 lheStream << " 22 -1 0 0 0 0 0.0000000000e+00 0.0000000000e+00 "
330 << photon_system.m()/2.*std::exp(photon_system.rapidity())<<" "
331 <<photon_system.m()/2.*std::exp(photon_system.rapidity())
332 <<" 0.0000000000e+00 0. 9.\n";
333 lheStream << " 22 -1 0 0 0 0 0.0000000000e+00 0.0000000000e+00 "
334 << -photon_system.m()/2.*std::exp(-photon_system.rapidity())<<" "
335 <<photon_system.m()/2.*std::exp(-photon_system.rapidity())
336 <<" 0.0000000000e+00 0. 9.\n";
337 }
338
339 for (part = particleCollection->begin(); part != particleCollection->end(); ++part, ++ipart)
340 {
341 int pid = (*part).getPdgCode();
342 int charge = (*part).getCharge();
343 //AO special for pid sign stored in charge
344 int pidsign = pid/std::abs(pid);
345 int chsign = charge/std::abs(charge);
346 if( chsign != pidsign ) pid = -pid;
347
348 double px = (*part).GetPx();
349 double py = (*part).GetPy();
350 double pz = (*part).GetPz();
351 double e = (*part).GetE();
352 double mass = (*part).getMass();
353 if(std::abs(pid)==11) mass = m_inputParameters.mel();
354 else if(std::abs(pid)==13) mass = m_inputParameters.muonMass();
355 else if(std::abs(pid)==15) mass = m_inputParameters.tauMass();
356
357 lheStream << pid<<" 1 1 2 0 0 "<<px<<" "<<py<<" "<<pz<<" "<<e<<" "<<mass<<" 0. 9.\n";
358
359 }
360 lheStream << "</event>\n";
361 }
362
363
364 lheStream << "</LesHouchesEvents>";
365 lheStream.close();
366
367 return true;
368}
UnsignedIntegerProperty m_maxevents
Definition Starlight_i.h:45
BooleanProperty m_doTauolappLheFormat
Definition Starlight_i.h:46
#define unlikely(x)

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 298 of file AthCommonDataStore.h.

298 {
299 for (auto &a : m_vhka) {
301 for (auto k : keys) {
302 k->setOwner(this);
303 }
304 }
305 }

Member Data Documentation

◆ m_accCutEta

bool Starlight_i::m_accCutEta {false}
protected

Definition at line 83 of file Starlight_i.h.

83{false};

◆ m_accCutPt

bool Starlight_i::m_accCutPt {false}
protected

Definition at line 80 of file Starlight_i.h.

80{false};

◆ m_axionMass

double Starlight_i::m_axionMass {1.}
protected

Definition at line 59 of file Starlight_i.h.

59{1.};

◆ m_beam1_energy

DoubleProperty Starlight_i::m_beam1_energy {this,"beam1Energy", 2.51e+03}
protected

Definition at line 66 of file Starlight_i.h.

66{this,"beam1Energy", 2.51e+03};

◆ m_beam1A

unsigned int Starlight_i::m_beam1A {0}
protected

Definition at line 70 of file Starlight_i.h.

70{0};

◆ m_beam1Gamma

double Starlight_i::m_beam1Gamma {0.}
protected

Definition at line 73 of file Starlight_i.h.

73{0.};

◆ m_beam1Z

unsigned int Starlight_i::m_beam1Z {0}
protected

Definition at line 69 of file Starlight_i.h.

69{0};

◆ m_beam2_energy

DoubleProperty Starlight_i::m_beam2_energy {this,"beam2Energy", 2.51e+03}
protected

Definition at line 67 of file Starlight_i.h.

67{this,"beam2Energy", 2.51e+03};

◆ m_beam2A

unsigned int Starlight_i::m_beam2A {0}
protected

Definition at line 72 of file Starlight_i.h.

72{0};

◆ m_beam2Gamma

double Starlight_i::m_beam2Gamma {0.}
protected

Definition at line 74 of file Starlight_i.h.

74{0.};

◆ m_beam2Z

unsigned int Starlight_i::m_beam2Z {0}
protected

Definition at line 71 of file Starlight_i.h.

71{0};

◆ m_beamBreakupMode

int Starlight_i::m_beamBreakupMode {0}
protected

Definition at line 90 of file Starlight_i.h.

90{0};

◆ m_coherentProduction

bool Starlight_i::m_coherentProduction {false}
protected

Definition at line 93 of file Starlight_i.h.

93{false};

◆ m_configFileName

StringProperty Starlight_i::m_configFileName {this, "ConfigFileName", ""}
protected

Definition at line 43 of file Starlight_i.h.

43{this, "ConfigFileName", ""};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 381 of file AthCommonDataStore.h.

◆ m_doTauolappLheFormat

BooleanProperty Starlight_i::m_doTauolappLheFormat {this, "doTauolappLheFormat", false}
protected

Definition at line 46 of file Starlight_i.h.

46{this, "doTauolappLheFormat", false};

◆ m_dsid

IntegerProperty Starlight_i::m_dsid {this, "Dsid", 999999, "Dataset ID number"}
protected

Definition at line 42 of file Starlight_i.h.

42{this, "Dsid", 999999, "Dataset ID number"};

◆ m_event

std::variant< std::unique_ptr<upcEvent>, std::unique_ptr<upcXEvent> > Starlight_i::m_event {}
protected

Definition at line 63 of file Starlight_i.h.

63{};

◆ m_events

int Starlight_i::m_events {0}
protected

Definition at line 55 of file Starlight_i.h.

55{0}; // event counter

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 378 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_incidentSvc

ServiceHandle<IIncidentSvc> GenModule::m_incidentSvc {this, "IncidentSvc", "IncidentSvc"}
privateinherited

Handle on the incident service.

Definition at line 99 of file GenModule.h.

99{this, "IncidentSvc", "IncidentSvc"};

◆ m_incoherentFactor

double Starlight_i::m_incoherentFactor {0.}
protected

Definition at line 94 of file Starlight_i.h.

94{0.};

◆ m_InitializeVector

StringArrayProperty Starlight_i::m_InitializeVector
protected
Initial value:
{this,
"Initialize",
{},
"List of parameters for Starlight initialization",
"GeneratorSettings<std::string>"}

Definition at line 49 of file Starlight_i.h.

49 {this,
50 "Initialize",
51 {},
52 "List of parameters for Starlight initialization",
53 "GeneratorSettings<std::string>"};

◆ m_inputParameters

inputParameters Starlight_i::m_inputParameters
protected

Definition at line 58 of file Starlight_i.h.

◆ m_interferenceEnabled

bool Starlight_i::m_interferenceEnabled {false}
protected

Definition at line 91 of file Starlight_i.h.

91{false};

◆ m_interferenceStrength

double Starlight_i::m_interferenceStrength {0.}
protected

Definition at line 92 of file Starlight_i.h.

92{0.};

◆ m_isAfterburner

BooleanProperty GenModule::m_isAfterburner {this, "IsAfterburner", false, "Set true if generator modifies existing events rather than creating new ones"}
protectedinherited

Flag for normal vs. afterburner generators.

Definition at line 87 of file GenModule.h.

87{this, "IsAfterburner", false, "Set true if generator modifies existing events rather than creating new ones"};

◆ m_lheOutput

BooleanProperty Starlight_i::m_lheOutput {this, "lheOutput", false}
protected

Definition at line 44 of file Starlight_i.h.

44{this, "lheOutput", false};

◆ m_maxEta

double Starlight_i::m_maxEta {0.}
protected

Definition at line 85 of file Starlight_i.h.

85{0.};

◆ m_maxevents

UnsignedIntegerProperty Starlight_i::m_maxevents {this, "maxevents", 5500}
protected

Definition at line 45 of file Starlight_i.h.

45{this, "maxevents", 5500};

◆ m_maxPt

double Starlight_i::m_maxPt {0.}
protected

Definition at line 82 of file Starlight_i.h.

82{0.};

◆ m_maxPtInterference

double Starlight_i::m_maxPtInterference {0.}
protected

Definition at line 95 of file Starlight_i.h.

95{0.};

◆ m_maxRapidity

double Starlight_i::m_maxRapidity {0.}
protected

Definition at line 78 of file Starlight_i.h.

78{0.};

◆ m_maxW

double Starlight_i::m_maxW {0.}
protected

Definition at line 75 of file Starlight_i.h.

75{0.};

◆ m_mcEventKey

std::string GenBase::m_mcEventKey {}
protectedinherited

StoreGate key for the MC event collection (defaults to GEN_EVENT).

Definition at line 108 of file GenBase.h.

108{};

◆ m_mcevents_const

SG::ReadHandleKey<McEventCollection> GenBase::m_mcevents_const { this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" }
privateinherited

Const handle to the MC event collection.

Definition at line 117 of file GenBase.h.

117{ this, "McEventKey", "GEN_EVENT", "StoreGate key of the MC event collection" };

◆ m_minEta

double Starlight_i::m_minEta {0.}
protected

Definition at line 84 of file Starlight_i.h.

84{0.};

◆ m_minPt

double Starlight_i::m_minPt {0.}
protected

Definition at line 81 of file Starlight_i.h.

81{0.};

◆ m_minW

double Starlight_i::m_minW {0.}
protected

Definition at line 76 of file Starlight_i.h.

76{0.};

◆ m_mkMcEvent

BooleanProperty GenBase::m_mkMcEvent {this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"}
protectedinherited

Flag to determine if a new MC event collection should be made if it doesn't exist.

Definition at line 110 of file GenBase.h.

110{this, "MakeMcEvent", false, "Create a new MC event collection if it doesn't exist"};

◆ m_nmbEventsTot

unsigned int Starlight_i::m_nmbEventsTot {0}
protected

Definition at line 87 of file Starlight_i.h.

87{0};

◆ m_nmbPtBinsInterference

int Starlight_i::m_nmbPtBinsInterference {0}
protected

Definition at line 96 of file Starlight_i.h.

96{0};

◆ m_nmbRapidityBins

unsigned int Starlight_i::m_nmbRapidityBins {0}
protected

Definition at line 79 of file Starlight_i.h.

79{0};

◆ m_nmbWBins

unsigned int Starlight_i::m_nmbWBins {0}
protected

Definition at line 77 of file Starlight_i.h.

77{0};

◆ m_nThreads

int Starlight_i::m_nThreads {1}
protected

Definition at line 99 of file Starlight_i.h.

99{1};

◆ m_outputFormat

int Starlight_i::m_outputFormat {0}
protected

Definition at line 89 of file Starlight_i.h.

89{0};

◆ m_prodParticleId

int Starlight_i::m_prodParticleId {0}
protected

Definition at line 88 of file Starlight_i.h.

88{0};

◆ m_productionMode

int Starlight_i::m_productionMode {0}
protected

Definition at line 86 of file Starlight_i.h.

86{0};

◆ m_ptBinWidthInterference

double Starlight_i::m_ptBinWidthInterference {0.}
protected

Definition at line 97 of file Starlight_i.h.

97{0.};

◆ m_pythFullRec

bool Starlight_i::m_pythFullRec {false}
protected

Definition at line 100 of file Starlight_i.h.

100{false};

◆ m_randomGenerator

std::shared_ptr<randomGenerator> Starlight_i::m_randomGenerator {}
protected

Definition at line 57 of file Starlight_i.h.

57{};

◆ m_randomSeed

IntegerProperty GenModule::m_randomSeed {this, "RandomSeed", 1234567, "Random seed for the built-in random engine"}
protectedinherited

Seed for random number engine.

Definition at line 84 of file GenModule.h.

84{this, "RandomSeed", 1234567, "Random seed for the built-in random engine"}; // FIXME make this into an unsigned long int?

◆ m_rndmSvc

ServiceHandle<IAthRNGSvc> GenModule::m_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
privateinherited

Data members.

Definition at line 97 of file GenModule.h.

97{this, "RndmSvc", "AthRNGSvc"};

◆ m_runinfo

std::shared_ptr<HepMC3::GenRunInfo> GenModule::m_runinfo {}
protectedinherited

The run info for HepMC3.

Definition at line 90 of file GenModule.h.

90{};

◆ m_starlight

std::unique_ptr<starlight> Starlight_i::m_starlight {}
protected

Definition at line 56 of file Starlight_i.h.

56{}; // pointer to starlight instance

◆ m_suppressVMdecay

BooleanProperty Starlight_i::m_suppressVMdecay {this, "suppressVMdecay", false}
protected

Definition at line 47 of file Starlight_i.h.

47{this, "suppressVMdecay", false};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 387 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_vhka
privateinherited

Definition at line 386 of file AthCommonDataStore.h.

◆ m_xsecMethod

bool Starlight_i::m_xsecMethod {false}
protected

Definition at line 98 of file Starlight_i.h.

98{false};

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