ATLAS Offline Software
Public Member Functions | List of all members
dqm_algorithms::HLTMETComponents Struct Reference

#include <HLTMETComponents.h>

Inheritance diagram for dqm_algorithms::HLTMETComponents:
Collaboration diagram for dqm_algorithms::HLTMETComponents:

Public Member Functions

 HLTMETComponents ()
 
HLTMETComponentsclone ()
 
dqm_core::Resultexecute (const std::string &, const TObject &, const dqm_core::AlgorithmConfig &)
 
void printDescription (std::ostream &out)
 

Detailed Description

Definition at line 20 of file HLTMETComponents.h.

Constructor & Destructor Documentation

◆ HLTMETComponents()

dqm_algorithms::HLTMETComponents::HLTMETComponents ( )

Definition at line 27 of file HLTMETComponents.cxx.

29 {
30  dqm_core::AlgorithmManager::instance().registerAlgorithm("AlgHLTMETComponents", this);
31 }

Member Function Documentation

◆ clone()

dqm_algorithms::HLTMETComponents * dqm_algorithms::HLTMETComponents::clone ( )

Definition at line 34 of file HLTMETComponents.cxx.

35 {
36 
37  return new HLTMETComponents();
38 }

◆ execute()

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

Definition at line 42 of file HLTMETComponents.cxx.

45 {
46  const TH2 *histogram;
47 
48  if( object.IsA()->InheritsFrom( "TH2" ) ) {
49  histogram = static_cast<const TH2*>(&object);
50  int dimension = histogram->GetDimension();
51  if (dimension != 2 ){
52  throw dqm_core::BadConfig( ERS_HERE, name, "dimension != 2 " );
53  }
54  } else {
55  throw dqm_core::BadConfig( ERS_HERE, name, "does not inherit from TH2" );
56  }
58 
59  int nXBins = histogram -> GetNbinsX(); // components
60  if(nXBins > 25) {
61  nXBins = 25;
62  }
63  const int nYBins = histogram -> GetNbinsY(); // SumEt per sampling
64 
65 
66  // read thresholds
67  int colflags[4];
68  colflags[0] = static_cast<int>(dqm_algorithms::tools::GetFirstFromMap("METYellowMin", config.getParameters(), 1));
69  colflags[1] = static_cast<int>(dqm_algorithms::tools::GetFirstFromMap("METYellowMax", config.getParameters(), nXBins));
70  colflags[2] = static_cast<int>(dqm_algorithms::tools::GetFirstFromMap("METRedMin", config.getParameters(), 1));
71  colflags[3] = static_cast<int>(dqm_algorithms::tools::GetFirstFromMap("METRedMax", config.getParameters(), nXBins));
72  // read options
73  bool doflags[2];
74  doflags[0] = static_cast<bool>(dqm_algorithms::tools::GetFirstFromMap("DoYellowFlag", config.getParameters(), 1));
75  doflags[1] = static_cast<bool>(dqm_algorithms::tools::GetFirstFromMap("DoRedFlag", config.getParameters(), 1));
76 
78  colflags[0] = ((colflags[0] > 0) && (colflags[0] <= nXBins)) ? colflags[0] : 1;
79  colflags[1] = ((colflags[1] >= colflags[0]) && (colflags[1] <= nXBins)) ? colflags[1] : nXBins;
80  colflags[2] = ((colflags[2] > 0) && (colflags[2] <= nXBins)) ? colflags[2] : 1;
81  colflags[3] = ((colflags[3] >= colflags[2]) && (colflags[3] <= nXBins)) ? colflags[3] : nXBins;
82  bool yellowFlagComp = false, redFlagComp = false;
83  int ycnt = 0, rcnt = 0;
84 
85  // yellow flag
86  float epsilon = 1.e-3;
87  if(doflags[0]) {
88  for( int j = colflags[0]; j <= colflags[1]; j++ ) {
89  TString binLabel = histogram->GetXaxis()->GetBinLabel(j);
90  TH1D *hprojy = histogram->ProjectionY(Form("hpy1yf%02d_%s",j,binLabel.Data()),j,j+1,"egoff");
91  if(hprojy) {
92  float uflow = std::abs(hprojy->GetBinContent(0));
93  float oflow = std::abs(hprojy->GetBinContent(nYBins+1));
94  float btotal = hprojy->Integral();
95 
96  // flag true if overflow/underflow has entries or if histo is empty
97  // denoting missing component
98  if(((uflow > epsilon) || (oflow > epsilon)) && (btotal < epsilon)) {
99  yellowFlagComp = true;
100  // count bins flagged as yellow
101  ycnt++;
102  } // if uflow
103  delete hprojy; hprojy = 0;
104  } // if hprojy
105  } // for
106  } // if doflags[0]
107 
108  // red flag
109  if(doflags[1]) {
110  for( int j = colflags[2]; j <= colflags[3]; j++ ) {
111  TString binLabel = histogram->GetXaxis()->GetBinLabel(j);
112  TH1D *hprojy = histogram->ProjectionY(Form("hpy1rf%02d_%s",j,binLabel.Data()),j,j+1,"egoff");
113  if(hprojy) {
114  float uflow = std::abs(hprojy->GetBinContent(0));
115  float oflow = std::abs(hprojy->GetBinContent(nYBins+1));
116  float btotal = hprojy->Integral();
117  // flag true if overflow/underflow has entries or if histo is empty
118  // denoting missing component
119  if(((uflow > epsilon) || (oflow > epsilon)) && (btotal < epsilon)) {
120  redFlagComp = true;
121  rcnt++;
122  } // if uflow
123  delete hprojy; hprojy = 0;
124  } // if hprojy
125  } // for
126  } // if doflags[1]
127 
128  // set results (default green,
129  result->status_ = dqm_core::Result::Green;
130  if(doflags[0] && yellowFlagComp) {
131  result->status_ = dqm_core::Result::Yellow;
132  }
133  if(doflags[1] && redFlagComp) {
134  result->status_ = dqm_core::Result::Red;
135  }
136  result->tags_["YellowMETComponents"] = ycnt;
137  result->tags_["RedMETComponents"] = rcnt;
138 
140 
141  return result;
142 }

◆ printDescription()

void dqm_algorithms::HLTMETComponents::printDescription ( std::ostream &  out)

Definition at line 145 of file HLTMETComponents.cxx.

146 {
147 
148  out << "HLT MET Components: Of the 25 components (24 calo samplings and 1 muon component of MET) ";
149  out << "Check if any sub-detector component is empty. Empty means any of the following:";
150  out << " overflow/underflow bins are filled, or integral of histogram is zero. " << std::endl;
151  out<< "Each component (25 of them) are bins on abscissa and the 1d histograms represent the quantity (SumEt)" << std::endl;
152 
153 }

The documentation for this struct was generated from the following files:
get_generator_info.result
result
Definition: get_generator_info.py:21
IsA
#define IsA
Declare the TObject style functions.
Definition: xAODTEventBranch.h:59
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
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
dqm_algorithms::HLTMETComponents::HLTMETComponents
HLTMETComponents()
Definition: HLTMETComponents.cxx:27
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