Skip to content
Snippets Groups Projects
Commit 8a86b312 authored by Hass Abouzeid's avatar Hass Abouzeid Committed by Graeme Stewart
Browse files

fixing compilation issues in rel21 (PrimaryDPDMaker-01-00-18)

2017-01-25 Hass AbouZeid <hass.abouzeid@cern.ch>
	* Fix for rel21 compilation
	* Tagging as PrimaryDPDMaker-01-00-18

2016-12-17 Christian Ohm <christian.ohm@cern.ch>
	* Update of DRAW_TOPSLMU, validated and final for Tier-0 test
	* Tagging as PrimaryDPDMaker-01-00-17

2016-12-10 Christian Ohm <christian.ohm@cern.ch>
	* Update of DRAW_TOPSLMU (not validated yet)

2016-12-10 Christian Ohm <christian.ohm@cern.ch>
	* Fix configurability of DRAW_BCID[1,2]
	* Tagging as PrimaryDPDMaker-01-00-16

2016-12-09 Christian Ohm <christian.ohm@cern.ch>
	* Tagging as PrimaryDPDMaker-01-00-15
2016-12-06 Christian Ohm <christian.ohm@cern.ch>
	* Fix to make the AcceptBCIDs (RejectBCIDs) lists for DRAW_BCID1 (DRAW_BCID2)
	  configurable via preExec
...
(Long ChangeLog diff - truncated)
parent 77a86336
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ atlas_depends_on_subdirs( PUBLIC
Control/AthenaKernel
Control/DataModel
Control/StoreGate
PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces
DetectorDescription/IRegionSelector
DetectorDescription/Identifier
Event/EventKernel
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
///////////////////////////////////////////////////////////////////
// BCIDFilterTool.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef PRIMARYDPDMAKER_BCIDFILTERTOOL_H
#define PRIMARYDPDMAKER_BCIDFILTERTOOL_H
#include<string>
#include <vector>
// Gaudi & Athena basics
#include "AthenaBaseComps/AthAlgTool.h"
// DerivationFramework includes
#include "DerivationFrameworkInterfaces/ISkimmingTool.h"
/** @class BCIDFilterTool
@author Christian Ohm -at- cern.ch
*/
class BCIDFilterTool : public AthAlgTool, public DerivationFramework::ISkimmingTool {
public:
/** Constructor with parameters */
BCIDFilterTool( const std::string& t, const std::string& n, const IInterface* p );
/** Destructor */
~BCIDFilterTool();
// Athena algtool's Hooks
StatusCode initialize();
StatusCode finalize();
/** Check that the current event passes this filter */
virtual bool eventPassesFilter() const;
private:
mutable unsigned int m_ntot;
mutable unsigned int m_npass;
std::vector<int> m_acceptBCIDs;
std::vector<int> m_rejectBCIDs;
};
#endif
......@@ -41,6 +41,8 @@ use TrkTrack TrkTrack-* Tracking/TrkEvent
#Needed for RegSelSvc
use IRegionSelector IRegionSelector-* DetectorDescription
use DerivationFrameworkInterfaces DerivationFrameworkInterfaces-* PhysicsAnalysis/DerivationFramework
private
use NavFourMom NavFourMom-* Event
use AtlasROOT AtlasROOT-* External
......
......@@ -352,6 +352,50 @@ class WriteDRAW_EMU(JobProperty):
jobproperties.PrimaryDPDFlags.add_JobProperty(WriteDRAW_EMU)
listRAWtoDPD.append(WriteDRAW_EMU.StreamName)
class WriteDRAW_BCID1(JobProperty):
""" Produce the BCID-filtered DRAW, based on the AcceptBCIDs list (Byte Stream format)."""
statusOn = True
allowedTypes = ['bool']
StoredValue = False
StreamName = "StreamDRAW_BCID1"
FileName = ""
Prescale = 1
AcceptBCIDs = [11, 1247, 2430]
isVirtual = False
DPDMakerScript = "PrimaryDPDMaker/DRAW_BCID1.py"
pass
jobproperties.PrimaryDPDFlags.add_JobProperty(WriteDRAW_BCID1)
listRAWtoDPD.append(WriteDRAW_BCID1.StreamName)
class WriteDRAW_BCID2(JobProperty):
""" Produce the BCID-filtered DRAW, based on the RejectBCIDs list (Byte Stream format)."""
statusOn = True
allowedTypes = ['bool']
StoredValue = False
StreamName = "StreamDRAW_BCID2"
FileName = ""
Prescale = 1
RejectBCIDs = [11, 1247, 2430]
isVirtual = False
DPDMakerScript = "PrimaryDPDMaker/DRAW_BCID2.py"
pass
jobproperties.PrimaryDPDFlags.add_JobProperty(WriteDRAW_BCID2)
listRAWtoDPD.append(WriteDRAW_BCID2.StreamName)
class WriteDRAW_TOPSLMU(JobProperty):
""" Produce DRAW_TOPSLMU, a top-like single-muon selection for tau embedding used by H+ searches."""
statusOn = True
allowedTypes = ['bool']
StoredValue = False
StreamName = "StreamDRAW_TOPSLMU"
FileName = ""
Prescale = 1
isVirtual = False
DPDMakerScript = "PrimaryDPDMaker/DRAW_TOPSLMU.py"
pass
jobproperties.PrimaryDPDFlags.add_JobProperty(WriteDRAW_TOPSLMU)
listRAWtoDPD.append(WriteDRAW_TOPSLMU.StreamName)
##--------------------------------------------
## Skimmed ESD
##--------------------------------------------
......
####################################################
### Setup:
### sequencer
### derivation framework / event selection
####################################################
# Sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
DRAW_BCID1_Seq = CfgMgr.AthSequencer("DRAW_BCID1_Seq")
from PrimaryDPDMaker.PrimaryDPDMakerConf import BCIDFilterTool
bcidFilterTool = BCIDFilterTool( name = "BCID1Filter",
AcceptBCIDs = jobproperties.PrimaryDPDFlags.WriteDRAW_BCID1.AcceptBCIDs
)
bcidFilterTool.OutputLevel = 3 # INFO
ToolSvc += bcidFilterTool
# Kernel algorithm
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
DRAW_BCID1_Seq += CfgMgr.DerivationFramework__DerivationKernel("DRAW_BCID1Kernel",
SkimmingTools = [bcidFilterTool]
)
topSequence += DRAW_BCID1_Seq
##################
### Output stream
##################
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
from D2PDMaker.D2PDHelpers import buildFileName
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDRAW_BCID1.StreamName
fileName = buildFileName( primDPD.WriteDRAW_BCID1 )
# Remove the .pool.root ending in the file name, this is a RAW file!
if fileName.endswith(".pool.root") :
fileName = fileName.rstrip(".pool.root")
pass
StreamDRAW_BCID1 = MSMgr.NewByteStream( streamName, fileName )
StreamDRAW_BCID1.AddRequireAlgs(["DRAW_BCID1Kernel"])
# Don't write an output RAW file if it is empty
StreamDRAW_BCID1.bsOutputSvc.WriteEventlessFiles = primDPD.WriteEventlessFiles()
#########################################
# Add the containers to the output stream
#########################################
from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput
# Take everything from the input
ExcludeList=[]
dpdOutput.addAllItemsFromInputExceptExcludeList(streamName,ExcludeList)
####################################################
### Setup:
### sequencer
### derivation framework / event selection
####################################################
# Sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
DRAW_BCID2_Seq = CfgMgr.AthSequencer("DRAW_BCID2_Seq")
from PrimaryDPDMaker.PrimaryDPDMakerConf import BCIDFilterTool
bcidFilterTool = BCIDFilterTool( name = "BCID2Filter",
RejectBCIDs = jobproperties.PrimaryDPDFlags.WriteDRAW_BCID2.RejectBCIDs
)
bcidFilterTool.OutputLevel = 3 # INFO
ToolSvc += bcidFilterTool
# Kernel algorithm
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
DRAW_BCID2_Seq += CfgMgr.DerivationFramework__DerivationKernel("DRAW_BCID2Kernel",
SkimmingTools = [bcidFilterTool]
)
topSequence += DRAW_BCID2_Seq
##################
### Output stream
##################
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
from D2PDMaker.D2PDHelpers import buildFileName
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDRAW_BCID2.StreamName
fileName = buildFileName( primDPD.WriteDRAW_BCID2 )
# Remove the .pool.root ending in the file name, this is a RAW file!
if fileName.endswith(".pool.root") :
fileName = fileName.rstrip(".pool.root")
pass
StreamDRAW_BCID2 = MSMgr.NewByteStream( streamName, fileName )
StreamDRAW_BCID2.AddRequireAlgs(["DRAW_BCID2Kernel"])
# Don't write an output RAW file if it is empty
StreamDRAW_BCID2.bsOutputSvc.WriteEventlessFiles = primDPD.WriteEventlessFiles()
#########################################
# Add the containers to the output stream
#########################################
from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput
# Take everything from the input
ExcludeList=[]
dpdOutput.addAllItemsFromInputExceptExcludeList(streamName,ExcludeList)
####################################################
## Name: DRAW_TOPSLMU.py
##
## Author: anna bozena kowalewska
## Email: anna.bozena.kowalewska@cern.ch
##
## Description: This defines the content of the
##ttbar single tight muon DRAW output stream.
####################################################
# Sequence
from AthenaCommon.AlgSequence import AlgSequence
topSequence = AlgSequence()
DRAW_TOPSLMU_Seq = CfgMgr.AthSequencer("DRAW_TOPSLMU_Seq")
##============================================================================
## Define the skimming (event selection) for the DRAW_TOPSLMU output stream
##============================================================================
# Object selection strings
# FixedCutBEff_77 for btag
sel_muon = 'Muons.pt > 30.0*GeV && abs(Muons.eta) < 2.5 && (Muons.quality == 0)'
sel_jet = 'AntiKt4EMTopoJets.pt > 25*GeV && abs(AntiKt4EMTopoJets.eta) < 2.5'
sel_bjet = 'AntiKt4EMTopoJets.pt > 25*GeV && abs(AntiKt4EMTopoJets.eta) < 2.5 && BTagging_AntiKt4EMTopo.MV2c10_discriminant>0.645925'
sel_el = 'Electrons.pt > 20*GeV && ( Electrons.Loose || Electrons.LHLoose ) && abs( Electrons.eta) < 2.47'
#met = 'MET_Reference_AntiKt4EMTopo["FinalClus"].met > 55*GeV'
met = 'MET_Reference_AntiKt4EMTopo["FinalTrk"].met > 45*GeV'
#triggers for periodD3 Run=302872, events=474
muTriggers = ['HLT_mu20_iloose_L1MU15','HLT_mu24_ivarmedium','HLT_mu24_imedium']
# Event selection string:
draw_ttbar = '( count('+sel_muon+')==1 && count('+sel_jet+')>=3 && count('+sel_bjet+')>=1 && count('+sel_el+') == 0 && count('+met+') >=1 ) && (' + " || ".join(muTriggers) + ')'
print "This is the selection string that will be used for DRAW_TOPSLMU:"
print draw_ttbar
# Event selection tool
from DerivationFrameworkTools.DerivationFrameworkToolsConf import DerivationFramework__xAODStringSkimmingTool
DRAW_TOPSLMU_SkimmingTool = DerivationFramework__xAODStringSkimmingTool(name = "DRAW_TOPSLMU_SkimmingTool",
expression = draw_ttbar)
ToolSvc += DRAW_TOPSLMU_SkimmingTool
print "Skimming tool:"
print DRAW_TOPSLMU_SkimmingTool
# Kernel algorithm
from DerivationFrameworkCore.DerivationFrameworkCoreConf import DerivationFramework__DerivationKernel
DRAW_TOPSLMU_Seq += CfgMgr.DerivationFramework__DerivationKernel("DRAW_TOPSLMUKernel",
SkimmingTools = [DRAW_TOPSLMU_SkimmingTool]
)
topSequence += DRAW_TOPSLMU_Seq
##################
### Output stream
##################
from OutputStreamAthenaPool.MultipleStreamManager import MSMgr
from D2PDMaker.D2PDHelpers import buildFileName
from PrimaryDPDMaker.PrimaryDPDFlags import primDPD
streamName = primDPD.WriteDRAW_TOPSLMU.StreamName
fileName = buildFileName( primDPD.WriteDRAW_TOPSLMU )
# Remove the .pool.root ending in the file name, this is a RAW file!
if fileName.endswith(".pool.root") :
fileName = fileName.rstrip(".pool.root")
pass
StreamDRAW_TOPSLMU = MSMgr.NewByteStream( streamName, fileName )
StreamDRAW_TOPSLMU.AddRequireAlgs(["DRAW_TOPSLMUKernel"])
# Don't write an output RAW file if it is empty
StreamDRAW_TOPSLMU.bsOutputSvc.WriteEventlessFiles = primDPD.WriteEventlessFiles()
#########################################
# Add the containers to the output stream
#########################################
from PrimaryDPDMaker import PrimaryDPD_OutputDefinitions as dpdOutput
# Take everything from the input
ExcludeList=[]
dpdOutput.addAllItemsFromInputExceptExcludeList(streamName,ExcludeList)
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
/////////////////////////////////////////////////////////////////
// BCIDFilterTool.cxx, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#include "PrimaryDPDMaker/BCIDFilterTool.h"
#include "xAODEventInfo/EventInfo.h"
#include <string>
// Constructor
BCIDFilterTool::BCIDFilterTool( const std::string& t,
const std::string& n,
const IInterface* p ) :
AthAlgTool(t,n,p),
m_ntot(0),
m_npass(0)
{
declareInterface<DerivationFramework::ISkimmingTool>(this);
declareProperty("AcceptBCIDs", m_acceptBCIDs);
declareProperty("RejectBCIDs", m_rejectBCIDs);
}
// Destructor
BCIDFilterTool::~BCIDFilterTool() {}
// Athena initialize and finalize
StatusCode BCIDFilterTool::initialize()
{
ATH_MSG_VERBOSE("initialize() ...");
if (m_acceptBCIDs.size() && m_rejectBCIDs.size()) {
ATH_MSG_ERROR("Failed to initialize - both accept and reject BCIDs specified, please only use one");
return StatusCode::FAILURE;
}
if (!(m_acceptBCIDs.size() || m_rejectBCIDs.size())) {
ATH_MSG_ERROR("Neither AcceptBCIDs nor RejectBCIDs specified, can't use filter!");
}
if (m_acceptBCIDs.size()) {
ATH_MSG_INFO("Events with the following " << m_acceptBCIDs.size() << " BCIDs will be accepted into the stream");
for (int bcid : m_acceptBCIDs) ATH_MSG_INFO(" " << bcid);
}
if (m_rejectBCIDs.size()) {
ATH_MSG_INFO("Events with the following " << m_rejectBCIDs.size() << " BCIDs will be rejected from the stream");
for (int bcid : m_rejectBCIDs) ATH_MSG_INFO(" " << bcid);
}
return StatusCode::SUCCESS;
}
StatusCode BCIDFilterTool::finalize()
{
ATH_MSG_VERBOSE("finalize() ...");
ATH_MSG_INFO("Processed "<< m_ntot <<" events, "<< m_npass<<" events passed filter ");
return StatusCode::SUCCESS;
}
// The filter itself
bool BCIDFilterTool::eventPassesFilter() const
{
++m_ntot;
const xAOD::EventInfo* ei(0);
ATH_CHECK( evtStore()->retrieve(ei, "EventInfo") );
int bcid = ei->bcid();
if (m_acceptBCIDs.size()) {
for (auto acceptBCID : m_acceptBCIDs) {
if (bcid == acceptBCID) return true;
}
return false;
}
else {
for (auto rejectBCID : m_rejectBCIDs) {
if (bcid == rejectBCID) return false;
}
return true;
}
}
......@@ -4,6 +4,7 @@
#include "PrimaryDPDMaker/ThinContainers.h"
#include "PrimaryDPDMaker/MBTSTimeFilterTool.h"
#include "PrimaryDPDMaker/CaloTimeFilterTool.h"
#include "PrimaryDPDMaker/BCIDFilterTool.h"
#include "PrimaryDPDMaker/CollisionFilterAlg.h"
#include "PrimaryDPDMaker/muonTrkTrackThinTool.h"
......@@ -13,6 +14,7 @@ DECLARE_ALGORITHM_FACTORY( CollisionFilterAlg )
DECLARE_ALGORITHM_FACTORY( muonTrkTrackThinTool )
DECLARE_TOOL_FACTORY( MBTSTimeFilterTool )
DECLARE_TOOL_FACTORY( CaloTimeFilterTool )
DECLARE_TOOL_FACTORY( BCIDFilterTool )
DECLARE_FACTORY_ENTRIES( PrimaryDPDMaker )
{
......@@ -22,4 +24,5 @@ DECLARE_FACTORY_ENTRIES( PrimaryDPDMaker )
DECLARE_ALGORITHM( muonTrkTrackThinTool );
DECLARE_TOOL( MBTSTimeFilterTool );
DECLARE_TOOL( CaloTimeFilterTool );
DECLARE_TOOL( BCIDFilterTool );
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment