ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
Classes | Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
AtSimpleSimulation Class Reference

#include <AtSimpleSimulation.h>

Collaboration diagram for AtSimpleSimulation:
Collaboration graph
[legend]

Classes

struct  ParticleID
 

Public Member Functions

 AtSimpleSimulation (std::string geoFile)
 
 AtSimpleSimulation ()
 
 AtSimpleSimulation (const AtSimpleSimulation &other)=default
 
 ~AtSimpleSimulation ()=default
 
void RegisterBranch (std::string branchName="AtTpcPoint", bool pers=true)
 
void AddModel (int Z, int A, ModelPtr model)
 
void SetSpaceChargeModel (SpaceChargeModel model)
 
void SetDistanceStep (double step)
 
void NewEvent ()
 
void SimulateParticle (int Z, int A, const XYZPoint &iniPos, const PxPyPzEVector &iniMom)
 
AtMCPointGetMcPoint (int i)
 
int GetNumPoints ()
 
TClonesArray & GetPointsArray ()
 
SpaceChargeModel GetSpaceChargeModel ()
 

Protected Types

using SpaceChargeModel = std::shared_ptr< AtSpaceChargeModel >
 
using ModelPtr = std::shared_ptr< AtTools::AtELossModel >
 
using XYZPoint = ROOT::Math::XYZPoint
 
using XYZVector = ROOT::Math::XYZVector
 
using PxPyPzEVector = ROOT::Math::PxPyPzEVector
 

Protected Member Functions

bool IsInVolume (const std::string &volName, const XYZPoint &point)
 
std::string GetVolumeName (const XYZPoint &point)
 
void SimulateParticle (ModelPtr model, const XYZPoint &iniPos, const PxPyPzEVector &iniMom)
 
void AddHit (double ELoss, const XYZPoint &pos, const PxPyPzEVector &mom, double length)
 
TGeoVolume * GetVolume (const XYZPoint &pos)
 Takes position in mm. More...
 

Protected Attributes

std::map< ParticleID, ModelPtrfModels
 
SpaceChargeModel fSCModel {nullptr}
 
double fDistStep {1.}
 
std::mutex fGeoMutex
 

Static Protected Attributes

static thread_local int fTrackID = 0
 
static thread_local TClonesArray fMCPoints
 

Detailed Description

Class for simulating simple events using AtELossModels. Units in this class are MeV (energy), mm (distance) MeV/c (momentum).

Definition at line 29 of file AtSimpleSimulation.h.

Member Typedef Documentation

◆ ModelPtr

using AtSimpleSimulation::ModelPtr = std::shared_ptr<AtTools::AtELossModel>
protected

Definition at line 38 of file AtSimpleSimulation.h.

◆ PxPyPzEVector

using AtSimpleSimulation::PxPyPzEVector = ROOT::Math::PxPyPzEVector
protected

Definition at line 41 of file AtSimpleSimulation.h.

◆ SpaceChargeModel

using AtSimpleSimulation::SpaceChargeModel = std::shared_ptr<AtSpaceChargeModel>
protected

Definition at line 37 of file AtSimpleSimulation.h.

◆ XYZPoint

using AtSimpleSimulation::XYZPoint = ROOT::Math::XYZPoint
protected

Definition at line 39 of file AtSimpleSimulation.h.

◆ XYZVector

using AtSimpleSimulation::XYZVector = ROOT::Math::XYZVector
protected

Definition at line 40 of file AtSimpleSimulation.h.

Constructor & Destructor Documentation

◆ AtSimpleSimulation() [1/3]

AtSimpleSimulation::AtSimpleSimulation ( std::string  geoFile)

Assumes that the IO manager has been initialized (it will attempt to construct the branch needed here).

Definition at line 24 of file AtSimpleSimulation.cxx.

◆ AtSimpleSimulation() [2/3]

AtSimpleSimulation::AtSimpleSimulation ( )

Definition at line 31 of file AtSimpleSimulation.cxx.

◆ AtSimpleSimulation() [3/3]

AtSimpleSimulation::AtSimpleSimulation ( const AtSimpleSimulation other)
default

◆ ~AtSimpleSimulation()

AtSimpleSimulation::~AtSimpleSimulation ( )
default

Member Function Documentation

◆ AddHit()

void AtSimpleSimulation::AddHit ( double  ELoss,
const XYZPoint pos,
const PxPyPzEVector mom,
double  length 
)
protected

Units are mm, Mev, and Mev/c.

Definition at line 150 of file AtSimpleSimulation.cxx.

◆ AddModel()

void AtSimpleSimulation::AddModel ( int  Z,
int  A,
ModelPtr  model 
)

Definition at line 82 of file AtSimpleSimulation.cxx.

◆ GetMcPoint()

AtMCPoint& AtSimpleSimulation::GetMcPoint ( int  i)
inline

Definition at line 69 of file AtSimpleSimulation.h.

◆ GetNumPoints()

int AtSimpleSimulation::GetNumPoints ( )
inline

Definition at line 70 of file AtSimpleSimulation.h.

◆ GetPointsArray()

TClonesArray& AtSimpleSimulation::GetPointsArray ( )
inline

Definition at line 71 of file AtSimpleSimulation.h.

◆ GetSpaceChargeModel()

SpaceChargeModel AtSimpleSimulation::GetSpaceChargeModel ( )
inline

Definition at line 72 of file AtSimpleSimulation.h.

◆ GetVolume()

TGeoVolume * AtSimpleSimulation::GetVolume ( const XYZPoint pos)
protected

Takes position in mm.

Definition at line 49 of file AtSimpleSimulation.cxx.

◆ GetVolumeName()

std::string AtSimpleSimulation::GetVolumeName ( const XYZPoint point)
protected

Definition at line 73 of file AtSimpleSimulation.cxx.

◆ IsInVolume()

bool AtSimpleSimulation::IsInVolume ( const std::string &  volName,
const XYZPoint point 
)
protected

Definition at line 62 of file AtSimpleSimulation.cxx.

◆ NewEvent()

void AtSimpleSimulation::NewEvent ( )

Definition at line 141 of file AtSimpleSimulation.cxx.

◆ RegisterBranch()

void AtSimpleSimulation::RegisterBranch ( std::string  branchName = "AtTpcPoint",
bool  pers = true 
)

Definition at line 175 of file AtSimpleSimulation.cxx.

◆ SetDistanceStep()

void AtSimpleSimulation::SetDistanceStep ( double  step)
inline

Definition at line 64 of file AtSimpleSimulation.h.

◆ SetSpaceChargeModel()

void AtSimpleSimulation::SetSpaceChargeModel ( SpaceChargeModel  model)
inline

Definition at line 63 of file AtSimpleSimulation.h.

◆ SimulateParticle() [1/2]

void AtSimpleSimulation::SimulateParticle ( int  Z,
int  A,
const XYZPoint iniPos,
const PxPyPzEVector iniMom 
)

Definition at line 92 of file AtSimpleSimulation.cxx.

◆ SimulateParticle() [2/2]

void AtSimpleSimulation::SimulateParticle ( ModelPtr  model,
const XYZPoint iniPos,
const PxPyPzEVector iniMom 
)
protected

Definition at line 103 of file AtSimpleSimulation.cxx.

Member Data Documentation

◆ fDistStep

double AtSimpleSimulation::fDistStep {1.}
protected

Definition at line 45 of file AtSimpleSimulation.h.

◆ fGeoMutex

std::mutex AtSimpleSimulation::fGeoMutex
protected

Definition at line 46 of file AtSimpleSimulation.h.

◆ fMCPoints

thread_local TClonesArray AtSimpleSimulation::fMCPoints
staticprotected

Definition at line 50 of file AtSimpleSimulation.h.

◆ fModels

std::map<ParticleID, ModelPtr> AtSimpleSimulation::fModels
protected

Definition at line 43 of file AtSimpleSimulation.h.

◆ fSCModel

SpaceChargeModel AtSimpleSimulation::fSCModel {nullptr}
protected

Definition at line 44 of file AtSimpleSimulation.h.

◆ fTrackID

thread_local int AtSimpleSimulation::fTrackID = 0
staticprotected

Definition at line 49 of file AtSimpleSimulation.h.


The documentation for this class was generated from the following files: