Belle II Software release-09-00-00
CDCDedxPIDCreatorModule::DEDX Struct Reference

Helper structure for merging dEdx measurements. More...

Collaboration diagram for CDCDedxPIDCreatorModule::DEDX:

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 70 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 87 of file CDCDedxPIDCreatorModule.h.

88 {
89 if (not hit) {
90 hit = &hit_in;
91 cWire = cWire_in;
92 cLayer = cLayer_in;
93 dx = dx_in;
94 dE = dE_in;
95 nhits = 1;
96 dxMax = dx;
97 } else if (hit_in.getWireID() == hit->getWireID()) {
98 dx += dx_in;
99 if (hit->getADCCount() != hit_in.getADCCount()) dE += dE_in; // these hits are not piled-up
100 nhits++;
101 if (dx_in > dxMax) dxMax = dx_in;
102 } else {
103 B2ERROR("DEDX helper: measurements on different wires cannot be merged");
104 }
105 }
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 111 of file CDCDedxPIDCreatorModule.h.

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

Member Data Documentation

◆ cLayer

int cLayer = -1

continuous layer number

Definition at line 73 of file CDCDedxPIDCreatorModule.h.

◆ cWire

int cWire = -1

continuous wire number

Definition at line 72 of file CDCDedxPIDCreatorModule.h.

◆ dE

double dE = 0

energy deposit

Definition at line 75 of file CDCDedxPIDCreatorModule.h.

◆ dx

double dx = 0

track length

Definition at line 74 of file CDCDedxPIDCreatorModule.h.

◆ dxMax

double dxMax = 0

longest track length

Definition at line 77 of file CDCDedxPIDCreatorModule.h.

◆ hit

const CDCDedxHit* hit = nullptr

hit

Definition at line 71 of file CDCDedxPIDCreatorModule.h.

◆ nhits

int nhits = 0

number of merged hits

Definition at line 76 of file CDCDedxPIDCreatorModule.h.


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