CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UtilsClient.h
Go to the documentation of this file.
1 #ifndef UtilsClient_H
2 #define UtilsClient_H
3 
17 #include "TObject.h"
18 
19 class TH1;
20 class TProfile;
21 class TProfile2D;
22 class TClass;
23 
24 class UtilsClient {
25 
26  public:
27 
34  template<class T> static T getHisto( const MonitorElement* me, bool clone = false, T ret = 0);
35 
42  static void printBadChannels( const MonitorElement* me, TH1* hi, bool positive_only = false );
43 
52  static bool getBinStatistics( TH1* histo, const int ix, const int iy, float& num, float& mean, float& rms, float minEntries = 1. );
53 
59  static bool getBinQuality( const MonitorElement* me, const int ix, const int iy );
60 
66  static bool getBinStatus( const MonitorElement* me, const int ix, const int iy );
67 
73  static void maskBinContent( const MonitorElement* me, const int ix, const int iy );
74 
79  static int getFirstNonEmptyChannel( const TProfile2D* histo );
80 
81  private:
82 
83  UtilsClient() {}; // Hidden to force static use
84  ~UtilsClient() {}; // Hidden to force static use
85 
86 };
87 
88 template<class T>
89 inline
90 T
92 {
93  if( me ) {
94  TObject* ob = const_cast<MonitorElement*>(me)->getRootObject();
95  if( ob ) {
96  if( clone ) {
97  if( ret ) {
98  delete ret;
99  }
100  std::string s = "ME " + me->getName();
101  ret = dynamic_cast<T>(ob->Clone(s.c_str()));
102  if( ret ) {
103  ret->SetDirectory(0);
104  }
105  } else {
106  ret = dynamic_cast<T>(ob);
107  }
108  } else {
109  ret = 0;
110  }
111  } else {
112  if( !clone ) {
113  ret = 0;
114  }
115  }
116  return ret;
117 }
118 
119 #endif
const std::string & getName(void) const
get name of ME
static T getHisto(const MonitorElement *me, bool clone=false, T ret=0)
Returns the histogram contained by the Monitor Element.
Definition: UtilsClient.h:91
static bool getBinQuality(const MonitorElement *me, const int ix, const int iy)
Returns true if the bin quality is good or masked.
Definition: UtilsClient.cc:201
static void maskBinContent(const MonitorElement *me, const int ix, const int iy)
Mask the bin content.
Definition: UtilsClient.cc:231
static bool getBinStatus(const MonitorElement *me, const int ix, const int iy)
Returns true if the bin status is red/dark red.
Definition: UtilsClient.cc:216
Utilities for Ecal Monitor Client.
Definition: UtilsClient.h:24
static bool getBinStatistics(TH1 *histo, const int ix, const int iy, float &num, float &mean, float &rms, float minEntries=1.)
Returns true if the bin contains good statistical data.
Definition: UtilsClient.cc:74
long long int num
Definition: procUtils.cc:71
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
Definition: eve_macros.cc:135
long double T
static void printBadChannels(const MonitorElement *me, TH1 *hi, bool positive_only=false)
Print the bad channels.
Definition: UtilsClient.cc:14
static int getFirstNonEmptyChannel(const TProfile2D *histo)
Find the first non empty bin.
Definition: UtilsClient.cc:246