Skip to content
Snippets Groups Projects
Commit 79a880b2 authored by Frank Winklmeier's avatar Frank Winklmeier
Browse files

Merge branch 'CleanupDetailedTrackTruthBuilder_main' into 'main'

Modernise DetailedTrackTruthBuilder syntax

See merge request !69650
parents 20181664 5919dcd3
No related branches found
No related tags found
40 merge requests!78241Draft: FPGATrackSim: GenScan code refactor,!78236Draft: Switching Streams https://its.cern.ch/jira/browse/ATR-27417,!78056AFP monitoring: new synchronization and cleaning,!78041AFP monitoring: new synchronization and cleaning,!77990Updating TRT chip masks for L1TRT trigger simulation - ATR-28372,!77733Draft: add new HLT NN JVT, augmented with additional tracking information,!77731Draft: Updates to ZDC reconstruction,!77728Draft: updates to ZDC reconstruction,!77522Draft: sTGC Pad Trigger Emulator,!76725ZdcNtuple: Fix cppcheck warning.,!76611L1CaloFEXByteStream: Fix out-of-bounds array accesses.,!76475Punchthrough AF3 implementation in FastG4,!76474Punchthrough AF3 implementation in FastG4,!76343Draft: MooTrackBuilder: Recalibrate NSW hits in refine method,!75729New implementation of ZDC nonlinear FADC correction.,!75703Draft: Update to HI han config for HLT jets,!75184Draft: Update file heavyions_run.config,!74430Draft: Fixing upper bound for Delayed Jet Triggers,!73963Changing the path of the histograms to "Expert" area,!73875updating ID ART reference plots,!73874AtlasCLHEP_RandomGenerators: Fix cppcheck warnings.,!73449Add muon detectors to DarkJetPEBTLA partial event building,!73343Draft: [TrigEgamma] Add photon ringer chains on bootstrap mechanism,!72972Update L1Calo Jet Trigger Efficiency Monitoring algorithm,!72336Fixed TRT calibration crash,!72176Draft: Improving L1TopoOnline chain that now gets no-empty plots. Activating it by default,!72012Draft: Separate JiveXMLConfig.py into Config files,!71876Fix MET trigger name in MissingETMonitoring,!71820Draft: Adding new TLA End-Of-Fill (EOF) chains and removing obsolete DIPZ chains,!71279Draft: ATR-29330: Move L1_4J15 and the HLT chains seeded by it in the MC Menu,!70990Updates to pulse analysis to support new 2016 p+Pb analysis and 2023 Pb+Pb analysis,!70948[TrigEGam] Adding egamma chains to be monitored,!70777Draft: sTGC offline raw monitoring: strip efficiency re-implementation,!70654Update JetMonitoringStandard.py,!70442Draft: Harmonize output folders+collections in ID Alignment monitoring and update DQM han config,!70269Draft: Initial Preparations for mc23e mu-distribution,!70047More test chains for delayed jets,!69944Draft: Avoid additional ONNX thread spawning for FastCaloSim,!69935Draft: New efficiency DQ criteria for HLTmuon hanconfig,!69650Modernise DetailedTrackTruthBuilder syntax
......@@ -126,7 +126,7 @@ StatusCode InDetDetailedTrackTruthMaker::execute(const EventContext &ctx) const
}
else {
ATH_MSG_DEBUG ("DetailedTrackTruthCollection '" << m_detailedTrackTruthName.key() << "' is registered in StoreGate, size="<<dttc->size());
m_truthTool->buildDetailedTrackTruth(&(*dttc), *tracks, prdCollectionVector);
m_truthTool->buildDetailedTrackTruth(&(*dttc), *tracks, prdCollectionVector, ctx);
return StatusCode::SUCCESS;
}
......
......@@ -75,8 +75,8 @@ StatusCode MuonDetailedTrackTruthMaker::execute(const EventContext& ctx) const {
SG::WriteHandle<DetailedTrackTruthCollection> dttc(m_detailedTrackTruthNames.at(i), ctx);
ATH_CHECK(dttc.record(std::make_unique<DetailedTrackTruthCollection>()));
dttc->setTrackCollection(tcol.cptr());
m_truthTool->buildDetailedTrackTruth(dttc.ptr(), *(tcol.cptr()), prdCollectionVector);
m_truthTool->buildDetailedTrackTruth(dttc.ptr(), *(tcol.cptr()), prdCollectionVector, ctx);
i++;
}
return StatusCode::SUCCESS;
}
\ No newline at end of file
}
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef IDETAILEDTRACKTRUTHBUILDER_H
#define IDETAILEDTRACKTRUTHBUILDER_H
#ifndef TRKTOOLINTERFACES_IDETAILEDTRACKTRUTHBUILDER_H
#define TRKTOOLINTERFACES_IDETAILEDTRACKTRUTHBUILDER_H
#include <vector>
#include "GaudiKernel/IAlgTool.h"
#include "TrkTrack/TrackCollection.h" /* forward declaring the typedef would be ugly.. */
#include <vector>
// Forard declarations of types.
class PRD_MultiTruthCollection;
class DetailedTrackTruthCollection;
namespace Trk {
static const InterfaceID IID_IDetailedTrackTruthBuilder("Trk::IDetailedTrackTruthBuilder",1,0);
/** @brief Provides interface for tool to return a "detailed" track truth map.
@author Andrei Gaponenko <agaponenko@lbl.gov> */
class IDetailedTrackTruthBuilder : virtual public IAlgTool {
public:
static const InterfaceID& interfaceID() { return IID_IDetailedTrackTruthBuilder; }
/** The main tool method. Fills a pre-existing
* DetailedTrackTruthCollection pointed to by output with data for
......@@ -33,16 +30,18 @@ namespace Trk {
*
* This method does not impose a memory management model on the
* caller. (As e.g. returning an object on the heap would do.)
* The caller can use it to work with stack or heap objects.
* The caller can use it to work with stack or heap objects.
* Call with output==0 is a no-op. (But output should not be garbage, it must be initialized.)
*
*
* Adding an int to tell it to only calculate the detailed track truth for certain tracks: used only by track overlay
*/
virtual void buildDetailedTrackTruth(DetailedTrackTruthCollection *output,
const TrackCollection& tracks,
const std::vector<const PRD_MultiTruthCollection*>& prdTruth) const = 0;
const TrackCollection& tracks,
const std::vector<const PRD_MultiTruthCollection*>& prdTruth,
const EventContext& ctx) const = 0;
DeclareInterfaceID(Trk::IDetailedTrackTruthBuilder,1,0);
};
} // namespace Trk
#endif/*IDETAILEDTRACKTRUTHBUILDER_H*/
#endif/*TRKTOOLINTERFACES_IDETAILEDTRACKTRUTHBUILDER_H*/
......@@ -21,9 +21,8 @@
#include "TrkTruthData/SubDetHitStatistics.h"
namespace Trk {
class DetailedTrackTruthBuilder final: virtual public IDetailedTrackTruthBuilder,
public AthAlgTool
class DetailedTrackTruthBuilder final: virtual public extends<AthAlgTool, IDetailedTrackTruthBuilder>
{
public:
DetailedTrackTruthBuilder(const std::string& type, const std::string& name, const IInterface* parent);
......@@ -32,22 +31,24 @@ namespace Trk {
/** See description for IDetailedTrackTruthBuilder::buildDetailedTrackTruth() */
virtual void buildDetailedTrackTruth(DetailedTrackTruthCollection *output,
const TrackCollection& tracks,
const std::vector<const PRD_MultiTruthCollection*>& prdTruth) const;
const TrackCollection& tracks,
const std::vector<const PRD_MultiTruthCollection*>& prdTruth,
const EventContext& ctx) const;
private:
typedef InverseMultiMap<PRD_MultiTruthCollection> PRD_InverseTruth;
const AtlasDetectorID *m_idHelper;
const AtlasDetectorID *m_idHelper{};
ToolHandle<Trk::ITruthTrajectoryBuilder> m_truthTrajBuilder;
PublicToolHandle<Trk::ITruthTrajectoryBuilder> m_truthTrajBuilder{this, "TruthTrajectoryTool", "Trk::ElasticTruthTrajectoryBuilder"};
SubDetHitStatistics::SubDetType findSubDetType(const Identifier& id) const;
void addTrack(DetailedTrackTruthCollection *output,
const ElementLink<DataVector<Trk::Track> > &track,
const std::vector<const PRD_MultiTruthCollection*>& orderedPRD_Truth,
const PRD_InverseTruth& inverseTruth) const;
const ElementLink<DataVector<Trk::Track> > &track,
const std::vector<const PRD_MultiTruthCollection*>& orderedPRD_Truth,
const PRD_InverseTruth& inverseTruth,
const EventContext& ctx) const;
static void makeTruthToRecMap( PRD_InverseTruth& result, const PRD_MultiTruthCollection& rec2truth) ;
......@@ -55,7 +56,7 @@ namespace Trk {
const PRD_InverseTruth& inverseTruth) const;
};
} // end namespace Trk
#endif/*DETAILEDTRACKTRUTHBUILDER_H*/
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment