Project
Loading...
Searching...
No Matches
o2::tpc::CalibdEdx Class Reference

Class that creates dE/dx histograms from a sequence of tracks objects. More...

#include <CalibdEdx.h>

Public Types

enum  Axis {
  dEdx , Tgl , Snp , Sector ,
  Stack , Charge , Size
}
 
using IntAxis = boost::histogram::axis::integer< int, boost::histogram::use_default, boost::histogram::axis::option::none_t >
 
using FloatAxis = boost::histogram::axis::regular< float, boost::histogram::use_default, boost::histogram::use_default, boost::histogram::axis::option::none_t >
 
using TFIDInfo = o2::dataformats::TFIDInfo
 
using AxesType = std::tuple< FloatAxis, FloatAxis, FloatAxis, IntAxis, IntAxis, IntAxis >
 
using Hist = boost::histogram::histogram< AxesType >
 

Public Member Functions

 CalibdEdx (const CalibdEdx &other)
 copy ctor
 
 CalibdEdx (int dEdxBins=70, float mindEdx=10, float maxdEdx=90, int angularBins=36, bool fitSnp=false)
 
void setCuts (const TrackCuts &cuts)
 
void setApplyCuts (bool apply)
 
bool getApplyCuts () const
 
void setSectorFitThreshold (int minEntries)
 
void set1DFitThreshold (int minEntries)
 
void set2DFitThreshold (int minEntries)
 
int getSectorFitThreshold () const
 
int getTglFitThreshold () const
 
int getSnpFitThreshold () const
 
void setElectronCut (float cut, int passes=3, float lowCutFactor=1.5)
 Params used to remove electron points from the fit. The fit to find the MIP peak will be performed passes times, from the second time and afterwords any points with dEdx values above the previous fit * (1 + cut) and blow previous fit * (1 - lowCutFactor * cut) will be cut out.
 
void setMaterialType (o2::base::Propagator::MatCorrType materialType)
 setting the material type for track propagation
 
void fill (const TrackTPC &tracks)
 Fill histograms using tracks data.
 
void fill (const gsl::span< const TrackTPC >)
 
void fill (const std::vector< TrackTPC > &tracks)
 
void fill (const TFIDInfo &tfid, const gsl::span< const TrackTPC > tracks)
 
void fill (const TFIDInfo &tfid, const std::vector< TrackTPC > &tracks)
 
void merge (const CalibdEdx *other)
 Add counts from another container.
 
void finalize (const bool useGausFits=true)
 
const HistgetHist () const
 Return calib data histogram.
 
THnF * getRootHist () const
 Return calib data as a THn.
 
const CalibdEdxCorrectiongetCalib () const
 
void setCalibrationInput (const CalibdEdxCorrection &calib)
 calibration used during reconstruction
 
const CalibdEdxCorrectiongetCalibrationInput () const
 
int minStackEntries () const
 Return the number of hist entries of the gem stack with less statistics.
 
bool hasEnoughData (float minEntries) const
 Check if there are enough data to compute the calibration.
 
void print () const
 Print statistics info.
 
void writeTTree (std::string_view fileName) const
 Save the histograms to a TTree.
 
void enableDebugOutput (std::string_view fileName)
 Enable debug output to file of the time slots calibrations outputs and dE/dx histograms.
 
void disableDebugOutput ()
 Disable debug output to file. Also writes and closes stored time slots.
 
void finalizeDebugOutput () const
 Write debug output to file.
 
bool hasDebugOutput () const
 
void dumpToFile (const char *outFile, const char *outName) const
 dump this object to a file - the boost histogram is converted to a ROOT histogram -
 
void setSigmaFitRange (const float lowerSigma, const float upperSigma)
 

Static Public Member Functions

static int findTrackSector (const TrackTPC &track, GEMstack, bool &ok)
 Find the sector of a track at a given GEM stack type.
 
static constexpr float scaleTgl (float tgl, GEMstack rocType)
 
static constexpr float recoverTgl (float scaledTgl, GEMstack rocType)
 
static CalibdEdx readFromFile (const char *inFile, const char *inName)
 read the object from a file
 

Static Public Attributes

static constexpr float MipScale = 1.0 / 50.0
 Inverse of target dE/dx value for MIPs.
 

Detailed Description

Class that creates dE/dx histograms from a sequence of tracks objects.

Definition at line 42 of file CalibdEdx.h.

Member Typedef Documentation

◆ AxesType

Definition at line 63 of file CalibdEdx.h.

◆ FloatAxis

using o2::tpc::CalibdEdx::FloatAxis = boost::histogram::axis::regular<float, boost::histogram::use_default, boost::histogram::use_default, boost::histogram::axis::option::none_t>

Definition at line 58 of file CalibdEdx.h.

◆ Hist

using o2::tpc::CalibdEdx::Hist = boost::histogram::histogram<AxesType>

Definition at line 72 of file CalibdEdx.h.

◆ IntAxis

using o2::tpc::CalibdEdx::IntAxis = boost::histogram::axis::integer<int, boost::histogram::use_default, boost::histogram::axis::option::none_t>

Definition at line 56 of file CalibdEdx.h.

◆ TFIDInfo

Member Enumeration Documentation

◆ Axis

Enumerator
dEdx 
Tgl 
Snp 
Sector 
Stack 
Charge 
Size 

Number of axes.

Definition at line 45 of file CalibdEdx.h.

Constructor & Destructor Documentation

◆ CalibdEdx() [1/2]

CalibdEdx::CalibdEdx ( const CalibdEdx other)

copy ctor

Definition at line 62 of file CalibdEdx.cxx.

◆ CalibdEdx() [2/2]

CalibdEdx::CalibdEdx ( int  dEdxBins = 70,
float  mindEdx = 10,
float  maxdEdx = 90,
int  angularBins = 36,
bool  fitSnp = false 
)
Parameters
angularBinsnumber of bins for Tgl and Snp
fitSnpenable Snp correction

Definition at line 49 of file CalibdEdx.cxx.

Member Function Documentation

◆ disableDebugOutput()

void CalibdEdx::disableDebugOutput ( )

Disable debug output to file. Also writes and closes stored time slots.

Definition at line 732 of file CalibdEdx.cxx.

◆ dumpToFile()

void CalibdEdx::dumpToFile ( const char outFile,
const char outName 
) const

dump this object to a file - the boost histogram is converted to a ROOT histogram -

Definition at line 746 of file CalibdEdx.cxx.

◆ enableDebugOutput()

void CalibdEdx::enableDebugOutput ( std::string_view  fileName)

Enable debug output to file of the time slots calibrations outputs and dE/dx histograms.

Definition at line 727 of file CalibdEdx.cxx.

◆ fill() [1/5]

void CalibdEdx::fill ( const gsl::span< const TrackTPC tracks)

Definition at line 168 of file CalibdEdx.cxx.

◆ fill() [2/5]

void o2::tpc::CalibdEdx::fill ( const std::vector< TrackTPC > &  tracks)
inline

Definition at line 115 of file CalibdEdx.h.

◆ fill() [3/5]

void o2::tpc::CalibdEdx::fill ( const TFIDInfo tfid,
const gsl::span< const TrackTPC tracks 
)
inline

Definition at line 117 of file CalibdEdx.h.

◆ fill() [4/5]

void o2::tpc::CalibdEdx::fill ( const TFIDInfo tfid,
const std::vector< TrackTPC > &  tracks 
)
inline

Definition at line 122 of file CalibdEdx.h.

◆ fill() [5/5]

void CalibdEdx::fill ( const TrackTPC tracks)

Fill histograms using tracks data.

Definition at line 84 of file CalibdEdx.cxx.

◆ finalize()

void CalibdEdx::finalize ( const bool  useGausFits = true)

Compute MIP position from dEdx histograms and save result in the correction container. To retrieve the correction call CalibdEdx::getCalib()

Parameters
useGausFitsmake gaussian fits of dEdx vs tgl instead of fitting the mean dEdx

Definition at line 535 of file CalibdEdx.cxx.

◆ finalizeDebugOutput()

void CalibdEdx::finalizeDebugOutput ( ) const

Write debug output to file.

Definition at line 738 of file CalibdEdx.cxx.

◆ findTrackSector()

static int o2::tpc::CalibdEdx::findTrackSector ( const TrackTPC track,
GEMstack  ,
bool &  ok 
)
static

Find the sector of a track at a given GEM stack type.

◆ getApplyCuts()

bool o2::tpc::CalibdEdx::getApplyCuts ( ) const
inline

Definition at line 83 of file CalibdEdx.h.

◆ getCalib()

const CalibdEdxCorrection & o2::tpc::CalibdEdx::getCalib ( ) const
inline

Definition at line 137 of file CalibdEdx.h.

◆ getCalibrationInput()

const CalibdEdxCorrection & o2::tpc::CalibdEdx::getCalibrationInput ( ) const
inline

Definition at line 141 of file CalibdEdx.h.

◆ getHist()

const Hist & o2::tpc::CalibdEdx::getHist ( ) const
inline

Return calib data histogram.

Definition at line 133 of file CalibdEdx.h.

◆ getRootHist()

THnF * CalibdEdx::getRootHist ( ) const

Return calib data as a THn.

Definition at line 615 of file CalibdEdx.cxx.

◆ getSectorFitThreshold()

int o2::tpc::CalibdEdx::getSectorFitThreshold ( ) const
inline

Definition at line 93 of file CalibdEdx.h.

◆ getSnpFitThreshold()

int o2::tpc::CalibdEdx::getSnpFitThreshold ( ) const
inline

Definition at line 95 of file CalibdEdx.h.

◆ getTglFitThreshold()

int o2::tpc::CalibdEdx::getTglFitThreshold ( ) const
inline

Definition at line 94 of file CalibdEdx.h.

◆ hasDebugOutput()

bool o2::tpc::CalibdEdx::hasDebugOutput ( ) const
inline
Returns
if debug output is enabled

Definition at line 169 of file CalibdEdx.h.

◆ hasEnoughData()

bool CalibdEdx::hasEnoughData ( float  minEntries) const

Check if there are enough data to compute the calibration.

Returns
false if any of the GEM stacks has less entries than minEntries

Definition at line 591 of file CalibdEdx.cxx.

◆ merge()

void CalibdEdx::merge ( const CalibdEdx other)

Add counts from another container.

Definition at line 175 of file CalibdEdx.cxx.

◆ minStackEntries()

int CalibdEdx::minStackEntries ( ) const

Return the number of hist entries of the gem stack with less statistics.

Definition at line 581 of file CalibdEdx.cxx.

◆ print()

void CalibdEdx::print ( ) const

Print statistics info.

Definition at line 687 of file CalibdEdx.cxx.

◆ readFromFile()

CalibdEdx CalibdEdx::readFromFile ( const char inFile,
const char inName 
)
static

read the object from a file

Definition at line 754 of file CalibdEdx.cxx.

◆ recoverTgl()

static constexpr float o2::tpc::CalibdEdx::recoverTgl ( float  scaledTgl,
GEMstack  rocType 
)
inlinestaticconstexpr

Definition at line 174 of file CalibdEdx.h.

◆ scaleTgl()

static constexpr float o2::tpc::CalibdEdx::scaleTgl ( float  tgl,
GEMstack  rocType 
)
inlinestaticconstexpr

Definition at line 173 of file CalibdEdx.h.

◆ set1DFitThreshold()

void o2::tpc::CalibdEdx::set1DFitThreshold ( int  minEntries)
inline
Parameters
minEntriesper GEM stack to enable Tgl fit

Definition at line 88 of file CalibdEdx.h.

◆ set2DFitThreshold()

void o2::tpc::CalibdEdx::set2DFitThreshold ( int  minEntries)
inline
Parameters
minEntriesper GEM stack to enable Tgl and Snp fit has no effect if fitSnp = false

Definition at line 91 of file CalibdEdx.h.

◆ setApplyCuts()

void o2::tpc::CalibdEdx::setApplyCuts ( bool  apply)
inline

Definition at line 82 of file CalibdEdx.h.

◆ setCalibrationInput()

void o2::tpc::CalibdEdx::setCalibrationInput ( const CalibdEdxCorrection calib)
inline

calibration used during reconstruction

Definition at line 140 of file CalibdEdx.h.

◆ setCuts()

void o2::tpc::CalibdEdx::setCuts ( const TrackCuts cuts)
inline

Definition at line 81 of file CalibdEdx.h.

◆ setElectronCut()

void o2::tpc::CalibdEdx::setElectronCut ( float  cut,
int  passes = 3,
float  lowCutFactor = 1.5 
)
inline

Params used to remove electron points from the fit. The fit to find the MIP peak will be performed passes times, from the second time and afterwords any points with dEdx values above the previous fit * (1 + cut) and blow previous fit * (1 - lowCutFactor * cut) will be cut out.

Note
you can set passes = 0 to disable this functionality

Definition at line 102 of file CalibdEdx.h.

◆ setMaterialType()

void o2::tpc::CalibdEdx::setMaterialType ( o2::base::Propagator::MatCorrType  materialType)
inline

setting the material type for track propagation

Definition at line 110 of file CalibdEdx.h.

◆ setSectorFitThreshold()

void o2::tpc::CalibdEdx::setSectorFitThreshold ( int  minEntries)
inline
Parameters
minEntriesper GEM stack to enable sector by sector correction. Below this value we only perform one fit per ROC type (IROC, OROC1, ...; no side nor sector information).

Definition at line 86 of file CalibdEdx.h.

◆ setSigmaFitRange()

void CalibdEdx::setSigmaFitRange ( const float  lowerSigma,
const float  upperSigma 
)

set lower and upper range in units of sigma which are used for the gaussian fits

Parameters
lowerSigmalow sigma range
upperSigmaupper sigma range

Definition at line 772 of file CalibdEdx.cxx.

◆ writeTTree()

void CalibdEdx::writeTTree ( std::string_view  fileName) const

Save the histograms to a TTree.

Definition at line 693 of file CalibdEdx.cxx.

Member Data Documentation

◆ MipScale

constexpr float o2::tpc::CalibdEdx::MipScale = 1.0 / 50.0
staticconstexpr

Inverse of target dE/dx value for MIPs.

Definition at line 171 of file CalibdEdx.h.


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