Implementation of the gamma tracking and combinator. More...
#include <gamma_tracking.h>
Public Types | |
typedef std::list< int > | ref_t |
collection of integer, ref for "reference of PM" | |
typedef std::list< int >::iterator | ref_it |
collection of integer iterator, ref for "reference of PM" | |
typedef std::list< int > ::const_iterator | ref_const_it |
const collection of integer iterator, ref for "reference of PM" | |
typedef std::list< std::list < int > > | refcoll_t |
2D collection of integer, ref for "reference of PM" | |
typedef std::list< std::list < int > >::iterator | refcoll_it |
2D collection of integer iterator, ref for "reference of PM" | |
typedef std::list< std::list < int > >::const_iterator | refcoll_const_it |
2D const collection of integer iterator, ref for "reference of PM" | |
Public Member Functions | |
gamma_tracking () | |
Default constructor. | |
gamma_tracking (const gamma_tracking &) | |
Copy constructor. | |
~gamma_tracking () | |
Default destructor. | |
bool | has_tracks () |
Check if contains calculated tracks. | |
void | Add (int number1_) |
Just add standalone gamma. | |
void | AddProb (int number1_, int number2_, double proba_) |
Add 2 ref number combinaison with a proba in [0,1]. | |
void | AddChi2 (int number1_, int number2_, double chi2_) |
Add 2 ref number combinaison with a proba in [0,inf]. | |
void | AddStart (int number_) |
Add prestart. | |
void | Print () |
cout information about current gamma tracking (old) | |
void | Count () |
Counter of the current gamma tracking (old) | |
void | FillIt (TH2 *h_) |
TH2 filling nb scins VS proba (old) | |
bool | is_inside (const std::list< int > &check_, const std::list< int > &values_) |
check if an element of gamma_tracking::ref_t values_ is in gamma_tracking::ref_t check_ | |
bool | is_inside (const ref_t &check_, int value_) |
check if value_ is in gamma_tracking::ref_t check_ | |
void | extract (std::list< int > &source_, const std::list< int > &values_) |
erase elements of gamma_tracking::ref_t values_ is in gamma_tracking::ref_t check_ | |
void | put_inside (const std::list< int > &from_, std::list< int > &to_) |
to_ become a unique elements ref_t of from_+to_ | |
void | set_absolute (bool a_) |
if true, only by prob, else by size and then by prob. | |
bool | is_absolute () |
check gamma_tracking::set_absolute | |
void | set_extern (bool e_) |
if true, forbid the starts to be elsewhere than at start | |
bool | is_extern () |
check gamma_tracking::set_extern | |
void | set_prob_min (double min_prob_) |
Set the minimal probability to continue next combinaisons. | |
refcoll_t | GetReflects (double prob_, const ref_t *starts_=NULL, const ref_t *exclude_=NULL, bool deathless_starts_=false) |
Return the results. | |
const refcoll_t & | GetAll () |
Return all calculated combination. | |
double | GetProb (int scin_id1_, int scin_id2_) |
Get the proba between two ref. | |
double | GetProb (const ref_t &scin_ids_) |
Get the proba for a gamma tracked. | |
double | GetChi2 (int scin_id1_, int scin_id2_) |
Get the chi square between two ref. | |
double | GetChi2 (ref_t &scin_ids_) |
Get the chi square for a gamma tracked. | |
void | SortProb (std::list< std::list< int > > &list_) |
Classify a 2D ref_t in order of size and proba. Depend on __absolute. | |
double | GetChiLimit (unsigned int) |
Get the chi square limit of __min_prob depend on degree of freedom. | |
void | Combine () |
Main calculation before the gamma_tracking::GetReflects. | |
void | Flush () |
Reset the gamma tracking. | |
Static Public Member Functions | |
static bool | SortReflect (ref_t &ref1_, ref_t &ref2_) |
Classify the two ref_t in order of size and proba. Depend on __absolute. | |
static long | factorial (int x) |
Tool to calculate each factorial only once. | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar_, const unsigned int version_) |
Private Attributes | |
bool | __absolute |
Prefer probability rather than size of gamma tracked. | |
bool | __extern |
Impose starts in the gamma tracked, not elsewhere. | |
int | __max |
Maximum size of a gamma tracked. | |
double | __min_prob |
minimal probability to continue the combinating | |
ref_t | __starts |
start collections (pre and post) | |
refcoll_t | __serie |
The full gamma tracked combinaisons. | |
std::map< int, double > | __min_chi2 |
dictionnary of chi squares : deg of freedom: size-1 VS the chi2 | |
std::map< std::list< int > *,double > | __chi2 |
Dictionnary of chi square based on gamma tracked pointer. | |
std::map< std::list< int > *,double > | __proba |
Dictionnary of probabilities based on gamma tracked pointer. | |
pthread_mutex_t | __mutex |
used for ROOT protection against multithreading | |
Static Private Attributes | |
static std::map< long, double > | __fact |
Factorial kept. | |
Friends | |
class | boost::serialization::access |
Implementation of the gamma tracking and combinator.
2011-2012 Hugon Christophe CENBG
The gamma tracking object is a combinator of integers in fonction of doubles. The integers represents PMs or vertexes number, the doubles are probabilities calculations.
It can give the longest combinaison or the one which has the highest probability. It need an external probability calculator (tof_tools for NAT++) which is able to gives the probability between two PMs, and then it calculate the combinaisons with chi square probabilies with (NbPMs-1) degrees of freedom.
The most standard usage is :
gamma_tracking gt; gt.AddProb (PM1, PM2, prob1); gt.AddProb (PM2, PM3, prob2); gt.AddProb (PM1, PM3, prob3); [...] gt.Combine (); refcoll_t gamma_tracked_coll=gt.GetReflects (lowest_prob);
void nemo3::gamma_tracking::Add | ( | int | number1_ | ) |
Just add standalone gamma.
For complete gamma tracking, gamma_tracking::GetReflect gives also alone gammas
void nemo3::gamma_tracking::AddStart | ( | int | number_ | ) |
Add prestart.
It impose starts during combinaison. Faster calculations, but less reliable than postarts.
void nemo3::gamma_tracking::Combine | ( | ) |
Main calculation before the gamma_tracking::GetReflects.
Calculate all of the possible combinaisons of gamma tracked in the limit of gamma_tracking::min_prob. If there is prestart gamma_tracking::starts, it does the calculation only for combinaisons which starts with __starts.
const refcoll_t& nemo3::gamma_tracking::GetAll | ( | ) | [inline] |
refcoll_t nemo3::gamma_tracking::GetReflects | ( | double | prob_, |
const ref_t * | starts_ = NULL , |
||
const ref_t * | exclude_ = NULL , |
||
bool | deathless_starts_ = false |
||
) |
Return the results.
\param starts_ is the post start ref_t. After calculation, the function will return only gamma tracked starting with starts_. \param exclude_ is the ref_t to exclude from the calculations, and so, from the final result. \param deathless_starts_ means that the starts can be used in all gt. Usefull if starts represents vertexes instead of PM numbers. \par Attributes:
gamma_tracking::extern allow only gamma tracked with starts, no elswhere
gamma_tracking::starts will be merged with starts_, and will be taken in care with extern and other
friend class boost::serialization::access [friend] |