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

Containers access - works

parent 6d2604d6
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
......@@ -68,7 +68,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
# Add a GMT for the other example monitor algorithm
# anotherGroup = helper.addGroup(anotherExampleMonAlg,'AFPSiLayer')
# AFPGroup.defineHistogram('totHits', title='Luminosity Block;lb;total number of Hits', path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits')
AFPGroup.defineHistogram('totHits', title='Luminosity Block;lb;total number of Hits', path='Global',xbins=1000,xmin=-0.5,xmax=999.5,weight='nhits')
### STEP 5 ###
# Configure histogramsIf you want to create histograms with variable bin widths, ROOT provides another constructor suited for this purpose. Instead of passing the data interval and the number of bins, you have to pass an array (single or double precision) of bin edges. When the histogram has n bins, then there are n+1 distinct edges, so the array you pass must be of size n+1.
......@@ -86,7 +86,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
sideList = ['Aside' , 'Cside' ]
array = helper.addArray([sideList,stationList,layerList],alg,'AFPSiLayerTool')
array.defineHistogram( 'h_hitMap', title='Map of hits', type='TH2F', path='AFPSiLayer', xbins=80,xmin=0.5,xmax=80.5, ybins=336,ymin=0.5,ymax=336.5)
array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {3}', path='Keys/{0}', xmax=3. )
array.defineHistogram('h_hitMap', title='hitmap for {0} {1} Layer {2}', path='Keys/{0}', xmax=3. )
### STEP 6 ###
# Finalize. The return value should be a tuple of the ComponentAccumulator
......
......@@ -40,12 +40,13 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
std::vector<std::string> stations = { "FarStation","NearStation"};
std::vector<std::string> sides = { "Aside","Cside"};
m_HitmapGroups = buildToolMap<std::map<std::string,std::map<std::string,int>>>(m_tools,"AFPSiLayerTool",sides,stations,layers);
// std::map<std::string,std::map<std::string,int>> <std::map<std::string,int>>
// We must declare to the framework in initialize what SG objects we are going to use
//SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
// ATH_CHECK(m_afpHitContainerKey.initialize());
SG::ReadHandleKey<xAOD::AFPSiHitContainer> afpHitContainerKey("AFPSiHits");
ATH_CHECK(m_afpHitContainerKey.initialize());
// ...
return AthMonitorAlgorithm::initialize();
}
......@@ -67,6 +68,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
auto random = Monitored::Scalar<float>("random",0.0);
auto testweight = Monitored::Scalar<float>("testweight",1.0);
*/
auto totHits = Monitored::Scalar<int>("totHits", 0); // Nikola
/* // Two variables (value and passed) needed for TEfficiency
auto pT = Monitored::Scalar<float>("pT",0.0);
......@@ -76,6 +78,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
// h_timeOverThreshold = lbAverageInteractionsPerCrossing(ctx);
// h_hitMultiplicity = lbAverageInteractionsPerCrossing(ctx);
// h_hitMap = lbAverageInteractionsPerCrossing(ctx);
totHits = GetEventInfo(ctx)->lumiBlock(); // Nikola
/*
lumiPerBCID = lbAverageInteractionsPerCrossing(ctx);
lb = GetEventInfo(ctx)->lumiBlock();
......@@ -96,6 +99,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
//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("AFPSiLayerTool", totHits);
// Alternative fill method. Get the group yourself, and pass it to the fill function.
//auto tool = getGroup("AFPSiLayer");
......@@ -140,9 +144,9 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
}
//ATH_CHECK( afpHitContainerKey.initialize() );
ATH_CHECK( afpHitContainer.initialize() );
//for (const auto& muonItr : *muons) {
/* for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
for(const xAOD::AFPSiHit *hitsItr: *afpHitContainer)
{
std::cout << hitsItr->stationID() << std::endl;
......@@ -159,7 +163,7 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
}
}
*/
//m_cNearStation.eventEnd();
//m_cFarStation.eventEnd();
......
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