Loading [MathJax]/extensions/tex2jax.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
Public Member Functions | List of all members
dqm_algorithms::AFP_Sync_check Class Reference

#include <AFP_Sync_check.h>

Inheritance diagram for dqm_algorithms::AFP_Sync_check:
Collaboration diagram for dqm_algorithms::AFP_Sync_check:

Public Member Functions

 AFP_Sync_check ()
 
 ~AFP_Sync_check ()
 
AFP_Sync_checkclone () 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_Sync_check.h.

Constructor & Destructor Documentation

◆ AFP_Sync_check()

dqm_algorithms::AFP_Sync_check::AFP_Sync_check ( )

Definition at line 22 of file AFP_Sync_check.cxx.

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

◆ ~AFP_Sync_check()

dqm_algorithms::AFP_Sync_check::~AFP_Sync_check ( )

Definition at line 26 of file AFP_Sync_check.cxx.

26  {
27 }

Member Function Documentation

◆ clone()

dqm_algorithms::AFP_Sync_check * dqm_algorithms::AFP_Sync_check::clone ( )
override

Definition at line 30 of file AFP_Sync_check.cxx.

30  {
31  return new AFP_Sync_check();
32 }

◆ execute()

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

Definition at line 35 of file AFP_Sync_check.cxx.

37  {
38  if ( !object.IsA()->InheritsFrom( "TProfile" ) ) {
39  throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TProfile" );
40  }
41 
42  auto histogram = static_cast<const TProfile*>( &object );
43 
44  auto gthreshold = static_cast<uint32_t>( dqm_algorithms::tools::GetFromMap( "FractionBadLBs", config.getGreenThresholds() ) );
45  auto rthreshold = static_cast<uint32_t>( dqm_algorithms::tools::GetFromMap( "FractionBadLBs", config.getRedThresholds() ) );
46  auto dif_limit = static_cast<float>( dqm_algorithms::tools::GetFirstFromMap( "dif_limit", config.getParameters() ) );
47 
48  std::vector<double> bad_errs;
49  std::vector<int> bad_lbs;
50  int nonZerocounter = 0;
51  double percentBadBins = -10.0;
52 
53  for (int i = 1; i <= 2000; i++)
54  {
55  if (abs(histogram->GetBinContent(i)) >= dif_limit)
56  {
57  bad_errs.push_back( histogram->GetBinContent(i) );
58  bad_lbs.push_back(i);
59  }
60  if (histogram->GetBinContent(i) != 0)
61  nonZerocounter++;
62  }
63  percentBadBins = double( bad_errs.size() )/double(nonZerocounter)*100;
64 
65  auto result = new dqm_core::Result();
66 
67  // publish problematic bins
68  result->tags_[ "% Bad bins " ] = percentBadBins;
69  for ( int i = 0; i < int(bad_errs.size()); ++i )
70  {
71  auto tag = ( std::ostringstream() << "LB " << bad_lbs[i] ).str();
72  result->tags_[ tag ] = bad_errs[i];
73  }
74 
75  if ( nonZerocounter == 0 )
77  else if ( percentBadBins > rthreshold )
78  result->status_ = dqm_core::Result::Red;
79  else if ( percentBadBins > gthreshold )
80  result->status_ = dqm_core::Result::Yellow;
81  else
83 
84  return result;
85 }

◆ printDescriptionTo()

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

Definition at line 87 of file AFP_Sync_check.cxx.

87  {
88  out << "AFP_Sync_check: Print out fraction of bad bins where module/station is out of synchronization\n"
89  << "Required Parameter: dif_limit: threshold for content of the individual bin to be assumed out of sync" << std::endl;
90 }

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
dqm_algorithms::AFP_Sync_check::AFP_Sync_check
AFP_Sync_check()
Definition: AFP_Sync_check.cxx:22
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
python.TrigEgammaMonitorHelper.TProfile
def TProfile(*args, **kwargs)
Definition: TrigEgammaMonitorHelper.py:81
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.CaloAddPedShiftConfig.str
str
Definition: CaloAddPedShiftConfig.py:42
python.LArMinBiasAlgConfig.int
int
Definition: LArMinBiasAlgConfig.py:59
python.handimod.Green
int Green
Definition: handimod.py:524
xAOD::double
double
Definition: CompositeParticle_v1.cxx:159
python.handimod.Red
Red
Definition: handimod.py:551
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:240
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
CaloCondBlobAlgs_fillNoiseFromASCII.tag
string tag
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:24
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