 |
ATLAS Offline Software
|
Filtering algorithm to sanity check HepMC event features.
More...
#include <TestHepMC.h>
|
| TestHepMC (const std::string &name, ISvcLocator *pSvcLocator) |
|
StatusCode | initialize () |
|
StatusCode | execute () |
|
StatusCode | finalize () |
|
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...
|
|
Filtering algorithm to sanity check HepMC event features.
The TestHepMC algorithm is used in MC production to ensure that only events with valid final state particles, properly balanced initial-final state momentum and energy, etc. are accepted for further processing. A too-high failure rate results in a warning or algorithm failure to flag up to production that there is a fundamental problem and that the sanity check may be unphysically biasing the resulting events.
- Todo:
- Inherit from GenFilter? It is a filter
Definition at line 33 of file TestHepMC.h.
◆ StoreGateSvc_t
◆ TestHepMC()
TestHepMC::TestHepMC |
( |
const std::string & |
name, |
|
|
ISvcLocator * |
pSvcLocator |
|
) |
| |
◆ 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.
78 ATH_MSG_ERROR(
"McEventCollection is empty during first event access");
79 return *(
events()->begin());
◆ ATLAS_NOT_CONST_THREAD_SAFE() [2/2]
◆ cmTomm()
void GenBase::cmTomm |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event lengths by x 10.
Definition at line 78 of file GenBase.cxx.
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);
◆ 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()
◆ event_const()
const HepMC::GenEvent* GenBase::event_const |
( |
| ) |
const |
|
inlineinherited |
Access the current signal event (const)
Definition at line 83 of file GenBase.h.
85 ATH_MSG_ERROR(
"Const McEventCollection is empty during first event access");
◆ events_const() [1/2]
◆ events_const() [2/2]
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute()
StatusCode TestHepMC::execute |
( |
| ) |
|
|
virtual |
- Todo:
- Clean up / improve / apply to all decaying species
- Todo:
- Persuade generator authors to set proper generated masses in HepMC, then really require mass = 0
Reimplemented from GenBase.
Definition at line 269 of file TestHepMC.cxx.
272 bool filter_pass =
true;
280 double nonG4_energy = 0;
281 std::vector<HepMC::ConstGenParticlePtr> negEnPart;
282 std::vector<HepMC::ConstGenParticlePtr> tachyons;
283 std::vector<HepMC::ConstGenParticlePtr> unstNoEnd;
284 std::vector<HepMC::ConstGenParticlePtr> unDecPi0;
285 std::vector<HepMC::ConstGenParticlePtr> undisplaceds;
291 ATH_MSG_DEBUG(
"Please use MC::Loops::findLoops for this event to obtain all particles and vertices in the loops");
296 const auto xsec =
evt->cross_section();
298 ATH_MSG_WARNING(
"WATCH OUT: event is missing the generator cross-section!");
301 ATH_MSG_WARNING(
"-> Adding a dummy cross-section for debugging purposes.");
303 std::shared_ptr<HepMC3::GenCrossSection> dummy_xsec = std::make_shared<HepMC3::GenCrossSection>();
304 dummy_xsec->set_cross_section(1.0,0.0);
305 HepMC::GenEvent* evt_nonconst =
const_cast<HepMC::GenEvent*
>(
evt);
306 evt_nonconst->set_cross_section(std::move(dummy_xsec));
314 std::vector<std::shared_ptr<const HepMC3::GenParticle>> beams_t;
315 for (
auto p :
evt->beams()) {
if (
p->status() == 4) beams_t.push_back(std::move(
p)); }
316 std::pair<std::shared_ptr<const HepMC3::GenParticle>,std::shared_ptr<const HepMC3::GenParticle>> beams;
317 if (beams_t.size() == 2) {
318 beams.first=beams_t.at(0);
319 beams.second=beams_t.at(1);
321 ATH_MSG_WARNING(
"Invalid number of beam particles " << beams_t.size() <<
" this generator interface should be fixed");
326 auto beams =
evt->beam_particles();
330 ATH_MSG_WARNING(
"Invalid beam particle pointers -- this generator interface should be fixed");
331 if (cmenergy < 0)
ATH_MSG_WARNING(
"Invalid expected beam energy: " << cmenergy <<
" MeV");
335 ATH_MSG_WARNING(
"Beam particles have incorrectly set status -- this generator interface should be fixed");
338 const double sumE = beams.first->momentum().e() + beams.second->momentum().e();
339 const double sumP = beams.first->momentum().pz() + beams.second->momentum().pz();
340 cmenergy = std::sqrt(sumE*sumE - sumP*sumP);
342 if(beams.first->pdg_id() == MC::OXYGEN && beams.second->pdg_id() == MC::OXYGEN){
345 if(beams.first->pdg_id() == MC::LEAD && beams.second->pdg_id() == MC::LEAD){
348 if(beams.first->pdg_id() == MC::OXYGEN && beams.second->pdg_id() == MC::PROTON){
351 if(beams.first->pdg_id() == MC::PROTON && beams.second->pdg_id() == MC::OXYGEN){
354 if(beams.first->pdg_id() == MC::LEAD && beams.second->pdg_id() == MC::PROTON){
357 if(beams.first->pdg_id() == MC::PROTON && beams.second->pdg_id() == MC::LEAD){
360 if(beams.first->pdg_id() == MC::OXYGEN && beams.second->pdg_id() == MC::HELIUM){
363 if(beams.first->pdg_id() == MC::HELIUM && beams.second->pdg_id() == MC::OXYGEN){
369 setFilterPassed(
false);
377 return StatusCode::FAILURE;
382 int vtxDisplacedstatuscode12CheckRateCnt=0;
383 int vtxDisplacedstatuscodenot12CheckRateCnt=0;
384 int vtxDisplacedMoreThan_1m_CheckRateCnt=0;
386 for (
const auto& vtx:
evt->vertices()) {
388 for (
auto vitr =
evt->vertices_begin(); vitr !=
evt->vertices_end(); ++vitr ) {
389 const HepMC::GenVertex* vtx = *vitr;
391 const HepMC::FourVector
pos = vtx->position();
394 if ( std::isnan(
pos.x()) || std::isinf(
pos.x()) ||
395 std::isnan(
pos.y()) || std::isinf(
pos.y()) ||
396 std::isnan(
pos.z()) || std::isinf(
pos.z()) ) {
397 ATH_MSG_WARNING(
"NaN (Not A Number) or inf found in the event record vertex positions");
408 const double dist_trans2 =
pos.x()*
pos.x() +
pos.y()*
pos.y();
409 const double dist2 = dist_trans2 +
pos.z()*
pos.z();
410 const double dist_trans = std::sqrt(dist_trans2);
411 const double dist = std::sqrt(dist2);
414 ++vtxDisplacedMoreThan_1m_CheckRateCnt;
424 for (
const auto&
part: vtx->particles_in()) {
426 for (
auto part_it = vtx->particles_in_const_begin(); part_it != vtx->particles_in_const_end(); ++part_it) {
427 auto part=(*part_it);
433 ATH_MSG_WARNING(
"production vertex = " <<
part->production_vertex()->position().x() <<
", " <<
part->production_vertex()->position().y() <<
", " <<
part->production_vertex()->position().z());
434 ATH_MSG_WARNING(
"end vertex = " <<
part->end_vertex()->position().x() <<
", " <<
part->end_vertex()->position().y() <<
", " <<
part->end_vertex()->position().z());
436 if (
part->production_vertex()) {
438 for(
const auto& p_parents:
part->production_vertex()->particles_in()) {
440 for(
auto p_parents_it =
part->production_vertex()->particles_in_const_begin(); p_parents_it !=
part->production_vertex()->particles_in_const_end(); ++p_parents_it) {
441 auto p_parents=(*p_parents_it);
444 msg(MSG::WARNING) <<
"\t";
450 if (
part->status() == 1 ||
part->status() == 2){
451 vtxDisplacedstatuscode12CheckRateCnt += 1;
453 vtxDisplacedstatuscodenot12CheckRateCnt += 1;
472 double endvx =
part->end_vertex()->position().x();
473 double endvy =
part->end_vertex()->position().y();
474 double endvz =
part->end_vertex()->position().z();
475 double prodvx =
part->production_vertex()->position().x();
476 double prodvy =
part->production_vertex()->position().y();
477 double prodvz =
part->production_vertex()->position().z();
478 double enddis = std::sqrt(endvx*endvx + endvy*endvy + endvz*endvz);
479 double proddis = std::sqrt(prodvx*prodvx + prodvy*prodvy + prodvz*prodvz);
491 for (
auto pitr: *
evt) {
494 const HepMC::FourVector pmom = pitr->momentum();
495 const int pstatus = pitr->status();
496 const int ppdgid = pitr->pdg_id();
498 if ( std::isnan(pmom.px()) || std::isinf(pmom.px()) ||
499 std::isnan(pmom.py()) || std::isinf(pmom.py()) ||
500 std::isnan(pmom.pz()) || std::isinf(pmom.pz()) ||
501 std::isnan(pmom.e()) || std::isinf(pmom.e()) ) {
502 ATH_MSG_WARNING(
"NaN (Not A Number) or inf found in the event record momenta");
513 if (ppdgid == 111 && !pitr->end_vertex() ) {
514 unDecPi0.push_back( pitr);
523 double plifetime =
pd->lifetime()*1
e+12;
524 if (plifetime != 0 && plifetime <
m_min_tau) {
525 ATH_MSG_WARNING(
"Stable particle found with lifetime = " << plifetime <<
"~ns!!");
537 std::vector<int>::size_type
count = 0;
546 ATH_MSG_WARNING(
"Stable particle not found in PDT, no lifetime check done");
553 const MC::DecodedPID decodedPID(ppdgid);
554 const int first_dig = decodedPID(0);
559 std::vector<int>::size_type
count =0;
566 nonG4_energy += pmom.e();
567 ATH_MSG_WARNING(
"Interacting particle not known by Geant4 with ID " << ppdgid);
582 unstNoEnd.push_back(pitr);
589 totalPx += pmom.px();
590 totalPy += pmom.py();
591 totalPz += pmom.pz();
594 negEnPart.push_back(pitr);
597 const double aener = std::abs(pmom.e());
599 tachyons.push_back(pitr);
609 auto vtx = pitr->end_vertex();
613 for (
auto desc: HepMC::descendant_particles(vtx)) {
615 for (
auto desc_it = vtx->particles_begin(HepMC::descendants); desc_it != vtx->particles_end(HepMC::descendants); ++desc_it) {
616 auto desc=(*desc_it);
618 if (std::abs(
desc->pdg_id()) ==
m_pdg) tau_child = 1;
621 if (std::abs( p_energy - pmom.e()) >
m_energy_diff && !tau_child) {
623 <<
"Energy (original particle) > " <<
m_energy_diff <<
" MeV, "
624 <<
"Event #" <<
evt->event_number() <<
", "
625 <<
"The original particle = " << pitr);
630 const HepMC::FourVector tau_decaypos = vtx->position();
631 const double tau_displacement = tau_decaypos.x()*tau_decaypos.x() + tau_decaypos.y()*tau_decaypos.y() + tau_decaypos.z()*tau_decaypos.z();
642 if (pitr->end_vertex()) {
643 auto decayvtx = pitr->end_vertex();
644 const HepMC::FourVector decaypos = decayvtx->position();
645 const double displacement = decaypos.x()*decaypos.x() + decaypos.y()*decaypos.y() + decaypos.z()*decaypos.z();
646 if (displacement > 1
e-6) {
647 for (
auto ip: *decayvtx) {
648 const HepMC::FourVector pos2 =
ip->production_vertex()->position();
649 const double displacement2 = pos2.x()*pos2.x() + pos2.y()*pos2.y() + pos2.z()*pos2.z();
650 if (displacement2 < 1
e-6) {
652 <<
" has undisplaced vertex (" <<
ip->production_vertex()
653 <<
" @ " << displacement2 <<
"mm) "
654 <<
" but parent vertex is displaced (" << decayvtx
655 <<
" @ " << displacement <<
"mm)");
656 undisplaceds.push_back(std::move(
ip));
666 const double mass = pitr->generated_mass();
667 if (std::abs(
mass) > 1.0) {
677 ATH_MSG_WARNING(
"The energy of interacting particles not known by Geant4 is = " << nonG4_energy <<
" MeV");
685 double lostE = std::abs(totalE - cmenergy);
687 ATH_MSG_WARNING(
"ENERGY BALANCE FAILED : E-difference = " << lostE <<
" MeV");
689 ATH_MSG_WARNING(
"balance " << totalPx <<
" " << totalPy <<
" " << totalPz <<
" " << totalE);
703 ATH_MSG_WARNING(
"MOMENTUM BALANCE FAILED : SumPx = " << totalPx <<
" SumPy = " << totalPy <<
" SumPz = " << totalPz <<
" MeV");
717 if (!negEnPart.empty()) {
718 std::stringstream
ss;
719 ss <<
"NEGATIVE ENERGY PARTICLES FOUND :";
720 for (
const auto &
b: negEnPart){
732 if (!tachyons.empty()) {
733 std::stringstream
ss;
734 ss <<
"PARTICLES WITH |E| < |Pi| (i=x,y,z) FOUND :";
735 for (
auto b: tachyons){
747 if (!unstNoEnd.empty()) {
748 std::stringstream
ss;
749 ss <<
"Unstable particle with no decay vertex found: ";
750 for (
auto b: unstNoEnd){
762 if (!unDecPi0.empty()) {
763 std::stringstream
ss;
764 ss <<
"pi0 with no decay vertex found:";
765 for (
auto b: unDecPi0){
777 if (!undisplaceds.empty()) {
778 std::stringstream
ss{
"Undisplaced decay vertices from displaced particle: "};
795 setFilterPassed(
false);
806 return StatusCode::FAILURE;
809 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 TestHepMC::finalize |
( |
| ) |
|
Definition at line 813 of file TestHepMC.cxx.
824 if (!
m_vtxNaNTest)
ATH_MSG_INFO(
" The check for NaN or inf in vtx. record is switched off, so is not included in the final TestHepMC efficiency ");
827 if (!
m_vtxDisplacedTest)
ATH_MSG_INFO(
" The check for displaced vertices is switched off, so is not included in the final TestHepMC efficiency ");
829 if (!
m_momNaNTest)
ATH_MSG_INFO(
" The check for NaN/inf in momentum record is switched off, so is not included in the final TestHepMC efficiency ");
839 if (!
m_momImbalanceTest)
ATH_MSG_INFO(
" The check for momentum imbalance is switched off, so is not included in the final TestHepMC efficiency ");
841 if (!
m_negativeEnergyTest)
ATH_MSG_INFO(
" The check for particles with negative energy is switched off, so is not included in the final TestHepMC efficiency ");
843 if (!
m_tachyonsTest)
ATH_MSG_INFO(
" The check for tachyons is switched off, so is not included in the final TestHepMC efficiency ");
846 if (!
m_unstableNoVtxTest)
ATH_MSG_INFO(
" The check for unstable part. without end vertex is switched off, so is not included in the final TestHepMC efficiency ");
848 if (!
m_pi0NoVtxTest)
ATH_MSG_INFO(
" The check for undecayed pi0's is switched off, so is not included in the final TestHepMC efficiency ");
852 if (!
m_lifeTimeTest)
ATH_MSG_INFO(
" The check for status 1 particles with too short lifetime is switched off, so is not included in the final TestHepMC efficiency ");
854 if (!
m_energyG4Test)
ATH_MSG_INFO(
" The check for energy not known by G4 is switched off, so is not included in the final TestHepMC efficiency ");
861 return StatusCode::FAILURE;
870 return StatusCode::FAILURE;
880 return StatusCode::FAILURE;
885 return StatusCode::SUCCESS;
◆ 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.
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());
◆ initialize()
StatusCode TestHepMC::initialize |
( |
| ) |
|
|
virtual |
Reimplemented from GenBase.
Definition at line 130 of file TestHepMC.cxx.
188 ATH_MSG_INFO(
"No decay vertex - is ignored for particles with status (list):" );
197 std::ifstream G4file;
198 G4file.open(fileLocation);
202 while(std::getline(G4file,
line)){
203 std::stringstream
ss(
line);
210 ATH_MSG_WARNING(
"Failed to open G4particle_acceptlist.txt, checking that all particles are known by Genat4 cannot be performed");
217 while(std::getline(G4file,
line)){
218 std::stringstream
ss(
line);
229 std::ifstream susyFile;
230 susyFile.open(
"susyParticlePdgid.txt");
232 if (!susyFile.fail()){
233 while(getline(susyFile,
line)){
234 std::stringstream ss1(
line);
241 ATH_MSG_WARNING(
"Failed to open susyParticlePdgid.txt, listing particles not present in PDTTable");
245 std::ifstream pdgFile;
248 if (!pdgFile.fail()){
250 while(std::getline(pdgFile,
line)){
251 std::stringstream
ss(
line);
258 ATH_MSG_INFO(
"extra accept list for PDG IDs not provided");
265 return StatusCode::SUCCESS;
◆ 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 GenBase::MeVToGeV |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event energies/momenta by x 1/1000.
Definition at line 68 of file GenBase.cxx.
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);
◆ mmTocm()
void GenBase::mmTocm |
( |
HepMC::GenEvent * |
evt | ) |
|
|
protectedinherited |
Scale event lengths by x 1/10.
Definition at line 87 of file GenBase.cxx.
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);
◆ 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.
◆ 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.
◆ particleTable()
const HepPDT::ParticleDataTable& GenBase::particleTable |
( |
| ) |
const |
|
inlineinherited |
Get a particle data table.
Definition at line 118 of file GenBase.h.
◆ partPropSvc()
Access the particle property service.
Definition at line 113 of file GenBase.h.
◆ pdt()
const HepPDT::ParticleDataTable& GenBase::pdt |
( |
| ) |
const |
|
inlineinherited |
Shorter alias to get a particle data table.
Definition at line 123 of file GenBase.h.
◆ renounce()
◆ renounceArray()
◆ 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.
◆ updateVHKA()
◆ m_accur_margin
double TestHepMC::m_accur_margin |
|
private |
◆ m_allowMissingXSec
bool TestHepMC::m_allowMissingXSec |
|
private |
◆ m_beamEnergyCheckRate
int TestHepMC::m_beamEnergyCheckRate |
|
private |
◆ m_beamEnergyTest
bool TestHepMC::m_beamEnergyTest |
|
private |
◆ m_beamParticleswithStatusNotFourCheckRate
int TestHepMC::m_beamParticleswithStatusNotFourCheckRate |
|
private |
◆ m_cm_energy
double TestHepMC::m_cm_energy |
|
private |
◆ m_cme_diff
double TestHepMC::m_cme_diff |
|
private |
◆ m_decayCheckRate
int TestHepMC::m_decayCheckRate |
|
private |
◆ m_detStore
◆ m_doHist
◆ m_dumpEvent
bool TestHepMC::m_dumpEvent |
|
private |
◆ m_eff_fail_threshold
double TestHepMC::m_eff_fail_threshold |
|
private |
◆ m_eff_warn_threshold
double TestHepMC::m_eff_warn_threshold |
|
private |
◆ m_energy_diff
double TestHepMC::m_energy_diff |
|
private |
◆ m_energyBalanceCheckRate
int TestHepMC::m_energyBalanceCheckRate |
|
private |
◆ m_energyG4Test
bool TestHepMC::m_energyG4Test |
|
private |
◆ m_energyImbalanceTest
bool TestHepMC::m_energyImbalanceTest |
|
private |
◆ m_evtStore
◆ m_extendedExtraObjects
DataObjIDColl AthAlgorithm::m_extendedExtraObjects |
|
privateinherited |
◆ m_FastDecayedTau
int TestHepMC::m_FastDecayedTau |
|
private |
◆ m_G4pdgID_tab
std::vector<int> TestHepMC::m_G4pdgID_tab |
|
private |
◆ m_h_beamparticle1_Energy
TH1F* TestHepMC::m_h_beamparticle1_Energy |
|
private |
◆ m_h_beamparticle2_Energy
TH1F* TestHepMC::m_h_beamparticle2_Energy |
|
private |
◆ m_h_cmEnergyDiff
TH1F* TestHepMC::m_h_cmEnergyDiff |
|
private |
◆ m_h_energy_dispVtxCheck
TH1F* TestHepMC::m_h_energy_dispVtxCheck |
|
private |
◆ m_h_energy_dispVtxCheck_lt10
TH1F* TestHepMC::m_h_energy_dispVtxCheck_lt10 |
|
private |
◆ m_h_energyImbalance
TH1F* TestHepMC::m_h_energyImbalance |
|
private |
◆ m_h_momentumImbalance_px
TH1F* TestHepMC::m_h_momentumImbalance_px |
|
private |
◆ m_h_momentumImbalance_py
TH1F* TestHepMC::m_h_momentumImbalance_py |
|
private |
◆ m_h_momentumImbalance_pz
TH1F* TestHepMC::m_h_momentumImbalance_pz |
|
private |
◆ m_h_pdgid_dispVtxCheck
TH1F* TestHepMC::m_h_pdgid_dispVtxCheck |
|
private |
◆ m_h_photon_e2_p2_e2
TH1F* TestHepMC::m_h_photon_e2_p2_e2 |
|
private |
◆ m_h_photon_energy
TH1F* TestHepMC::m_h_photon_energy |
|
private |
◆ m_h_photon_mass
TH1F* TestHepMC::m_h_photon_mass |
|
private |
◆ m_h_px_dispVtxCheck
TH1F* TestHepMC::m_h_px_dispVtxCheck |
|
private |
◆ m_h_py_dispVtxCheck
TH1F* TestHepMC::m_h_py_dispVtxCheck |
|
private |
◆ m_h_pz_dispVtxCheck
TH1F* TestHepMC::m_h_pz_dispVtxCheck |
|
private |
◆ m_h_status_dispVtxCheck
TH1F* TestHepMC::m_h_status_dispVtxCheck |
|
private |
◆ m_h_vtxend_dispVtxCheck
TH1F* TestHepMC::m_h_vtxend_dispVtxCheck |
|
private |
◆ m_h_vtxprod_dispVtxCheck
TH1F* TestHepMC::m_h_vtxprod_dispVtxCheck |
|
private |
◆ m_h_vx_dispVtxCheck
TH1F* TestHepMC::m_h_vx_dispVtxCheck |
|
private |
◆ m_h_vxprod_dispVtxCheck
TH1F* TestHepMC::m_h_vxprod_dispVtxCheck |
|
private |
◆ m_h_vy_dispVtxCheck
TH1F* TestHepMC::m_h_vy_dispVtxCheck |
|
private |
◆ m_h_vyprod_dispVtxCheck
TH1F* TestHepMC::m_h_vyprod_dispVtxCheck |
|
private |
◆ m_h_vz_dispVtxCheck
TH1F* TestHepMC::m_h_vz_dispVtxCheck |
|
private |
◆ m_h_vzprod_dispVtxCheck
TH1F* TestHepMC::m_h_vzprod_dispVtxCheck |
|
private |
◆ m_invalidBeamParticlesCheckRate
int TestHepMC::m_invalidBeamParticlesCheckRate |
|
private |
◆ m_lifeTimeTest
bool TestHepMC::m_lifeTimeTest |
|
private |
◆ m_looper
◆ m_max_dist
double TestHepMC::m_max_dist |
|
private |
◆ m_max_dist_trans
double TestHepMC::m_max_dist_trans |
|
private |
◆ m_max_energy_diff
double TestHepMC::m_max_energy_diff |
|
private |
◆ m_maxloops
int TestHepMC::m_maxloops |
|
private |
◆ 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.
◆ m_mcevents_const
Const handle to the MC event collection.
Definition at line 163 of file GenBase.h.
◆ m_min_tau
double TestHepMC::m_min_tau |
|
private |
◆ 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.
◆ m_momentumBalanceCheckRate
int TestHepMC::m_momentumBalanceCheckRate |
|
private |
◆ m_momImbalanceTest
bool TestHepMC::m_momImbalanceTest |
|
private |
◆ m_momNaNTest
bool TestHepMC::m_momNaNTest |
|
private |
◆ m_negativeEnergyCheckRate
int TestHepMC::m_negativeEnergyCheckRate |
|
private |
◆ m_negativeEnergyTachyonicCheckRate
int TestHepMC::m_negativeEnergyTachyonicCheckRate |
|
private |
◆ m_negativeEnergyTest
bool TestHepMC::m_negativeEnergyTest |
|
private |
◆ m_nFail
◆ m_nonG4_energy_threshold
double TestHepMC::m_nonG4_energy_threshold |
|
private |
◆ m_nonG4_energyCheckRate
int TestHepMC::m_nonG4_energyCheckRate |
|
private |
◆ m_nonZeroPhotonMassCheckRate
int TestHepMC::m_nonZeroPhotonMassCheckRate |
|
private |
◆ m_noXSECset
int TestHepMC::m_noXSECset |
|
private |
◆ m_nPass
◆ m_paramFile
std::string TestHepMC::m_paramFile |
|
private |
◆ m_partMomentumNANandINFCheckRate
int TestHepMC::m_partMomentumNANandINFCheckRate |
|
private |
◆ m_pdg
◆ m_pi0NoVtxTest
bool TestHepMC::m_pi0NoVtxTest |
|
private |
◆ 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.
◆ m_stableUnstableNoParentCheckRate
int TestHepMC::m_stableUnstableNoParentCheckRate |
|
private |
◆ m_Status1ShortLifetime
int TestHepMC::m_Status1ShortLifetime |
|
private |
◆ m_SusyPdgID_tab
std::vector<int> TestHepMC::m_SusyPdgID_tab |
|
private |
◆ m_tachyonCheckRate
int TestHepMC::m_tachyonCheckRate |
|
private |
◆ m_tachyonsTest
bool TestHepMC::m_tachyonsTest |
|
private |
◆ m_tau_eff_threshold
double TestHepMC::m_tau_eff_threshold |
|
private |
◆ m_thistSvc
◆ m_TotalTaus
int TestHepMC::m_TotalTaus |
|
private |
◆ m_uknownPDGID_tab
std::vector<int> TestHepMC::m_uknownPDGID_tab |
|
private |
◆ m_undecayedPi0CheckRate
int TestHepMC::m_undecayedPi0CheckRate |
|
private |
◆ m_undecayedPi0statuscode12CheckRate
int TestHepMC::m_undecayedPi0statuscode12CheckRate |
|
private |
◆ m_undisplacedDaughtersTest
bool TestHepMC::m_undisplacedDaughtersTest |
|
private |
◆ m_undisplacedDecayDaughtersOfDisplacedVtxCheckRate
int TestHepMC::m_undisplacedDecayDaughtersOfDisplacedVtxCheckRate |
|
private |
◆ m_undisplacedLLHdaughtersCheckRate
int TestHepMC::m_undisplacedLLHdaughtersCheckRate |
|
private |
◆ m_unknownPDGIDCheckRate
int TestHepMC::m_unknownPDGIDCheckRate |
|
private |
◆ m_unknownPDGIDFile
std::string TestHepMC::m_unknownPDGIDFile |
|
private |
◆ m_unknownPDGIDTest
bool TestHepMC::m_unknownPDGIDTest |
|
private |
◆ m_unstableNoEndVtxCheckRate
int TestHepMC::m_unstableNoEndVtxCheckRate |
|
private |
◆ m_unstableNoVtxTest
bool TestHepMC::m_unstableNoVtxTest |
|
private |
◆ m_unstablePartNoDecayVtxCheckRate
int TestHepMC::m_unstablePartNoDecayVtxCheckRate |
|
private |
◆ m_varHandleArraysDeclared
◆ m_vertexStatuses
std::vector<int> TestHepMC::m_vertexStatuses |
|
private |
◆ m_vhka
◆ m_vtxDisplacedMoreThan_1m_CheckRate
int TestHepMC::m_vtxDisplacedMoreThan_1m_CheckRate |
|
private |
◆ m_vtxDisplacedstatuscode12CheckRate
int TestHepMC::m_vtxDisplacedstatuscode12CheckRate |
|
private |
◆ m_vtxDisplacedstatuscodenot12CheckRate
int TestHepMC::m_vtxDisplacedstatuscodenot12CheckRate |
|
private |
◆ m_vtxDisplacedTest
bool TestHepMC::m_vtxDisplacedTest |
|
private |
◆ m_vtxNANandINFCheckRate
int TestHepMC::m_vtxNANandINFCheckRate |
|
private |
◆ m_vtxNaNTest
bool TestHepMC::m_vtxNaNTest |
|
private |
The documentation for this class was generated from the following files:
TH1F * m_h_status_dispVtxCheck
TH1F * m_h_vx_dispVtxCheck
TH1F * m_h_py_dispVtxCheck
bool isNucleus(const T &p)
PDG rule 16 Nuclear codes are given as 10-digit numbers ±10LZZZAAAI.
void content(std::ostream &os, const GenEvent &e)
int m_energyBalanceCheckRate
int m_unstablePartNoDecayVtxCheckRate
double m_eff_fail_threshold
std::string find(const std::string &s)
return a remapped string
const_pointer_type cptr()
Dereference the pointer.
int m_beamParticleswithStatusNotFourCheckRate
bool m_negativeEnergyTest
double baryonNumber(const T &p)
const McEventCollection * events_const() const
Access the current event's McEventCollection (const)
int m_negativeEnergyCheckRate
TH1F * m_h_vtxprod_dispVtxCheck
ServiceHandle< ITHistSvc > m_thistSvc
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
TH1F * m_h_momentumImbalance_pz
int m_vtxDisplacedstatuscodenot12CheckRate
int m_vtxDisplacedstatuscode12CheckRate
std::string m_unknownPDGIDFile
bool isValid(const T &p)
Av: we implement here an ATLAS-sepcific convention: all particles which are 99xxxxx are fine.
const std::string & key() const
Return the StoreGate ID for the referenced object.
int m_unknownPDGIDCheckRate
int m_momentumBalanceCheckRate
void line(std::ostream &os, const GenEvent &e)
std::vector< int > m_G4pdgID_tab
TH1F * m_h_px_dispVtxCheck
std::vector< int > m_uknownPDGID_tab
double m_eff_warn_threshold
virtual void setOwner(IDataHandleHolder *o)=0
double m_nonG4_energy_threshold
TH1F * m_h_pz_dispVtxCheck
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
int m_stableUnstableNoParentCheckRate
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
ServiceHandle< IPartPropSvc > m_ppSvc
Handle on the particle property service.
int m_unstableNoEndVtxCheckRate
std::vector< int > m_SusyPdgID_tab
void efficiency(std::vector< double > &bins, std::vector< double > &values, const std::vector< std::string > &files, const std::string &histname, const std::string &tplotname, const std::string &label="")
virtual StatusCode sysInitialize() override
Override sysInitialize.
std::vector< int > m_vertexStatuses
int m_undecayedPi0statuscode12CheckRate
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override
Return this algorithm's output handles.
int m_vtxNANandINFCheckRate
int m_partMomentumNANandINFCheckRate
::StatusCode StatusCode
StatusCode definition for legacy code.
TH1F * m_h_beamparticle2_Energy
TH1F * m_h_vyprod_dispVtxCheck
int m_undecayedPi0CheckRate
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
SG::ReadHandleKey< McEventCollection > m_mcevents_const
Const handle to the MC event collection.
TH1F * m_h_momentumImbalance_py
int m_vtxDisplacedMoreThan_1m_CheckRate
#define CHECK(...)
Evaluate an expression and check for errors.
TH1F * m_h_vtxend_dispVtxCheck
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
TH1F * m_h_pdgid_dispVtxCheck
virtual bool isValid() override final
Can the handle be successfully dereferenced?
TH1F * m_h_photon_e2_p2_e2
virtual void renounce()=0
const HepPDT::ParticleDataTable & particleTable() const
Get a particle data table.
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
TH1F * m_h_vzprod_dispVtxCheck
const GenParticle * ConstGenParticlePtr
TH1F * m_h_vy_dispVtxCheck
const std::vector< Prt > & loop_particles() const
int m_beamEnergyCheckRate
bool m_energyImbalanceTest
int m_nonG4_energyCheckRate
int m_nonZeroPhotonMassCheckRate
MC::Loops< HepMC::GenEvent, HepMC::ConstGenParticlePtr, HepMC::ConstGenVertexPtr > m_looper
member to detect loops
int m_invalidBeamParticlesCheckRate
std::string PathResolverFindDataFile(const std::string &logical_file_name)
const std::vector< Vtx > & loop_vertices() const
DataObjIDColl m_extendedExtraObjects
TH1F * m_h_vxprod_dispVtxCheck
bool isStable(const T &p)
Identify if the particle is stable, i.e. has not decayed.
double m_tau_eff_threshold
bool empty() const noexcept
TH1F * m_h_energy_dispVtxCheck
#define ATH_MSG_WARNING(x)
bool valid_beam_particles(const GenEvent *e)
int numberOfProtons(const T &p)
bool isDecayed(const T &p)
Identify if the particle decayed.
bool isPhoton(const xAOD::Egamma *eg)
is the object a photon
bool isBeam(const T &p)
Identify if the particle is beam particle.
const HepPDT::ParticleDataTable & pdt() const
Shorter alias to get a particle data table.
bool isSimInteracting(const T &p)
Identify if the particle could interact with the detector during the simulation, e....
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
TH1F * m_h_vz_dispVtxCheck
GenBase(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
int m_Status1ShortLifetime
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
int findLoops(const Evt *evt, bool force)
int m_undisplacedDecayDaughtersOfDisplacedVtxCheckRate
int m_undisplacedLLHdaughtersCheckRate
TH1F * m_h_energyImbalance
TH1F * m_h_beamparticle1_Energy
int m_negativeEnergyTachyonicCheckRate
const HepPDT::ParticleData * particleData(int pid) const
Access an element in the particle data table.
TH1F * m_h_energy_dispVtxCheck_lt10
virtual StatusCode initialize() override
bool m_undisplacedDaughtersTest
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
TH1F * m_h_momentumImbalance_px