Commit 0e9ececc authored by Elemer Nagy's avatar Elemer Nagy
Browse files

This is the same modification as introduced on Run3TrigFeatureAccessTest1 but including the

conflicts solved for the TrigEGammaMonitoring package
parent f1e7173f
......@@ -16,7 +16,7 @@ def TrigBjetMonConfig(inputFlags):
# Define one top-level monitoring algorithm. The new configuration
# framework uses a component accumulator.
from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
result = ComponentAccumulator()
# result = ComponentAccumulator()
# The following class will make a sequence, configure algorithms, and link
# them to GenericMonitoringTools
......@@ -65,7 +65,7 @@ def TrigBjetMonConfig(inputFlags):
from TrigHLTMonitoring.HLTMonTriggerList import hltmonList
bjet_triglist = hltmonList.monitoring_bjet
bjet_triglist += hltmonList.monitoring_mujet
print " ==> bjet_triglist: ", bjet_triglist
# print " ==> bjet_triglist: ", bjet_triglist
# Add some tools. N.B. Do not use your own trigger decion tool. Use the
# standard one that is included with AthMonitorAlgorithm.
......@@ -111,67 +111,67 @@ def TrigBjetMonConfig(inputFlags):
AllChains = []
for chain in bjet_triglist :
AllChains.append(chain[2:])
print " inside bjet_triglist chain[2:8] : " , chain[2:8]
# print " inside bjet_triglist chain[2:8] : " , chain[2:8]
if chain[2:8] == 'HLT_mu' : # mu-jets
print " mu-jet histogram is defined for ", chain[2:]
# print " mu-jet histogram is defined for ", chain[2:]
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)
print " ==> histogram ",HistName," is defined for Expert folder"
# 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"
# print " ==> histogram ",HistName," is defined for Shifter folder"
continue
else : # b-jets
print " b-jet histogram is defined for ", chain[2:]
# print " b-jet histogram is defined for ", chain[2:]
HistName = 'PVz_tr_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online zPV;zPV;Events',
path='Expert/'+chain[2:],xbins=200,xmin=-200.0,xmax=200.0)
print " ==> histogram ",HistName," is defined for Expert folder"
# print " ==> histogram ",HistName," is defined for Expert folder"
if chain[0:1] == "S" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of online zPV;zPV;Events',
path='Shifter/'+chain[2:],xbins=200,xmin=-200.0,xmax=200.0)
print " ==> histogram ",HistName," is defined for Shifter folder"
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'd0_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of d0;d0;Events',
path='Expert/'+chain[2:],xbins=200,xmin=-2.0,xmax=2.0)
print " ==> histogram ",HistName," is defined for Expert folder"
# print " ==> histogram ",HistName," is defined for Expert folder"
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"
# 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)
print " ==> histogram ",HistName," is defined for Expert folder"
# 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"
# print " ==> histogram ",HistName," is defined for Shifter folder"
HistName = 'wMV2c20_' + chain[2:]
if chain[0:1] == "E" :
BjetMonGroup.defineHistogram(HistName, title='Distribution of MV2c20 discriminant;MV2c20;Events',
path='Expert/'+chain[2:],xbins=200,xmin=-1.0,xmax=1.0)
print " ==> histogram ",HistName," is defined for Expert folder"
# print " ==> histogram ",HistName," is defined for Expert folder"
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"
# print " ==> histogram ",HistName," is defined for Shifter folder"
continue
print " ==> In TrigBjetMonitorAlgorithm.py: AllChains list: ", AllChains
# print " ==> In TrigBjetMonitorAlgorithm.py: AllChains list: ", AllChains
trigBjetMonAlg.AllChains = AllChains
#shifterTrigBjetMonAlg.AllChains = AllChains
......@@ -220,7 +220,8 @@ if __name__=='__main__':
# MC input files proposed by Tim Martin in https://its.cern.ch/jira/browse/ATR-19881 for Run-3
# file = '/afs/cern/ch/user/t/tamartin/public/ESD.pool.root'
# file = '/afs/cern/ch/user/t/tamartin/public/AOD.pool.root'
file = '/afs/cern.ch/work/e/enagy/public/Run3TrigFeatureAccessTest_1/run/legacy.AOD.pool.root'
# file = '/afs/cern.ch/work/e/enagy/public/Run3TrigFeatureAccessTest_1/run/legacy.AOD.pool.root'
file = '/afs/cern.ch/work/e/enagy/public/GenerateAOD/AOD.pool.root'
# file = '/afs/cern.ch/work/e/enagy/public/Run3TrigFeatureAccessTest_1/run/mt.AOD.pool.root'
ConfigFlags.Input.Files = [file]
ConfigFlags.Input.isMC = True
......
......@@ -17,14 +17,14 @@
TrigBjetMonitorAlgorithm::TrigBjetMonitorAlgorithm( const std::string& name, ISvcLocator* pSvcLocator )
: AthMonitorAlgorithm(name,pSvcLocator)
,m_doRandom(true)
,m_AllChains{}
,m_MuonContainerKey("Muons")
,m_VertexContainerKey("PrimaryVertices")
,m_allChains{}
,m_muonContainerKey("Muons")
,m_vertexContainerKey("PrimaryVertices")
,m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool")
{
declareProperty ("AllChains", m_AllChains);
declareProperty("MuonContainerName",m_MuonContainerKey);
declareProperty("VertexContainerName",m_VertexContainerKey);
declareProperty ("AllChains", m_allChains);
declareProperty("MuonContainerName",m_muonContainerKey);
declareProperty("VertexContainerName",m_vertexContainerKey);
}
......@@ -32,8 +32,8 @@ TrigBjetMonitorAlgorithm::~TrigBjetMonitorAlgorithm() {}
StatusCode TrigBjetMonitorAlgorithm::initialize() {
ATH_CHECK( m_MuonContainerKey.initialize() );
ATH_CHECK( m_VertexContainerKey.initialize() );
ATH_CHECK( m_muonContainerKey.initialize() );
ATH_CHECK( m_vertexContainerKey.initialize() );
return AthMonitorAlgorithm::initialize();
}
......@@ -49,12 +49,12 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
auto OffyVtx = Monitored::Scalar<float>("Off_yVtx",0.0);
auto OffzVtx = Monitored::Scalar<float>("Off_zVtx",0.0);
SG::ReadHandle<xAOD::VertexContainer> offlinepv(m_VertexContainerKey, ctx);
SG::ReadHandle<xAOD::VertexContainer> offlinepv(m_vertexContainerKey, ctx);
if (! offlinepv.isValid() ) {
ATH_MSG_ERROR("evtStore() does not contain VertexContainer Collection with name "<< m_VertexContainerKey);
ATH_MSG_ERROR("evtStore() does not contain VertexContainer Collection with name "<< m_vertexContainerKey);
return StatusCode::FAILURE;
}
std::cout << " Size of the Off-line PV container: " << offlinepv->size() << std::endl;
ATH_MSG_INFO(" Size of the Off-line PV container: " << offlinepv->size() );
OffNVtx = offlinepv->size() ;
for (unsigned int j = 0; j<offlinepv->size(); j++){
OffxVtx = (*(offlinepv))[j]->x();
......@@ -68,10 +68,10 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
std::string chainName;
int size_AllChains = m_AllChains.size();
int size_AllChains = m_allChains.size();
ATH_MSG_INFO(" Size of the AllChains trigger container: " << size_AllChains );
for (int i =0; i<size_AllChains; i++){
chainName = m_AllChains.at(i);
chainName = m_allChains.at(i);
ATH_MSG_INFO(" Chain number: " << i << " AllChains Chain Name: " << chainName );
}
......@@ -90,7 +90,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for ( auto& trigName : m_AllChains ) {
for ( auto& trigName : m_allChains ) {
// Access to TrigFeature
......@@ -99,7 +99,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
if ( m_trigDecTool->isPassed(trigName) ) {
std::cout << " Trigger chain from AllChains list: " << trigName << " has fired !!! " << std::endl;
ATH_MSG_INFO(" Trigger chain from AllChains list: " << trigName << " has fired !!! " );
// Trigger type
......@@ -141,8 +141,8 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
bjetChain = false;
}// found
std::cout << " Trigger type: bjetChain " << bjetChain << " mujetChain " << mujetChain << " FTKChain " << FTKChain << " splitChain " << splitChain << std::endl;
std::cout << " Keys -- priVtxKey: " << priVtxKey << " jetKey: " << jetKey << " trackKey: " << trackKey << std::endl;
ATH_MSG_INFO( " Trigger type: bjetChain " << bjetChain << " mujetChain " << mujetChain << " FTKChain " << FTKChain << " splitChain " << splitChain );
ATH_MSG_INFO( " Keys -- priVtxKey: " << priVtxKey << " jetKey: " << jetKey << " trackKey: " << trackKey );
// Read the TrigFeature contener
......@@ -153,7 +153,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
Trig::FeatureContainer fc = m_trigDec->features(trigName);
const std::vector< Trig::Combination >& triggerCombs = fc.getCombinations();
ATH_MSG_INFO("RETRIEVED " << triggerCombs.size() << " COMBINATIONS FOR " << trigName);
std::cout << " Size of triggerCombs : " << triggerCombs.size() << std::endl;
ATH_MSG_INFO( " Size of triggerCombs : " << triggerCombs.size() );
// Take all combinations for this b-jet trigger
std::vector< Trig::Combination >::const_iterator triggerComb;
for( triggerComb = triggerCombs.begin(); triggerComb != triggerCombs.end(); ++triggerComb ) {
......@@ -171,7 +171,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
if( not onlinepv->empty()) {
// PVz_tr
std::string NameH = "PVz_tr_"+trigName;
std::cout << " NameH: " << NameH << std::endl;
ATH_MSG_INFO( " NameH: " << NameH );
auto PVz_tr = Monitored::Scalar<float>(NameH,0.0);
PVz_tr = (*(onlinepv))[0]->z();
ATH_MSG_INFO(" PVz_tr: " << PVz_tr);
......@@ -188,7 +188,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for(const auto* trk : *onlinetrack) {
// d0
std::string NameH = "d0_"+trigName;
std::cout << " NameH: " << NameH << std::endl;
ATH_MSG_INFO( " NameH: " << NameH );
auto d0 = Monitored::Scalar<float>(NameH,0.0);
d0 = trk->d0();
ATH_MSG_INFO(" d0: " << d0);
......@@ -205,7 +205,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for(const auto* bjet : *onlinebjet) {
// wMV2c20
std::string NameH = "wMV2c20_"+trigName;
std::cout << " NameH: " << NameH << std::endl;
ATH_MSG_INFO( " NameH: " << NameH );
auto wMV2c20 = Monitored::Scalar<double>(NameH,0.0);
wMV2c20 = bjet->auxdata<double>("MV2c20_discriminant");
ATH_MSG_INFO(" wMV2c20: " << wMV2c20);
......@@ -227,7 +227,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for(const auto* jet : *onlinejet) {
// jetPt
std::string NameH = "jetPt_"+trigName;
std::cout << " NameH: " << NameH << std::endl;
ATH_MSG_INFO( " NameH: " << NameH );
auto jetPt = Monitored::Scalar<float>(NameH,0.0);
jetPt = (jet->pt())*1.e-3;
ATH_MSG_INFO(" jetPt: " << jetPt);
......@@ -260,7 +260,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
for(const auto* jet : *onlinejet) {
// jetPt
std::string NameH = "jetPt_"+trigName;
std::cout << " NameH: " << NameH << std::endl;
ATH_MSG_INFO( " NameH: " << NameH );
auto jetPt = Monitored::Scalar<float>(NameH,0.0);
jetPt = (jet->pt())*1.e-3;
ATH_MSG_INFO(" jetPt: " << jetPt);
......@@ -293,7 +293,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
// jetPt
const xAOD::Jet* jet = *(jetLinkInfo.link);
std::string NameH = "jetPt_"+trigName;
std::cout << " NameH: " << NameH << std::endl;
ATH_MSG_INFO( " NameH: " << NameH );
auto jetPt = Monitored::Scalar<float>(NameH,0.0);
jetPt = (jet->pt())*1.e-3;
ATH_MSG_INFO(" jetPt: " << jetPt);
......@@ -304,7 +304,7 @@ StatusCode TrigBjetMonitorAlgorithm::fillHistograms( const EventContext& ctx ) c
} // else Run3
} else {
std::cout << " Trigger chain from AllChains list: " << trigName << " has not fired " << std::endl;
ATH_MSG_INFO( " Trigger chain from AllChains list: " << trigName << " has not fired " );
} // trigger not fired
......
......@@ -25,10 +25,10 @@ class TrigBjetMonitorAlgorithm : public AthMonitorAlgorithm {
private:
// Gaudi::Property<bool> m_doRandom {this,"RandomHist",false};
Gaudi::Property<bool> m_doRandom {this,"RandomHist",true};
// const std::vector<std::string> m_AllChains;
std::vector<std::string> m_AllChains;
SG::ReadHandleKey<xAOD::MuonContainer> m_MuonContainerKey;
SG::ReadHandleKey<xAOD::VertexContainer> m_VertexContainerKey;
// const std::vector<std::string> m_allChains;
std::vector<std::string> m_allChains;
SG::ReadHandleKey<xAOD::MuonContainer> m_muonContainerKey;
SG::ReadHandleKey<xAOD::VertexContainer> m_vertexContainerKey;
ToolHandle<Trig::TrigDecisionTool> m_trigDec; //!
};
#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