Commit 1296ad2b authored by Elemer Nagy's avatar Elemer Nagy Committed by Frank Winklmeier
Browse files

Introduced access to triggered track particles both in the legacy and in the new Run3 framework.

In order that it can be applied to ART files Carlo Varni needs to migrate InputMakerAlg.Views = "BTagViews"
from EventViewCreatorAlgorithmWithJets to EventViewCreatorAlgorithm (with InViewJets property)
parent d62e84b9
......@@ -71,6 +71,7 @@ class HLTBjetMonTool : public IHLTMonTool {
SG::ReadHandleKey<xAOD::VertexContainer> m_offlineVertexContainerKey {this,"OfflineVertexContainerName","PrimaryVertices","Key of offline primary vertexes"};
SG::ReadHandleKey<xAOD::VertexContainer> m_onlineVertexContainerKey {this,"OnlineVertexContainerName","HLT_EFHistoPrmVtx","Key of online bjet primary vertexes"};
SG::ReadHandleKey<xAOD::TrackParticleContainer> m_onlineTrackContainerKey {this,"OnlineTrackContainerName","HLT_IDTrack_Bjet_IDTrig","Key of online tracks of bjets"};
ToolHandle<Trig::TrigDecisionTool> m_trigDec; //!
......
......@@ -5,7 +5,7 @@
'''@file TrigBjetMonitorAlgorithm.py
@author E. Nagy
@author T. Bold
@date 2019-04-16
@date 2020-05-27
@brief Example trigger python configuration for the Run III AthenaMonitoring package, based on the example by C Burton and P Onyisi
'''
......@@ -113,6 +113,7 @@ def TrigBjetMonConfig(inputFlags):
# Histograms which depend on the trigger chain
# mu-jet histograms
doRun2 = False
AllChains = []
......@@ -125,17 +126,22 @@ def TrigBjetMonConfig(inputFlags):
HistName = 'jetPt_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of Pt_jet;Pt_jet;Events',
path='Expert/'+chain[2:],xbins=100,xmin=-0.0,xmax=750.0)
path='Expert/'+chain[2:],xbins=100,xmin=0.0,xmax=750.0)
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of Pt_jet;Pt_jet;Events',
path='Shifter/'+chain[2:],xbins=100,xmin=-0.0,xmax=750.0)
# print " ==> histogram ",HistName," is defined for Shifter folder"
path='Shifter/'+chain[2:],xbins=100,xmin=0.0,xmax=750.0)
continue
else : # b-jets
# print " b-jet histogram is defined for ", chain[2:]
# b-jet histograms
# Primary vertex histograms
# PV associated to jets
HistName = 'PVz_jet_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online zPV from jets;zPV from jets;Events',
......@@ -144,7 +150,6 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online zPV from jets;zPV from jets;Events',
path='Shifter/'+chain[2:],xbins=500,xmin=-250.0,xmax=250.0)
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'PVx_jet_' + chain[2:]
if chain[0:1] == "E" :
......@@ -154,7 +159,6 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online xPV from jets;xPV from jets;Events',
path='Shifter/'+chain[2:],xbins=200,xmin=-1.5,xmax=+1.5)
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'PVy_jet_' + chain[2:]
if chain[0:1] == "E" :
......@@ -164,7 +168,8 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online yPV from jets;yPV from jets;Events',
path='Shifter/'+chain[2:],xbins=200,xmin=-1.5,xmax=+1.5)
# print " ==> histogram ",HistName," is defined for Shifter folder"
# PV directly from SG
HistName = 'nPV_tr_' + chain[2:]
if chain[0:1] == "E" :
......@@ -174,7 +179,6 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Number of online PV per event;nPV;Events',
path='Shifter/'+chain[2:],xbins=101,xmin=-1.0,xmax=100.0)
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'PVz_tr_' + chain[2:]
if chain[0:1] == "E" :
......@@ -184,7 +188,6 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online zPV;zPV;Events',
path='Shifter/'+chain[2:],xbins=500,xmin=-250.0,xmax=250.0)
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'PVx_tr_' + chain[2:]
if chain[0:1] == "E" :
......@@ -194,7 +197,6 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online xPV;xPV from jets;Events',
path='Shifter/'+chain[2:],xbins=200,xmin=-1.5,xmax=+1.5)
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'PVy_tr_' + chain[2:]
if chain[0:1] == "E" :
......@@ -204,7 +206,35 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online yPV;yPV from jets;Events',
path='Shifter/'+chain[2:],xbins=200,xmin=-1.5,xmax=+1.5)
# print " ==> histogram ",HistName," is defined for Shifter folder"
# track histograms
HistName = 'nTrack_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Number of tracks;nTrack;Events',
path='Expert/'+chain[2:],xbins=40,xmin=0.0,xmax=40.0)
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Number of tracks;nTrack;Events',
path='Shifter/'+chain[2:],xbins=40,xmin=0.0,xmax=40.0)
HistName = 'trkPt_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Pt of tracks;Pt;Events',
path='Expert/'+chain[2:],xbins=100,xmin=0.0,xmax=50.0)
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Pt of tracks;Pt;Events',
path='Shifter/'+chain[2:],xbins=100,xmin=0.0,xmax=50.0)
HistName = 'trkEta_' + chain[2:] + ',trkPhi_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName,type='TH2F',title='Phi vs Eta of tracks;Eta;Phi',
path='Expert/'+chain[2:],xbins=20,xmin=-5.0,xmax=+5.0,ybins=20,ymin=-3.1416,ymax=+3.1416)
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName,type='TH2F',title='Phi vs Eta of tracks;Eta;Phi',
path='Shifter/'+chain[2:],xbins=20,xmin=-5.0,xmax=+5.0,ybins=20,ymin=-3.1416,ymax=+3.1416)
HistName = 'd0_' + chain[2:]
if chain[0:1] == "E" :
......@@ -214,7 +244,35 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of d0;d0;Events',
path='Shifter/'+chain[2:],xbins=200,xmin=-2.0,xmax=2.0)
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'ed0_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of sig(d0);sig(d0);Events',
path='Expert/'+chain[2:],xbins=200,xmin=0.,xmax=1.0)
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of sig(d0);sig(d0);Events',
path='Shifter/'+chain[2:],xbins=200,xmin=0.,xmax=1.0)
HistName = 'z0_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of z0;z0;Events',
path='Expert/'+chain[2:],xbins=200,xmin=-250.0,xmax=250.0)
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of z0;z0;Events',
path='Shifter/'+chain[2:],xbins=200,xmin=-250.0,xmax=250.0)
HistName = 'ez0_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of sig(z0);sig(z0);Events',
path='Expert/'+chain[2:],xbins=200,xmin=0.,xmax=5.0)
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of sig(z0);sig(z0);Events',
path='Shifter/'+chain[2:],xbins=200,xmin=0.,xmax=5.0)
# jet histograms
HistName = 'nJet_' + chain[2:]
if chain[0:1] == "E" :
......@@ -224,17 +282,15 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Number of jets;nJet;Events',
path='Shifter/'+chain[2:],xbins=40,xmin=0.0,xmax=40.0)
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'jetPt_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of Pt_jet;Pt_jet;Events',
path='Expert/'+chain[2:],xbins=100,xmin=-0.0,xmax=750.0)
path='Expert/'+chain[2:],xbins=100,xmin=0.0,xmax=750.0)
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of Pt_jet;Pt_jet;Events',
path='Shifter/'+chain[2:],xbins=100,xmin=-0.0,xmax=750.0)
# print " ==> histogram ",HistName," is defined for Shifter folder"
path='Shifter/'+chain[2:],xbins=100,xmin=0.0,xmax=750.0)
HistName = 'jetEta_' + chain[2:] + ',jetPhi_' + chain[2:]
if chain[0:1] == "E" :
......@@ -244,7 +300,9 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName,type='TH2F',title='Phi vs Eta of jets;Eta_jet;Phi_jet',
path='Shifter/'+chain[2:],xbins=20,xmin=-5.0,xmax=+5.0,ybins=20,ymin=-3.1416,ymax=+3.1416)
# print " ==> histogram ",HistName," is defined for Shifter folder"
# b-tagging quantities
HistName = 'wMV2c20_' + chain[2:]
if chain[0:1] == "E" :
......@@ -254,7 +312,6 @@ def TrigBjetMonConfig(inputFlags):
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of MV2c20 discriminant;MV2c20;Events',
path='Shifter/'+chain[2:],xbins=200,xmin=-1.0,xmax=1.0)
# print " ==> histogram ",HistName," is defined for Shifter folder"
continue
......@@ -309,7 +366,7 @@ if __name__=='__main__':
# file to be run w/ doRun2 = False
# file = '/afs/cern.ch/user/e/ebergeas/work/public/triggermonitoring/nightly_2019-10-20T2130/AOD.pool.root'
# file = '/afs/cern.ch/work/e/enagy/public/GenerateAOD/Gen_MT_240919/AOD.pool.root'
file = '/afs/cern.ch/work/e/enagy/public/ARTfiles/MCtest290120.AOD.pool.root'
file = '/afs/cern.ch/work/e/enagy/public/ARTfiles/MCtest200520.AOD.pool.root'
# file to be run w/ doRun2 = True
# file = '/afs/cern.ch/work/e/enagy/public/GenerateAOD/Gen_ST_240919/AOD.pool.root'
# file = '/eos/atlas/atlascerngroupdisk/data-art/build-output/master/Athena/x86_64-centos7-gcc8-opt/2019-09-16T2129/TrigAnalysisTest/test_trigAna_q221_RDOtoAOD_mt1_build/AOD.pool.root'
......
......@@ -127,6 +127,7 @@ StatusCode HLTBjetMonTool::init() {
ATH_CHECK( m_offlineVertexContainerKey.initialize() );
ATH_CHECK( m_onlineVertexContainerKey.initialize() );
ATH_CHECK( m_onlineTrackContainerKey.initialize() );
return StatusCode::SUCCESS;
}
......@@ -953,7 +954,7 @@ StatusCode HLTBjetMonTool::book(){
ATH_MSG_DEBUG(" pT: " << (trk->pt())*1.e-3 << " Eta: " << trk->eta() << " Phi: " << trk->phi() << " d0: " << trk->d0() );
if (HistTrack) hist("d0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(trk->d0());
if (HistTrack) hist("z0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(trk->z0());
if (HistTrack) hist("ed0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(Amg::error(trk->definingParametersCovMatrix(), 0));
if (HistTrack) hist("ed0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(Amg::error(trk->definingParametersCovMatrix(), 0) );
if (HistTrack) hist("ez0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(Amg::error(trk->definingParametersCovMatrix(), 1));
if (HistTrack) hist("trkPt"+HistExt,"HLT/BjetMon/"+HistDir)->Fill( (trk->pt())*1.e-3 );
if (HistTrack) hist2("trkEtaPhi"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(trk->eta(),trk->phi());
......@@ -1043,10 +1044,18 @@ StatusCode HLTBjetMonTool::book(){
} // Run2 access
else { // Run3 access
ATH_MSG_DEBUG(" ===> Run 3 access for Trigger Item: " << trigItem);
// online PV from SG
// online track container
SG::ReadHandle<xAOD::TrackParticleContainer> theTracks(m_onlineTrackContainerKey);
// verify the content
for ( const xAOD::TrackParticle* track : *theTracks ) {
ATH_MSG_DEBUG( " Pt of track in TrackParticleContainer: " << track->pt() );
}
// online PV from SG
int iPV = 0;
SG::ReadHandle<xAOD::VertexContainer> vtxContainer(m_onlineVertexContainerKey);
for (const xAOD::Vertex* vtx : *vtxContainer) {
......@@ -1056,15 +1065,16 @@ StatusCode HLTBjetMonTool::book(){
if(HistPV) hist("PVy_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(vtx->y());
if(HistPV) hist("PVz_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(vtx->z());
iPV++;
if ( Eofflinepv && HistPV && (iPV == 1) ) hist("diffzPV0offPVon"+HistExt,"HLT/BjetMon/"+HistDir)->Fill( vtx->z()-offlinepvz );
} // if vtx type
} // loop on vtxContainer
ATH_MSG_DEBUG(" Number of vertices from SG: " << iPV );
if(HistPV) hist("nPV_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(iPV);
// Jets and PV through jet link
// std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDec->features<xAOD::JetContainer>(trigItem, TrigDefs::Physics, jetKey);
// Jets and PV and tracks through jet link
std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDec->features<xAOD::JetContainer>(trigItem, TrigDefs::Physics, m_onlineBjetContainerKey); // TM 240320
int ijet = 0;
int itrack = 0;
for(const auto jetLinkInfo : onlinejets) {
// jetPt
const xAOD::Jet* jet = *(jetLinkInfo.link);
......@@ -1080,13 +1090,41 @@ StatusCode HLTBjetMonTool::book(){
// if(HistPV) hist("PVz_tr"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(vtx->z());
}
ijet++;
} // onlinejets
ATH_MSG_DEBUG(" - nJet: " << ijet);
// Tracks associated to triggered jets ( featurs = onlinejets ) courtesy of Tim Martin on 12/05/2020
const auto track_it_pair = m_trigDec->associateToEventView(theTracks, jetLinkInfo.source, "roi");
const xAOD::TrackParticleContainer::const_iterator start_it = track_it_pair.first;
const xAOD::TrackParticleContainer::const_iterator end_it = track_it_pair.second;
int count = 0;
for ( xAOD::TrackParticleContainer::const_iterator it = start_it; it != end_it; ++it) {
count++;
ATH_MSG_DEBUG( " Track " << count << " with pT " << (*it)->pt() <<" from BJet with pT " << (*jetLinkInfo.link)->pt() );
ATH_MSG_DEBUG( " Track " << count << " with pT/eta/phi " << (*it)->pt() << "/" << (*it)->eta() << "/" << (*it)->phi() );
ATH_MSG_DEBUG( " Track " << count << " with d0/sigd0 " << (*it)->d0() << "/" << Amg::error((*it)->definingParametersCovMatrix(), 0) );
ATH_MSG_DEBUG( " Track " << count << " with z0/sigz0 " << (*it)->z0() << "/" << Amg::error((*it)->definingParametersCovMatrix(), 1) );
if (HistTrack) hist("d0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill((*it)->d0());
if (HistTrack) hist("z0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill((*it)->z0());
if (HistTrack) hist("ed0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(Amg::error((*it)->definingParametersCovMatrix(), 0) );
if (HistTrack) hist("ez0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(Amg::error((*it)->definingParametersCovMatrix(), 1) );
if (HistTrack) hist("trkPt"+HistExt,"HLT/BjetMon/"+HistDir)->Fill( ((*it)->pt())*1.e-3 );
if (HistTrack) hist2("trkEtaPhi"+HistExt,"HLT/BjetMon/"+HistDir)->Fill((*it)->eta(),(*it)->phi());
float errz0 = Amg::error((*it)->definingParametersCovMatrix(), 1);
if (Eofflinepv && HistTrack) hist("diffz0PV0"+HistExt,"HLT/BjetMon/"+HistDir)->Fill((*it)->z0()+(*it)->vz()-offlinepvz);
if ( errz0 >0. && Eofflinepv && HistTrack) hist("sigz0PV"+HistExt,"HLT/BjetMon/"+HistDir)->Fill( ((*it)->z0()+(*it)->vz()-offlinepvz)/errz0 );
} // it on tracks
ATH_MSG_DEBUG( " Number of tracks: " << count );
itrack += count;
} // jetLinkInfo
ATH_MSG_DEBUG(" Total number of triggered b-jets: " << ijet);
if(HistJet) hist("nJet"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(ijet);
ATH_MSG_DEBUG(" Total number of triggered tracks associated to the b-jets: " << itrack);
if (HistTrack) hist("nTrack"+HistExt,"HLT/BjetMon/"+HistDir)->Fill(itrack);
} // else Run3 access
} // ichain
} // trigItem
} // FiredChainNames.empty()
......
......@@ -10,10 +10,21 @@
#include "xAODBTagging/BTaggingContainer.h"
#include "xAODBTagging/BTagging.h"
#include "Particle/TrackParticleContainer.h"
#include "GeoPrimitives/GeoPrimitives.h"
#include "TrigParticle/TrigEFBjet.h"
#include "TrigParticle/TrigEFBjetContainer.h"
#include "JetEvent/JetCollection.h"
#include "muonEvent/Muon.h"
#include "muonEvent/MuonContainer.h"
// Calculates the track errors
#include "EventPrimitives/EventPrimitivesHelpers.h"
TrigBjetMonitorAlgorithm::TrigBjetMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
: AthMonitorAlgorithm(name,pSvcLocator)
,m_doRandom(true)
......@@ -36,6 +47,7 @@ StatusCode TrigBjetMonitorAlgorithm::initialize() {
ATH_CHECK( m_offlineVertexContainerKey.initialize() );
ATH_CHECK( m_onlineVertexContainerKey.initialize() );
ATH_CHECK( m_onlineTrackContainerKey.initialize() );
return AthMonitorAlgorithm::initialize();
}
......@@ -278,7 +290,15 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
}// trigger combinations
} else { // Run 3 trigger
ATH_MSG_DEBUG(" ===> Run 3 access to Trigger feature: " );
ATH_MSG_DEBUG(" ===> Run 3 access to Trigger Item: " << trigName);
// online track container
SG::ReadHandle<xAOD::TrackParticleContainer> theTracks(m_onlineTrackContainerKey, ctx);
// verify the content
for ( const xAOD::TrackParticle* track : *theTracks ) {
ATH_MSG_DEBUG( " Pt of track in TrackParticleContainer: " << track->pt() );
}
// bjet chains
if (bjetChain) {
......@@ -318,11 +338,12 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
//bjet or mujet chains
if (bjetChain || mujetChain) {
// Jets and PV through jet link
// std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDec->features<xAOD::JetContainer>(trigName, TrigDefs::Physics, jetKey);
// Jets and PV and tracks through jet link
std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDec->features<xAOD::JetContainer>(trigName, TrigDefs::Physics, m_onlineBjetContainerKey);
// std::vector< TrigCompositeUtils::LinkInfo<xAOD::JetContainer> > onlinejets = m_trigDec->features<xAOD::JetContainer>(trigName);
int ijet = 0;
int itrack = 0;
std::string nJetH = "nJet_"+trigName;
auto nJet = Monitored::Scalar<int>(nJetH,0.0);
nJet = onlinejets.size();
......@@ -371,9 +392,74 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
fill("TrigBjetMonitor",PVy_jet);
}
ijet++;
} // onlinejets
ATH_MSG_DEBUG(" ijet : " << ijet << " nJet : " << nJet);
// Tracks associated to triggered jets ( featurs = onlinejets ) courtesy of Tim Martin on 12/05/2020
const auto track_it_pair = m_trigDec->associateToEventView(theTracks, jetLinkInfo.source, "roi");
const xAOD::TrackParticleContainer::const_iterator start_it = track_it_pair.first;
const xAOD::TrackParticleContainer::const_iterator end_it = track_it_pair.second;
int count = 0;
for ( xAOD::TrackParticleContainer::const_iterator it = start_it; it != end_it; ++it) {
count++;
ATH_MSG_DEBUG( " Track " << count << " with pT " << (*it)->pt() <<" from BJet with pT " << (*jetLinkInfo.link)->pt() );
ATH_MSG_DEBUG( " Track " << count << " with pT/eta/phi " << (*it)->pt() << "/" << (*it)->eta() << "/" << (*it)->phi() );
ATH_MSG_DEBUG( " Track " << count << " with d0/sigd0 " << (*it)->d0() << "/" << Amg::error((*it)->definingParametersCovMatrix(), 0) );
ATH_MSG_DEBUG( " Track " << count << " with z0/sigz0 " << (*it)->z0() << "/" << Amg::error((*it)->definingParametersCovMatrix(), 1) );
std::string NameH = "trkPt_"+trigName;
ATH_MSG_DEBUG( " NameH: " << NameH );
auto trkPt = Monitored::Scalar<float>(NameH,0.0);
trkPt = ((*it)->pt())*1.e-3;
ATH_MSG_DEBUG(" trkPt: " << trkPt);
fill("TrigBjetMonitor",trkPt);
NameH = "trkEta_"+trigName;
ATH_MSG_DEBUG( " NameH: " << NameH );
auto trkEta = Monitored::Scalar<float>(NameH,0.0);
trkEta = (*it)->eta();
NameH = "trkPhi_"+trigName;
ATH_MSG_DEBUG( " NameH: " << NameH );
auto trkPhi = Monitored::Scalar<float>(NameH,0.0);
trkPhi = (*it)->phi();
ATH_MSG_DEBUG(" trkEta: " << trkEta << " trkPhi : " << trkPhi);
fill("TrigBjetMonitor",trkEta,trkPhi);
NameH = "d0_"+trigName;
ATH_MSG_DEBUG( " NameH: " << NameH );
auto d0 = Monitored::Scalar<float>(NameH,0.0);
d0 = (*it)->d0();
ATH_MSG_DEBUG(" d0: " << d0);
fill("TrigBjetMonitor",d0);
NameH = "z0_"+trigName;
ATH_MSG_DEBUG( " NameH: " << NameH );
auto z0 = Monitored::Scalar<float>(NameH,0.0);
z0 = (*it)->z0();
ATH_MSG_DEBUG(" z0: " << z0);
fill("TrigBjetMonitor",z0);
NameH = "ed0_"+trigName;
ATH_MSG_DEBUG( " NameH: " << NameH );
auto ed0 = Monitored::Scalar<float>(NameH,0.0);
ed0 = Amg::error((*it)->definingParametersCovMatrix(), 0);
ATH_MSG_DEBUG(" ed0: " << ed0);
fill("TrigBjetMonitor",ed0);
NameH = "ez0_"+trigName;
ATH_MSG_DEBUG( " NameH: " << NameH );
auto ez0 = Monitored::Scalar<float>(NameH,0.0);
ez0 = Amg::error((*it)->definingParametersCovMatrix(), 1);
ATH_MSG_DEBUG(" ez0: " << ez0);
fill("TrigBjetMonitor",ez0);
} // it on tracks
ATH_MSG_DEBUG( " Number of tracks: " << count );
itrack += count;
} // jetLinkInfo from onlinejets
ATH_MSG_DEBUG(" Total number of triggered b-jets: " << ijet << " nJet : " << nJet);
ATH_MSG_DEBUG(" Total number of triggered tracks associated to the b-jets: " << itrack);
std::string nTrackH = "nTrack_"+trigName;
auto nTrack = Monitored::Scalar<int>(nTrackH,0.0);
nTrack = itrack;
fill("TrigBjetMonitor",nTrack);
} //bjet or mujet
} // else Run3
} else {
......
......@@ -32,7 +32,10 @@ class TrigBjetMonitorAlgorithm : public AthMonitorAlgorithm {
SG::ReadHandleKey<xAOD::MuonContainer> m_muonContainerKey;
SG::ReadHandleKey<xAOD::VertexContainer> m_offlineVertexContainerKey {this,"OfflineVertexContainerName","PrimaryVertices","Key of offline primary vertexes"};
SG::ReadHandleKey<xAOD::VertexContainer> m_onlineVertexContainerKey {this,"OnlineVertexContainerName","HLT_EFHistoPrmVtx","Key of online bjet primary vertexes"};
SG::ReadHandleKey<xAOD::TrackParticleContainer> m_onlineTrackContainerKey {this,"OnlineTrackContainerName","HLT_IDTrack_Bjet_IDTrig","Key of online tracks of bjets"};
ToolHandle<Trig::TrigDecisionTool> m_trigDec; //!
bool m_doRun2;
};
#endif
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment