Skip to content
Snippets Groups Projects
Commit 281a4bf0 authored by Savannah Rose Shively's avatar Savannah Rose Shively
Browse files

working state

parent 2810d83f
No related branches found
No related tags found
No related merge requests found
Pipeline #2745779 failed
...@@ -13,8 +13,8 @@ def ClusterReadExampleCfg(flags, **kwargs): ...@@ -13,8 +13,8 @@ def ClusterReadExampleCfg(flags, **kwargs):
# kwargs.setdefault("DataObjectName", "SCT_RDOs") # kwargs.setdefault("DataObjectName", "SCT_RDOs")
kwargs.setdefault("ClustersName", "SCT_ClusterContainer") kwargs.setdefault("ClustersName", "SCT_ClusterContainer")
# kwargs.setdefault("SCT_FlaggedCondData", "SCT_Flags") # kwargs.setdefault("SCT_FlaggedCondData", "SCT_Flags")
TEST_ClusterReadAlg=CompFactory.ClusterReadAlg Tracker__ClusterReadAlg=CompFactory.ClusterReadAlg
acc.addEventAlgo(TEST_ClusterReadAlg(**kwargs)) acc.addEventAlgo(Tracker__ClusterReadAlg(**kwargs))
thistSvc = CompFactory.THistSvc() thistSvc = CompFactory.THistSvc()
thistSvc.Output += ["HIST DATAFILE='ClusterReadHistograms.root' OPT='RECREATE'"] thistSvc.Output += ["HIST DATAFILE='ClusterReadHistograms.root' OPT='RECREATE'"]
...@@ -30,10 +30,10 @@ if __name__ == "__main__": ...@@ -30,10 +30,10 @@ if __name__ == "__main__":
# Flags for this job # Flags for this job
ConfigFlags.Input.isMC = True # Needed to bypass autoconfig ConfigFlags.Input.isMC = True # Needed to bypass autoconfig
ConfigFlags.IOVDb.GlobalTag = "OFLCOND-XXXX-XXX-XX" # Needed to bypass autoconfig, only the "OFLCOND" matters at the moment ConfigFlags.IOVDb.GlobalTag = "OFLCOND-FASER-01" # Needed to bypass autoconfig, only the "OFLCOND" matters at the moment
ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Default FASER geometry ConfigFlags.GeoModel.FaserVersion = "FASER-01" # Default FASER geometry
#ConfigFlags.Detector.SimulateFaserSCT = True #ConfigFlags.Detector.SimulateFaserSCT = True
ConfigFlags.Input.Files = ["run001332.ESD.pool.root"]#["my.COSMICHITS.pool.root"] ConfigFlags.Input.Files = ["cosmics.HITS.pool.root"]#["my.COSMICHITS.pool.root"]
ConfigFlags.lock() ConfigFlags.lock()
# Configure components # Configure components
......
...@@ -29,8 +29,6 @@ POOLCollectiontree - IsSimulation (0 or 1) ...@@ -29,8 +29,6 @@ POOLCollectiontree - IsSimulation (0 or 1)
- event time - event time
check issimulation before continuing check issimulation before continuing
- coords, energy deposit, etc - coords, energy deposit, etc
- wtf is this doing that isnt done by clusterfit again...?
*/ */
...@@ -46,8 +44,11 @@ ClusterReadAlg::ClusterReadAlg(const std::string& name, ISvcLocator* pSvcLocator ...@@ -46,8 +44,11 @@ ClusterReadAlg::ClusterReadAlg(const std::string& name, ISvcLocator* pSvcLocator
// Initialize method: // Initialize method:
StatusCode ClusterReadAlg::initialize() { StatusCode ClusterReadAlg::initialize() {
ATH_MSG_INFO("ClusterReadAlg::initialize()"); ATH_MSG_INFO("ClusterReadAlg::initialize()");
std::cout<<m_numberOfEvents; //std::cout<<m_numberOfEvents;
ATH_CHECK(m_mcEventKey.initialize() );
//ATH_CHECK( m_faserSiHitKey.initialize() );
//TH_CHECK( m_faserRdoKey.initialize());
//ATH_CHECK( m_sctMap.initialize());
ATH_CHECK(m_faserTriggerDataKey.initialize()); ATH_CHECK(m_faserTriggerDataKey.initialize());
ATH_CHECK(m_clusterContainerKey.initialize()); ATH_CHECK(m_clusterContainerKey.initialize());
ATH_CHECK(m_trackCollection.initialize()); ATH_CHECK(m_trackCollection.initialize());
...@@ -65,7 +66,7 @@ StatusCode ClusterReadAlg::initialize() { ...@@ -65,7 +66,7 @@ StatusCode ClusterReadAlg::initialize() {
m_tree->Branch("residual", &m_residual, "residual/F"); m_tree->Branch("residual", &m_residual, "residual/F");
m_tree->Branch("pull", &m_pull, "pull/F"); m_tree->Branch("pull", &m_pull, "pull/F");
m_tree->Branch("chi2", &m_refitChi2, "chi2/F"); m_tree->Branch("chi2", &m_refitChi2, "chi2/F");
m_tree->Branch("mc_Event", &m_mcEventKey2, "chi2/F"); //m_tree->Branch("mc_Event", &m_mcEventKey2, "chi2/F");
m_tree->Branch("waveformExists", &m_waveformExists, "waveform/B"); m_tree->Branch("waveformExists", &m_waveformExists, "waveform/B");
...@@ -88,6 +89,7 @@ StatusCode ClusterReadAlg::initialize() { ...@@ -88,6 +89,7 @@ StatusCode ClusterReadAlg::initialize() {
StatusCode ClusterReadAlg::execute(const EventContext& ctx) const StatusCode ClusterReadAlg::execute(const EventContext& ctx) const
{ {
++m_numberOfEvents; ++m_numberOfEvents;
setFilterPassed(false, ctx); setFilterPassed(false, ctx);
...@@ -95,13 +97,13 @@ StatusCode ClusterReadAlg::execute(const EventContext& ctx) const ...@@ -95,13 +97,13 @@ StatusCode ClusterReadAlg::execute(const EventContext& ctx) const
std::unique_ptr<TrackCollection> outputTracks = std::make_unique<TrackCollection>(); std::unique_ptr<TrackCollection> outputTracks = std::make_unique<TrackCollection>();
SG::ReadHandle<xAOD::FaserTriggerData> triggerContainer{m_faserTriggerDataKey, ctx}; SG::ReadHandle<xAOD::FaserTriggerData> triggerContainer{m_faserTriggerDataKey, ctx};
ATH_CHECK(triggerContainer.isValid()); m_triggerisValid = triggerContainer.isValid();
++m_numberOfTriggeredEvents; ++m_numberOfTriggeredEvents;
SG::ReadHandle<Tracker::FaserSCT_ClusterContainer> clusterContainer{m_clusterContainerKey, ctx}; SG::ReadHandle<Tracker::FaserSCT_ClusterContainer> clusterContainer{m_clusterContainerKey, ctx};
ATH_CHECK(clusterContainer.isValid()); m_clusterisValid = clusterContainer.isValid();
// Loop over stations // Loop over stations
...@@ -114,14 +116,16 @@ StatusCode ClusterReadAlg::execute(const EventContext& ctx) const ...@@ -114,14 +116,16 @@ StatusCode ClusterReadAlg::execute(const EventContext& ctx) const
SG::ReadHandle<McEventCollection> h_mcEvents(m_mcEventKey); SG::ReadHandle<McEventCollection> h_mcEvents(m_mcEventKey);
ATH_MSG_INFO("Read McEventContainer with " << h_mcEvents->size() << " events"); ATH_MSG_INFO("Read McEventContainer with " << h_mcEvents->size() << " events");
if (h_mcEvents->size() == 0) return StatusCode::FAILURE; if (h_mcEvents->size() == 0) return StatusCode::FAILURE;
//if (!m_clusterisValid) return StatusCode::FAILURE;
//if (!m_triggerisValid) return StatusCode::FAILURE;
// h_mcEvents->at(0)->print( msg().stream() ); // h_mcEvents->at(0)->print( msg().stream() );
//SG::ReadHandle<FaserSiHitCollection> h_siHits(m_faserSiHitKey); //SG::ReadHandle<FaserSiHitCollection> h_siHits(m_faserSiHitKey);
//ATH_MSG_INFO("Read FaserSiHitCollection with " << h_siHits->size() << " hits"); //ATH_MSG_INFO("Read FaserSiHitCollection with " << h_siHits->size() << " hits");
SG::ReadHandle<FaserSCT_RDO_Container> h_sctRDO(m_faserRdoKey); //SG::ReadHandle<FaserSCT_RDO_Container> h_sctRDO(m_faserRdoKey);
//SG::ReadHandle<TrackerSimDataCollection> h_collectionMap(m_sctMap); //SG::ReadHandle<TrackerSimDataCollection> h_collectionMap(m_sctMap);
m_waveformExists = true; //m_waveformExists = true;
m_tree->Fill(); m_tree->Fill();
......
...@@ -8,8 +8,8 @@ ...@@ -8,8 +8,8 @@
* @date 28 February 2021 * @date 28 February 2021
*/ */
#ifndef FASERCLUSTERFIT_CLUSTERFITALG_H #ifndef FASERCLUSTERREAD_CLUSTERREADALG_H
#define FASERCLUSTERFIT_CLUSTERFITALG_H #define FASERCLUSTERREAD_CLUSTERREADALG_H
// Base class // Base class
#include "AthenaBaseComps/AthReentrantAlgorithm.h" #include "AthenaBaseComps/AthReentrantAlgorithm.h"
...@@ -91,13 +91,19 @@ class ClusterReadAlg : public AthReentrantAlgorithm, AthHistogramming ...@@ -91,13 +91,19 @@ class ClusterReadAlg : public AthReentrantAlgorithm, AthHistogramming
SG::ReadHandleKey<xAOD::FaserTriggerData> m_faserTriggerDataKey { this, "FaserTriggerDataKey", "FaserTriggerData", "ReadHandleKey for xAOD::FaserTriggerData" }; SG::ReadHandleKey<xAOD::FaserTriggerData> m_faserTriggerDataKey { this, "FaserTriggerDataKey", "FaserTriggerData", "ReadHandleKey for xAOD::FaserTriggerData" };
SG::ReadHandleKey<Tracker::FaserSCT_ClusterContainer> m_clusterContainerKey { this, "ClustersName", "SCT_ClusterContainer", "FaserSCT cluster container" }; SG::ReadHandleKey<Tracker::FaserSCT_ClusterContainer> m_clusterContainerKey { this, "ClustersName", "SCT_ClusterContainer", "FaserSCT cluster container" };
SG::WriteHandleKey<TrackCollection> m_trackCollection { this, "OutputCollection", "ClusterFit", "Output track collection name" }; SG::WriteHandleKey<TrackCollection> m_trackCollection { this, "OutputCollection", "ClusterRead", "Output track collection name" };
DoubleProperty m_zCenter { this, "ZCenter", 2300.0, "Global z position at which to reconstruct track parameters"}; DoubleProperty m_zCenter { this, "ZCenter", 2300.0, "Global z position at which to reconstruct track parameters"};
UnsignedIntegerProperty m_triggerMask { this, "TriggerMask", 0x0, "Trigger mask to analyze (0 = pass all)" }; UnsignedIntegerProperty m_triggerMask { this, "TriggerMask", 0x0, "Trigger mask to analyze (0 = pass all)" };
/// a handle on the Hist/TTree registration service /// a handle on the Hist/TTree registration service
ServiceHandle<ITHistSvc> m_histSvc; ServiceHandle<ITHistSvc> m_histSvc;
//RDO
SG::ReadHandleKey<McEventCollection> m_mcEventKey { this, "McEventCollection", "TruthEvent" };
//SG::ReadHandleKey<FaserSiHitCollection> m_faserSiHitKey { this, "FaserSiHitCollection", "SCT_Hits" };
SG::ReadHandleKey<FaserSCT_RDO_Container> m_faserRdoKey { this, "FaserSCT_RDO_Container", "SCT_RDOs"};
//SG::ReadHandleKey<TrackerSimDataCollection> m_sctMap {this, "TrackerSimDataCollection", "SCT_SDO_Map"};
mutable TH1* m_chi2; mutable TH1* m_chi2;
...@@ -115,16 +121,16 @@ class ClusterReadAlg : public AthReentrantAlgorithm, AthHistogramming ...@@ -115,16 +121,16 @@ class ClusterReadAlg : public AthReentrantAlgorithm, AthHistogramming
mutable std::atomic<int> m_numberOfCluster{0}; mutable std::atomic<int> m_numberOfCluster{0};
mutable std::atomic<int> m_numberOfFits{0}; mutable std::atomic<int> m_numberOfFits{0};
//isvalids
mutable bool m_triggerisValid = false;
mutable bool m_clusterisValid = false;
//RDO //RDO
TH1* m_hist; // Example histogram TH1* m_hist; // Example histogram
TH1* m_incAnglHist; TH1* m_incAnglHist;
TProfile* m_hprof; TProfile* m_hprof;
SG::ReadHandleKey<McEventCollection> m_mcEventKey { this, "McEventCollection", "TruthEvent" };
//SG::ReadHandleKey<FaserSiHitCollection> m_faserSiHitKey { this, "FaserSiHitCollection", "SCT_Hits" };
SG::ReadHandleKey<FaserSCT_RDO_Container> m_faserRdoKey { this, "FaserSCT_RDO_Container", "SCT_RDOs"};
//SG::ReadHandleKey<TrackerSimDataCollection> m_sctMap {this, "TrackerSimDataCollection", "SCT_SDO_Map"};
}; };
// For the THistSvc // For the THistSvc
...@@ -134,4 +140,4 @@ inline const ServiceHandle<ITHistSvc>& ClusterReadAlg::histSvc() const ...@@ -134,4 +140,4 @@ inline const ServiceHandle<ITHistSvc>& ClusterReadAlg::histSvc() const
} }
#endif // FASERCLUSTERFIT_CLUSTERFITALG_H #endif // FASERCLUSTERREAD_CLUSTERREADLG_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment