14 #include "nug4/MagneticFieldServices/MagneticFieldService.h" 27 #include "CoreUtils/ServiceUtil.h" 31 #include "Api/PandoraApi.h" 34 #include "LCContent.h" 35 #include "LCPlugins/LCSoftwareCompensation.h" 36 #include "LCPlugins/LCEnergyCorrectionPlugins.h" 37 #include "LCPlugins/LCParticleIdPlugins.h" 38 #include "LCPlugins/LCShowerProfilePlugin.h" 43 namespace gar_pandora {
131 catch (pandora::StatusCodeException &statusCodeException)
133 MF_LOG_ERROR(
"Failed to initialize PandoraInterface: ") << statusCodeException.ToString();
134 throw statusCodeException;
138 MF_LOG_ERROR(
"Failed to initialize PandoraInterface: std exception ") << exception.what();
143 MF_LOG_ERROR(
"Failed to initialize PandoraInterface: unrecognized exception");
164 PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::ProcessEvent(*
m_pPandora));
167 PANDORA_THROW_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::Reset(*
m_pPandora));
170 catch (pandora::StatusCodeException &statusCodeException)
172 MF_LOG_ERROR(
"pandora failed to process event: ") << statusCodeException.ToString();
173 throw statusCodeException;
177 MF_LOG_ERROR(
"pandora failed to process event: std exception ") << exception.what();
182 MF_LOG_ERROR(
"pandora failed to process event: unrecognized exception");
204 throw pandora::StatusCodeException(pandora::STATUS_CODE_NOT_INITIALIZED);
212 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, LCContent::RegisterAlgorithms(*
m_pPandora));
215 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetShowerProfilePlugin(*
m_pPandora,
new lc_content::LCShowerProfilePlugin));
217 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::RegisterEnergyCorrectionPlugin(*
m_pPandora,
"CleanClusters", pandora::HADRONIC,
new lc_content::LCEnergyCorrectionPlugins::CleanCluster));
218 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::RegisterEnergyCorrectionPlugin(*
m_pPandora,
"ScaleHotHadrons", pandora::HADRONIC,
new lc_content::LCEnergyCorrectionPlugins::ScaleHotHadrons));
219 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::RegisterEnergyCorrectionPlugin(*
m_pPandora,
"MuonCoilCorrection", pandora::HADRONIC,
new lc_content::LCEnergyCorrectionPlugins::MuonCoilCorrection));
222 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::RegisterParticleIdPlugin(*
m_pPandora,
"LCEmShowerId" ,
new lc_content::LCParticleIdPlugins::LCEmShowerId));
223 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::RegisterParticleIdPlugin(*
m_pPandora,
"LCPhotonId" ,
new lc_content::LCParticleIdPlugins::LCPhotonId));
224 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::RegisterParticleIdPlugin(*
m_pPandora,
"LCElectronId" ,
new lc_content::LCParticleIdPlugins::LCElectronId));
225 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::RegisterParticleIdPlugin(*
m_pPandora,
"LCMuonId" ,
new lc_content::LCParticleIdPlugins::LCMuonId));
228 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, PandoraApi::SetBFieldPlugin(*
m_pPandora,
232 PANDORA_RETURN_RESULT_IF(pandora::STATUS_CODE_SUCCESS, !=, LCContent::RegisterNonLinearityEnergyCorrection(*
m_pPandora,
235 return pandora::STATUS_CODE_SUCCESS;
246 if( !sp.
find_file(pandora_file, fullConfigFileName) )
247 throw cet::exception(
"PandoraInterface") <<
" Failed to find xml configuration file " << pandora_file <<
" in FW search path";
279 produces< std::vector<gar::rec::Cluster> >();
280 produces< std::vector<gar::rec::PFParticle> >();
286 auto const *magFieldService = gar::providerFrom<mag::MagneticFieldService>();
287 G4ThreeVector zerovec(0,0,0);
288 G4ThreeVector magfield = magFieldService->FieldAtPoint(zerovec);
291 fGeo = gar::providerFrom<geo::GeometryGAr>();
327 m_inputEnergyCorrectionPoints(0),
328 m_outputEnergyCorrectionPoints(0)
336 namespace gar_pandora {
static constexpr double cm
float m_eCalBarrelInnerR
ECal barrel inner radius.
const TrackVector & GetTrackVector() const
PfoCreator * m_pPfoCreator
The pfo creator.
float m_eCalToHadGeVEndCap
The calibration from deposited ECal endcap energy to hadronic energy.
std::string m_geantModuleLabel
The geant4 label.
std::string m_CaloHitCollection
The calorimeter hit collection.
int m_eCalBarrelInnerSymmetry
ECal barrel inner symmetry order.
float m_eCalMipThreshold
Threshold for creating calo hits in the ECal, units mip.
float m_eCalEndCapInnerZ
ECal endcap inner z.
std::string m_V0Collection
The vees collection.
RotationTransformation * m_pRotation
The transformation tool for rotations.
const pandora::Pandora * GetPandora() const
unsigned int m_maxTrackHits
Track quality cut: the maximum number of track hits.
float m_eCalEndCapOuterR
ECal endcap outer r coordinate.
void produce(art::Event &e) override
std::string m_generatorModuleLabel
The generator label.
float m_innerBField
The bfield in the main tracker and ecal, units Tesla.
EDProducer(fhicl::ParameterSet const &pset)
const CalorimeterHitVector & GetCalorimeterHitVector() const
float m_eCalEndCapOuterZ
ECal endcap outer z coordinate.
float m_d0TrackCut
Track d0 cut used to determine whether track can be used to form pfo.
float m_eCalToEMGeV
The calibration from deposited ECal energy to EM energy.
float m_minTrackECalDistanceFromIp
Sanity check on separation between ip and track projected ecal position.
#define MF_LOG_ERROR(category)
float m_eCalBarrelInnerPhi0
ECal barrel inner phi0 coordinate.
float m_bField
The bfield.
int m_nOuterSamplingLayers
Number of layers from edge for hit to be flagged as an outer layer hit.
float m_hadStochasticTerm
The stochastic term for HAD shower energy resolution.
const geo::GeometryCore * fGeo
pointer to the geometry
Description of geometry of one entire detector.
float m_z0TrackCut
Track z0 cut used to determine whether track can be used to form pfo.
std::vector< float > m_inputEnergyCorrectionPoints
The input energy points for non-linearity energy correction.
void reconfigure(fhicl::ParameterSet const &pset)
pandora::StatusCode CreateTrackAssociations(const art::Event &pEvent)
float m_eCalToHadGeVBarrel
The calibration from deposited ECal barrel energy to hadronic energy.
Settings m_settings
The settings for the pandora interface module.
pandora::StatusCode CreateCaloHits(const art::Event &pEvent)
float m_eCalBarrelOuterZ
ECal barrel outer z coordinate.
#define DEFINE_ART_MODULE(klass)
pandora::StatusCode RegisterUserComponents() const
float m_emConstantTerm
The constant term for EM shower energy resolution.
pandora::StatusCode CreateCaloHitToMCParticleRelationships(const CalorimeterHitVector &calorimeterHitVector) const
float m_eCalBarrelOuterPhi0
ECal barrel outer phi0 coordinate.
T get(std::string const &key) const
TrackCreator::Settings m_trackCreatorSettings
The track creator settings.
std::string m_CaloHitInstanceName
The calorimeter hit instance name.
void FinaliseSteeringParameters()
float m_eCalBarrelOuterR
ECal barrel outer r coordinate.
float TPCZCent() const
Returns the Z location of the center of the TPC in cm.
GeometryCreator::Settings m_geometryCreatorSettings
The geometry creator settings.
float m_eCalBarrelInnerPhi0
ECal barrel inner phi 0.
CaloHitCreator * m_pCaloHitCreator
The calo hit creator.
#define MF_LOG_INFO(category)
TrackCreator * m_pTrackCreator
The track creator.
pandora::StatusCode CreateTracks(const art::Event &pEvent)
FloatVector m_eCalBarrelNormalVector
ECal barrel normal vector.
float m_emStochasticTerm
The stochastic term for EM shower energy resolution.
CaloHitCreator::Settings m_caloHitCreatorSettings
The calo hit creator settings.
pandora::Pandora * m_pPandora
Address of the pandora instance.
std::string m_pandoraSettingsXmlFile
The pandora settings xml file.
General GArSoft Utilities.
unsigned int m_minTrackHits
Track quality cut: the minimum number of track hits.
unsigned int m_eCalEndCapInnerSymmetryOrder
ECal endcap inner symmetry.
unsigned int m_eCalBarrelOuterSymmetry
ECal barrel outer symmetry order.
std::string m_trackCollection
The reconstructed track collection.
pandora::StatusCode CreateMCParticles(const art::Event &pEvent)
MCParticleCreator::Settings m_mcParticleCreatorSettings
The mc particle creator settings.
float TPCYCent() const
Returns the Y location of the center of the TPC in cm.
float m_eCalToMip
The calibration from deposited ECal energy to mip.
pandora::StatusCode CreateParticleFlowObjects(art::Event &pEvent)
PandoraInterface(fhicl::ParameterSet const &p)
pandora::StatusCode CreateTrackToMCParticleRelationships(const TrackVector &trackVector) const
std::string find_file(std::string const &filename) const
std::vector< float > m_outputEnergyCorrectionPoints
The output energy points for non-linearity energy correction.
MCParticleCreator * m_pMCParticleCreator
The mc particle creator.
float m_maxTrackSigmaPOverP
Track fraction momentum error cut.
float m_maxECalHitHadronicEnergy
The maximum hadronic energy allowed for a single hcal hit.
GeometryCreator * m_pGeometryCreator
The geometry creator.
PfoCreator::Settings m_pfoCreatorSettings
The pfo creator settings.
float m_layersFromEdgeMaxRearDistance
Maximum number of layers from candidate outer layer hit to rear of detector.
Settings()
Default constructor.
art framework interface to geometry description
unsigned int m_eCalBarrelInnerSymmetry
ECal barrel inner symmetry order.
pandora::StatusCode CreateGeometry() const
cet::coded_exception< error, detail::translate > exception
std::map< gar::geo::LayeredCalorimeterData::LayoutType, std::shared_ptr< gar::geo::LayeredCalorimeterData > > GetECALLayeredCalorimeterData() const
PandoraInterface & operator=(PandoraInterface const &)=delete
float m_eCalEndCapInnerPhiCoordinate
ECal endcap inner phi.