Skip to content
Snippets Groups Projects
Commit 5e545bdb authored by John Chapman's avatar John Chapman
Browse files

Migrate MCTruth package to use (Const)GenParticlePtr

parent 45a5300c
6 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!34550Preparatory changes for the HepMC3 migration for packages in AthSimulation
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef EventInformation_H #ifndef EventInformation_H
...@@ -27,13 +27,13 @@ public: ...@@ -27,13 +27,13 @@ public:
const G4ThreeVector GetVertexPosition() const; const G4ThreeVector GetVertexPosition() const;
void Print() const {} void Print() const {}
void SetCurrentPrimary(HepMC::GenParticle *p) {m_currentPrimary=p;} void SetCurrentPrimary(HepMC::GenParticlePtr p) {m_currentPrimary=p;}
void SetCurrentlyTraced(HepMC::GenParticle *p) {m_currentlyTraced=p;} void SetCurrentlyTraced(HepMC::GenParticlePtr p) {m_currentlyTraced=p;}
HepMC::GenParticle *GetCurrentPrimary() const {return m_currentPrimary;} HepMC::GenParticlePtr GetCurrentPrimary() const {return m_currentPrimary;}
HepMC::GenParticle *GetCurrentlyTraced() const {return m_currentlyTraced;} HepMC::GenParticlePtr GetCurrentlyTraced() const {return m_currentlyTraced;}
int SecondaryParticleBarCode() {m_secondaryParticleBarCode++; int SecondaryParticleBarCode() {m_secondaryParticleBarCode++;
return m_secondaryParticleBarCode;} return m_secondaryParticleBarCode;}
int SecondaryVertexBarCode() {m_secondaryVertexBarCode--; int SecondaryVertexBarCode() {m_secondaryVertexBarCode--;
...@@ -50,8 +50,8 @@ private: ...@@ -50,8 +50,8 @@ private:
int m_secondaryParticleBarCode; int m_secondaryParticleBarCode;
int m_secondaryVertexBarCode; int m_secondaryVertexBarCode;
HepMC::GenEvent *m_theEvent; HepMC::GenEvent *m_theEvent;
HepMC::GenParticle *m_currentPrimary; HepMC::GenParticlePtr m_currentPrimary;
HepMC::GenParticle *m_currentlyTraced; HepMC::GenParticlePtr m_currentlyTraced;
// These two are used by calibration hits as event-level flags // These two are used by calibration hits as event-level flags
// They correspond to the last barcode and step processed by an SD // They correspond to the last barcode and step processed by an SD
// Both are needed, because a particle might have only one step // Both are needed, because a particle might have only one step
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef PrimaryParticleInformation_H #ifndef PrimaryParticleInformation_H
...@@ -15,25 +15,25 @@ namespace ISF { ...@@ -15,25 +15,25 @@ namespace ISF {
class PrimaryParticleInformation: public G4VUserPrimaryParticleInformation { class PrimaryParticleInformation: public G4VUserPrimaryParticleInformation {
public: public:
PrimaryParticleInformation(); PrimaryParticleInformation();
PrimaryParticleInformation(const HepMC::GenParticle*, const ISF::ISFParticle* isp=0); PrimaryParticleInformation(HepMC::ConstGenParticlePtr, const ISF::ISFParticle* isp=0);
const HepMC::GenParticle *GetHepMCParticle() const; HepMC::ConstGenParticlePtr GetHepMCParticle() const;
int GetParticleBarcode() const; int GetParticleBarcode() const;
void SuggestBarcode(int bc); void SuggestBarcode(int bc);
void SetParticle(const HepMC::GenParticle*); void SetParticle(HepMC::ConstGenParticlePtr);
void Print() const {} void Print() const {}
int GetRegenerationNr() {return m_regenerationNr;} int GetRegenerationNr() {return m_regenerationNr;}
void SetRegenerationNr(int i) {m_regenerationNr=i;} void SetRegenerationNr(int i) {m_regenerationNr=i;}
void SetISFParticle(const ISF::ISFParticle* isp); void SetISFParticle(const ISF::ISFParticle* isp);
const ISF::ISFParticle* GetISFParticle() const; const ISF::ISFParticle* GetISFParticle() const;
private: private:
const HepMC::GenParticle *m_theParticle; HepMC::ConstGenParticlePtr m_theParticle{};
const ISF::ISFParticle* m_theISFParticle; const ISF::ISFParticle* m_theISFParticle{};
int m_regenerationNr; int m_regenerationNr{0};
int m_barcode; int m_barcode{-1};
}; };
#endif #endif
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef TrackInformation_H #ifndef TrackInformation_H
...@@ -14,11 +14,11 @@ namespace ISF { ...@@ -14,11 +14,11 @@ namespace ISF {
class TrackInformation: public VTrackInformation { class TrackInformation: public VTrackInformation {
public: public:
TrackInformation(); TrackInformation();
TrackInformation(const HepMC::GenParticle*,const ISF::ISFParticle* baseIsp=0); TrackInformation(HepMC::ConstGenParticlePtr,const ISF::ISFParticle* baseIsp=0);
const HepMC::GenParticle *GetHepMCParticle() const; HepMC::ConstGenParticlePtr GetHepMCParticle() const;
const ISF::ISFParticle *GetBaseISFParticle() const; const ISF::ISFParticle *GetBaseISFParticle() const;
int GetParticleBarcode() const; int GetParticleBarcode() const;
void SetParticle(const HepMC::GenParticle*); void SetParticle(HepMC::ConstGenParticlePtr);
void SetBaseISFParticle(const ISF::ISFParticle*); void SetBaseISFParticle(const ISF::ISFParticle*);
void SetReturnedToISF(bool returned) {m_returnedToISF=returned;}; void SetReturnedToISF(bool returned) {m_returnedToISF=returned;};
bool GetReturnedToISF() const {return m_returnedToISF;}; bool GetReturnedToISF() const {return m_returnedToISF;};
...@@ -26,7 +26,7 @@ public: ...@@ -26,7 +26,7 @@ public:
int GetRegenerationNr() const {return m_regenerationNr;}; int GetRegenerationNr() const {return m_regenerationNr;};
private: private:
int m_regenerationNr; int m_regenerationNr;
const HepMC::GenParticle *m_theParticle; HepMC::ConstGenParticlePtr m_theParticle;
const ISF::ISFParticle *m_theBaseISFParticle; const ISF::ISFParticle *m_theBaseISFParticle;
bool m_returnedToISF; bool m_returnedToISF;
}; };
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef VTrackInformation_H #ifndef VTrackInformation_H
...@@ -17,22 +17,22 @@ namespace ISF { ...@@ -17,22 +17,22 @@ namespace ISF {
class VTrackInformation: public G4VUserTrackInformation { class VTrackInformation: public G4VUserTrackInformation {
public: public:
VTrackInformation(TrackClassification tc=Primary); VTrackInformation(TrackClassification tc=Primary);
const HepMC::GenParticle *GetPrimaryHepMCParticle() const; HepMC::ConstGenParticlePtr GetPrimaryHepMCParticle() const;
void SetPrimaryHepMCParticle(const HepMC::GenParticle*); void SetPrimaryHepMCParticle(HepMC::ConstGenParticlePtr);
virtual const HepMC::GenParticle *GetHepMCParticle() const; virtual HepMC::ConstGenParticlePtr GetHepMCParticle() const;
virtual const ISF::ISFParticle *GetBaseISFParticle() const; virtual const ISF::ISFParticle *GetBaseISFParticle() const;
virtual bool GetReturnedToISF() const; virtual bool GetReturnedToISF() const;
virtual int GetParticleBarcode() const =0; virtual int GetParticleBarcode() const =0;
virtual void SetParticle(const HepMC::GenParticle*); virtual void SetParticle(HepMC::ConstGenParticlePtr);
virtual void SetBaseISFParticle(const ISF::ISFParticle*); virtual void SetBaseISFParticle(const ISF::ISFParticle*);
virtual void SetReturnedToISF(bool) ; virtual void SetReturnedToISF(bool) ;
virtual void Print() const {} virtual void Print() const {}
void SetClassification(TrackClassification tc) {m_classify=tc;} void SetClassification(TrackClassification tc) {m_classify=tc;}
TrackClassification GetClassification() {return m_classify;} TrackClassification GetClassification() {return m_classify;}
private: private:
TrackClassification m_classify; TrackClassification m_classify;
const HepMC::GenParticle *m_thePrimaryParticle; HepMC::ConstGenParticlePtr m_thePrimaryParticle{};
}; };
#endif #endif
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#include "MCTruth/PrimaryParticleInformation.h" #include "MCTruth/PrimaryParticleInformation.h"
PrimaryParticleInformation::PrimaryParticleInformation() PrimaryParticleInformation::PrimaryParticleInformation()
: m_theParticle(0),m_theISFParticle(0),m_regenerationNr(0),m_barcode(-1)
{ {
} }
PrimaryParticleInformation::PrimaryParticleInformation(const HepMC::GenParticle *p, const ISF::ISFParticle* isp):m_theParticle(p),m_theISFParticle(isp),m_regenerationNr(0),m_barcode(-1) PrimaryParticleInformation::PrimaryParticleInformation(HepMC::ConstGenParticlePtr p, const ISF::ISFParticle* isp):m_theParticle(p),m_theISFParticle(isp)
{ {
} }
const HepMC::GenParticle* PrimaryParticleInformation::GetHepMCParticle() const HepMC::ConstGenParticlePtr PrimaryParticleInformation::GetHepMCParticle() const
{ {
return m_theParticle; return m_theParticle;
} }
const ISF::ISFParticle* PrimaryParticleInformation::GetISFParticle() const const ISF::ISFParticle* PrimaryParticleInformation::GetISFParticle() const
{ {
return m_theISFParticle; return m_theISFParticle;
} }
void PrimaryParticleInformation::SuggestBarcode(int bc) void PrimaryParticleInformation::SuggestBarcode(int bc)
...@@ -33,15 +32,15 @@ void PrimaryParticleInformation::SuggestBarcode(int bc) ...@@ -33,15 +32,15 @@ void PrimaryParticleInformation::SuggestBarcode(int bc)
int PrimaryParticleInformation::GetParticleBarcode() const int PrimaryParticleInformation::GetParticleBarcode() const
{ {
return m_theParticle?m_theParticle->barcode():m_barcode; return m_theParticle?HepMC::barcode(m_theParticle):m_barcode;
} }
void PrimaryParticleInformation::SetParticle(const HepMC::GenParticle* p) void PrimaryParticleInformation::SetParticle(HepMC::ConstGenParticlePtr p)
{ {
m_theParticle=p; m_theParticle=p;
} }
void PrimaryParticleInformation::SetISFParticle(const ISF::ISFParticle* p) void PrimaryParticleInformation::SetISFParticle(const ISF::ISFParticle* p)
{ {
m_theISFParticle=p; m_theISFParticle=p;
} }
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#include "MCTruth/TrackInformation.h" #include "MCTruth/TrackInformation.h"
...@@ -9,7 +9,7 @@ TrackInformation::TrackInformation():m_regenerationNr(0),m_theParticle(0),m_theB ...@@ -9,7 +9,7 @@ TrackInformation::TrackInformation():m_regenerationNr(0),m_theParticle(0),m_theB
{ {
} }
TrackInformation::TrackInformation(const HepMC::GenParticle *p,const ISF::ISFParticle* baseIsp): TrackInformation::TrackInformation(HepMC::ConstGenParticlePtr p,const ISF::ISFParticle* baseIsp):
m_regenerationNr(0), m_regenerationNr(0),
m_theParticle(p), m_theParticle(p),
m_theBaseISFParticle(baseIsp), m_theBaseISFParticle(baseIsp),
...@@ -17,7 +17,7 @@ TrackInformation::TrackInformation(const HepMC::GenParticle *p,const ISF::ISFPar ...@@ -17,7 +17,7 @@ TrackInformation::TrackInformation(const HepMC::GenParticle *p,const ISF::ISFPar
{ {
} }
const HepMC::GenParticle* TrackInformation::GetHepMCParticle() const HepMC::ConstGenParticlePtr TrackInformation::GetHepMCParticle() const
{ {
return m_theParticle; return m_theParticle;
} }
...@@ -31,7 +31,7 @@ int TrackInformation::GetParticleBarcode() const ...@@ -31,7 +31,7 @@ int TrackInformation::GetParticleBarcode() const
return ( m_theParticle ? m_theParticle->barcode() : 0 ); return ( m_theParticle ? m_theParticle->barcode() : 0 );
} }
void TrackInformation::SetParticle(const HepMC::GenParticle* p) void TrackInformation::SetParticle(HepMC::ConstGenParticlePtr p)
{ {
m_theParticle=p; m_theParticle=p;
} }
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
*/ */
#include "MCTruth/VTrackInformation.h" #include "MCTruth/VTrackInformation.h"
VTrackInformation::VTrackInformation(TrackClassification tc):m_classify(tc),m_thePrimaryParticle(0) VTrackInformation::VTrackInformation(TrackClassification tc):m_classify(tc)
{ {
} }
const HepMC::GenParticle* VTrackInformation::GetPrimaryHepMCParticle() const HepMC::ConstGenParticlePtr VTrackInformation::GetPrimaryHepMCParticle() const
{ {
return m_thePrimaryParticle; return m_thePrimaryParticle;
} }
void VTrackInformation::SetPrimaryHepMCParticle(const HepMC::GenParticle* p) void VTrackInformation::SetPrimaryHepMCParticle(HepMC::ConstGenParticlePtr p)
{ {
m_thePrimaryParticle=p; m_thePrimaryParticle=p;
} }
const HepMC::GenParticle* VTrackInformation::GetHepMCParticle() const HepMC::ConstGenParticlePtr VTrackInformation::GetHepMCParticle() const
{ {
return 0; return 0;
} }
...@@ -34,7 +34,7 @@ bool VTrackInformation::GetReturnedToISF() const ...@@ -34,7 +34,7 @@ bool VTrackInformation::GetReturnedToISF() const
return false; return false;
} }
void VTrackInformation::SetParticle(const HepMC::GenParticle* /*p*/) void VTrackInformation::SetParticle(HepMC::ConstGenParticlePtr /*p*/)
{ {
// you should not call this, perhaps throw an exception? // you should not call this, perhaps throw an exception?
std::cerr<<"ERROR VTrackInformation::SetParticle() not supported "<<std::endl; std::cerr<<"ERROR VTrackInformation::SetParticle() not supported "<<std::endl;
......
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