Skip to content
Snippets Groups Projects

Add status to transient TrackRecord class and add, but not use a new persistent class

Merged John Derek Chapman requested to merge jchapman/athena:TrackRecordWithStatus_main into main
All threads resolved!
1 file
+ 95
63
Compare changes
  • Side-by-side
  • Inline
/*
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 TrackRecord_H
#define TrackRecord_H
#ifndef TRACKRECORD_TRACKRECORD_H
#define TRACKRECORD_TRACKRECORD_H
#include "CLHEP/Vector/ThreeVector.h"
class TrackRecord {
public:
/** @brief Default constructor */
TrackRecord() : m_PDG_code(0), m_Energy(0), m_Momentum(0,0,0), m_Position(0,0,0), m_Time(0), m_barCode(0), m_volName("") {}
/** @brief Default destructor */
virtual ~TrackRecord() {}
/** @brief Constructor */
TrackRecord(int pdg, double e, const CLHEP::Hep3Vector& p, const CLHEP::Hep3Vector& x, double t, int bc, const std::string& vn)
: m_PDG_code(pdg), m_Energy(e), m_Momentum(p), m_Position(x), m_Time(t), m_barCode(bc), m_volName(vn) {}
/** @brief Constructor */
TrackRecord(const TrackRecord& trc):m_PDG_code(trc.m_PDG_code), m_Energy(trc.m_Energy),
m_Momentum(trc.m_Momentum), m_Position(trc.m_Position),
m_Time(trc.m_Time), m_barCode(trc.m_barCode), m_volName(trc.m_volName){}
/** @brief Assignement Operator */
/** @brief Default constructor */
TrackRecord() = default;
/** @brief Default destructor */
virtual ~TrackRecord() = default;
/** @brief Constructor */
TrackRecord(
int pdg,
double energy,
const CLHEP::Hep3Vector& momentum,
const CLHEP::Hep3Vector& postition,
double time,
int barcode,
const std::string& volumeName)
: m_pdgCode(pdg)
, m_energy(energy)
, m_momentum(momentum)
, m_position(postition)
, m_time(time)
, m_barcode(barcode)
, m_volName(volumeName) {}
/** @brief Constructor */
TrackRecord(const TrackRecord& trc)
: m_pdgCode(trc.m_pdgCode)
, m_energy(trc.m_energy)
, m_momentum(trc.m_momentum)
, m_position(trc.m_position)
, m_time(trc.m_time)
, m_barcode(trc.m_barcode)
, m_volName(trc.m_volName){}
/** @brief Assignement Operator */
TrackRecord &operator=(const TrackRecord& trc) {
if(this!=&trc) {
m_PDG_code = trc.m_PDG_code; m_Energy = trc.m_Energy;
m_Momentum = trc.m_Momentum; m_Position = trc.m_Position;
m_Time = trc.m_Time; m_barCode = trc.m_barCode;
if (this != &trc) {
m_pdgCode = trc.m_pdgCode;
m_energy = trc.m_energy;
m_momentum = trc.m_momentum;
m_position = trc.m_position;
m_time = trc.m_time;
m_barcode = trc.m_barcode;
m_volName = trc.m_volName;
}
return *this;
}
/** @brief Set energy */
void SetEnergy(double e) {m_Energy=e;}
/** @brief Set position */
void SetPosition(CLHEP::Hep3Vector p) {m_Position=p;}
/** @brief Set momentum */
void SetMomentum(CLHEP::Hep3Vector e) {m_Momentum=e;}
/** @brief Set PDG code */
void SetPDGCode(int pcode) {m_PDG_code=pcode;}
/** @brief Energy */
double GetEnergy() const {return m_Energy;}
/** @brief Position */
CLHEP::Hep3Vector GetPosition() const {return m_Position;}
/** @brief Momentum */
CLHEP::Hep3Vector GetMomentum() const {return m_Momentum;}
/** @brief PDG Code */
int GetPDGCode() const {return m_PDG_code;}
/* Davide 30-6-06 add methods and evolve this class */
/** @brief Set time */
void SetTime(double time) {m_Time=time;}
/** @brief Time */
double GetTime() const {return m_Time;}
/** @brief Set bar code */
void SetBarCode(int theCode){m_barCode=theCode;}
/** @brief bar code */
int GetBarCode() const {return m_barCode;}
/** @brief bar code. Alias function. */
int barcode() const {return GetBarCode();}
/** @brief Set Volume name */
void SetVolName(const std::string& theName){m_volName=theName;}
/** @brief Volume name */
/** @brief Energy */
double GetEnergy() const {return m_energy;}
/** @brief Set energy */
void SetEnergy(double e) {m_energy = e;}
/** @brief Position */
CLHEP::Hep3Vector GetPosition() const {return m_position;}
/** @brief Set position */
void SetPosition(CLHEP::Hep3Vector p) {m_position = p;}
/** @brief Momentum */
CLHEP::Hep3Vector GetMomentum() const {return m_momentum;}
/** @brief Set momentum */
void SetMomentum(CLHEP::Hep3Vector e) {m_momentum = e;}
/** @brief PDG Code */
int GetPDGCode() const {return m_pdgCode;}
/** @brief Set PDG code */
void SetPDGCode(int pcode) {m_pdgCode = pcode;}
/** @brief Time */
double GetTime() const {return m_time;}
/** @brief Set time */
void SetTime(double time) {m_time = time;}
/** @brief Volume name */
std::string GetVolName() const {return m_volName;}
private:
int m_PDG_code;
double m_Energy;
CLHEP::Hep3Vector m_Momentum;
CLHEP::Hep3Vector m_Position;
/* Davide 30-6-06 add member and evolve this class */
double m_Time;
int m_barCode;
std::string m_volName;
/** @brief Set Volume name */
void SetVolName(const std::string& theName){m_volName = theName;}
/** @brief bar code. Alias function. */
int barcode() const {return m_barcode;}
/** @brief Set barcode */
void SetBarcode(int barcode){m_barcode = barcode;}
private:
int m_pdgCode{0};
double m_energy{0};
CLHEP::Hep3Vector m_momentum{0,0,0};
CLHEP::Hep3Vector m_position{0,0,0};
double m_time{0.};
int m_barcode{0};
std::string m_volName{""};
};
#endif
#endif // TRACKRECORD_TRACKRECORD_H
Loading