17#include "GaudiKernel/MsgStream.h"
18#include "GaudiKernel/StatusCode.h"
64 ATH_MSG_FATAL(
"ManagedMonitorToolBase::initialize() - Failed" );
86 return evtInfo->lumiBlock();
97 return StatusCode::SUCCESS;
102 h =
new TH1F(hname.c_str(),htitle.c_str(),nbins,low,high);
106void egammaMonToolBase::bookTH1F(TH1* &
h,
MonGroup& mygroup,
const std::string& hname_prefix,
const std::string& htitle_prefix,
int nbins,
float low,
float high, std::string &nameOfEgammaType)
108 std::string hname = hname_prefix + nameOfEgammaType;
109 std::string htitle = htitle_prefix +
" (" + nameOfEgammaType +
")";
110 bookTH1F(
h, mygroup, hname, htitle, nbins, low, high);
115 h =
new TH2F(hname.c_str(),htitle.c_str(),nbinsx,xlow,xhigh,nbinsy,ylow,yhigh);
119void egammaMonToolBase::bookTH2F(TH2* &
h,
MonGroup& mygroup,
const std::string& hname_prefix,
const std::string& htitle_prefix,
int nbinsx,
float xlow,
float xhigh,
int nbinsy,
float ylow,
float yhigh, std::string &nameOfEgammaType)
121 std::string hname = hname_prefix + nameOfEgammaType;
122 std::string htitle = htitle_prefix +
" (" + nameOfEgammaType +
")";
123 bookTH2F(
h, mygroup, hname, htitle, nbinsx, xlow, xhigh, nbinsy, ylow, yhigh);
128 h =
new TProfile(hname.c_str(),htitle.c_str(),nbins,xlow,xhigh,ylow,yhigh);
138 for(
unsigned int ir=min_region;
ir<=max_region;
ir++) {
142 TH1 *
h =
new TH1F(name.c_str(),title.c_str(),nbins,low,high);
148void egammaMonToolBase::bookTH1FperRegion(std::vector<TH1*> &vhist,
MonGroup& mygroup,
const std::string& hname_prefix,
const std::string& htitle_prefix,
int nbins,
float low,
float high,
unsigned int min_region,
unsigned int max_region, std::string &nameOfEgammaType)
150 std::string hname = hname_prefix + nameOfEgammaType;
151 std::string htitle = htitle_prefix +
" (" + nameOfEgammaType +
")";
152 bookTH1FperRegion(vhist, mygroup, hname, htitle, nbins, low, high, min_region, max_region);
155void egammaMonToolBase::bookTH2FperRegion(std::vector<TH2*> &vhist,
MonGroup& mygroup,
const std::string& hname,
const std::string& htitle,
int nbinsx,
float xlow,
float xhigh,
int nbinsy,
float ylow,
float yhigh,
unsigned int min_region,
unsigned int max_region)
161 for(
unsigned int ir=min_region;
ir<=max_region;
ir++) {
165 TH2 *
h =
new TH2F(name.c_str(),title.c_str(),nbinsx,xlow,xhigh,nbinsy,ylow,yhigh);
171void egammaMonToolBase::bookTH2FperRegion(std::vector<TH2*> &vhist,
MonGroup& mygroup,
const std::string& hname_prefix,
const std::string& htitle_prefix,
int nbinsx,
float xlow,
float xhigh,
int nbinsy,
float ylow,
float yhigh,
unsigned int min_region,
unsigned int max_region, std::string &nameOfEgammaType)
173 std::string hname = hname_prefix + nameOfEgammaType;
174 std::string htitle = htitle_prefix +
" (" + nameOfEgammaType +
")";
175 bookTH2FperRegion(vhist, mygroup, hname, htitle, nbinsx, xlow, xhigh, nbinsy, ylow, yhigh, min_region, max_region);
180 unsigned int size = vhist.size();
188 unsigned int size = vhist.size();
196 float aeta = fabs(
eta);
197 if( aeta < 3.2 )
return ENDCAP;
203 float aeta = fabs(
eta);
205 if( aeta < 1.37 )
return BARREL;
207 if( aeta > 1.52)
return ENDCAP;
218 return StatusCode::SUCCESS;
255 return StatusCode::SUCCESS;
260 int nbins =
h->GetNbinsX();
261 if(href->GetNbinsX()!=nbins) {
262 ATH_MSG_WARNING(
"egammaMonToolBase::FillEfficiencies(): histograms have different number of bins, can not divide!");
266 ATH_MSG_DEBUG(
"egammaMonToolBase::FillEfficiencies(): start new computation");
268 for(
int i=1;i<nbins+1;++i){
271 double Yref = href->GetBinContent(i);
273 double A =
h->GetBinContent(i);
275 err = sqrt(eps*(1-eps)/Yref);
283 h->SetBinContent(i,eps);
284 h->SetBinError(i,err);
291 ATH_MSG_DEBUG(
"No Trigger request for that monitoring tool");
296 bool triggerfound =
false;
298 ATH_MSG_DEBUG(comment <<
" Trigger " << i <<
" for that event ?");
302 ATH_MSG_DEBUG(comment <<
" Trigger " << i <<
" found for that event");
306 if (!triggerfound)
ATH_MSG_DEBUG(
"No " << comment <<
" Trigger found for that event");
310 const std::vector<std::string>&
vec =
m_trigdec->getListOfTriggers();
312 for (
const auto & i :
vec) {
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
std::vector< size_t > vec
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)
Header file for AthHistogramAlgorithm.
virtual bool isValid() override final
Can the handle be successfully dereferenced?
@ LAr
The LAr calorimeter.
EventFlagErrorState
States that a given sub-detector could be in.
@ Error
The sub-detector issued an error.
int ir
counter of the current depth
hold the test vectors and ease the comparison