Go to the documentation of this file.00001 #ifndef DQM_ECALCOMMON_UtilFunctions_H
00002 #define DQM_ECALCOMMON_UtilFunctions_H
00003
00012 #include <cmath>
00013 #include <iostream>
00014
00015 #include "TH1F.h"
00016 #include "TProfile.h"
00017 #include "TClass.h"
00018
00019 class MonitorElement;
00020
00021 namespace ecaldqm {
00022
00023 enum Directions {
00024 kLeft,
00025 kRight
00026 };
00027
00028
00029
00030
00031
00032
00033
00034 void calcBins(int binWidth, int divisor, long int start_time, long int last_time, long int current_time,
00035 long int & binDiff, long int & diff);
00036
00037
00038
00039 void shift(TH1 *h, Directions d, int bins);
00040
00041
00042
00043 void shift2Right(TH1* h, int bins);
00044
00045
00046
00047 void shift2Left(TH1* h, int bins);
00048
00049
00050
00051 void shiftAxis(TH1 *h, Directions d, double shift);
00052
00053
00054
00055 void getAverageFromTProfile(TProfile* p, double& mean, double& rms);
00056
00057
00058
00059 void getMeanRms(TObject* pre, TObject* cur, double& mean, double& rms);
00060
00061 TObject* cloneIt(MonitorElement* me, std::string histo);
00062
00063 }
00064
00065 #endif