45{
48
51
53 std::vector< std::vector< double > > aw, bw;
54 std::vector< double > clearRoad;
55 clearRoad.clear();
59 if ( (*clusterPatFinder)->findPatternEta(aw, bw, rpcLayerClusters) ) {
60 for(unsigned int iClus = 0; iClus < aw[1].size(); iClus++){
61 TrigL2MuonSA::RpcFitResult clusFitResult;
62 clusFitResult.
Clear();
70 ATH_MSG_DEBUG(
"==========================================================");
76 }
77 clusterFitResults.push_back(clusFitResult);
78 }
79 ATH_MSG_DEBUG(
"==========================================================");
80 } else {
81 TrigL2MuonSA::RpcFitResult clusFitResult;
82 clusFitResult.
Clear();
84 clusterFitResults.push_back(clusFitResult);
85 }
86
88 std::vector<double> phi_middle, phi_outer;
89 phi_middle.clear(); phi_outer.clear();
90 if ( (*clusterPatFinder)->findPatternPhi(phi_middle, phi_outer, rpcLayerClusters) ){
91 double phi_middle_tot = 0;
92 double phi_outer_tot = 0;
93 size_t npatternPhi = phi_middle.size();
94 if(npatternPhi > 0){
95 for(
double&
phi : phi_middle){
96 phi_middle_tot = phi_middle_tot +
phi;
97 }
98 for(
double&
phi : phi_outer){
99 phi_outer_tot = phi_outer_tot +
phi;
100 }
101 double phi_middle_center = phi_middle_tot/npatternPhi;
102 double phi_outer_center = phi_outer_tot/npatternPhi;
103 ATH_MSG_DEBUG(
"center of phi middle/outer = " << phi_middle_center <<
"/" << phi_outer_center);
104 for(unsigned int iClus_fit = 0; iClus_fit < clusterFitResults.size(); iClus_fit++){
105 clusterFitResults.at(iClus_fit).phi = phi_middle_center;
106 clusterFitResults.at(iClus_fit).phi_middle = phi_middle_center;
107 clusterFitResults.at(iClus_fit).phi_outer = phi_outer_center;
108 }
109 } else {
110 for(unsigned int iClus_fit = 0; iClus_fit < clusterFitResults.size(); iClus_fit++){
111 clusterFitResults.at(iClus_fit).phi = p_roi->
phi();
112 clusterFitResults.at(iClus_fit).phi_middle = p_roi->
phi();
113 clusterFitResults.at(iClus_fit).phi_outer = p_roi->
phi();
114 }
115 }
116 } else {
117 for(unsigned int iClus_fit = 0; iClus_fit < clusterFitResults.size(); iClus_fit++){
118 clusterFitResults.at(iClus_fit).phi = p_roi->
phi();
119 }
120 }
121 }
122 if(clusterFitResults.empty()){
123 TrigL2MuonSA::RpcFitResult clusFitResult;
124 clusFitResult.
Clear();
126 clusFitResult.
phi = p_roi->
phi();
127 clusterFitResults.push_back(clusFitResult);
128 }
129
130 ATH_MSG_DEBUG(
"stored cluster eta/phi pattern to clusterRoad");
131 for(unsigned int iClus_fit = 0; iClus_fit < clusterFitResults.size(); iClus_fit++){
132 TrigL2MuonSA::MuonRoad muonRoad;
134
135
137 muonRoad.
phiMiddle = clusterFitResults.at(iClus_fit).phi;
139 muonRoad.
side = (p_roi->
phi()<0.)? 0 : 1;
141
142 int PhysicsSector = ((p_roi->
getSectorID() + 1)/4 )%8 + 1;
143
144 int special = 0;
145 if (muonRoad.
LargeSmall == 0 && (PhysicsSector == 6 || PhysicsSector == 8 ))
146 special = 1;
147 else if (muonRoad.
LargeSmall == 1 && (PhysicsSector == 6 || PhysicsSector == 7 ))
148 special = 1;
150
151 for (int i_station=0; i_station<6; i_station++) {
152 for (int i_layer=0; i_layer<8; i_layer++) {
153 if(!clusterFitResults.at(iClus_fit).isSuccess) {
154 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 500;
155 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 650;
156 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 800;
157 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 500;
158 else if (i_station==4) muonRoad.
rWidth[9][i_layer] = 650;
159 else if (i_station==5) muonRoad.
rWidth[10][i_layer] = 650;
161 }
162 else {
163 if (i_station==0) muonRoad.
rWidth[i_station][i_layer] = 400;
164 else if (i_station==1) muonRoad.
rWidth[i_station][i_layer] = 200;
165 else if (i_station==2) muonRoad.
rWidth[i_station][i_layer] = 400;
166 else if (i_station==3) muonRoad.
rWidth[i_station][i_layer] = 400;
170 }
171 }
172 }
173 int sector_trigger = 99;
174 int sector_overlap = 99;
175 std::vector<Identifier> stationList;
176 std::vector<IdentifierHash> mdtHashList;
177
178
179 IdContext context =
m_idHelperSvc->mdtIdHelper().module_context();
180
185 if(phiMax >
M_PI) phiMax -=
M_PI*2.;
186 if(phiMin <
M_PI*-1) phiMin +=
M_PI*2.;
187
189
190 const IRoiDescriptor* iroi = static_cast<IRoiDescriptor*> (roi);
191
193 else {
196 }
197
198 if(roi) delete roi;
199
200 for( const IdentifierHash& hash : mdtHashList){
201
204
205 if(convert!=0)
ATH_MSG_ERROR(
"problem converting hash list to id");
206
210
211 if ( name[1]=='M' && name[2]=='E' ) continue;
212 else if ( name[1]=='M' && name[2]=='G' ) continue;
213
214 int LargeSmall = 0;
215 if(name[2]=='S' || name[2]=='F' || name[2]=='G' ) LargeSmall = 1;
217 if(sector_trigger == 99)
218 sector_trigger = sector;
219 else if(sector_trigger != sector)
220 sector_overlap = sector;
221 }
222
223 int MDT_tr = (PhysicsSector - 1)*2 + muonRoad.
LargeSmall;
224 if (MDT_tr == sector_overlap) {
225 sector_overlap = sector_trigger;
226 sector_trigger = MDT_tr;
227 }
228
231
232 if (clusterFitResults.at(iClus_fit).isSuccess) {
233 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
234 muonRoad.
aw[0][i_sector] = clusterFitResults.at(iClus_fit).slope_inner;
235 muonRoad.
bw[0][i_sector] = clusterFitResults.at(iClus_fit).offset_inner;
236 muonRoad.
aw[1][i_sector] = clusterFitResults.at(iClus_fit).slope_middle;
237 muonRoad.
bw[1][i_sector] = clusterFitResults.at(iClus_fit).offset_middle;
238 muonRoad.
aw[2][i_sector] = clusterFitResults.at(iClus_fit).slope_outer;
239 muonRoad.
bw[2][i_sector] = clusterFitResults.at(iClus_fit).offset_outer;
240 muonRoad.
aw[3][i_sector] = clusterFitResults.at(iClus_fit).slope_inner;
241 muonRoad.
bw[3][i_sector] = clusterFitResults.at(iClus_fit).offset_inner;
242 muonRoad.
aw[9][i_sector] = clusterFitResults.at(iClus_fit).slope_middle;
243 muonRoad.
bw[9][i_sector] = clusterFitResults.at(iClus_fit).offset_middle;
244 muonRoad.
aw[10][i_sector] = clusterFitResults.at(iClus_fit).slope_middle;
245 muonRoad.
bw[10][i_sector] = clusterFitResults.at(iClus_fit).offset_middle;
246 }
247 } else {
248 double roiEtaLow = (roiEtaMinLow + roiEtaMaxLow) * 0.5;
249 double roiEtaHigh = (roiEtaMinHigh + roiEtaMaxHigh) * 0.5;
250 double thetaLow = std::atan(std::exp(-std::abs(roiEtaLow)))*2.;
251 double thetaHigh = std::atan(std::exp(-std::abs(roiEtaHigh)))*2.;
252 double awLow = (std::abs(roiEtaLow) >
ZERO_LIMIT)? std::tan(thetaLow)*(std::abs(roiEtaLow)/roiEtaLow): 0.;
253 double awHigh = (std::abs(roiEtaHigh) >
ZERO_LIMIT)? std::tan(thetaHigh)*(std::abs(roiEtaHigh)/roiEtaHigh): 0.;
254
255 for (
int i_station=0; i_station<
N_LAYER; i_station++) {
256 for (
int i_sector=0; i_sector<
N_SECTOR; i_sector++) {
257 muonRoad.
aw[i_station][i_sector] = awLow;
258 muonRoad.
bw[i_station][i_sector] = 0;
259 if (i_station==2) muonRoad.
aw[i_station][i_sector] = awHigh;
260 else if (i_station==3) muonRoad.
aw[i_station][i_sector] = awLow;
261 else if (i_station==4) muonRoad.
aw[9][i_sector] = awLow;
262 else if (i_station==5) muonRoad.
aw[10][i_sector] = awLow;
263 }
264 }
265 }
266 clusterRoad.push_back(muonRoad);
267 }
268 ATH_MSG_DEBUG(
"finished ClusterRoadDefiner algorithm... leave");
269 return StatusCode::SUCCESS;
270}
Scalar phi() const
phi method
Athena::TPCnvVers::Current TrigRoiDescriptor
double m_rWidth_RPC_Failed
ToolHandle< IRegSelTool > m_regionSelector
ServiceHandle< Muon::IMuonIdHelperSvc > m_idHelperSvc
std::vector< Identifier > stationList
double aw[N_STATION][N_SECTOR]
double bw[N_STATION][N_SECTOR]
double rWidth[N_STATION][N_LAYER]
float eta() const
The pseudorapidity ( ) of the muon candidate.
float phi() const
The azimuthal angle ( ) of the muon candidate.
int getSectorID() const
Get the sector ID number.
constexpr uint8_t stationPhi
station Phi 1 to 8
std::unique_ptr< MVAUtils::BDT > convert(TMVA::MethodBDT *bdt, bool isRegression=true, bool useYesNoLeaf=false)