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

rdo get[component] experimenting

parent 281a4bf0
No related branches found
No related tags found
No related merge requests found
Pipeline #2748548 failed
......@@ -9,7 +9,7 @@ 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 TrkRIO_OnTrack GeneratorObjects)
LINK_LIBRARIES AthenaBaseComps AthViews StoreGateLib SGtests Identifier GaudiKernel TrackerRawData TrackerPrepRawData FaserDetDescr TrackerIdentifier TrackerReadoutGeometry xAODFaserTrigger TrkTrack TrkEventPrimitives TrackerSimEvent TrkRIO_OnTrack GeneratorObjects)
atlas_install_python_modules( python/*.py )
......@@ -46,7 +46,7 @@ StatusCode ClusterReadAlg::initialize() {
ATH_MSG_INFO("ClusterReadAlg::initialize()");
//std::cout<<m_numberOfEvents;
ATH_CHECK(m_mcEventKey.initialize() );
//ATH_CHECK( m_faserSiHitKey.initialize() );
ATH_CHECK( m_faserSiHitKey.initialize() );
//TH_CHECK( m_faserRdoKey.initialize());
//ATH_CHECK( m_sctMap.initialize());
ATH_CHECK(m_faserTriggerDataKey.initialize());
......@@ -63,23 +63,24 @@ StatusCode ClusterReadAlg::initialize() {
// Tree
m_tree = new TTree("residTree","Cosmics residuals");
m_tree->Branch("id", &m_hash, "id/I");
m_tree->Branch("residual", &m_residual, "residual/F");
m_tree->Branch("pull", &m_pull, "pull/F");
m_tree->Branch("chi2", &m_refitChi2, "chi2/F");
//m_tree->Branch("residual", &m_residual, "residual/F");
//m_tree->Branch("pull", &m_pull, "pull/F");
//m_tree->Branch("chi2", &m_refitChi2, "chi2/F");
//m_tree->Branch("mc_Event", &m_mcEventKey2, "chi2/F");
m_tree->Branch("waveformExists", &m_waveformExists, "waveform/B");
m_tree->Branch("station", &m_station, "station/I");
ATH_CHECK(histSvc()->regHist("/HIST/chi2", m_chi2));
//ATH_CHECK(histSvc()->regHist("/HIST/chi2", m_chi2));
ATH_CHECK(histSvc()->regTree("/HIST/residTree", m_tree));
//rdo
m_hist = new TH1D("GroupSize", "RDO Group Size", 8, 0, 8); //first string is root object name, second is histogram title
m_hprof = new TProfile("IncAngleGroup", "Mean Group Size vs Incident Angle", 10, -.1, .1 ,0,5);
m_incAnglHist = new TH1D("IncAngleHist", "Incident Angle Count", 10, -.1, .1);
ATH_CHECK(histSvc()->regHist("/HIST/myhist", m_hist));
ATH_CHECK(histSvc()->regHist("/HIST/myhistprof", m_hprof));
ATH_CHECK(histSvc()->regHist("/HIST/myhistAngl", m_incAnglHist));
//m_hist = new TH1D("GroupSize", "RDO Group Size", 8, 0, 8); //first string is root object name, second is histogram title
//m_hprof = new TProfile("IncAngleGroup", "Mean Group Size vs Incident Angle", 10, -.1, .1 ,0,5);
//m_incAnglHist = new TH1D("IncAngleHist", "Incident Angle Count", 10, -.1, .1);
//ATH_CHECK(histSvc()->regHist("/HIST/myhist", m_hist));
//ATH_CHECK(histSvc()->regHist("/HIST/myhistprof", m_hprof));
//ATH_CHECK(histSvc()->regHist("/HIST/myhistAngl", m_incAnglHist));
return StatusCode::SUCCESS;
......@@ -116,16 +117,29 @@ StatusCode ClusterReadAlg::execute(const EventContext& ctx) const
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) return StatusCode::FAILURE;
//if (!m_triggerisValid) return StatusCode::FAILURE;
if (m_clusterisValid || m_triggerisValid) {
m_waveformExists = true;
}
// h_mcEvents->at(0)->print( msg().stream() );
//SG::ReadHandle<FaserSiHitCollection> h_siHits(m_faserSiHitKey);
//ATH_MSG_INFO("Read FaserSiHitCollection with " << h_siHits->size() << " hits");
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();
std::cout<<"St:"<<station<<"\tPl:"<<plane<<"\tMod:"<<module<<"\n";
m_station[station]++;
}
//SG::ReadHandle<FaserSCT_RDO_Container> h_sctRDO(m_faserRdoKey);
//SG::ReadHandle<TrackerSimDataCollection> h_collectionMap(m_sctMap);
//m_waveformExists = true;
m_tree->Fill();
......
......@@ -36,7 +36,7 @@
#include <math.h>
#include <TProfile.h>
#include "GeneratorObjects/McEventCollection.h"
//#include "TrackerSimEvent/FaserSiHitCollection.h"
#include "TrackerSimEvent/FaserSiHitCollection.h"
#include "TrackerRawData/FaserSCT_RDO_Container.h"
//#include "TrackerSimData/TrackerSimDataCollection.h"
......@@ -100,7 +100,7 @@ class ClusterReadAlg : public AthReentrantAlgorithm, AthHistogramming
//RDO
SG::ReadHandleKey<McEventCollection> m_mcEventKey { this, "McEventCollection", "TruthEvent" };
//SG::ReadHandleKey<FaserSiHitCollection> m_faserSiHitKey { this, "FaserSiHitCollection", "SCT_Hits" };
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"};
......@@ -114,6 +114,7 @@ class ClusterReadAlg : public AthReentrantAlgorithm, AthHistogramming
mutable float m_refitChi2;
mutable float m_mcEventKey2;
mutable bool m_waveformExists;
mutable int m_station[5]={};
mutable std::atomic<int> m_numberOfEvents{0};
mutable std::atomic<int> m_numberOfTriggeredEvents{0};
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment