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 const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
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 ()
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
 Access the current signal event (const)
const McEventCollectionevents_const () const
 Access the current event's McEventCollection (const)
const McEventCollectionevents_const (const EventContext &ctx) const
Particle data accessors
const ServiceHandle< IPartPropSvc > partPropSvc () const
 Access the particle property service.
const HepPDT::ParticleDataTable & particleTable () const
 Get a particle data table.
const HepPDT::ParticleDataTable & pdt () const
 Shorter alias to get a particle data table.
const HepPDT::ParticleData * particleData (int pid) const
 Access an element in the particle data table.

Protected Member Functions

bool starlight2lhef ()
bool set_user_params ()
bool prepare_params_file ()
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 {this, "Initialize", {} }
int m_events {0}
starlight * m_starlight {}
std::shared_ptr< randomGenerator > m_randomGenerator {}
inputParameters m_inputParameters
double m_axionMass {1.}
upcEvent * m_event {}
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_bford {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}
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_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
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.
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< IAthRNGSvcm_rndmSvc {this, "RndmSvc", "AthRNGSvc"}
 Data members.
ServiceHandle< IIncidentSvc > m_incidentSvc {this, "IncidentSvc", "IncidentSvc"}
 Handle on the incident service.

Utility event-mangling functions

Todo
Replace with HepMC units when available
void GeVToMeV (HepMC::GenEvent *evt)
 Scale event energies/momenta by x 1000.
void MeVToGeV (HepMC::GenEvent *evt)
 Scale event energies/momenta by x 1/1000.
void cmTomm (HepMC::GenEvent *evt)
 Scale event lengths by x 10.
void mmTocm (HepMC::GenEvent *evt)
 Scale event lengths by x 1/10.
ServiceHandle< IPartPropSvc > m_ppSvc {this, "PartPropSvc", "PartPropSvc"}
 Handle on the particle property service.
SG::ReadHandleKey< McEventCollectionm_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 30 of file Starlight_i.h.

Member Typedef Documentation

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ Starlight_i()

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

Definition at line 43 of file Starlight_i.cxx.

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

◆ ~Starlight_i()

Starlight_i::~Starlight_i ( )
virtual

Definition at line 48 of file Starlight_i.cxx.

48 {
49 if (m_starlight) delete m_starlight;
50 if (m_event) delete m_event;
51}
starlight * m_starlight
Definition Starlight_i.h:51
upcEvent * m_event
Definition Starlight_i.h:55

Member Function Documentation

◆ ATLAS_NOT_CONST_THREAD_SAFE() [1/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 76 of file GenBase.h.

76 {
77 if (events()->empty())
78 ATH_MSG_ERROR("McEventCollection is empty during first event access");
79 return *(events()->begin());
80 }
#define ATH_MSG_ERROR(x)
static const Attributes_t empty

◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/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.

◆ 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 m_event = new upcEvent;
105#ifdef UPCXEVENT_H
106 (*m_event) = m_starlight->produceUpcEvent();
107#else
108 (*m_event) = m_starlight->produceEvent();
109#endif
110
111 // update event counter
112 ++m_events;
113
114 int numberofTracks = m_event->getParticles()->size();
115 int numberOfVertices = 1; //m_event->getVertices()->size();
116
117 ATH_MSG_DEBUG( "EVENT: " << m_events << " "
118 << " with " << numberOfVertices << " vertices "
119 << " and " << numberofTracks << " tracks" );
120 ATH_MSG_DEBUG( "VERTEX: "<< 0. << " " << 0. << " " << 0.
121 << " with " << numberofTracks << " tracks" );
122
123 int ipart = 0;
124 std::vector<starlightParticle>::const_iterator part =
125 (m_event->getParticles())->begin();
126 for (part = m_event->getParticles()->begin();
127 part != m_event->getParticles()->end(); ++part, ++ipart) {
128 ATH_MSG_DEBUG( "TRACK: " << " "
129 << starlightParticleCodes::jetsetToGeant((*part).getCharge() * (*part).getPdgCode()) << " "
130 << (*part).GetPx() << " " << (*part).GetPy() << " "<< (*part).GetPz()
131 << " " << m_events << " " << ipart << " " << 0 << " "
132 << (*part).getCharge() * (*part).getPdgCode() );
133 }
134
135 ATH_MSG_DEBUG( " Starlight generating done. \n" );
136
137 return StatusCode::SUCCESS;
138}
#define ATH_MSG_DEBUG(x)
IntegerProperty m_randomSeed
Seed for random number engine.
Definition GenModule.h:84
BooleanProperty m_lheOutput
Definition Starlight_i.h:43
IntegerProperty m_dsid
Definition Starlight_i.h:41
std::shared_ptr< randomGenerator > m_randomGenerator
Definition Starlight_i.h:52
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.

◆ cmTomm()

void GenBase::cmTomm ( HepMC::GenEvent * evt)
protectedinherited

Scale event lengths by x 10.

Definition at line 78 of file GenBase.cxx.

78 {
79 for (HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin(); vtx != evt->vertices_end(); ++vtx) {
80 const HepMC::FourVector fv((*vtx)->position().x() * 10,
81 (*vtx)->position().y() * 10,
82 (*vtx)->position().z() * 10,
83 (*vtx)->position().t() * 10);
84 (*vtx)->set_position(fv);
85 }
86}

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< 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< 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< 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
inlineinherited

Access the current signal event (const)

Definition at line 83 of file GenBase.h.

83 {
84 if (events_const()->empty())
85 ATH_MSG_ERROR("Const McEventCollection is empty during first event access");
86 return *(events_const()->begin());
87 }
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
Definition GenBase.h:96

◆ events_const() [1/2]

const McEventCollection * GenBase::events_const ( ) const
inlineinherited

Access the current event's McEventCollection (const)

Definition at line 96 of file GenBase.h.

96 {
97 return events_const( getContext() );
98 }

◆ events_const() [2/2]

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

Definition at line 99 of file GenBase.h.

99 {
100 SG::ReadHandle<McEventCollection> ret = SG::makeHandle(m_mcevents_const, ctx);
101 if (!ret.isValid())
102 ATH_MSG_ERROR("No McEventCollection found in StoreGate with key " << m_mcevents_const.key());
103 return ret.cptr();
104 }
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
Definition GenBase.h:163
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< 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 ( )
virtualinherited
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 //const EventContext& ctx = Gaudi::Hive::currentContext();
79 //CLHEP::HepRandomEngine* rndmEngine = this->getRandomEngine("MyStream", ctx);
80
81 // Example 2 - seeded based on the m_randomSeed property (+ slot, run, streamName)
82 //const EventContext& ctx = Gaudi::Hive::currentContext();
83 //CLHEP::HepRandomEngine* rndmEngine = this->getRandomEngine("MyStream", m_randomSeed.value(), ctx);
84
85 // Call the code that generates an event
86 CHECK(this->callGenerator());
87
88 // Create the MC event and send the GeneratorEvent stored in it to fillEvt
89 HepMC::GenEvent* evt = HepMC::newGenEvent(1,1);
90 CHECK(this->fillEvt(evt));
92
93 // Add the event to the MC event collection
94 if (events()) {
95 // If this is an "afterburner" generator, replace the last event rather than add a new one
97 if (m_isAfterburner.value() || name() == "Tauola" || name() == "Photos") {
98 events()->pop_back();
99 }
100 // Add the event to the end of the collection
101 events()->push_back(evt);
102 ATH_MSG_DEBUG("MC event added to McEventCollection");
103
104 // remove the empty event in case of ParticleDecayer
105 if (name() == "ParticleDecayer") {
106 events()->pop_back();
107 }
108 }
109
110 // Call the incident service to notify that an event has been made
111 m_incidentSvc->fireIncident( Incident(name(), "McEventGenerated") );
112 return StatusCode::SUCCESS;
113}
#define CHECK(...)
Evaluate an expression and check for errors.
ServiceHandle< IIncidentSvc > m_incidentSvc
Handle on the incident service.
Definition GenModule.h:101
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 *)
Definition GenEvent.h:628
GenEvent * newGenEvent(const int a, const int b)
Definition GenEvent.h:626

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< 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 & AthAlgorithm::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

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

Definition at line 50 of file AthAlgorithm.cxx.

51{
52 // If we didn't find any symlinks to add, just return the collection
53 // from the base class. Otherwise, return the extended collection.
54 if (!m_extendedExtraObjects.empty()) {
56 }
57 return Algorithm::extraOutputDeps();
58}
DataObjIDColl m_extendedExtraObjects

◆ fillEvt()

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

For filling the HepMC event object.

Implements GenModule.

Definition at line 149 of file Starlight_i.cxx.

150{
151 if(m_lheOutput) return StatusCode::SUCCESS;
152 ATH_MSG_DEBUG( " STARLIGHT Filing. \n" );
153
154 // Set the event number
155 evt->set_event_number( m_events );
156
157 // Create the event vertex
159 evt->add_vertex( v1 );
160
161 // Loop on all final particles and
162 // put them all as outgoing from the event vertex
163 int ipart = 0;
164 std::vector<starlightParticle>::const_iterator part =
165 (m_event->getParticles())->begin();
166 double px_tot=0;
167 double py_tot=0;
168 double pz_tot=0;
169 for (part = m_event->getParticles()->begin();
170 part != m_event->getParticles()->end(); ++part, ++ipart)
171 {
172 int pid = (*part).getPdgCode();
173 int charge = (*part).getCharge();
174 //AO special for pid sign stored in charge
175 int pidsign = pid/std::abs(pid);
176 int chsign = 0;
177 if (charge !=0) chsign = charge/std::abs(charge);
178 if( chsign != pidsign && chsign != 0) pid = -pid;
179
180 double px = (*part).GetPx();
181 double py = (*part).GetPy();
182 double pz = (*part).GetPz();
183 double e = (*part).GetE();
184 // mass fix implemented only for muons
185 if(std::abs(pid)==13) {
186 float mass = m_inputParameters.muonMass();//0.1056583715;// starlightConstants::muonMass;
187 e = std::sqrt(px*px + py*py + pz*pz + mass*mass);
188 }
189 // mass fix for photons (ALPs)
190 if(std::abs(pid)==22) {
191 e = std::sqrt(px*px + py*py + pz*pz);
192 }
193
194 ATH_MSG_DEBUG( "saving particle " << ipart );
195 px_tot+=px;
196 py_tot+=py;
197 pz_tot+=pz;
198
199 if(!m_suppressVMdecay) v1->add_particle_out(
200 HepMC::newGenParticlePtr(HepMC::FourVector(px, py, pz, e), pid, 1) );
201 }
203 int pid = 113;
204 double mass = 0.770;
205 if(m_prodParticleId == 443011 || m_prodParticleId == 443013){
206 pid = 443;
207 mass = 3.0969;
208 }
209 if(m_prodParticleId == 444011 || m_prodParticleId == 444013){
210 pid = 100443;
211 mass = 3.6861;
212 }
213 if(m_prodParticleId == 553011 || m_prodParticleId == 553013){
214 pid = 553;
215 mass = 9.4604;
216 }
217 if(m_prodParticleId == 554011 || m_prodParticleId == 554013){
218 pid = 100553;
219 mass = 10.023;
220 }
221 if(m_prodParticleId == 555011 || m_prodParticleId == 555013){
222 pid = 200553;
223 mass = 10.355;
224 }
225 double e = sqrt(px_tot*px_tot + py_tot*py_tot + pz_tot*pz_tot + mass*mass);
226 v1->add_particle_out(
227 HepMC::newGenParticlePtr(HepMC::FourVector(px_tot, py_tot, pz_tot, e), pid, 1) );
228 }
229 ATH_MSG_DEBUG( "Saved " << ipart << " tracks " );
230
231 // Convert cm->mm and GeV->MeV
232 //
233 GeVToMeV(evt);
234
235 return StatusCode::SUCCESS;
236}
double charge(const T &p)
Definition AtlasPID.h:997
void GeVToMeV(HepMC::GenEvent *evt)
Scale event energies/momenta by x 1000.
Definition GenBase.cxx:58
int m_prodParticleId
Definition Starlight_i.h:76
inputParameters m_inputParameters
Definition Starlight_i.h:53
BooleanProperty m_suppressVMdecay
Definition Starlight_i.h:46
HepMC::GenVertex * GenVertexPtr
Definition GenVertex.h:59
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
Definition GenVertex.h:64
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
Definition GenParticle.h:39

◆ 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 141 of file Starlight_i.cxx.

142{
143 ATH_MSG_DEBUG( " STARLIGHT Ending. \n" );
144
145 return StatusCode::SUCCESS;
146}

◆ 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 = new 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:169
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
Definition RNGWrapper.h:134
ServiceHandle< IAthRNGSvc > m_rndmSvc
Data members.
Definition GenModule.h:99

◆ 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}
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.

◆ GeVToMeV()

void GenBase::GeVToMeV ( HepMC::GenEvent * evt)
protectedinherited

Scale event energies/momenta by x 1000.

Todo
Add HepMC units awareness and do it differently when HepMC provides this functionality directly (and reference-based FourVector accessors)

Definition at line 58 of file GenBase.cxx.

58 {
59 for (HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
60 const HepMC::FourVector fv((*p)->momentum().px() * 1000,
61 (*p)->momentum().py() * 1000,
62 (*p)->momentum().pz() * 1000,
63 (*p)->momentum().e() * 1000);
64 (*p)->set_momentum(fv);
65 (*p)->set_generated_mass(1000 * (*p)->generated_mass());
66 }
67}

◆ 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< 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.

◆ MeVToGeV()

void GenBase::MeVToGeV ( HepMC::GenEvent * evt)
protectedinherited

Scale event energies/momenta by x 1/1000.

Definition at line 68 of file GenBase.cxx.

68 {
69 for (HepMC::GenEvent::particle_iterator p = evt->particles_begin(); p != evt->particles_end(); ++p) {
70 const HepMC::FourVector fv((*p)->momentum().px() / 1000,
71 (*p)->momentum().py() / 1000,
72 (*p)->momentum().pz() / 1000,
73 (*p)->momentum().e() / 1000);
74 (*p)->set_momentum(fv);
75 (*p)->set_generated_mass((*p)->generated_mass() / 1000);
76 }
77}

◆ mmTocm()

void GenBase::mmTocm ( HepMC::GenEvent * evt)
protectedinherited

Scale event lengths by x 1/10.

Definition at line 87 of file GenBase.cxx.

87 {
88 for (HepMC::GenEvent::vertex_iterator vtx = evt->vertices_begin(); vtx != evt->vertices_end(); ++vtx) {
89 const HepMC::FourVector fv((*vtx)->position().x() / 10,
90 (*vtx)->position().y() / 10,
91 (*vtx)->position().z() / 10,
92 (*vtx)->position().t() / 10);
93 (*vtx)->set_position(fv);
94 }
95}

◆ msg()

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

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< 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< 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.

◆ particleData()

const HepPDT::ParticleData * GenBase::particleData ( int pid) const
inlineinherited

Access an element in the particle data table.

Definition at line 126 of file GenBase.h.

126 {
127 return pdt().particle(HepPDT::ParticleID(std::abs(pid)));
128 }
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
Definition GenBase.h:123

◆ particleTable()

const HepPDT::ParticleDataTable & GenBase::particleTable ( ) const
inlineinherited

Get a particle data table.

Definition at line 118 of file GenBase.h.

118 {
119 return *(m_ppSvc->PDT());
120 }
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
Definition GenBase.h:160

◆ partPropSvc()

const ServiceHandle< IPartPropSvc > GenBase::partPropSvc ( ) const
inlineinherited

Access the particle property service.

Definition at line 113 of file GenBase.h.

113 {
114 return m_ppSvc;
115 }

◆ pdt()

const HepPDT::ParticleDataTable & GenBase::pdt ( ) const
inlineinherited

Shorter alias to get a particle data table.

Definition at line 123 of file GenBase.h.

123{ return particleTable(); }
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
Definition GenBase.h:118

◆ prepare_params_file()

bool Starlight_i::prepare_params_file ( )
protected

Definition at line 373 of file Starlight_i.cxx.

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

◆ 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< Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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< Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ set_user_params()

bool Starlight_i::set_user_params ( )
protected

Definition at line 349 of file Starlight_i.cxx.

350{
351 // Set starlight user initialization parameters
352
353 // write python starlight config parameters to tmp file
354 // if external config file not specified
355 if (m_configFileName.empty()) {
356 m_configFileName = "tmp.slight.in";
357 if (!prepare_params_file()) {
358 printWarn <<
359 "problems initializing input parameters. cannot initialize starlight.";
360 return false;
361 }
362 }
363
364 m_inputParameters.configureFromFile(m_configFileName);
365 if (!m_inputParameters.init()) {
366 ATH_MSG_WARNING( "problems initializing input parameters. cannot initialize starlight. " );
367 return false;
368 }
369
370 return true;
371}
#define ATH_MSG_WARNING(x)
bool prepare_params_file()

◆ starlight2lhef()

bool Starlight_i::starlight2lhef ( )
protected

Definition at line 239 of file Starlight_i.cxx.

240{
241
242 std::string lheFilename = "events.lhe";
243 std::ofstream lheStream;
244 lheStream.open(lheFilename.c_str(), std::ofstream::trunc);
245 if(!lheStream) {
246 ATH_MSG_ERROR("error: Failed to open file "+lheFilename);
247 return false;
248 }
249
250 lheStream << "<LesHouchesEvents version=\"1.0\">\n";
251 lheStream << "<!--\n";
252 lheStream << "File generated using Starlight \n";
253 lheStream << "-->\n";
254
255 float beam_energy=0.;
256 // run-3 beam energy (allowing approximate value of 2877 for gamma of the beams)
257 if(m_beam1Gamma>2870 && m_beam1Gamma<2880) beam_energy = 2.68e+03;
258 // run-2 beam energy
259 else beam_energy = 2.51e+03;
260
261 lheStream << "<init>\n";
262 lheStream << " 13 -13 "<<beam_energy<<" "<<beam_energy<<" 0 0 0 0 3 1\n";
263 lheStream << " 1.000000e+00 0.000000e+00 1.000000e+00 9999\n";
264 lheStream << "</init>\n";
265
266
267 std::unique_ptr<upcEvent> uevent(new upcEvent);
268
269 for(unsigned int i=0; i<m_maxevents; i++) {
270 lheStream << "<event>\n";
271#ifdef UPCXEVENT_H
272 (*uevent) = m_starlight->produceUpcEvent();
273#else
274 (*uevent) = m_starlight->produceEvent();
275#endif
276 int ipart = 0;
277 CLHEP::HepLorentzVector photon_system(0);
278 double ptscale =0;
279 std::vector<starlightParticle>::const_iterator part = (uevent->getParticles())->begin();
280 for (part = uevent->getParticles()->begin(); part != uevent->getParticles()->end(); ++part, ++ipart)
281 {
282 CLHEP::HepLorentzVector particle_sl((*part).GetPx(), (*part).GetPy(), (*part).GetPz(), (*part).GetE());
283 photon_system += particle_sl;
284 ptscale += std::sqrt((*part).GetPx()*(*part).GetPx() + (*part).GetPy()*(*part).GetPy());
285 }
286
287 // avg pt is the correct scale here
288 if (ipart == 0)[[unlikely]]{
289 ATH_MSG_WARNING( "Starlight_i::starlight2lhef: ipart is zero.");
290 ptscale = 0;
291 } else {
292 ptscale /= static_cast<float> (ipart);
293 }
294 lheStream << " 4 9999 1.000000e+00 "<<ptscale<<" 7.297e-03 2.569093e-01\n";
295
297 lheStream << " -11 -1 0 0 0 0 0.0000000000e+00 0.0000000000e+00 "
298 << photon_system.m()/2.*std::exp(photon_system.rapidity())<<" "
299 <<photon_system.m()/2.*std::exp(photon_system.rapidity())
300 << " 0.0000000000e+00 0. 9.\n";
301 lheStream << " 11 -1 0 0 0 0 0.0000000000e+00 0.0000000000e+00 "
302 << -photon_system.m()/2.*std::exp(-photon_system.rapidity())<<" "
303 <<photon_system.m()/2.*std::exp(-photon_system.rapidity())
304 << " 0.0000000000e+00 0. 9.\n";
305 }
306
307 else{
308 lheStream << " 22 -1 0 0 0 0 0.0000000000e+00 0.0000000000e+00 "
309 << photon_system.m()/2.*std::exp(photon_system.rapidity())<<" "
310 <<photon_system.m()/2.*std::exp(photon_system.rapidity())
311 <<" 0.0000000000e+00 0. 9.\n";
312 lheStream << " 22 -1 0 0 0 0 0.0000000000e+00 0.0000000000e+00 "
313 << -photon_system.m()/2.*std::exp(-photon_system.rapidity())<<" "
314 <<photon_system.m()/2.*std::exp(-photon_system.rapidity())
315 <<" 0.0000000000e+00 0. 9.\n";
316 }
317
318 for (part = uevent->getParticles()->begin(); part != uevent->getParticles()->end(); ++part, ++ipart)
319 {
320 int pid = (*part).getPdgCode();
321 int charge = (*part).getCharge();
322 //AO special for pid sign stored in charge
323 int pidsign = pid/std::abs(pid);
324 int chsign = charge/std::abs(charge);
325 if( chsign != pidsign ) pid = -pid;
326
327 double px = (*part).GetPx();
328 double py = (*part).GetPy();
329 double pz = (*part).GetPz();
330 double e = (*part).GetE();
331 double mass = (*part).getMass();
332 if(std::abs(pid)==11) mass = m_inputParameters.mel();
333 else if(std::abs(pid)==13) mass = m_inputParameters.muonMass();
334 else if(std::abs(pid)==15) mass = m_inputParameters.tauMass();
335
336 lheStream << pid<<" 1 1 2 0 0 "<<px<<" "<<py<<" "<<pz<<" "<<e<<" "<<mass<<" 0. 9.\n";
337
338 }
339 lheStream << "</event>\n";
340 }
341
342
343 lheStream << "</LesHouchesEvents>";
344 lheStream.close();
345
346 return true;
347}
UnsignedIntegerProperty m_maxevents
Definition Starlight_i.h:44
BooleanProperty m_doTauolappLheFormat
Definition Starlight_i.h:45
#define unlikely(x)
Definition dictionary.h:41

◆ sysInitialize()

StatusCode AthAlgorithm::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< Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, and PyAthena::Alg.

Definition at line 66 of file AthAlgorithm.cxx.

66 {
68
69 if (sc.isFailure()) {
70 return sc;
71 }
72 ServiceHandle<ICondSvc> cs("CondSvc",name());
73 for (auto h : outputHandles()) {
74 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
75 // do this inside the loop so we don't create the CondSvc until needed
76 if ( cs.retrieve().isFailure() ) {
77 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
78 return StatusCode::SUCCESS;
79 }
80 if (cs->regHandle(this,*h).isFailure()) {
81 sc = StatusCode::FAILURE;
82 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
83 << " with CondSvc");
84 }
85 }
86 }
87 return sc;
88}
static Double_t sc
virtual StatusCode sysInitialize() override
Override sysInitialize.
AthCommonDataStore(const std::string &name, T... args)
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
::StatusCode StatusCode
StatusCode definition for legacy code.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< 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< Algorithm > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

Member Data Documentation

◆ m_accCutEta

bool Starlight_i::m_accCutEta {false}
protected

Definition at line 71 of file Starlight_i.h.

71{false};

◆ m_accCutPt

bool Starlight_i::m_accCutPt {false}
protected

Definition at line 68 of file Starlight_i.h.

68{false};

◆ m_axionMass

double Starlight_i::m_axionMass {1.}
protected

Definition at line 54 of file Starlight_i.h.

54{1.};

◆ m_beam1A

unsigned int Starlight_i::m_beam1A {0}
protected

Definition at line 58 of file Starlight_i.h.

58{0};

◆ m_beam1Gamma

double Starlight_i::m_beam1Gamma {0.}
protected

Definition at line 61 of file Starlight_i.h.

61{0.};

◆ m_beam1Z

unsigned int Starlight_i::m_beam1Z {0}
protected

Definition at line 57 of file Starlight_i.h.

57{0};

◆ m_beam2A

unsigned int Starlight_i::m_beam2A {0}
protected

Definition at line 60 of file Starlight_i.h.

60{0};

◆ m_beam2Gamma

double Starlight_i::m_beam2Gamma {0.}
protected

Definition at line 62 of file Starlight_i.h.

62{0.};

◆ m_beam2Z

unsigned int Starlight_i::m_beam2Z {0}
protected

Definition at line 59 of file Starlight_i.h.

59{0};

◆ m_beamBreakupMode

int Starlight_i::m_beamBreakupMode {0}
protected

Definition at line 78 of file Starlight_i.h.

78{0};

◆ m_bford

double Starlight_i::m_bford {0.}
protected

Definition at line 83 of file Starlight_i.h.

83{0.};

◆ m_coherentProduction

bool Starlight_i::m_coherentProduction {false}
protected

Definition at line 81 of file Starlight_i.h.

81{false};

◆ m_configFileName

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

Definition at line 42 of file Starlight_i.h.

42{this, "ConfigFileName", ""};

◆ m_detStore

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

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_doTauolappLheFormat

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

Definition at line 45 of file Starlight_i.h.

45{this, "doTauolappLheFormat", false};

◆ m_dsid

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

Definition at line 41 of file Starlight_i.h.

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

◆ m_event

upcEvent* Starlight_i::m_event {}
protected

Definition at line 55 of file Starlight_i.h.

55{}; // TODO convert to unique_ptr

◆ m_events

int Starlight_i::m_events {0}
protected

Definition at line 50 of file Starlight_i.h.

50{0}; // event counter

◆ m_evtStore

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

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthAlgorithm::m_extendedExtraObjects
privateinherited

Definition at line 79 of file AthAlgorithm.h.

◆ m_incidentSvc

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

Handle on the incident service.

Definition at line 101 of file GenModule.h.

101{this, "IncidentSvc", "IncidentSvc"};

◆ m_incoherentFactor

double Starlight_i::m_incoherentFactor {0.}
protected

Definition at line 82 of file Starlight_i.h.

82{0.};

◆ m_InitializeVector

StringArrayProperty Starlight_i::m_InitializeVector {this, "Initialize", {} }
protected

Definition at line 48 of file Starlight_i.h.

48{this, "Initialize", {} };

◆ m_inputParameters

inputParameters Starlight_i::m_inputParameters
protected

Definition at line 53 of file Starlight_i.h.

◆ m_interferenceEnabled

bool Starlight_i::m_interferenceEnabled {false}
protected

Definition at line 79 of file Starlight_i.h.

79{false};

◆ m_interferenceStrength

double Starlight_i::m_interferenceStrength {0.}
protected

Definition at line 80 of file Starlight_i.h.

80{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 43 of file Starlight_i.h.

43{this, "lheOutput", false};

◆ m_maxEta

double Starlight_i::m_maxEta {0.}
protected

Definition at line 73 of file Starlight_i.h.

73{0.};

◆ m_maxevents

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

Definition at line 44 of file Starlight_i.h.

44{this, "maxevents", 5500};

◆ m_maxPt

double Starlight_i::m_maxPt {0.}
protected

Definition at line 70 of file Starlight_i.h.

70{0.};

◆ m_maxPtInterference

double Starlight_i::m_maxPtInterference {0.}
protected

Definition at line 84 of file Starlight_i.h.

84{0.};

◆ m_maxRapidity

double Starlight_i::m_maxRapidity {0.}
protected

Definition at line 66 of file Starlight_i.h.

66{0.};

◆ m_maxW

double Starlight_i::m_maxW {0.}
protected

Definition at line 63 of file Starlight_i.h.

63{0.};

◆ m_mcEventKey

std::string GenBase::m_mcEventKey {}
protectedinherited

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

Definition at line 137 of file GenBase.h.

137{};

◆ 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 163 of file GenBase.h.

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

◆ m_minEta

double Starlight_i::m_minEta {0.}
protected

Definition at line 72 of file Starlight_i.h.

72{0.};

◆ m_minPt

double Starlight_i::m_minPt {0.}
protected

Definition at line 69 of file Starlight_i.h.

69{0.};

◆ m_minW

double Starlight_i::m_minW {0.}
protected

Definition at line 64 of file Starlight_i.h.

64{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 139 of file GenBase.h.

139{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 75 of file Starlight_i.h.

75{0};

◆ m_nmbPtBinsInterference

int Starlight_i::m_nmbPtBinsInterference {0}
protected

Definition at line 85 of file Starlight_i.h.

85{0};

◆ m_nmbRapidityBins

unsigned int Starlight_i::m_nmbRapidityBins {0}
protected

Definition at line 67 of file Starlight_i.h.

67{0};

◆ m_nmbWBins

unsigned int Starlight_i::m_nmbWBins {0}
protected

Definition at line 65 of file Starlight_i.h.

65{0};

◆ m_nThreads

int Starlight_i::m_nThreads {1}
protected

Definition at line 88 of file Starlight_i.h.

88{1};

◆ m_outputFormat

int Starlight_i::m_outputFormat {0}
protected

Definition at line 77 of file Starlight_i.h.

77{0};

◆ m_ppSvc

ServiceHandle<IPartPropSvc> GenBase::m_ppSvc {this, "PartPropSvc", "PartPropSvc"}
privateinherited

Handle on the particle property service.

Definition at line 160 of file GenBase.h.

160{this, "PartPropSvc", "PartPropSvc"};

◆ m_prodParticleId

int Starlight_i::m_prodParticleId {0}
protected

Definition at line 76 of file Starlight_i.h.

76{0};

◆ m_productionMode

int Starlight_i::m_productionMode {0}
protected

Definition at line 74 of file Starlight_i.h.

74{0};

◆ m_ptBinWidthInterference

double Starlight_i::m_ptBinWidthInterference {0.}
protected

Definition at line 86 of file Starlight_i.h.

86{0.};

◆ m_pythFullRec

bool Starlight_i::m_pythFullRec {false}
protected

Definition at line 89 of file Starlight_i.h.

89{false};

◆ m_randomGenerator

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

Definition at line 52 of file Starlight_i.h.

52{};

◆ 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 99 of file GenModule.h.

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

◆ m_starlight

starlight* Starlight_i::m_starlight {}
protected

Definition at line 51 of file Starlight_i.h.

51{}; // pointer to starlight instance // TODO convert to unique_ptr

◆ m_suppressVMdecay

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

Definition at line 46 of file Starlight_i.h.

46{this, "suppressVMdecay", false};

◆ m_varHandleArraysDeclared

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

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.

◆ m_xsecMethod

bool Starlight_i::m_xsecMethod {false}
protected

Definition at line 87 of file Starlight_i.h.

87{false};

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