ATLAS Offline Software
TrigBphysMonitorAlgorithm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 #include "GaudiKernel/SystemOfUnits.h"
8 
10 #include "xAODBPhys/BPhysHelper.h"
12 
13 using namespace Gaudi::Units;
14 
15 TrigBphysMonitorAlgorithm::TrigBphysMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
16  : AthMonitorAlgorithm(name,pSvcLocator)
17 {}
18 
19 
21 
22 
24 
25  for(const auto& MonitoredContainerName : m_ContainerNames) {
26  SG::ReadHandleKey<xAOD::TrigBphysContainer> BphysContainerKey(MonitoredContainerName);
27  ATH_CHECK( BphysContainerKey.initialize() );
28  m_TrigBphysContainerKeys.push_back(BphysContainerKey);
29  }
30 
31  ATH_CHECK( m_offlineMuonCollectionKey.initialize() );
33  ATH_CHECK( m_offlinePvCollectionKey.initialize() );
34 
36 
37  return StatusCode::SUCCESS;
38 
39 }
40 
41 
42 StatusCode TrigBphysMonitorAlgorithm::fillHistograms( const EventContext& ctx ) const {
43 
44  // fill the container hists
45  ATH_MSG_DEBUG ("fill... Containers");
46  if (fillContainers(ctx).isFailure()) {ATH_MSG_ERROR("Problems filling Container histograms");}
47 
48  // fill the chain hists
49  ATH_MSG_DEBUG ("fill... Chains");
50  if (fillChains(ctx).isFailure()) {ATH_MSG_ERROR("Problems filling Chain histograms");}
51 
52  // build offline dimuons and fill offline histograms
53  std::vector<std::unique_ptr<xAOD::Vertex>> offlineDimuons;
54  if (buildDimuons(ctx, offlineDimuons).isFailure()) {
55  ATH_MSG_ERROR("Problems building offline dimuons, won't fill corresponding histograms");
56  }
57  else {
58  if (fillOfflineDimuons(ctx, offlineDimuons).isFailure()) {ATH_MSG_ERROR("Problems filling Offline dimuon histograms");}
59  }
60 
61  return StatusCode::SUCCESS;
62 }
63 
64 StatusCode TrigBphysMonitorAlgorithm::fillContainers(const EventContext& ctx) const {
65 
66  for(const SG::ReadHandleKey<xAOD::TrigBphysContainer>& monitoredContainerKey : m_TrigBphysContainerKeys) {
67  ATH_MSG_DEBUG("Process container " << monitoredContainerKey.key().c_str());
68  if(fillContainerHists(ctx, monitoredContainerKey).isFailure()) {
69  ATH_MSG_ERROR(Form("Problems filling %s container histograms", monitoredContainerKey.key().c_str()));
70  }
71  }
72 
73  return StatusCode::SUCCESS;
74 }
75 
77  SG::ReadHandle<xAOD::TrigBphysContainer> trigBphysContainer(trigBphysContainerKey, ctx);
78  if( !trigBphysContainer.isValid() ) {
79  ATH_MSG_WARNING("No valid TrigBphysContainer with tag: " << trigBphysContainerKey);
80  }
81  else {
82  // Fill container-wise histograms
83  std::string monGroupName = std::string("Container_")+trigBphysContainerKey.key();
84  auto monGroup = getGroup(monGroupName);
85 
86  auto ncandidates = Monitored::Scalar<int>("ncandidates",-999);
87  ncandidates = trigBphysContainer->size();
88 
89  auto bphys_mass = Monitored::Collection("bphys_mass", (*trigBphysContainer), [](const xAOD::TrigBphys* bphys){ return bphys->fitmass() / GeV;});
90 
91  fill(monGroup, ncandidates, bphys_mass);
92 
93  }
94  return StatusCode::SUCCESS;
95 }
96 
97 
98 StatusCode TrigBphysMonitorAlgorithm::fillChains(const EventContext& ctx) const {
99 
100  for(const auto& monitoredChain : m_ChainNames_MuMu) {
101  ATH_MSG_DEBUG("Process chain " << monitoredChain);
102  if( !isChainPassed(monitoredChain) ) {
103  ATH_MSG_DEBUG("Chain " << monitoredChain << " is not passed");
104  continue;
105  }
106  if(fillDimuonChainHists(ctx, monitoredChain).isFailure()) {
107  ATH_MSG_ERROR(Form("Problems filling %s chain histograms", monitoredChain.c_str()));
108  }
109  }
110 
111  for(const auto& monitoredChain : m_ChainNames_MuMuX) {
112  ATH_MSG_DEBUG("Process chain " << monitoredChain);
113  if( !isChainPassed(monitoredChain) ) {
114  ATH_MSG_DEBUG("Chain " << monitoredChain << " is not passed");
115  continue;
116  }
117  if(fillBmumuxChainHists(ctx, monitoredChain).isFailure()) {
118  ATH_MSG_ERROR(Form("Problems filling %s chain histograms", monitoredChain.c_str()));
119  }
120  }
121 
122  for(const auto& monitoredChain : m_ChainNames_ElEl) {
123  ATH_MSG_DEBUG("Process chain " << monitoredChain);
124  if( !isChainPassed(monitoredChain) ) {
125  ATH_MSG_DEBUG("Chain " << monitoredChain << " is not passed");
126  continue;
127  }
128  if(fillDielectronChainHists(ctx, monitoredChain).isFailure()) {
129  ATH_MSG_ERROR(Form("Problems filling %s chain histograms", monitoredChain.c_str()));
130  }
131  }
132 
133  return StatusCode::SUCCESS;
134 }
135 
136 StatusCode TrigBphysMonitorAlgorithm::fillDimuonChainHists(const EventContext& ctx, const std::string& chainName) const {
137  ATH_MSG_DEBUG("Filling " << chainName << " chain histograms");
138 
139  std::string monGroupName = std::string("Chain_")+chainName;
140  auto monGroup = getGroup(monGroupName);
141 
142  if (fillChainGenericHists(ctx, monGroup, chainName).isFailure()) {
143  ATH_MSG_ERROR(Form("Problems filling generic histograms for %s chain",chainName.c_str()));
144  }
145 
146  std::vector< TrigCompositeUtils::LinkInfo<xAOD::TrigBphysContainer> > chainFeatureContainer = getTrigDecisionTool()->features<xAOD::TrigBphysContainer>(chainName, TrigDefs::Physics);
147  for (const auto& featLinkInfo: chainFeatureContainer){
148  ATH_CHECK(featLinkInfo.isValid());
149  const auto featLink = featLinkInfo.link;
150  if (fillBphysObjectHists(monGroup, featLink, "dimu").isFailure()) {
151  ATH_MSG_ERROR(Form("Problems filling bphys object histograms for %s chain",chainName.c_str()));
152  }
153  if (fillTrigLeptonHists(monGroup, featLink, "mu").isFailure()) {
154  ATH_MSG_ERROR(Form("Problems filling muon histograms for %s chain",chainName.c_str()));
155  }
156  }
157  return StatusCode::SUCCESS;
158 }
159 
160 
161 StatusCode TrigBphysMonitorAlgorithm::fillBmumuxChainHists(const EventContext& ctx, const std::string& chainName) const {
162  ATH_MSG_DEBUG("Filling " << chainName << " chain histograms");
163 
164  std::string monGroupName = std::string("Chain_")+chainName;
165  auto monGroup = getGroup(monGroupName);
166 
167  if (fillChainGenericHists(ctx, monGroup, chainName).isFailure()) {
168  ATH_MSG_ERROR(Form("Problems filling generic histograms for %s chain",chainName.c_str()));
169  }
170 
171  std::vector< TrigCompositeUtils::LinkInfo<xAOD::TrigBphysContainer> > chainFeatureContainer = getTrigDecisionTool()->features<xAOD::TrigBphysContainer>(chainName, TrigDefs::Physics);
172  for (const auto& featLinkInfo: chainFeatureContainer){
173  ATH_CHECK(featLinkInfo.isValid());
174  const auto featLink = featLinkInfo.link;
175  if (fillBphysObjectHists(monGroup, featLink, "B").isFailure()) {
176  ATH_MSG_ERROR(Form("Problems filling bphys object histograms for %s chain",chainName.c_str()));
177  }
178  if (fillTrigBmumuxTrkHists(monGroup, featLink).isFailure()) {
179  ATH_MSG_ERROR(Form("Problems filling muon histograms for %s chain",chainName.c_str()));
180  }
181 
182  auto dimuonLink = (*featLink)->lowerChainLink();
183  ATH_CHECK(dimuonLink.isValid());
184  if (fillBphysObjectHists(monGroup, dimuonLink, "dimu").isFailure()) {
185  ATH_MSG_ERROR(Form("Problems filling dimuon object histograms for %s chain",chainName.c_str()));
186  }
187  if (fillTrigLeptonHists(monGroup, dimuonLink, "mu").isFailure()) {
188  ATH_MSG_ERROR(Form("Problems filling muon histograms for %s chain",chainName.c_str()));
189  }
190  }
191 
192  return StatusCode::SUCCESS;
193 }
194 
195 StatusCode TrigBphysMonitorAlgorithm::fillDielectronChainHists(const EventContext& ctx, const std::string& chainName) const {
196  ATH_MSG_DEBUG("Filling " << chainName << " chain histograms");
197 
198  std::string monGroupName = std::string("Chain_")+chainName;
199  auto monGroup = getGroup(monGroupName);
200 
201  if (fillChainGenericHists(ctx, monGroup, chainName).isFailure()) {
202  ATH_MSG_ERROR(Form("Problems filling generic histograms for %s chain",chainName.c_str()));
203  }
204 
205  std::vector< TrigCompositeUtils::LinkInfo<xAOD::TrigBphysContainer> > chainFeatureContainer = getTrigDecisionTool()->features<xAOD::TrigBphysContainer>(chainName, TrigDefs::Physics);
206  for (const auto& featLinkInfo: chainFeatureContainer){
207  ATH_CHECK(featLinkInfo.isValid());
208  const auto featLink = featLinkInfo.link;
209  if (fillBphysObjectHists(monGroup, featLink, "diel").isFailure()) {
210  ATH_MSG_ERROR(Form("Problems filling bphys object histograms for %s chain",chainName.c_str()));
211  }
212  if (fillTrigLeptonHists(monGroup, featLink, "el").isFailure()) {
213  ATH_MSG_ERROR(Form("Problems filling muon histograms for %s chain",chainName.c_str()));
214  }
215  }
216  return StatusCode::SUCCESS;
217 }
218 
219 
220 // Function to fill general per-chain hists, independent on the type of chains
221 StatusCode TrigBphysMonitorAlgorithm::fillChainGenericHists(const EventContext& /*ctx*/, const ToolHandle<GenericMonitoringTool>& currentMonGroup, const std::string& chainName) const {
222 
223  std::vector< TrigCompositeUtils::LinkInfo<xAOD::TrigBphysContainer> > chainFeatureContainer = getTrigDecisionTool()->features<xAOD::TrigBphysContainer>(chainName, TrigDefs::Physics);
224  auto ncandidates = Monitored::Scalar<int>("ncandidates",-999);
225  ncandidates = chainFeatureContainer.size();
226 
227  fill(currentMonGroup, ncandidates);
228 
229  return StatusCode::SUCCESS;
230 }
231 
232 
233 // Function to fill per-object hists (e.g. for dimuon, B from Bmumux, or X from Bmumux)
234 StatusCode TrigBphysMonitorAlgorithm::fillBphysObjectHists(const ToolHandle<GenericMonitoringTool>& currentMonGroup, const ElementLink<xAOD::TrigBphysContainer>& bphysLink, const std::string& objStr) const {
235 
236  auto dimu_mass = Monitored::Scalar<float>(objStr+"_mass",-999.);
237  auto dimu_fitmass = Monitored::Scalar<float>(objStr+"_fitmass",-999.);
238  auto dimu_pt = Monitored::Scalar<float>(objStr+"_pt",-999.);
239  auto dimu_y = Monitored::Scalar<float>(objStr+"_y",-999.);
240  auto dimu_chi2 = Monitored::Scalar<float>(objStr+"_chi2",-999.);
241 
242  dimu_mass = (*bphysLink)->mass() / GeV;
243  dimu_fitmass = (*bphysLink)->fitmass() / GeV;
244  dimu_pt = (*bphysLink)->pt() / GeV;
245  dimu_chi2 = (*bphysLink)->fitchi2();
246  dimu_y = (*bphysLink)->eta();
247 
248  fill(currentMonGroup, dimu_mass, dimu_fitmass, dimu_pt, dimu_y, dimu_chi2);
249 
250  return StatusCode::SUCCESS;
251 }
252 
253 
254 // Function to fill per-muon hists, assuming that the passed object is a dimuon
255 StatusCode TrigBphysMonitorAlgorithm::fillTrigLeptonHists(const ToolHandle<GenericMonitoringTool>& currentMonGroup, const ElementLink<xAOD::TrigBphysContainer>& bphysLink, const std::string& name_prefix) const {
256 
257  const std::vector<ElementLink<xAOD::TrackParticleContainer> > trackVector = (*bphysLink)->trackParticleLinks();
258  ATH_MSG_DEBUG("fillTrigLeptonHists: number of lepton tracks: " << trackVector.size());
259  if( fillTracksHists(currentMonGroup, trackVector, name_prefix, true).isFailure() ) {
260  ATH_MSG_ERROR(Form("Problems filling muon histograms for a chain"));
261  return StatusCode::FAILURE;
262  }
263  if( fillDiTracksHists(currentMonGroup, trackVector, std::string("di")+name_prefix).isFailure() ) {
264  ATH_MSG_ERROR(Form("Problems filling two-muon histograms for a chain"));
265  return StatusCode::FAILURE;
266  }
267 
268  return StatusCode::SUCCESS;
269 }
270 
271 // Function to fill per-track hists for Bmumux candidates
272 StatusCode TrigBphysMonitorAlgorithm::fillTrigBmumuxTrkHists(const ToolHandle<GenericMonitoringTool>& currentMonGroup, const ElementLink<xAOD::TrigBphysContainer>& bphysLink, UInt_t tracksStartFrom) const {
273 
274  const std::vector<ElementLink<xAOD::TrackParticleContainer> > trackVector = (*bphysLink)->trackParticleLinks();
275  if (trackVector.size() < tracksStartFrom) {
276  ATH_MSG_WARNING("Unexpected number of tracks: "<< trackVector.size() << " found, while expected at least " << tracksStartFrom);
277  return StatusCode::SUCCESS;
278  }
279 
280  if (fillTracksHists(currentMonGroup, trackVector, "trk", false, tracksStartFrom).isFailure()) {
281  ATH_MSG_ERROR(Form("Problems filling track histograms for a BMuMuX chain"));
282  return StatusCode::FAILURE;
283  }
284 
285  return StatusCode::SUCCESS;
286 }
287 
288 StatusCode TrigBphysMonitorAlgorithm::fillTracksHists(const ToolHandle<GenericMonitoringTool>& currentMonGroup,
289  const std::vector<ElementLink<xAOD::TrackParticleContainer> >& tpLinkVector,
290  const std::string& prefix,
291  bool separateHists,
292  UInt_t offsetIndex) const {
293  for(UInt_t i = offsetIndex; i < tpLinkVector.size(); ++i) {
294  ATH_CHECK(tpLinkVector.at(i).isValid());
295  std::string curPrefix = prefix;
296  if(separateHists)
297  curPrefix += std::to_string(i+1);
298  if (fillTrkHists(currentMonGroup, *tpLinkVector.at(i), curPrefix).isFailure()) {
299  ATH_MSG_ERROR(Form("Problems filling track histograms"));
300  return StatusCode::FAILURE;
301  }
302  }
303  return StatusCode::SUCCESS;
304 }
305 
306 StatusCode TrigBphysMonitorAlgorithm::fillDiTracksHists(const ToolHandle<GenericMonitoringTool>& currentMonGroup,
307  const std::vector<ElementLink<xAOD::TrackParticleContainer> >& tpLinkVector,
308  const std::string& name_prefix) const {
309  // Use first two tracks
310  if (tpLinkVector.size() <2) {
311  ATH_MSG_ERROR("Unexpected number of tracks in a dimuon: " << tpLinkVector.size());
312  return StatusCode::FAILURE;
313  }
314  ATH_CHECK(tpLinkVector.at(0).isValid());
315  ATH_CHECK(tpLinkVector.at(1).isValid());
316  const xAOD::TrackParticle* trk1 = *tpLinkVector.at(0);
317  const xAOD::TrackParticle* trk2 = *tpLinkVector.at(1);
318 
319  auto ditrk_dR = Monitored::Scalar<float>(name_prefix+"_dR",-999.);
320  auto ditrk_deta = Monitored::Scalar<float>(name_prefix+"_deta",-999.);
321  auto ditrk_dphi = Monitored::Scalar<float>(name_prefix+"_dphi",-999.);
322 
323  ditrk_dR = xAOD::P4Helpers::deltaR(*trk1, *trk2, false); // false for pseudo, not true rapidity
324  ditrk_deta = std::abs(trk1->eta()-trk2->eta());
325  ditrk_dphi = std::abs(xAOD::P4Helpers::deltaPhi(*trk1, *trk2));
326 
327  fill(currentMonGroup, ditrk_dR, ditrk_deta, ditrk_dphi);
328 
329  return StatusCode::SUCCESS;
330 }
331 
332 // Generic function to fill track hists
333 StatusCode TrigBphysMonitorAlgorithm::fillTrkHists(const ToolHandle<GenericMonitoringTool>& currentMonGroup, const xAOD::TrackParticle* trk, const std::string& name_prefix) const {
334  if (!trk) {
335  ATH_MSG_ERROR("Null pointer for a track");
336  return StatusCode::FAILURE;
337  }
338  auto trk_pt = Monitored::Scalar<float>(name_prefix+"_pt",-999.);
339  auto trk_eta = Monitored::Scalar<float>(name_prefix+"_eta",-999.);
340  auto trk_d0 = Monitored::Scalar<float>(name_prefix+"_d0",-999.);
341 
342  trk_pt = trk->pt() / GeV;
343  trk_eta = trk->eta();
344  trk_d0 = trk->d0();
345 
346  fill(currentMonGroup, trk_pt, trk_eta, trk_d0);
347 
348  return StatusCode::SUCCESS;
349 }
350 
351 StatusCode TrigBphysMonitorAlgorithm::fillOfflineDimuons(const EventContext& ctx, const std::vector<std::unique_ptr<xAOD::Vertex>>& dimuonContainer) const {
352 
353  std::vector<std::string> dimuonMonGroupNames = {"Any"};
354  dimuonMonGroupNames.insert( dimuonMonGroupNames.end(), m_ChainNames_MuMu.begin(), m_ChainNames_MuMu.end() );
355  dimuonMonGroupNames.insert( dimuonMonGroupNames.end(), m_ChainNames_MuMuX.begin(), m_ChainNames_MuMuX.end() );
356 
357  for(const auto& dimuonMonGroupName : dimuonMonGroupNames) {
358  ATH_MSG_DEBUG("Process dimuons for " << dimuonMonGroupName);
359  if(dimuonMonGroupName != "Any") {
360  auto& monitoredChain = dimuonMonGroupName;
361  if( !(dimuonMonGroupName == "Any") && !isChainPassed(monitoredChain) ) {
362  ATH_MSG_DEBUG("Chain " << monitoredChain << " is not passed");
363  continue;
364  }
365  }
366  if(fillOfflineDimuonHists(ctx, dimuonMonGroupName, dimuonContainer).isFailure()) {
367  ATH_MSG_ERROR(Form("Problems filling offline dimuon histograms for %s", dimuonMonGroupName.c_str()));
368  }
369  }
370 
371  return StatusCode::SUCCESS;
372 }
373 
374 StatusCode TrigBphysMonitorAlgorithm::fillOfflineDimuonHists(const EventContext& /*ctx*/, const std::string& dimuonMonGroupName, const std::vector<std::unique_ptr<xAOD::Vertex>>& dimuonContainer) const {
375  ATH_MSG_DEBUG("Filling " << dimuonMonGroupName << " offline dimuons histograms");
376 
377  // Do matching
378  std::vector<const xAOD::Vertex*> matchedDimuons;
379  for(auto& offlineDimuon : dimuonContainer) {
380  if( dimuonMonGroupName == "Any" || matchDimuon(offlineDimuon.get(), dimuonMonGroupName) )
381  matchedDimuons.push_back(offlineDimuon.get());
382  }
383 
384  std::string monGroupName = std::string("OfflineDimu_")+dimuonMonGroupName;
385  auto monGroup = getGroup(monGroupName);
386 
387  auto ncandidates = Monitored::Scalar<int>("ncandidates",-999);
388  ncandidates = matchedDimuons.size();
389 
390  fill(monGroup, ncandidates);
391 
392  for(auto matchedDimuon : matchedDimuons) {
393  if (fillVertexHists(monGroup, matchedDimuon, "dimu").isFailure()) {
394  ATH_MSG_ERROR(Form("Problems filling histogram for an offline dimuon vertex in %s", dimuonMonGroupName.c_str()));
395  }
396  if (fillTracksHists(monGroup, matchedDimuon->trackParticleLinks(), "mu", true).isFailure()) {
397  ATH_MSG_ERROR(Form("Problems filling histogram for offline dimuon muons in %s", dimuonMonGroupName.c_str()));
398  }
399  if (fillDiTracksHists(monGroup, matchedDimuon->trackParticleLinks(), "dimu").isFailure()) {
400  ATH_MSG_ERROR(Form("Problems filling histogram for offline dimuon muon pairs in %s", dimuonMonGroupName.c_str()));
401  }
402  }
403 
404  return StatusCode::SUCCESS;
405 
406 }
407 
408 StatusCode TrigBphysMonitorAlgorithm::fillVertexHists(const ToolHandle<GenericMonitoringTool>& currentMonGroup, const xAOD::Vertex* vertex, const std::string& objStr) const {
409 
410  xAOD::BPhysHelper dimuonVertexHelper(vertex);
411  if(dimuonVertexHelper.nRefTrks() != 2) {
412  ATH_MSG_WARNING("Unexpected number of refitted tracks at vertex is " << dimuonVertexHelper.nRefTrks());
413  return StatusCode::SUCCESS;
414  }
415 
416  using namespace TrigVtx;
417  TLorentzVector dimuonMom = dimuonVertexHelper.totalP(std::array<double,2>{TrigParticleMasses().mass[TrigParticleName::muon], TrigParticleMasses().mass[TrigParticleName::muon]});
418 
419  auto dimu_mass = Monitored::Scalar<float>(objStr+"_mass",-999.);
420  auto dimu_pt = Monitored::Scalar<float>(objStr+"_pt",-999.);
421  auto dimu_y = Monitored::Scalar<float>(objStr+"_y",-999.);
422  auto dimu_chi2 = Monitored::Scalar<float>(objStr+"_chi2",-999.);
423  auto dimu_Lxy = Monitored::Scalar<float>(objStr+"_Lxy",-999.);
424  auto dimu_LxySig = Monitored::Scalar<float>(objStr+"_LxySig",-999.);
425 
426  dimu_mass = dimuonMom.M() / GeV;
427  dimu_pt = dimuonMom.Pt() / GeV;
428  dimu_chi2 = vertex->chiSquared();
429  dimu_y = dimuonMom.Rapidity();
430  dimu_Lxy = dimuonVertexHelper.lxy(xAOD::BPhysHelper::PV_MIN_A0);
431  dimu_LxySig = dimuonVertexHelper.lxy(xAOD::BPhysHelper::PV_MIN_A0)/dimuonVertexHelper.lxyErr(xAOD::BPhysHelper::PV_MIN_A0);
432 
433  fill(currentMonGroup, dimu_mass, dimu_pt, dimu_y, dimu_chi2, dimu_Lxy, dimu_LxySig);
434 
435  return StatusCode::SUCCESS;
436 }
437 
438 bool TrigBphysMonitorAlgorithm::isChainPassed(const std::string& chain) const {
439  // Check if a chain is passed after prescale, accounting for Express Stream prescales if necessary
441  return getTrigDecisionTool()->isPassed(chain);
442  }
443  else {
444  const unsigned int passBits = getTrigDecisionTool()->isPassedBits(chain);
445  return passBits & TrigDefs::Express_passed;
446  }
447 }
448 
449 StatusCode TrigBphysMonitorAlgorithm::buildDimuons(const EventContext& ctx, std::vector<std::unique_ptr<xAOD::Vertex>>& vxContainer) const {
450  ATH_MSG_DEBUG( "TrigBphysMonitorAlgorithm::buildDimuons" );
451 
452  // Get the muons
454  ATH_CHECK(muonHandle.isValid());
455  const xAOD::MuonContainer* muonContainer = muonHandle.cptr();
456  ATH_MSG_DEBUG("Muon container size " << muonContainer->size());
457 
458  // Muon preselection
459  std::vector<const xAOD::Muon*> selectedMuons;
460  for (const auto mu : *muonContainer) {
461  if ( mu == nullptr ) continue;
462  if ( mu->muonType() != xAOD::Muon::Combined ) continue; // require combined muons
463  if (!mu->inDetTrackParticleLink()) continue; // No muons without ID tracks
464  if (!mu->inDetTrackParticleLink().isValid()) continue; // No muons without ID tracks
465  selectedMuons.push_back(mu);
466  }
467  if(selectedMuons.size() < 2) {
468  ATH_MSG_DEBUG("Only " << selectedMuons.size() << "muons pass preselection");
469  return StatusCode::SUCCESS;
470  }
471  std::sort(selectedMuons.begin(), selectedMuons.end(), [](const auto mu1, const auto mu2){ return mu1->pt() > mu2->pt(); });
472 
473  // Build dimuons
474  for(auto outerItr=selectedMuons.begin(); outerItr<selectedMuons.end(); ++outerItr){
475  for(auto innerItr=(outerItr+1); innerItr!=selectedMuons.end(); ++innerItr){
476  const auto muon1 = *outerItr;
477  const auto muon2 = *innerItr;
478  const auto trackParticle1 = muon1->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
479  const auto trackParticle2 = muon2->trackParticle( xAOD::Muon::InnerDetectorTrackParticle );
480  // Charge selection
481  if(trackParticle1->qOverP() * trackParticle2->qOverP() > 0.)
482  continue;
483  // Mass selection
484  double dimu_momentum_prefit = dimuonMass(trackParticle1, trackParticle2);
485  if( !(dimu_momentum_prefit > m_dimuMassLower_prefit && dimu_momentum_prefit < m_dimuMassUpper_prefit) )
486  continue;
487  // Fit
488  std::unique_ptr<xAOD::Vertex> dimuon = dimuonFit(trackParticle1, trackParticle2);
489  if(!dimuon) continue;
490  if(dimuon->chiSquared() > m_dimuChi2Cut) continue;
491  vxContainer.push_back(std::move(dimuon));
492  }
493  }
494  ATH_MSG_DEBUG("Found " << vxContainer.size() << " good dimuons");
495 
496  // Augment the dimuon vertices
497  if( !vxContainer.empty() ) {
499  ATH_CHECK(pvHandle.isValid());
500  const xAOD::VertexContainer* pvContainer = pvHandle.cptr();
501  std::vector<const xAOD::Vertex*> goodPVs = GetGoodPVs(pvContainer);
502  ATH_MSG_DEBUG("Found " << goodPVs.size() << " good PVs");
503  for(auto& dimuon : vxContainer) {
504  xAOD::BPhysHelper jpsiHelper(dimuon.get());
505  jpsiHelper.setRefTrks();
506  const xAOD::Vertex* lowestA0Pv = getPvForDimuon_lowestA0(dimuon.get(), goodPVs);
507  if(lowestA0Pv) {
508  jpsiHelper.setLxy ( m_v0Tools->lxy ( dimuon.get(),lowestA0Pv ), xAOD::BPhysHelper::PV_MIN_A0 );
509  jpsiHelper.setLxyErr( m_v0Tools->lxyError( dimuon.get(),lowestA0Pv ), xAOD::BPhysHelper::PV_MIN_A0 );
510  ATH_MSG_VERBOSE("Lxy = " << m_v0Tools->lxy ( dimuon.get(),lowestA0Pv ));
511  ATH_MSG_VERBOSE("LxyErr = " << m_v0Tools->lxyError( dimuon.get(),lowestA0Pv ));
512  }
513  }
514  }
515 
516  return StatusCode::SUCCESS;
517 }
518 
519 std::unique_ptr<xAOD::Vertex> TrigBphysMonitorAlgorithm::dimuonFit(const xAOD::TrackParticle* mu1, const xAOD::TrackParticle* mu2) const {
520 
521  const Trk::Perigee& mu1Perigee = mu1->perigeeParameters();
522  const Trk::Perigee& mu2Perigee = mu2->perigeeParameters();
523  int sflag = 0; int errorcode = 0;
524  Amg::Vector3D startingPoint = m_vertexPointEstimator->getCirclesIntersectionPoint(&mu1Perigee,&mu2Perigee,sflag,errorcode);
525  if (errorcode != 0) {startingPoint(0) = 0.0; startingPoint(1) = 0.0; startingPoint(2) = 0.0;}
526  const std::vector<const xAOD::TrackParticle*> trackPair = {mu1, mu2};
527  std::unique_ptr<xAOD::Vertex> myVxCandidate(m_vertexFitter->fit(trackPair, startingPoint));
528 
529  return myVxCandidate;
530 }
531 
532 bool TrigBphysMonitorAlgorithm::matchDimuon(const xAOD::Vertex* dimuonVertex, const std::string& chainName) const {
533  std::vector< TrigCompositeUtils::LinkInfo<xAOD::TrigBphysContainer> > chainFeatureContainer = getTrigDecisionTool()->features<xAOD::TrigBphysContainer>(chainName, TrigDefs::Physics);
534  for (const auto& featLinkInfo: chainFeatureContainer){
535  if(!featLinkInfo.isValid())
536  return false;
537  const auto featLink = featLinkInfo.link;
538  if( matchDimuon(dimuonVertex, featLink) )
539  return true;
540  }
541  return false;
542 }
543 
545  auto offlineTrk1 = dimuonVertex->trackParticle(0);
546  auto offlineTrk2 = dimuonVertex->trackParticle(1);
547  if(!offlineTrk1 || !offlineTrk2) {
548  ATH_MSG_DEBUG("TrackParticle from dimuon is null, won't match");
549  return false;
550  }
551 
552  const std::vector<ElementLink<xAOD::TrackParticleContainer> > trackVector = (*bphysLink)->trackParticleLinks();
553  if (trackVector.size() < 2) {
554  ATH_MSG_ERROR("Unexpected number of tracks in a dimuon: " << trackVector.size() << ", won't match");
555  return false;
556  }
557 
558  const xAOD::TrackParticle *hltTrk1(nullptr),*hltTrk2(nullptr);
559  // Assume the first two tracks are always muons'
560  if( !trackVector.at(0).isValid() || !trackVector.at(1).isValid() )
561  return false;
562  hltTrk1 = *trackVector.at(0);
563  hltTrk2 = *trackVector.at(1);
564  if (!hltTrk1 || !hltTrk2) {
565  ATH_MSG_ERROR("Null pointer for track in a dimuon!");
566  return false;
567  }
568  if( ( matchTrackParticles(offlineTrk1, hltTrk1) && matchTrackParticles(offlineTrk2, hltTrk2) ) ||
569  ( matchTrackParticles(offlineTrk1, hltTrk2) && matchTrackParticles(offlineTrk2, hltTrk1) ) )
570  return true;
571  else
572  return false;
573 }
574 
576  double deltaR = xAOD::P4Helpers::deltaR(*trk1, *trk2);
578  return true;
579  else
580  return false;
581 }
582 
584  using namespace TrigVtx;
589  xAOD::TrackParticle::GenVecFourMom_t dimu_mom = mom1 + mom2;
590  return dimu_mom.M();
591 }
592 
593 std::vector<const xAOD::Vertex*> TrigBphysMonitorAlgorithm::GetGoodPVs(const xAOD::VertexContainer* pvContainer) const {
594  std::vector<const xAOD::Vertex*> goodPrimaryVertices;
595  goodPrimaryVertices.reserve(pvContainer->size());
596  for (auto pv : *pvContainer) {
597  xAOD::VxType::VertexType pvType = pv->vertexType();
598  if ( pvType == xAOD::VxType::PriVtx || pvType == xAOD::VxType::PileUp ) {
599  goodPrimaryVertices.push_back(pv);
600  }
601  }
602  return goodPrimaryVertices;
603 }
604 
605 const xAOD::Vertex* TrigBphysMonitorAlgorithm::getPvForDimuon_lowestA0(const xAOD::Vertex* vtx, const std::vector<const xAOD::Vertex*>& PVs) const {
606  std::vector<const xAOD::Vertex*>::const_iterator pv = std::min_element(PVs.begin(), PVs.end(),
607  [&, vtx](const xAOD::Vertex* pv1, const xAOD::Vertex* pv2)
608  { return (std::abs(m_v0Tools->a0(vtx, pv1)) < std::abs(m_v0Tools->a0(vtx, pv2)));}
609  );
610  if(pv == PVs.end()) {
611  return nullptr;
612  }
613  ATH_MSG_VERBOSE("Min-a0 PV has index " << std::distance(PVs.begin(), pv) << ", a0 = " << m_v0Tools->a0(vtx, *pv));
614  return *pv;
615 }
muonContainer
xAOD::MuonContainer * muonContainer
Definition: TrigGlobEffCorrValidation.cxx:188
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
xAOD::TrackParticle_v1::GenVecFourMom_t
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzM4D< double > > GenVecFourMom_t
Base 4 Momentum type for TrackParticle.
Definition: TrackParticle_v1.h:78
python.TIDAMonTool.monGroup
def monGroup(analysis_chain)
Definition: TIDAMonTool.py:297
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
xAOD::BPhysHelper::totalP
TVector3 totalP()
: Returns total 3-momentum calculated from the refitted tracks
Definition: BPhysHelper.cxx:374
GeV
#define GeV
Definition: PhysicsAnalysis/TauID/TauAnalysisTools/Root/HelperFunctions.cxx:17
TrigBphysMonitorAlgorithm::m_dimuChi2Cut
Gaudi::Property< double > m_dimuChi2Cut
Definition: TrigBphysMonitorAlgorithm.h:45
TrigBphysMonitorAlgorithm::dimuonMass
double dimuonMass(const xAOD::TrackParticle *mu1, const xAOD::TrackParticle *mu2) const
Definition: TrigBphysMonitorAlgorithm.cxx:583
xAOD::BPhysHelper
Definition: BPhysHelper.h:71
runLayerRecalibration.chain
chain
Definition: runLayerRecalibration.py:175
xAOD::BPhysHelper::nRefTrks
int nRefTrks()
Returns number of stored refitted track momenta.
Definition: BPhysHelper.cxx:115
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
Base_Fragment.mass
mass
Definition: Sherpa_i/share/common/Base_Fragment.py:59
TrigBphysMonitorAlgorithm::matchDimuon
bool matchDimuon(const xAOD::Vertex *dimuonVertex, const std::string &chainName) const
Definition: TrigBphysMonitorAlgorithm.cxx:532
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
xAODP4Helpers.h
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
xAOD::TrackParticle_v1::eta
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Definition: TrackParticle_v1.cxx:77
TrigBphysMonitorAlgorithm::fillDiTracksHists
StatusCode fillDiTracksHists(const ToolHandle< GenericMonitoringTool > &currentMonGroup, const std::vector< ElementLink< xAOD::TrackParticleContainer > > &tpLinkVector, const std::string &name_prefix) const
Definition: TrigBphysMonitorAlgorithm.cxx:306
TrigVtx
Definition: TrigParticleTable.h:18
AthMonitorAlgorithm::getTrigDecisionTool
const ToolHandle< Trig::TrigDecisionTool > & getTrigDecisionTool() const
Get the trigger decision tool member.
Definition: AthMonitorAlgorithm.cxx:189
xAOD::passBits
passBits
Definition: TrigPassBits_v1.cxx:115
xAOD::P4Helpers::deltaPhi
double deltaPhi(double phiA, double phiB)
delta Phi in range [-pi,pi[
Definition: xAODP4Helpers.h:69
TrigBphysMonitorAlgorithm::fillTrkHists
StatusCode fillTrkHists(const ToolHandle< GenericMonitoringTool > &currentMonGroup, const xAOD::TrackParticle *trk, const std::string &name_prefix) const
Definition: TrigBphysMonitorAlgorithm.cxx:333
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SG::VarHandleKey::key
const std::string & key() const
Return the StoreGate ID for the referenced object.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:141
xAOD::BPhysHelper::lxyErr
float lxyErr(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
its error
Definition: BPhysHelper.cxx:877
SG::ReadHandleKey
Property holding a SG store/key/clid from which a ReadHandle is made.
Definition: StoreGate/StoreGate/ReadHandleKey.h:39
TrigBphysMonitorAlgorithm::getPvForDimuon_lowestA0
const xAOD::Vertex * getPvForDimuon_lowestA0(const xAOD::Vertex *vtx, const std::vector< const xAOD::Vertex * > &PVs) const
Definition: TrigBphysMonitorAlgorithm.cxx:605
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
Monitored::Collection
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
Definition: MonitoredCollection.h:38
TrigBphysMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: TrigBphysMonitorAlgorithm.cxx:23
AthMonitorAlgorithm
Base class for Athena Monitoring Algorithms.
Definition: AthMonitorAlgorithm.h:36
xAOD::VxType::VertexType
VertexType
Vertex types.
Definition: TrackingPrimitives.h:569
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
TrigBphysMonitorAlgorithm::m_dimuMassUpper_prefit
Gaudi::Property< double > m_dimuMassUpper_prefit
Definition: TrigBphysMonitorAlgorithm.h:42
TrigBphysMonitorAlgorithm::m_vertexPointEstimator
ToolHandle< InDet::VertexPointEstimator > m_vertexPointEstimator
Definition: TrigBphysMonitorAlgorithm.h:49
TrigBphysMonitorAlgorithm::fillChainGenericHists
StatusCode fillChainGenericHists(const EventContext &, const ToolHandle< GenericMonitoringTool > &currentMonGroup, const std::string &chainName) const
Definition: TrigBphysMonitorAlgorithm.cxx:221
TrigBphysMonitorAlgorithm::fillDielectronChainHists
StatusCode fillDielectronChainHists(const EventContext &ctx, const std::string &chainName) const
Definition: TrigBphysMonitorAlgorithm.cxx:195
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
TrigBphysMonitorAlgorithm::m_offlineMuonCollectionKey
SG::ReadHandleKey< xAOD::MuonContainer > m_offlineMuonCollectionKey
Definition: TrigBphysMonitorAlgorithm.h:29
TrigBphysMonitorAlgorithm::matchTrackParticles
bool matchTrackParticles(const xAOD::TrackParticle *trk1, const xAOD::TrackParticle *trk2) const
Definition: TrigBphysMonitorAlgorithm.cxx:575
TrigBphysMonitorAlgorithm::m_ChainNames_MuMu
Gaudi::Property< std::vector< std::string > > m_ChainNames_MuMu
Definition: TrigBphysMonitorAlgorithm.h:35
lumiFormat.i
int i
Definition: lumiFormat.py:85
xAOD::P4Helpers::deltaR
double deltaR(double rapidity1, double phi1, double rapidity2, double phi2)
from bare bare rapidity,phi
Definition: xAODP4Helpers.h:150
TrigBphysMonitorAlgorithm::fillBmumuxChainHists
StatusCode fillBmumuxChainHists(const EventContext &ctx, const std::string &chainName) const
Definition: TrigBphysMonitorAlgorithm.cxx:161
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
TrigBphysMonitorAlgorithm::fillContainerHists
StatusCode fillContainerHists(const EventContext &ctx, const SG::ReadHandleKey< xAOD::TrigBphysContainer > &trigBphysContainerKey) const
Definition: TrigBphysMonitorAlgorithm.cxx:76
checkCorrelInHIST.prefix
dictionary prefix
Definition: checkCorrelInHIST.py:391
xAOD::BPhysHelper::PV_MIN_A0
@ PV_MIN_A0
Definition: BPhysHelper.h:475
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TrigParticleTable.h
xAOD::Vertex_v1::trackParticle
const TrackParticle * trackParticle(size_t i) const
Get the pointer to a given track that was used in vertex reco.
Definition: Vertex_v1.cxx:249
xAOD::TrackParticle_v1::genvecP4
GenVecFourMom_t genvecP4() const
The full 4-momentum of the particle : GenVector form.
Definition: TrackParticle_v1.cxx:116
AthMonitorAlgorithm::fill
void fill(const ToolHandle< GenericMonitoringTool > &groupHandle, std::vector< std::reference_wrapper< Monitored::IMonitoredVariable >> &&variables) const
Fills a vector of variables to a group by reference.
TrigBphysMonitorAlgorithm::TrigBphysMonitorAlgorithm
TrigBphysMonitorAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Definition: TrigBphysMonitorAlgorithm.cxx:15
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
TrigBphysMonitorAlgorithm::fillOfflineDimuonHists
StatusCode fillOfflineDimuonHists(const EventContext &, const std::string &dimuonMonGroupName, const std::vector< std::unique_ptr< xAOD::Vertex >> &dimuonContainer) const
Definition: TrigBphysMonitorAlgorithm.cxx:374
TrigBphysMonitorAlgorithm::fillChains
StatusCode fillChains(const EventContext &ctx) const
Definition: TrigBphysMonitorAlgorithm.cxx:98
xAOD::TrigBphys_v1::fitmass
float fitmass() const
accessor method: mass from vertex fit
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
TrigBphysMonitorAlgorithm::fillTrigBmumuxTrkHists
StatusCode fillTrigBmumuxTrkHists(const ToolHandle< GenericMonitoringTool > &currentMonGroup, const ElementLink< xAOD::TrigBphysContainer > &bphysLink, UInt_t tracksStartFrom=2) const
Definition: TrigBphysMonitorAlgorithm.cxx:272
xAOD::BPhysHelper::setLxy
bool setLxy(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Set the transverse decay distance and its error measured between the refitted primary vertex of type ...
Definition: BPhysHelper.cxx:888
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
Trk::Combined
@ Combined
Definition: TrackSummaryTool.h:32
TrigBphysMonitorAlgorithm::buildDimuons
StatusCode buildDimuons(const EventContext &ctx, std::vector< std::unique_ptr< xAOD::Vertex >> &vxContainer) const
Definition: TrigBphysMonitorAlgorithm.cxx:449
TrigBphysMonitorAlgorithm::m_offlineIDTrackCollectionKey
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_offlineIDTrackCollectionKey
Definition: TrigBphysMonitorAlgorithm.h:30
TrigBphysMonitorAlgorithm::fillVertexHists
StatusCode fillVertexHists(const ToolHandle< GenericMonitoringTool > &currentMonGroup, const xAOD::Vertex *vertex, const std::string &objStr) const
Definition: TrigBphysMonitorAlgorithm.cxx:408
xAOD::VxType::PileUp
@ PileUp
Pile-up vertex.
Definition: TrackingPrimitives.h:573
TrigBphysMonitorAlgorithm::m_ChainNames_ElEl
Gaudi::Property< std::vector< std::string > > m_ChainNames_ElEl
Definition: TrigBphysMonitorAlgorithm.h:37
TrigBphysMonitorAlgorithm::dimuonFit
std::unique_ptr< xAOD::Vertex > dimuonFit(const xAOD::TrackParticle *mu1, const xAOD::TrackParticle *mu2) const
Definition: TrigBphysMonitorAlgorithm.cxx:519
TrigBphysMonitorAlgorithm::m_dimuMassLower_prefit
Gaudi::Property< double > m_dimuMassLower_prefit
Definition: TrigBphysMonitorAlgorithm.h:41
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
ActsTrk::to_string
std::string to_string(const DetectorType &type)
Definition: GeometryDefs.h:34
TrigBphysMonitorAlgorithm::GetGoodPVs
std::vector< const xAOD::Vertex * > GetGoodPVs(const xAOD::VertexContainer *pvContainer) const
Definition: TrigBphysMonitorAlgorithm.cxx:593
TrigBphysMonitorAlgorithm::m_TrigBphysContainerKeys
SG::ReadHandleKeyArray< xAOD::TrigBphysContainer > m_TrigBphysContainerKeys
Definition: TrigBphysMonitorAlgorithm.h:27
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
TrigVtx::TrigParticleMasses
Definition: TrigParticleTable.h:30
TrigBphysMonitorAlgorithm::m_v0Tools
ToolHandle< Trk::V0Tools > m_v0Tools
Definition: TrigBphysMonitorAlgorithm.h:51
xAOD::BPhysHelper::setLxyErr
bool setLxyErr(const float val, const pv_type vertexType=BPhysHelper::PV_MIN_A0)
its error
Definition: BPhysHelper.cxx:899
AthMonitorAlgorithm::initialize
virtual StatusCode initialize() override
initialize
Definition: AthMonitorAlgorithm.cxx:18
BPhysHelper.h
: B-physics xAOD helpers.
xAOD::BPhysHelper::setRefTrks
bool setRefTrks(std::vector< float > px, std::vector< float > py, std::vector< float > pz)
Sets refitted track momenta.
Definition: BPhysHelper.cxx:286
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
xAOD::BPhysHelper::lxy
float lxy(const pv_type vertexType=BPhysHelper::PV_MIN_A0)
Get the transverse decay distance and its error measured between the refitted primary vertex of type ...
Definition: BPhysHelper.cxx:866
xAOD::Vertex_v1::chiSquared
float chiSquared() const
Returns the of the vertex fit as float.
TrigBphysMonitorAlgorithm::fillTracksHists
StatusCode fillTracksHists(const ToolHandle< GenericMonitoringTool > &currentMonGroup, const std::vector< ElementLink< xAOD::TrackParticleContainer > > &tpLinkVector, const std::string &prefix, bool separateHists=false, UInt_t offsetIndex=0) const
Definition: TrigBphysMonitorAlgorithm.cxx:288
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
python.TriggerAPI.TriggerAPISession.chainName
chainName
Definition: TriggerAPISession.py:426
python.changerun.pv
pv
Definition: changerun.py:81
TrigBphysMonitorAlgorithm::fillDimuonChainHists
StatusCode fillDimuonChainHists(const EventContext &ctx, const std::string &chainName) const
Definition: TrigBphysMonitorAlgorithm.cxx:136
TrigBphysMonitorAlgorithm::m_deltaRMatchingThreshold
Gaudi::Property< double > m_deltaRMatchingThreshold
Definition: TrigBphysMonitorAlgorithm.h:47
TrigBphysMonitorAlgorithm::fillTrigLeptonHists
StatusCode fillTrigLeptonHists(const ToolHandle< GenericMonitoringTool > &currentMonGroup, const ElementLink< xAOD::TrigBphysContainer > &bphysLink, const std::string &name_prefix) const
Definition: TrigBphysMonitorAlgorithm.cxx:255
TrigBphysMonitorAlgorithm::fillContainers
StatusCode fillContainers(const EventContext &ctx) const
For lxy etc.
Definition: TrigBphysMonitorAlgorithm.cxx:64
TrigBphysMonitorAlgorithm::fillBphysObjectHists
StatusCode fillBphysObjectHists(const ToolHandle< GenericMonitoringTool > &currentMonGroup, const ElementLink< xAOD::TrigBphysContainer > &bphysLink, const std::string &objStr) const
Definition: TrigBphysMonitorAlgorithm.cxx:234
TrigBphysMonitorAlgorithm::~TrigBphysMonitorAlgorithm
virtual ~TrigBphysMonitorAlgorithm()
Definition: TrigBphysMonitorAlgorithm.cxx:20
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
Monitored::Scalar
Declare a monitored scalar variable.
Definition: MonitoredScalar.h:34
TrigBphysMonitorAlgorithm::m_offlinePvCollectionKey
SG::ReadHandleKey< xAOD::VertexContainer > m_offlinePvCollectionKey
Definition: TrigBphysMonitorAlgorithm.h:31
TrigVtx::TrigParticleMasses::mass
std::array< double, 6 > mass
Definition: TrigParticleTable.h:32
TrigBphysMonitorAlgorithm::m_ChainNames_MuMuX
Gaudi::Property< std::vector< std::string > > m_ChainNames_MuMuX
Definition: TrigBphysMonitorAlgorithm.h:36
CaloNoise_fillDB.mu
mu
Definition: CaloNoise_fillDB.py:53
Amg::distance
float distance(const Amg::Vector3D &p1, const Amg::Vector3D &p2)
calculates the distance between two point in 3D space
Definition: GeoPrimitivesHelpers.h:54
TrigBphysMonitorAlgorithm::m_vertexFitter
ToolHandle< Trk::TrkVKalVrtFitter > m_vertexFitter
Definition: TrigBphysMonitorAlgorithm.h:50
makeComparison.deltaR
float deltaR
Definition: makeComparison.py:36
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TrigBphysMonitorAlgorithm::fillOfflineDimuons
StatusCode fillOfflineDimuons(const EventContext &ctx, const std::vector< std::unique_ptr< xAOD::Vertex >> &dimuonContainer) const
Definition: TrigBphysMonitorAlgorithm.cxx:351
TrigBphysMonitorAlgorithm::m_requireExplicitESDecision
Gaudi::Property< bool > m_requireExplicitESDecision
Definition: TrigBphysMonitorAlgorithm.h:39
TrigBphysMonitorAlgorithm::m_ContainerNames
Gaudi::Property< std::vector< std::string > > m_ContainerNames
Definition: TrigBphysMonitorAlgorithm.h:33
xAOD::TrigBphys_v1
Class describing a Bphysics online composite object.
Definition: TrigBphys_v1.h:44
AthMonitorAlgorithm::getGroup
const ToolHandle< GenericMonitoringTool > & getGroup(const std::string &name) const
Get a specific monitoring tool from the tool handle array.
Definition: AthMonitorAlgorithm.cxx:164
TrigBphysMonitorAlgorithm.h
TrigBphysMonitorAlgorithm::isChainPassed
bool isChainPassed(const std::string &chain) const
Definition: TrigBphysMonitorAlgorithm.cxx:438
TrigBphysMonitorAlgorithm::fillHistograms
virtual StatusCode fillHistograms(const EventContext &ctx) const override
adds event to the monitoring histograms
Definition: TrigBphysMonitorAlgorithm.cxx:42