15 #include "GaudiKernel/ISvcLocator.h"
16 #include "GaudiKernel/Service.h"
26 const std::string& dirName,
27 const std::string& anaTag,
31 m_anaTag( anaTag ) { }
41 return StatusCode::SUCCESS;
50 const std::string& folderOverride,
51 const std::string& nameOverride )
const
54 ISvcLocator* svcLoc = Gaudi::svcLocator();
55 SmartIF<IPlotsDefinitionSvc> plotsDefSvc(svcLoc->service(
"PlotsDefSvc"+m_anaTag ));
65 if( not folderOverride.empty() ) sDef.
folder( folderOverride );
68 if( not nameOverride.empty() ) sDef.
name( nameOverride );
83 return StatusCode::FAILURE;
98 return StatusCode::SUCCESS;
108 return StatusCode::FAILURE;
132 return StatusCode::SUCCESS;
142 return StatusCode::FAILURE;
175 return StatusCode::SUCCESS;
185 return StatusCode::FAILURE;
201 return StatusCode::SUCCESS;
211 return StatusCode::FAILURE;
235 return StatusCode::SUCCESS;
245 return StatusCode::FAILURE;
248 pHisto = ( def.
nBinsY() == 0 ) ?
273 return StatusCode::SUCCESS;
286 return StatusCode::FAILURE;
289 if( std::isnan(
value ) or std::isnan(
weight ) ) {
290 ATH_MSG_ERROR(
"Non-valid fill arguments for TH1:" << pTh1->GetName() );
291 return StatusCode::FAILURE;
296 return StatusCode::SUCCESS;
306 return StatusCode::FAILURE;
309 if( std::isnan(
xval ) or std::isnan(
yval ) or std::isnan(
weight ) ) {
310 ATH_MSG_ERROR(
"Non-valid fill arguments for TH2:" << pTh2->GetName() );
311 return StatusCode::FAILURE;
316 return StatusCode::SUCCESS;
322 TH3* pTh3,
float xval,
float yval,
float zval,
float weight )
const
326 return StatusCode::FAILURE;
329 if( std::isnan(
xval ) or std::isnan(
yval ) or
330 std::isnan( zval ) or std::isnan(
weight ) ) {
331 ATH_MSG_ERROR(
"Non-valid fill arguments for TH3:" << pTh3->GetName() );
332 return StatusCode::FAILURE;
338 return StatusCode::SUCCESS;
346 if( not pTprofile ) {
348 return StatusCode::FAILURE;
351 if( std::isnan(
xval ) or std::isnan(
yval ) or std::isnan(
weight ) ) {
352 ATH_MSG_ERROR(
"Non-valid fill arguments for TProfile:" << pTprofile->GetName() );
353 return StatusCode::FAILURE;
358 return StatusCode::SUCCESS;
364 TProfile2D* pTprofile,
float xval,
float yval,
float zval,
float weight )
const
366 if( not pTprofile ) {
368 return StatusCode::FAILURE;
371 if( std::isnan(
xval ) or std::isnan(
yval ) or
372 std::isnan( zval ) or std::isnan(
weight ) ) {
373 ATH_MSG_ERROR(
"Non-valid fill arguments for TProfile2D:" << pTprofile->GetName() );
374 return StatusCode::FAILURE;
379 return StatusCode::SUCCESS;
385 TEfficiency* pTeff,
float value,
bool accepted,
float weight )
const
388 ATH_MSG_ERROR(
"Trying to fill non-definded 1D TEfficiency" );
389 return StatusCode::FAILURE;
392 if( std::isnan(
value ) or std::isnan(
weight ) ) {
393 ATH_MSG_ERROR(
"Non-valid fill arguments for 1D TEfficiency:" << pTeff->GetName() );
394 return StatusCode::FAILURE;
400 else pTeff->FillWeighted( accepted,
weight,
value );
401 return StatusCode::SUCCESS;
407 TEfficiency* pTeff2d,
float xvalue,
float yvalue,
bool accepted,
float weight )
const
410 ATH_MSG_ERROR(
"Trying to fill non-definded 2D TEfficiency" );
411 return StatusCode::FAILURE;
414 if( std::isnan( xvalue ) or std::isnan( yvalue ) or std::isnan(
weight ) ) {
415 ATH_MSG_ERROR(
"Non-valid fill arguments for 2D TEfficiency:" << pTeff2d->GetName() );
416 return StatusCode::FAILURE;
421 if(
weight==1.) pTeff2d->Fill( accepted, xvalue, yvalue );
422 else pTeff2d->FillWeighted( accepted,
weight, xvalue, yvalue );
423 return StatusCode::SUCCESS;
429 unsigned int nBins,
float absMin,
float absMax,
bool symmetriseAroundZero )
431 std::vector<float> emptyVec;
433 if( absMin<=0 or absMax<=0 ) {
434 ATH_MSG_WARNING(
"absMin or absMax argument to getLogLinearBins is out of range" );
436 }
else if(
nBins==0 ) {
441 unsigned int asymVecSize =
nBins + 1;
442 std::vector<float> theBinning( asymVecSize, 0.);
444 float logStart =
std::log( absMin );
445 float logDist =
std::log( absMax ) - logStart;
448 float thisLog{ logStart };
449 for(
float& thisBin : theBinning ) {
453 if( symmetriseAroundZero ) {