ATLAS Offline Software
SeedingAlgorithmAnalysisAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 
9 
11  ISvcLocator *pSvcLocator)
12 : AthMonitorAlgorithm(name, pSvcLocator)
13 {}
14 
16  ATH_MSG_DEBUG( "Initializing SeedingAlgorithmAnalysisAlg" );
17 
18  ATH_CHECK(m_seedingTools.retrieve());
19 
20  if (m_monitoringGroupNames.size() != m_seedingTools.size()) {
21  ATH_MSG_ERROR("Number of monitoring tools not equal to number of seeding tools! Please check!");
22  return StatusCode::FAILURE;
23  }
24 
26 }
27 
29  ATH_MSG_DEBUG(" In SeedingAlgorithmAnalysisAlg::fillHistograms()" );
30 
31  for (unsigned int index(0); index < m_seedingTools.size() ; ++index) {
32  const auto& seedingTool = m_seedingTools[index];
33 
34  std::array<Monitored::Timer<std::chrono::milliseconds>, TimeMonitoringType::AllTypes> timeMonitors = {
35  Monitored::Timer<std::chrono::milliseconds>("TIME_initTimeFirstIter"),
36  Monitored::Timer<std::chrono::milliseconds>("TIME_initTimeSecondIter"),
39  };
40 
41  auto eventNumber = Monitored::Scalar<int>("eventNumber", ctx.eventID().event_number());
42 
44 
45  timeMonitors[TimeMonitoringType::StripSeedInitialisation].start();
46  seedingTool->newEvent(ctx, seedEventData, 0);
47  timeMonitors[TimeMonitoringType::StripSeedInitialisation].stop();
48  auto stripSeedInitialisationTime = Monitored::Scalar<float>("stripSeedInitialisationTime", static_cast<float>(timeMonitors[TimeMonitoringType::StripSeedInitialisation]));
49 
50  auto numberStripSpacePoints = Monitored::Scalar<int>("numberStripSpacePoints", seedEventData.ns);
51 
52  timeMonitors[TimeMonitoringType::StripSeedProduction].start();
53  seedingTool->find3Sp(ctx, seedEventData, {});
54  timeMonitors[TimeMonitoringType::StripSeedProduction].stop();
55  auto stripSeedProductionTime = Monitored::Scalar<float>("stripSeedProductionTime", static_cast<float>(timeMonitors[TimeMonitoringType::StripSeedProduction]));
56 
57  auto numberStripSeeds = Monitored::Scalar<int>("numberStripSeeds", 0);
58  if (not seedEventData.l_ITkSpacePointForSeed.empty())
59  numberStripSeeds = seedEventData.i_ITkSeeds.size();
60  else if (not seedEventData.v_ActsSpacePointForSeed.empty())
61  numberStripSeeds = seedEventData.nsazv;
62 
63  timeMonitors[TimeMonitoringType::PixelSeedInitialisation].start();
64  seedingTool->newEvent(ctx, seedEventData, 1);
65  timeMonitors[TimeMonitoringType::PixelSeedInitialisation].stop();
66  auto pixelSeedInitialisationTime = Monitored::Scalar<float>("pixelSeedInitialisationTime", static_cast<float>(timeMonitors[TimeMonitoringType::PixelSeedInitialisation]));
67 
68  auto numberPixelSpacePoints = Monitored::Scalar<int>("numberPixelSpacePoints", seedEventData.ns);
69 
70  timeMonitors[TimeMonitoringType::PixelSeedProduction].start();
71  seedingTool->find3Sp(ctx, seedEventData, {});
72  timeMonitors[TimeMonitoringType::PixelSeedProduction].stop();
73  auto pixelSeedProductionTime = Monitored::Scalar<float>("pixelSeedProductionTime", static_cast<float>(timeMonitors[TimeMonitoringType::PixelSeedProduction]));
74 
75  auto numberPixelSeeds = Monitored::Scalar<int>("numberPixelSeeds", 0);
76  if (not seedEventData.l_ITkSpacePointForSeed.empty())
77  numberPixelSeeds = seedEventData.i_ITkSeeds.size();
78  else if (not seedEventData.v_ActsSpacePointForSeed.empty())
79  numberPixelSeeds = seedEventData.nsazv;
80 
81  auto monGroup = getGroup(m_monitoringGroupNames[index]);
82  fill(monGroup,
84  stripSeedInitialisationTime,
85  stripSeedProductionTime,
86  pixelSeedInitialisationTime,
87  pixelSeedProductionTime,
88  numberPixelSpacePoints,
89  numberStripSpacePoints,
90  numberPixelSeeds,
91  numberStripSeeds);
92  }
93 
94  return StatusCode::SUCCESS;
95 }
SiSpacePointsSeedMakerEventData.h
python.TIDAMonTool.monGroup
def monGroup(analysis_chain)
Definition: TIDAMonTool.py:297
InDet::SiSpacePointsSeedMakerEventData
Definition: SiSpacePointsSeedMakerEventData.h:49
index
Definition: index.py:1
InDet::SiSpacePointsSeedMakerEventData::i_ITkSeeds
ITkSiSpacePointsProSeedPoolList i_ITkSeeds
Definition: SiSpacePointsSeedMakerEventData.h:249
InDet::SiSpacePointsSeedMakerEventData::v_ActsSpacePointForSeed
std::vector< const xAOD::SpacePoint * > v_ActsSpacePointForSeed
Definition: SiSpacePointsSeedMakerEventData.h:237
InDet::SiSpacePointsSeedMakerEventData::l_ITkSpacePointForSeed
ITkSiSpacePointForSeedPoolList l_ITkSpacePointForSeed
Definition: SiSpacePointsSeedMakerEventData.h:234
pool::getGroup
std::string getGroup(const std::string &encoded)
SeedingAlgorithmAnalysisAlg.h
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ActsTrk::SeedingAlgorithmAnalysisAlg::initialize
virtual StatusCode initialize() override
initialize
Definition: SeedingAlgorithmAnalysisAlg.cxx:15
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
xAOD::eventNumber
eventNumber
Definition: EventInfo_v1.cxx:124
Monitored.h
Header file to be included by clients of the Monitored infrastructure.
fill
void fill(H5::Group &out_file, size_t iterations)
Definition: test-hdf5-writer.cxx:95
InDet::SiSpacePointsSeedMakerEventData::nsazv
int nsazv
Definition: SiSpacePointsSeedMakerEventData.h:81
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
ActsTrk::SeedingAlgorithmAnalysisAlg::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: SeedingAlgorithmAnalysisAlg.cxx:28
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
DeMoScan.index
string index
Definition: DeMoScan.py:364
ActsTrk::SeedingAlgorithmAnalysisAlg::SeedingAlgorithmAnalysisAlg
SeedingAlgorithmAnalysisAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: SeedingAlgorithmAnalysisAlg.cxx:10
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
Monitored::Timer
A monitored timer.
Definition: MonitoredTimer.h:32
InDet::SiSpacePointsSeedMakerEventData::ns
int ns
total number of SP that we sorted into our r-binned vector
Definition: SiSpacePointsSeedMakerEventData.h:79