ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
MuonSpectrometer
MuonReconstruction
MuonDataPrep
MuonClusterization
MuonClusterization
RpcHitClustering.h
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#ifndef RPCHITCLUSTERING_H
6
#define RPCHITCLUSTERING_H
7
8
#include <vector>
9
#include "
MuonPrepRawData/MuonPrepDataContainer.h
"
10
#include "
MuonPrepRawData/RpcPrepData.h
"
11
#include "
MuonReadoutGeometry/RpcReadoutElement.h
"
12
13
#include "Identifier/Identifier.h"
14
#include "
MuonIdHelpers/RpcIdHelper.h
"
15
16
namespace
Muon
{
17
18
struct
RpcClusterObj
{
19
20
typedef
std::vector< const RpcPrepData* >
HitList
;
21
typedef
HitList::iterator
HitIt
;
22
typedef
HitList::const_iterator
HitCit
;
23
RpcClusterObj
() :
ngasgap1
(0),
ngasgap2
(0) {}
24
25
void
add
(
const
RpcPrepData
* prd,
int
gasgap ) {
26
if
( gasgap == 1 ) ++
ngasgap1
;
27
else
++
ngasgap2
;
28
hitList
.push_back(prd);
29
}
30
31
bool
addSecond
(
const
RpcPrepData
* prd,
int
gasgap ) {
32
33
HitIt
it =
hitList
.begin();
34
HitIt
it_end =
hitList
.end();
35
for
( ;it!=it_end;++it ){
36
if
( (*it)->identify() != prd->
identify
() )
continue
;
37
if
( fabs( (*it)->time() - 12.5) > fabs( prd->
time
() - 12.5 ) ){
38
*it = prd;
39
}
40
return
true
;
41
}
42
add
(prd,gasgap);
43
return
false
;
44
}
45
46
void
merge
(
RpcClusterObj
& cluster ) {
47
hitList
.insert(
hitList
.end(),cluster.
hitList
.begin(),cluster.
hitList
.end());
48
ngasgap1
+= cluster.
ngasgap1
;
49
ngasgap2
+= cluster.
ngasgap2
;
50
cluster.
ngasgap1
= 0;
51
cluster.
ngasgap2
= 0;
52
cluster.
hitList
.clear();
53
}
54
55
bool
active
()
const
{
return
!
hitList
.empty(); }
56
57
int
layers
()
const
{
58
if
(
hitList
.empty() )
return
0;
59
else
if
(
ngasgap1
> 0 &&
ngasgap2
> 0 )
return
2;
60
return
1;
61
}
62
63
int
ngasgap1
;
64
int
ngasgap2
;
65
HitList
hitList
;
66
};
67
68
struct
SortRpcClusterObjs
{
69
bool
operator()
(
const
RpcClusterObj
& cl1,
const
RpcClusterObj
& cl2 )
const
{
70
if
( cl1.
layers
() > cl2.
layers
() )
return
true
;
71
else
if
( cl1.
layers
() < cl2.
layers
() )
return
false
;
72
return
cl1.
hitList
.size() < cl2.
hitList
.size();
73
}
74
};
75
76
struct
RpcHitClusteringObj
{
77
78
struct
Id
{
79
Id
(
int
g,
int
c ) :
gp
(g),
ch
(c) {}
80
int
gp
;
81
int
ch
;
82
};
83
84
struct
Doublet
{
85
Doublet
() :
first
(-1),
second
(-1) {}
86
int
first
;
87
int
second
;
88
int
sum
()
const
{
return
first
+
second
; }
89
};
90
typedef
std::vector< Doublet >
HitClustering
;
91
92
RpcHitClusteringObj
(
const
RpcIdHelper
* rpcIdHelper ) :
93
m_rpcIdHelper
(rpcIdHelper),
debug
(false),
combinedGasGaps
(true)
94
{}
95
96
bool
cluster
(
const
std::vector<const RpcPrepData*>& col );
97
bool
cluster
(
const
std::vector<const RpcPrepData*>& col,
const
Identifier
& subid );
98
99
void
dump
()
const
;
100
101
const
RpcClusterObj
*
bestEtaCluster
()
const
{
102
if
(
clustersEta
.empty() )
return
0;
103
return
&
clustersEta
.front();
104
}
105
106
const
RpcClusterObj
*
bestPhiCluster
()
const
{
107
if
(
clustersPhi
.empty() )
return
0;
108
return
&
clustersPhi
.front();
109
}
110
111
void
findBest
();
112
113
const
RpcIdHelper
*
m_rpcIdHelper
;
114
std::vector<Doublet>
channelsEta
;
115
std::vector<Doublet>
channelsPhi
;
116
std::vector<RpcClusterObj>
clustersEta
;
117
std::vector<RpcClusterObj>
clustersPhi
;
118
std::vector<RpcClusterObj>
clustersEtaTmp
;
119
std::vector<RpcClusterObj>
clustersPhiTmp
;
120
bool
debug
;
121
bool
combinedGasGaps
;
122
};
123
124
}
125
#endif
RpcReadoutElement.h
MuonPrepDataContainer.h
RpcIdHelper.h
RpcPrepData.h
Muon::RpcPrepData
Class to represent RPC measurements.
Definition
RpcPrepData.h:35
Muon::RpcPrepData::time
float time() const
Returns the time.
Definition
RpcPrepData.h:196
RpcIdHelper
Definition
RpcIdHelper.h:51
Trk::PrepRawData::identify
Identifier identify() const
return the identifier
Identifier
Definition
IdentifierFieldParser.cxx:14
Muon
NRpcCablingAlg reads raw condition data and writes derived condition data to the condition store.
Definition
TrackSystemController.h:46
Muon::RpcClusterObj
Definition
RpcHitClustering.h:18
Muon::RpcClusterObj::add
void add(const RpcPrepData *prd, int gasgap)
Definition
RpcHitClustering.h:25
Muon::RpcClusterObj::HitCit
HitList::const_iterator HitCit
Definition
RpcHitClustering.h:22
Muon::RpcClusterObj::merge
void merge(RpcClusterObj &cluster)
Definition
RpcHitClustering.h:46
Muon::RpcClusterObj::addSecond
bool addSecond(const RpcPrepData *prd, int gasgap)
Definition
RpcHitClustering.h:31
Muon::RpcClusterObj::RpcClusterObj
RpcClusterObj()
Definition
RpcHitClustering.h:23
Muon::RpcClusterObj::layers
int layers() const
Definition
RpcHitClustering.h:57
Muon::RpcClusterObj::ngasgap2
int ngasgap2
Definition
RpcHitClustering.h:64
Muon::RpcClusterObj::HitList
std::vector< const RpcPrepData * > HitList
Definition
RpcHitClustering.h:20
Muon::RpcClusterObj::HitIt
HitList::iterator HitIt
Definition
RpcHitClustering.h:21
Muon::RpcClusterObj::active
bool active() const
Definition
RpcHitClustering.h:55
Muon::RpcClusterObj::hitList
HitList hitList
Definition
RpcHitClustering.h:65
Muon::RpcClusterObj::ngasgap1
int ngasgap1
Definition
RpcHitClustering.h:63
Muon::RpcHitClusteringObj::Doublet::second
int second
Definition
RpcHitClustering.h:87
Muon::RpcHitClusteringObj::Doublet::Doublet
Doublet()
Definition
RpcHitClustering.h:85
Muon::RpcHitClusteringObj::Doublet::first
int first
Definition
RpcHitClustering.h:86
Muon::RpcHitClusteringObj::Doublet::sum
int sum() const
Definition
RpcHitClustering.h:88
Muon::RpcHitClusteringObj::Id::Id
Id(int g, int c)
Definition
RpcHitClustering.h:79
Muon::RpcHitClusteringObj::Id::gp
int gp
Definition
RpcHitClustering.h:80
Muon::RpcHitClusteringObj::Id::ch
int ch
Definition
RpcHitClustering.h:81
Muon::RpcHitClusteringObj::dump
void dump() const
Definition
RpcHitClustering.cxx:237
Muon::RpcHitClusteringObj::clustersPhiTmp
std::vector< RpcClusterObj > clustersPhiTmp
Definition
RpcHitClustering.h:119
Muon::RpcHitClusteringObj::channelsEta
std::vector< Doublet > channelsEta
Definition
RpcHitClustering.h:114
Muon::RpcHitClusteringObj::bestPhiCluster
const RpcClusterObj * bestPhiCluster() const
Definition
RpcHitClustering.h:106
Muon::RpcHitClusteringObj::clustersEta
std::vector< RpcClusterObj > clustersEta
Definition
RpcHitClustering.h:116
Muon::RpcHitClusteringObj::m_rpcIdHelper
const RpcIdHelper * m_rpcIdHelper
Definition
RpcHitClustering.h:113
Muon::RpcHitClusteringObj::channelsPhi
std::vector< Doublet > channelsPhi
Definition
RpcHitClustering.h:115
Muon::RpcHitClusteringObj::debug
bool debug
Definition
RpcHitClustering.h:120
Muon::RpcHitClusteringObj::RpcHitClusteringObj
RpcHitClusteringObj(const RpcIdHelper *rpcIdHelper)
Definition
RpcHitClustering.h:92
Muon::RpcHitClusteringObj::cluster
bool cluster(const std::vector< const RpcPrepData * > &col)
Definition
RpcHitClustering.cxx:9
Muon::RpcHitClusteringObj::bestEtaCluster
const RpcClusterObj * bestEtaCluster() const
Definition
RpcHitClustering.h:101
Muon::RpcHitClusteringObj::HitClustering
std::vector< Doublet > HitClustering
Definition
RpcHitClustering.h:90
Muon::RpcHitClusteringObj::clustersEtaTmp
std::vector< RpcClusterObj > clustersEtaTmp
Definition
RpcHitClustering.h:118
Muon::RpcHitClusteringObj::combinedGasGaps
bool combinedGasGaps
Definition
RpcHitClustering.h:121
Muon::RpcHitClusteringObj::findBest
void findBest()
Definition
RpcHitClustering.cxx:258
Muon::RpcHitClusteringObj::clustersPhi
std::vector< RpcClusterObj > clustersPhi
Definition
RpcHitClustering.h:117
Muon::SortRpcClusterObjs
Definition
RpcHitClustering.h:68
Muon::SortRpcClusterObjs::operator()
bool operator()(const RpcClusterObj &cl1, const RpcClusterObj &cl2) const
Definition
RpcHitClustering.h:69
Generated on
for ATLAS Offline Software by
1.17.0