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 m_matchTool->matchL2SA(ctx, mu, chain, activestate);
93 L2SApass = activestate;
102 bool activestate =
false;
104 L2CBpass = activestate;
113 bool activestate =
false;
115 EFSApass = activestate;
124 bool activestate =
false;
126 EFCBpass = activestate;
135 bool activestate =
false;
137 EFIsopass = activestate;
145 bool activestate =
false;
147 EFSAFSpass = activestate;
155 bool activestate =
false;
157 EFCBFSpass = activestate;
165 " doEFSA:" <<
m_doEFSA <<
" EFSApass:" << EFSApass <<
" doEFCB:" <<
m_doEFCB <<
" EFCBpass:" << EFCBpass <<
" doEFIso:" <<
m_doEFIso <<
" EFIsopass:" << EFIsopass <<
166 " doEFSAFS:" <<
m_doEFSAFS <<
" EFSAFSpass:" << EFSAFSpass <<
" doEFCBFS:" <<
m_doEFCBFS <<
" EFCBFSpass:" << EFCBFSpass);
170 fill(
m_group, muPt, L1pass, L2SApass, L2CBpass, EFSApass, EFCBpass, EFIsopass, EFSAFSpass, EFCBFSpass);
174 fill(
m_group, muEta, muPhi, averageMu, L1pass, L2SApass, L2CBpass, EFSApass, EFCBpass, EFIsopass, EFSAFSpass, EFCBFSpass);
177 return StatusCode::SUCCESS;
184 std::vector<float> vec_invmass;
187 std::vector<std::pair<const xAOD::Muon*, const xAOD::Muon*> > dimuons;
190 for(; mu1_it!=mu1_end; ++mu1_it){
195 for(++mu2_it; mu2_it!=mu2_end; ++mu2_it){
200 TLorentzVector lvmu1 = mu1->
p4();
201 TLorentzVector lvmu2 = mu2->
p4();
202 double dimu_mass = (lvmu1+lvmu2).M()/1.e3;
203 vec_invmass.push_back(dimu_mass);
205 bool bit_dR = lvmu1.DeltaR(lvmu2)>0.5;
211 if(extTrack1 && extTrack2){
212 TLorentzVector lvext1 = lvmu1;
213 TLorentzVector lvext2 = lvmu2;
214 double mupt1 = mu1->
pt();
215 double mupt2 = mu2->
pt();
216 lvext1.SetPtEtaPhiM( mupt1, extTrack1->
position().eta(), extTrack1->
position().phi(), mu1->
m());
217 lvext2.SetPtEtaPhiM( mupt2, extTrack2->
position().eta(), extTrack2->
position().phi(), mu2->
m());
223 if(
m_eff_method ==
"TTbarTagAndProbe" && !bit_dR )
continue;
225 if(
m_eff_method ==
"ZTagAndProbe" && !(bit_mass && bit_dR) )
continue;
227 dimuons.emplace_back(mu1,mu2);
235 for (std::pair<const xAOD::Muon*,const xAOD::Muon*> dimu : dimuons){
243 if(std::find(probes.begin(), probes.end(), dimu.second)==probes.end()){
245 if( std::abs( dimu.second->eta() ) > 0. && std::abs( dimu.second->eta() ) < 1.05 ) probes.push_back(dimu.second);
247 else probes.push_back(dimu.second);
251 if(std::find(probes.begin(), probes.end(), dimu.first)==probes.end()){
253 if( std::abs( dimu.first->eta() ) > 0. && std::abs( dimu.first->eta() ) < 1.05 ) probes.push_back(dimu.first);
255 else probes.push_back(dimu.first);
260 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.
const TrackParticle * primaryTrackParticle() const
Returns a pointer (which should not usually be NULL, but might be if the muon has been stripped of in...
virtual FourMom_t p4() const
The full 4-momentum of the particle.
virtual double m() const
The invariant mass of the particle..
virtual double pt() const
The transverse 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)