Belle II Software development
TOPRingPlotterModule.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <framework/core/Module.h>
12#include <TTree.h>
13#include <TH2F.h>
14#include <TFile.h>
15#include <analysis/VariableManager/Manager.h>
16#include <mdst/dataobjects/Track.h>
17
18namespace Belle2 {
29
30 public:
31
36
38 void initialize() override;
39
40
42 void event() override;
43
44
46 void terminate() override;
47
48
49 private:
50
52 void fillPDF(Belle2::Const::ChargedStable, const Track*, TH2F*, short*, float*, int&, int&);
53
55 void resetTree();
56
57
58 static const int m_MaxPhotons = 5000;
59 static const int m_MaxPDFPhotons = 5000;
61 // steering parameters
62 std::string m_particleList = "pi+:all";
63 std::string m_outputName = "TOPRings.root";
64 int m_toyNumber = 1;
65 bool m_saveHistograms = false;
66 bool m_saveLLScan = false;
68 TFile* m_outputFile = nullptr;
69 TTree* m_tree = nullptr;
72 std::vector<double> m_branchAddresses = {};
74 std::vector<Variable::Manager::FunctionPtr> m_functions = {};
76 std::vector<std::string> m_variables = {};
77
78 std::vector<short> m_pdgHyp = {11, 13, 211, 321, 2212};
94 short m_nDigits = 0;
107 int m_pdfToysP = 0;
109 int m_pdfToysK = 0;
111 int m_pdfToysPI = 0;
113 int m_pdfToysMU = 0;
115 int m_pdfToysE = 0;
118 float m_scanMass[10000] = {0};
119 float m_scanLL[10000] = {0};
122 TH2F* m_hitMapMCK = nullptr;
123 TH2F* m_hitMapMCPI = nullptr;
124 TH2F* m_hitMapMCP = nullptr;
125 TH2F* m_hitMapMCE = nullptr;
126 TH2F* m_hitMapMCMU = nullptr;
128 TH2F* m_pdfAsHisto = nullptr;
130 };
132}
Provides a type-safe way to pass members of the chargedStableSet set.
Definition: Const.h:589
Base class for Modules.
Definition: Module.h:72
A module to plot the x-t images from TOP, and in general study the distribution of the digits associa...
short m_digitQuality[m_MaxPhotons]
Digit quality
float m_pdfTimePI[m_MaxPDFPhotons]
array with the times of the sampled pseudo-hits for the pion PDF
float m_pdfTimeE[m_MaxPDFPhotons]
array with the times of the sampled pseudo-hits for the electron PDF
short m_digitPixelCol[m_MaxPhotons]
Pixel column.
short m_pdfPixelK[m_MaxPDFPhotons]
array with the pixel location of the sampled pseudo-hits for the kaon PDF
TTree * m_tree
tree where data are saved.
std::vector< std::string > m_variables
List of variables to save.
short m_digitPixel[m_MaxPhotons]
Pixel number (1-512)
short m_digitSlot[m_MaxPhotons]
Slot number (1-16)
TH2F * m_hitMapMCPI
x-t plot of the pion PDF
short m_digitPixelRow[m_MaxPhotons]
Pixel row.
std::vector< short > m_pdgHyp
List of pdg codes for which the PDF is sampled and saved.
void initialize() override
Prepares the tree.
TOPRingPlotterModule()
Constructor: Sets the description, the properties and the parameters of the module.
float m_pdfTimeP[m_MaxPDFPhotons]
array with the times of the sampled pseudo-hits for the proton PDF
void event() override
Fills the tree.
float m_scanLL[10000]
LL values of the scan.
void fillPDF(Belle2::Const::ChargedStable, const Track *, TH2F *, short *, float *, int &, int &)
Fills the pdf-related branches.
bool m_saveHistograms
Set true to save the histograms of the maps.
float m_digitAmplitude[m_MaxPhotons]
Digit amplitude [ADC].
int m_pdfSamplesPI
total number of samples drawn from the pion PDF
void terminate() override
Writes the tree.
TH2F * m_hitMapMCK
x-t plot of the kaon PDF
int m_pdfToysP
total number of toys from the proton PDF
TH2F * m_hitMapMCMU
x-t plot of the muon PDF
std::vector< double > m_branchAddresses
Variable branch addresses.
int m_pdfSamplesK
total number of samples drawn from the kaon PDF
bool m_saveLLScan
Set to true to save the results of the LL scan.
static const int m_MaxPhotons
maximum number of digits allowed per PDF
int m_pdfSamplesMU
total number of samples drawn from the muon PDF
int m_pdfToysMU
total number of toys from the muon PDF
std::string m_outputName
Name of the output file.
short m_digitBoardstack[m_MaxPhotons]
BoardStack number
int m_pdfToysPI
total number of toys from the pion PDF
static const int m_MaxPDFPhotons
maximum number of digits allowed per PDF
std::vector< Variable::Manager::FunctionPtr > m_functions
List of function pointers corresponding to given variables.
int m_pdfSamplesE
total number of samples drawn from the electron PDF
std::string m_particleList
List of particles to be used for plotting.
short m_digitCarrier[m_MaxPhotons]
Carrier number
float m_scanMass[10000]
masses used in the LL scan
short m_pdfPixelE[m_MaxPDFPhotons]
array with the pixel location of the sampled pseudo-hits for the electron PDF
short m_digitAsic[m_MaxPhotons]
Asic number
float m_pdfTimeMU[m_MaxPDFPhotons]
array with the times of the sampled pseudo-hits for the muon PDF
void resetTree()
reset the tree variables.
short m_digitASICChannel[m_MaxPhotons]
ASIC channel number.
TH2F * m_hitMapMCE
x-t plot of the electron PDF
int m_pdfToysK
total number of toys from the kaon PDF
TH2F * m_pdfAsHisto
histogram to hot the PDF that will be sampled
float m_digitTime[m_MaxPhotons]
Digit calibrated time [ns].
short m_digitChannel[m_MaxPhotons]
SW channel (0-511)
short m_pdfPixelPI[m_MaxPDFPhotons]
array with the pixel location of the sampled pseudo-hits for the pion PDF
short m_pdfPixelP[m_MaxPDFPhotons]
array with the pixel location of the sampled pseudo-hits for the proton PDF
float m_digitWidth[m_MaxPhotons]
Digit calibrated width [ns].
short m_digitPMTNumber[m_MaxPhotons]
Digit PMT number.
int m_nScanPoints
number of points used in the LL scan
short m_nDigits
Total number of digits in the slot where the track is extrapolated.
int m_toyNumber
Number of toys used to populate the arrays of expected hits.
TH2F * m_hitMapMCP
x-t plot of the proton PDF
short m_pdfPixelMU[m_MaxPDFPhotons]
array with the pixel location of the sampled pseudo-hits for the muon PDF
float m_pdfTimeK[m_MaxPDFPhotons]
array with the times of the sampled pseudo-hits for the kaon PDF
int m_pdfToysE
total number of toys from the electron PDF
int m_pdfSamplesP
total number of samples drawn from the proton PDF
Class that bundles various TrackFitResults.
Definition: Track.h:25
Abstract base class for different kinds of events.