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

esd functionality. waveform next

parent 7ba15b57
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,7 @@ atlas_add_component( ClusterReadExample
AthViews StoreGateLib SGtests
Identifier GaudiKernel
TrackerRawData TrackerPrepRawData
TrackerSimData
FaserDetDescr TrackerIdentifier
TrackerReadoutGeometry xAODFaserTrigger
TrkTrack TrkEventPrimitives TrackerSimEvent
......
......@@ -11,8 +11,9 @@ def ClusterReadExampleCfg(flags, **kwargs):
# clusterTool = acc.popToolsAndMerge(FaserSCT_ClusterizationToolCfg(flags))
# kwargs.setdefault("SCT_ClusteringTool", clusterTool)
# kwargs.setdefault("DataObjectName", "SCT_RDOs")
kwargs.setdefault("ClustersName", "SCT_ClusterContainer")
# kwargs.setdefault("ClustersName", "SCT_ClusterContainer")
# kwargs.setdefault("SCT_FlaggedCondData", "SCT_Flags")
# kwargs.setdefault("OutputSDOName", "SCT_SDO_Map")
Tracker__ClusterReadAlg=CompFactory.ClusterReadAlg
acc.addEventAlgo(Tracker__ClusterReadAlg(**kwargs))
......
......@@ -44,25 +44,21 @@ 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() );
ATH_CHECK(m_faserTriggerDataKey.initialize());
ATH_CHECK(m_clusterContainerKey.initialize());
ATH_CHECK(m_trackCollection.initialize());
*/
ATH_CHECK(m_faserRdoKey.initialize());
ATH_CHECK(m_faserWfKey.initialize());
//ATH_CHECK( m_sctMap.initialize());
ATH_MSG_INFO( "Using FaserSCT RDO Container with key " << m_faserRdoKey.key());//works
ATH_MSG_INFO( "Using FaserWaveform Container with key " << m_faserWfKey.key());//works
//ATH_MSG_INFO( "Using SCT_SDO_Map with key "<< m_sctMap.key());
// Get the SCT ID helper
ATH_CHECK(detStore()->retrieve(m_idHelper, "FaserSCT_ID"));
// Histograms
// 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("waveformExists", &m_waveformExists, "waveform/B");
m_tree->Branch("station", &m_station, "station/I");
......@@ -85,57 +81,54 @@ StatusCode ClusterReadAlg::execute(const EventContext& ctx) const
++m_numberOfEvents;
setFilterPassed(false, 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<FaserSCT_RDO_Container> h_sctRDO(m_faserRdoKey);
SG::ReadHandle<FaserSCT_RDO_Container> h_sctRDO(m_faserRdoKey,ctx);
//SG::ReadHandle<TrackerSimDataCollection> h_collectionMap(m_sctMap);
SG::ReadHandle<ScintWaveformContainer> h_wf(m_faserWfKey,ctx);
++m_numberOfTriggeredEvents;
//SG::ReadHandle<Tracker::FaserSCT_ClusterContainer> clusterContainer{m_clusterContainerKey, ctx};
//m_clusterisValid = clusterContainer.isValid();
// Loop over stations
//ATH_CHECK(trackContainer.record(std::move(outputTracks)));
for( const auto& collection : *h_sctRDO)
{
for(const auto& rawdata : *collection)
{
const auto identifier = rawdata->identify();
/*ATH_MSG_INFO("map size "<<h_collectionMap->size());
if( h_collectionMap->count(identifier) == 0)
{
ATH_MSG_INFO("no map found w/identifier "<<identifier);
continue;
}*/
//const auto& simdata = h_collectionMap->find(rawdata->identify())->second;
//const auto& deposits = simdata.getdeposits();
const FaserSCT_ID* pix;
ServiceHandle<StoreGateSvc> detStore ("DetectorStore", "SiHitIdHelper");
if (detStore.retrieve().isSuccess()) {
if (detStore->retrieve(pix, "FaserSCT_ID").isFailure()) { pix = 0; }
}
int station = pix->station(identifier);/*
ATH_MSG_INFO(station);
int plane = pix->layer(identifier);
int row = pix->phi_module(identifier);
int module = pix->eta_module(identifier);
int sensor = pix->side(identifier);
ATH_MSG_INFO("St:"<<station<<" plane:"<<plane<<" mod:"<<module);
ATH_MSG_INFO("Boop");*/
}
}
//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;
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");
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 energyloss= hit.energyLoss();
//std::cout<<"St:"<<station<<"\tPl:"<<plane<<"\tMod:"<<module<<"\n";
std::cout<<"\nENERGY LOSS"<<energyloss<<'\n';
++m_station[station];
m_hist->Fill(station);
if (energyloss!=0) m_hist2->Fill(energyloss);
}
//SG::ReadHandle<FaserSCT_RDO_Container> h_sctRDO(m_faserRdoKey);
//SG::ReadHandle<TrackerSimDataCollection> h_collectionMap(m_sctMap);
*/
m_tree->Fill();
......
......@@ -38,9 +38,9 @@
#include "GeneratorObjects/McEventCollection.h"
#include "TrackerSimEvent/FaserSiHitCollection.h"
#include "TrackerRawData/FaserSCT_RDO_Container.h" //new
//#include "TrackerSimData/TrackerSimDataCollection.h"
#include "ScintRawEvent/ScintWaveformContainer.h"
#include "ScintRawEvent/ScintWaveformContainer.h" //new?
#include "TrackerSimData/TrackerSimDataCollection.h"
class FaserSCT_ID;
class ISvcLocator;
......@@ -92,28 +92,8 @@ 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 */
/*
//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<ScintWaveformContainer> m_faserWfKey { this, "ScintWaveformContainer", "Scint_Waveforms"};
//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