|
ATLAS Offline Software
|
Go to the documentation of this file.
5 #include "GaudiKernel/SystemOfUnits.h"
22 return StatusCode::FAILURE;
30 ATH_MSG_ERROR(
"Trying to configure hypo with no pT bins. This is probably a configuration mistake.");
31 return StatusCode::FAILURE;
34 for(
size_t j=0; j<
m_ptBins.size(); j++){
38 return StatusCode::FAILURE;
41 for (std::vector<float>::size_type
i=0;
i<
m_bins[j];++
i) {
57 if(
m_doSA)
m_type = xAOD::Muon::TrackParticleType::ExtrapolatedMuonSpectrometerTrackParticle;
58 else m_type = xAOD::Muon::TrackParticleType::CombinedTrackParticle;
60 return StatusCode::SUCCESS;
65 std::vector<float> fexPt, fexEta, fexPhi, selPt, selEta, selPhi;
72 auto monitorIt =
Monitored::Group(
m_monTool, muonPtMon, muonEtaMon, muonPhiMon, muonPtSelMon, muonEtaSelMon, muonPhiSelMon);
77 ATH_MSG_DEBUG(
"Accept property is set: taking all the events");
88 if (
muon->primaryTrackParticle()) {
96 fexEta.push_back(tr->
eta());
97 fexPhi.push_back(tr->
phi());
101 for (std::vector<float>::size_type
k=0;
k<
m_bins[cutIndex]; ++
k) {
112 ATH_MSG_DEBUG(
"No numberOfGoodPrecisionLayers variable found; not passing hypo");
115 if(std::abs(
muon->eta()) > 1.3) {
117 if(nGoodPrcLayers < 2){
118 ATH_MSG_DEBUG(
"Muon has less than two GoodPrecisionLayers; not passing hypo (requrement loosend according to absence of NSW)");
122 if(nGoodPrcLayers < 3){
123 ATH_MSG_DEBUG(
"Muon has less than three GoodPrecisionLayers; not passing hypo");
127 }
else if (std::abs(
muon->eta()) > 1.05) {
128 if(nGoodPrcLayers < 3){
129 ATH_MSG_DEBUG(
"Muon has less than three GoodPrecisionLayers; not passing hypo");
141 selEta.push_back(tr->
eta());
142 selPhi.push_back(tr->
phi());
146 <<
" with Charge " << tr->
charge()
148 <<
" so hypothesis is " << (
result?
"true":
"false"));
151 <<
" with Charge " << tr->
charge()
152 <<
" and with d0 " << tr->
d0()
154 <<
" and d0min cut is " <<
m_d0min<<
" mm"
155 <<
" so hypothesis is " << (
result?
"true":
"false"));
163 bool passCut =
false;
165 const xAOD::TrackParticle* metrack =
muon->trackParticle( xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle );
166 float mePt = -999999., idPt = -999999.;
168 float reducedChi2 = -10, qOverPsignif = -10;
170 if(idtrack && metrack) {
171 mePt = metrack->
pt();
172 idPt = idtrack->
pt();
173 float meP = 1.0 / (
sin(metrack->
theta()) / mePt);
174 float idP = 1.0 / (
sin(idtrack->
theta()) / idPt);
176 reducedChi2 =
muon->primaryTrackParticle()->chiSquared()/
muon->primaryTrackParticle()->numberDoF();
185 size_t numTrigger =
m_ptBins.size();
186 size_t numMuon=toolInput.size();
195 return StatusCode::SUCCESS;
198 for (
uint i=0;
i<toolInput.size();
i++){
199 auto&
tool = toolInput.at(
i);
201 bool overlap =
false;
203 for(
uint j=
i+1; j<toolInput.size();j++){
204 auto& tool2 = toolInput.at(j);
206 if(tool2.muon->p4()==
tool.muon->p4()) overlap=
true;
209 if(overlap)
continue;
218 return StatusCode::SUCCESS;
222 bool passingNscan=
false;
223 for(
size_t cutIndex=0; cutIndex <
m_ptBins.size(); ++cutIndex) {
224 size_t elementIndex{0};
225 for(
auto&
tool : toolInput){
228 if(
m_nscan && cutIndex==0 && (!passingNscan)){
231 unsigned int nInCone=0;
232 float muonR = sqrt(
pow(
tool.muon->eta(),2) +
pow(
tool.muon->phi(),2));
234 for (
auto& tooltmp : toolInput){
236 << tooltmp.muon->eta() <<
", phi: " << tooltmp.muon->phi());
237 if (tooltmp.muon->p4() ==
tool.muon->p4()) {
240 deta = std::abs(tooltmp.muon->eta()-
tool.muon->eta());
241 dphi =
getdphi(tooltmp.muon->phi(),
tool.muon->phi());
242 if(deta<coneCheck && dphi<coneCheck){
255 ATH_MSG_DEBUG(
"Passes narrow-scan selection Index["<<elementIndex<<
"]");
257 }
else ATH_MSG_DEBUG(
"Does not pass narrow-scan selection Index["<<elementIndex<<
"]");
260 passingSelection[cutIndex].push_back(elementIndex);
269 if (
m_nscan &&(!passingNscan)){
270 ATH_MSG_DEBUG(
"Narrow-scan is required and no muons passed, all muons will be rejected ");
271 return StatusCode::SUCCESS;
274 if(passingSelection[cutIndex].
empty()){
275 ATH_MSG_DEBUG(
"No muons passed the selection "<<cutIndex<<
" rejecting...");
276 return StatusCode::SUCCESS;
279 std::set<size_t> passingIndices;
282 std::set<const xAOD::Muon*> setOfMuons;
283 for (
auto index : comb){
284 setOfMuons.insert(toolInput[
index].
muon);
286 return setOfMuons.size()==comb.size();
294 if(passingIndices.empty()){
296 return StatusCode::SUCCESS;
298 for(
auto i : passingIndices){
302 return StatusCode::SUCCESS;
305 float dphi = phi1-phi2;
306 if(dphi > TMath::Pi()) dphi -= TMath::TwoPi();
307 if(dphi < -1*TMath::Pi()) dphi += TMath::TwoPi();
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Group
Properties of a chain group.
bool passed(DecisionID id, const DecisionIDContainer &idSet)
checks if required decision ID is in the set of IDs in the container
TrigCompositeUtils::DecisionID numeric() const
numeric ID
float charge() const
Returns the charge.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
void addDecisionID(DecisionID id, Decision *d)
Appends the decision (given as ID) to the decision object.
bool msgLvl(const MSG::Level lvl) const
float d0() const
Returns the parameter.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
std::vector< size_t > Index1DVec
Unique combinations for case when one can not repeat the index (i.e.
It used to be useful piece of code for replacing actual SG with other store of similar functionality ...
::StatusCode StatusCode
StatusCode definition for legacy code.
Header file to be included by clients of the Monitored infrastructure.
void elementsInUniqueCombinations(const Index2DVec &indices, std::set< size_t > &participants, std::function< bool(const Index1DVec &)> &&filter)
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
bool absEta(const xAOD::TauJet &tau, double &out)
@ numberOfGoodPrecisionLayers
layers with at least 3 hits that are not deweighted [uint8_t]
std::vector< Index1DVec > Index2DVec
Class describing a TrackParticle.
constexpr int pow(int base, int exp) noexcept
float theta() const
Returns the parameter, which has range 0 to .
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)