EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
HEXPLIT.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2023 Sebouh Paul
3
4// An algorithm for splitting calorimeter hits in overlapping cells into "subhits" based on the relative
5// energies of hits on neighboring layers
6//
7// Author: Sebouh Paul
8// Date: 12/04/2023
9
10#pragma once
11
12#include <DD4hep/Detector.h>
13#include <algorithms/algorithm.h>
14#include <algorithms/geo.h>
15#include <edm4eic/CalorimeterHitCollection.h>
16#include <gsl/pointers>
17#include <string> // for basic_string
18#include <string_view> // for string_view
19#include <vector>
20
21#include "HEXPLITConfig.h"
23
24namespace eicrecon {
25
27 algorithms::Algorithm<algorithms::Input<const edm4eic::CalorimeterHitCollection>,
28 algorithms::Output<edm4eic::CalorimeterHitCollection>>;
29
30class HEXPLIT : public HEXPLITAlgorithm, public WithPodConfig<HEXPLITConfig> {
31
32public:
33 HEXPLIT(std::string_view name)
35 name, {"inputHits"}, {"outputSubcellHits"}, "Split hits into subcell hits"} {}
36
37 void init() final;
38 void process(const Input&, const Output&) const final;
39
40private:
41 typedef struct stagger_pattern {
42 int SUBCELLS;
43 int NEIGHBORS;
44 int OVERLAP;
45 std::vector<double> neighbor_offsets_x;
46 std::vector<double> neighbor_offsets_y;
47 std::vector<std::vector<int>> neighbor_indices;
48 std::vector<double> subcell_offsets_x;
49 std::vector<double> subcell_offsets_y;
50 } stagger_pattern;
51
52 // number of subcells that a single cell is divided into
53 static const int SUBCELLS_H4 = 12;
54 // number of neighboring positions whose overlap define the subcells
55 static const int NEIGHBORS_H4 = 12;
56 // number of neighboring cells that overlap to obtain a subcell
57 static const int OVERLAP_H4 = 3;
58 //positions where the overlapping cells are relative to a given cell (in units of hexagon side length)
59 static const std::vector<double> neighbor_offsets_x_H4;
60 static const std::vector<double> neighbor_offsets_y_H4;
61 //indices of the neighboring cells which overlap to produce a given subcell
62 static const std::vector<std::vector<int>> neighbor_indices_H4;
63 //positions of the centers of subcells
64 static const std::vector<double> subcell_offsets_x_H4;
65 static const std::vector<double> subcell_offsets_y_H4;
66
67 const stagger_pattern stag_H4 = {
68 .SUBCELLS = SUBCELLS_H4,
69 .NEIGHBORS = NEIGHBORS_H4,
70 .OVERLAP = OVERLAP_H4,
71 .neighbor_offsets_x = neighbor_offsets_x_H4,
72 .neighbor_offsets_y = neighbor_offsets_y_H4,
73 .neighbor_indices = neighbor_indices_H4,
74 .subcell_offsets_x = subcell_offsets_x_H4,
75 .subcell_offsets_y = subcell_offsets_y_H4,
76 };
77
78 static const int SUBCELLS_S2 = 4;
79 // number of neighboring positions whose overlap define the subcells
80 static const int NEIGHBORS_S2 = 4;
81 // number of neighboring cells that overlap to obtain a subcell
82 static const int OVERLAP_S2 = 1;
83 //positions where the overlapping cells are relative to a given cell (in units of hexagon side length)
84 static const std::vector<double> neighbor_offsets_x_S2;
85 static const std::vector<double> neighbor_offsets_y_S2;
86 //indices of the neighboring cells which overlap to produce a given subcell
87 static const std::vector<std::vector<int>> neighbor_indices_S2;
88 //positions of the centers of subcells
89 static const std::vector<double> subcell_offsets_x_S2;
90 static const std::vector<double> subcell_offsets_y_S2;
91
92 const stagger_pattern stag_S2 = {
93 .SUBCELLS = SUBCELLS_S2,
94 .NEIGHBORS = NEIGHBORS_S2,
95 .OVERLAP = OVERLAP_S2,
96 .neighbor_offsets_x = neighbor_offsets_x_S2,
97 .neighbor_offsets_y = neighbor_offsets_y_S2,
98 .neighbor_indices = neighbor_indices_S2,
99 .subcell_offsets_x = subcell_offsets_x_S2,
100 .subcell_offsets_y = subcell_offsets_y_S2,
101 };
102
103 stagger_pattern stag = stag_H4;
104
105private:
106 const dd4hep::Detector* m_detector{algorithms::GeoSvc::instance().detector()};
107};
108
109} // namespace eicrecon
Definition HEXPLIT.h:30
HEXPLIT(std::string_view name)
Definition HEXPLIT.h:33
Definition WithPodConfig.h:22
-client
Definition CalorimeterClusterRecoCoG.cc:37
algorithms::Algorithm< algorithms::Input< const edm4eic::CalorimeterHitCollection >, algorithms::Output< edm4eic::CalorimeterHitCollection > > HEXPLITAlgorithm
Definition HEXPLIT.h:28