Belle II Software development
CDCDedxPIDCreatorModule::DEDX Struct Reference

Helper structure for merging dEdx measurements. More...

Public Member Functions

void add (const CDCDedxHit &hit_in, int cWire_in, int cLayer_in, double dx_in, double dE_in)
 Add measurement on the same wire.
 
void add (const DEDX &dedx)
 Add measurement in the same layer.
 

Public Attributes

const CDCDedxHithit = nullptr
 hit
 
int cWire = -1
 continuous wire number
 
int cLayer = -1
 continuous layer number
 
double dx = 0
 track length
 
double dE = 0
 energy deposit
 
int nhits = 0
 number of merged hits
 
double dxMax = 0
 longest track length
 

Detailed Description

Helper structure for merging dEdx measurements.

Definition at line 67 of file CDCDedxPIDCreatorModule.h.

Member Function Documentation

◆ add() [1/2]

void add ( const CDCDedxHit hit_in,
int  cWire_in,
int  cLayer_in,
double  dx_in,
double  dE_in 
)
inline

Add measurement on the same wire.

Parameters
hit_inwire hit
cWire_incontinuous wire number
cLayer_incontinuous layer number
dx_intrack length
dE_inenergy deposit

Definition at line 84 of file CDCDedxPIDCreatorModule.h.

85 {
86 if (not hit) {
87 hit = &hit_in;
88 cWire = cWire_in;
89 cLayer = cLayer_in;
90 dx = dx_in;
91 dE = dE_in;
92 nhits = 1;
93 dxMax = dx;
94 } else if (hit_in.getWireID() == hit->getWireID()) {
95 dx += dx_in;
96 if (hit->getADCCount() != hit_in.getADCCount()) dE += dE_in; // these hits are not piled-up
97 nhits++;
98 if (dx_in > dxMax) dxMax = dx_in;
99 } else {
100 B2ERROR("DEDX helper: measurements on different wires cannot be merged");
101 }
102 }
const WireID & getWireID() const
Returns wire identifier.
Definition: CDCDedxHit.h:66
unsigned short getADCCount() const
Returns ADC count.
Definition: CDCDedxHit.h:78

◆ add() [2/2]

void add ( const DEDX dedx)
inline

Add measurement in the same layer.

Parameters
dedxmeasurement

Definition at line 108 of file CDCDedxPIDCreatorModule.h.

109 {
110 if (cLayer < 0) {
111 cWire = dedx.cWire;
112 cLayer = dedx.cLayer;
113 dx = dedx.dx;
114 dE = dedx.dE;
115 nhits = dedx.nhits;
116 dxMax = dedx.dxMax;
117 } else if (dedx.cLayer == cLayer) {
118 dx += dedx.dx;
119 dE += dedx.dE;
120 nhits += dedx.nhits;
121 if (dedx.dxMax > dxMax) {
122 dxMax = dedx.dxMax;
123 cWire = dedx.cWire; // wire ID with longest hit
124 }
125 } else {
126 B2ERROR("DEDX helper: measurements in different layers cannot be merged");
127 }
128 }

Member Data Documentation

◆ cLayer

int cLayer = -1

continuous layer number

Definition at line 70 of file CDCDedxPIDCreatorModule.h.

◆ cWire

int cWire = -1

continuous wire number

Definition at line 69 of file CDCDedxPIDCreatorModule.h.

◆ dE

double dE = 0

energy deposit

Definition at line 72 of file CDCDedxPIDCreatorModule.h.

◆ dx

double dx = 0

track length

Definition at line 71 of file CDCDedxPIDCreatorModule.h.

◆ dxMax

double dxMax = 0

longest track length

Definition at line 74 of file CDCDedxPIDCreatorModule.h.

◆ hit

const CDCDedxHit* hit = nullptr

hit

Definition at line 68 of file CDCDedxPIDCreatorModule.h.

◆ nhits

int nhits = 0

number of merged hits

Definition at line 73 of file CDCDedxPIDCreatorModule.h.


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