diff --git a/Generators/ReadGenie/python/GenieReader.py b/Generators/ReadGenie/python/GenieReader.py index d04fdd0eb938839d4981a544e95410d2d29b400b..fc1cb184f0016fe4f73599a9f1eb1edab209f5f1 100644 --- a/Generators/ReadGenie/python/GenieReader.py +++ b/Generators/ReadGenie/python/GenieReader.py @@ -2,20 +2,17 @@ from AthenaCommon.AppMgr import ServiceMgr as svcMgr from GeneratorModules.EvgenAlg import EvgenAlg -from AthenaPython.PyAthena import StatusCode, py_svc +from AthenaPython.PyAthena import StatusCode import ROOT __author__ = "Dave Caser <dcasper@uci.edu>" class GenieReader(EvgenAlg): - def __init__(self, name="GenieReader"): + def __init__(self, name="GenieReader", MCEventKey="BeamTruthEvent"): super(GenieReader,self).__init__(name=name) + self.McEventKey = MCEventKey return - def initialize(self): - self.evtstore = py_svc('StoreGateSvc') - return StatusCode.Success - def fillEvent(self, evt): try: from AthenaPython.PyAthena import HepMC3 as HepMC @@ -23,19 +20,19 @@ class GenieReader(EvgenAlg): from AthenaPython.PyAthena import HepMC as HepMC evt.weights().push_back(1.0) - pos = HepMC.FourVector(self.evtstore["vx"]*1000, self.evtstore["vy"]*1000, self.evtstore["vz"]*1000, 0) + pos = HepMC.FourVector(self.evtStore["vx"]*1000, self.evtStore["vy"]*1000, self.evtStore["vz"]*1000, 0) gv = HepMC.GenVertex(pos) ROOT.SetOwnership(gv, False) evt.add_vertex(gv) - nParticles = self.evtstore["n"] - pdgc = list(self.evtstore["pdgc"]) - status = list(self.evtstore["status"]) - px = list(self.evtstore["px"]) - py = list(self.evtstore["py"]) - pz = list(self.evtstore["pz"]) - E = list(self.evtstore["E"]) - M = list(self.evtstore["M"]) + nParticles = self.evtStore["n"] + pdgc = list(self.evtStore["pdgc"]) + status = list(self.evtStore["status"]) + px = list(self.evtStore["px"]) + py = list(self.evtStore["py"]) + pz = list(self.evtStore["pz"]) + E = list(self.evtStore["E"]) + M = list(self.evtStore["M"]) for i in range(nParticles): gp = HepMC.GenParticle() diff --git a/Simulation/ISF/ISF_Core/FaserISF_Services/src/FaserTruthSvc.cxx b/Simulation/ISF/ISF_Core/FaserISF_Services/src/FaserTruthSvc.cxx index c3e0607252a06e4d439cf298851b6d2884cef3b9..b1a64408271187de69318c448fb727056c66f704 100644 --- a/Simulation/ISF/ISF_Core/FaserISF_Services/src/FaserTruthSvc.cxx +++ b/Simulation/ISF/ISF_Core/FaserISF_Services/src/FaserTruthSvc.cxx @@ -270,7 +270,7 @@ void ISF::FaserTruthSvc::recordIncidentToMCTruth( ISF::IFaserTruthIncident& ti) if (m_ignoreUndefinedBarcodes) { ATH_MSG_WARNING("Unable to generate new Particle Barcode. Continuing due to 'IgnoreUndefinedBarcodes'==True"); } else { - ATH_MSG_FATAL("Unable to generate new Particle Barcode in region " << ti.geoID() << ". Aborting"); + ATH_MSG_FATAL("Unable to generate new Particle Barcode in region " << ti.geoID() << ", at vertex (" << vtx->position().x() << ", " << vtx->position().y() << ", " << vtx->position().z() << "). Aborting"); abort(); } } diff --git a/Simulation/ISF/ISF_HepMC/FaserISF_HepMC_Tools/python/FaserISF_HepMC_ToolsConfigNew.py b/Simulation/ISF/ISF_HepMC/FaserISF_HepMC_Tools/python/FaserISF_HepMC_ToolsConfigNew.py index a49c04991034dd011d9066b5b9116d317a1cd042..0f251682c98dfba7a08fd7e9a7427fb6a330e91b 100644 --- a/Simulation/ISF/ISF_HepMC/FaserISF_HepMC_Tools/python/FaserISF_HepMC_ToolsConfigNew.py +++ b/Simulation/ISF/ISF_HepMC/FaserISF_HepMC_Tools/python/FaserISF_HepMC_ToolsConfigNew.py @@ -163,7 +163,8 @@ def FaserDipoleTruthStrategyCfg(ConfigFlags, name="ISF_FaserDipoleTruthStrategy" # Save truth in Dipole region # kwargs.setdefault('Regions', [FaserRegion.fFaserDipole, - FaserRegion.fFaserNeutrino]) + FaserRegion.fFaserNeutrino, + FaserRegion.fFaserCavern]) kwargs.setdefault('ParentMinEkin', 1000.0*MeV) kwargs.setdefault('ChildMinEkin', 1000.0*MeV) result.setPrivateTools(ISF__FaserTruthStrategy(name, **kwargs)) @@ -182,10 +183,10 @@ def FaserTruthStrategyCfg(ConfigFlags, name="ISF_FaserTruthStrategy", **kwargs): kwargs.setdefault('Regions', [ # FaserRegion.fFaserNeutrino, FaserRegion.fFaserScintillator, - FaserRegion.fFaserTracker, + FaserRegion.fFaserTracker]) # FaserRegion.fFaserDipole, # FaserRegion.fFaserCalorimeter, - FaserRegion.fFaserCavern]) + # FaserRegion.fFaserCavern]) # kwargs.setdefault('ParentMinEkin', 0.1*MeV) # kwargs.setdefault('ChildMinEkin', 0.1*MeV) result.setPrivateTools(ISF__FaserTruthStrategy(name, **kwargs))