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

Cleaning up the code

parent 38871d9b
No related branches found
No related tags found
8 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
......@@ -22,6 +22,7 @@ public:
private:
std::map<std::string,std::map<std::string,int>> m_HitmapGroups;
std::map<std::string,int> m_TrackGroup;
SG::ReadHandleKey<xAOD::AFPSiHitContainer> m_afpHitContainerKey;
protected:
......
......@@ -21,10 +21,8 @@ public:
virtual StatusCode fillHistograms( const EventContext& ctx ) const override;
private:
//std::map<std::string,std::map<std::string,int>> m_HitmapGroupsToF;
//std::map<std::string, int> m_HitmapGroupsToF;
//std::vector<std::string> m_HitmapGroupsToF;
std::map<std::string,int> m_HitmapGroupsToF;
SG::ReadHandleKey<xAOD::AFPToFHitContainer> m_afpToFHitContainerKey;
protected:
......
......@@ -18,12 +18,12 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
from AthenaConfiguration.ComponentFactory import CompFactory
#from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPSiLayerAlgorithm
afpSiLayerAlgorithm = CompFactory.AFPSiLayerAlgorithm
afpSiLayerAlgorithm = helper.addAlgorithm(AFPSiLayerAlgorithm,'AFPSiLayerAlg')
afpSiLayerAlgorithmFac = CompFactory.AFPSiLayerAlgorithm
afpSiLayerAlgorithm = helper.addAlgorithm(afpSiLayerAlgorithmFac,'AFPSiLayerAlg')
#from Run3AFPMonitoring.Run3AFPMonitoringConf import AFPToFAlgorithm
afpToFAlgorithm = CompFactory.AFPToFAlgorithm
afpToFAlgorithm = helper.addAlgorithm(AFPToFAlgorithm,'AFPToFAlg')
afpToFAlgorithmFac = CompFactory.AFPToFAlgorithm
afpToFAlgorithm = helper.addAlgorithm(afpToFAlgorithmFac,'AFPToFAlg')
# Add a generic monitoring tool (a "group" in old language). The returned
# object here is the standard GenericMonitoringTool.
......@@ -35,7 +35,6 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
AFPToFGroup.defineHistogram('numberOfHit_S0', title='Number of hit per bar station 0;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
AFPToFGroup.defineHistogram('numberOfHit_S3', title='Number of hit per bar station 3;total number of Hits', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5)
#AFPToFGroup.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train side A;trainID;barInTrainID', type='TH2F', path='ToF/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
# Using a map of groups
......@@ -51,7 +50,7 @@ def Run3AFPExampleMonitoringConfig(inputFlags):
arrayOneList = helper.addArray([combinedList], afpToFAlgorithm, 'AFPToFTool', topPath='AFP/ToF/')
arrayOneList.defineHistogram('trainID,barInTrainID', title='ToF hit bar vs train {0};trainID;barInTrainID', type='TH2F', path='HitBarvsTrain/',xbins=4,xmin=-0.5,xmax=3.5,ybins=4,ymin=-0.5,ymax=3.5)
array.defineHistogram('trackX,trackY', title='Track posistion position in station {0}trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
arrayOneList.defineHistogram('trackX,trackY', title='Track posistion position in station {0};trackX;trackY', type='TH2F', path='Track', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
#array.defineHistogram('pixelColIDChip,pixelColIDChip', title='Correlation Row {0} Row {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=80, ymin=0.5, ymax=80.5)
#array.defineHistogram('pixelRowIDChip,pixelRowIDChip', title='Correlation Col {0} Col {1}', type='TH2F', path='Correlation', xbins=80, xmin=0.5, xmax=80.5, ybins=336, ymin=0.5, ymax=336.5)
......@@ -73,8 +72,8 @@ if __name__=='__main__':
# Set the Athena configuration flags
from AthenaConfiguration.AllConfigFlags import ConfigFlags
nightly = ''
#file = '/eos/atlas/atlastier0/tzero/prod/data18_13TeV/physics_Main/00354309/data18_13TeV.00354309.physics_Main.recon.AOD.f946/data18_13TeV.00354309.physics_Main.recon.AOD.f946._lb0130._0001.1'
file ='/afs/cern.ch/work/k/kristin/dataAFP/data17_13TeV.00337176.physics_Main.merge.AOD.r10258_p3399_tid13243079_00/AOD.13243079._000003.pool.root.1'
ConfigFlags.Input.Files = [nightly+file]
ConfigFlags.Input.isMC = False
......@@ -91,6 +90,6 @@ if __name__=='__main__':
exampleMonitorAcc = Run3AFPExampleMonitoringConfig(ConfigFlags)
cfg.merge(exampleMonitorAcc)
cfg.run(1000) #use cfg.run(20) to only run on first 20 events
cfg.run(10000) #use cfg.run(20) to only run on first 20 events
......@@ -30,7 +30,7 @@ StatusCode AFPSiLayerAlgorithm::initialize() {
using namespace Monitored;
m_HitmapGroups = buildToolMap<std::map<std::string,int>>(m_tools,"AFPSiLayerTool", m_stationnames, m_pixlayers);
m_TrackGroup = buildToolMap<int>(m_tools, "AFPSiLayerTool", m_stationnames);
// 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());
......@@ -72,7 +72,6 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
pixelRowIDChip = hitsItr->pixelRowIDChip();
pixelColIDChip = hitsItr->pixelColIDChip();
timeOverThreshold = hitsItr->timeOverThreshold();
std::cout << "\tTime Over Threshold: " << timeOverThreshold << "\n";
if (hitsItr->stationID()<4 && hitsItr->stationID()>=0 && hitsItr->pixelLayerID()<4 && hitsItr->pixelLayerID()>=0)
{
......@@ -89,17 +88,15 @@ StatusCode AFPSiLayerAlgorithm::fillHistograms( const EventContext& ctx ) const
fast.reco();
for (const auto& cluster : fast.clusters()) {
//ATH_MSG_INFO("c: " << cluster.x << " " << cluster.y);
clusterX = cluster.x;
clusterY = cluster.y;
fill(m_tools[m_HitmapGroups.at(m_stationnames.at(cluster.station)).at(m_pixlayers.at(cluster.layer))], clusterX, clusterY);
}
for (const auto& track : fast.tracks()) {
//ATH_MSG_INFO("t: " << track.x << " " << track.y);
trackX = track.x;
trackY = track.y;
//fill(m_tools[m_HitmapGroups.at(m_stationnames.at(track.station))], trackX, trackY);
fill(m_tools[m_TrackGroup.at(m_stationnames.at(track.station))], trackX, trackY);
}
......
......@@ -27,10 +27,8 @@ AFPToFAlgorithm::~AFPToFAlgorithm() {}
StatusCode AFPToFAlgorithm::initialize() {
using namespace Monitored;
//m_HitmapGroupsToF = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFAlgorithm", m_stationNamesToF);
//m_HitmapGroupsToF = buildToolMap<std::map<std::string,int>>(m_tools,"AFPToFAlgorithm", m_stationNamesToF);
//m_HitmapGroupsToF = buildToolMap<std::vector<int>>(m_tools,"AFPToFTool", m_stationNamesToF);
m_HitmapGroupsToF = buildToolMap<int>(m_tools,"AFPToFTool", m_stationNamesToF);
// We must declare to the framework in initialize what SG objects we are going to use
SG::ReadHandleKey<xAOD::AFPToFHitContainer> afpToFHitContainerKey("AFPToFHits");
ATH_CHECK(m_afpToFHitContainerKey.initialize());
......@@ -45,6 +43,10 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
// Declare the quantities which should be monitored
auto lb = Monitored::Scalar<int>("lb", 0);
auto nTofHits = Monitored::Scalar<int>("nTofHits", 1);
auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0);
auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
auto trainID = Monitored::Scalar<int>("trainID", 0);
auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0);
lb = GetEventInfo(ctx)->lumiBlock();
......@@ -60,12 +62,6 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
nTofHits = afpToFHitContainer->size();
fill("AFPToFTool", lb, nTofHits);
// TO BE researched: difference between trainID and barInTrainID
auto numberOfHit_S0 = Monitored::Scalar<int>("numberOfHit_S0", 0);
auto numberOfHit_S3 = Monitored::Scalar<int>("numberOfHit_S3", 0);
auto trainID = Monitored::Scalar<int>("trainID", 0);
auto barInTrainID = Monitored::Scalar<int>("barInTrainID", 0);
for(const xAOD::AFPToFHit *hitsItr: *afpToFHitContainer)
{
......@@ -76,22 +72,11 @@ StatusCode AFPToFAlgorithm::fillHistograms( const EventContext& ctx ) const {
{
numberOfHit_S0 = hitsItr->trainID();
fill("AFPToFTool", numberOfHit_S0);
//std::cout << "\n\t" << hitsItr->stationID() << "\n";
//fill(m_tools[m_HitmapGroupsToF.at("Aside")], trainID, barInTrainID);
//fill(m_tools[m_HitmapGroupsToF.at(m_stationNamesToF.at(0))], trainID, barInTrainID);
//fill(m_tools[m_HitmapGroupsToF[0]], trainID, barInTrainID);
//fill("AFPToFTool", trainID, barInTrainID);
}
else if(hitsItr->isSideC())
{
numberOfHit_S3 = hitsItr->trainID();
fill("AFPToFTool", numberOfHit_S3);
//std::cout << "\n\t" << hitsItr->stationID() << "\n";
//fill(m_tools[m_HitmapGroupsToF.at(m_stationnames.at(hitsItr->stationID()))], trainID, barInTrainID);
//fill(m_tools[m_HitmapGroupsToF.at("Cside")], trainID, barInTrainID);
//fill(m_tools[m_HitmapGroupsToF[1]], trainID, barInTrainID);
//fill("AFPToFTool", trainID, barInTrainID);
}
if (hitsItr->stationID() == 0 || hitsItr->stationID() == 3)
......
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