EICrecon
JANA based reconstruction for the EPIC detector
Loading...
Searching...
No Matches
ImagingTopoClusterConfig.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// Copyright (C) 2022 Chao Peng, Sylvester Joosten, Whitney Armstrong
3
4#pragma once
5
6#include <string>
7#include <variant>
8#include <iostream>
9
10#include <DD4hep/DD4hepUnits.h>
11
12namespace eicrecon {
13
15
16 // maximum difference in layer numbers that can be considered as neighbours
18 // maximum distance of global (x, y) to be considered as neighbors at same layers (if layerMode==xy)
19 std::vector<std::variant<std::string, double>> sameLayerDistXY = {1.0 * dd4hep::mm,
20 1.0 * dd4hep::mm};
21 // maximum distance of global (eta, phi) to be considered as neighbors at same layers (if layerMode==etaphi)
22 std::vector<double> sameLayerDistEtaPhi = {0.01, 0.01};
23 // maximum distance of global (t, z) to be considered as neighbors at same layers (if layerMode==tz)
24 std::vector<double> sameLayerDistTZ = {1.0 * dd4hep::mm, 1.0 * dd4hep::mm};
25 // maximum distance of global (x, y) to be considered as neighbors at different layers (if layerMode==xy)
26 std::vector<std::variant<std::string, double>> diffLayerDistXY = {1.0 * dd4hep::mm,
27 1.0 * dd4hep::mm};
28 // maximum distance of global (eta, phi) to be considered as neighbors at different layers (if layerMode==etaphi)
29 std::vector<double> diffLayerDistEtaPhi = {0.01, 0.01};
30 // maximum distance of global (t, z) to be considered as neighbors at different layers (if layerMode==tz)
31 std::vector<double> diffLayerDistTZ = {1.0 * dd4hep::mm, 1.0 * dd4hep::mm};
32 // Layermodes
33 enum class ELayerMode { etaphi = 0, xy = 1, tz = 2 };
34 // determines how neighbors are determined for hits in same layers (using either eta and phi, or x and y)
36 // determines how neighbors are determined for hits in different layers (using either eta and phi, or x and y)
37 ELayerMode diffLayerMode = ELayerMode::xy; // for ldiff <= neighbourLayersRange
38
39 // maximum global distance to be considered as neighbors in different sectors
40 double sectorDist = 1.0 * dd4hep::cm;
41
42 // minimum hit energy to participate clustering
43 double minClusterHitEdep = 0.;
44 // minimum cluster center energy (to be considered as a seed for cluster)
46 // minimum cluster energy (to save this cluster)
47 double minClusterEdep = 0.5 * dd4hep::MeV;
48 // minimum number of hits (to save this cluster)
49 std::size_t minClusterNhits = 10;
50};
51
52std::istream& operator>>(std::istream& in, ImagingTopoClusterConfig::ELayerMode& layerMode) {
53 std::string s;
54 in >> s;
55 // stringifying the enums causes them to be converted to integers before conversion to strings
56 if (s == "etaphi" or s == "0") {
58 } else if (s == "xy" or s == "1") {
60 } else if (s == "tz" or s == "2") {
62 } else {
63 in.setstate(std::ios::failbit); // Set the fail bit if the input is not valid
64 }
65
66 return in;
67}
68std::ostream& operator<<(std::ostream& out, const ImagingTopoClusterConfig::ELayerMode& layerMode) {
69 switch (layerMode) {
71 out << "etaphi";
72 break;
74 out << "xy";
75 break;
77 out << "tz";
78 break;
79 default:
80 out.setstate(std::ios::failbit);
81 }
82 return out;
83}
84} // namespace eicrecon
-client
Definition CalorimeterClusterRecoCoG.cc:37
std::ostream & operator<<(std::ostream &out, const ImagingTopoClusterConfig::ELayerMode &layerMode)
Definition ImagingTopoClusterConfig.h:68
std::istream & operator>>(std::istream &in, ImagingTopoClusterConfig::ELayerMode &layerMode)
Definition ImagingTopoClusterConfig.h:52
Definition ImagingTopoClusterConfig.h:14
std::vector< double > sameLayerDistEtaPhi
Definition ImagingTopoClusterConfig.h:22
std::vector< double > diffLayerDistTZ
Definition ImagingTopoClusterConfig.h:31
std::size_t minClusterNhits
Definition ImagingTopoClusterConfig.h:49
ELayerMode sameLayerMode
Definition ImagingTopoClusterConfig.h:35
double sectorDist
Definition ImagingTopoClusterConfig.h:40
double minClusterEdep
Definition ImagingTopoClusterConfig.h:47
std::vector< double > sameLayerDistTZ
Definition ImagingTopoClusterConfig.h:24
double minClusterCenterEdep
Definition ImagingTopoClusterConfig.h:45
std::vector< double > diffLayerDistEtaPhi
Definition ImagingTopoClusterConfig.h:29
std::vector< std::variant< std::string, double > > sameLayerDistXY
Definition ImagingTopoClusterConfig.h:19
ELayerMode diffLayerMode
Definition ImagingTopoClusterConfig.h:37
double minClusterHitEdep
Definition ImagingTopoClusterConfig.h:43
std::vector< std::variant< std::string, double > > diffLayerDistXY
Definition ImagingTopoClusterConfig.h:26
ELayerMode
Definition ImagingTopoClusterConfig.h:33
int neighbourLayersRange
Definition ImagingTopoClusterConfig.h:17