ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
MCFitter::AtMCFitter Class Referenceabstract

#include <AtMCFitter.h>

Inheritance diagram for MCFitter::AtMCFitter:
Inheritance graph
[legend]
Collaboration diagram for MCFitter::AtMCFitter:
Collaboration graph
[legend]

Public Member Functions

 AtMCFitter (SimPtr sim, ClusterPtr cluster, PulsePtr pulse)
 
virtual ~AtMCFitter ()=default
 
void Init ()
 
void SetPSA (PsaPtr psa)
 
void Exec (const AtPatternEvent &event)
 
ParamPtr GetParameter (const std::string &name) const
 
void FillResultArrays (TClonesArray &resultArray, TClonesArray &simEvent, TClonesArray &simRawEvent)
 
void SetNumIter (int iter)
 
void SetNumRounds (int rounds)
 Set number of times to run fNumIter iterations and then re-center and truncate the parameter space. More...
 
void SetTimeEvent (bool val)
 
void SetNumEventsToSave (int num)
 
void SetNumThreads (int num)
 

Protected Types

using ParamPtr = std::shared_ptr< AtParameterDistribution >
 
using SimPtr = std::shared_ptr< AtSimpleSimulation >
 
using ClusterPtr = std::shared_ptr< AtClusterize >
 
using PulsePtr = std::shared_ptr< AtPulse >
 
using MapPtr = std::shared_ptr< AtMap >
 
using PsaPtr = std::shared_ptr< AtPSA >
 
using ObjPair = std::pair< int, double >
 

Protected Member Functions

void RunRound ()
 
void RunIterRange (int startIter, int numIter, AtPulse *pulse)
 
virtual void CreateParamDistros ()=0
 Create the parameter distributions to use for the fit. More...
 
virtual void SetParamDistributions (const AtPatternEvent &event)=0
 Set parameter distributions (mean/spread) from the event. More...
 
virtual double ObjectiveFunction (const AtBaseEvent &expEvent, int SimEventID, AtMCResult &definition)=0
 This is the thing we are minimizing between events (SimEventID is index in TClonesArray) More...
 
virtual TClonesArray SimulateEvent (AtMCResult &definition)=0
 
virtual AtMCResult DefineEvent ()
 
virtual void RecenterParamDistributions ()
 
int DigitizeEvent (const TClonesArray &points, int idx, AtPulse *pulse)
 

Protected Attributes

std::map< std::string, ParamPtrfParameters
 
MapPtr fMap
 
SimPtr fSim
 
ClusterPtr fClusterize
 
PulsePtr fPulse
 
PsaPtr fPSA {nullptr}
 
int fNumIter {1}
 
int fNumRounds {1}
 
int fNumEventsToSave {10}
 
bool fTimeEvent {false}
 
int fNumThreads {1}
 
const AtPatternEventfCurrentEvent {nullptr}
 
std::vector< PulsePtrfThPulse
 
const AtDigiParfPar {nullptr}
 
std::vector< AtRawEventfRawEventArray
 
std::vector< AtEventfEventArray
 
std::mutex fResultMutex
 Store the iteration number sorted by lowest objective funtion. More...
 
std::set< AtMCResult, std::function< bool(AtMCResult, AtMCResult)> > fResults
 

Detailed Description

Definition at line 31 of file AtMCFitter.h.

Member Typedef Documentation

◆ ClusterPtr

using MCFitter::AtMCFitter::ClusterPtr = std::shared_ptr<AtClusterize>
protected

Definition at line 36 of file AtMCFitter.h.

◆ MapPtr

using MCFitter::AtMCFitter::MapPtr = std::shared_ptr<AtMap>
protected

Definition at line 38 of file AtMCFitter.h.

◆ ObjPair

using MCFitter::AtMCFitter::ObjPair = std::pair<int, double>
protected

Definition at line 40 of file AtMCFitter.h.

◆ ParamPtr

using MCFitter::AtMCFitter::ParamPtr = std::shared_ptr<AtParameterDistribution>
protected

Definition at line 33 of file AtMCFitter.h.

◆ PsaPtr

using MCFitter::AtMCFitter::PsaPtr = std::shared_ptr<AtPSA>
protected

Definition at line 39 of file AtMCFitter.h.

◆ PulsePtr

using MCFitter::AtMCFitter::PulsePtr = std::shared_ptr<AtPulse>
protected

Definition at line 37 of file AtMCFitter.h.

◆ SimPtr

using MCFitter::AtMCFitter::SimPtr = std::shared_ptr<AtSimpleSimulation>
protected

Definition at line 34 of file AtMCFitter.h.

Constructor & Destructor Documentation

◆ AtMCFitter()

MCFitter::AtMCFitter::AtMCFitter ( SimPtr  sim,
ClusterPtr  cluster,
PulsePtr  pulse 
)

Definition at line 31 of file AtMCFitter.cxx.

◆ ~AtMCFitter()

virtual MCFitter::AtMCFitter::~AtMCFitter ( )
virtualdefault

Member Function Documentation

◆ CreateParamDistros()

virtual void MCFitter::AtMCFitter::CreateParamDistros ( )
protectedpure virtual

Create the parameter distributions to use for the fit.

Implemented in MCFitter::AtMCFission.

◆ DefineEvent()

AtMCResult MCFitter::AtMCFitter::DefineEvent ( )
protectedvirtual

Sample parameter distributions and constrain the system to simulate an event. The parameters in AtMCResult will be used to then simulate an event. This function calls Sample() on all the parameter distributions and saves them.

Reimplemented in MCFitter::AtMCFission.

Definition at line 200 of file AtMCFitter.cxx.

◆ DigitizeEvent()

int MCFitter::AtMCFitter::DigitizeEvent ( const TClonesArray &  points,
int  idx,
AtPulse pulse 
)
protected

Create the AtRawEvent and AtEvent from fSim returns the index of the event in the TClonesArray

Definition at line 158 of file AtMCFitter.cxx.

◆ Exec()

void MCFitter::AtMCFitter::Exec ( const AtPatternEvent event)

Definition at line 97 of file AtMCFitter.cxx.

◆ FillResultArrays()

void MCFitter::AtMCFitter::FillResultArrays ( TClonesArray &  resultArray,
TClonesArray &  simEvent,
TClonesArray &  simRawEvent 
)

Fill the TClonesArray in order of smallest to largest chi2.

Definition at line 177 of file AtMCFitter.cxx.

◆ GetParameter()

AtMCFitter::ParamPtr MCFitter::AtMCFitter::GetParameter ( const std::string &  name) const

Definition at line 37 of file AtMCFitter.cxx.

◆ Init()

void MCFitter::AtMCFitter::Init ( )

Definition at line 52 of file AtMCFitter.cxx.

◆ ObjectiveFunction()

virtual double MCFitter::AtMCFitter::ObjectiveFunction ( const AtBaseEvent expEvent,
int  SimEventID,
AtMCResult definition 
)
protectedpure virtual

This is the thing we are minimizing between events (SimEventID is index in TClonesArray)

Implemented in MCFitter::AtMCFission.

◆ RecenterParamDistributions()

void MCFitter::AtMCFitter::RecenterParamDistributions ( )
protectedvirtual

Recenter the parameter distributions around the best result and truncate the parameter space.

Definition at line 207 of file AtMCFitter.cxx.

◆ RunIterRange()

void MCFitter::AtMCFitter::RunIterRange ( int  startIter,
int  numIter,
AtPulse pulse 
)
protected

Definition at line 72 of file AtMCFitter.cxx.

◆ RunRound()

void MCFitter::AtMCFitter::RunRound ( )
protected

Definition at line 117 of file AtMCFitter.cxx.

◆ SetNumEventsToSave()

void MCFitter::AtMCFitter::SetNumEventsToSave ( int  num)
inline

Definition at line 87 of file AtMCFitter.h.

◆ SetNumIter()

void MCFitter::AtMCFitter::SetNumIter ( int  iter)
inline

Definition at line 82 of file AtMCFitter.h.

◆ SetNumRounds()

void MCFitter::AtMCFitter::SetNumRounds ( int  rounds)
inline

Set number of times to run fNumIter iterations and then re-center and truncate the parameter space.

Definition at line 85 of file AtMCFitter.h.

◆ SetNumThreads()

void MCFitter::AtMCFitter::SetNumThreads ( int  num)

Definition at line 45 of file AtMCFitter.cxx.

◆ SetParamDistributions()

virtual void MCFitter::AtMCFitter::SetParamDistributions ( const AtPatternEvent event)
protectedpure virtual

Set parameter distributions (mean/spread) from the event.

Implemented in MCFitter::AtMCFission.

◆ SetPSA()

void MCFitter::AtMCFitter::SetPSA ( PsaPtr  psa)
inline

Definition at line 77 of file AtMCFitter.h.

◆ SetTimeEvent()

void MCFitter::AtMCFitter::SetTimeEvent ( bool  val)
inline

Definition at line 86 of file AtMCFitter.h.

◆ SimulateEvent()

virtual TClonesArray MCFitter::AtMCFitter::SimulateEvent ( AtMCResult definition)
protectedpure virtual

Simulate an event using the parameters in the passed AtMCResult class and return an array of the AtMCPoints to then digitize.

Implemented in MCFitter::AtMCFission.

Member Data Documentation

◆ fClusterize

ClusterPtr MCFitter::AtMCFitter::fClusterize
protected

Definition at line 46 of file AtMCFitter.h.

◆ fCurrentEvent

const AtPatternEvent* MCFitter::AtMCFitter::fCurrentEvent {nullptr}
protected

Definition at line 58 of file AtMCFitter.h.

◆ fEventArray

std::vector<AtEvent> MCFitter::AtMCFitter::fEventArray
protected

Definition at line 65 of file AtMCFitter.h.

◆ fMap

MapPtr MCFitter::AtMCFitter::fMap
protected

Definition at line 44 of file AtMCFitter.h.

◆ fNumEventsToSave

int MCFitter::AtMCFitter::fNumEventsToSave {10}
protected

Definition at line 52 of file AtMCFitter.h.

◆ fNumIter

int MCFitter::AtMCFitter::fNumIter {1}
protected

Definition at line 50 of file AtMCFitter.h.

◆ fNumRounds

int MCFitter::AtMCFitter::fNumRounds {1}
protected

Definition at line 51 of file AtMCFitter.h.

◆ fNumThreads

int MCFitter::AtMCFitter::fNumThreads {1}
protected

Definition at line 54 of file AtMCFitter.h.

◆ fPar

const AtDigiPar* MCFitter::AtMCFitter::fPar {nullptr}
protected

Definition at line 60 of file AtMCFitter.h.

◆ fParameters

std::map<std::string, ParamPtr> MCFitter::AtMCFitter::fParameters
protected

Definition at line 42 of file AtMCFitter.h.

◆ fPSA

PsaPtr MCFitter::AtMCFitter::fPSA {nullptr}
protected

Definition at line 48 of file AtMCFitter.h.

◆ fPulse

PulsePtr MCFitter::AtMCFitter::fPulse
protected

Definition at line 47 of file AtMCFitter.h.

◆ fRawEventArray

std::vector<AtRawEvent> MCFitter::AtMCFitter::fRawEventArray
protected

Definition at line 64 of file AtMCFitter.h.

◆ fResultMutex

std::mutex MCFitter::AtMCFitter::fResultMutex
protected

Store the iteration number sorted by lowest objective funtion.

Things below here need to be written to by threads and will be locked using a shared mutex

Definition at line 69 of file AtMCFitter.h.

◆ fResults

std::set<AtMCResult, std::function<bool(AtMCResult, AtMCResult)> > MCFitter::AtMCFitter::fResults
protected

Definition at line 70 of file AtMCFitter.h.

◆ fSim

SimPtr MCFitter::AtMCFitter::fSim
protected

Definition at line 45 of file AtMCFitter.h.

◆ fThPulse

std::vector<PulsePtr> MCFitter::AtMCFitter::fThPulse
protected

Definition at line 59 of file AtMCFitter.h.

◆ fTimeEvent

bool MCFitter::AtMCFitter::fTimeEvent {false}
protected

Definition at line 53 of file AtMCFitter.h.


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