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

#include <AtMCFission.h>

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

Public Member Functions

 AtMCFission (SimPtr sim, ClusterPtr cluster, PulsePtr pulse)
 
virtual ~AtMCFission ()=default
 
void SetCN (Ion cn)
 
void SetChargeObjective (ObjectiveFuncCharge obj)
 
void SetAmp (float amp)
 
void SetZRange (int Zmin, int Zmax)
 
- Public Member Functions inherited from MCFitter::AtMCFitter
 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)
 

Static Public Member Functions

static double ObjectiveChargeChi2 (const std::vector< double > &exp, const std::vector< double > &sim, const double *par)
 
static double ObjectiveChargeChi2Norm (const std::vector< double > &exp, const std::vector< double > &sim, const double *par)
 
static double ObjectiveChargeDiff2 (const std::vector< double > &exp, const std::vector< double > &sim, const double *par)
 

Protected Types

using XYZPoint = ROOT::Math::XYZPoint
 
using XYZVector = ROOT::Math::XYZVector
 
using XYZEVector = ROOT::Math::PxPyPzEVector
 
using ObjectiveFuncCharge = std::function< double(const std::vector< double > &exp, const std::vector< double > &sim, const double *par)>
 
- Protected Types inherited from MCFitter::AtMCFitter
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

virtual void CreateParamDistros () override
 Create the parameter distributions to use for the fit. More...
 
virtual void SetParamDistributions (const AtPatternEvent &event) override
 Set parameter distributions (mean/spread) from the event. More...
 
virtual double ObjectiveFunction (const AtBaseEvent &expEvent, int SimEventID, AtMCResult &definition) override
 This is the thing we are minimizing between events (SimEventID is index in TClonesArray) More...
 
virtual TClonesArray SimulateEvent (AtMCResult &definition) override
 
virtual AtMCResult DefineEvent () override
 
double ObjectiveCharge (const AtFissionEvent &expEvent, int SimEventID, AtMCResult &def)
 
double ObjectiveCharge (const std::array< std::vector< double >, 2 > &exp, const std::array< std::vector< double >, 2 > &sim, AtMCResult &definition)
 
double ObjectivePositionPads (const AtFissionEvent &expEvent, int SimEventID)
 
double ObjectivePosition (const AtFissionEvent &expEvent, int SimEventID)
 
double ObjectiveChargePads (const AtFissionEvent &expEvent, int SimEventID, AtMCResult &def)
 
XYZPoint GetVertex (AtMCResult &)
 
std::array< Ion, 2 > GetFragmentSpecies (AtMCResult &, const Ion &CN)
 
XYZVector GetBeamDir (AtMCResult &, const std::array< XYZVector, 2 > &ffDir, double pTrans)
 
XYZVector GetBeamDirSample (AtMCResult &, const std::array< XYZVector, 2 > &ffDir)
 
XYZVector GetBeamDirSameV (AtMCResult &, const std::array< XYZVector, 2 > &ffDir)
 
std::array< XYZVector, 2 > GetMomDirLab (AtMCResult &)
 
void SetMomMagnitude (std::array< XYZVector, 2 > &mom, double pTrans)
 
double ObjectivePosition (double uE, double sE, double uO, double sO)
 
double ObjectivePosition4 (double uE, double sE, double uO, double sO)
 
double ObjectivePosition3 (double uE, double sE, double uO, double sO)
 
double ObjectivePosition2 (double uE, double sE, double uO, double sO)
 
- Protected Member Functions inherited from MCFitter::AtMCFitter
void RunRound ()
 
void RunIterRange (int startIter, int numIter, AtPulse *pulse)
 
virtual void RecenterParamDistributions ()
 
int DigitizeEvent (const TClonesArray &points, int idx, AtPulse *pulse)
 

Static Protected Member Functions

static double violaEn (int A, int Z)
 

Protected Attributes

Ion fCN {85, 204}
 
int fZmin = 26
 
int fZmax = 59
 
XYZVector fNominalBeamDir {11.464, 3.754, 1000}
 
ObjectiveFuncCharge fObjCharge {ObjectiveChargeChi2}
 Objective function to minimize the difference between A*sim and exp charge curves. More...
 
float fAmp = 1
 
bool fFitAmp = true
 
- Protected Attributes inherited from MCFitter::AtMCFitter
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 26 of file AtMCFission.h.

Member Typedef Documentation

◆ ObjectiveFuncCharge

using MCFitter::AtMCFission::ObjectiveFuncCharge = std::function<double(const std::vector<double> &exp, const std::vector<double> &sim, const double *par)>
protected

Definition at line 31 of file AtMCFission.h.

◆ XYZEVector

Definition at line 30 of file AtMCFission.h.

◆ XYZPoint

using MCFitter::AtMCFission::XYZPoint = ROOT::Math::XYZPoint
protected

Definition at line 28 of file AtMCFission.h.

◆ XYZVector

using MCFitter::AtMCFission::XYZVector = ROOT::Math::XYZVector
protected

Definition at line 29 of file AtMCFission.h.

Constructor & Destructor Documentation

◆ AtMCFission()

MCFitter::AtMCFission::AtMCFission ( SimPtr  sim,
ClusterPtr  cluster,
PulsePtr  pulse 
)
inline

Definition at line 50 of file AtMCFission.h.

◆ ~AtMCFission()

virtual MCFitter::AtMCFission::~AtMCFission ( )
virtualdefault

Member Function Documentation

◆ CreateParamDistros()

void AtMCFission::CreateParamDistros ( )
overrideprotectedvirtual

Create the parameter distributions to use for the fit.

Implements MCFitter::AtMCFitter.

Definition at line 56 of file AtMCFission.cxx.

◆ DefineEvent()

AtMCResult AtMCFission::DefineEvent ( )
overrideprotectedvirtual

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 from MCFitter::AtMCFitter.

Definition at line 533 of file AtMCFission.cxx.

◆ GetBeamDir()

XYZVector AtMCFission::GetBeamDir ( AtMCResult res,
const std::array< XYZVector, 2 > &  ffDir,
double  pTrans 
)
protected

Gets the beam direction using kinematics constraints given our assumtion on the kinetic energy of the fission fragments from viola systematics, the masses of the fission fragments, and the folding angle between the fission fragments.

Definition at line 454 of file AtMCFission.cxx.

◆ GetBeamDirSameV()

XYZVector AtMCFission::GetBeamDirSameV ( AtMCResult res,
const std::array< XYZVector, 2 > &  ffDir 
)
protected

Gets the beam direction assuming the velocity of the FFs are the same (i.e. it assumes the beam direction is half way between the two FF in tha lab frame.

Definition at line 439 of file AtMCFission.cxx.

◆ GetBeamDirSample()

XYZVector AtMCFission::GetBeamDirSample ( AtMCResult res,
const std::array< XYZVector, 2 > &  ffDir 
)
protected

Definition at line 496 of file AtMCFission.cxx.

◆ GetFragmentSpecies()

std::array< Ion, 2 > AtMCFission::GetFragmentSpecies ( AtMCResult res,
const Ion CN 
)
protected

Definition at line 428 of file AtMCFission.cxx.

◆ GetMomDirLab()

std::array< XYZVector, 2 > AtMCFission::GetMomDirLab ( AtMCResult res)
protected

Get the direction of the FF in the lab frame.

Definition at line 526 of file AtMCFission.cxx.

◆ GetVertex()

XYZPoint AtMCFission::GetVertex ( AtMCResult res)
protected

Definition at line 422 of file AtMCFission.cxx.

◆ ObjectiveCharge() [1/2]

double AtMCFission::ObjectiveCharge ( const AtFissionEvent expEvent,
int  SimEventID,
AtMCResult def 
)
protected

Definition at line 207 of file AtMCFission.cxx.

◆ ObjectiveCharge() [2/2]

double AtMCFission::ObjectiveCharge ( const std::array< std::vector< double >, 2 > &  exp,
const std::array< std::vector< double >, 2 > &  sim,
AtMCResult definition 
)
protected

Definition at line 273 of file AtMCFission.cxx.

◆ ObjectiveChargeChi2()

double AtMCFission::ObjectiveChargeChi2 ( const std::vector< double > &  exp,
const std::vector< double > &  sim,
const double *  par 
)
static

Definition at line 224 of file AtMCFission.cxx.

◆ ObjectiveChargeChi2Norm()

double AtMCFission::ObjectiveChargeChi2Norm ( const std::vector< double > &  exp,
const std::vector< double > &  sim,
const double *  par 
)
static

Definition at line 239 of file AtMCFission.cxx.

◆ ObjectiveChargeDiff2()

double AtMCFission::ObjectiveChargeDiff2 ( const std::vector< double > &  exp,
const std::vector< double > &  sim,
const double *  par 
)
static

Definition at line 256 of file AtMCFission.cxx.

◆ ObjectiveChargePads()

double AtMCFission::ObjectiveChargePads ( const AtFissionEvent expEvent,
int  SimEventID,
AtMCResult def 
)
protected

Gets the max charge of a hit in the experimental event that is associated with a FF (Qmax) Fits the scaling parameter, A to minimize the following (which is the objective funtion)

Chi2 = 1/N \Sum (Q_exp - A*Q_sim)^2/(0.1*Qmax)^2 summing over all good pads in the experimental event.

Definition at line 129 of file AtMCFission.cxx.

◆ ObjectiveFunction()

double AtMCFission::ObjectiveFunction ( const AtBaseEvent expEvent,
int  SimEventID,
AtMCResult definition 
)
overrideprotectedvirtual

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

Implements MCFitter::AtMCFitter.

Definition at line 108 of file AtMCFission.cxx.

◆ ObjectivePosition() [1/2]

double AtMCFission::ObjectivePosition ( const AtFissionEvent expEvent,
int  SimEventID 
)
protected

Definition at line 318 of file AtMCFission.cxx.

◆ ObjectivePosition() [2/2]

double AtMCFission::ObjectivePosition ( double  uE,
double  sE,
double  uO,
double  sO 
)
protected

Returns \Integral_{-inf}^{inf} (G[uO,sO,x] - G[uE,sE,x])^2 dx Assuming the Gaussain functions have the same area.

The experimental is the expected, the observed is our simulated event

Definition at line 402 of file AtMCFission.cxx.

◆ ObjectivePosition2()

double AtMCFission::ObjectivePosition2 ( double  uE,
double  sE,
double  uO,
double  sO 
)
protected

Returns \Integral_{-inf}^{inf} (G[uO,sO,x] - G[uE,sE,x])^2/G[uE,sE,x] dx Assuming the Gaussain functions are normalized (same area).

The experimental is the expected, the observed is our simulated event

Definition at line 376 of file AtMCFission.cxx.

◆ ObjectivePosition3()

double AtMCFission::ObjectivePosition3 ( double  uE,
double  sE,
double  uO,
double  sO 
)
protected

Returns \Integral_{-inf}^{inf} (G[uO,sO,x] - G[uE,sE,x])^2/G[uE,sE,x] dx Assuming the Gaussain functions have the same height.

The experimental is the expected, the observed is our simulated event

Definition at line 415 of file AtMCFission.cxx.

◆ ObjectivePosition4()

double AtMCFission::ObjectivePosition4 ( double  uE,
double  sE,
double  uO,
double  sO 
)
protected

Returns \Integral_{-inf}^{inf} (G[uO,sO,x] - G[uE,sE,x])^2 dx Assuming the Gaussain functions have the same height.

The experimental is the expected, the observed is our simulated event

Definition at line 389 of file AtMCFission.cxx.

◆ ObjectivePositionPads()

double AtMCFission::ObjectivePositionPads ( const AtFissionEvent expEvent,
int  SimEventID 
)
protected

Definition at line 189 of file AtMCFission.cxx.

◆ SetAmp()

void AtMCFission::SetAmp ( float  amp)

Definition at line 50 of file AtMCFission.cxx.

◆ SetChargeObjective()

void MCFitter::AtMCFission::SetChargeObjective ( ObjectiveFuncCharge  obj)
inline

Definition at line 53 of file AtMCFission.h.

◆ SetCN()

void MCFitter::AtMCFission::SetCN ( Ion  cn)
inline

Definition at line 52 of file AtMCFission.h.

◆ SetMomMagnitude()

void AtMCFission::SetMomMagnitude ( std::array< XYZVector, 2 > &  moms,
double  pTrans 
)
protected

Set the magnitude of the FF momenta in the lab' frame (assume the beam direction points in the Z direction). The transverse momentum (w.r.t. the beam axis) of the fission fragment in the lab frame is the same as in the CoM frame. We can calculate the magnitude of p for a FF by comparing the angle between the beam and FF.

Definition at line 562 of file AtMCFission.cxx.

◆ SetParamDistributions()

void AtMCFission::SetParamDistributions ( const AtPatternEvent event)
overrideprotectedvirtual

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

Implements MCFitter::AtMCFitter.

Definition at line 73 of file AtMCFission.cxx.

◆ SetZRange()

void MCFitter::AtMCFission::SetZRange ( int  Zmin,
int  Zmax 
)
inline

Definition at line 55 of file AtMCFission.h.

◆ SimulateEvent()

TClonesArray AtMCFission::SimulateEvent ( AtMCResult definition)
overrideprotectedvirtual

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

Implements MCFitter::AtMCFitter.

Definition at line 572 of file AtMCFission.cxx.

◆ violaEn()

static double MCFitter::AtMCFission::violaEn ( int  A,
int  Z 
)
inlinestaticprotected

Definition at line 102 of file AtMCFission.h.

Member Data Documentation

◆ fAmp

float MCFitter::AtMCFission::fAmp = 1
protected

Definition at line 46 of file AtMCFission.h.

◆ fCN

Ion MCFitter::AtMCFission::fCN {85, 204}
protected

Definition at line 33 of file AtMCFission.h.

◆ fFitAmp

bool MCFitter::AtMCFission::fFitAmp = true
protected

Definition at line 47 of file AtMCFission.h.

◆ fNominalBeamDir

XYZVector MCFitter::AtMCFission::fNominalBeamDir {11.464, 3.754, 1000}
protected

Average beam direction. We will sample the beam direction as deviations from this vector. Default value taken from Joe's plots in the overleaf on space charge

Definition at line 41 of file AtMCFission.h.

◆ fObjCharge

ObjectiveFuncCharge MCFitter::AtMCFission::fObjCharge {ObjectiveChargeChi2}
protected

Objective function to minimize the difference between A*sim and exp charge curves.

Definition at line 44 of file AtMCFission.h.

◆ fZmax

int MCFitter::AtMCFission::fZmax = 59
protected

Definition at line 37 of file AtMCFission.h.

◆ fZmin

int MCFitter::AtMCFission::fZmin = 26
protected

Definition at line 36 of file AtMCFission.h.


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