14 const std::string&
name,
27 ATH_CHECK(m_tgcContainerKey.initialize());
29 return StatusCode::SUCCESS;
38 float roi_eta = p_roi->
eta();
39 float roi_phi = p_roi->
phi();
40 if (roi_phi < 0) roi_phi += 2.0 *
M_PI;
47 const bool isLowPt = m_recMuonRoIUtils.isLowPt(p_roi);
50 const double mid_eta_test = (isLowPt) ? m_options.roadParameters().deltaEtaAtMiddleForLowPt()
51 : m_options.roadParameters().deltaEtaAtMiddleForHighPt();
52 const double inn_eta_test = (isLowPt) ? m_options.roadParameters().deltaEtaAtInnerForLowPt()
53 : m_options.roadParameters().deltaEtaAtInnerForHighPt();
54 const double mid_phi_test = m_options.roadParameters().deltaPhiAtMiddle();
55 const double inn_phi_test = m_options.roadParameters().deltaPhiAtInner();
58 tgcPrepContainer = tgcContainerHandle.cptr();
59 if (!tgcContainerHandle.isValid()) {
60 ATH_MSG_ERROR(
"Could not retrieve PrepDataContainer key:" << m_tgcContainerKey.key());
61 return StatusCode::FAILURE;
67 float min_dphi_wire=1000.;
68 float second_dphi_wire=1000.;
69 std::vector<float> ov_dphi;
76 if (!m_idHelperSvc->tgcIdHelper().isStrip(prepDataWi.
identify())) {
77 int stationNumWi = m_idHelperSvc->tgcIdHelper().stationRegion(prepDataWi.
identify())-1;
78 if (stationNumWi==-1) stationNumWi=3;
79 if (stationNumWi<3 && std::abs(prepDataWi.
globalPosition().eta() - roi_eta) < mid_eta_test ) {
82 for (
unsigned int ov=0;
ov<ov_dphi.size();
ov++)
83 if (std::abs(dphi-ov_dphi[
ov])<1
e-5) overlap=
true;
84 if (overlap)
continue;
85 ov_dphi.push_back(dphi);
86 if (dphi<second_dphi_wire){
87 second_dphi_wire=dphi;
89 if (dphi<min_dphi_wire) {
90 second_dphi_wire=min_dphi_wire;
100 int num_second_hits=0;
104 if( !chit )
continue;
106 if (!m_idHelperSvc->tgcIdHelper().isStrip(prepDataHit.
identify())) {
107 int stationNumHit = m_idHelperSvc->tgcIdHelper().stationRegion(prepDataHit.
identify())-1;
108 if (stationNumHit==-1) stationNumHit=3;
109 if (stationNumHit<3 && std::abs(prepDataHit.
globalPosition().eta() - roi_eta) < mid_eta_test ) {
111 if (std::abs(dphi-min_dphi_wire)<1
e-5) num_min_hits++;
112 if (std::abs(dphi-second_dphi_wire)<1
e-5) num_second_hits++;
118 float dphi_wire=min_dphi_wire;
119 bool useDefault=
false;
120 if (num_min_hits<5) {
121 if (num_second_hits>5) dphi_wire=second_dphi_wire;
122 else useDefault=
true;
131 bool isInRoad =
false;
132 int stationNum = m_idHelperSvc->tgcIdHelper().stationRegion(prepData.
identify())-1;
133 if (stationNum==-1) stationNum=3;
134 if (m_idHelperSvc->tgcIdHelper().isStrip(prepData.
identify())) {
135 double dphi = std::abs(prepData.
globalPosition().phi() - roi_phi);
136 if( dphi >
M_PI*2 ) dphi = dphi -
M_PI*2;
137 if( dphi >
M_PI ) dphi =
M_PI*2 - dphi;
139 if ( stationNum < 3 && dphi < mid_phi_test ) { isInRoad =
true; }
140 else if( stationNum == 3 && dphi < inn_phi_test ) { isInRoad =
true; }
145 if ( stationNum < 3 && std::abs(prepData.
globalPosition().eta() - roi_eta) < mid_eta_test ) {
146 if (useDefault) isInRoad =
true;
147 else if (std::abs(dphi-dphi_wire)<1
e-5) isInRoad =
true;
149 else if( stationNum == 3 && std::abs(prepData.
globalPosition().eta() - roi_eta) < inn_eta_test ) { isInRoad =
true; }
151 if( ! isInRoad )
continue;
154 gasGap = m_idHelperSvc->tgcIdHelper().gasGap(prepData.
identify());
163 lutDigit.
sta = stationNum;
164 lutDigit.
isStrip = m_idHelperSvc->tgcIdHelper().isStrip(prepData.
identify());
165 if(m_idHelperSvc->tgcIdHelper().isStrip(prepData.
identify())){
175 tgcHits.push_back(lutDigit);
180 return StatusCode::SUCCESS;
189 float roi_eta = p_roi->
eta();
190 float roi_phi = p_roi->
phi();
191 if (roi_phi < 0) roi_phi += 2.0 *
M_PI;
198 const bool isLowPt = m_recMuonRoIUtils.isLowPt(p_roi);
201 const double mid_eta_test = (isLowPt) ? m_options.roadParameters().deltaEtaAtMiddleForLowPt()
202 : m_options.roadParameters().deltaEtaAtMiddleForHighPt();
203 const double inn_eta_test = (isLowPt) ? m_options.roadParameters().deltaEtaAtInnerForLowPt()
204 : m_options.roadParameters().deltaEtaAtInnerForHighPt();
205 const double mid_phi_test = m_options.roadParameters().deltaPhiAtMiddle();
206 const double inn_phi_test = m_options.roadParameters().deltaPhiAtInner();
209 tgcPrepContainer = tgcContainerHandle.cptr();
210 if (!tgcContainerHandle.isValid()) {
211 ATH_MSG_ERROR(
"Could not retrieve PrepDataContainer key:" << m_tgcContainerKey.key());
212 return StatusCode::FAILURE;
218 float min_dphi_wire=1000.;
219 float second_dphi_wire=1000.;
220 std::vector<float> ov_dphi;
227 if (!m_idHelperSvc->tgcIdHelper().isStrip(prepDataWi.
identify())) {
228 int stationNumWi = m_idHelperSvc->tgcIdHelper().stationRegion(prepDataWi.
identify())-1;
229 if (stationNumWi==-1) stationNumWi=3;
230 if (stationNumWi<3 && std::abs(prepDataWi.
globalPosition().eta() - roi_eta) < mid_eta_test ) {
233 for (
unsigned int ov=0;
ov<ov_dphi.size();
ov++)
234 if (std::abs(dphi-ov_dphi[
ov])<1
e-5) overlap=
true;
235 if (overlap)
continue;
236 ov_dphi.push_back(dphi);
237 if (dphi<second_dphi_wire){
238 second_dphi_wire=dphi;
240 if (dphi<min_dphi_wire) {
241 second_dphi_wire=min_dphi_wire;
251 int num_second_hits=0;
255 if( !chit )
continue;
257 if (!m_idHelperSvc->tgcIdHelper().isStrip(prepDataHit.
identify())) {
258 int stationNumHit = m_idHelperSvc->tgcIdHelper().stationRegion(prepDataHit.
identify())-1;
259 if (stationNumHit==-1) stationNumHit=3;
260 if (stationNumHit<3 && std::abs(prepDataHit.
globalPosition().eta() - roi_eta) < mid_eta_test ) {
262 if (std::abs(dphi-min_dphi_wire)<1
e-5) num_min_hits++;
263 if (std::abs(dphi-second_dphi_wire)<1
e-5) num_second_hits++;
269 float dphi_wire=min_dphi_wire;
270 bool useDefault=
false;
271 if (num_min_hits<5) {
272 if (num_second_hits>5) dphi_wire=second_dphi_wire;
273 else useDefault=
true;
282 bool isInRoad =
false;
283 int stationNum = m_idHelperSvc->tgcIdHelper().stationRegion(prepData.
identify())-1;
284 if (stationNum==-1) stationNum=3;
285 if (m_idHelperSvc->tgcIdHelper().isStrip(prepData.
identify())) {
286 double dphi = std::abs(prepData.
globalPosition().phi() - roi_phi);
287 if( dphi >
M_PI*2 ) dphi = dphi -
M_PI*2;
288 if( dphi >
M_PI ) dphi =
M_PI*2 - dphi;
290 if ( stationNum < 3 && dphi < mid_phi_test ) { isInRoad =
true; }
291 else if( stationNum == 3 && dphi < inn_phi_test ) { isInRoad =
true; }
296 if ( stationNum < 3 && std::abs(prepData.
globalPosition().eta() - roi_eta) < mid_eta_test ) {
297 if (useDefault) isInRoad =
true;
298 else if (std::abs(dphi-dphi_wire)<1
e-5) isInRoad =
true;
300 else if( stationNum == 3 && std::abs(prepData.
globalPosition().eta() - roi_eta) < inn_eta_test ) { isInRoad =
true; }
302 if( ! isInRoad )
continue;
305 gasGap = m_idHelperSvc->tgcIdHelper().gasGap(prepData.
identify());
314 lutDigit.
sta = stationNum;
315 lutDigit.
isStrip = m_idHelperSvc->tgcIdHelper().isStrip(prepData.
identify());
316 if(m_idHelperSvc->tgcIdHelper().isStrip(prepData.
identify())){
326 tgcHits.push_back(lutDigit);
331 return StatusCode::SUCCESS;