ATLAS Offline Software
Loading...
Searching...
No Matches
Muon::MuonDQAFitFunc Class Reference

Tool to fit histograms. More...

#include <MuonDQAFitFunc.h>

Inheritance diagram for Muon::MuonDQAFitFunc:
Collaboration diagram for Muon::MuonDQAFitFunc:

Public Member Functions

 MuonDQAFitFunc (const std::string &type, const std::string &name, const IInterface *parent)
 constructor
virtual ~MuonDQAFitFunc ()
 destructor
void ZmumuFitHistograms (TH1F *hmass, TH1F *hwidth, TH1F *h1[], int nbins)
void MuonEffHisto1D (TH1F *h_Num, TH1F *h_Denom, TProfile *h_Eff) const
void MuonEffHisto2D (TH2F *h_Num, TH2F *h_Denom, TProfile2D *h_Eff) const
void MinWindow1Set_from_TProf (TProfile *hProf, float windowMin, float windowMax) const
 ================================================================
void MinWindow2Set_from_TProf (TProfile2D *hProf, float windowMin, float windowMax) const
void FillMeanRmsProj (TH2F *, TH1F *, int) const
void FillRMSFromProfile (TProfile *, TH1F *) const
 Fills a histogram with the RMS values of a TProfile.
void FillRMSFromCharProfile (TProfile *, TH1F *) const
 Fills a histogram with the RMS values of a TProfile, which labeled bins->keeping the labeling for the bins.
void FillGausMeanOrWidth (TH2F *, TH1F *, float, float, int) const
void FillGaussMeanAndWidth (TH2F *, TH1F *, float, float) const
void FillGaussMeanAndWidth (TH1F *, TH1F *, int, float, float) const
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Static Public Member Functions

static const InterfaceID & interfaceID ()
 access to tool interface

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed.

Protected Attributes

float m_minMuonEffWindow
float m_maxMuonEffWindow

Static Protected Attributes

static const int NBINS =6

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

double m_ZmumuPDGmass
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default)
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Tool to fit histograms.

The tool can be used to:

Definition at line 30 of file MuonDQAFitFunc.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ MuonDQAFitFunc()

Muon::MuonDQAFitFunc::MuonDQAFitFunc ( const std::string & type,
const std::string & name,
const IInterface * parent )

constructor

Definition at line 24 of file MuonDQAFitFunc.cxx.

25 : AthAlgTool(ty,na,pa),
28 {
29 declareProperty("ZmumuPDGmass", m_ZmumuPDGmass=Zmass);
30 declareProperty("minMuonEffWindow", m_minMuonEffWindow);
31 declareProperty("maxMuonEffWindow", m_maxMuonEffWindow);
32 declareInterface<MuonDQAFitFunc>(this);
33 }
AthAlgTool()
Default constructor:
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ ~MuonDQAFitFunc()

virtual Muon::MuonDQAFitFunc::~MuonDQAFitFunc ( )
inlinevirtual

destructor

Definition at line 37 of file MuonDQAFitFunc.h.

37{};

Member Function Documentation

◆ declareGaudiProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T, V, H > & hndl,
const SG::VarHandleKeyType &  )
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

const ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

ServiceHandle< StoreGateSvc > & AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase & ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ FillGausMeanOrWidth()

void Muon::MuonDQAFitFunc::FillGausMeanOrWidth ( TH2F * h2d,
TH1F * h1d,
float MinFit,
float MaxFit,
int iopt ) const

Definition at line 248 of file MuonDQAFitFunc.cxx.

249 {
250
251
252 //Makes a Gaussian fit to each bin of a TH2F and fills a TH1F with
253 //the either the mean or width of this Gaussian
254
255 //calling this means that the histogram bin content is flagged
256 //as being an average and so adding histos from different jobs
257 //will produce weighted mean
258 h1d->SetBit(TH1::kIsAverage);
259
260 int nBins_2d = h2d->GetNbinsX();
261 int nBins_1d = h1d->GetNbinsX();
262
263 if(nBins_2d!=nBins_1d) ATH_MSG_DEBUG("Mean/Width Histograms not set up correctly - nBins mismatch");
264
265 for(int i = 1; i!=nBins_2d+1; i++){
266
267 TH1F* hProj = (TH1F*)h2d->ProjectionY("Proj",i,i,"e");
268
269 //do not fill if there are no entries in the bin
270 if(hProj->GetEntries()<=0) {
271 delete hProj;
272 continue;
273 }
274
275 TF1 *fit = new TF1("fit","gaus",MinFit,MaxFit);
276
277 hProj->Fit("fit","RQNM");
278 float Mean = fit->GetParameter(1);
279 float MeanSigma = fit->GetParError(1);
280 float Width = fit->GetParameter(2);
281 float WidthSigma = fit->GetParError(2);
282
283 if(iopt==0){
284 h1d->SetBinContent(i,Mean);
285 h1d->SetBinError(i,MeanSigma);
286 }
287 else if(iopt==1){
288 h1d->SetBinContent(i,Width);
289 h1d->SetBinError(i,WidthSigma);
290 }
291 else ATH_MSG_DEBUG("Incorrect switch in FillGausMeanOrWidth");
292
293 delete hProj;
294 delete fit;
295 }
296
297 return;
298
299 }
#define ATH_MSG_DEBUG(x)
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)

◆ FillGaussMeanAndWidth() [1/2]

void Muon::MuonDQAFitFunc::FillGaussMeanAndWidth ( TH1F * h1,
TH1F * h2,
int nbin,
float MinFit,
float MaxFit ) const

Definition at line 361 of file MuonDQAFitFunc.cxx.

362 {
363 // Makes a Gaussian fit to a TH1F and fills the given bin of another TH1F
364 // with the mean of this Gaussian, and the errors with the width.
365
366 //calling this means that the histogram bin content is flagged
367 //as being an average and so adding histos from different jobs
368 //will produce weighted mean
369 h2->SetBit(TH1::kIsAverage);
370
371 //do not fill if there are no entries in h1
372 if(h1->GetEntries()<=0) return;
373
374 TF1 *fit = new TF1("fit","gaus",MinFit,MaxFit);
375 h1->Fit("fit","RQNM");
376 float Mean = fit->GetParameter(1);
377 // float MeanSigma = fit->GetParError(1);
378 float Width = fit->GetParameter(2);
379 // float WidthSigma = fit->GetParError(2);
380
381 h2->SetBinContent(nbin,Mean);
382 h2->SetBinError(nbin,Width);
383 delete fit;
384 h2->SetEntries(h1->GetEntries());
385 return;
386 }

◆ FillGaussMeanAndWidth() [2/2]

void Muon::MuonDQAFitFunc::FillGaussMeanAndWidth ( TH2F * h2d,
TH1F * h1d,
float MinFit,
float MaxFit ) const

Definition at line 303 of file MuonDQAFitFunc.cxx.

304 {
305
306
307 //Makes a Gaussian fit to each bin of a TH2F and fills a TH1F,
308 // the mean of this Gaussian, and the errors the width.
309
310 //calling this means that the histogram bin content is flagged
311 //as being an average and so adding histos from different jobs
312 //will produce weighted mean
313 h1d->SetBit(TH1::kIsAverage);
314
315 int nBins_2d = h2d->GetNbinsX();
316 int nBins_1d = h1d->GetNbinsX();
317
318 if(nBins_2d!=nBins_1d) ATH_MSG_DEBUG("Mean/Width Histograms not set up correctly - nBins mismatch");
319
320 for(int i = 1; i!=nBins_2d+1; i++){
321
322 TH1F* hProj = (TH1F*)h2d->ProjectionY("Proj",i,i,"e");
323
324 int numNonEmptyBins = 0;
325 for (int ii = 0; ii < (int)hProj->GetNbinsX()+1; ++ii)
326 {
327 if (hProj->GetBinContent(ii)>0.) ++numNonEmptyBins;
328 }
329
330 //do not fill if there are no entries in the bin
331 //if(hProj->GetEntries()<=0) {
332 if((hProj->GetEntries()<=0)||(numNonEmptyBins<2)) {
333 delete hProj;
334 continue;
335 }
336
337 TF1 *fit = new TF1("fit","gaus",MinFit,MaxFit);
338
339 hProj->Fit("fit","RQNM");
340 float Mean = fit->GetParameter(1);
341 // float MeanSigma = fit->GetParError(1);
342 float Width = fit->GetParameter(2);
343 // float WidthSigma = fit->GetParError(2);
344
345 h1d->SetBinContent(i,Mean);
346 h1d->SetBinError(i, Width);
347
348 delete hProj;
349 delete fit;
350 }
351
352 h1d->SetEntries(h2d->GetEntries());
353 return;
354
355 }

◆ FillMeanRmsProj()

void Muon::MuonDQAFitFunc::FillMeanRmsProj ( TH2F * h2d,
TH1F * h1d,
int MeanRms ) const

Definition at line 142 of file MuonDQAFitFunc.cxx.

143 {
144
145 // fills a 1-D histogram with either the mean or RMS of the residual distribution for each layer in the barrel.
146 // Does this by projecting a 2-D histo of residual vs layer.
147
148 int nBins_2d = h2d->GetNbinsX();
149 int nBins_1d = h1d->GetNbinsX();
150
151 if(nBins_2d!=nBins_1d) ATH_MSG_DEBUG("Mean/RMS Histograms not set up correctly - nBins mismatch");
152
153 //calling this means that the histogram bin content is flagged
154 //as being an average and so adding histos from different jobs
155 //will produce weighted mean
156
157 h1d->SetBit(TH1::kIsAverage);
158
159 for(int j = 1; j!=nBins_2d+1; j++){
160
161 TH1F* hproj = (TH1F*)h2d->ProjectionY("Proj",j,j,"e");
162
163 //do not fill if there are no entries in the bin
164 if(hproj->GetEntries()<=0) {
165 delete hproj;
166 continue;
167 }
168
169 if(MeanRms==0){
170 h1d->SetBinContent(j,hproj->GetMean());
171 h1d->SetBinError(j,hproj->GetMeanError());
172
173 }
174 else if(MeanRms==1){
175 h1d->SetBinContent(j,hproj->GetRMS());
176 h1d->SetBinError(j,hproj->GetRMSError());
177 }
178 else ATH_MSG_DEBUG("Incorrect switch in MeanRMSProjectionsBarrel()");
179
180 delete hproj;
181 }
182
183 return;
184 }

◆ FillRMSFromCharProfile()

void Muon::MuonDQAFitFunc::FillRMSFromCharProfile ( TProfile * hProf_char,
TH1F * hRms_char ) const

Fills a histogram with the RMS values of a TProfile, which labeled bins->keeping the labeling for the bins.

Definition at line 215 of file MuonDQAFitFunc.cxx.

216 {
217
218 //Uses the spread information in an already filled TProfile (with character bins)
219 //to fill a second TH1F with the (correctly weigthed by N events) RMS of each bin
220
221 int nBins = hProf_char->GetNbinsX();
222
223 for(int j = 1; j!=nBins+1; j++){
224
225 //float bincentre = (float)hProf->GetBinCenter(j);
226 const char* BinLabel_char = hProf_char->GetXaxis()->GetBinLabel(j);
227
228 //By default this is RMS/sqrt(N)
229 float binerr = (float)hProf_char->GetBinError(j);
230
231 //getting binentries
232 float binentries = (float)hProf_char->GetBinEntries(j);
233
234 //calculating the RMS from the above quantities
235 float rms = (float)binerr*(std::sqrt(binentries));
236
237 hRms_char->SetCanExtend(TH1::kAllAxes);
238 hRms_char->Fill(BinLabel_char,rms);
239
240 } // Loop over bins
241
242 hRms_char->LabelsDeflate("X");
243 if (hRms_char->GetEntries() > 0) hRms_char->LabelsOption("v");
244 return;
245 }

◆ FillRMSFromProfile()

void Muon::MuonDQAFitFunc::FillRMSFromProfile ( TProfile * hProf,
TH1F * hRms ) const

Fills a histogram with the RMS values of a TProfile.

Definition at line 187 of file MuonDQAFitFunc.cxx.

188 {
189 //Uses the spread information in an already filled TProfile
190 //to fill a second TH1F with the (correctly weigthed by N events) RMS of each bin
191
192 int nBins = hProf->GetNbinsX();
193
194 for(int j = 1; j!=nBins+1; j++){
195
196 float bincentre = (float)hProf->GetBinCenter(j);
197
198 //By default this is RMS/sqrt(N)
199 float binerr = (float)hProf->GetBinError(j);
200
201 //getting binentries
202 float binentries = (float)hProf->GetBinEntries(j);
203
204 //calculating the RMS from the above quantities
205 float rms = (float)binerr*(std::sqrt(binentries));
206
207 hRms->Fill(bincentre,rms);
208 } // Loop over bins
209
210 return;
211 }

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & Muon::MuonDQAFitFunc::interfaceID ( )
inlinestatic

access to tool interface

Definition at line 40 of file MuonDQAFitFunc.h.

40{ return IID_MuonDQAFitFunc; }
static const InterfaceID IID_MuonDQAFitFunc("Muon::MuonDQAFitFunc", 1, 0)

◆ MinWindow1Set_from_TProf()

void Muon::MuonDQAFitFunc::MinWindow1Set_from_TProf ( TProfile * hProf,
float windowMin,
float windowMax ) const

================================================================

Establishes a minimim window for the TProfile

Definition at line 117 of file MuonDQAFitFunc.cxx.

118 {
119 float min=hProf->GetMinimum();
120 float max=hProf->GetMaximum();
121 float margin=0.05*(max-min);
122 if(min > windowMin) min=windowMin-margin;
123 if(max < windowMax) max=windowMax+margin;
124 hProf->SetMinimum(min);
125 hProf->SetMaximum(max);
126
127 }
#define min(a, b)
Definition cfImp.cxx:40
#define max(a, b)
Definition cfImp.cxx:41

◆ MinWindow2Set_from_TProf()

void Muon::MuonDQAFitFunc::MinWindow2Set_from_TProf ( TProfile2D * hProf,
float windowMin,
float windowMax ) const

Definition at line 130 of file MuonDQAFitFunc.cxx.

131 {
132 float min=hProf->GetMinimum();
133 float max=hProf->GetMaximum();
134 float margin=0.05*(max-min);
135 if(min > windowMin) min=windowMin-margin;
136 if(max < windowMax) max=windowMax+margin;
137 hProf->SetMinimum(min);
138 hProf->SetMaximum(max);
139 }

◆ msg()

MsgStream & AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24 {
25 return this->msgStream();
26 }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30 {
31 return this->msgLevel(lvl);
32 }

◆ MuonEffHisto1D()

void Muon::MuonDQAFitFunc::MuonEffHisto1D ( TH1F * h_Num,
TH1F * h_Denom,
TProfile * h_Eff ) const

Definition at line 70 of file MuonDQAFitFunc.cxx.

71 {
72 int nBins;
73 nBins = h_Num->GetNbinsX();
74 for (int bin=0; bin!=nBins; ++bin) {
75 int nPass = int(h_Num->GetBinContent(bin+1));
76 int nFail = int(h_Denom->GetBinContent(bin+1)) - nPass;
77 double x = h_Denom->GetBinCenter(bin+1);
78 for (int pass=0; pass!=nPass; ++pass) {
79 h_Eff->Fill(x,1.);
80 }
81 for (int fail=0; fail!=nFail; ++fail) {
82 h_Eff->Fill(x,0.);
83 }
84 }
86
87 }
#define x
void MinWindow1Set_from_TProf(TProfile *hProf, float windowMin, float windowMax) const
================================================================
fail(message)

◆ MuonEffHisto2D()

void Muon::MuonDQAFitFunc::MuonEffHisto2D ( TH2F * h_Num,
TH2F * h_Denom,
TProfile2D * h_Eff ) const

Definition at line 90 of file MuonDQAFitFunc.cxx.

91 {
92 int nBins;
93 int nBinsY;
94 nBins = h_Num->GetNbinsX();
95 nBinsY = h_Num->GetNbinsY();
96 for (int bin=0; bin!=nBins; ++bin) {
97 for (int binY=0; binY!=nBinsY; ++binY) {
98 int nPass = int(h_Num->GetBinContent(bin+1,binY+1));
99 int nFail = int(h_Denom->GetBinContent(bin+1,binY+1)) - nPass;
100 double x = h_Denom->GetXaxis()->GetBinCenter(bin+1);
101 double y = h_Denom->GetYaxis()->GetBinCenter(binY+1);
102 for (int pass=0; pass!=nPass; ++pass) {
103 h_Eff->Fill(x,y,1.);
104 }
105 for (int fail=0; fail!=nFail; ++fail) {
106 h_Eff->Fill(x,y,0.);
107 }
108 }
109 }
111
112 }
#define y
void MinWindow2Set_from_TProf(TProfile2D *hProf, float windowMin, float windowMax) const
@ binY
Definition BinningType.h:48

◆ outputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ renounce()

std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce(T &h)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in asg::AsgMetadataTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and DerivationFramework::CfAthAlgTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase & )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308 {
309 // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310 // << " size: " << m_vhka.size() << endmsg;
311 for (auto &a : m_vhka) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }
std::vector< SG::VarHandleKeyArray * > m_vhka

◆ ZmumuFitHistograms()

void Muon::MuonDQAFitFunc::ZmumuFitHistograms ( TH1F * hmass,
TH1F * hwidth,
TH1F * h1[],
int nbins )

Definition at line 36 of file MuonDQAFitFunc.cxx.

37 {
38 double mass=0.;
39 double mass_error=0.;
40 double width=0.;
41 double width_error=0.;
42 double maxmass=0;
43 double maxwidth=0;
44 TF1 *ZmumFit = new TF1("ZmumFit","gaus",89.,93.);
45 for (int i=0; i<nbins; i++) {
46 if (h1[i]->GetEntries()>50) {
47 ZmumFit->SetParameter(1,3.097);
48 ZmumFit->SetParameter(2,0.05);
49 h1[i]->Fit("ZmumFit","RQNM");
50 mass=ZmumFit->GetParameter(1)-m_ZmumuPDGmass;
51 mass_error=ZmumFit->GetParError(1);
52 width=ZmumFit->GetParameter(2);
53 width_error=ZmumFit->GetParError(2);
54 hmass->SetBinContent(i+1,mass);
55 hmass->SetBinError(i+1,mass_error);
56 hwidth->SetBinContent(i+1,width);
57 hwidth->SetBinError(i+1,width_error);
58 if( (std::abs(mass)+mass_error)>maxmass ) maxmass=std::abs(mass)+mass_error;
59 if( (std::abs(width)+width_error)>maxwidth ) maxwidth=std::abs(width)+width_error;
60 }
61 }
62 if (maxmass>0.1) maxmass=0.1;
63 if (maxwidth>0.2) maxwidth=0.2;
64 hmass->SetAxisRange(-maxmass,maxmass,"Y");
65 hwidth->SetAxisRange(0.,maxwidth,"Y");
66
67 delete ZmumFit;
68 }
TGraphErrors * GetEntries(TH2F *histo)
const double width

Member Data Documentation

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_maxMuonEffWindow

float Muon::MuonDQAFitFunc::m_maxMuonEffWindow
protected

Definition at line 67 of file MuonDQAFitFunc.h.

◆ m_minMuonEffWindow

float Muon::MuonDQAFitFunc::m_minMuonEffWindow
protected

Definition at line 66 of file MuonDQAFitFunc.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.

◆ m_ZmumuPDGmass

double Muon::MuonDQAFitFunc::m_ZmumuPDGmass
private

Definition at line 70 of file MuonDQAFitFunc.h.

◆ NBINS

const int Muon::MuonDQAFitFunc::NBINS =6
staticprotected

Definition at line 65 of file MuonDQAFitFunc.h.


The documentation for this class was generated from the following files: