Commit 442491a2 authored by Benjamin William Allen's avatar Benjamin William Allen Committed by Graeme Stewart
Browse files

Fix L1CALO3 (DerivationFrameworkL1Calo-00-00-22)

parent b52e224d
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// SaturatedTriggerTower.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef DERIVATIONFRAMEWORK_SATURATEDTRIGGERTOWER_H
#define DERIVATIONFRAMEWORK_SATURATEDTRIGGERTOWER_H
#include <string>
#include "AthenaBaseComps/AthAlgTool.h"
#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
namespace DerivationFramework {
class SaturatedTriggerTower : public AthAlgTool, public ISkimmingTool {
public:
SaturatedTriggerTower(const std::string& t, const std::string& n, const IInterface* p);
StatusCode initialize();
StatusCode finalize();
virtual bool eventPassesFilter() const;
private:
int m_adcThreshold;
std::string m_collName;
};
}
#endif // DERIVATIONFRAMEWORK_SATURATEDTRIGGERTOWER_H
package DerivationFrameworkL1Calo
author James Catmore <james.catmore@cern.ch>
author John Morris <john.morris@cern.ch>
author Ben Allen <ballen4@uoregon.edu>
#################################################################
# public use statements
use AtlasPolicy AtlasPolicy-*
use AthenaBaseComps AthenaBaseComps-* Control
use DerivationFrameworkInterfaces DerivationFrameworkInterfaces-* PhysicsAnalysis/DerivationFramework
private
use GaudiInterface GaudiInterface-* External
use AtlasROOT AtlasROOT-* External
use xAODTrigL1Calo xAODTrigL1Calo-* Event/xAOD
################################################################
#
public
## declare the directories CMT should know about
branches python share src
apply_pattern dual_use_library files= " *.cxx "
apply_pattern declare_joboptions files=" *.py"
apply_pattern declare_python_modules files="*.py"
apply_tag ROOTMathLibs
# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
#====================================================================
# L1CALO1.py
# reductionConf flag L1CALO1 in Reco_tf.py
#====================================================================
from DerivationFrameworkCore.DerivationFrameworkMaster import *
#from DerivationFrameworkInDet.InDetCommon import *
#from DerivationFrameworkJetEtMiss.JetCommon import *
#from DerivationFrameworkJetEtMiss.METCommon import *
#from DerivationFrameworkEGamma.EGammaCommon import *
from AthenaCommon.GlobalFlags import globalflags
#====================================================================
# SET UP STREAM
#====================================================================
#streamName = derivationFlags.WriteDAOD_L1CALO1Stream.StreamName
#fileName = buildFileName( derivationFlags.WriteDAOD_L1CALO1Stream )
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDAOD_L1CALO1.StreamName
fileName = buildFileName( primDPD.WriteDAOD_L1CALO1 )
L1CALO1Stream = MSMgr.NewPoolRootStream( streamName, fileName )
L1CALO1Stream.AcceptAlgs(["L1CALO1Kernel"])
from DerivationFrameworkCore.ThinningHelper import ThinningHelper
L1CALO1ThinningHelper = ThinningHelper( "L1CALO1ThinningHelper" )
L1CALO1ThinningHelper.AppendToStream( L1CALO1Stream )
# SPECIAL LINES FOR THINNING
# Thinning service name must match the one passed to the thinning tools
from AthenaServices.Configurables import ThinningSvc, createThinningSvc
augStream = MSMgr.GetStream( streamName )
evtStream = augStream.GetEventStream()
svcMgr += createThinningSvc( svcName="L1CALO1ThinningSvc", outStreams=[evtStream] )
##============================================================================
##
##============================================================================
thinningTools=[]
#=======================================
# THINNING
#=======================================
from TrigT1CaloCalibTools.TrigT1CaloCalibToolsConf import DerivationFramework__TriggerTowerThinningAlg
L1CALO1CaloThinningTool = DerivationFramework__TriggerTowerThinningAlg( name = "L1CaloThinning",
ThinService = L1CALO1ThinningHelper.ThinningSvc(),
TriggerTowerLocation = "xAODTriggerTowers",
MinCaloCellEnergy = 0.8,
MinADC = 36,
UseRandom = True,
MinRandom = 0.01)
ToolSvc += L1CALO1CaloThinningTool
thinningTools.append(L1CALO1CaloThinningTool)
#=======================================
# CREATE THE DERIVATION KERNEL ALGORITHM
#=======================================
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel( "L1CALO1Kernel",
SkimmingTools =[],
ThinningTools = thinningTools,
AugmentationTools = [],
)
#====================================================================
# Add the containers to the output stream - slimming done here
#====================================================================
from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
L1CALO1SlimmingHelper = SlimmingHelper("L1CALO1SlimmingHelper")
##Smart Slimming
L1CALO1SlimmingHelper.SmartCollections = ["Electrons",
"Photons",
"TauJets",
"PrimaryVertices",
"MET_Reference_AntiKt4EMTopo",
"AntiKt4EMTopoJets",
]
L1CALO1SlimmingHelper.AllVariables = ["egammaClusters",
"CaloCalTopoClusters",
"TauPi0Clusters",
"CMXCPHits",
"CMXCPTobs",
"CMXEtSums",
"CMXJetHits",
"CMXJetTobs",
"CMXRoIs",
"CPMTobRoIs",
"CPMTobRoIsRoIB",
"CPMTowers",
"CPMTowersOverlap",
"JEMEtSums",
"JEMTobRoIs",
"JEMTobRoIsRoIB",
"JetElements",
"JetElementsOverlap",
"LVL1EmTauRoIs",
"LVL1EnergySumRoIs",
"LVL1JetEtRoIs",
"LVL1JetRoIs",
"LVL1MuonRoIs",
"RODHeaders",
"xAODTriggerTowers",
"L1TopoRawData",
]
L1CALO1SlimmingHelper.IncludeMuonTriggerContent = True
L1CALO1SlimmingHelper.IncludeEGammaTriggerContent = True
L1CALO1SlimmingHelper.IncludeJetTriggerContent = True
L1CALO1SlimmingHelper.IncludeTauTriggerContent = True
L1CALO1SlimmingHelper.IncludeEtMissTriggerContent = True
L1CALO1SlimmingHelper.IncludeBJetTriggerContent = True
L1CALO1SlimmingHelper.IncludeBPhysTriggerContent = True
L1CALO1SlimmingHelper.IncludeMinBiasTriggerContent = True
L1CALO1SlimmingHelper.AppendContentToStream(L1CALO1Stream)
#====================================================================
# L1CALO2.py
# reductionConf flag L1CALO2 in Reco_tf.py
#====================================================================
from DerivationFrameworkCore.DerivationFrameworkMaster import *
#from DerivationFrameworkInDet.InDetCommon import *
#from DerivationFrameworkJetEtMiss.JetCommon import *
#from DerivationFrameworkJetEtMiss.METCommon import *
#from DerivationFrameworkEGamma.EGammaCommon import *
from AthenaCommon.GlobalFlags import globalflags
expression = "true"
from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool
L1CALO2StringSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "L1CALO2StringSkimmingTool", expression = expression)
ToolSvc += L1CALO2StringSkimmingTool
print "L1CALO2.py L1CALO2StringSkimmingTool: ", L1CALO2StringSkimmingTool
'''
from DerivationFrameworkL1Calo.DerivationFrameworkL1CaloConf import DerivationFramework__SaturatedTriggerTower
L1CALO2SkimmingTool = DerivationFramework__SaturatedTriggerTower( name = "SaturatedTowerTool",
adcThreshold = 900)
ToolSvc += L1CALO2SkimmingTool
'''
#=======================================
# THINNING
#=======================================
thinningTools=[]
augmentationTools=[]
#=======================================
# CREATE THE DERIVATION KERNEL ALGORITHM
#=======================================
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel( "L1CALO2Kernel",
SkimmingTools = [L1CALO2StringSkimmingTool,
# L1CALO2SkimmingTool
],
ThinningTools = thinningTools,
AugmentationTools = augmentationTools)
#====================================================================
# SET UP STREAM
#====================================================================
#streamName = derivationFlags.WriteDAOD_L1CALO2Stream.StreamName
#fileName = buildFileName( derivationFlags.WriteDAOD_L1CALO2Stream )
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDAOD_L1CALO2.StreamName
fileName = buildFileName( primDPD.WriteDAOD_L1CALO2 )
L1CALO2Stream = MSMgr.NewPoolRootStream( streamName, fileName )
L1CALO2Stream.AcceptAlgs(["L1CALO2Kernel"])
# SPECIAL LINES FOR THINNING
# Thinning service name must match the one passed to the thinning tools
from AthenaServices.Configurables import ThinningSvc, createThinningSvc
augStream = MSMgr.GetStream( streamName )
evtStream = augStream.GetEventStream()
svcMgr += createThinningSvc( svcName="L1CALO2ThinningSvc", outStreams=[evtStream] )
#====================================================================
# Add the containers to the output stream - slimming done here
#====================================================================
from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
L1CALO2SlimmingHelper = SlimmingHelper("L1CALO2SlimmingHelper")
##Smart Slimming
L1CALO2SlimmingHelper.SmartCollections = ["Electrons",
"Photons",
"TauJets",
"PrimaryVertices",
"MET_Reference_AntiKt4EMTopo",
"AntiKt4EMTopoJets",
]
L1CALO2SlimmingHelper.AllVariables = ["egammaClusters",
"CaloCalTopoClusters",
"TauPi0Clusters",
"CMXCPHits",
"CMXCPTobs",
"CMXEtSums",
"CMXJetHits",
"CMXJetTobs",
"CMXRoIs",
"CPMTobRoIs",
"CPMTobRoIsRoIB",
"CPMTowers",
"CPMTowersOverlap",
"JEMEtSums",
"JEMTobRoIs",
"JEMTobRoIsRoIB",
"JetElements",
"JetElementsOverlap",
"LVL1EmTauRoIs",
"LVL1EnergySumRoIs",
"LVL1JetEtRoIs",
"LVL1JetRoIs",
"LVL1MuonRoIs",
"RODHeaders",
"xAODTriggerTowers",
"L1TopoRawData",
]
L1CALO2SlimmingHelper.IncludeMuonTriggerContent = True
L1CALO2SlimmingHelper.IncludeEGammaTriggerContent = True
L1CALO2SlimmingHelper.IncludeJetTriggerContent = True
L1CALO2SlimmingHelper.IncludeTauTriggerContent = True
L1CALO2SlimmingHelper.IncludeEtMissTriggerContent = True
L1CALO2SlimmingHelper.IncludeBJetTriggerContent = True
L1CALO2SlimmingHelper.IncludeBPhysTriggerContent = True
L1CALO2SlimmingHelper.IncludeMinBiasTriggerContent = True
L1CALO2SlimmingHelper.AppendContentToStream(L1CALO2Stream)
#====================================================================
# L1CALO3.py
# reductionConf flag L1CALO3 in Reco_tf.py
#====================================================================
from DerivationFrameworkCore.DerivationFrameworkMaster import *
#from DerivationFrameworkInDet.InDetCommon import *
#from DerivationFrameworkJetEtMiss.JetCommon import *
#from DerivationFrameworkJetEtMiss.METCommon import *
#from DerivationFrameworkEGamma.EGammaCommon import *
from AthenaCommon.GlobalFlags import globalflags
expression = "true"
from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool
L1CALO3StringSkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "L1CALO3StringSkimmingTool", expression = expression)
ToolSvc += L1CALO3StringSkimmingTool
print "L1CALO3.py L1CALO3StringSkimmingTool: ", L1CALO3StringSkimmingTool
#=======================================
# THINNING
#=======================================
thinningTools=[]
## Electrons Track Thinning
from DerivationFrameworkInDet.DerivationFrameworkInDetConf import DerivationFramework__EgammaTrackParticleThinning
L1CALO3ElectronTPThinningTool = DerivationFramework__EgammaTrackParticleThinning( name = "L1CALO3ElectronTPThinningTool",
ThinningService = "L1CALO3ThinningSvc",
SGKey = "Electrons",
InDetTrackParticlesKey = "InDetTrackParticles")
ToolSvc += L1CALO3ElectronTPThinningTool
thinningTools.append(L1CALO3ElectronTPThinningTool)
print "L1CALO3.py L1CALO3ElectronTPThinningTool: ", L1CALO3ElectronTPThinningTool
augmentationTools=[]
#=======================================
# CREATE THE DERIVATION KERNEL ALGORITHM
#=======================================
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
DerivationFrameworkJob += CfgMgr.DerivationFramework__DerivationKernel( "L1CALO3Kernel",
SkimmingTools = [L1CALO3StringSkimmingTool],
ThinningTools = thinningTools,
AugmentationTools = augmentationTools)
#====================================================================
# SET UP STREAM
#====================================================================
#streamName = derivationFlags.WriteDAOD_L1CALO3Stream.StreamName
#fileName = buildFileName( derivationFlags.WriteDAOD_L1CALO3Stream )
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDAOD_L1CALO3.StreamName
fileName = buildFileName( primDPD.WriteDAOD_L1CALO3 )
L1CALO3Stream = MSMgr.NewPoolRootStream( streamName, fileName )
L1CALO3Stream.AcceptAlgs(["L1CALO3Kernel"])
# SPECIAL LINES FOR THINNING
# Thinning service name must match the one passed to the thinning tools
from AthenaServices.Configurables import ThinningSvc, createThinningSvc
augStream = MSMgr.GetStream( streamName )
evtStream = augStream.GetEventStream()
svcMgr += createThinningSvc( svcName="L1CALO3ThinningSvc", outStreams=[evtStream] )
#====================================================================
# Add the containers to the output stream - slimming done here
#====================================================================
from DerivationFrameworkCore.SlimmingHelper import SlimmingHelper
L1CALO3SlimmingHelper = SlimmingHelper("L1CALO3SlimmingHelper")
##Smart Slimming
L1CALO3SlimmingHelper.SmartCollections = [
# "Electrons",
# "Photons",
# "TauJets",
# "PrimaryVertices",
# "MET_Reference_AntiKt4EMTopo",
# "AntiKt4EMTopoJets",
]
L1CALO3SlimmingHelper.AllVariables = [
# "egammaClusters",
# "CaloCalTopoClusters",
# "TauPi0Clusters",
# "CMXCPHits",
# "CMXCPTobs",
# "CMXEtSums",
# "CMXJetHits",
# "CMXJetTobs",
# "CMXRoIs",
# "CPMTobRoIs",
# "CPMTobRoIsRoIB",
# "CPMTowers",
# "CPMTowersOverlap",
# "JEMEtSums",
# "JEMTobRoIs",
# "JEMTobRoIsRoIB",
# "JetElements",
# "JetElementsOverlap",
# "LVL1EmTauRoIs",
# "LVL1EnergySumRoI",
# "LVL1JetEtRoI",
# "LVL1JetRoIs",
# "RODHeaders",
# "xAODTriggerTowers",
]
#L1CALO3SlimmingHelper.IncludeMuonTriggerContent = True
#L1CALO3SlimmingHelper.IncludeEGammaTriggerContent = True
#L1CALO3SlimmingHelper.IncludeJetTriggerContent = True
#L1CALO3SlimmingHelper.IncludeTauTriggerContent = True
#L1CALO3SlimmingHelper.IncludeEtMissTriggerContent = True
#L1CALO3SlimmingHelper.IncludeBJetTriggerContent = True
#L1CALO3SlimmingHelper.IncludeBPhysTriggerContent = True
#L1CALO3SlimmingHelper.IncludeMinBiasTriggerContent = True
L1CALO3SlimmingHelper.AppendContentToStream(L1CALO3Stream)
jp.Rec.doMuon.set_Value_and_Lock(False)
jp.Rec.doInDet.set_Value_and_Lock(False)
jp.Rec.doLucid.set_Value_and_Lock(False)
jp.Rec.doZdc.set_Value_and_Lock(False)
jp.Rec.doTagRawSummary.set_Value_and_Lock(False)
import JetRec.JetRecFlags
import tauRec.tauRecFlags
import CaloRec.CaloRecFlags
import RecExConfig.RecAlgsFlags
jp.Rec.doEgamma.set_Value_and_Lock(False)
jp.JetRecFlags.Enabled.set_Value_and_Lock(False)
jp.tauRecFlags.Enabled.set_Value_and_Lock(False)
jp.CaloRecFlags.doCaloCluster.set_Value_and_Lock(False)
jp.Rec.RecAlgs.doEFlow.set_Value_and_Lock(False)
jp.Rec.RecAlgs.doEFlowJet.set_Value_and_Lock(False)
jp.Rec.RecAlgs.doMissingET.set_Value_and_Lock(False)
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/////////////////////////////////////////////////////////////////
// SaturatedTriggerTower.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
// Author: Ben Allen (benjamin.william.allen@cern.ch)
// Adapted heavily from code originally written by
// James Catmore (james.catmore@cern.ch)
//
#include "DerivationFrameworkL1Calo/SaturatedTriggerTower.h"
#include "xAODTrigL1Calo/TriggerTowerContainer.h"
#include <vector>
#include <string>
namespace DerivationFramework {
SaturatedTriggerTower::SaturatedTriggerTower(const std::string& t,
const std::string& n,
const IInterface* p) :
AthAlgTool(t,n,p),
m_adcThreshold(0),
m_collName("xAODTriggerTowers")
{
declareInterface<DerivationFramework::ISkimmingTool>(this);
declareProperty("TriggerTowerContainer",m_collName);
declareProperty("adcThreshold",m_adcThreshold);
}
StatusCode SaturatedTriggerTower::initialize()
{
ATH_MSG_VERBOSE("initialize() ...");
return StatusCode::SUCCESS;
}
StatusCode SaturatedTriggerTower::finalize()
{
return StatusCode::SUCCESS;
}
bool SaturatedTriggerTower::eventPassesFilter() const
{
bool acceptEvent(false);
// check for triggertowers
if (evtStore()->contains<xAOD::TriggerTowerContainer>( m_collName )) {
// Retrieve data
const xAOD::TriggerTowerContainer* triggertowers(nullptr);
CHECK( evtStore()->retrieve( triggertowers , m_collName ) );
if( !triggertowers ) {
ATH_MSG_ERROR("Couldn't retrieve triggertower container with key: " << m_collName);
return StatusCode::FAILURE;
}
// LOOP OVER TRIGGERTOWERS
int adcvalue(0);
for (xAOD::TriggerTowerContainer::const_iterator eIt = triggertowers->begin(); eIt!=triggertowers->end(); ++eIt) {
for(int i=0; i<5; i++){
adcvalue = (*eIt)->adc()[i];
if(adcvalue > m_adcThreshold){
acceptEvent = true;
return acceptEvent;
}
}
}
} // check for trigger towers
return acceptEvent;
}
} // end of namespace
#include "GaudiKernel/DeclareFactoryEntries.h"
#include "DerivationFrameworkL1Calo/SaturatedTriggerTower.h"
#include "xAODTrigL1Calo/L1TopoRawDataContainer.h"
#include "xAODTrigL1Calo/L1TopoRawDataAuxContainer.h"
DECLARE_NAMESPACE_TOOL_FACTORY( DerivationFramework , SaturatedTriggerTower )
DECLARE_FACTORY_ENTRIES( DerivationFrameworkL1Calo ) {
DECLARE_NAMESPACE_TOOL( DerivationFramework , SaturatedTriggerTower )
}
\ No newline at end of file
#include "GaudiKernel/LoadFactoryEntries.h"
LOAD_FACTORY_ENTRIES( DerivationFrameworkL1Calo )
Supports Markdown
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