#include <TimeBinning.h>
|
| TimeBinning (const std::vector< double > &, HadronicParameters::BinningPtr, double) |
|
| TimeBinning (const std::string &, const std::string &fname="") |
|
virtual | ~TimeBinning () |
|
void | add (IDalitzEvent &, int, double, double weight=1.) |
|
HadronicParameters::BinningPtr | phaseBinning () const |
|
int | timeBin (double) const |
|
void | Print (const std::string &, std::ostream &os=std::cout) const |
|
void | write (const std::string &, const std::string &) const |
|
double | chiSquared (unsigned, unsigned, double, double) const |
|
unsigned | nBinsTime () const |
|
unsigned | nBinsPhase () const |
|
const Bin & | integratedBin (unsigned) const |
|
const Bin & | bin (unsigned, unsigned) const |
|
const Bin & | binBar (unsigned, unsigned) const |
|
std::deque< TH1F > | plotVsTime (const std::string &, unsigned, int) const |
|
std::deque< std::deque< TH1F > > | plotsVsTime (const std::string &) const |
|
void | savePlotsVsTime (const std::string &, TFile &) const |
|
double | meanUnmixedTime (unsigned) const |
|
double | meanUnmixedTime2 (unsigned) const |
|
void | setLifetime (double) |
|
double | getLifetime () const |
|
bool | isConsistent (const TimeBinning &) const |
| Check that two TimeBinnings use the same binning scheme. More...
|
|
TimeBinning | operator+ (TimeBinning) const |
|
TimeBinning & | operator+= (const TimeBinning &) |
|
Definition at line 12 of file TimeBinning.h.
◆ Bins
◆ Bins2D
◆ TimeBinning() [1/2]
◆ TimeBinning() [2/2]
TimeBinning::TimeBinning |
( |
const std::string & |
, |
|
|
const std::string & |
fname = "" |
|
) |
| |
◆ ~TimeBinning()
virtual TimeBinning::~TimeBinning |
( |
| ) |
|
|
inlinevirtual |
◆ _bin()
◆ _binBar()
TimeBinning::Bin & TimeBinning::_binBar |
( |
unsigned |
iTimeBin, |
|
|
unsigned |
iPhaseBin |
|
) |
| |
|
private |
◆ _integratedBin()
◆ add()
void TimeBinning::add |
( |
IDalitzEvent & |
evt, |
|
|
int |
tag, |
|
|
double |
t, |
|
|
double |
weight = 1. |
|
) |
| |
Definition at line 229 of file TimeBinning.cpp.
234 bool isPlus = phaseBin > 0 ;
236 _bin(timeBinNo, abs(phaseBin)).
add(t, isPlus, weight) ;
240 _binBar(timeBinNo, abs(phaseBin)).
add(t, isPlus, weight) ;
int timeBin(double) const
Bin & _binBar(unsigned, unsigned)
HadronicParameters::BinningPtr m_phaseBinning
Bin & _bin(unsigned, unsigned)
Bin & _integratedBin(unsigned)
void add(double, bool, double weight=1.)
◆ bin()
const TimeBinning::Bin & TimeBinning::bin |
( |
unsigned |
iTimeBin, |
|
|
unsigned |
iPhaseBin |
|
) |
| const |
◆ binBar()
const TimeBinning::Bin & TimeBinning::binBar |
( |
unsigned |
iTimeBin, |
|
|
unsigned |
iPhaseBin |
|
) |
| const |
◆ chiSquared()
double TimeBinning::chiSquared |
( |
unsigned |
iTimeBin, |
|
|
unsigned |
iPhaseBin, |
|
|
double |
Rplus, |
|
|
double |
Rminus |
|
) |
| const |
Definition at line 245 of file TimeBinning.cpp.
const Bin & binBar(unsigned, unsigned) const
const Bin & bin(unsigned, unsigned) const
double chiSquared(double) const
◆ getLifetime()
double TimeBinning::getLifetime |
( |
| ) |
const |
◆ integratedBin()
◆ isConsistent()
bool TimeBinning::isConsistent |
( |
const TimeBinning & |
other | ) |
const |
Check that two TimeBinnings use the same binning scheme.
Definition at line 366 of file TimeBinning.cpp.
HadronicParameters::BinningPtr m_phaseBinning
std::vector< double > m_meant2
std::vector< double > m_meant
std::vector< double > m_timeBins
◆ meanUnmixedTime()
double TimeBinning::meanUnmixedTime |
( |
unsigned |
ibin | ) |
const |
◆ meanUnmixedTime2()
double TimeBinning::meanUnmixedTime2 |
( |
unsigned |
ibin | ) |
const |
◆ nBinsPhase()
unsigned TimeBinning::nBinsPhase |
( |
| ) |
const |
Definition at line 254 of file TimeBinning.cpp.
HadronicParameters::BinningPtr m_phaseBinning
◆ nBinsTime()
unsigned TimeBinning::nBinsTime |
( |
| ) |
const |
◆ operator+()
◆ operator+=()
Definition at line 390 of file TimeBinning.cpp.
392 throw std::invalid_argument(
"Attempt to combine incompatible TimeBinning instances!");
396 for(
unsigned iTimeBin = 0; iTimeBin <
nBinsTime(); ++iTimeBin){
398 for(
unsigned iPhaseBin = 0; iPhaseBin <
nBinsPhase(); ++iPhaseBin){
399 m_bins.at(iTimeBin).at(iPhaseBin) += other.
m_bins.at(iTimeBin).at(iPhaseBin);
unsigned nBinsPhase() const
bool isConsistent(const TimeBinning &) const
Check that two TimeBinnings use the same binning scheme.
unsigned nBinsTime() const
◆ phaseBinning()
Definition at line 218 of file TimeBinning.cpp.
HadronicParameters::BinningPtr m_phaseBinning
◆ plotsVsTime()
deque< deque< TH1F > > TimeBinning::plotsVsTime |
( |
const std::string & |
| ) |
const |
Definition at line 308 of file TimeBinning.cpp.
309 deque<deque<TH1F> > histos ;
310 for(
unsigned iphase = 1 ; iphase <
m_phaseBinning->nBins + 1 ; ++iphase){
311 histos.push_back(deque<TH1F>()) ;
312 deque<TH1F>& binhistos = histos.back() ;
313 for(
int tag = -1 ; tag < 2 ; tag += 2){
314 deque<TH1F> taghistos =
plotVsTime(name, iphase, tag) ;
315 binhistos.insert(binhistos.end(), taghistos.begin(), taghistos.end()) ;
317 TH1F rdiff(binhistos.back()) ;
318 string rdiffname(
Bin::getName(name +
"_phase", iphase) +
"ratiodiff") ;
319 rdiff.SetName(rdiffname.c_str()) ;
320 rdiff.Add(&binhistos[2], -1.) ;
321 binhistos.push_back(rdiff) ;
std::deque< TH1F > plotVsTime(const std::string &, unsigned, int) const
static std::string getName(const std::string &, unsigned)
HadronicParameters::BinningPtr m_phaseBinning
◆ plotVsTime()
deque< TH1F > TimeBinning::plotVsTime |
( |
const std::string & |
, |
|
|
unsigned |
, |
|
|
int |
|
|
) |
| const |
Definition at line 282 of file TimeBinning.cpp.
285 string name =
Bin::getName(_name +
"_" + stag.str() +
"_phase", phaseBin) ;
290 for(
unsigned i = 1 ; i <
nBinsTime()+1 ; ++i) {
291 const Bin& pbin = tag > 0 ?
bin(i-1, phaseBin) :
binBar(i-1, phaseBin) ;
292 hplus.SetBinContent(i, pbin.nPlus()) ;
293 hplus.SetBinError(i, pbin.nPlusErr()) ;
294 hminus.SetBinContent(i, pbin.nMinus()) ;
295 hminus.SetBinError(i, pbin.nMinusErr()) ;
296 double r = pbin.
nPlus() > 0. ? pbin.nMinus()/pbin.nPlus() : 0. ;
297 double rerr = r > 0 && pbin.nMinus() > 0 ? r * sqrt(pow(pbin.nPlusErr()/pbin.nPlus(), 2) + pow(pbin.nMinusErr()/pbin.nMinus(), 2)) : 0. ;
298 hr.SetBinContent(i, r) ;
299 hr.SetBinError(i, rerr) ;
302 histos.push_back(hplus) ;
303 histos.push_back(hminus) ;
304 histos.push_back(hr) ;
static std::string getName(const std::string &, unsigned)
const Bin & binBar(unsigned, unsigned) const
const Bin & bin(unsigned, unsigned) const
std::vector< double > m_timeBins
unsigned nBinsTime() const
◆ Print()
void TimeBinning::Print |
( |
const std::string & |
, |
|
|
std::ostream & |
os = std::cout |
|
) |
| const |
Definition at line 189 of file TimeBinning.cpp.
191 os << name <<
"_timeBins" ;
195 os << name <<
"_lifetime\t" <<
m_lifetime << endl ;
196 string nameint = name +
"_int" ;
197 string nameplus = name +
"_plus" ;
198 string nameminus = name +
"_minus" ;
199 for(
unsigned iTimeBin = 0 ; iTimeBin <
nBinsTime() ; ++iTimeBin){
200 m_binsInt[iTimeBin].Print(nameint, iTimeBin, os) ;
201 string nameplusbin =
Bin::getName(nameplus +
"_time", iTimeBin) +
"phase" ;
202 string nameminusbin =
Bin::getName(nameminus +
"_time", iTimeBin) +
"phase" ;
203 for(
unsigned iPhaseBin = 1 ; iPhaseBin <
m_phaseBinning->nBins + 1; ++iPhaseBin){
204 bin(iTimeBin, iPhaseBin).
Print(nameplusbin, iPhaseBin, os) ;
205 binBar(iTimeBin, iPhaseBin).
Print(nameminusbin, iPhaseBin, os) ;
static std::string getName(const std::string &, unsigned)
const Bin & binBar(unsigned, unsigned) const
void Print(const std::string &, unsigned, std::ostream &os=std::cout) const
HadronicParameters::BinningPtr m_phaseBinning
const Bin & bin(unsigned, unsigned) const
std::vector< double > m_timeBins
unsigned nBinsTime() const
◆ savePlotsVsTime()
void TimeBinning::savePlotsVsTime |
( |
const std::string & |
, |
|
|
TFile & |
|
|
) |
| const |
Definition at line 326 of file TimeBinning.cpp.
329 for(
auto& binhistos : histos)
330 for(
auto& histo : binhistos)
std::deque< std::deque< TH1F > > plotsVsTime(const std::string &) const
◆ setLifetime()
void TimeBinning::setLifetime |
( |
double |
lifetime | ) |
|
Definition at line 345 of file TimeBinning.cpp.
347 for(
unsigned ibin = 0 ; ibin <
nBinsTime() ; ++ibin){
std::vector< double > m_meant2
virtual double unmixedTimeMoment(unsigned, double, int) const
std::vector< double > m_meant
unsigned nBinsTime() const
◆ timeBin()
int TimeBinning::timeBin |
( |
double |
t | ) |
const |
Definition at line 222 of file TimeBinning.cpp.
223 for(
unsigned i = 0 ; i <
nBinsTime() ; ++i)
std::vector< double > m_timeBins
unsigned nBinsTime() const
◆ unmixedTimeMoment()
double TimeBinning::unmixedTimeMoment |
( |
unsigned |
ibin, |
|
|
double |
lifetime, |
|
|
int |
moment |
|
) |
| const |
|
privatevirtual |
Definition at line 334 of file TimeBinning.cpp.
337 double norm = exp(-tmin/lifetime) - exp(-tmax/lifetime) ;
338 double timeMoment = (pow(tmin, moment) * exp(-tmin/lifetime) - pow(tmax, moment) * exp(-tmax/lifetime))/norm ;
virtual double unmixedTimeMoment(unsigned, double, int) const
std::vector< double > m_timeBins
◆ write()
void TimeBinning::write |
( |
const std::string & |
, |
|
|
const std::string & |
|
|
) |
| const |
Definition at line 211 of file TimeBinning.cpp.
213 outfile.open(fname) ;
214 Print(name, outfile) ;
void Print(const std::string &, std::ostream &os=std::cout) const
◆ m_bins
◆ m_binsBar
◆ m_binsInt
Bins TimeBinning::m_binsInt |
|
private |
◆ m_lifetime
double TimeBinning::m_lifetime |
|
private |
◆ m_meant
std::vector<double> TimeBinning::m_meant |
|
private |
◆ m_meant2
std::vector<double> TimeBinning::m_meant2 |
|
private |
◆ m_phaseBinning
◆ m_timeBins
std::vector<double> TimeBinning::m_timeBins |
|
private |
The documentation for this class was generated from the following files: