Belle II Software development
DedxDriftCell Class Reference

A class to hold the geometry of a cell. More...

#include <LineHelper.h>

Public Member Functions

 DedxDriftCell (const DedxLine &left, const DedxLine &top, const DedxLine &right, const DedxLine &bot)
 Construct a DedxDriftCell from four different DedxLines (sides)
 
 DedxDriftCell (const DedxPoint &tl, const DedxPoint &tr, const DedxPoint &br, const DedxPoint &bl)
 Construct a DedxDriftCell from four different DedxPoints (corners)
 
bool isValid ()
 Check if this is a valid calculation (number of intersections = 2)
 
double dx (const DedxPoint &poca, double entAng)
 Calculate the path length through this cell for a track with a given DedxPoint Of Closest Approach (poca) and entrance angle (entAng)
 
double dx (double doca, double entAng)
 Calculate the path length through this cell for a track with a given Distance Of Closest Approach (doca) and entrance angle (entAng)
 

Private Attributes

DedxLine m_Left
 the left boundary of the cell
 
DedxLine m_Top
 the left boundary of the cell
 
DedxLine m_Right
 the left boundary of the cell
 
DedxLine m_Bot
 the left boundary of the cell
 
bool m_isValid
 does the hit land in this cell
 

Detailed Description

A class to hold the geometry of a cell.

This class is used to actually calculate the path length of a track moving through a given cell.

Definition at line 186 of file LineHelper.h.

Constructor & Destructor Documentation

◆ DedxDriftCell() [1/2]

DedxDriftCell ( const DedxLine left,
const DedxLine top,
const DedxLine right,
const DedxLine bot 
)
inline

Construct a DedxDriftCell from four different DedxLines (sides)

Definition at line 191 of file LineHelper.h.

191 : m_Left(left), m_Top(top),
192 m_Right(right), m_Bot(bot), m_isValid(true) {}
DedxLine m_Right
the left boundary of the cell
Definition: LineHelper.h:282
DedxLine m_Top
the left boundary of the cell
Definition: LineHelper.h:281
DedxLine m_Left
the left boundary of the cell
Definition: LineHelper.h:280
DedxLine m_Bot
the left boundary of the cell
Definition: LineHelper.h:283
bool m_isValid
does the hit land in this cell
Definition: LineHelper.h:284

◆ DedxDriftCell() [2/2]

DedxDriftCell ( const DedxPoint tl,
const DedxPoint tr,
const DedxPoint br,
const DedxPoint bl 
)
inline

Construct a DedxDriftCell from four different DedxPoints (corners)

Definition at line 195 of file LineHelper.h.

195 : m_Left(bl, tl), m_Top(tl, tr),
196 m_Right(tr, br), m_Bot(br, bl), m_isValid(true) {}

Member Function Documentation

◆ dx() [1/2]

double dx ( const DedxPoint poca,
double  entAng 
)
inline

Calculate the path length through this cell for a track with a given DedxPoint Of Closest Approach (poca) and entrance angle (entAng)

Definition at line 203 of file LineHelper.h.

204 {
205 // The path length (dx) is the length of the track in this cell.
206 double Dx = 0;
207
208 // The DedxPoint Of Closest Approach (poca) is useful for a reference point
209 // to construct a line that represents the track.
210 DedxLine track = DedxLine(poca, std::tan(M_PI_2 - entAng));
211
212 // Find the points of intersection with each cell boundary
213 DedxPoint intLeft = m_Left.intersection(track);
214 DedxPoint intTop = m_Top.intersection(track);
215 DedxPoint intRight = m_Right.intersection(track);
216 DedxPoint intBot = m_Bot.intersection(track);
217
218 std::vector<DedxPoint> endpoints;
219 if (intLeft.isValid())
220 endpoints.push_back(intLeft);
221 if (intTop.isValid())
222 endpoints.push_back(intTop);
223 if (intRight.isValid())
224 endpoints.push_back(intRight);
225 if (intBot.isValid())
226 endpoints.push_back(intBot);
227
228 // Make sure we only get two intersections!
229 if (endpoints.size() == 2) {
230 Dx = endpoints[0].length(endpoints[1]);
231 if (Dx == 0)
232 m_isValid = false;
233 } else
234 m_isValid = false;
235
236 return Dx;
237 }
DedxPoint intersection(const DedxLine &l)
Find the intersection of this and another line.
Definition: LineHelper.h:112
double length(const DedxPoint &p)
Calculate the distance between this and another point.
Definition: LineHelper.h:53

◆ dx() [2/2]

double dx ( double  doca,
double  entAng 
)
inline

Calculate the path length through this cell for a track with a given Distance Of Closest Approach (doca) and entrance angle (entAng)

Definition at line 241 of file LineHelper.h.

242 {
243 // The path length (dx) is the length of the track in this cell.
244 double Dx = 0;
245
246 // The DedxPoint Of Closest Approach (poca) is useful for a reference point
247 // to construct a line that represents the track.
248 const DedxPoint poca = DedxPoint(doca * std::abs(std::cos(entAng)), -1.0 * doca * std::sin(entAng));
249 DedxLine track = DedxLine(poca, std::tan(M_PI_2 - entAng));
250
251 // Find the points of intersection with each cell boundary
252 DedxPoint intLeft = m_Left.intersection(track);
253 DedxPoint intTop = m_Top.intersection(track);
254 DedxPoint intRight = m_Right.intersection(track);
255 DedxPoint intBot = m_Bot.intersection(track);
256
257 std::vector< DedxPoint > endpoints;
258 if (intLeft.isValid())
259 endpoints.push_back(intLeft);
260 if (intTop.isValid())
261 endpoints.push_back(intTop);
262 if (intRight.isValid())
263 endpoints.push_back(intRight);
264 if (intBot.isValid())
265 endpoints.push_back(intBot);
266
267 // Make sure we only get two intersections!
268 if (endpoints.size() == 2) {
269 Dx = endpoints[0].length(endpoints[1]);
270 if (Dx == 0)
271 m_isValid = false;
272 } else
273 m_isValid = false;
274
275 return Dx;
276 }
ROOT::Math::XYZVector poca(ROOT::Math::XYZVector const &trackPos, ROOT::Math::XYZVector const &trackP, ROOT::Math::XYZVector const &vtxPos)
Returns the Point Of Closest Approach of a track to a vertex.

◆ isValid()

bool isValid ( )
inline

Check if this is a valid calculation (number of intersections = 2)

Definition at line 199 of file LineHelper.h.

199{ return m_isValid; }

Member Data Documentation

◆ m_Bot

DedxLine m_Bot
private

the left boundary of the cell

Definition at line 283 of file LineHelper.h.

◆ m_isValid

bool m_isValid
private

does the hit land in this cell

Definition at line 284 of file LineHelper.h.

◆ m_Left

DedxLine m_Left
private

the left boundary of the cell

Definition at line 280 of file LineHelper.h.

◆ m_Right

DedxLine m_Right
private

the left boundary of the cell

Definition at line 282 of file LineHelper.h.

◆ m_Top

DedxLine m_Top
private

the left boundary of the cell

Definition at line 281 of file LineHelper.h.


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