CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Classes | Public Types | Public Member Functions | Private Types | Private Attributes
Book Class Reference

#include <Book.h>

Classes

struct  match_name
 

Public Types

typedef boost::filter_iterator
< match_name,
book_t::const_iterator > 
const_iterator
 
typedef boost::filter_iterator
< match_name, book_t::iterator > 
iterator
 

Public Member Functions

iterator begin (string_t re=".*")
 
const_iterator begin (string_t re=".*") const
 
 Book ()
 
 Book (string_t t)
 
TH1 * book (string_t name, TH1 *const hist)
 
bool empty () const
 
iterator end (string_t re=".*")
 
const_iterator end (string_t re=".*") const
 
void erase (string_t name)
 
void erase (iterator it)
 
void fill (double_t X, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
 
void fill (double_t X, const poly< std::string > &names, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
 
void fill (double_t X, double_t Y, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
 
void fill (double_t X, double_t Y, const poly< std::string > &names, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
 
void fill (double_t X, double_t Y, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, uint_t NbinsY, double_t Ylow, double_t Yup, double_t W=1)
 
void fill (double_t X, double_t Y, const poly< std::string > &names, uint_t NbinsX, double_t Xlow, double_t Xup, uint_t NbinsY, double_t Ylow, double_t Yup, double_t W=1)
 
void fill (double_t X, double_t Y, double_t Z, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, uint_t NbinsY, double_t Ylow, double_t Yup, uint_t NbinsZ, double_t Zlow, double_t Zup, double_t W=1)
 
void fill (double_t X, double_t Y, double_t Z, const poly< std::string > &names, uint_t NbinsX, double_t Xlow, double_t Xup, uint_t NbinsY, double_t Ylow, double_t Yup, uint_t NbinsZ, double_t Zlow, double_t Zup, double_t W=1)
 
std::pair< iterator, iteratorfilter_range (string_t re=".*")
 
std::pair< const_iterator,
const_iterator
filter_range (string_t re=".*") const
 
iterator find (string_t name, string_t re=".*")
 
const_iterator find (string_t name, string_t re=".*") const
 
TH1 *& operator[] (string_t name)
 
const TH1 * operator[] (string_t name) const
 
long size () const
 
string_ttitle () const
 

Private Types

typedef std::map< std::string,
TH1 * > 
book_t
 
typedef const double double_t
 
typedef const std::string string_t
 
typedef const unsigned long uint_t
 

Private Attributes

book_t book_
 
TDirectory * directory
 
std::string title_
 

Detailed Description

Definition at line 16 of file Book.h.

Member Typedef Documentation

typedef std::map<std::string, TH1*> Book::book_t
private

Definition at line 20 of file Book.h.

typedef boost::filter_iterator<match_name, book_t::const_iterator> Book::const_iterator

Definition at line 56 of file Book.h.

typedef const double Book::double_t
private

Definition at line 17 of file Book.h.

typedef boost::filter_iterator<match_name, book_t::iterator> Book::iterator

Definition at line 55 of file Book.h.

typedef const std::string Book::string_t
private

Definition at line 19 of file Book.h.

typedef const unsigned long Book::uint_t
private

Definition at line 18 of file Book.h.

Constructor & Destructor Documentation

Book::Book ( )
inline

Definition at line 35 of file Book.h.

35 : title_(""), directory(nullptr) {}
std::string title_
Definition: Book.h:23
TDirectory * directory
Definition: Book.h:24
Book::Book ( string_t  t)
inline

Definition at line 36 of file Book.h.

36 : title_(t), directory(new TDirectory(t.c_str(), t.c_str())) {}
std::string title_
Definition: Book.h:23
TDirectory * directory
Definition: Book.h:24

Member Function Documentation

iterator Book::begin ( string_t  re = ".*")
inline
const_iterator Book::begin ( string_t  re = ".*") const
inline

Definition at line 61 of file Book.h.

References b, book_, and alignCSCRings::e.

61  {
62  book_t::const_iterator b(book_.begin()), e(book_.end());
63  return boost::make_filter_iterator(match_name(re), b, e);
64  }
book_t book_
Definition: Book.h:22
double b
Definition: hdecay.h:118
TH1* Book::book ( string_t  name,
TH1 *const  hist 
)
inline

Definition at line 42 of file Book.h.

References book_, directory, gpuVertexFinder::hist, and mergeVDriftHistosByStation::name.

Referenced by fill(), and LA_Filler_Fitter::make_and_fit_symmchi2().

42  {
43  book_[name] = hist;
44  hist->SetDirectory(directory);
45  if (!hist->GetSumw2N())
46  hist->Sumw2();
47  return hist;
48  }
book_t book_
Definition: Book.h:22
__shared__ Hist hist
TDirectory * directory
Definition: Book.h:24
bool Book::empty ( ) const
inline

Definition at line 39 of file Book.h.

References book_.

39 { return book_.empty(); }
book_t book_
Definition: Book.h:22
iterator Book::end ( string_t  re = ".*")
inline
const_iterator Book::end ( string_t  re = ".*") const
inline

Definition at line 69 of file Book.h.

References book_, and alignCSCRings::e.

Referenced by Types.LuminosityBlockRange::cppID(), and Types.EventRange::cppID().

69  {
70  book_t::const_iterator e(book_.end());
71  return boost::make_filter_iterator(match_name(re), e, e);
72  }
book_t book_
Definition: Book.h:22
void Book::erase ( string_t  name)
inline

Definition at line 84 of file Book.h.

References book_.

Referenced by LA_Filler_Fitter::fit_width_profile().

84  {
85  book_t::iterator it = book_.find(name);
86  if (it != book_.end()) {
87  delete it->second;
88  book_.erase(it);
89  }
90  }
book_t book_
Definition: Book.h:22
void Book::erase ( iterator  it)
inline

Definition at line 91 of file Book.h.

References book_.

91  {
92  delete it->second;
93  book_.erase(it.base());
94  }
book_t book_
Definition: Book.h:22
void Book::fill ( double_t  X,
const char *  name,
uint_t  NbinsX,
double_t  Xlow,
double_t  Xup,
double_t  W = 1 
)
inline

Definition at line 96 of file Book.h.

References AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by fill(), LA_Filler_Fitter::fill_one_cluster(), LA_Filler_Fitter::summarize_ensembles(), and sistrip::MeasureLA::summarize_module_muH_byLayer().

96  {
97  fill(X, std::string(name), NbinsX, Xlow, Xup, W);
98  }
#define X(str)
Definition: MuonsGrabber.cc:38
void fill(double_t X, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
Definition: Book.h:96
void Book::fill ( double_t  X,
const poly< std::string > &  names,
uint_t  NbinsX,
double_t  Xlow,
double_t  Xup,
double_t  W = 1 
)
inline

Definition at line 99 of file Book.h.

References book(), book_, mergeVDriftHistosByStation::name, and HLTObjectMonitor_cfi::NbinsX.

99  {
100  for (auto const& name : names) {
101  book_t::const_iterator current = book_.find(name);
102  if (current == book_.end())
103  book(name, new TH1D(name.c_str(), "", NbinsX, Xlow, Xup))->Fill(X, W);
104  else
105  current->second->Fill(X, W);
106  }
107  }
#define X(str)
Definition: MuonsGrabber.cc:38
book_t book_
Definition: Book.h:22
TH1 * book(string_t name, TH1 *const hist)
Definition: Book.h:42
void Book::fill ( double_t  X,
double_t  Y,
const char *  name,
uint_t  NbinsX,
double_t  Xlow,
double_t  Xup,
double_t  W = 1 
)
inline

Definition at line 108 of file Book.h.

References fill(), and AlCaHLTBitMon_QueryRunRegistry::string.

108  {
109  fill(X, Y, std::string(name), NbinsX, Xlow, Xup, W);
110  }
#define X(str)
Definition: MuonsGrabber.cc:38
void fill(double_t X, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
Definition: Book.h:96
void Book::fill ( double_t  X,
double_t  Y,
const poly< std::string > &  names,
uint_t  NbinsX,
double_t  Xlow,
double_t  Xup,
double_t  W = 1 
)
inline

Definition at line 111 of file Book.h.

References book(), book_, HcalObjRepresent::Fill(), mergeVDriftHistosByStation::name, and HLTObjectMonitor_cfi::NbinsX.

117  {
118  for (auto const& name : names) {
119  book_t::const_iterator current = book_.find(name);
120  if (current == book_.end())
121  static_cast<TProfile*>(book(name, new TProfile(name.c_str(), "", NbinsX, Xlow, Xup)))->Fill(X, Y, W);
122  else
123  static_cast<TProfile*>(current->second)->Fill(X, Y, W);
124  }
125  }
#define X(str)
Definition: MuonsGrabber.cc:38
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
book_t book_
Definition: Book.h:22
TH1 * book(string_t name, TH1 *const hist)
Definition: Book.h:42
void Book::fill ( double_t  X,
double_t  Y,
const char *  name,
uint_t  NbinsX,
double_t  Xlow,
double_t  Xup,
uint_t  NbinsY,
double_t  Ylow,
double_t  Yup,
double_t  W = 1 
)
inline

Definition at line 126 of file Book.h.

References fill(), and AlCaHLTBitMon_QueryRunRegistry::string.

135  {
136  fill(X, Y, std::string(name), NbinsX, Xlow, Xup, NbinsY, Ylow, Yup, W);
137  }
#define X(str)
Definition: MuonsGrabber.cc:38
void fill(double_t X, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
Definition: Book.h:96
void Book::fill ( double_t  X,
double_t  Y,
const poly< std::string > &  names,
uint_t  NbinsX,
double_t  Xlow,
double_t  Xup,
uint_t  NbinsY,
double_t  Ylow,
double_t  Yup,
double_t  W = 1 
)
inline

Definition at line 138 of file Book.h.

References book(), book_, HcalObjRepresent::Fill(), mergeVDriftHistosByStation::name, and HLTObjectMonitor_cfi::NbinsX.

147  {
148  for (auto const& name : names) {
149  book_t::const_iterator current = book_.find(name);
150  if (current == book_.end())
151  static_cast<TH2*>(book(name, new TH2D(name.c_str(), "", NbinsX, Xlow, Xup, NbinsY, Ylow, Yup)))->Fill(X, Y, W);
152  else
153  static_cast<TH2*>(current->second)->Fill(X, Y, W);
154  }
155  }
#define X(str)
Definition: MuonsGrabber.cc:38
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
book_t book_
Definition: Book.h:22
TH1 * book(string_t name, TH1 *const hist)
Definition: Book.h:42
void Book::fill ( double_t  X,
double_t  Y,
double_t  Z,
const char *  name,
uint_t  NbinsX,
double_t  Xlow,
double_t  Xup,
uint_t  NbinsY,
double_t  Ylow,
double_t  Yup,
uint_t  NbinsZ,
double_t  Zlow,
double_t  Zup,
double_t  W = 1 
)
inline

Definition at line 156 of file Book.h.

References fill(), and AlCaHLTBitMon_QueryRunRegistry::string.

169  {
170  fill(X, Y, Z, std::string(name), NbinsX, Xlow, Xup, NbinsY, Ylow, Yup, NbinsZ, Zlow, Zup);
171  }
#define X(str)
Definition: MuonsGrabber.cc:38
void fill(double_t X, const char *name, uint_t NbinsX, double_t Xlow, double_t Xup, double_t W=1)
Definition: Book.h:96
void Book::fill ( double_t  X,
double_t  Y,
double_t  Z,
const poly< std::string > &  names,
uint_t  NbinsX,
double_t  Xlow,
double_t  Xup,
uint_t  NbinsY,
double_t  Ylow,
double_t  Yup,
uint_t  NbinsZ,
double_t  Zlow,
double_t  Zup,
double_t  W = 1 
)
inline

Definition at line 172 of file Book.h.

References book(), book_, HcalObjRepresent::Fill(), mergeVDriftHistosByStation::name, and HLTObjectMonitor_cfi::NbinsX.

185  {
186  for (auto const& name : names) {
187  book_t::const_iterator current = book_.find(name);
188  if (current == book_.end())
189  static_cast<TH3*>(
190  book(name, new TH3D(name.c_str(), "", NbinsX, Xlow, Xup, NbinsY, Ylow, Yup, NbinsZ, Zlow, Zup)))
191  ->Fill(X, Y, Z, W);
192  else
193  static_cast<TH3*>(current->second)->Fill(X, Y, Z, W);
194  }
195  }
#define X(str)
Definition: MuonsGrabber.cc:38
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
book_t book_
Definition: Book.h:22
TH1 * book(string_t name, TH1 *const hist)
Definition: Book.h:42
std::pair<iterator, iterator> Book::filter_range ( string_t  re = ".*")
inline

Definition at line 79 of file Book.h.

References begin(), and end().

79 { return std::make_pair(begin(re), end(re)); }
iterator begin(string_t re=".*")
Definition: Book.h:57
iterator end(string_t re=".*")
Definition: Book.h:65
std::pair<const_iterator, const_iterator> Book::filter_range ( string_t  re = ".*") const
inline

Definition at line 80 of file Book.h.

References begin(), and end().

80  {
81  return std::make_pair(begin(re), end(re));
82  }
iterator begin(string_t re=".*")
Definition: Book.h:57
iterator end(string_t re=".*")
Definition: Book.h:65
iterator Book::find ( string_t  name,
string_t  re = ".*" 
)
inline

Definition at line 73 of file Book.h.

References book_.

Referenced by BeautifulSoup.Tag::__getattr__(), BeautifulSoup.Tag::firstText(), and LA_Filler_Fitter::make_and_fit_symmchi2().

73  {
74  return boost::make_filter_iterator(match_name(re), book_.find(name), book_.end());
75  }
book_t book_
Definition: Book.h:22
const_iterator Book::find ( string_t  name,
string_t  re = ".*" 
) const
inline

Definition at line 76 of file Book.h.

References book_.

Referenced by BeautifulSoup.Tag::__getattr__(), and BeautifulSoup.Tag::firstText().

76  {
77  return boost::make_filter_iterator(match_name(re), book_.find(name), book_.end());
78  }
book_t book_
Definition: Book.h:22
TH1*& Book::operator[] ( string_t  name)
inline

Definition at line 49 of file Book.h.

References book_, and mergeVDriftHistosByStation::name.

49 { return book_[name]; }
book_t book_
Definition: Book.h:22
const TH1* Book::operator[] ( string_t  name) const
inline

Definition at line 50 of file Book.h.

References book_.

50  {
51  book_t::const_iterator it = book_.find(name);
52  return it == book_.end() ? nullptr : it->second;
53  }
book_t book_
Definition: Book.h:22
long Book::size ( void  ) const
inline

Definition at line 40 of file Book.h.

References book_.

Referenced by ntupleDataFormat._Collection::__iter__(), and ntupleDataFormat._Collection::__len__().

40 { return book_.size(); }
book_t book_
Definition: Book.h:22
string_t& Book::title ( ) const
inline

Definition at line 38 of file Book.h.

References title_.

38 { return title_; }
std::string title_
Definition: Book.h:23

Member Data Documentation

book_t Book::book_
private

Definition at line 22 of file Book.h.

Referenced by begin(), book(), empty(), end(), erase(), fill(), find(), operator[](), and size().

TDirectory* Book::directory
private
std::string Book::title_
private

Definition at line 23 of file Book.h.

Referenced by title().