CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
UtilFunctions.h
Go to the documentation of this file.
1 #ifndef DQM_ECALCOMMON_UtilFunctions_H
2 #define DQM_ECALCOMMON_UtilFunctions_H
3 
12 #include <cmath>
13 #include <iostream>
14 
15 #include "TH1F.h"
16 #include "TProfile.h"
17 #include "TClass.h"
18 
19 class MonitorElement;
20 
21 namespace ecaldqm {
22 
23  enum Directions {
26  };
27 
28  // functions implemented here are not universal in the sense that
29  // the input variables are changed due to efficiency of memory usage.
30 
31 
32  // calculated time intervals and bin locations for time varing profiles
33 
34  void calcBins(int binWidth, int divisor, long int start_time, long int last_time, long int current_time,
35  long int & binDiff, long int & diff);
36 
37  // shift bins in the given direction
38 
39  void shift(TH1 *h, Directions d, int bins);
40 
41  // shift bins in histograms to the right
42 
43  void shift2Right(TH1* h, int bins);
44 
45  // shift bins in histograms to the left
46 
47  void shift2Left(TH1* h, int bins);
48 
49  // shift axis of histograms keeping the bin contents
50 
51  void shiftAxis(TH1 *h, Directions d, double shift);
52 
53  // get mean and rms of Y values from TProfile
54 
55  void getAverageFromTProfile(TProfile* p, double& mean, double& rms);
56 
57  // get mean and rms based on two histograms' difference
58 
59  void getMeanRms(TObject* pre, TObject* cur, double& mean, double& rms);
60 
61  TObject* cloneIt(MonitorElement* me, std::string histo);
62 
63 }
64 
65 #endif
void getAverageFromTProfile(TProfile *p, double &mean, double &rms)
unsigned long long start_time
Definition: procUtils.cc:98
void shiftAxis(TH1 *h, Directions d, double shift)
void shift2Left(TH1 *h, int bins)
void shift(TH1 *h, Directions d, int bins)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
Definition: Activities.doc:4
TObject * cloneIt(MonitorElement *me, std::string histo)
void calcBins(int binWidth, int divisor, long int start_time, long int last_time, long int current_time, long int &binDiff, long int &diff)
void shift2Right(TH1 *h, int bins)
void getMeanRms(TObject *pre, TObject *cur, double &mean, double &rms)