ATLAS Offline Software
Loading...
Searching...
No Matches
TripleGaussCollFit.cxx File Reference
#include "dqm_algorithms/TripleGaussCollFit.h"
#include <dqm_core/AlgorithmManager.h>
#include <dqm_core/exceptions.h>
#include <dqm_algorithms/tools/AlgorithmHelper.h>
#include "ers/ers.h"
#include "TH2.h"
#include "TH1.h"
#include "TF1.h"
#include "TClass.h"
#include <iostream>
#include <cmath>

Go to the source code of this file.

Namespaces

namespace  dqm_algorithms

Macros

#define PARAM_IS_AREA
#define ADJUST_VAL   startVal = startVal * hist1D->GetBinWidth(1) / m_gaus3_fn->GetParameter(2) / 2.5066

Typedefs

typedef std::map< std::string, double > param_map
typedef std::map< std::string, double > err_map

Functions

Double_t getStartValue (TH1 *thehist, Double_t minx, Double_t maxx)
void multLB_writeTags (std::vector< int > *goodLB, dqm_core::Result *result, const TH1 *thehist)

Variables

const char *const fmt = "%0*d"

Macro Definition Documentation

◆ ADJUST_VAL

#define ADJUST_VAL   startVal = startVal * hist1D->GetBinWidth(1) / m_gaus3_fn->GetParameter(2) / 2.5066

Definition at line 380 of file TripleGaussCollFit.cxx.

◆ PARAM_IS_AREA

#define PARAM_IS_AREA

Definition at line 165 of file TripleGaussCollFit.cxx.

Typedef Documentation

◆ err_map

typedef std::map<std::string, double> err_map

Definition at line 163 of file TripleGaussCollFit.cxx.

◆ param_map

typedef std::map<std::string, double> param_map

Definition at line 162 of file TripleGaussCollFit.cxx.

Function Documentation

◆ getStartValue()

Double_t getStartValue ( TH1 * thehist,
Double_t minx,
Double_t maxx )

Definition at line 70 of file TripleGaussCollFit.cxx.

70 {
71
72 Double_t result = 0.0;
73 int minidx = thehist->FindBin(minx), maxidx = thehist->FindBin(maxx);
74 for (int idx = minidx; idx <= maxidx; idx++) {
75 Double_t val = thehist->GetBinContent(idx);
76 if (val > result)
77 result = val;
78 }
79
80 return result;
81}

◆ multLB_writeTags()

void multLB_writeTags ( std::vector< int > * goodLB,
dqm_core::Result * result,
const TH1 * thehist )

Definition at line 86 of file TripleGaussCollFit.cxx.

86 {
87
88 /* This method assumes that the entries in goodLB are in ascending order!! */
89
90 char buf[10];
91 std::string lb_str = "LB_";
92 int firstLB = (*goodLB)[0], offset = 1;
93 unsigned int c = 1, sz = goodLB->size(), psz = static_cast<unsigned int>( std::log10(sz))+1;
94 Double_t lo, hi;
95
96 while (c < sz) {
97 if ((*goodLB)[c] == firstLB + offset)
98 offset++;
99
100 else {
101 std::string tagname = lb_str;
102 //find the low LB
103
104 lo = thehist->GetXaxis()->GetBinLowEdge(firstLB);
105
106 if (lo == std::floor(lo))
107 sprintf(buf, fmt, psz, static_cast<Int_t>(lo));
108 else
109 sprintf(buf, fmt, psz, static_cast<Int_t>(std::floor(lo))+1);
110
111 tagname += buf;
112 tagname += "_";
113
114 hi = thehist->GetXaxis()->GetBinUpEdge(firstLB+offset-1);
115
116 if (hi == std::floor(hi))
117 sprintf(buf, fmt, psz, static_cast<Int_t>(std::floor(hi))-1);
118 else
119 sprintf(buf, fmt, psz, static_cast<Int_t>(std::floor(hi)));
120
121 tagname += buf;
122 result->tags_ [tagname] = 1.0;
123 firstLB = (*goodLB)[c];
124 offset = 1;
125 }
126
127 c++; //I've always wanted to write this
128 }
129
130 lo = thehist->GetXaxis()->GetBinLowEdge(firstLB);
131
132 if (lo == std::floor(lo))
133 sprintf(buf, fmt, psz, static_cast<Int_t>(lo));
134 else
135 sprintf(buf, fmt, psz, static_cast<Int_t>(std::floor(lo))+1);
136
137 lb_str += buf;
138 lb_str += "_";
139 hi = thehist->GetXaxis()->GetBinUpEdge(firstLB+offset-1);
140 if (hi == std::floor(hi))
141 sprintf(buf, fmt, psz, static_cast<Int_t>(std::floor(hi))-1);
142 else
143 sprintf(buf, fmt, psz, static_cast<Int_t>(std::floor(hi)));
144 lb_str += buf;
145 result->tags_ [lb_str] = 1.0;
146
147}
static Double_t sz
const char *const fmt

Variable Documentation

◆ fmt

const char* const fmt = "%0*d"

Definition at line 84 of file TripleGaussCollFit.cxx.