BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
BmnDigiContainerTemplate.h
Go to the documentation of this file.
1/* Copyright (C) 2021 Institute for Nuclear Research, Moscow
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Nikolay Karpushkin [committer] */
4
5/** \file BmnDigiContainerTemplate.h
6 ** \author Nikolay Karpushkin <karpushkin@inr.ru>
7 ** \date 18.01.2022
8 **/
9
10/** \class BmnDigiContainerTemplate
11 ** \brief Data class for Bmn digi container template
12 ** \version 1.0
13 **/
14
15#ifndef BmnDigiContainerTemplate_H
16#define BmnDigiContainerTemplate_H 1
17
18#include "TCanvas.h"
19#include "TGraph.h"
20#include "TROOT.h"
21
22#include <Rtypes.h> // for THashConsistencyHolder, ClassDefNV
23#include <boost/serialization/access.hpp>
24#include <boost/serialization/base_object.hpp>
25#include <numeric>
26#include <stdint.h>
27#include <string> // for string
28
30{
31
32 public:
33 /**@brief Default constructor.
34 **/
36
37 /** @brief Constructor with detailed assignment.
38 **/
40 int zl,
41 int integral,
42 int time_max,
43 int tot,
44 float fit_ampl,
45 float fit_zl,
46 float fit_integral,
47 float fit_R2,
48 float fit_time_max,
49 std::vector<float> wfm,
50 std::vector<float> fit_wfm);
51
52 /** Copy constructor **/
54
55 /** Move constructor **/
57
58 /** Assignment operator **/
60
61 /** Move Assignment operator **/
63
64 /** Destructor **/
66 {
67 std::vector<float>().swap(fWfm);
68 std::vector<float>().swap(fFitWfm);
69 }
70
71 /** @brief Class name (static)
72 ** @return BmnDigiContainerTemplate
73 **/
74 virtual const char* GetClassName() { return "BmnDigiContainerTemplate"; }
75
76 /** @brief Fit R2 quality
77 ** @return Fit R2 quality
78 **/
79 float GetFitR2() const { return fFitR2; };
80
81 /** @brief Waveform
82 ** @return Signal Waveform
83 **/
84 std::vector<float> GetWfm() const { return fWfm; }
85
86 void reset();
87
88 void DrawWfmWithTitle(TCanvas* canvas, TString hist_name);
89 const void DeleteCanvases() { gROOT->GetListOfCanvases()->Delete(); }
90
91 int fAmpl = 0; /// Amplitude from waveform [adc counts]
92 int fZL = 0; /// ZeroLevel from waveform [adc counts]
93 int fIntegral = 0; /// Energy deposition from waveform [adc counts]
94 int fTimeMax = 0; /// Time of maximum in waveform [adc samples]
95 int fToT = 0; /// Time over threshold [adc samples]
96
97 float fFitAmpl = 0.; /// Amplitude from fit of waveform [adc counts]
98 float fFitZL = 0.; /// ZeroLevel from fit of waveform [adc counts]
99 float fFitIntegral = 0.; /// Energy deposition from fit of waveform [adc counts]
100 float fFitR2 = 2.; /// Quality of waveform fit [] -- good near 0
101 float fFitTimeMax = -1.; /// Time of maximum in fit of waveform [adc samples]
102
103 std::vector<float> fWfm;
104 std::vector<float> fFitWfm;
105
106 template<class Archive>
107 void serialize(Archive& ar, const unsigned int /*version*/)
108 {
109 ar & fAmpl;
110 ar & fZL;
111 ar & fIntegral;
112 ar & fTimeMax;
113 ar & fToT;
114
115 ar & fFitAmpl;
116 ar & fFitZL;
117 ar & fFitIntegral;
118 ar & fFitR2;
119 ar & fFitTimeMax;
120
121 ar & fWfm;
122 ar & fFitWfm;
123 }
124
125 private:
126 /// BOOST serialization interface
128
130};
131
132#endif // BmnDigiContainerTemplate_H
#define ClassDefNV(name, id)
#define gROOT
BmnDigiContainerTemplate()
Default constructor.
std::vector< float > fWfm
Time of maximum in fit of waveform [adc samples].
float fFitTimeMax
Quality of waveform fit [] – good near 0.
float fFitZL
Amplitude from fit of waveform [adc counts].
float fFitR2
Energy deposition from fit of waveform [adc counts].
float GetFitR2() const
Fit R2 quality.
friend class boost::serialization::access
BOOST serialization interface.
int fToT
Time of maximum in waveform [adc samples].
void DrawWfmWithTitle(TCanvas *canvas, TString hist_name)
int fZL
Amplitude from waveform [adc counts].
float fFitIntegral
ZeroLevel from fit of waveform [adc counts].
void serialize(Archive &ar, const unsigned int)
BmnDigiContainerTemplate & operator=(const BmnDigiContainerTemplate &)
Assignment operator.
float fFitAmpl
Time over threshold [adc samples].
virtual ~BmnDigiContainerTemplate()
Destructor.
std::vector< float > GetWfm() const
Waveform.
int fTimeMax
Energy deposition from waveform [adc counts].
int fIntegral
ZeroLevel from waveform [adc counts].
virtual const char * GetClassName()
Class name (static).