ATLAS Offline Software
Loading...
Searching...
No Matches
GepPi0Alg.h
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4
5#ifndef TRIGL0GEPPERF_GEPPI0ALG_H
6#define TRIGL0GEPPERF_GEPPI0ALG_H
7
8/*
9 This algorithm provides a framework in which to study alternative
10 pi0 detection algorithms or, more precisely, algorithms which take
11 a seed cell and a neighborhood of cells all lying in the EMB1 sampling
12 layer of the LArEM calorimeter.
13
14 The AlgTool delivers cell collections to the Algorithm. There may
15 a single collection if all the cells are read in, or many such collections
16 as would happen when a cell collection is produced for each CaloCluster
17 in the event.
18
19 A seed cell for a each input cell collection is identified.
20
21 The algorithm also reads in all Calorimeter Cells.
22
23 The algorithms are implemented in separate merthods. They receive
24 as inputs the seeds, and the EMB1 cells.
25
26 Output is currently done in debug mode (m_debug = true) by outputing
27 text files.
28
29*/
30
32
34
38
39#include "Identifier/Identifier.h"
40#include <vector>
41
43 public:
44
45 typedef std::vector<std::vector<const CaloCell*>> CellVectors;
46 typedef std::vector<std::vector<float>> PathsSignif;
47
48
49 GepPi0Alg(const std::string& name, ISvcLocator* pSvcLocator);
50
51 virtual StatusCode initialize() override;
52 virtual StatusCode execute(const EventContext& ) const override;
53
54 private:
55
56 // label for debug output
57 mutable std::atomic<size_t> m_id{0l};
58
59 // key to get all calo cells
61 this, "caloCells", "AllCalo", "key to read in a CaloCell constainer"};
62
63 // tool to get vector of vector of cal cells, eg one vector per cluster
64 ToolHandle<ICaloCellsProducer> m_cellsProducer{this,
65 "caloCellsProducer",
66 "EMB1CellsFromCaloCells",
67 "AlgTool to provide vectors of CaloCells ot GepPi0Alg"};
68
69 // Provide access to a noise tool. Allows calculation of S/N for a CaloCell
72 "totalNoiseKey",
73 "totalNoise",
74 "SG Key of CaloNoise data object"};
75
76 // CaloCell_ID helps with with intercell navigation
77 const CaloCell_ID* m_calocell_id{nullptr};
78
79 // CaloDetDescrMAnager provides descriptors with cell geometry information.
82 "caloDetDescrManager",
83 "CaloDetDescrManager",
84 "SG Key of the CaloDetDescrManager in the Consition Store"};
85
86 // Neighborhood generation
87 // 0.25: about seed strip +- 1 strip in eta
88 Gaudi::Property<float> m_neigh_half_eta{
89 "neigh_half_eta",
90 {0.004},
91 "+- neighborhood extent in eta"};
92
93 // 0.1: about seed strip +- 6 strips in phi
94 Gaudi::Property<float> m_neigh_half_phi{
95 this,
96 "neigh_half_phi",
97 {0.6},
98 "+- neighborhood extent in phi"};
99
100 // Allow the user to set the desired algorithm(s)
101 Gaudi::Property<std::vector<std::string>> m_strategies{
102 this,
103 "pi0strategies",
104 {"TWINPEAKS", "CRAWL"},
105 "list of pi0 detection strategies to be run"};
106
107 // paramaters for seed cell identification
108 Gaudi::Property<float> m_seed_signifcut{
109 this, "seed_signif_cut", {2.0}, "twin peak min peak e/noise"};
110
111
112 // parameters for crawl algorithm
113 Gaudi::Property<float> m_tp_signifcut{
114 this, "tp_signif_cut", {2.0}, "twin peak min peak e/noise"};
115
116 Gaudi::Property<float> m_crawl_signifcut{
117 this, "crawl_signif_cut", {2.0}, "crawl min peak e/noise"};
118
119 Gaudi::Property<int> m_er_neta{
120 this, "er_neta", {1}, "crawl number of steps eta"};
121
122 Gaudi::Property<int> m_er_nphi{
123 this, "er_nphi", {10}, "crawl number of steps phi"};
124
125
126 Gaudi::Property<bool> m_dump{
127 this, "dump", false, "flag to trigger writing out debug information"};
128
129
130 // The different algorithms are encapsulated in private methods
131 // twin peaks exhaustively looks for local peaks in the neighborhood
132 // of a seed
133 StatusCode twinpeaks_strategy(const CaloCell* seed,
134 const std::vector<const CaloCell*>& laremCells,
135 const std::vector<const CaloCell*>& emb1Cells,
136 std::size_t iseed,
137 const CaloNoise*,
139 ) const;
140
141 // sort will sort the cells in a neighborhood of a seed by e, and examine
142 // this for cells which are local maxima.
143
144 StatusCode sort_strategy(const CaloCell* seed,
145 const std::vector<const CaloCell*>& laremCells,
146 const std::vector<const CaloCell*>& emb1Cells,
147 std::size_t iseed,
148 const CaloNoise*,
149 const CaloDetDescrManager*) const;
150
151 // the crawl algorithm finds the binary string found by comparing the
152 // energy of at location along a path with the previous location.
153 // The strings are then tested against a regex to determine whether
154 // a particular pattern is present. The default regex identifies '010'
155 // within the string, or '01' at the end of the string.
156
157 StatusCode crawl_strategy(const CaloCell* seed,
158 const std::vector<const CaloCell*>& laremCells,
159 const std::vector<const CaloCell*>& emb1Cells,
160 std::size_t iseed,
161 const CaloNoise*,
162 const CaloDetDescrManager*) const;
163
164
165
166
167 // Find a list of cell identifiers in the neighborhood of a seed cell.
168 // The neighborhood is rectangular in eta-phi.
169 StatusCode neighborhood(const CaloCell*,
170 const std::vector<const CaloCell*>& laremCells,
171 std::vector<const CaloCell*>& neighs,
172 const CaloDetDescrManager*) const;
173
174 // methods to output details of the different algorithms
175 StatusCode dump_crawl(std::size_t iseed,
176 const CaloCell* seed,
177 float seed_signif,
178 const CellVectors&,
179 const PathsSignif&,
180 const std::vector<std::string>& paths_pat) const;
181
182 StatusCode dump_twinpeaks(std::size_t iseed,
183 const CaloCell* seed,
184 double seed_signif,
185 const std::vector<const CaloCell*>& neighborhood,
186 const std::vector<const CaloCell*>& peaks,
187 const std::vector<double>& peak_signifs) const;
188};
189
190#endif
191
192
193
194
Definition of CaloDetDescrManager.
An algorithm that can be simultaneously executed in multiple threads.
Helper class for offline cell identifiers.
Definition CaloCell_ID.h:34
Data object for each calorimeter readout cell.
Definition CaloCell.h:57
This class provides the client interface for accessing the detector description information common to...
Gaudi::Property< int > m_er_neta
Definition GepPi0Alg.h:119
Gaudi::Property< float > m_tp_signifcut
Definition GepPi0Alg.h:113
StatusCode sort_strategy(const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const
StatusCode dump_twinpeaks(std::size_t iseed, const CaloCell *seed, double seed_signif, const std::vector< const CaloCell * > &neighborhood, const std::vector< const CaloCell * > &peaks, const std::vector< double > &peak_signifs) const
StatusCode neighborhood(const CaloCell *, const std::vector< const CaloCell * > &laremCells, std::vector< const CaloCell * > &neighs, const CaloDetDescrManager *) const
StatusCode crawl_strategy(const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const
Gaudi::Property< int > m_er_nphi
Definition GepPi0Alg.h:122
virtual StatusCode initialize() override
Definition GepPi0Alg.cxx:25
StatusCode dump_crawl(std::size_t iseed, const CaloCell *seed, float seed_signif, const CellVectors &, const PathsSignif &, const std::vector< std::string > &paths_pat) const
virtual StatusCode execute(const EventContext &) const override
Definition GepPi0Alg.cxx:40
StatusCode twinpeaks_strategy(const CaloCell *seed, const std::vector< const CaloCell * > &laremCells, const std::vector< const CaloCell * > &emb1Cells, std::size_t iseed, const CaloNoise *, const CaloDetDescrManager *) const
Gaudi::Property< float > m_neigh_half_eta
Definition GepPi0Alg.h:88
Gaudi::Property< float > m_neigh_half_phi
Definition GepPi0Alg.h:94
Gaudi::Property< std::vector< std::string > > m_strategies
Definition GepPi0Alg.h:101
std::vector< std::vector< const CaloCell * > > CellVectors
Definition GepPi0Alg.h:45
Gaudi::Property< bool > m_dump
Definition GepPi0Alg.h:126
SG::ReadHandleKey< CaloCellContainer > m_allCaloCellsKey
Definition GepPi0Alg.h:60
ToolHandle< ICaloCellsProducer > m_cellsProducer
Definition GepPi0Alg.h:64
Gaudi::Property< float > m_seed_signifcut
Definition GepPi0Alg.h:108
SG::ReadCondHandleKey< CaloDetDescrManager > m_caloMgrKey
Definition GepPi0Alg.h:81
SG::ReadCondHandleKey< CaloNoise > m_totalNoiseKey
Definition GepPi0Alg.h:71
Gaudi::Property< float > m_crawl_signifcut
Definition GepPi0Alg.h:116
std::vector< std::vector< float > > PathsSignif
Definition GepPi0Alg.h:46
const CaloCell_ID * m_calocell_id
Definition GepPi0Alg.h:77
GepPi0Alg(const std::string &name, ISvcLocator *pSvcLocator)
Definition GepPi0Alg.cxx:20
std::atomic< size_t > m_id
Definition GepPi0Alg.h:57
Property holding a SG store/key/clid from which a ReadHandle is made.