Skip to content

Commit

Permalink
Updated WABRecProcessor with reco-level kinematic variable reconstruc…
Browse files Browse the repository at this point in the history
…tion (i.e. using ECalRecHits + LinearTracking)
  • Loading branch information
SanjitMasanam committed Feb 11, 2025
1 parent 46b950b commit 5e84ccf
Show file tree
Hide file tree
Showing 5 changed files with 397 additions and 277 deletions.
3 changes: 3 additions & 0 deletions Ecal/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ endif()
# to an external folder and create the targets.
find_package(ONNXRuntime 1.2.0)

find_package(Eigen3 CONFIG REQUIRED)

setup_library(module Ecal
dependencies ROOT::Physics
Framework::Framework Recon::Event Tools::Tools DetDescr::DetDescr
ONNXRuntime::Interface
Eigen3::Eigen
)

setup_test(dependencies Ecal::Ecal)
Expand Down
40 changes: 20 additions & 20 deletions Ecal/include/Ecal/EcalWABRecProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,10 @@
#include "Ecal/Event/EcalWABResult.h"
#include "Framework/Configure/Parameters.h"
#include "Framework/EventProcessor.h"
#include "Tracking/Event/ReducedTrack.h"

#include "Tools/ONNXRuntime.h"
#include "Eigen/Dense"

// ROOT (MIP tracking)
#include "TVector3.h"
Expand All @@ -24,6 +26,7 @@
#include <map>
#include <memory>


namespace ecal {

class EcalWABRecProcessor : public framework::Producer {
Expand All @@ -34,11 +37,10 @@ class EcalWABRecProcessor : public framework::Producer {

virtual ~EcalWABRecProcessor() {}

/**
* Configure the processor using the given user specified parameters.
*
* @param parameters Set of parameters used to configure this processor.
*/
void onProcessStart() override;

void onProcessEnd() override;

void configure(framework::config::Parameters& parameters) override;

void produce(framework::Event& event);
Expand All @@ -48,21 +50,19 @@ class EcalWABRecProcessor : public framework::Producer {
std::string rec_coll_name_;
std::string track_pass_name_;
std::string track_coll_name_;
bool data;
bool WAB;

// std::tuple<Eigen::VectorXd, double, int, Eigen::MatrixXd, int>
// fit2DTracksConstrained(const std::vector<double>& x1,
// const std::vector<double>& y1,
// const std::vector<double>& s1,
// const std::vector<double>& x2,
// const std::vector<double>& y2,
// const std::vector<double>& s2,
// const std::vector<double>& guess,
// int maxIter = 20,
// int verbosity = 0,
// double dchisq = 0.001,
// double abs_lim = 10.0)
int nevents_{0};
double processing_time_{0.};

std::tuple<Eigen::VectorXd, double, int, Eigen::MatrixXd, int>
fit2DTracksConstrained(const std::vector<double>& x1,
const std::vector<double>& y1,
const std::vector<double>& s1,
const std::vector<double>& x2,
const std::vector<double>& y2,
const std::vector<double>& s2,
const std::vector<double>& guess,
int maxIter, int verbosity,
double dchisq, double abs_lim);

/** Name of the collection which will containt the results. */
std::string collectionName_{"EcalWABRec"};
Expand Down
2 changes: 1 addition & 1 deletion Ecal/include/Ecal/Event/EcalWABResult.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/**
* @file EcalWABResult.h
* @brief Class used to encapsulate the results obtained from EcalWAbRecProcessor
* @brief Class used to encapsulate the results obtained from EcalWABRecProcessor
* @author Sanjit Masanam (UCSB)
*/

Expand Down
4 changes: 1 addition & 3 deletions Ecal/python/EcalWABRecProcessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,4 @@ def __init__(self,name = 'EcalWABRec') :
self.rec_coll_name = 'EcalRecHits'
self.rec_pass_name = ''
self.track_coll_name = 'ReducedTracks'
self.track_pass_name = ''
self.data = 0
self.WAB = 0
self.track_pass_name = ''
Loading

0 comments on commit 5e84ccf

Please sign in to comment.