ATLAS Offline Software
Public Member Functions | Private Attributes | List of all members
dqm_algorithms::MUCTPISLTiming Class Reference

#include <MUCTPISLTiming.h>

Inheritance diagram for dqm_algorithms::MUCTPISLTiming:
Collaboration diagram for dqm_algorithms::MUCTPISLTiming:

Public Member Functions

 MUCTPISLTiming ()
 
virtual ~MUCTPISLTiming ()=default
 
virtual dqm_core::Algorithm * clone ()
 
virtual dqm_core::Resultexecute (const std::string &name, const TObject &data, const dqm_core::AlgorithmConfig &config)
 
virtual void printDescription (std::ostream &out)
 

Private Attributes

std::string m_name
 

Detailed Description

Definition at line 15 of file MUCTPISLTiming.h.

Constructor & Destructor Documentation

◆ MUCTPISLTiming()

dqm_algorithms::MUCTPISLTiming::MUCTPISLTiming ( )

Definition at line 34 of file MUCTPISLTiming.cxx.

35  : m_name("MUCTPISLTiming")
36 {
37  dqm_core::AlgorithmManager::instance().registerAlgorithm( m_name, this );
38 }

◆ ~MUCTPISLTiming()

virtual dqm_algorithms::MUCTPISLTiming::~MUCTPISLTiming ( )
virtualdefault

Member Function Documentation

◆ clone()

dqm_core::Algorithm * dqm_algorithms::MUCTPISLTiming::clone ( )
virtual

Definition at line 41 of file MUCTPISLTiming.cxx.

42 {
43  return new MUCTPISLTiming(*this);
44 }

◆ execute()

dqm_core::Result * dqm_algorithms::MUCTPISLTiming::execute ( const std::string &  name,
const TObject &  data,
const dqm_core::AlgorithmConfig &  config 
)
virtual

Definition at line 48 of file MUCTPISLTiming.cxx.

49 {
50  using namespace std;
51 
52  const TH2 * hist;
53  //TH2 * ref; //not using reference in this case
54 
55  if( object.IsA()->InheritsFrom( "TH2" ) ) {
56  hist = (const TH2*)&object;
57  if (hist->GetDimension() != 2 ){
58  throw dqm_core::BadConfig( ERS_HERE, name, "dimension != 2 " );
59  }
60  } else {
61  throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH2" );
62  }
63 
64  //Get Parameters and Thresholds
65  double thresh=0.5;
66  double minstat=-1;
67  int centralBin=4; // the middle of 7 bins;
68 
69  try {
70  thresh = dqm_algorithms::tools::GetFirstFromMap("thresh", config.getParameters(), 0.5);
71  minstat = dqm_algorithms::tools::GetFirstFromMap( "MinStat", config.getParameters(), -1);
72  }
73  catch ( dqm_core::Exception & ex ) {
74  throw dqm_core::BadConfig( ERS_HERE, name, ex.what(), ex );
75  }
76 
77  //Algo
78 
79  //project our 2D histogram to 1D (x-axis), thus summing up along y
80  //will then compare every bin of the projection with the GetBinContent of the central bin in the 2D histo
81  TH1* projection = hist->ProjectionX();
82 
84  std::map<std::string,double> tags; //defined in https://gitlab.cern.ch/atlas-tdaq-software/dqm_core/-/blob/master/dqm_core/Result.h
85 
86  //assume all good, until find a bad one
88  uint howmanybad=0;
89 
90  for(int iBin=1;iBin<=projection->GetNbinsX();iBin++)//0=underflow bin
91  {
92  if( projection->GetBinContent(iBin)*thresh > hist->GetBinContent(iBin,centralBin) ) //if central slice is less than half of SL sum => bad
93  {
94  result->status_ = dqm_core::Result::Yellow;
95  howmanybad++;
96  //add tag to print which bins are actually the "problematic" ones
97  std::string slNum = std::to_string(iBin-1);
98  if(iBin < 10) slNum = "0" + slNum; // leading zero for conformity
99 
100  tags[slNum] = hist->GetBinContent(iBin,centralBin)*1.0 / projection->GetBinContent(iBin) ;
101  }
102  }
103  tags["howmanybad"] = howmanybad;
104 
105  //set the result tags
106  result->tags_ = tags;
107 
108  //If more than 2SL have bad timing, make it red
109  if(howmanybad>2)
110  result->status_ = dqm_core::Result::Red;
111 
112  Double_t stats[7];
113  hist->GetStats(stats);
114  //if not enough stats, reset the result (but keep this here, so can still see the tag for bad SL)
115  if(stats[0]<minstat)
117 
118  // Return the result
119  return result;
120 }

◆ printDescription()

void dqm_algorithms::MUCTPISLTiming::printDescription ( std::ostream &  out)
virtual

Definition at line 124 of file MUCTPISLTiming.cxx.

124  {
125  std::string message;
126  message += "\n";
127  message += "Algorithm: \"" + m_name + "\"\n";
128  message += "Description: for each SL x-slice (set of y-bins for the same x value) check that the central y bin has at least 'thresh' percent(ratio) of the sum of values in the SL \n";
129  out << message;
130 }

Member Data Documentation

◆ m_name

std::string dqm_algorithms::MUCTPISLTiming::m_name
private

Definition at line 27 of file MUCTPISLTiming.h.


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
dqm_algorithms::MUCTPISLTiming::m_name
std::string m_name
Definition: MUCTPISLTiming.h:27
physval_make_web_display.thresh
thresh
Definition: physval_make_web_display.py:36
plotmaker.hist
hist
Definition: plotmaker.py:148
dqm_algorithms::MUCTPISLTiming::MUCTPISLTiming
MUCTPISLTiming()
Definition: MUCTPISLTiming.cxx:34
python.AthDsoLogger.out
out
Definition: AthDsoLogger.py:71
trigbs_dumpHLTContentInBS.stats
stats
Definition: trigbs_dumpHLTContentInBS.py:91
ReweightUtils.message
message
Definition: ReweightUtils.py:15
config
Definition: PhysicsAnalysis/AnalysisCommon/AssociationUtils/python/config.py:1
instance
std::map< std::string, double > instance
Definition: Run_To_Get_Tags.h:8
uint
unsigned int uint
Definition: LArOFPhaseFill.cxx:20
tags
std::vector< std::string > tags
Definition: hcg.cxx:102
Result
ICscStripFitter::Result Result
Definition: CalibCscStripFitter.cxx:13
python.handimod.Green
int Green
Definition: handimod.py:524
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::GetFirstFromMap
double GetFirstFromMap(const std::string &paramName, const std::map< std::string, double > &params)
Definition: AlgorithmHelper.cxx:339