ATLAS Offline Software
Functions | Variables
ConfAnalysis.cxx File Reference
#include "ConfAnalysis.h"
#include "ConfVtxAnalysis.h"
#include "TrigInDetAnalysis/TrackFilter.h"
#include "TrigInDetAnalysis/TIDAEvent.h"
#include "TrigInDetAnalysis/TIDARoiDescriptor.h"
#include <fstream>
#include "BinConfig.h"
#include "TF1.h"
#include "TMath.h"
#include "globals.h"

Go to the source code of this file.

Functions

std::ofstream dumpfile ("dumpfile.log")
 
void Normalise (TH1 *h)
 
TF1 * FitFWGaussian (TH1D *s, double a, double b)
 
void fitSin (TH1D *h, const std::string &parent="")
 
double wrapphi (double phi)
 fill all the histograms - matched histograms, efficiencies etc More...
 

Variables

bool PRINT_BRESIDUALS = false
 stack trace headers More...
 
BinConfig g_binConfig ("standard")
 
BinConfig electronBinConfig ("electron")
 
BinConfig muonBinConfig ("muon")
 
BinConfig tauBinConfig ("tau")
 
BinConfig bjetBinConfig ("bjet")
 
BinConfig cosmicBinConfig ("cosmic")
 
int Nvtxtracks
 
int NvtxCount
 

Detailed Description

Author
mark sutton
Date
$Id: ConfAnalysis.cxx 800361 2017-03-12 14:33:19Z

Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration

Definition in file ConfAnalysis.cxx.

Function Documentation

◆ dumpfile()

std::ofstream dumpfile ( "dumpfile.log"  )

◆ FitFWGaussian()

TF1* FitFWGaussian ( TH1D *  s,
double  a,
double  b 
)

Definition at line 872 of file ConfAnalysis.cxx.

872  {
873 
874  // std::cout << "FitFWGaussian " << s->GetName() << std::endl;
875 
876  // TF1* f1 = new TF1("gausr", "gaus");
877  TF1* f1 = new TF1("gausr", "[0]*exp(-(x-[1])*(x-[1])/([2]*[2]))");
878 
879  f1->SetNpx(5000);
880  f1->SetLineWidth(1);
881 
882  f1->SetParameter(0,s->GetBinContent(s->GetMaximumBin()) );
883  f1->SetParameter(1,s->GetBinCenter(s->GetMaximumBin()));
884  // f1->SetParameter(2,s->GetRMS());
885  f1->SetParameter(2,1.5);
886  f1->FixParameter(2,1.5);
887 
888  f1->SetParName(0, "Norm");
889  f1->SetParName(1, "Mean");
890  f1->SetParName(2, "Sigma");
891 
892  int nbins=0;
893  for (int j=1 ; j<=s->GetNbinsX() ; j++) if (s->GetBinContent(j)) nbins++;
894 
895  if (nbins>2) {
896  if ( a==-999 || b==-999 ) s->Fit(f1,"Q");
897  else s->Fit(f1,"Q", "", a, b);
898  }
899  else for ( int j=0 ; j<3 ; j++ ) f1->SetParameter(j, 0);
900 
901  // std::cout << "return" << std::endl;
902 
903  return f1;
904 }

◆ fitSin()

void fitSin ( TH1D *  h,
const std::string &  parent = "" 
)

Definition at line 910 of file ConfAnalysis.cxx.

910  {
911 
912  TF1* fsin = new TF1( "sinp", "sqrt([0]*[0])*sin([1]-x)+[2]" ); // , -M_PI, M_PI );
913 
914  fsin->SetParameter(0,1);
915  fsin->SetParameter(1,0);
916  fsin->SetParameter(2,0);
917 
918  fsin->SetLineWidth(1);
919 
920  // h->SetTitle(";track #phi;d_{0} [mm]");
921 
922  std::cout << __FUNCTION__ << " " << h->GetName() << std::endl;
923  h->Fit( fsin, "", "", -M_PI, M_PI );
924 
925  double radius = fsin->GetParameter(0);
926  double phi = fsin->GetParameter(1);
927 
928  double y = radius*sin(phi);
929  double x = radius*cos(phi);
930 
931  std::cout << parent << "\t" << h->GetTitle() << "\tx = " << x << "\ty = " << y << std::endl;
932 
933  delete fsin;
934 }

◆ Normalise()

void Normalise ( TH1 *  h)

Definition at line 33 of file ConfAnalysis.cxx.

33  {
34 
35  for ( int i=1 ; i<=h->GetNbinsX() ; i++ ) {
36 
37  double del = h->GetBinLowEdge(i+1)-h->GetBinLowEdge(i);
38 
39  h->SetBinContent( i, h->GetBinContent(i)/del );
40  h->SetBinError( i, h->GetBinError(i)/del );
41  }
42 
43 }

◆ wrapphi()

double wrapphi ( double  phi)

fill all the histograms - matched histograms, efficiencies etc

Definition at line 1221 of file ConfAnalysis.cxx.

1221  {
1222  if ( phi<-M_PI ) phi += 2*M_PI;
1223  if ( phi> M_PI ) phi -= 2*M_PI;
1224  return phi;
1225 }

Variable Documentation

◆ bjetBinConfig

BinConfig bjetBinConfig("bjet")

◆ cosmicBinConfig

BinConfig cosmicBinConfig("cosmic")

◆ electronBinConfig

BinConfig electronBinConfig("electron")

◆ g_binConfig

BinConfig g_binConfig("standard")

◆ muonBinConfig

BinConfig muonBinConfig("muon")

◆ NvtxCount

int NvtxCount

Definition at line 18 of file globals.cxx.

◆ Nvtxtracks

int Nvtxtracks

Definition at line 17 of file globals.cxx.

◆ PRINT_BRESIDUALS

bool PRINT_BRESIDUALS = false

stack trace headers

globals for communicating with *Analyses TagNProbe class

Definition at line 29 of file ConfAnalysis.cxx.

◆ tauBinConfig

BinConfig tauBinConfig("tau")
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
M_PI
#define M_PI
Definition: ActiveFraction.h:11
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
x
#define x
SCT_CalibAlgs::nbins
@ nbins
Definition: SCT_CalibNumbers.h:10
lumiFormat.i
int i
Definition: lumiFormat.py:85
test_pyathena.parent
parent
Definition: test_pyathena.py:15
plotBeamSpotMon.b
b
Definition: plotBeamSpotMon.py:77
ParticleGun_SamplingFraction.radius
radius
Definition: ParticleGun_SamplingFraction.py:96
a
TList * a
Definition: liststreamerinfos.cxx:10
y
#define y
h
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
read_hist_ntuple.f1
f1
Definition: read_hist_ntuple.py:4