Belle II Software development
SVDAPVHistograms< H > Class Template Reference

template class for the APV Histograms More...

#include <SVDAPVHistograms.h>

Inheritance diagram for SVDAPVHistograms< H >:

Public Types

enum  E_side {
  VIndex = 0 ,
  UIndex = 1
}
 This enumeration assure the same semantic of the isU methods defined by Peter Kv. More...
 

Public Member Functions

 SVDAPVHistograms ()
 Default constructor.
 
 SVDAPVHistograms (const H &templateAPV)
 Use.
 
 ~SVDAPVHistograms ()
 clean everything in the destructor
 
H * getHistogram (const VxdID &vxdID, int view, int apv)
 get a reference to the histogram for
 
template<class ... Types>
void fill (const VxdID &vxdID, int view, int apv, Types ... args)
 fill the histogram for
 
template<class ... Types>
void fill (const VxdID &vxdID, bool isU, int apv, Types ... args)
 fill the histogram for
 
void customizeString (std::string &base, const VxdID &vxdID, bool isU, int user_apv)
 replaces layer ladder sensor view and apv with the current numbers
 
void clean ()
 delete pointers
 

Private Types

typedef std::vector< H * > t_Views
 A t_SVDView is a vector of H that will have length = # APV chips.
 
typedef std::vector< t_Viewst_SVDSensor
 a vector of vector of H, length = 2
 
typedef std::vector< t_SVDSensort_SVDLadder
 A t_SVDLadder is a vector of t_SVDSensors.
 
typedef std::vector< t_SVDLaddert_SVDLayer
 A t_SVDLayer is a vector of t_SVDLadders.
 
typedef std::vector< t_SVDLayert_SVD
 The t_SVD is a vector of t_SVDLayers.
 

Private Member Functions

void customize (H &histogram, VxdID vxdID, int view, int apv)
 customize the histogram with the sensor, view and APV numbers
 
 ClassDef (SVDAPVHistograms, 1)
 needed by root
 

Private Attributes

t_SVD m_histograms
 the vector of vector ... that contains all histograms
 
H * m_defaultHistogram
 the default histogram
 

Detailed Description

template<class H>
class Belle2::SVDAPVHistograms< H >

template class for the APV Histograms

Definition at line 24 of file SVDAPVHistograms.h.

Member Typedef Documentation

◆ t_SVD

typedef std::vector< t_SVDLayer > t_SVD
private

The t_SVD is a vector of t_SVDLayers.

a vector of vector of vector of vector of vector of H, length = # layers

Definition at line 139 of file SVDAPVHistograms.h.

◆ t_SVDLadder

typedef std::vector< t_SVDSensor > t_SVDLadder
private

A t_SVDLadder is a vector of t_SVDSensors.

a vector of vector of vector of H, length = # svd sensors

Definition at line 133 of file SVDAPVHistograms.h.

◆ t_SVDLayer

typedef std::vector< t_SVDLadder > t_SVDLayer
private

A t_SVDLayer is a vector of t_SVDLadders.

a vector of vector of vector of vector of H, length = # ladders

Definition at line 136 of file SVDAPVHistograms.h.

◆ t_SVDSensor

typedef std::vector< t_Views > t_SVDSensor
private

a vector of vector of H, length = 2

Definition at line 130 of file SVDAPVHistograms.h.

◆ t_Views

typedef std::vector< H* > t_Views
private

A t_SVDView is a vector of H that will have length = # APV chips.

Index 0 for the V side, index 1 for the U side Please, please, pleaseeeee use SVDAPVHistograms<...>::UIndex and SVDAPVHistograms<...>::VIndex instead of 1 and 0 for better code readibility a vector of H, length = # APV chips

Definition at line 128 of file SVDAPVHistograms.h.

Member Enumeration Documentation

◆ E_side

enum E_side

This enumeration assure the same semantic of the isU methods defined by Peter Kv.

Definition at line 39 of file SVDAPVHistograms.h.

39{ VIndex = 0, UIndex = 1 };

Constructor & Destructor Documentation

◆ SVDAPVHistograms()

SVDAPVHistograms ( )
inline

Default constructor.

Definition at line 28 of file SVDAPVHistograms.h.

28 :
29 SVDAPVHistograms(H()) {};
SVDAPVHistograms()
Default constructor.

◆ ~SVDAPVHistograms()

~SVDAPVHistograms ( )
inline

clean everything in the destructor

Definition at line 35 of file SVDAPVHistograms.h.

35{ clean(); };
void clean()
delete pointers

Member Function Documentation

◆ clean()

void clean ( )
inline

delete pointers

Definition at line 107 of file SVDAPVHistograms.h.

108 {
109
110 for (auto layer : m_histograms)
111 for (auto ladder : layer)
112 for (auto sensor : ladder)
113 for (auto view : sensor)
114 for (auto apv : view)
115 delete apv;
116 }
t_SVD m_histograms
the vector of vector ... that contains all histograms

◆ customizeString()

void customizeString ( std::string &  base,
const VxdID vxdID,
bool  isU,
int  user_apv 
)
inline

replaces layer ladder sensor view and apv with the current numbers

Definition at line 90 of file SVDAPVHistograms.h.

91 {
92 std::string layer = std::to_string(vxdID.getLayerNumber());
93 std::string ladder = std::to_string(vxdID.getLadderNumber());
94 std::string sensor = std::to_string(vxdID.getSensorNumber());
95 std::string apv = std::to_string(user_apv);
96 std::string view = isU ? "U" : "V" ;
97 base = std::regex_replace(base, std::regex("[@]layer"), layer);
98 base = std::regex_replace(base, std::regex("[@]ladder"), ladder);
99 base = std::regex_replace(base, std::regex("[@]sensor"), sensor);
100 base = std::regex_replace(base, std::regex("[@]view"), view);
101 std::string side = isU ? "P" : "N" ;
102 base = std::regex_replace(base, std::regex("[@]side"), side);
103 base = std::regex_replace(base, std::regex("[@]apv"), apv);
104 }

◆ fill() [1/2]

void fill ( const VxdID vxdID,
bool  isU,
int  apv,
Types ...  args 
)
inline

fill the histogram for

Parameters
vxdIDside
isU
apv
argsvalue to be filled

Definition at line 83 of file SVDAPVHistograms.h.

84 {
85 int view = isU ? UIndex : VIndex;
86 getHistogram(vxdID, view, apv)->Fill(args...);
87 }
H * getHistogram(const VxdID &vxdID, int view, int apv)
get a reference to the histogram for

◆ fill() [2/2]

void fill ( const VxdID vxdID,
int  view,
int  apv,
Types ...  args 
)
inline

fill the histogram for

Parameters
vxdIDside
view
apv
argsvalue to be filled

Definition at line 71 of file SVDAPVHistograms.h.

72 {
73 getHistogram(vxdID, view, apv)->Fill(args...);
74 }

◆ getHistogram()

H * getHistogram ( const VxdID vxdID,
int  view,
int  apv 
)
inline

get a reference to the histogram for

Parameters
vxdIDside
viewand
apvplease, use the enumeration SVDAPVHistograms::Vindex and SVDAPVHistograms::UIndex

Definition at line 44 of file SVDAPVHistograms.h.

45 {
46 H* returnValue = m_defaultHistogram;
47 try {
48 auto layer = m_histograms.at(vxdID.getLayerNumber());
49 auto ladder = layer.at(vxdID.getLadderNumber());
50 auto sensor = ladder.at(vxdID.getSensorNumber());
51 auto theView = sensor.at(view);
52 returnValue = theView.at(apv);
53 } catch (...) {
54 B2WARNING("Unexpected VxdID/view/apv. VxdID: " << (std::string)(vxdID)
55 << " view : " << view
56 << " apv : " << apv);
57
58 returnValue = m_defaultHistogram;
59 }
60
61 return returnValue;
62 }
H * m_defaultHistogram
the default histogram

Member Data Documentation

◆ m_defaultHistogram

H* m_defaultHistogram
private

the default histogram

Definition at line 142 of file SVDAPVHistograms.h.

◆ m_histograms

t_SVD m_histograms
private

the vector of vector ... that contains all histograms

Definition at line 141 of file SVDAPVHistograms.h.


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