10TrigMuonEfficiencyMon :: TrigMuonEfficiencyMon(
const std::string& name, ISvcLocator* pSvcLocator )
15StatusCode TrigMuonEfficiencyMon :: initialize(){
21 ATH_MSG_ERROR(
"Configuration seems to be wrong. The size of \"L1Seeds\" and \"Thresholds\" should be same as \"MonitoredChainds\".");
22 return StatusCode::FAILURE;
24 for(
unsigned int ichain=0; ichain<nchains; ++ichain){
33bool TrigMuonEfficiencyMon :: selectEvents()
const {
42 if(
m_eff_method.value().find(
"TagAndProbe")!=std::string::npos){
46 if(
static_cast<int>(mu->muonType())<=
m_muontype &&
47 mu->author()==xAOD::Muon::Author::MuidCo &&
48 mu->quality()==xAOD::Muon::Quality::Medium ){
53 return StatusCode::SUCCESS;
57StatusCode TrigMuonEfficiencyMon :: fillVariablesPerOfflineMuonPerChain(
const EventContext& ctx,
const xAOD::Muon* mu,
const std::string &chain)
const {
81 bool activestate =
false;
82 m_matchTool->matchL1(ctx, muEta, muPhi, 0.25, chain, activestate);
91 bool activestate =
false;
92 const bool isPh2FastReco = chain.find(
"newFast") != std::string::npos;
94 m_matchTool->matchFastRecoSA(ctx, mu, chain, activestate);
96 m_matchTool->matchL2SA(ctx, mu, chain, activestate);
98 L2SApass = activestate;
107 bool activestate =
false;
109 L2CBpass = activestate;
118 bool activestate =
false;
120 EFSApass = activestate;
129 bool activestate =
false;
131 EFCBpass = activestate;
140 bool activestate =
false;
142 EFIsopass = activestate;
150 bool activestate =
false;
152 EFSAFSpass = activestate;
160 bool activestate =
false;
162 EFCBFSpass = activestate;
170 " doEFSA:" <<
m_doEFSA <<
" EFSApass:" << EFSApass <<
" doEFCB:" <<
m_doEFCB <<
" EFCBpass:" << EFCBpass <<
" doEFIso:" <<
m_doEFIso <<
" EFIsopass:" << EFIsopass <<
171 " doEFSAFS:" <<
m_doEFSAFS <<
" EFSAFSpass:" << EFSAFSpass <<
" doEFCBFS:" <<
m_doEFCBFS <<
" EFCBFSpass:" << EFCBFSpass);
175 fill(
m_group, muPt, L1pass, L2SApass, L2CBpass, EFSApass, EFCBpass, EFIsopass, EFSAFSpass, EFCBFSpass);
179 fill(
m_group, muEta, muPhi, averageMu, L1pass, L2SApass, L2CBpass, EFSApass, EFCBpass, EFIsopass, EFSAFSpass, EFCBFSpass);
182 return StatusCode::SUCCESS;
189 std::vector<float> vec_invmass;
192 std::vector<std::pair<const xAOD::Muon*, const xAOD::Muon*> > dimuons;
195 for(; mu1_it!=mu1_end; ++mu1_it){
200 for(++mu2_it; mu2_it!=mu2_end; ++mu2_it){
205 TLorentzVector lvmu1 = mu1->
p4();
206 TLorentzVector lvmu2 = mu2->
p4();
207 double dimu_mass = (lvmu1+lvmu2).M()/1.e3;
208 vec_invmass.push_back(dimu_mass);
210 bool bit_dR = lvmu1.DeltaR(lvmu2)>0.5;
216 if(extTrack1 && extTrack2){
217 TLorentzVector lvext1 = lvmu1;
218 TLorentzVector lvext2 = lvmu2;
219 double mupt1 = mu1->
pt();
220 double mupt2 = mu2->
pt();
221 lvext1.SetPtEtaPhiM( mupt1, extTrack1->
position().eta(), extTrack1->
position().phi(), mu1->
m());
222 lvext2.SetPtEtaPhiM( mupt2, extTrack2->
position().eta(), extTrack2->
position().phi(), mu2->
m());
228 if(
m_eff_method ==
"TTbarTagAndProbe" && !bit_dR )
continue;
230 if(
m_eff_method ==
"ZTagAndProbe" && !(bit_mass && bit_dR) )
continue;
232 dimuons.emplace_back(mu1,mu2);
240 for (std::pair<const xAOD::Muon*,const xAOD::Muon*> dimu : dimuons){
248 if(std::find(probes.begin(), probes.end(), dimu.second)==probes.end()){
250 if( std::abs( dimu.second->eta() ) > 0. && std::abs( dimu.second->eta() ) < 1.05 ) probes.push_back(dimu.second);
252 else probes.push_back(dimu.second);
256 if(std::find(probes.begin(), probes.end(), dimu.first)==probes.end()){
258 if( std::abs( dimu.first->eta() ) > 0. && std::abs( dimu.first->eta() ) < 1.05 ) probes.push_back(dimu.first);
260 else probes.push_back(dimu.first);
265 return StatusCode::SUCCESS;;
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
DataModel_detail::const_iterator< DataVector > const_iterator
Declare a monitored scalar variable.
std::map< std::string, double > m_thresholds
Gaudi::Property< bool > m_doEFIso
std::map< std::string, std::string > m_l1seeds
Gaudi::Property< std::vector< std::string > > m_monitored_chains_L1
Gaudi::Property< std::vector< double > > m_monitored_chains_threshold
Gaudi::Property< std::string > m_tag_trig
Gaudi::Property< bool > m_doEFCBFS
Gaudi::Property< bool > m_doL1
StatusCode selectMuonsTagAndProbe(const EventContext &ctx, SG::ReadHandle< xAOD::MuonContainer > &muons, std::vector< const xAOD::Muon * > &probes) const
Gaudi::Property< bool > m_doEFSAFS
Gaudi::Property< bool > m_doEFCB
Gaudi::Property< bool > m_doEFSA
Gaudi::Property< double > m_mass_lowlim
Gaudi::Property< bool > m_BarrelOnly
Gaudi::Property< double > m_mass_highlim
Gaudi::Property< std::string > m_eff_method
Gaudi::Property< bool > m_doL2SA
Gaudi::Property< std::string > m_event_trigger
Gaudi::Property< bool > m_use_extrapolator
Gaudi::Property< bool > m_doL2CB
Gaudi::Property< std::string > m_group
Name of monitored group.
TrigMuonMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Gaudi::Property< std::vector< std::string > > m_monitored_chains
List of trigger chains that are monitored in fillVariablesPerChain and fillVariablesPerOfflineMuonPer...
Gaudi::Property< int > m_muontype
Requirement for the offline muon type considered in analyses.
virtual StatusCode initialize() override
initialize
ToolHandle< CP::IMuonSelectionTool > m_muonSelectionTool
ToolHandle< MuonMatchingTool > m_matchTool
const Amg::Vector3D & position() const
Access method for the position.
virtual double m() const override
The invariant mass of the particle..
virtual double pt() const override
The transverse momentum ( ) of the particle.
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be a nullptr) to the TrackParticle used in identification of this muon.
virtual FourMom_t p4() const override
The full 4-momentum of the particle.
virtual float lbAverageInteractionsPerCrossing(const EventContext &ctx) const
Calculate the average mu, i.e.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
static const unsigned int requireDecision
ParametersBase< TrackParametersDim, Charged > TrackParameters
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Muon_v1 Muon
Reference the current persistent version:
void fill(H5::Group &out_file, size_t iterations)