Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2024-06-29 07:05:54

0001 // SPDX-License-Identifier: LGPL-3.0-or-later
0002 // Copyright (C) 2023 Sebouh Paul
0003 
0004 // An algorithm for splitting calorimeter hits in overlapping cells into "subhits" based on the relative
0005 // energies of hits on neighboring layers
0006 //
0007 // Author: Sebouh Paul
0008 // Date: 12/04/2023
0009 
0010 #pragma once
0011 
0012 #include <DD4hep/Detector.h>
0013 #include <algorithms/algorithm.h>
0014 #include <algorithms/geo.h>
0015 #include <edm4eic/CalorimeterHitCollection.h>
0016 #include <gsl/pointers>
0017 #include <string>                                 // for basic_string
0018 #include <string_view>                            // for string_view
0019 #include <vector>
0020 
0021 #include "HEXPLITConfig.h"
0022 #include "algorithms/interfaces/WithPodConfig.h"
0023 
0024 namespace eicrecon {
0025 
0026 using HEXPLITAlgorithm = algorithms::Algorithm<
0027      algorithms::Input<
0028         const edm4eic::CalorimeterHitCollection
0029      >,
0030      algorithms::Output<
0031         edm4eic::CalorimeterHitCollection
0032      >
0033    >;
0034 
0035   class HEXPLIT
0036   : public HEXPLITAlgorithm,
0037     public WithPodConfig<HEXPLITConfig> {
0038 
0039   public:
0040     HEXPLIT(std::string_view name)
0041              : HEXPLITAlgorithm{name,
0042                                    {"inputHits"},
0043                                    {"outputSubcellHits"},
0044                                    "Split hits into subcell hits"} {}
0045 
0046     void init() final;
0047     void process(const Input&, const Output&) const final;
0048 
0049   private:
0050       // number of subcells that a single cell is divided into
0051       static const int SUBCELLS=12;
0052       // number of neighboring positions whose overlap define the subcells
0053       static const int NEIGHBORS=12;
0054       // number of neighboring cells that overlap to obtain a subcell
0055       static const int OVERLAP=3;
0056   //positions where the overlapping cells are relative to a given cell (in units of hexagon side length)
0057       static const std::vector<double> neighbor_offsets_x;
0058       static const std::vector<double>  neighbor_offsets_y;
0059       //indices of the neighboring cells which overlap to produce a given subcell
0060       static const int neighbor_indices[SUBCELLS][OVERLAP];
0061   //positions of the centers of subcells
0062       static const std::vector<double>  subcell_offsets_x;
0063       static const std::vector<double>  subcell_offsets_y;
0064 
0065   private:
0066     const dd4hep::Detector* m_detector{algorithms::GeoSvc::instance().detector()};
0067 
0068   };
0069 
0070 } // namespace eicrecon