LDMX Software
HcalGeometryTest.cxx
1#include <catch2/catch_approx.hpp>
2#include <catch2/catch_test_macros.hpp>
3
4using Catch::Approx;
5
7#include "DetDescr/HcalID.h" //creating unique cell IDs
8#include "Framework/ConfigurePython.h"
10#include "Framework/Process.h"
12
13namespace hcal {
14namespace test {
15
24 public:
25 HcalCheckPositionMap(const std::string &name, framework::Process &p)
26 : framework::Analyzer(name, p) {}
28
29 void onProcessStart() final override {}
30
31 void analyze(const framework::Event &event) final override {
32 const auto simHits =
33 event.getCollection<ldmx::SimCalorimeterHit>("HcalSimHits");
34
35 CHECK(simHits.size() > 0);
36 return;
37 }
38}; // HcalCheckPositionMap
39
40} // namespace test
41} // namespace hcal
42
43DECLARE_ANALYZER_NS(hcal::test, HcalCheckPositionMap)
44
45
48TEST_CASE("Hcal Geometry test", "[Hcal][functionality]") {
49 const std::string config_file{"hcal_geometry_test_config.py"};
50
51 char **args{nullptr};
53
54 framework::ConfigurePython cfg(config_file, args, 0);
55 REQUIRE_NOTHROW(p = cfg.makeProcess());
56 p->run();
57}
Base classes for all user event processing components to extend.
#define DECLARE_ANALYZER_NS(NS, CLASS)
Macro which allows the framework to construct an analyzer given its name during configuration.
Class that translates HCal ID into positions of strip hits.
Class that defines an HCal sensitive detector.
Class which represents the process under execution.
Class which stores simulated calorimeter hit information.
Base class for a module which does not produce a data product.
Utility class which reads/executes a python script and creates a Process object based on the input.
Implements an event buffer system for storing event data.
Definition Event.h:41
Class which represents the process under execution.
Definition Process.h:36
void onProcessStart() final override
Callback for the EventProcessor to take any necessary action when the processing of events starts,...
void analyze(const framework::Event &event) final override
Process the event and make histograms or summaries.
Stores simulated calorimeter hit information.
std::unique_ptr< Process > ProcessHandle
A handle to the current process Used to pass a process from ConfigurePython to fire....
Definition Process.h:248