Belle II Software prerelease-11-00-00a
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 68 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 85 of file CDCDedxPIDCreatorModule.h.

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

◆ add() [2/2]

void add ( const DEDX & dedx)
inline

Add measurement in the same layer.

Parameters
dedxmeasurement

Definition at line 109 of file CDCDedxPIDCreatorModule.h.

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

Member Data Documentation

◆ cLayer

int cLayer = -1

continuous layer number

Definition at line 71 of file CDCDedxPIDCreatorModule.h.

◆ cWire

int cWire = -1

continuous wire number

Definition at line 70 of file CDCDedxPIDCreatorModule.h.

◆ dE

double dE = 0

energy deposit

Definition at line 73 of file CDCDedxPIDCreatorModule.h.

◆ dx

double dx = 0

track length

Definition at line 72 of file CDCDedxPIDCreatorModule.h.

◆ dxMax

double dxMax = 0

longest track length

Definition at line 75 of file CDCDedxPIDCreatorModule.h.

◆ hit

const CDCDedxHit* hit = nullptr

hit

Definition at line 69 of file CDCDedxPIDCreatorModule.h.

◆ nhits

int nhits = 0

number of merged hits

Definition at line 74 of file CDCDedxPIDCreatorModule.h.


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