17 ATH_CHECK( fillVariablesOverlapRemoverPlots<xAOD::L2StandAloneMuon>(
chain,
"L2SA") );
18 ATH_CHECK( fillVariablesOverlapRemoverPlots<xAOD::L2CombinedMuon>(
chain,
"L2CB") );
20 return StatusCode::SUCCESS;
40 double dRThres = 9999.;
41 double massThres = 9999.;
42 bool isBarrel1 = (*muEL1)->sAddress() != -1;
43 bool isBarrel2 = (*muEL2)->sAddress() != -1;
45 if( isBarrel1 && isBarrel2 ) {
49 else if( (isBarrel1 && ! isBarrel2) || (!isBarrel1 && isBarrel2) ) {
54 double absEta = (std::abs(mu1Pt) > std::abs(mu2Pt)) ? std::abs(mu1Eta) : std::abs(mu2Eta);
55 unsigned int iThres=0;
65 bool sameSign = mu1Pt*mu2Pt > 0;
68 float deta = mu1Eta - mu2Eta;
70 dR = sqrt(deta*deta + dphi*dphi);
71 bool dRisClose = dR < dRThres;
75 bool massIsClose =
invMass < massThres;
78 const float monitor_limit = 1
e-4;
79 dRLog10 = ( dR >= monitor_limit ) ? log10(dR) : log10(monitor_limit);
80 invMassLog10 = (
invMass >= monitor_limit ) ? log10(
invMass) : log10(monitor_limit);
84 bool overlap = sameSign && dRisClose && massIsClose;
109 double absEta = (std::abs(mu1Pt) > std::abs(mu2Pt)) ? std::abs(mu1Eta) : std::abs(mu2Eta);
110 unsigned int iThres=0;
120 bool sameSign = mu1Pt*mu2Pt > 0;
123 float deta = mu1Eta - mu2Eta;
125 dR = sqrt(deta*deta + dphi*dphi);
126 bool dRisClose = dR < dRThres;
129 bool dRbySAisClose =
false;
132 if( muSA1 ==
nullptr || muSA2 ==
nullptr )
return false;
136 float dRBySA = sqrt(deta*deta + dphi*dphi);
137 if( dRBySA < dRbySAThres ) dRbySAisClose =
true;
142 bool massIsClose =
invMass < massThres;
145 const float monitor_limit = 1
e-4;
146 dRLog10 = ( dR >= monitor_limit ) ? log10(dR) : log10(monitor_limit);
147 invMassLog10 = (
invMass >= monitor_limit ) ? log10(
invMass) : log10(monitor_limit);
151 bool overlap = sameSign && dRisClose && massIsClose && dRbySAisClose;
164 std::vector<float> vec_RemovedEta, vec_RemovedPhi, vec_RemovedPt;
169 for(
i=0;
i<featureCont.size();
i++) {
171 if( muResult[
i] !=
i ) {
175 std::vector<unsigned int> others;
176 for(j=0; j<featureCont.size(); j++) {
177 if( muResult[j] == muResult[
i] ) others.emplace_back(j);
179 if( others.size() == 1 ) {
185 unsigned int BestMuon = 0;
188 for(
k=0;
k<others.size();
k++) {
191 float pt = std::abs((*muEL)->pt());
192 float ptRoI = (*muEL)->roiThreshold();
193 if( (ptRoI-maxPtRoI) > 0.1 ) {
198 else if( std::abs(ptRoI-maxPtRoI) < 0.1 ) {
207 for(
k=0;
k<others.size();
k++) {
209 if( j != BestMuon ) {
211 vec_RemovedPt.push_back( (*muEL)->pt() );
212 vec_RemovedEta.push_back( (*muEL)->etaMS() );
213 vec_RemovedPhi.push_back( (*muEL)->phiMS() );
221 return StatusCode::SUCCESS;
228 std::vector<float> vec_RemovedEta, vec_RemovedPhi, vec_RemovedPt;
233 for(
i=0;
i<featureCont.size();
i++) {
235 if( muResult[
i] !=
i ) {
239 std::vector<unsigned int> others;
240 for(j=0; j<featureCont.size(); j++) {
241 if( muResult[j] == muResult[
i] ) others.emplace_back(j);
243 if( others.size() == 1 ) {
249 unsigned int BestMuon = 0;
251 for(
k=0;
k<others.size();
k++) {
254 float pt = std::abs((*muEL)->pt()/1
e3);
261 for(
k=0;
k<others.size();
k++) {
263 if( j != BestMuon ) {
265 vec_RemovedPt.push_back( (*muEL)->pt()/1
e3 * (*muEL)->charge() );
266 vec_RemovedEta.push_back( (*muEL)->eta() );
267 vec_RemovedPhi.push_back( (*muEL)->phi() );
275 return StatusCode::SUCCESS;
281 double m2,
double pt2,
double eta2,
double phi2)
285 double theta1 = 2*atan2((
double)
exp(-
eta1),1.);
286 double theta2 = 2*atan2((
double)
exp(-
eta2),1.);
288 double fpt1 = fabs(pt1);
289 double fpt2 = fabs(pt2);
291 double px1 = fpt1*
cos(phi1);
292 double py1 = fpt1*
sin(phi1);
293 double pz1 = fpt1/
tan(theta1);
294 double e1 = sqrt(px1*px1+py1*py1+pz1*pz1+
m1*
m1);
296 double px2 = fpt2*
cos(phi2);
297 double py2 = fpt2*
sin(phi2);
298 double pz2 = fpt2/
tan(theta2);
299 double e2 = sqrt(px2*px2+py2*py2+pz2*pz2+
m2*
m2);
301 double pxsum = px1 + px2;
302 double pysum = py1 + py2;
303 double pzsum = pz1 + pz2;
304 double esum =
e1 +
e2;
307 double mass2 = esum*esum - pxsum*pxsum - pysum*pysum - pzsum*pzsum;
315 return std::forward_as_tuple(trig->
pt(), trig->
etaMS(), trig->
phiMS());
319 return std::forward_as_tuple( (trig->
pt()/1
e3 * trig->
charge() ), trig->
eta(), trig->
phi());