 |
ATLAS Offline Software
|
#include <ALFA_BeamTransport.h>
|
| | ALFA_BeamTransport (const std::string &name, ISvcLocator *pSvcLocator) |
| | Standard Athena-Algorithm Constructor. More...
|
| |
| | ~ALFA_BeamTransport () |
| | Default Destructor. More...
|
| |
| StatusCode | initialize () |
| | standard Athena-Algorithm method More...
|
| |
| StatusCode | execute () |
| | standard Athena-Algorithm method More...
|
| |
| StatusCode | finalize () |
| | standard Athena-Algorithm method More...
|
| |
| void | MeVToGeV (HepMC::GenEvent &evt) |
| | convert unit MeV to GeV for energy and momenta More...
|
| |
| void | GeVToMeV (HepMC::GenEvent &evt) |
| | convert GeV to MeV for HepMC event record More...
|
| |
| int | SelectParticles (HepMC::GenEvent *evt) |
| | Selects particles for beam transported Sets event status code of outgoing particles from generator to status != 1. More...
|
| |
| int | DoBeamTracking (int evt_number) |
| | Function which calls BeamTrack class to calcualte Position at RPs. More...
|
| |
| int | TransportSelectedParticle (HepMC::GenEvent &evt, int evt_number) |
| | This function is event selection, tracking and HepMC save ine one function. More...
|
| |
| virtual StatusCode | sysInitialize () override |
| | Override sysInitialize. More...
|
| |
| virtual const DataObjIDColl & | extraOutputDeps () const override |
| | Return the list of extra output dependencies. More...
|
| |
| ServiceHandle< StoreGateSvc > & | evtStore () |
| | The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
|
| |
| const ServiceHandle< StoreGateSvc > & | evtStore () const |
| | The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
|
| |
| const ServiceHandle< StoreGateSvc > & | detStore () const |
| | The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
|
| |
| virtual StatusCode | sysStart () override |
| | Handle START transition. More...
|
| |
| virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| | Return this algorithm's input handles. More...
|
| |
| virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| | Return this algorithm's output handles. More...
|
| |
| Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T, V, H > &t) |
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| | Declare a new Gaudi property. More...
|
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| | Declare a new Gaudi property. More...
|
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| | Declare a new Gaudi property. More...
|
| |
| Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| | Declare a new Gaudi property. More...
|
| |
| void | updateVHKA (Gaudi::Details::PropertyBase &) |
| |
| MsgStream & | msg () const |
| |
| MsgStream & | msg (const MSG::Level lvl) const |
| |
| bool | msgLvl (const MSG::Level lvl) const |
| |
|
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKey> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyArrayType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleType &) |
| | specialization for handling Gaudi::Property<SG::VarHandleBase> More...
|
| |
| Gaudi::Details::PropertyBase & | declareGaudiProperty (Gaudi::Property< T, V, H > &t, const SG::NotHandleType &) |
| | specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
|
| |
This is the ALFA Beam Transport package. It is an interface which uses FPTracker for beamtransportation. Getting from the HepMC eventrecord the particle data at the IP it calculates the particle porition at the first RP.
- Author
- Daniel Pelikan danie.nosp@m.l.pe.nosp@m.likan.nosp@m.@cer.nosp@m.n.ch
Definition at line 45 of file ALFA_BeamTransport.h.
◆ StoreGateSvc_t
◆ ALFA_BeamTransport()
| ALFA_BeamTransport::ALFA_BeamTransport |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ ~ALFA_BeamTransport()
| ALFA_BeamTransport::~ALFA_BeamTransport |
( |
| ) |
|
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| hndl | Object holding the property value. |
| doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| hndl | Object holding the property value. |
| doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| property | Object holding the property value. |
| doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
| name | Name of the property. |
| property | Object holding the property value. |
| doc | Documentation string for the property. |
This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ DoBeamTracking()
| int ALFA_BeamTransport::DoBeamTracking |
( |
int |
evt_number | ) |
|
Function which calls BeamTrack class to calcualte Position at RPs.
Definition at line 205 of file ALFA_BeamTransport.cxx.
228 m_FileBeam1 << evt_number <<
"\t" << std::setprecision(17)
229 <<
m_PosRP1.
x() << std::setprecision(17) <<
"\t"
230 <<
m_PosRP1.
y() <<
"\t" << std::setprecision(17)
231 <<
m_PosRP1.
z() <<
"\t" << std::setprecision(17)
232 <<
m_MomRP1.
x() << std::setprecision(17) <<
"\t"
233 <<
m_MomRP1.
y() <<
"\t" << std::setprecision(17)
234 <<
m_MomRP1.
z() <<
"\t" << std::setprecision(17)
236 m_FileBeam2 << evt_number <<
"\t" << std::setprecision(17)
237 <<
m_PosRP3.
x() << std::setprecision(17) <<
"\t"
238 <<
m_PosRP3.
y() <<
"\t" << std::setprecision(17)
239 <<
m_PosRP3.
z() <<
"\t" << std::setprecision(17)
240 <<
m_MomRP3.
x() << std::setprecision(17) <<
"\t"
241 <<
m_MomRP3.
y() <<
"\t" << std::setprecision(17)
242 <<
m_MomRP3.
z() <<
"\t" << std::setprecision(17)
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
| StatusCode ALFA_BeamTransport::execute |
( |
| ) |
|
standard Athena-Algorithm method
Definition at line 108 of file ALFA_BeamTransport.cxx.
124 if(!eventInfo.isValid()) {
126 return StatusCode::FAILURE;
130 evt_number=eventInfo->eventNumber();
136 if (!mcColl.isValid()) {
138 return StatusCode::SUCCESS;
142 for (
const HepMC::GenEvent* itr : *mcColl){
143 HepMC::GenEvent
evt = (*itr);
171 return StatusCode::SUCCESS;
◆ extraDeps_update_handler()
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.
57 return Algorithm::extraOutputDeps();
◆ finalize()
| StatusCode ALFA_BeamTransport::finalize |
( |
| ) |
|
◆ GeVToMeV()
| void ALFA_BeamTransport::GeVToMeV |
( |
HepMC::GenEvent & |
evt | ) |
|
convert GeV to MeV for HepMC event record
Definition at line 191 of file ALFA_BeamTransport.cxx.
194 const HepMC::FourVector fv(
p->momentum().px() * 1000.,
195 p->momentum().py() * 1000.,
196 p->momentum().pz() * 1000.,
197 p->momentum().e() * 1000.);
◆ initialize()
| StatusCode ALFA_BeamTransport::initialize |
( |
| ) |
|
◆ inputHandles()
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 ALFA_BeamTransport::MeVToGeV |
( |
HepMC::GenEvent & |
evt | ) |
|
convert unit MeV to GeV for energy and momenta
Definition at line 177 of file ALFA_BeamTransport.cxx.
180 const HepMC::FourVector fv(
p->momentum().px() / 1000.,
181 p->momentum().py() / 1000.,
182 p->momentum().pz() / 1000.,
183 p->momentum().e() / 1000.);
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
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.
◆ renounce()
◆ renounceArray()
◆ SelectParticles()
| int ALFA_BeamTransport::SelectParticles |
( |
HepMC::GenEvent * |
evt | ) |
|
Selects particles for beam transported Sets event status code of outgoing particles from generator to status != 1.
◆ sysInitialize()
| StatusCode AthAlgorithm::sysInitialize |
( |
| ) |
|
|
overridevirtualinherited |
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ TransportSelectedParticle()
| int ALFA_BeamTransport::TransportSelectedParticle |
( |
HepMC::GenEvent & |
evt, |
|
|
int |
evt_number |
|
) |
| |
This function is event selection, tracking and HepMC save ine one function.
Definition at line 249 of file ALFA_BeamTransport.cxx.
253 std::vector<FPTracker::Point> PosAtRP1;
254 std::vector<FPTracker::Point> PosAtRP3;
255 std::vector<FPTracker::Point> MomAtPR1;
256 std::vector<FPTracker::Point> MomAtPR3;
257 std::vector<double> EnergyRP1;
258 std::vector<double> EnergyRP3;
273 theta = std::acos(std::abs(
p->momentum().pz()) /
mom);
278 int pid =
p->pdg_id();
282 HepMC::FourVector Position =
p->production_vertex()->position();
283 HepMC::FourVector Momentum =
p->momentum();
291 if (
p->momentum().pz() > 0. &&
pid == 2212) {
296 p1->production_vertex()->position().x() / 1000.,
297 p1->production_vertex()->position().y() / 1000.,
298 p1->production_vertex()->position().z() / 1000.,
301 p1->momentum().pz());
317 m_FileBeam1 << evt_number <<
"\t" << std::setprecision(17)
318 <<
m_PosRP1.
x() << std::setprecision(17) <<
"\t"
319 <<
m_PosRP1.
y() <<
"\t" << std::setprecision(17)
320 <<
m_PosRP1.
z() <<
"\t" << std::setprecision(17)
321 <<
m_MomRP1.
x() << std::setprecision(17) <<
"\t"
322 <<
m_MomRP1.
y() <<
"\t" << std::setprecision(17)
323 <<
m_MomRP1.
z() <<
"\t" << std::setprecision(17)
327 }
else if (
p->momentum().pz() < 0. &&
pid == 2212) {
331 p2->production_vertex()->position().x() / 1000.,
332 p2->production_vertex()->position().y() / 1000.,
333 p2->production_vertex()->position().z() / 1000.,
336 p2->momentum().pz());
350 m_FileBeam2 << evt_number <<
"\t" << std::setprecision(17)
351 <<
m_PosRP3.
x() << std::setprecision(17) <<
"\t"
352 <<
m_PosRP3.
y() <<
"\t" << std::setprecision(17)
353 <<
m_PosRP3.
z() <<
"\t" << std::setprecision(17)
354 <<
m_MomRP3.
x() << std::setprecision(17) <<
"\t"
355 <<
m_MomRP3.
y() <<
"\t" << std::setprecision(17)
356 <<
m_MomRP3.
z() <<
"\t" << std::setprecision(17)
367 ATH_MSG_ERROR(
"Strange: More than two protons in this event!");
376 ATH_MSG_INFO(
"Add transproted particle into HepMC event record Beam 1");
379 for(
int i=0;
i<(
int)PosAtRP1.size();
i++){
381 HepMC::FourVector PositionVectorRP1 = HepMC::FourVector(PosAtRP1.at(
i).x()*1000.,PosAtRP1.at(
i).y()*1000.,PosAtRP1.at(
i).z()*1000.,0.*1000.);
382 HepMC::FourVector MomentumVectorRP1 = HepMC::FourVector(MomAtPR1.at(
i).x(),MomAtPR1.at(
i).y(),MomAtPR1.at(
i).z(),EnergyRP1.at(
i));
387 VertexRP1->add_particle_out(std::move(ParticleRP1));
390 evt.add_vertex(std::move(VertexRP1));
393 ATH_MSG_INFO (
"Add transproted particle into HepMC event record Beam 2" );
394 for(
int i=0;
i<(
int)PosAtRP3.size();
i++){
395 HepMC::FourVector PositionVectorRP3 = HepMC::FourVector(PosAtRP3.at(
i).x()*1000.,PosAtRP3.at(
i).y()*1000.,PosAtRP3.at(
i).z()*1000.,0.*1000.);
396 HepMC::FourVector MomentumVectorRP3 = HepMC::FourVector(MomAtPR3.at(
i).x(),MomAtPR3.at(
i).y(),MomAtPR3.at(
i).z(),EnergyRP3.at(
i));
399 VertexRP3->add_particle_out(std::move(ParticleRP3));
401 evt.add_vertex(std::move(VertexRP3));
◆ updateVHKA()
◆ m_BeamTracker
◆ m_detStore
◆ m_EnergyRP1
| double ALFA_BeamTransport::m_EnergyRP1 = 0.0 |
|
private |
◆ m_EnergyRP3
| double ALFA_BeamTransport::m_EnergyRP3 = 0.0 |
|
private |
◆ m_EtaCut
| double ALFA_BeamTransport::m_EtaCut |
|
private |
◆ m_eventInfoKey
Initial value:{ this,
"EvtInfo",
"EventInfo",
"EventInfo name" }
Definition at line 83 of file ALFA_BeamTransport.h.
◆ m_evtStore
◆ m_extendedExtraObjects
| DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_FileBeam1
| std::ofstream ALFA_BeamTransport::m_FileBeam1 |
|
private |
◆ m_FileBeam2
| std::ofstream ALFA_BeamTransport::m_FileBeam2 |
|
private |
◆ m_FPConfig
◆ m_FPOutputBeam1
| std::string ALFA_BeamTransport::m_FPOutputBeam1 |
|
private |
◆ m_FPOutputBeam2
| std::string ALFA_BeamTransport::m_FPOutputBeam2 |
|
private |
◆ m_MCKey
Initial value:{
this,
"McEventCollectionName",
"GEN_EVENT",
"MC Event Collection name"
}
Definition at line 76 of file ALFA_BeamTransport.h.
◆ m_MomRP1
◆ m_MomRP3
◆ m_Particle1
◆ m_Particle2
◆ m_pcount
| int ALFA_BeamTransport::m_pcount = 0 |
|
private |
◆ m_pint
| int ALFA_BeamTransport::m_pint = 0 |
|
private |
◆ m_PosRP1
◆ m_PosRP3
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_WriteDebugOutput
| bool ALFA_BeamTransport::m_WriteDebugOutput |
|
private |
◆ m_XiCut
| double ALFA_BeamTransport::m_XiCut |
|
private |
The documentation for this class was generated from the following files:
HepMC::GenVertex * GenVertexPtr
ALFA_BeamTrack m_BeamTracker
std::ofstream m_FileBeam1
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
std::string m_FPOutputBeam1
std::string m_FPOutputBeam2
std::ofstream m_FileBeam2
FPTracker::Point m_MomRP3
Scalar eta() const
pseudorapidity method
Scalar theta() const
theta method
GenParticle * GenParticlePtr
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
FPTracker::Particle m_Particle1
std::vector< SG::VarHandleKeyArray * > m_vhka
void GeVToMeV(HepMC::GenEvent &evt)
convert GeV to MeV for HepMC event record
void line(std::ostream &os, const GenEvent &e)
FPTracker::Point m_MomRP1
Particle_v1 Particle
Define the latest version of the particle class.
virtual void setOwner(IDataHandleHolder *o)=0
SG::ReadHandleKey< McEventCollection > m_MCKey
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual StatusCode sysInitialize() override
Override sysInitialize.
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
GenVertexPtr newGenVertexPtr(const HepMC::FourVector &pos=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), const int i=0)
::StatusCode StatusCode
StatusCode definition for legacy code.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
int TransportSelectedParticle(HepMC::GenEvent &evt, int evt_number)
This function is event selection, tracking and HepMC save ine one function.
FPTracker::Point m_PosRP1
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
DataObjIDColl m_extendedExtraObjects
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
GenParticlePtr newGenParticlePtr(const HepMC::FourVector &mom=HepMC::FourVector(0.0, 0.0, 0.0, 0.0), int pid=0, int status=0)
#define ATH_MSG_WARNING(x)
FPTracker::Particle m_Particle2
void MeVToGeV(HepMC::GenEvent &evt)
convert unit MeV to GeV for energy and momenta
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
AthAlgorithm()
Default constructor:
FPTracker::Point m_PosRP3
constexpr int pow(int base, int exp) noexcept