ATLAS Offline Software
ClusterPatFinder.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #ifndef TRIGL2MUONSA_CLUSTERPATFINDER_H
6 #define TRIGL2MUONSA_CLUSTERPATFINDER_H
7 
8 #include <string>
9 #include <list>
10 #include <vector>
11 
13 
14 namespace TrigL2MuonSA {
15 
17 {
18  std::multimap<int, int> groupCand;
19  int group;
20  double dMM;
21  double dMO;
22  double aw[3];
23  double bw[3];
24  int clustersID[8];
25  bool isGoodFit;
26  double phi_middle;
27  double phi_outer;
28  int nclusters;
29 
30  void Clear(){
31  groupCand.clear();
32  group = -1;
33  dMM = 9999;
34  dMO = 9999;
35  isGoodFit = false;
36  phi_middle = 0;
37  phi_outer = 0;
38  nclusters = 0;
39  for(int i=0; i < 3; i++){
40  aw[i] = 0;
41  bw[i] = 0;
42  }
43  for(int i=0; i < 8; i++) clustersID[i] = -1;
44  }
45 
46  bool operator==(const ClusterPattern& clp) const {
47  for(int i=0; i < 8; i++){
48  if(clustersID[i] != clp.clustersID[i]) return false;
49  }
50  return true;
51  }
52 
53 };
54 
55 // --------------------------------------------------------------------------------
56 // --------------------------------------------------------------------------------
58 {
59  std::vector<std::list<double>> clusters_in_layer_eta;
60  std::vector<std::list<double>> clusters_in_layer_phi;
61  std::vector<std::vector<double>> clusters_in_layer_Z;
62  std::vector<std::vector<double>> clusters_in_layer_R;
63  void clear() {
64  std::list<double> z;
65  z.clear();
66  clusters_in_layer_eta.assign(8,z);
67  clusters_in_layer_phi.assign(8,z);
68  std::vector<double> zz;
69  zz.clear();
70  clusters_in_layer_R.assign(8,zz);
71  clusters_in_layer_Z.assign(8,zz);
72  }
73 };
74 
75 // --------------------------------------------------------------------------------
76 // --------------------------------------------------------------------------------
77 
79 {
80 
81  public:
82  ClusterPatFinder(const std::string& type,
83  const std::string& name,
84  const IInterface* parent);
85 
86  public:
87 
88  void addCluster(const std::string& stationName,
89  int stationEta,
90  bool measuresPhi,
91  unsigned int gasGap,
92  unsigned int doubletR,
93  double gPosX, double gPosY, double gPosZ,
94  TrigL2MuonSA::RpcLayerClusters& rpcLayerClusters) const;
95 
96  bool findPatternEta(std::vector<std::vector<double>>& aw,
97  std::vector<std::vector<double>>& bw,
98  TrigL2MuonSA::RpcLayerClusters& rpcLayerClusters) const;
99 
100  bool findPatternPhi(std::vector<double>& phi_middle,
101  std::vector<double>& phi_outer,
102  TrigL2MuonSA::RpcLayerClusters& rpcLayerClusters) const;
103 
104  private:
105  bool patfinder_forEta(std::vector<TrigL2MuonSA::ClusterPattern>& crPatterns,
106  TrigL2MuonSA::RpcLayerClusters& rpcLayerClusters) const;
107 
108  bool patfinder(std::vector<TrigL2MuonSA::ClusterPattern>& crPattern,
109  TrigL2MuonSA::RpcLayerClusters& rpcLayerClusters) const;
110 
111  bool deltaOK(int l1, int l2, double x1, double x2, int isphi, double &delta) const;
112 
113  double calibR(const std::string& stationName, double R, double Phi) const;
114 
115  void abcal(unsigned int result_pat, size_t index[], double aw[], double bw[], TrigL2MuonSA::RpcLayerClusters& rpcLayerClusters) const;
116 
117  void removeSimilarRoad(std::vector<TrigL2MuonSA::ClusterPattern>& crPatterns) const;
118 
119  void setGroup(int& nGroup,
120  std::vector<TrigL2MuonSA::ClusterPattern>& crPatterns) const;
121  void selectGoodFit(int nGroup,
122  std::vector<TrigL2MuonSA::ClusterPattern>& crPatterns) const;
123 };
124 
125 }
126 #endif
127 
TrigL2MuonSA::ClusterPattern::aw
double aw[3]
Definition: ClusterPatFinder.h:22
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
dumpTgcDigiDeadChambers.gasGap
list gasGap
Definition: dumpTgcDigiDeadChambers.py:33
TrigL2MuonSA::RpcLayerClusters::clusters_in_layer_R
std::vector< std::vector< double > > clusters_in_layer_R
Definition: ClusterPatFinder.h:62
TrigL2MuonSA::RpcLayerClusters::clear
void clear()
Definition: ClusterPatFinder.h:63
dumpTgcDigiDeadChambers.stationName
dictionary stationName
Definition: dumpTgcDigiDeadChambers.py:30
index
Definition: index.py:1
plotBeamSpotCompare.x2
x2
Definition: plotBeamSpotCompare.py:218
TrigL2MuonSA::ClusterPattern::dMM
double dMM
Definition: ClusterPatFinder.h:20
createCablingJSON.doubletR
int doubletR
Definition: createCablingJSON.py:15
TrigL2MuonSA::ClusterPatFinder::selectGoodFit
void selectGoodFit(int nGroup, std::vector< TrigL2MuonSA::ClusterPattern > &crPatterns) const
Definition: ClusterPatFinder.cxx:731
Phi
@ Phi
Definition: RPCdef.h:8
TrigL2MuonSA::RpcLayerClusters::clusters_in_layer_phi
std::vector< std::list< double > > clusters_in_layer_phi
Definition: ClusterPatFinder.h:60
TrigL2MuonSA::ClusterPattern::group
int group
Definition: ClusterPatFinder.h:19
TrigL2MuonSA::ClusterPatFinder::setGroup
void setGroup(int &nGroup, std::vector< TrigL2MuonSA::ClusterPattern > &crPatterns) const
Definition: ClusterPatFinder.cxx:676
TrigL2MuonSA::ClusterPattern::dMO
double dMO
Definition: ClusterPatFinder.h:21
TrigL2MuonSA::RpcLayerClusters::clusters_in_layer_Z
std::vector< std::vector< double > > clusters_in_layer_Z
Definition: ClusterPatFinder.h:61
TrigL2MuonSA::ClusterPattern::clustersID
int clustersID[8]
Definition: ClusterPatFinder.h:24
TrigL2MuonSA::ClusterPattern::bw
double bw[3]
Definition: ClusterPatFinder.h:23
TrigL2MuonSA::ClusterPatFinder::findPatternEta
bool findPatternEta(std::vector< std::vector< double >> &aw, std::vector< std::vector< double >> &bw, TrigL2MuonSA::RpcLayerClusters &rpcLayerClusters) const
Definition: ClusterPatFinder.cxx:232
skel.l2
l2
Definition: skel.GENtoEVGEN.py:399
TrigL2MuonSA::ClusterPatFinder::deltaOK
bool deltaOK(int l1, int l2, double x1, double x2, int isphi, double &delta) const
Definition: ClusterPatFinder.cxx:408
lumiFormat.i
int i
Definition: lumiFormat.py:85
z
#define z
TrigL2MuonSA::ClusterPatFinder::calibR
double calibR(const std::string &stationName, double R, double Phi) const
Definition: ClusterPatFinder.cxx:478
AthAlgTool.h
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TrigL2MuonSA::RpcLayerClusters
Definition: ClusterPatFinder.h:58
TrigL2MuonSA::RpcLayerClusters::clusters_in_layer_eta
std::vector< std::list< double > > clusters_in_layer_eta
Definition: ClusterPatFinder.h:59
TrigL2MuonSA::ClusterPattern::isGoodFit
bool isGoodFit
Definition: ClusterPatFinder.h:25
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
TrigL2MuonSA::ClusterPattern::Clear
void Clear()
Definition: ClusterPatFinder.h:30
TrigL2MuonSA::ClusterPattern::phi_middle
double phi_middle
Definition: ClusterPatFinder.h:26
TrigL2MuonSA::ClusterPattern::groupCand
std::multimap< int, int > groupCand
Definition: ClusterPatFinder.h:18
TrigL2MuonSA::ClusterPatFinder::findPatternPhi
bool findPatternPhi(std::vector< double > &phi_middle, std::vector< double > &phi_outer, TrigL2MuonSA::RpcLayerClusters &rpcLayerClusters) const
Definition: ClusterPatFinder.cxx:66
TrigL2MuonSA::ClusterPatFinder::patfinder_forEta
bool patfinder_forEta(std::vector< TrigL2MuonSA::ClusterPattern > &crPatterns, TrigL2MuonSA::RpcLayerClusters &rpcLayerClusters) const
Definition: ClusterPatFinder.cxx:255
TrigL2MuonSA::ClusterPatFinder::removeSimilarRoad
void removeSimilarRoad(std::vector< TrigL2MuonSA::ClusterPattern > &crPatterns) const
Definition: ClusterPatFinder.cxx:662
TrigL2MuonSA::ClusterPatFinder::addCluster
void addCluster(const std::string &stationName, int stationEta, bool measuresPhi, unsigned int gasGap, unsigned int doubletR, double gPosX, double gPosY, double gPosZ, TrigL2MuonSA::RpcLayerClusters &rpcLayerClusters) const
Definition: ClusterPatFinder.cxx:26
TrigL2MuonSA::ClusterPattern::nclusters
int nclusters
Definition: ClusterPatFinder.h:28
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TrigL2MuonSA::ClusterPattern::operator==
bool operator==(const ClusterPattern &clp) const
Definition: ClusterPatFinder.h:46
skel.l1
l1
Definition: skel.GENtoEVGEN.py:398
AthAlgTool
Definition: AthAlgTool.h:26
TrigL2MuonSA::ClusterPattern::phi_outer
double phi_outer
Definition: ClusterPatFinder.h:27
TrigL2MuonSA::ClusterPatFinder
Definition: ClusterPatFinder.h:79
TrigL2MuonSA::ClusterPatFinder::ClusterPatFinder
ClusterPatFinder(const std::string &type, const std::string &name, const IInterface *parent)
Definition: ClusterPatFinder.cxx:16
TrigL2MuonSA::ClusterPatFinder::abcal
void abcal(unsigned int result_pat, size_t index[], double aw[], double bw[], TrigL2MuonSA::RpcLayerClusters &rpcLayerClusters) const
Definition: ClusterPatFinder.cxx:506
TrigL2MuonSA::ClusterPattern
Definition: ClusterPatFinder.h:17
TrigL2MuonSA::ClusterPatFinder::patfinder
bool patfinder(std::vector< TrigL2MuonSA::ClusterPattern > &crPattern, TrigL2MuonSA::RpcLayerClusters &rpcLayerClusters) const
Definition: ClusterPatFinder.cxx:85
TrigL2MuonSA
Definition: AlignmentBarrelLUT.h:13