ATLAS Offline Software
|
A structure to contain data associated with the calibration of a certain sub-module. More...
#include <Calibrator.h>
Public Member Functions | |
Calibrator () | |
Calibrator (int, const std::string &, int, int, const std::string &, const std::string &, float) | |
Constructor. More... | |
Calibrator (const Calibrator &)=delete | |
Calibrator & | operator= (const Calibrator &)=delete |
~Calibrator () | |
Destructor. More... | |
int | Simple1dHist (float, float, int, float) |
A 1D histograming function. More... | |
int | Simple2dHist (float, float, int, float, float, int, float, float) |
A 2D histograming function. More... | |
float | AccumulativeMean (float, float, float) |
Increments a single bin in all three histograms in a sub-module. More... | |
int | AddHit (const std::string &, const databundle &, int *, bool) |
Adds hits to a sub-module either in the form of a single straw hit or a histogram containing all the hits in a single straw. More... | |
TDirectory *Calibrate | ATLAS_NOT_THREAD_SAFE (TDirectory *, std::string, const std::string &, caldata *) |
Creates root histograms, performs the t0 and R-t calibration for a given sub-module and writes the resulting histograms to a root directory tree (if not told otherwise). More... | |
float FitRt | ATLAS_NOT_THREAD_SAFE (const std::string &, const std::string &, TH2F *, TDirectory *) |
Makes the R-t fit. More... | |
float FitTimeResidual | ATLAS_NOT_THREAD_SAFE (const std::string &, TH1F *) |
Makes the time residual fit. More... | |
float FitResidual | ATLAS_NOT_THREAD_SAFE (const std::string &, TH1F *) |
Makes the residual fit. More... | |
void | WriteStat (TDirectory *) |
Creates an ntuple with entries containing data associated with the sub-modules in a sub level. More... | |
void | DumpConstants () |
std::string | GetBinnedRt (const std::string &) |
std::string | PrintStat () |
Prints some sub-level statistics. More... | |
std::string | PrintInfo () |
bool | HasKey (const std::string &) const |
... More... | |
int | UpdateOldConstants () |
... More... | |
bool | CheckSelection (int) |
Checks if a given sub-module is selected for calibration. More... | |
bool | Skip () |
... More... | |
std::string | GetOptString () const |
Creates a string summarizing what is being done at this sub-level. More... | |
int | GetNDirs () |
... More... | |
std::string | GetSelString () |
Creates a string summarizing which modules are being calibrated at this sub-level. More... | |
float | oldt0 (const std::string &key) |
float | xmean (const std::string &key) |
float | ymean (const std::string &key) |
float | zmean (const std::string &key) |
Public Attributes | |
std::map< std::string, caldata > | data |
A map between the sub-module identifier string and the calibration data structure (caldata) More... | |
bool | dort |
if true an rt fit is made, if false the value from the level above is used More... | |
bool | dot0 |
if true a time residual fit is made, if false the value from the level above is used More... | |
bool | dores |
if true a residual fit is made More... | |
bool | nort |
if true the old rt parameters are copied to the new ones More... | |
bool | not0 |
if true the old t0 valus is copied to the new one More... | |
bool | usebref |
if true chip reference t0 values (offset from board mean) are used More... | |
bool | bequiet |
if true no histograms are written to the root file More... | |
bool | printlog |
if true a log entry is prined for each sub-modile in this sub-level More... | |
bool | printt0 |
if true a t0 entry in the calibration output file is prined for each sub-module in this sub-level More... | |
bool | printrt |
if true an rt entry in the calibration output file is prined for each sub-module in this sub-level More... | |
bool | usep0 |
if true the 0th order coeficcient of the rt fit function is not set to 0 in the calibration output file More... | |
bool | floatp3 |
if true the 3rd order coeficcient of the rt fit function is not fixed to 0 More... | |
bool | useshortstraws |
if true a shift of -0.75 ns is applied for straws in layer ==0, strawlayer < 9, and when doing calibration in a granuralyty different from chip or straw More... | |
std::set< int > | selection |
a set containing the sub-modules to be calibrated More... | |
int | level |
the sub-level of the Calibrator instance More... | |
Private Attributes | |
std::string | m_name |
The name of the Calibrator instance. More... | |
std::string | m_rtbinning |
The direction to do the R-t binning. More... | |
int | m_minrtstat |
minimum number of hits in a sub-module required to do an R-t calibration More... | |
int | m_mint0stat |
minimum number of hits in a sub-module required to do a t0 calibration More... | |
float | m_t0shift |
the t0 shift More... | |
int | m_nbinsr |
number of r-bins in the 2D rt histogram More... | |
int | m_nbinst |
number of t-bins in the 2D rt histogram More... | |
int | m_nbinstres |
number of bins in the 1D time residual histogram More... | |
int | m_nbinsres |
number of bins in the 1D residual histogram More... | |
float | m_minr |
lower limit of r in 2D rt histogram More... | |
float | m_maxr |
upper limit of r in 2D rt histogram More... | |
float | m_mint |
lower limit of t in 2D rt histogram More... | |
float | m_maxt |
upper limit of t in 2D rt histogram More... | |
float | m_mintres |
lower limit of 1D time residual histogram More... | |
float | m_maxtres |
upper limit of 1D time residual histogram More... | |
float | m_minres |
lower limit of 1D residual histogram More... | |
float | m_maxres |
upper limit of 1D residual histogram More... | |
std::map< std::string, TDirectory * > | m_hdirs |
... More... | |
std::map< std::string, TH1F * > | m_resHists |
... More... | |
std::map< std::string, TH1F * > | m_tresHists |
... More... | |
std::map< std::string, TH2F * > | m_rtHists |
... More... | |
int | m_ntreshits |
... More... | |
int | m_nreshits |
... More... | |
int | m_nrthits |
... More... | |
int | m_nhits |
... More... | |
bool | m_isdines |
true if the rt relation is Dines' More... | |
A structure to contain data associated with the calibration of a certain sub-module.
An instance of this class is created for each sub-level of the TRT by the TRTCalibrator. It contains three histograms for each sub-module in the level:
The histograms are inside a caldata structure which also contains other variables with information about the calibration of a sub-module. There is one caldata instance for each sub-module in the level. They are contained in a map (Calibrator::data) with a key string which identifies the sub-module.
Methods exists for adding hits to the histograms (Calibrator::AddHits) and for fitting them (Calibrator::Calibrate).
Definition at line 178 of file Calibrator.h.
Calibrator::Calibrator | ( | ) |
Definition at line 339 of file Calibrator.cxx.
Calibrator::Calibrator | ( | int | lev, |
const std::string & | nme, | ||
int | mint0, | ||
int | minrt, | ||
const std::string & | rtr, | ||
const std::string & | rtb, | ||
float | t0sft | ||
) |
Constructor.
[in] | lev | sub level number 0=TRT 1=barrel/ec 2=layer 3=phi-module 4=board 5=chip 6=straw |
[in] | nme | the name of the calibrator |
[in] | mint0 | minimum number of hits in a sub-module required to do a t0 calibration |
[in] | minrt | minimum number of hits in a sub-module required to do an rt calibration |
[in] | rtr | which rt-relation to use |
[in] | rtb | which rt binning to use |
Definition at line 384 of file Calibrator.cxx.
|
delete |
Calibrator::~Calibrator | ( | ) |
float Calibrator::AccumulativeMean | ( | float | n, |
float | oldmean, | ||
float | newvalue | ||
) |
Increments a single bin in all three histograms in a sub-module.
[in] | key | the identifier of the histogram |
[in] | d | the databundle containing single straw hit data |
Definition at line 447 of file Calibrator.cxx.
int Calibrator::AddHit | ( | const std::string & | key, |
const databundle & | d, | ||
int * | binhist, | ||
bool | makehist | ||
) |
Adds hits to a sub-module either in the form of a single straw hit or a histogram containing all the hits in a single straw.
[in] | key | the identifier of the sub-module |
[in] | d | the databundle containing single straw hit data |
[in] | binhist | an integer arry containing the histogram data for a single straw |
Definition at line 962 of file Calibrator.cxx.
float FitRt Calibrator::ATLAS_NOT_THREAD_SAFE | ( | const std::string & | , |
const std::string & | , | ||
TH2F * | , | ||
TDirectory * | |||
) |
Makes the R-t fit.
[in] | key | the identifier of the sub-module to calibrate |
[in] | rtHist | the 2D root histogram with the R-t data |
float FitTimeResidual Calibrator::ATLAS_NOT_THREAD_SAFE | ( | const std::string & | , |
TH1F * | |||
) |
Makes the time residual fit.
[in] | key | the identifier of the sub-module to calibrate |
[in] | tresHist | the 1D root histogram with the time residuals |
float FitResidual Calibrator::ATLAS_NOT_THREAD_SAFE | ( | const std::string & | , |
TH1F * | |||
) |
Makes the residual fit.
[in] | key | the identifier of the sub-module to calibrate |
[in] | resHist | the 1D root histogram with the residuals |
TDirectory* Calibrate Calibrator::ATLAS_NOT_THREAD_SAFE | ( | TDirectory * | , |
std::string | , | ||
const std::string & | , | ||
caldata * | |||
) |
Creates root histograms, performs the t0 and R-t calibration for a given sub-module and writes the resulting histograms to a root directory tree (if not told otherwise).
The new t0 values are calculated here.
[in] | dir | the root directory of the sub level above |
[in] | key | the identifier of the sub-module to calibrate |
[in] | caldata_above | the caldata object from the sub-module above the one to be calibrated |
bool Calibrator::CheckSelection | ( | int | level | ) |
Checks if a given sub-module is selected for calibration.
[in] | level | the number of the sub-module to check |
Definition at line 457 of file Calibrator.cxx.
void Calibrator::DumpConstants | ( | ) |
Definition at line 1225 of file Calibrator.cxx.
std::string Calibrator::GetBinnedRt | ( | const std::string & | key | ) |
Definition at line 514 of file Calibrator.cxx.
int Calibrator::GetNDirs | ( | ) |
std::string Calibrator::GetOptString | ( | ) | const |
Creates a string summarizing what is being done at this sub-level.
Definition at line 485 of file Calibrator.cxx.
std::string Calibrator::GetSelString | ( | ) |
Creates a string summarizing which modules are being calibrated at this sub-level.
Definition at line 506 of file Calibrator.cxx.
bool Calibrator::HasKey | ( | const std::string & | key | ) | const |
...
Definition at line 452 of file Calibrator.cxx.
|
inline |
|
delete |
std::string Calibrator::PrintInfo | ( | ) |
std::string Calibrator::PrintStat | ( | ) |
Prints some sub-level statistics.
Definition at line 478 of file Calibrator.cxx.
int Calibrator::Simple1dHist | ( | float | min, |
float | max, | ||
int | nbins, | ||
float | value | ||
) |
A 1D histograming function.
[in] | min | histogram lower limit |
[in] | max | histogram upper limit |
[in] | nbins | nymber of bins |
[in] | value | the value |
Definition at line 432 of file Calibrator.cxx.
int Calibrator::Simple2dHist | ( | float | minx, |
float | maxx, | ||
int | nbinsx, | ||
float | miny, | ||
float | maxy, | ||
int | nbinsy, | ||
float | valuex, | ||
float | valuey | ||
) |
A 2D histograming function.
[in] | minx | histogram lower x-limit |
[in] | maxx | histogram upper x-limit |
[in] | nbinsx | nymber of x bins |
[in] | valuex | the x value |
[in] | miny | histogram lower y-limit |
[in] | maxy | histogram upper y-limit |
[in] | nbinsy | nymber of y bins |
[in] | valuey | the y value |
Definition at line 439 of file Calibrator.cxx.
bool Calibrator::Skip | ( | ) |
...
Definition at line 462 of file Calibrator.cxx.
int Calibrator::UpdateOldConstants | ( | ) |
void Calibrator::WriteStat | ( | TDirectory * | dir | ) |
Creates an ntuple with entries containing data associated with the sub-modules in a sub level.
[in] | dir | the root directory where to write the ntuple |
Definition at line 1180 of file Calibrator.cxx.
|
inline |
|
inline |
|
inline |
bool Calibrator::bequiet |
if true no histograms are written to the root file
Definition at line 347 of file Calibrator.h.
std::map<std::string,caldata> Calibrator::data |
A map between the sub-module identifier string and the calibration data structure (caldata)
Definition at line 339 of file Calibrator.h.
bool Calibrator::dores |
if true a residual fit is made
Definition at line 343 of file Calibrator.h.
bool Calibrator::dort |
if true an rt fit is made, if false the value from the level above is used
Definition at line 341 of file Calibrator.h.
bool Calibrator::dot0 |
if true a time residual fit is made, if false the value from the level above is used
Definition at line 342 of file Calibrator.h.
bool Calibrator::floatp3 |
if true the 3rd order coeficcient of the rt fit function is not fixed to 0
Definition at line 352 of file Calibrator.h.
int Calibrator::level |
the sub-level of the Calibrator instance
Definition at line 355 of file Calibrator.h.
|
private |
...
Definition at line 376 of file Calibrator.h.
|
private |
true if the rt relation is Dines'
Definition at line 388 of file Calibrator.h.
|
private |
upper limit of r in 2D rt histogram
Definition at line 369 of file Calibrator.h.
|
private |
upper limit of 1D residual histogram
Definition at line 375 of file Calibrator.h.
|
private |
upper limit of t in 2D rt histogram
Definition at line 371 of file Calibrator.h.
|
private |
upper limit of 1D time residual histogram
Definition at line 373 of file Calibrator.h.
|
private |
lower limit of r in 2D rt histogram
Definition at line 368 of file Calibrator.h.
|
private |
lower limit of 1D residual histogram
Definition at line 374 of file Calibrator.h.
|
private |
minimum number of hits in a sub-module required to do an R-t calibration
Definition at line 361 of file Calibrator.h.
|
private |
lower limit of t in 2D rt histogram
Definition at line 370 of file Calibrator.h.
|
private |
minimum number of hits in a sub-module required to do a t0 calibration
Definition at line 362 of file Calibrator.h.
|
private |
lower limit of 1D time residual histogram
Definition at line 372 of file Calibrator.h.
|
private |
The name of the Calibrator instance.
Definition at line 359 of file Calibrator.h.
|
private |
number of r-bins in the 2D rt histogram
Definition at line 364 of file Calibrator.h.
|
private |
number of bins in the 1D residual histogram
Definition at line 367 of file Calibrator.h.
|
private |
number of t-bins in the 2D rt histogram
Definition at line 365 of file Calibrator.h.
|
private |
number of bins in the 1D time residual histogram
Definition at line 366 of file Calibrator.h.
|
private |
...
Definition at line 384 of file Calibrator.h.
|
private |
...
Definition at line 382 of file Calibrator.h.
|
private |
...
Definition at line 383 of file Calibrator.h.
|
private |
...
Definition at line 381 of file Calibrator.h.
|
private |
...
Definition at line 377 of file Calibrator.h.
|
private |
The direction to do the R-t binning.
Definition at line 360 of file Calibrator.h.
|
private |
...
Definition at line 379 of file Calibrator.h.
|
private |
the t0 shift
Definition at line 363 of file Calibrator.h.
|
private |
...
Definition at line 378 of file Calibrator.h.
bool Calibrator::nort |
if true the old rt parameters are copied to the new ones
Definition at line 344 of file Calibrator.h.
bool Calibrator::not0 |
if true the old t0 valus is copied to the new one
Definition at line 345 of file Calibrator.h.
bool Calibrator::printlog |
if true a log entry is prined for each sub-modile in this sub-level
Definition at line 348 of file Calibrator.h.
bool Calibrator::printrt |
if true an rt entry in the calibration output file is prined for each sub-module in this sub-level
Definition at line 350 of file Calibrator.h.
bool Calibrator::printt0 |
if true a t0 entry in the calibration output file is prined for each sub-module in this sub-level
Definition at line 349 of file Calibrator.h.
std::set<int> Calibrator::selection |
a set containing the sub-modules to be calibrated
Definition at line 354 of file Calibrator.h.
bool Calibrator::usebref |
if true chip reference t0 values (offset from board mean) are used
Definition at line 346 of file Calibrator.h.
bool Calibrator::usep0 |
if true the 0th order coeficcient of the rt fit function is not set to 0 in the calibration output file
Definition at line 351 of file Calibrator.h.
bool Calibrator::useshortstraws |
if true a shift of -0.75 ns is applied for straws in layer ==0, strawlayer < 9, and when doing calibration in a granuralyty different from chip or straw
Definition at line 353 of file Calibrator.h.