DAS  3.0
Das Analysis System
Matrix

Description

Functor to extract a 2D distribution with physical axes from a 2ND distribution with bin IDs.

Intended to be used together with axisLoop and nodeLoop.

+ Collaboration diagram for Matrix:

Public Member Functions

 Matrix (TH2 *h, TUnfoldBinning *bng2)
 
void operator() (TDirectory *dOut, TString name2, TUnfoldBinning *node2, vector< double > x2, TString title2)
 

Public Attributes

TH2 * hIn
 
TUnfoldBinning * binning2
 
TString name1
 
TUnfoldBinning * node1
 
vector< int > ibins1
 
vector< double > x1
 
TString title1
 

Constructor & Destructor Documentation

◆ Matrix()

Matrix ( TH2 *  h,
TUnfoldBinning *  bng2 
)
inline
96  :
97  hIn(h), binning2(bng2), node1(nullptr)
98  { }

Member Function Documentation

◆ operator()()

void operator() ( TDirectory *  dOut,
TString  name2,
TUnfoldBinning *  node2,
vector< double >  x2,
TString  title2 
)
inline
Parameters
dOutoutput directory
name2partial name (w.r.t. 2nd axis)
node2local node (2nd axis)
x2physical values (2nd axis)
title2simplistic title, based on bin edges
105  {
106  const TVectorD * edges1 = node1->GetDistributionBinning(0),
107  * edges2 = node2->GetDistributionBinning(0);
108  int nbins1 = edges1->GetNrows()-1,
109  nbins2 = edges2->GetNrows()-1;
110  TString name = name1 + "__" + name2,
111  title = title1 + "-- " + title2;
112 
113 // const char * name = Form("%s_%s" , X.h->GetName() , Y.h->GetName() ),
114 // * title = Form("%s, %s;%s;%s;%s", X.h->GetTitle() , Y.h->GetTitle() ,
115 // X.h->GetXaxis()->GetTitle(), Y.h->GetXaxis()->GetTitle(),
116 // h->GetYaxis()->GetTitle() );
117 
118  TH2F hOut(name, title, nbins1, edges1->GetMatrixArray(),
119  nbins2, edges2->GetMatrixArray());
120  for (int ibin1 = 1; ibin1 <= nbins1; ++ibin1)
121  for (int ibin2 = 1; ibin2 <= nbins2; ++ibin2) {
122  x1.front() = hOut.GetXaxis()->GetBinLowEdge(ibin1);
123  x2.front() = hOut.GetYaxis()->GetBinLowEdge(ibin2);
124  int Ibin1 = node1->GetGlobalBinNumber(x1.data()),
125  Ibin2 = node2->GetGlobalBinNumber(x2.data());
126  auto content = hIn->GetBinContent(Ibin1, Ibin2);
127  hOut.SetBinContent(ibin1, ibin2, content);
128  }
129  hOut.SetDirectory(dOut);
130  hOut.SetMinimum(hIn->GetMinimum());
131  hOut.SetMaximum(hIn->GetMaximum());
132  hOut.Write();
133  }

Member Data Documentation

◆ binning2

TUnfoldBinning* binning2

global binning (2nd axis)

◆ hIn

TH2* hIn

input histogram with bin IDs

◆ ibins1

vector<int> ibins1

global bin IDs of present iteration

◆ name1

TString name1

partial name (w.r.t. 1st axis)

◆ node1

TUnfoldBinning* node1

local node (1st axis)

◆ title1

TString title1

simplistic title (1st axis)

◆ x1

vector<double> x1

physical values (1st axis)


The documentation for this struct was generated from the following file:
DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.name
name
Definition: DYToLL_M-50_13TeV_pythia8_cff_GEN_SIM_RECOBEFMIX_DIGI_L1_DIGI2RAW_L1Reco_RECO.py:48
DAS::Unfolding::ExtractHistogram::Matrix::node1
TUnfoldBinning * node1
local node (1st axis)
Definition: getUnfPhysDist.cc:91
DAS::Unfolding::ExtractHistogram::Matrix::hIn
TH2 * hIn
input histogram with bin IDs
Definition: getUnfPhysDist.cc:87
DAS::Unfolding::ExtractHistogram::Matrix::binning2
TUnfoldBinning * binning2
global binning (2nd axis)
Definition: getUnfPhysDist.cc:88
DAS::Unfolding::ExtractHistogram::Matrix::title1
TString title1
simplistic title (1st axis)
Definition: getUnfPhysDist.cc:94
DAS::Unfolding::ExtractHistogram::Matrix::name1
TString name1
partial name (w.r.t. 1st axis)
Definition: getUnfPhysDist.cc:90
DAS::Unfolding::ExtractHistogram::Matrix::x1
vector< double > x1
physical values (1st axis)
Definition: getUnfPhysDist.cc:93