Skip to content
Snippets Groups Projects
Commit 441a6036 authored by Nikola Dikic's avatar Nikola Dikic
Browse files

Accessing data

parent fa6700f0
No related branches found
No related tags found
9 merge requests!58791DataQualityConfigurations: Modify L1Calo config for web display,!46784MuonCondInterface: Enable thread-safety checking.,!46776Updated LArMonitoring config file for WD to match new files produced using MT,!45405updated ART test cron job,!42417Draft: DIRE and VINCIA Base Fragments for Pythia 8.3,!36664AFP DQM [rel 22],!36035AFP Run3 merge request - added automatic check,!32548AFP Run3 Monitoring DQ Data Quality - changes in python file,!28689First template for AFP Run3 Monitoring DQ Data Quality
......@@ -7,6 +7,8 @@
#include "AthenaMonitoring/AthMonitorAlgorithm.h"
#include "AthenaMonitoringKernel/Monitored.h"
#include "StoreGate/ReadHandleKey.h"
#include <xAODForward/AFPSiHitContainer.h>
#include "TRandom3.h"
......@@ -22,6 +24,7 @@ private:
std::vector<std::vector<int>> m_abGroups2;
std::map<std::string,int> m_cGroups1;
std::map<std::string,std::map<std::string,int>> m_cGroups2;
SG::ReadHandleKey<xAOD::MuonContainer> m_afpHitContainerKey;
protected:
static const int s_cNearStationIndex;
......
......@@ -24,9 +24,10 @@ AFPSiLayerAlgorithm::AFPSiLayerAlgorithm( const std::string& name, ISvcLocator*
//, m_histsDirectoryName ("AFP/")
//, m_cNearStation (s_cNearStationIndex)
//, m_cFarStation (s_cFarStationIndex)
, m_afpHitContainerKey("AFPSiHits")
{
//declareProperty( "AFPSiHits", afpHitContainerKey );
declareProperty( "AFPSiHits", m_afpHitContainerKey );
}
......@@ -46,9 +47,9 @@ m_abGroups1 = buildToolMap<int>(m_tools,"AFPSiLayer",2);
return AthMonitorAlgorithm::initialize();
*/
// We must declare to the framework in initialize what SG objects we are going to use
SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey;
//SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
ATH_CHECK(afpHitContainerKey.initialize());
ATH_CHECK(m_afpHitContainerKey.initialize());
// ...
return AthMonitorAlgorithm::initialize();
}
......@@ -98,7 +99,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
// Fill. First argument is the tool name, all others are the variables to be saved.
//fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity,lumiPerBCID,lb,random,pT,pT_passed,testweight);
//fill("AFPSiLayerAlgorithm",h_hitMultiplicity,lb,random,pT,pT_passed,testweight);
fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity);
//////////fill("AFPSiLayer", h_timeOverThreshold, h_hitMultiplicity);
// Alternative fill method. Get the group yourself, and pass it to the fill function.
//auto tool = getGroup("AFPSiLayer");
......@@ -135,22 +136,22 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
}
}
*/
SG::ReadHandle<xAOD::AFPSiHitContainer>* afpHitContainer;
if(! afpHitContainer->isValid())
SG::ReadHandle<xAOD::AFPSiHitContainer> afpHitContainer(m_afpHitContainerKey, ctx);
if(! afpHitContainer.isValid())
{
ATH_MSG_ERROR("evtStore() does not contain hits collection with name afpHitContainerKey ");
ATH_MSG_ERROR("evtStore() does not contain hits collection with name m_afpHitContainerKey ");
return StatusCode::FAILURE;
}
CHECK( evtStore()->retrieve( afpHitContainer, "AFPSiHitContainer" ) );
//ATH_CHECK( afpHitContainerKey.initialize() );
for(const auto* hitsItr: *afpHitContainer)
for(const auto& hitsItr: *afpHitContainer)
{
switch(hitsItr->stationID())
{
case s_cNearStationIndex:
std::cout << hit.pixelColIDChip() << std::endl;
case 2:
std::cout << hitsItr->pixelColIDChip() << std::endl;
break;
//case s_cFarStationIndex:
//m_cFarStation.fillHistograms(*hitsItr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment