13 #include "CLHEP/Geometry/Point3D.h"
16 #include "GaudiKernel/MsgStream.h"
39 static const double dRcut = 1.0e-7;
40 static const double dTcut = 1.0;
48 unsigned int endBC = 0;
49 unsigned int endId = 0;
50 unsigned int endHit = 0;
51 HepGeom::Point3D<double> lastEnd(0.0, 0.0, 0.0);
56 if (
it->particleLink().barcode() != lastBarcode ) {
60 lastBarcode =
it->particleLink().barcode();
61 persCont->
m_barcode.push_back(lastBarcode);
64 persCont->
m_nBC.push_back(
idx - endBC);
69 if ( (
int)
it->GetParticleEncoding() != lastId ) {
73 lastId =
it->GetParticleEncoding();
74 persCont->
m_id.push_back(lastId);
77 persCont->
m_nId.push_back(
idx - endId);
82 const HepGeom::Point3D<double> hitStart(
it->GetPreStepX(),
it->GetPreStepY(),
it->GetPreStepZ());
83 const double t =
it->GetGlobalTime();
85 const double dRLast = lastEnd.distance(hitStart);
86 const double dTLast = fabs(
t - lastT);
88 if (dRLast >= dRcut || dTLast >= dTcut) {
102 persCont->
m_hitId.push_back(
it->GetHitID() );
103 persCont->
m_kinEne.push_back(
it->GetKineticEnergy() );
106 persCont->
m_hitEne.push_back(
it->GetEnergyDeposit() );
107 persCont->
m_endX.push_back(
it->GetPostStepX() );
108 persCont->
m_endY.push_back(
it->GetPostStepY() );
109 persCont->
m_endZ.push_back(
it->GetPostStepZ() );
111 lastEnd = HepGeom::Point3D<double>(
it->GetPostStepX(),
it->GetPostStepY(),
it->GetPostStepZ());
116 persCont->
m_nBC.push_back(
idx - endBC);
117 persCont->
m_nId.push_back(
idx - endId);
123 std::unique_ptr<TRTUncompressedHitCollection> trans(std::make_unique<TRTUncompressedHitCollection>(
"DefaultCollectionName",persObj->
m_nHits.size()));
125 return(trans.release());
133 unsigned int hitCount = 0;
134 unsigned int idxBC = 0;
135 unsigned int idxId = 0;
136 unsigned int endHit = 0;
137 unsigned int endBC = 0;
138 unsigned int endId = 0;
140 for (
unsigned int i = 0;
i < persCont->
m_nHits.size();
i++) {
144 const unsigned int start = endHit;
149 for (
unsigned int j =
start; j < endHit; j++) {
151 if (j >= endBC + persCont->
m_nBC[idxBC])
152 endBC += persCont->
m_nBC[idxBC++];
154 if (j >= endId + persCont->
m_nId[idxId])
155 endId += persCont->
m_nId[idxId++];
157 const double eneLoss = persCont->
m_hitEne[hitCount];
159 HepGeom::Point3D<double> endThis(persCont->
m_endX[j], persCont->
m_endY[j], persCont->
m_endZ[j]);
164 eneLoss, endLast.x(), endLast.y(), endLast.z(), endThis.x(), endThis.y(), endThis.z(),