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

RDO SG working with ESD

parent c0bd3970
Branches
No related tags found
No related merge requests found
Pipeline #2772608 failed
......@@ -9,7 +9,14 @@ atlas_subdir( ClusterReadExample )
atlas_add_component( ClusterReadExample
src/*.cxx src/*.h
src/components/*.cxx
LINK_LIBRARIES AthenaBaseComps AthViews StoreGateLib SGtests Identifier GaudiKernel TrackerRawData TrackerPrepRawData FaserDetDescr TrackerIdentifier TrackerReadoutGeometry xAODFaserTrigger TrkTrack TrkEventPrimitives TrackerSimEvent TrkRIO_OnTrack GeneratorObjects)
LINK_LIBRARIES AthenaBaseComps xAODFaserWaveform ScintRawEvent
AthViews StoreGateLib SGtests
Identifier GaudiKernel
TrackerRawData TrackerPrepRawData
FaserDetDescr TrackerIdentifier
TrackerReadoutGeometry xAODFaserTrigger
TrkTrack TrkEventPrimitives TrackerSimEvent
TrkRIO_OnTrack GeneratorObjects)
#atlas_install_headers( TrackerPrepRawDataFormation )
atlas_install_python_modules( python/*.py )
......@@ -33,7 +33,7 @@ if __name__ == "__main__":
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.Detector.SimulateFaserSCT = True
ConfigFlags.Input.Files = ["cosmics.HITS.pool.root"]#["my.COSMICHITS.pool.root"]
ConfigFlags.Input.Files = ["run001332.ESD.pool.root"] #["cosmics.HITS.pool.root"]#["my.COSMICHITS.pool.root"]
ConfigFlags.lock()
# Configure components
......
......@@ -44,13 +44,14 @@ ClusterReadAlg::ClusterReadAlg(const std::string& name, ISvcLocator* pSvcLocator
// Initialize method:
StatusCode ClusterReadAlg::initialize() {
ATH_MSG_INFO("ClusterReadAlg::initialize()");
/*
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_clusterContainerKey.initialize());
ATH_CHECK(m_trackCollection.initialize());
*/
ATH_CHECK(m_faserRdoKey.initialize());
// Get the SCT ID helper
ATH_CHECK(detStore()->retrieve(m_idHelper, "FaserSCT_ID"));
......@@ -61,7 +62,7 @@ StatusCode ClusterReadAlg::initialize() {
// Tree
m_tree = new TTree("residTree","Cosmics residuals");
m_tree->Branch("id", &m_hash, "id/I");
m_tree->Branch("mc_Event", &m_mcEventKey, "mcEvent/F");
//m_tree->Branch("mc_Event", &m_mcEventKey, "mcEvent/F");
m_tree->Branch("waveformExists", &m_waveformExists, "waveform/B");
m_tree->Branch("station", &m_station, "station/I");
......@@ -84,43 +85,45 @@ StatusCode ClusterReadAlg::execute(const EventContext& ctx) const
++m_numberOfEvents;
setFilterPassed(false, ctx);
SG::WriteHandle trackContainer{m_trackCollection, ctx};
//SG::WriteHandle trackContainer{m_trackCollection, ctx};
std::unique_ptr<TrackCollection> outputTracks = std::make_unique<TrackCollection>();
SG::ReadHandle<xAOD::FaserTriggerData> triggerContainer{m_faserTriggerDataKey, ctx};
m_triggerisValid = triggerContainer.isValid();
//SG::ReadHandle<xAOD::FaserTriggerData> triggerContainer{m_faserTriggerDataKey, ctx};
//m_triggerisValid = triggerContainer.isValid();
SG::ReadHandle<FaserSCT_RDO_Container> h_sctRDO(m_faserRdoKey);
++m_numberOfTriggeredEvents;
SG::ReadHandle<Tracker::FaserSCT_ClusterContainer> clusterContainer{m_clusterContainerKey, ctx};
m_clusterisValid = clusterContainer.isValid();
//SG::ReadHandle<Tracker::FaserSCT_ClusterContainer> clusterContainer{m_clusterContainerKey, ctx};
//m_clusterisValid = clusterContainer.isValid();
// Loop over stations
ATH_CHECK(trackContainer.record(std::move(outputTracks)));
//ATH_CHECK(trackContainer.record(std::move(outputTracks)));
//RDO borrowed stuff
// Handles created from handle keys behave like pointers to the corresponding container
SG::ReadHandle<McEventCollection> h_mcEvents(m_mcEventKey);
ATH_MSG_INFO("Read McEventContainer with " << h_mcEvents->size() << " events");
if (h_mcEvents->size() == 0) return StatusCode::FAILURE;
//SG::ReadHandle<McEventCollection> h_mcEvents(m_mcEventKey);
//ATH_MSG_INFO("Read McEventContainer with " << h_mcEvents->size() << " events");
//if (h_mcEvents->size() == 0) return StatusCode::FAILURE;
if (m_clusterisValid || m_triggerisValid) {
m_waveformExists = true;
}
// h_mcEvents->at(0)->print( msg().stream() );
/* h_mcEvents->at(0)->print( msg().stream() );
SG::ReadHandle<FaserSiHitCollection> h_siHits(m_faserSiHitKey);
ATH_MSG_INFO("Read FaserSiHitCollection with " << h_siHits->size() << " hits");
for (const FaserSiHit& hit : *h_siHits){
int station= hit.getStation();
int plane =hit.getPlane();
int row =hit.getRow();
int module = hit.getModule();
int sensor = hit.getSensor();
//int plane =hit.getPlane();
//int row =hit.getRow();
//int module = hit.getModule();
//int sensor = hit.getSensor();
int energyloss= hit.energyLoss();
//std::cout<<"St:"<<station<<"\tPl:"<<plane<<"\tMod:"<<module<<"\n";
std::cout<<"\nENERGY LOSS"<<energyloss<<'\n';
......@@ -132,7 +135,7 @@ StatusCode ClusterReadAlg::execute(const EventContext& ctx) const
//SG::ReadHandle<FaserSCT_RDO_Container> h_sctRDO(m_faserRdoKey);
//SG::ReadHandle<TrackerSimDataCollection> h_collectionMap(m_sctMap);
*/
m_tree->Fill();
......
......@@ -37,9 +37,11 @@
#include <TProfile.h>
#include "GeneratorObjects/McEventCollection.h"
#include "TrackerSimEvent/FaserSiHitCollection.h"
#include "TrackerRawData/FaserSCT_RDO_Container.h"
#include "TrackerRawData/FaserSCT_RDO_Container.h" //new
//#include "TrackerSimData/TrackerSimDataCollection.h"
#include "ScintRawEvent/ScintWaveformContainer.h"
class FaserSCT_ID;
class ISvcLocator;
class StatusCode;
......@@ -88,22 +90,30 @@ class ClusterReadAlg : public AthReentrantAlgorithm, AthHistogramming
const FaserSCT_ID* m_idHelper;
ServiceHandle<ITHistSvc> m_histSvc;
SG::ReadHandleKey<FaserSCT_RDO_Container> m_faserRdoKey { this, "FaserSCT_RDO_Container", "SCT_RDOs"};
//FaserSCT_RDO_Container> m_clusterContainerKey { this, "ClustersName", "SCT_ClusterContainer", "FaserSCT cluster container" };
//============================
//for cosmics.hits.pool.root
/*
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::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"};
UnsignedIntegerProperty m_triggerMask { this, "TriggerMask", 0x0, "Trigger mask to analyze (0 = pass all)" };
/// a handle on the Hist/TTree registration service
ServiceHandle<ITHistSvc> m_histSvc;
/// a handle on the Hist/TTree registration service */
/*
//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 TTree* m_tree;
mutable int m_hash;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment