Skip to content
Snippets Groups Projects
Commit e36e4cd6 authored by Shaun Roe's avatar Shaun Roe Committed by Frank Winklmeier
Browse files

main-coverity-MCTruth

main-coverity-MCTruth
parent f1be229c
No related branches found
No related tags found
27 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,!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,!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,!71822main-coverity-MCTruth
Showing
with 62 additions and 67 deletions
......@@ -5,10 +5,8 @@
#ifndef MCTRUTH_ATLASG4EVENTUSERINFO_H
#define MCTRUTH_ATLASG4EVENTUSERINFO_H
#include "AtlasHepMC/GenEvent.h"
#include "AtlasHepMC/GenEvent_fwd.h"
#include "AtlasHepMC/GenParticle.h"
#include "TruthUtils/MagicNumbers.h"
#include "G4ThreeVector.hh"
#include "G4VUserEventInformation.hh"
/** @class AtlasG4EventUserInfo
......@@ -66,7 +64,7 @@ public:
* time an interaction of the G4Track is recorded to the
* HepMC::GenEvent. TODO Rename
*/
void SetCurrentGenParticle(HepMC::GenParticlePtr p) {m_currentGenParticle = p;}
void SetCurrentGenParticle(HepMC::GenParticlePtr p) {m_currentGenParticle = std::move(p);}
/**
* @brief return the value of G4Track::GetTrackID() for the last
......
......@@ -6,9 +6,8 @@
#define MCTRUTH_PRIMARYPARTICLEINFORMATION_H
#include "G4VUserPrimaryParticleInformation.hh"
#include "AtlasHepMC/GenEvent.h"
#include "AtlasHepMC/GenParticle.h"
#include "TruthUtils/MagicNumbers.h"
#include "AtlasHepMC/GenParticle_fwd.h"
#include "TruthUtils/MagicNumbers.h" //HepMC::INVALID_PARTICLE_BARCODE
#include "CxxUtils/checker_macros.h"
namespace ISF {
......
......@@ -5,9 +5,11 @@
#ifndef TrackHelper_H
#define TrackHelper_H
#include "G4Track.hh"
#include "MCTruth/TrackInformation.h"
#include "GeneratorObjects/HepMcParticleLink.h"
class G4Track;
class TrackInformation;
class HepMcParticleLink;
class TrackHelper {
public:
......
......@@ -6,7 +6,7 @@
#define MCTRUTH_TRACKINFORMATION_H
#include "VTrackInformation.h"
#include "TruthUtils/MagicNumbers.h"
#include "TruthUtils/MagicNumbers.h" //HepMC::INVALID_PARTICLE_BARCODE
#include "CxxUtils/checker_macros.h"
namespace ISF {
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
*/
#ifndef TruthEvent_H
#define TruthEvent_H
#include "AtlasHepMC/GenEvent.h"
#include "AthenaKernel/CLASS_DEF.h"
typedef HepMC::GenEvent TruthEvent;
typedef HepMC::GenVertex TruthVertex;
typedef HepMC::GenParticle TruthParticle;
CLASS_DEF( TruthEvent , 97924139 , 1 )
#endif
......@@ -6,9 +6,6 @@
#define MCTRUTH_VTRACKINFORMATION_H
#include "G4VUserTrackInformation.hh"
enum TrackClassification { Primary, RegeneratedPrimary, RegisteredSecondary, Secondary, BarcodeOnly } ;
#include "AtlasHepMC/GenParticle_fwd.h"
namespace ISF {
......@@ -32,6 +29,7 @@ namespace ISF {
*/
class VTrackInformation: public G4VUserTrackInformation {
public:
enum TrackClassification { Primary, RegeneratedPrimary, RegisteredSecondary, Secondary, BarcodeOnly } ;
VTrackInformation(TrackClassification tc=Primary);
/**
......
......@@ -3,6 +3,7 @@
*/
#include "MCTruth/AtlasG4EventUserInfo.h"
#include "AtlasHepMC/GenEvent.h"
HepMC::GenEvent* AtlasG4EventUserInfo::GetHepMCEvent()
{
......
......@@ -3,6 +3,7 @@
*/
#include "MCTruth/PrimaryParticleInformation.h"
#include "AtlasHepMC/GenParticle.h"
PrimaryParticleInformation::PrimaryParticleInformation()
{
......
......@@ -3,7 +3,11 @@
*/
#include "MCTruth/TrackHelper.h"
#include "G4Track.hh"
#include "ISF_Event/ISFParticle.h"
#include "MCTruth/TrackInformation.h"
#include "GeneratorObjects/HepMcParticleLink.h"
TrackHelper::TrackHelper(const G4Track* t)
{
......@@ -12,22 +16,22 @@ TrackHelper::TrackHelper(const G4Track* t)
bool TrackHelper::IsPrimary() const
{
if (m_trackInfo==0) return false;
return m_trackInfo->GetClassification()==Primary;
return m_trackInfo->GetClassification()==TrackInformation::Primary;
}
bool TrackHelper::IsRegeneratedPrimary() const
{
if (m_trackInfo==0) return false;
return m_trackInfo->GetClassification()==RegeneratedPrimary;
return m_trackInfo->GetClassification()==TrackInformation::RegeneratedPrimary;
}
bool TrackHelper::IsRegisteredSecondary() const
{
if (m_trackInfo==0) return false;
return m_trackInfo->GetClassification()==RegisteredSecondary;
return m_trackInfo->GetClassification()==TrackInformation::RegisteredSecondary;
}
bool TrackHelper::IsSecondary() const
{
if (m_trackInfo==0) return true;
return m_trackInfo->GetClassification()==Secondary;
return m_trackInfo->GetClassification()==TrackInformation::Secondary;
}
int TrackHelper::GetBarcode() const // TODO Drop this once UniqueID and Status are used instead
{
......
......@@ -11,7 +11,7 @@ VTrackInformation::VTrackInformation(TrackClassification tc)
void VTrackInformation::SetPrimaryGenParticle(HepMC::GenParticlePtr p)
{
m_primaryGenParticle = p;
m_primaryGenParticle = std::move(p);
}
bool VTrackInformation::GetReturnedToISF() const
......
/*
Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
// System includes
......@@ -122,7 +122,7 @@ namespace G4UA
// OK, we got back to HepMC
std::unique_ptr<TrackInformation> ti = std::make_unique<TrackInformation>(part);
ti->SetRegenerationNr(0);
ti->SetClassification(Primary);
ti->SetClassification(TrackInformation::Primary);
// regNr=0 and classify=Primary are default values anyway
/// Pass ownership to track. The G4VUserTrackInformation*
/// fpUserInformation member variable set by this method
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
// System includes
#include <iostream>
#include <memory>
#include <string>
// Local includes
#include "AthenaStackingAction.h"
......@@ -31,6 +28,10 @@
#include "CxxUtils/checker_macros.h"
// System includes
#include <memory>
#include <string>
namespace G4UA
{
......@@ -122,7 +123,7 @@ namespace G4UA
// OK, we got back to HepMC
std::unique_ptr<TrackInformation> ti = std::make_unique<TrackInformation>(part);
ti->SetRegenerationNr(0);
ti->SetClassification(Primary);
ti->SetClassification(TrackInformation::Primary);
// regNr=0 and classify=Primary are default values anyway
/// Pass ownership to track. The G4VUserTrackInformation*
/// fpUserInformation member variable set by this method
......
......@@ -11,8 +11,7 @@
#include "G4ChargedGeantino.hh"
#include "G4MuonPlus.hh"
#include "G4MuonMinus.hh"
//STL headers
#include <iostream>
#include "G4Step.hh"
namespace G4UA
{
......
......@@ -4,7 +4,7 @@
#include "G4TrackCounter.h"
#include "MCTruth/TrackHelper.h"
#include "G4Track.hh"
namespace G4UA
{
......
......@@ -9,11 +9,10 @@
#include <vector>
// ISF includes
#include "ISF_Event/ISFParticle.h"
#include "ISF_Event/ISFParticleContainer.h"
#include "ISF_Event/ITruthIncident.h"
// DetectorDescription
#include "AtlasDetDescr/AtlasRegion.h"
#include "AtlasDetDescr/AtlasRegion.h" //enum
namespace ISF {
class ISFParticle;
......
......@@ -9,8 +9,6 @@
#ifndef ISF_EVENT_SIMSVCID_H
#define ISF_EVENT_SIMSVCID_H 1
// stl includes
#include <limits>
// Gaudi Kernel
#include "GaudiKernel/MsgStream.h"
......
......@@ -14,11 +14,13 @@
#include "AtlasHepMC/GenEvent.h"
#include "TruthUtils/MagicNumbers.h"
#include <cmath>
static HepMC::GenParticlePtr ParticleHelper_convert( const ISF::ISFParticle &particle) {
const Amg::Vector3D &mom = particle.momentum();
double mass = particle.mass();
double energy = sqrt( mom.mag2() + mass*mass);
double energy = std::sqrt( mom.mag2() + mass*mass);
HepMC::FourVector fourMomentum( mom.x(), mom.y(), mom.z(), energy);
auto hepParticle = HepMC::newGenParticlePtr( fourMomentum, particle.pdgCode(), particle.status() );
......
......@@ -5,19 +5,22 @@
#ifndef ISF_GEANT4TOOLS_Geant4TruthIncident_H
#define ISF_GEANT4TOOLS_Geant4TruthIncident_H
// std
#include <vector>
// ISF includes
#include "ISF_Event/ITruthIncident.h"
#include "ISF_Event/ITruthIncident.h" //inheritance
//G4 includes
#include "G4ThreeVector.hh" //typedef
// HepMC includes
#include "AtlasHepMC/SimpleVector.h"
#include "AtlasHepMC/SimpleVector.h" //typedef FourVector
#include "AtlasHepMC/GenParticle_fwd.h" //typedef GenParticlePtr
//Geant4 includes
#include "G4ThreeVector.hh"
#include "AtlasDetDescr/AtlasRegion.h" //enum
#include "CxxUtils/checker_macros.h" //ATLAS_THREAD_SAFE
// std
#include <vector>
#include "CxxUtils/checker_macros.h"
// forward declarations
class G4Step;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
*/
#ifndef ISF_GEANT4EVENT_ISFG4GEOHELPER_H
......@@ -7,8 +7,16 @@
#include "AtlasDetDescr/AtlasRegion.h"
#include "G4Step.hh"
#include "ISF_Interfaces/IGeoIDSvc.h"
class G4Step;
class G4LogicalVolume;
class G4StepPoint;
namespace ISF{
class IGeoIDSvc;
}
namespace iGeant4 {
......
......@@ -6,17 +6,16 @@
#define ISF_GEANT4TOOLS_ISFG4HELPER_H
// ISF Includes
#include "ISF_Event/ISFParticle.h"
// MCTruth includes
#include "MCTruth/VTrackInformation.h"
#include "MCTruth/VTrackInformation.h" //use enum
// forward declarations
#include "AtlasHepMC/GenParticle_fwd.h"
namespace ISF {
class TruthBinding;
class ISFParticle;
}
class VTrackInformation;
class TrackInformation;
class AtlasG4EventUserInfo;
class G4Track;
......@@ -45,7 +44,7 @@ class ISFG4Helper {
* (the G4Track must not have a UserInformation object attached to it) */
static TrackInformation* attachTrackInfoToNewG4Track( G4Track& aTrack,
ISF::ISFParticle& baseIsp,
TrackClassification classification,
VTrackInformation::TrackClassification classification,
HepMC::GenParticlePtr generationZeroGenParticle = nullptr);
/** return pointer to current AtlasG4EventUserInfo */
......
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