diff --git a/event/include/MCTrackerHit.h b/event/include/MCTrackerHit.h index c0628818..03bd8e5d 100644 --- a/event/include/MCTrackerHit.h +++ b/event/include/MCTrackerHit.h @@ -41,10 +41,9 @@ class MCTrackerHit : public TObject { /** @return The hit position. */ std::vector getPosition() const { return {x_, y_, z_}; }; - - void setMomentum(const double* momentum, bool rotate = false); - std::vector getMomentum() const { return {px_, py_, pz_}; }; + void setMomentum(const float* momentum, bool rotate = false); + std::vector getMomentum() const { return {px_, py_, pz_}; }; /** @return the global X coordinate of the hit */ double getGlobalX() const {return x_;} @@ -106,10 +105,10 @@ class MCTrackerHit : public TObject { /** The x position of the hit. */ double z_{-999}; - /** The truth momentum of the hit. Only MC */ - double px_{-999}; - double py_{-999}; - double pz_{-999}; + /** The truth momentum of the hit. Only MC */ + float px_{-999}; + float py_{-999}; + float pz_{-999}; /** The hit time. */ double time_{-999}; diff --git a/event/src/MCTrackerHit.cxx b/event/src/MCTrackerHit.cxx index f4757a19..d6a15848 100644 --- a/event/src/MCTrackerHit.cxx +++ b/event/src/MCTrackerHit.cxx @@ -20,7 +20,7 @@ void MCTrackerHit::Clear(Option_t* /* options */) { TObject::Clear(); } -void MCTrackerHit::setMomentum(const double* momentum, bool rotate) { +void MCTrackerHit::setMomentum(const float* momentum, bool rotate) { //svt angle: it's already with minus sign. float svtAngle = 30.5e-3; diff --git a/processors/src/MCTrackerHitProcessor.cxx b/processors/src/MCTrackerHitProcessor.cxx index 7916ebca..0a2cbd9b 100644 --- a/processors/src/MCTrackerHitProcessor.cxx +++ b/processors/src/MCTrackerHitProcessor.cxx @@ -71,22 +71,12 @@ bool MCTrackerHitProcessor::process(IEvent* ievent) { mc_tracker_hit->setLayer(decoder["layer"]); mc_tracker_hit->setModule(decoder["module"]); - // Set the position of the hit - double hitPos[3]; - hitPos[0] = lcio_mcTracker_hit->getPosition()[0]; - hitPos[1] = lcio_mcTracker_hit->getPosition()[1]; - hitPos[2] = lcio_mcTracker_hit->getPosition()[2]; - mc_tracker_hit->setPosition(hitPos); - - double hitMom[3]; - hitMom[0] = lcio_mcTracker_hit->getMomentum()[0]; - hitMom[1] = lcio_mcTracker_hit->getMomentum()[1]; - hitMom[2] = lcio_mcTracker_hit->getMomentum()[2]; - mc_tracker_hit->setMomentum(hitMom); - + mc_tracker_hit->setPosition(lcio_mcTracker_hit->getPosition()); + mc_tracker_hit->setMomentum(lcio_mcTracker_hit->getMomentum()); + // Set the energy deposit of the hit mc_tracker_hit->setEdep(lcio_mcTracker_hit->getEDep()); - + // Set the pdg of particle generating the hit if(lcio_mcTracker_hit->getMCParticle()) mc_tracker_hit->setPDG(lcio_mcTracker_hit->getMCParticle()->getPDG());