ATTPCROOT
0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
|
Functions | |
template<typename T > | |
void | SetHistFromData (TH1 &hist, const T &data, double xMin=0, double xMax=0) |
Use contents of data to set the bin contents of hist. More... | |
template<typename Hist = TH1D, typename T > | |
std::unique_ptr< Hist > | CreateHistFromData (const std::string &name, const T &data, double xMin=0, double xMax=0) |
Use contents of data to create a histogram with the given name. More... | |
template<typename T > | |
T | GetMedian (std::vector< T > &vec) |
template<typename T > | |
T * | GetPointer (T &t) |
template<typename T > | |
std::remove_const_t< T > * | GetPointerNonConst (T &t) |
template<typename T > | |
std::vector< const T * > | GetConstPointerVector (const std::vector< T > &vec) |
template<typename T > | |
std::vector< const T * > | GetConstPointerVector (const std::vector< std::unique_ptr< T >> &vec) |
template<typename T > | |
std::vector< T * > | GetPointerVector (const std::vector< T > &vec) |
template<typename T > | |
std::vector< T * > | GetPointerVector (const std::vector< std::unique_ptr< T >> &vec) |
template<typename T > | |
std::vector< T > | GetObjectVector (const std::vector< std::unique_ptr< T >> &vec) |
template<typename T > | |
std::vector< T & > | GetReferenceVector (const std::vector< std::unique_ptr< T >> &vec) |
template<typename T , typename Operator > | |
std::vector< T > | MoveFromVector (std::vector< T > &vec, Operator op) |
std::unique_ptr<Hist> ContainerManip::CreateHistFromData | ( | const std::string & | name, |
const T & | data, | ||
double | xMin = 0 , |
||
double | xMax = 0 |
||
) |
Use contents of data to create a histogram with the given name.
Will resize the historgram to contain data.size() bins, setting the axis according to xMin and xMax. If both are 0, then sets the axis to [0,data.size()]. The returned unique_ptr owns the memory and it will not be cleaned up by root.
Definition at line 42 of file AtContainerManip.h.
std::vector<const T *> ContainerManip::GetConstPointerVector | ( | const std::vector< std::unique_ptr< T >> & | vec | ) |
Definition at line 95 of file AtContainerManip.h.
std::vector<const T *> ContainerManip::GetConstPointerVector | ( | const std::vector< T > & | vec | ) |
Definition at line 85 of file AtContainerManip.h.
T ContainerManip::GetMedian | ( | std::vector< T > & | vec | ) |
Definition at line 57 of file AtContainerManip.h.
std::vector<T> ContainerManip::GetObjectVector | ( | const std::vector< std::unique_ptr< T >> & | vec | ) |
Definition at line 125 of file AtContainerManip.h.
T* ContainerManip::GetPointer | ( | T & | t | ) |
Definition at line 73 of file AtContainerManip.h.
std::remove_const_t<T>* ContainerManip::GetPointerNonConst | ( | T & | t | ) |
Definition at line 79 of file AtContainerManip.h.
std::vector<T *> ContainerManip::GetPointerVector | ( | const std::vector< std::unique_ptr< T >> & | vec | ) |
Definition at line 115 of file AtContainerManip.h.
std::vector<T *> ContainerManip::GetPointerVector | ( | const std::vector< T > & | vec | ) |
Definition at line 105 of file AtContainerManip.h.
std::vector<T &> ContainerManip::GetReferenceVector | ( | const std::vector< std::unique_ptr< T >> & | vec | ) |
Definition at line 135 of file AtContainerManip.h.
std::vector<T> ContainerManip::MoveFromVector | ( | std::vector< T > & | vec, |
Operator | op | ||
) |
Will move elements from the input vector to the output vector if op(elem) returns true Suggested to make op() take a const referance to T so Operator is type bool(const T&)
[in] | op | Operator must have the form bool(T) |
Definition at line 151 of file AtContainerManip.h.
void ContainerManip::SetHistFromData | ( | TH1 & | hist, |
const T & | data, | ||
double | xMin = 0 , |
||
double | xMax = 0 |
||
) |
Use contents of data to set the bin contents of hist.
Will resize the historgram to contain data.size() bins, setting the axis according to xMin and xMax. If both are 0, then sets the axis to [0,data.size()]
Definition at line 24 of file AtContainerManip.h.