17 #include "TDirectory.h"
40 tversion = tversion.Remove(0,1);
41 tversion = tversion.Remove(tversion.Length()-1,tversion.Length());
42 DQMFile_ = std::string(tversion)+
"_"+
DQMFile_;
95 if ( tObject->IsA()->InheritsFrom(
"TH1" ) ) {
97 TH1 * histogram = (TH1*) tObject ;
102 hresiduals = hcompare.
Compare(histogram,
"/DQMData/"+TString(
algorithm_)+
"/"+TString(histogram->GetName()) );
106 monElement = dbe->
book1D (
107 std::string( histogram->GetName() ),
108 std::string( histogram->GetTitle() ),
109 histogram->GetXaxis()->GetNbins(),
110 histogram->GetXaxis()->GetXmin(),
111 histogram->GetXaxis()->GetXmax()
114 monElement->
setAxisTitle( std::string ( histogram->GetXaxis()->GetTitle()) , 1);
115 monElement->
setAxisTitle( std::string ( histogram->GetYaxis()->GetTitle()) , 2);
118 for(Int_t
x=0;
x<histogram->GetXaxis()->GetNbins();
x++) {
124 monElementRes = dbe->
book1D (
125 std::string( hresiduals->GetName() ),
126 std::string( hresiduals->GetTitle() ),
127 hresiduals->GetXaxis()->GetNbins(),
128 hresiduals->GetXaxis()->GetXmin(),
129 hresiduals->GetXaxis()->GetXmax()
133 for(Int_t
x=0;
x<hresiduals->GetXaxis()->GetNbins();
x++) {
135 monElementRes->
setBinError (
x, hresiduals->GetBinError(
x ) ) ;
139 else if ( tObject->IsA()->InheritsFrom(
"TH2" ) ) {
141 TH2 * histogram = (TH2*) tObject ;
143 monElement = dbe->
book2D (
144 std::string( histogram->GetName() ),
145 std::string( histogram->GetTitle() ),
146 histogram->GetXaxis()->GetNbins(),
147 histogram->GetXaxis()->GetXmin(),
148 histogram->GetXaxis()->GetXmax(),
149 histogram->GetYaxis()->GetNbins(),
150 histogram->GetYaxis()->GetXmin(),
151 histogram->GetYaxis()->GetXmax()
154 monElement->
setAxisTitle( std::string ( histogram->GetXaxis()->GetTitle()) , 1);
155 monElement->
setAxisTitle( std::string ( histogram->GetYaxis()->GetTitle()) , 2);
157 for(Int_t
x=0;
x<histogram->GetXaxis()->GetNbins();
x++)
158 for(Int_t
y=0;
y<histogram->GetYaxis()->GetNbins();
y++) {
163 else if ( tObject->IsA()->InheritsFrom(
"TH3" ) ) {
165 TH3 * histogram = (TH3*) tObject ;
167 monElement = dbe->
book3D (
168 std::string( histogram->GetName() ),
169 std::string( histogram->GetTitle() ),
170 histogram->GetXaxis()->GetNbins(),
171 histogram->GetXaxis()->GetXmin(),
172 histogram->GetXaxis()->GetXmax(),
173 histogram->GetYaxis()->GetNbins(),
174 histogram->GetYaxis()->GetXmin(),
175 histogram->GetYaxis()->GetXmax(),
176 histogram->GetZaxis()->GetNbins(),
177 histogram->GetZaxis()->GetXmin(),
178 histogram->GetZaxis()->GetXmax()
181 monElement->
setAxisTitle( std::string ( histogram->GetXaxis()->GetTitle()) , 1);
182 monElement->
setAxisTitle( std::string ( histogram->GetYaxis()->GetTitle()) , 2);
184 for(Int_t
x=0;
x<histogram->GetXaxis()->GetNbins();
x++)
185 for(Int_t
y=0;
y<histogram->GetYaxis()->GetNbins();
y++)
186 for(Int_t
z=0;
z<histogram->GetZaxis()->GetNbins();
z++) {
virtual void analyze(const edm::Event &, const edm::EventSetup &)
T getParameter(std::string const &) const
void setBinContent(int binx, double content)
set content of bin (1-D)
MonitorElement * book1D(const char *name, const char *title, int nchX, double lowX, double highX)
Book 1D histogram.
MonitorElement * book3D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, int nchZ, double lowZ, double highZ)
Book 3D histogram.
#define DEFINE_FWK_MODULE(type)
void save(const std::string &filename, const std::string &path="", const std::string &pattern="", const std::string &rewrite="", SaveReferenceTag ref=SaveWithReference, int minStatus=dqm::qstatus::STATUS_OK, const std::string &fileupdate="RECREATE")
void setBinError(int binx, double error)
set uncertainty on content of bin (1-D)
void SetReferenceFilename(TString filename)
std::string getReleaseVersion()
BTagValidator(const edm::ParameterSet &)
std::vector< std::string > vstring
std::string referenceFilename_
void showDirStructure(void) const
TH1 * Compare(TH1 *h, TString hname)
MonitorElement * book2D(const char *name, const char *title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
void setAxisTitle(const std::string &title, int axis=1)
set x-, y- or z-axis title (axis=1, 2, 3 respectively)
void setCurrentFolder(const std::string &fullpath)