|
BmnRoot 26.10.0-210-gc52d34b0
Software framework of the BM@N experiment
|
Histogram manager. More...
#include <BmnHistManager.h>
Public Member Functions | |
| BmnHistManager () | |
| Constructor. | |
| virtual | ~BmnHistManager () |
| Destructor. | |
| void | Add (const TString &name, TNamed *object) |
| Add new named object to manager. | |
| template<class T> | |
| void | Create1 (const TString &name, const TString &title, Int_t nofBins, Double_t minBin, Double_t maxBin) |
| Helper function for creation of 1-dimensional histograms and profiles. | |
| template<class T> | |
| void | Create2 (const TString &name, const TString &title, Int_t nofBinsX, Double_t minBinX, Double_t maxBinX, Int_t nofBinsY, Double_t minBinY, Double_t maxBinY) |
| Helper function for creation of 2-dimensional histograms and profiles. | |
| TH1 * | H1 (const TString &name) const |
| Return pointer to TH1 histogram. | |
| TH2 * | H2 (const TString &name) const |
| Return pointer to TH2 histogram. | |
| Bool_t | Exists (const TString &name) const |
| Check existence of histogram in manager. | |
| void | WriteToFile () |
| Write all histograms to current opened file. | |
| void | ResetHists () |
| Reset all histograms. | |
| void | ReadFromFile (TFile *file) |
| Read histograms from file. | |
| void | Clear () |
| Clear memory. | |
| void | ShrinkEmptyBinsH1 (const TString &histName) |
| Shrink empty bins in H1. | |
| void | ShrinkEmptyBinsH2 (const TString &histName) |
| Shrink empty bins in H2. | |
| void | Scale (const TString &histName, Double_t scale) |
| Scale histogram. | |
| void | NormalizeToIntegral (const TString &histName) |
| Normalize histogram to integral. | |
| void | Rebin (const TString &histName, Int_t ngroup) |
| Rebin histogram. | |
| TString | ToString () const |
| Return string representation of class. | |
| Public Member Functions inherited from TObject | |
| TObject () | |
| TObject (const TObject &object) | |
| virtual | ~TObject () |
| void | AbstractMethod (const char *method) const |
| virtual void | AppendPad (Option_t *option="") |
| virtual void | Browse (TBrowser *b) |
| ULong_t | CheckedHash () |
| virtual const char * | ClassName () const |
| virtual void | Clear (Option_t *="") |
| virtual TObject * | Clone (const char *newname="") const |
| virtual Int_t | Compare (const TObject *obj) const |
| virtual void | Copy (TObject &object) const |
| virtual void | Delete (Option_t *option="") |
| virtual Int_t | DistancetoPrimitive (Int_t px, Int_t py) |
| virtual void | Draw (Option_t *option="") |
| virtual void | DrawClass () const |
| virtual TObject * | DrawClone (Option_t *option="") const |
| virtual void | Dump () const |
| virtual void | Error (const char *method, const char *msgfmt,...) const |
| virtual void | Execute (const char *method, const char *params, Int_t *error=nullptr) |
| virtual void | Execute (TMethod *method, TObjArray *params, Int_t *error=nullptr) |
| virtual void | ExecuteEvent (Int_t event, Int_t px, Int_t py) |
| virtual void | Fatal (const char *method, const char *msgfmt,...) const |
| virtual TObject * | FindObject (const char *name) const |
| virtual TObject * | FindObject (const TObject *obj) const |
| virtual Option_t * | GetDrawOption () const |
| virtual const char * | GetIconName () const |
| virtual const char * | GetName () const |
| virtual char * | GetObjectInfo (Int_t px, Int_t py) const |
| virtual Option_t * | GetOption () const |
| virtual const char * | GetTitle () const |
| virtual UInt_t | GetUniqueID () const |
| virtual Bool_t | HandleTimer (TTimer *timer) |
| virtual ULong_t | Hash () const |
| Bool_t | HasInconsistentHash () const |
| virtual void | Info (const char *method, const char *msgfmt,...) const |
| virtual Bool_t | InheritsFrom (const char *classname) const |
| virtual Bool_t | InheritsFrom (const TClass *cl) const |
| virtual void | Inspect () const |
| void | InvertBit (UInt_t f) |
| virtual TClass * | IsA () const |
| Bool_t | IsDestructed () const |
| virtual Bool_t | IsEqual (const TObject *obj) const |
| virtual Bool_t | IsFolder () const |
| R__ALWAYS_INLINE Bool_t | IsOnHeap () const |
| virtual Bool_t | IsSortable () const |
| R__ALWAYS_INLINE Bool_t | IsZombie () const |
| virtual void | ls (Option_t *option="") const |
| void | MayNotUse (const char *method) const |
| virtual Bool_t | Notify () |
| void | Obsolete (const char *method, const char *asOfVers, const char *removedFromVers) const |
| void | operator delete (void *ptr) |
| void | operator delete (void *ptr, void *vp) |
| void | operator delete[] (void *ptr) |
| void | operator delete[] (void *ptr, void *vp) |
| void * | operator new (size_t sz) |
| void * | operator new (size_t sz, void *vp) |
| void * | operator new[] (size_t sz) |
| void * | operator new[] (size_t sz, void *vp) |
| TObject & | operator= (const TObject &rhs) |
| virtual void | Paint (Option_t *option="") |
| virtual void | Pop () |
| virtual void | Print (Option_t *option="") const |
| virtual Int_t | Read (const char *name) |
| virtual void | RecursiveRemove (TObject *obj) |
| void | ResetBit (UInt_t f) |
| virtual void | SaveAs (const char *filename="", Option_t *option="") const |
| virtual void | SavePrimitive (std::ostream &out, Option_t *option="") |
| void | SetBit (UInt_t f) |
| void | SetBit (UInt_t f, Bool_t set) |
| virtual void | SetDrawOption (Option_t *option="") |
| virtual void | SetUniqueID (UInt_t uid) |
| virtual void | Streamer (TBuffer &) |
| void | StreamerNVirtual (TBuffer &ClassDef_StreamerNVirtual_b) |
| virtual void | SysError (const char *method, const char *msgfmt,...) const |
| R__ALWAYS_INLINE Bool_t | TestBit (UInt_t f) const |
| Int_t | TestBits (UInt_t f) const |
| virtual void | UseCurrentStyle () |
| virtual void | Warning (const char *method, const char *msgfmt,...) const |
| virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) |
| virtual Int_t | Write (const char *name=nullptr, Int_t option=0, Int_t bufsize=0) const |
Private Attributes | |
| map< TString, TNamed * > | fMap |
Friends | |
| std::ostream & | operator<< (std::ostream &strm, const BmnHistManager &histManager) |
| Operator << for convenient output to std::ostream. | |
Additional Inherited Members | |
| Public Types inherited from TObject | |
| enum | EDeprecatedStatusBits |
| enum | EStatusBits |
| Static Public Member Functions inherited from TObject | |
| static TClass * | Class () |
| static const char * | Class_Name () |
| static constexpr Version_t | Class_Version () |
| static const char * | DeclFileName () |
| static Longptr_t | GetDtorOnly () |
| static Bool_t | GetObjectStat () |
| static void | SetDtorOnly (void *obj) |
| static void | SetObjectStat (Bool_t stat) |
| Public Attributes inherited from TObject | |
| kIsOnHeap | |
| kNotDeleted | |
| kZombie | |
| kInconsistent | |
| kBitMask | |
| kSingleKey | |
| kOverwrite | |
| kWriteDelete | |
| kObjInCanvas | |
| kCanDelete | |
| kMustCleanup | |
| kIsReferenced | |
| kHasUUID | |
| kCannotPick | |
| kNoContextMenu | |
| kInvalidObject | |
| Protected Member Functions inherited from TObject | |
| virtual void | DoError (int level, const char *location, const char *fmt, va_list va) const |
| void | MakeZombie () |
| Static Protected Member Functions inherited from TObject | |
| static void | SavePrimitiveConstructor (std::ostream &out, TClass *cl, const char *variable_name, const char *constructor_agrs="", Bool_t empty_line=kTRUE) |
| static void | SavePrimitiveDraw (std::ostream &out, const char *variable_name, Option_t *option=nullptr) |
| static TString | SavePrimitiveVector (std::ostream &out, const char *prefix, Int_t len, Double_t *arr, Bool_t empty_line=kFALSE) |
| Protected Attributes inherited from TObject | |
| kOnlyPrepStep | |
Definition at line 41 of file BmnHistManager.h.
| BmnHistManager::BmnHistManager | ( | ) |
Definition at line 32 of file BmnHistManager.cxx.
References fMap.
Referenced by operator<<.
|
virtual |
Definition at line 36 of file BmnHistManager.cxx.
| [in] | name | Name of the object. |
| [in] | object | Pointer to object. |
Definition at line 59 of file BmnHistManager.h.
References fMap.
Referenced by Create1(), Create2(), and ReadFromFile().
| void BmnHistManager::Clear | ( | ) |
|
inline |
Template argument is a real object type that has to be created, for example, Create1<TH1F>("name", "title", 100, 0, 100);
| [in] | name | Object name. |
| [in] | title | Object title. |
| [in] | nofBins | Number of bins. |
| [in] | minBin | Low axis limit. |
| [in] | maxBin | Upper axis limit. |
Definition at line 76 of file BmnHistManager.h.
References Add(), and TString::Data().
|
inline |
Template argument is a real object type that has to be created, for example, Create2<TH2F>("name", "title", 100, 0, 100, 200, 0, 200);
| [in] | name | Object name. |
| [in] | title | Object title. |
| [in] | nofBinsX | Number of bins for X axis. |
| [in] | minBinX | Low X axis limit. |
| [in] | maxBinX | Upper X axis limit. |
| [in] | nofBinsY | Number of bins for Y axis. |
| [in] | minBinY | Low Y axis limit. |
| [in] | maxBinY | Upper Y axis limit. |
Definition at line 96 of file BmnHistManager.h.
References Add(), and TString::Data().
| [in] | name | Name of histogram. |
Definition at line 142 of file BmnHistManager.h.
References fMap.
Referenced by BmnQaMonitor::GetHistosToBeRegistered().
| [in] | name | Name of histogram. |
Definition at line 114 of file BmnHistManager.h.
References fMap.
Referenced by BmnQaOffline::doHitsDistributions(), BmnPidQaReport::Draw(), BmnTrackingQaReport::DrawEffGem(), BmnLambdaQaReport::DrawGeomEfficiencyHistograms(), BmnTrackingQaReport::DrawMomResGem(), BmnTrackingQaReport::DrawNhitsGem(), BmnLambdaQaReport::DrawNumberOfNotReconstructedLambdasHistograms(), BmnClusteringQaReport::DrawOccupancyByStation(), BmnClusteringQaReport::DrawPullXbyStation(), BmnClusteringQaReport::DrawPullYbyStation(), BmnLambdaQaReport::DrawRecMesonsGeomRecEffHistograms(), BmnLambdaQaReport::DrawRecMesonsReconstructionEfficiencyHistograms(), BmnLambdaQaReport::DrawReconstructedLambdasHistograms(), BmnLambdaQaReport::DrawReconstructionEfficiencyHistograms(), BmnLambdaQaReport::DrawRecProtonsGeomEffHistograms(), BmnLambdaQaReport::DrawRecProtonsReconstructionEfficiencyHistograms(), BmnTrackingQaReport::DrawResAndPull(), BmnSimulationReport::DrawTwoH1(), BmnTrackingQaReport::DrawTwoH1(), BmnTrackingQaReport::DrawVertResGem(), BmnTrackingQaReport::FillAndFitSlice(), BmnQaOffline::GetCommonInfo(), BmnQaOffline::GetCommonInfo(), BmnQaOffline::GetCommonInfo(), BmnQaOffline::GetDistributionOfFiredStrips(), BmnQaMonitor::GetHistosToBeRegistered(), BmnQaOffline::GetMwpcDchInfo(), BmnQaOffline::GetTofInfo(), NormalizeToIntegral(), BmnClusteringQaReport::PrintEventInfo(), BmnLambdaQaReport::PrintEventInfo(), BmnTrackingQaReport::PrintEventInfo(), Rebin(), Scale(), and ShrinkEmptyBinsH1().
| [in] | name | Name of histogram. |
Definition at line 128 of file BmnHistManager.h.
References fMap.
Referenced by BmnTrackingQaReport::Draw(), BmnTrackingQaReport::DrawMomResGem(), BmnClusteringQaReport::DrawOccupancyByStation(), BmnLambdaQaReport::DrawTwoDimensionalRealRecEfficiencyHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRealRecEfficiencyRecMesonsHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRealRecEfficiencyRecProtonsHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRecGeomEfficiencyHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRecMesonsGeomRecEfficiencyHistograms(), BmnLambdaQaReport::DrawTwoDimensionalRecProtonsRecEfficiencyHistograms(), BmnTrackingQaReport::FillAndFitSlice(), BmnQaOffline::GetDistributionOfFiredStripsVsSignal(), and ShrinkEmptyBinsH2().
| void BmnHistManager::NormalizeToIntegral | ( | const TString & | histName | ) |
| [in] | histName | Name of histogram. |
Definition at line 138 of file BmnHistManager.cxx.
References H1(), TH1::Integral(), and TH1::Scale().
| void BmnHistManager::ReadFromFile | ( | TFile * | file | ) |
| [in] | file | Pointer to file with histograms. |
Definition at line 55 of file BmnHistManager.cxx.
References TObject::TObject(), Add(), TGraph2D::Class(), TGraph::Class(), TH1::Class(), TDirectoryFile::Get(), TDirectory::GetListOfKeys(), TNamed::GetName(), TClass::InheritsFrom(), TObject::IsA(), and TKey::ReadObj().
| [in] | histName | Name of histogram. |
| [in] | ngroup | Rebining factor. |
Definition at line 144 of file BmnHistManager.cxx.
References H1(), TH1::Rebin(), and TH1::Scale().
| void BmnHistManager::ResetHists | ( | ) |
Definition at line 46 of file BmnHistManager.cxx.
References TH1::Class(), and fMap.
| [in] | histName | Name of histogram. |
| [in] | scale | Scaling factor. |
Definition at line 133 of file BmnHistManager.cxx.
References H1(), and TH1::Scale().
| void BmnHistManager::ShrinkEmptyBinsH1 | ( | const TString & | histName | ) |
| [in] | histName | Name of histogram. |
Definition at line 84 of file BmnHistManager.cxx.
References TH1::GetBinContent(), TH1::GetNbinsX(), TH1::GetXaxis(), TH1::GetYaxis(), H1(), isSet(), and TAxis::SetRange().
| void BmnHistManager::ShrinkEmptyBinsH2 | ( | const TString & | histName | ) |
| [in] | histName | Name of histogram. |
Definition at line 105 of file BmnHistManager.cxx.
References TH1::GetBinContent(), TH1::GetNbinsX(), TH1::GetNbinsY(), TH1::GetXaxis(), TH1::GetYaxis(), H2(), isSet(), and TAxis::SetRange().
| TString BmnHistManager::ToString | ( | ) | const |
Definition at line 153 of file BmnHistManager.cxx.
References fMap.
Referenced by BmnQaHistoManager::GetListOfHistos(), and operator<<.
| void BmnHistManager::WriteToFile | ( | ) |
Definition at line 38 of file BmnHistManager.cxx.
References fMap.
|
friend |
Definition at line 207 of file BmnHistManager.h.
References BmnHistManager(), and ToString().
Definition at line 215 of file BmnHistManager.h.
Referenced by BmnHistManager(), Add(), Clear(), Exists(), H1(), H2(), ResetHists(), ToString(), and WriteToFile().