#include "DataQualityUtils/MonitoringFile.h"
#include <iostream>
#include <algorithm>
#include <fstream>
#include <cmath>
#include <cstdlib>
#include <sstream>
#include <stdio.h>
#include <map>
#include <iomanip>
#include <set>
#include "TH1F.h"
#include "TH2F.h"
#include "TFile.h"
#include "TClass.h"
#include "TKey.h"
#include "TMath.h"
#include "TF1.h"
#include "TTree.h"
#include "TBranch.h"
#include "TList.h"
#include "TProfile.h"
#include "TMinuit.h"
Go to the source code of this file.
|
double | breitgausfun (double *x, double *par) |
|
void | TwoDto2D_Eff (TH2 *Numerator, TH2 *Denominator, TH2 *Efficiency, bool rebin2d=false) |
|
void | TwoDto1D_Mean (TH2 *h_parent, TH1 *h_child, int rebinning=1) |
|
void | TwoDto1D_Sum (TH2 *h_parent, TH1 *h_child, int rebinning=2) |
|
void | SetMassInfo (int iBin, TH1 *InputHist, TH1 *OutMean, TH1 *OutSigma, TString recalg_path) |
|
◆ breitgausfun()
double breitgausfun |
( |
double * |
x, |
|
|
double * |
par |
|
) |
| |
◆ SetMassInfo()
void SetMassInfo |
( |
int |
iBin, |
|
|
TH1 * |
InputHist, |
|
|
TH1 * |
OutMean, |
|
|
TH1 * |
OutSigma, |
|
|
TString |
recalg_path |
|
) |
| |
Definition at line 168 of file MonitoringFile_MuonTrackPostProcess.cxx.
169 if (
InputHist == NULL || OutMean == NULL || OutSigma == NULL) {
173 if (recalg_path ==
"Z") {
175 fit1->SetLineColor(kRed);
176 fit1->SetParameter(0, 3.0);
177 fit1->SetParameter(1, 91.2);
178 fit1->SetParameter(2,
InputHist->GetEntries());
179 fit1->SetParameter(3, 1.0);
180 InputHist->Fit(
"fit1",
"q",
"", 77, 105);
187 if (recalg_path ==
"Jpsi") {
188 InputHist->Fit(
"gaus",
"q",
"", 2.95, 3.25);
189 TF1* fit1 = (TF1*)
InputHist->GetFunction(
"gaus");
◆ TwoDto1D_Mean()
void TwoDto1D_Mean |
( |
TH2 * |
h_parent, |
|
|
TH1 * |
h_child, |
|
|
int |
rebinning = 1 |
|
) |
| |
Definition at line 116 of file MonitoringFile_MuonTrackPostProcess.cxx.
118 if (h_parent == NULL || h_child == NULL) {
121 if (h_parent->GetNbinsX() != h_child->GetNbinsX()) {
125 for (
int bin_itrX = 1; bin_itrX < h_parent->GetNbinsX() + 1; bin_itrX++) {
126 double parent_event = 0;
127 double parent_sum = 0;
128 for (
int bin_itrY = 1; bin_itrY < h_parent->GetNbinsY() + 1; bin_itrY++) {
129 parent_event += h_parent->GetBinContent(bin_itrX, bin_itrY);
130 parent_sum += h_parent->GetBinContent(bin_itrX, bin_itrY) * h_parent->GetYaxis()->GetBinCenter(bin_itrY);
132 if (parent_event == 0) {
137 TString sHistTitle = h_child->GetTitle();
138 h_child->Rebin(rebinning);
139 h_child->SetTitle(sHistTitle +
" per event");
140 h_child->Write(
"", TObject::kOverwrite);
◆ TwoDto1D_Sum()
void TwoDto1D_Sum |
( |
TH2 * |
h_parent, |
|
|
TH1 * |
h_child, |
|
|
int |
rebinning = 2 |
|
) |
| |
Definition at line 144 of file MonitoringFile_MuonTrackPostProcess.cxx.
146 if (h_parent == NULL || h_child == NULL) {
149 if (h_parent->GetNbinsX() != h_child->GetNbinsX()) {
153 for (
int bin_itrX = 1; bin_itrX < h_parent->GetNbinsX() + 1; bin_itrX++) {
154 double parent_sum = 0;
155 for (
int bin_itrY = 1; bin_itrY < h_parent->GetNbinsY() + 1; bin_itrY++) {
156 parent_sum += h_parent->GetBinContent(bin_itrX, bin_itrY) * h_parent->GetYaxis()->GetBinCenter(bin_itrY);
158 if (parent_sum == 0) {
163 h_child->Rebin(rebinning);
164 h_child->Write(
"", TObject::kOverwrite);
◆ TwoDto2D_Eff()
void TwoDto2D_Eff |
( |
TH2 * |
Numerator, |
|
|
TH2 * |
Denominator, |
|
|
TH2 * |
Efficiency, |
|
|
bool |
rebin2d = false |
|
) |
| |
Definition at line 84 of file MonitoringFile_MuonTrackPostProcess.cxx.
86 if (Numerator == NULL || Denominator == NULL || Efficiency == NULL) {
91 Efficiency->Rebin2D();
94 int n_xbins = Numerator->GetNbinsX();
95 if (Denominator->GetNbinsX() != n_xbins || Efficiency->GetNbinsX() != n_xbins) {
98 int n_ybins = Numerator->GetNbinsY();
99 if (Denominator->GetNbinsY() != n_ybins || Efficiency->GetNbinsY() != n_ybins) {
104 for (
int bin_itrX = 1; bin_itrX < Efficiency->GetNbinsX() + 1; bin_itrX++) {
105 for (
int bin_itrY = 1; bin_itrY < Efficiency->GetNbinsY() + 1; bin_itrY++) {
106 if (Denominator->GetBinContent(bin_itrX, bin_itrY) == 0)
continue;
107 Efficiency->SetBinContent(bin_itrX, bin_itrY,
108 Numerator->GetBinContent(bin_itrX,
109 bin_itrY) / Denominator->GetBinContent(bin_itrX, bin_itrY));
112 Efficiency->Write(
"", TObject::kOverwrite);
◆ SegStationName
Initial value:= {
"BIS", "BIL", "BMS", "BML", "BOS", "BOL", "BEE",
"EIS", "EIL", "EMS", "EML", "EOS", "EOL", "EES",
"EEL", "CSS", "CSL"
}
Definition at line 39 of file MonitoringFile_MuonTrackPostProcess.cxx.
double breitgausfun(double *x, double *par)