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 
10 #include <cmath>
11 #include <iostream>
12 
13 #include "TH1F.h"
14 #include "TProfile.h"
15 #include "TClass.h"
16 
17 class MonitorElement;
18 
19 namespace ecaldqm {
20 
21  enum Directions {
24  };
25 
26  // functions implemented here are not universal in the sense that
27  // the input variables are changed due to efficiency of memory usage.
28 
29 
30  // calculated time intervals and bin locations for time varing profiles
31 
32  void calcBins(int binWidth, int divisor, long int start_time, long int last_time, long int current_time,
33  long int & binDiff, long int & diff);
34 
35  // shift bins in the given direction
36 
37  void shift(TH1 *h, Directions d, int bins);
38 
39  // shift bins in histograms to the right
40 
41  void shift2Right(TH1* h, int bins);
42 
43  // shift bins in histograms to the left
44 
45  void shift2Left(TH1* h, int bins);
46 
47  // shift axis of histograms keeping the bin contents
48 
49  void shiftAxis(TH1 *h, Directions d, double shift);
50 
51  // get mean and rms of Y values from TProfile
52 
53  void getAverageFromTProfile(TProfile* p, double& mean, double& rms);
54 
55  // get mean and rms based on two histograms' difference
56 
57  void getMeanRms(TObject* pre, TObject* cur, double& mean, double& rms);
58 
59  TObject* cloneIt(MonitorElement* me, std::string histo);
60 
61 }
62 
63 #endif
void getAverageFromTProfile(TProfile *p, double &mean, double &rms)
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)