ATLAS Offline Software
Public Member Functions | List of all members
dqm_algorithms::AFP_ToFEfficiency Class Reference

#include <AFP_ToFEfficiency.h>

Inheritance diagram for dqm_algorithms::AFP_ToFEfficiency:
Collaboration diagram for dqm_algorithms::AFP_ToFEfficiency:

Public Member Functions

 AFP_ToFEfficiency ()
 
 ~AFP_ToFEfficiency ()
 
AFP_ToFEfficiencyclone () override
 
dqm_core::Resultexecute (const std::string &name, const TObject &object, const dqm_core::AlgorithmConfig &config) override
 
void printDescriptionTo (std::ostream &out) override
 

Detailed Description

Definition at line 21 of file AFP_ToFEfficiency.h.

Constructor & Destructor Documentation

◆ AFP_ToFEfficiency()

dqm_algorithms::AFP_ToFEfficiency::AFP_ToFEfficiency ( )

Definition at line 21 of file AFP_ToFEfficiency.cxx.

21  {
22  dqm_core::AlgorithmManager::instance().registerAlgorithm( "AFP_ToFEfficiency", this );
23 }

◆ ~AFP_ToFEfficiency()

dqm_algorithms::AFP_ToFEfficiency::~AFP_ToFEfficiency ( )

Definition at line 25 of file AFP_ToFEfficiency.cxx.

25  {
26 }

Member Function Documentation

◆ clone()

dqm_algorithms::AFP_ToFEfficiency * dqm_algorithms::AFP_ToFEfficiency::clone ( )
override

Definition at line 29 of file AFP_ToFEfficiency.cxx.

29  {
30  return new AFP_ToFEfficiency();
31 }

◆ execute()

dqm_core::Result * dqm_algorithms::AFP_ToFEfficiency::execute ( const std::string &  name,
const TObject &  object,
const dqm_core::AlgorithmConfig &  config 
)
override

Definition at line 34 of file AFP_ToFEfficiency.cxx.

36  {
37  if ( !object.IsA()->InheritsFrom( "TH2" ) ) {
38  throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH2" );
39  }
40 
41  auto histogram = static_cast<const TH2D*>( &object );
42 
43  auto gthreshold = static_cast<uint32_t>( dqm_algorithms::tools::GetFromMap( "NbadTrains", config.getGreenThresholds() ) );
44  auto rthreshold = static_cast<uint32_t>( dqm_algorithms::tools::GetFromMap( "NbadTrains", config.getRedThresholds() ) );
45  auto eff_limit = static_cast<float>( dqm_algorithms::tools::GetFirstFromMap( "eff_limit", config.getParameters() ) );
46 
47  uint32_t each_tr_status[2] = {};
48  for (uint32_t i = 1; i < 5; ++i)
49  {
50  float current_eff = histogram->GetBinContent(histogram->GetBin(5,i));
51  if (current_eff >= eff_limit)
52  each_tr_status[0]++;
53  else
54  each_tr_status[1]++;
55  }
56 
57  auto result = new dqm_core::Result();
58 
59  // publish problematic bins
60  result->tags_[ ("N Trains with efficiency less than " + (std::to_string(eff_limit)).substr(0,4)).c_str() ] = each_tr_status[1];
61 
62  if ( each_tr_status[0]==0 && each_tr_status[1]==0 )
64  else if ( each_tr_status[0] == 4 )
66  else if ( each_tr_status[1] >= gthreshold && each_tr_status[1] < rthreshold )
67  result->status_ = dqm_core::Result::Yellow;
68  else
69  result->status_ = dqm_core::Result::Red;
70 
71  return result;
72 }

◆ printDescriptionTo()

void dqm_algorithms::AFP_ToFEfficiency::printDescriptionTo ( std::ostream &  out)
override

Definition at line 74 of file AFP_ToFEfficiency.cxx.

74  {
75  out << "AFP_ToFEfficiency: Print out how many trains have efficiency less than limit\n"
76  << "Required Parameter: eff_limit: threshold percentage of efficiency" << std::endl;
77 }

The documentation for this class was generated from the following files:
Undefined
@ Undefined
Definition: MaterialTypes.h:8
get_generator_info.result
result
Definition: get_generator_info.py:21
IsA
#define IsA
Declare the TObject style functions.
Definition: xAODTEventBranch.h:59
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
lumiFormat.i
int i
Definition: lumiFormat.py:85
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.handimod.Green
int Green
Definition: handimod.py:524
dqm_algorithms::AFP_ToFEfficiency::AFP_ToFEfficiency
AFP_ToFEfficiency()
Definition: AFP_ToFEfficiency.cxx:21
python.handimod.Red
Red
Definition: handimod.py:551
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
dqm_algorithms::tools::GetFromMap
const T & GetFromMap(const std::string &pname, const std::map< std::string, T > &params)
Definition: AlgorithmHelper.h:114
pickleTool.object
object
Definition: pickleTool.py:30
dqm_algorithms::tools::GetFirstFromMap
double GetFirstFromMap(const std::string &paramName, const std::map< std::string, double > &params)
Definition: AlgorithmHelper.cxx:339
histogram
std::string histogram
Definition: chains.cxx:52