From 6a1b0a6d9af5b64e09351e2ae217026ae94bdc8f Mon Sep 17 00:00:00 2001 From: Tamas Vami Date: Thu, 14 Nov 2024 22:31:38 -0800 Subject: [PATCH] Move the function properly under the class --- Ecal/include/Ecal/EcalVetoProcessor.h | 16 +++------------ Ecal/src/Ecal/EcalVetoProcessor.cxx | 29 ++++++++++++--------------- 2 files changed, 16 insertions(+), 29 deletions(-) diff --git a/Ecal/include/Ecal/EcalVetoProcessor.h b/Ecal/include/Ecal/EcalVetoProcessor.h index da44ab28c..4341e192e 100644 --- a/Ecal/include/Ecal/EcalVetoProcessor.h +++ b/Ecal/include/Ecal/EcalVetoProcessor.h @@ -20,16 +20,7 @@ #include "TVector3.h" // For recoil tracking -// #include "Tracking/Event/Track.h" -#pragma once - -#include "Framework/Configure/Parameters.h" -#include "Framework/Event.h" -#include "Framework/EventProcessor.h" -#include "SimCore/Event/SimTrackerHit.h" -#include "Tracking/Event/Measurement.h" #include "Tracking/Event/Track.h" -#include "Tracking/Event/TruthTrack.h" // C++ #include @@ -121,9 +112,9 @@ class EcalVetoProcessor : public framework::Producer { * @param[in] ts_title The track state title, most likely "ecal" * @returns Vector of parameters for a propagated recoil track */ - std::vector trackProp(const ldmx::Tracks& tracks, - ldmx::TrackStateType ts_type, - const std::string& ts_title); + std::vector trackProp(const ldmx::Tracks& tracks, + ldmx::TrackStateType ts_type, + const std::string& ts_title); private: std::map cellMap_; @@ -183,7 +174,6 @@ class EcalVetoProcessor : public framework::Producer { std::string rec_coll_name_; bool recoil_from_tracking_; std::string track_collection_; - /** Name of the collection which will containt the results. */ std::string collectionName_{"EcalVeto"}; diff --git a/Ecal/src/Ecal/EcalVetoProcessor.cxx b/Ecal/src/Ecal/EcalVetoProcessor.cxx index 339f68d81..d5fd0da1e 100644 --- a/Ecal/src/Ecal/EcalVetoProcessor.cxx +++ b/Ecal/src/Ecal/EcalVetoProcessor.cxx @@ -13,9 +13,6 @@ /*~~~~~~~~~~~*/ #include "Tools/AnalysisUtils.h" -// For recoil tracking -#include "Tracking/Event/Track.h" - // C++ #include @@ -246,13 +243,14 @@ void EcalVetoProcessor::produce(framework::Event &event) { } } } -// Get recoilPos using recoil tracking + // Get recoilPos using recoil tracking if (recoil_from_tracking_) { auto recoil_tracks{event.getCollection(track_collection_)}; - std::vector recoilTrackStates = trackProp(recoil_tracks, ldmx::TrackStateType::AtECAL, "ecal"); + std::vector recoilTrackStates = + trackProp(recoil_tracks, ldmx::TrackStateType::AtECAL, "ecal"); // recoilPos defined earlier but redefining now to come from the track state - recoilPos[0] = recoilTrackStates[0]; // track_state_loc0 - recoilPos[1] = recoilTrackStates[1]; // track_state_loc1 + recoilPos[0] = recoilTrackStates[0]; // track_state_loc0 + recoilPos[1] = recoilTrackStates[1]; // track_state_loc1 } if (verbose_) { @@ -1274,18 +1272,18 @@ float EcalVetoProcessor::distPtToLine(TVector3 h1, TVector3 p1, TVector3 p2) { return ((h1 - p1).Cross(h1 - p2)).Mag() / (p1 - p2).Mag(); } -std::vector trackProp(const ldmx::Tracks& tracks, - ldmx::TrackStateType ts_type, - const std::string& ts_title) { +std::vector EcalVetoProcessor::trackProp(const ldmx::Tracks &tracks, + ldmx::TrackStateType ts_type, + const std::string &ts_title) { // Vector to hold the new track state variables - std::vector newTrackStates; + std::vector newTrackStates; - for (auto& track : tracks) { + for (auto &track : tracks) { // Get track state for ts_type auto trk_ts = track.getTrackState(ts_type); // Continue if there's no value - if (!trk_ts.has_value()) continue; - ldmx::Track::TrackState& TargetState = trk_ts.value(); + if (!trk_ts.has_value()) continue; + ldmx::Track::TrackState &TargetState = trk_ts.value(); // Check that the track state is filled if (TargetState.params.size() < 5) continue; @@ -1299,14 +1297,13 @@ std::vector trackProp(const ldmx::Tracks& tracks, // Break after getting the first valid track state // TODO: interface this with CLUE to make sure the propageted track - // has an associated cluster in the ECAL + // has an associated cluster in the ECAL break; } return newTrackStates; } - } // namespace ecal DECLARE_PRODUCER_NS(ecal, EcalVetoProcessor);