From 8a4992523d60e7cbfcb955137c854a2a0bc9b53c Mon Sep 17 00:00:00 2001
From: Savannah Rose Shively <sshively@lxplus7100.cern.ch>
Date: Tue, 16 Nov 2021 14:52:26 +0100
Subject: [PATCH] functional c-code

---
 .gitignore                                           |  2 ++
 .../TrackerEfficiencyExample/CMakeLists.txt          |  3 ++-
 .../src/TrackerEfficiencyAlg.cxx                     | 12 ++++++++++--
 .../src/TrackerEfficiencyAlg.h                       |  8 +++++++-
 4 files changed, 21 insertions(+), 4 deletions(-)

diff --git a/.gitignore b/.gitignore
index c347b861..034f979b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,5 @@ tmp.*
 .idea/**
 cmake-debug-build/**
 .vscode/**
+.vscode/c_cpp_properties.json
+c_cpp_properties.json
diff --git a/Control/CalypsoExample/TrackerEfficiencyExample/CMakeLists.txt b/Control/CalypsoExample/TrackerEfficiencyExample/CMakeLists.txt
index 72e4ffde..69f18601 100644
--- a/Control/CalypsoExample/TrackerEfficiencyExample/CMakeLists.txt
+++ b/Control/CalypsoExample/TrackerEfficiencyExample/CMakeLists.txt
@@ -12,7 +12,8 @@ atlas_add_component( TrackerEfficiencyExample
                     src/components/*.cxx
                     src/components/TrackerEfficiencyExample_entries.cxx
                     LINK_LIBRARIES AthenaBaseComps TrackerPrepRawData xAODFaserWaveform WaveRawEvent GaudiKernel 
-                    AthViews StoreGateLib SGtests GeneratorObjects )
+                    AthViews StoreGateLib SGtests GeneratorObjects 
+                    TrkTrack TrackerPrepRawData TrkRIO_OnTrack TrackerRIO_OnTrack)
 
 #atlas_install_headers( TrackerPrepRawDataFormation )
 atlas_install_python_modules( python/*.py )
diff --git a/Control/CalypsoExample/TrackerEfficiencyExample/src/TrackerEfficiencyAlg.cxx b/Control/CalypsoExample/TrackerEfficiencyExample/src/TrackerEfficiencyAlg.cxx
index 58df166f..09ba29e3 100644
--- a/Control/CalypsoExample/TrackerEfficiencyExample/src/TrackerEfficiencyAlg.cxx
+++ b/Control/CalypsoExample/TrackerEfficiencyExample/src/TrackerEfficiencyAlg.cxx
@@ -10,6 +10,7 @@
 #include "TrackerEfficiencyAlg.h"
 #include "Identifier/Identifier.h"
 #include "StoreGate/ReadHandle.h"
+#include "StoreGate/StoreGateSvc.h"
 #include "TrackerPrepRawData/TrackerClusterCollection.h"
 #include <TH1F.h>
 #include <TTree.h>
@@ -17,9 +18,10 @@
 
 
 
+
 // Constructor with parameters:
 TrackerEfficiencyAlg::TrackerEfficiencyAlg(const std::string& name, ISvcLocator* pSvcLocator) :
-  AthReentrantAlgorithm(name, pSvcLocator){}
+  AthReentrantAlgorithm(name, pSvcLocator){ m_hist = nullptr; }
   //AthHistogramming( name ),
   //m_idHelper{nullptr},
   //m_histSvc ( "THistSvc/THistSvc", name ){}
@@ -28,13 +30,19 @@ TrackerEfficiencyAlg::TrackerEfficiencyAlg(const std::string& name, ISvcLocator*
 
 // Initialize method:
 StatusCode TrackerEfficiencyAlg::initialize() {
+  m_hist = new TH1D("GroupSize", "RDO Group Size", 8, 0, 8);
+ // ATH_CHECK(histSvc()->regHist("/HIST/myhist", m_hist));
+
+  ATH_CHECK( m_clusterfit.initialize() );
+  ATH_MSG_INFO( "Using tracker clusterfit collection with key " << m_clusterfit.key());
 
   return StatusCode::SUCCESS;
 }
 
 StatusCode TrackerEfficiencyAlg::execute(const EventContext& ctx) const
 {
-
+  //SG::ReadHandle<auto> h_clusterEvents(m_clusterfit);
+  //ATH_MSG_INFO("Read +trackContainer with " << h_clusterEvents->size() << " events");
   return StatusCode::SUCCESS;
 }
 
diff --git a/Control/CalypsoExample/TrackerEfficiencyExample/src/TrackerEfficiencyAlg.h b/Control/CalypsoExample/TrackerEfficiencyExample/src/TrackerEfficiencyAlg.h
index ee6551c3..18516941 100644
--- a/Control/CalypsoExample/TrackerEfficiencyExample/src/TrackerEfficiencyAlg.h
+++ b/Control/CalypsoExample/TrackerEfficiencyExample/src/TrackerEfficiencyAlg.h
@@ -16,10 +16,14 @@
 #include "AthenaBaseComps/AthReentrantAlgorithm.h"
 #include "StoreGate/ReadHandleKey.h"
 #include "TrackerIdentifier/FaserSCT_ID.h"
+#include "TrkTrack/TrackCollection.h"
+
 #include <string>
 #include <atomic>
 #include "TTree.h"
 #include "TFile.h"
+#include <TH1.h>
+#include <TProfile.h>
 
 #include "GaudiKernel/ServiceHandle.h"
 #include "GaudiKernel/ToolHandle.h"
@@ -54,7 +58,9 @@ class TrackerEfficiencyAlg : public AthReentrantAlgorithm
     //const ServiceHandle<ITHistSvc>& histSvc() const;
 
     private:
-      int m_a=0;
+      TH1* m_hist; 
+
+      SG::ReadHandleKey<TrackCollection> m_clusterfit { this, "TrackCollection", "ClusterFit" };
 
  };
 
-- 
GitLab