diff --git a/Phys/StrippingCache/CMakeLists.txt b/Phys/StrippingCache/CMakeLists.txt index 171e5cdc6c9cb2d3ca42bf7cb3796b90720bfe24..f345ac50a05e1361e77310c196b4514e645a4067 100644 --- a/Phys/StrippingCache/CMakeLists.txt +++ b/Phys/StrippingCache/CMakeLists.txt @@ -52,7 +52,7 @@ if ( NOT "$ENV{CMTCONFIG}" STREQUAL "x86_64-slc6-gcc48-do0" ) set ( conf_deps ${deps} DaVinciConfUserDB ) # Build the caches, most recent first - foreach(strip 21r1p1 21r0p1) + foreach(strip 21r1p2 21r0p2 21r1p1 21r0p1) # Stripping cache name set ( sname S${strip}FunctorCache ) @@ -75,6 +75,7 @@ if ( NOT "$ENV{CMTCONFIG}" STREQUAL "x86_64-slc6-gcc48-do0" ) ${optsfile} options/SilenceErrors.py options/DisableLoKiCacheFunctors.py + options/LoKiAddParticleHeader.py LINK_LIBRARIES LoKiArrayFunctorsLib LoKiHltLib DEPENDS ${conf_deps} SPLIT 50) diff --git a/Phys/StrippingCache/options/DV-Stripping21r0p2-Stripping.py b/Phys/StrippingCache/options/DV-Stripping21r0p2-Stripping.py new file mode 100644 index 0000000000000000000000000000000000000000..f1fa97bf7c88399c3e94598f5ed4a956acc776de --- /dev/null +++ b/Phys/StrippingCache/options/DV-Stripping21r0p2-Stripping.py @@ -0,0 +1,168 @@ +############################################################################### +# (c) Copyright 2000-2019 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +""" +Options for building Stripping21r0p2. +""" + +stripping='stripping21r0p2' + +my_wg=['B2OC', 'B2CC', 'BandQ', 'Semileptonic', 'RD', 'Charm', 'QEE', 'BnoC', 'Calib'] + +from CommonParticlesArchive import CommonParticlesArchiveConf +CommonParticlesArchiveConf().redirect(stripping) + +# Tighten Trk Chi2 to <3 +from CommonParticles.Utils import DefaultTrackingCuts +DefaultTrackingCuts().Cuts = { "Chi2Cut" : [ 0, 3 ], + "CloneDistCut" : [5000, 9e+99 ] } + +from Gaudi.Configuration import * +MessageSvc().Format = "% F%30W%S%7W%R%T %0W%M" + +# +# Disable the cache in Tr/TrackExtrapolators +# +from Configurables import TrackStateProvider +TrackStateProvider().CacheStatesOnDemand = False + +from Configurables import GaudiSequencer, RawEventJuggler +jseq=GaudiSequencer("RawEventSplitSeq") +juggler=RawEventJuggler("rdstjuggler") +juggler.Sequencer=jseq +juggler.Input="Reco14" +juggler.Output=4.3 + + +# +# Build the streams and stripping object +# +from StrippingConf.Configuration import StrippingConf, StrippingStream +from StrippingSettings.Utils import strippingConfiguration +from StrippingArchive.Utils import buildStreams +from StrippingArchive import strippingArchive + +#get the configuration dictionary from the database +config = strippingConfiguration(stripping) +#get the line builders from the archive +archive = strippingArchive(stripping) + +streams = buildStreams(stripping = config, archive = archive, WGs = my_wg) + + +leptonicMicroDSTname = 'Leptonic' +charmMicroDSTname = 'Charm' +pidMicroDSTname = 'PID' +bhadronMicroDSTname = 'Bhadron' +mdstStreams = [ leptonicMicroDSTname,charmMicroDSTname,pidMicroDSTname,bhadronMicroDSTname ] +dstStreams = [ "BhadronCompleteEvent", "CharmCompleteEvent", "Dimuon", + "EW", "Semileptonic", "Calibration", "MiniBias", "Radiative" ] + +stripTESPrefix = 'Strip' + +from Configurables import ProcStatusCheck, GaudiSequencer + +from PhysConf.Filters import LoKi_Filters +flts = LoKi_Filters(VOID_Code = "( TrSource(TrSOURCE('/Event/Rec/Track/Best', TrLONG))"\ + " >> ( sum( TrPT,TrP < 1 * TeV ) > 1 * TeV ) )" , + VOID_Preambulo = ["from LoKiTracks.decorators import *" , + "from LoKiCore.functions import * ", + "from GaudiKernel.SystemOfUnits import *"]) +filterBadEvents = GaudiSequencer("BadEventFilter", + ModeOR = True, + Members = [ flts.sequencer("GECFilter"), + ProcStatusCheck() ] ) +streamFilter = { 'default' : filterBadEvents, + 'MiniBias' : ProcStatusCheck() } + + +sc = StrippingConf( Streams = streams, + MaxCandidates = 2000, + AcceptBadEvents = False, + BadEventSelection = streamFilter, + TESPrefix = stripTESPrefix, + ActiveMDSTStream = True, + DSTStreams = dstStreams, + MicroDSTStreams = mdstStreams ) + + +# +# Configure the dst writers for the output +# +enablePacking = True + +from DSTWriters.microdstelements import * +from DSTWriters.Configuration import ( SelDSTWriter, + stripDSTStreamConf, + stripDSTElements, + stripMicroDSTStreamConf, + stripMicroDSTElements, + stripCalibMicroDSTStreamConf) + +# +# Configuration of MicroDST +# per-event an per-line selective writing of the raw event is active (selectiveRawEvent=True) +# +mdstStreamConf = stripMicroDSTStreamConf(pack=enablePacking, selectiveRawEvent=True) +mdstElements = stripMicroDSTElements(pack=enablePacking) + +# +# Configuration of SelDSTWriter +# per-event an per-line selective writing of the raw event is active (selectiveRawEvent=True) +# +SelDSTWriterElements = { + 'default' : stripDSTElements(pack=enablePacking), + charmMicroDSTname : mdstElements, + leptonicMicroDSTname : mdstElements, + pidMicroDSTname : mdstElements, + bhadronMicroDSTname : mdstElements + } + +SelDSTWriterConf = { + 'default' : stripDSTStreamConf(pack=enablePacking, selectiveRawEvent=True), + charmMicroDSTname : mdstStreamConf, + leptonicMicroDSTname : mdstStreamConf, + bhadronMicroDSTname : mdstStreamConf, + pidMicroDSTname : stripCalibMicroDSTStreamConf(pack=enablePacking, selectiveRawEvent=True) + } + +# Items that might get lost when running the CALO+PROTO ReProcessing in DV +caloProtoReprocessLocs = [ "/Event/pRec/ProtoP#99", "/Event/pRec/Calo#99" ] + +# Make sure they are present on full DST streams +SelDSTWriterConf['default'].extraItems += caloProtoReprocessLocs + + +dstWriter = SelDSTWriter( "MyDSTWriter", + StreamConf = SelDSTWriterConf, + MicroDSTElements = SelDSTWriterElements, + OutputFileSuffix ='000000', + SelectionSequences = sc.activeStreams() ) + +# Add stripping TCK +from Configurables import StrippingTCK +stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK=0x39162102) + +# +# DaVinci Configuration +# +#from Configurables import DaVinci +#DaVinci().EvtMax = -1# Number of events +#DaVinci().HistogramFile = "DVHistos.root" +#DaVinci().prependToMainSequence( [jseq] ) +#DaVinci().appendToMainSequence( [ sc.sequence() ] ) +#DaVinci().appendToMainSequence( [ stck ] ) +#DaVinci().appendToMainSequence( [ dstWriter.sequence() ] ) +#DaVinci().ProductionType = "Stripping" + +# Change the column size of Timing table +#from Configurables import AuditorSvc, TimingAuditor, SequencerTimerTool, NameAuditor +#TimingAuditor().addTool(SequencerTimerTool,name="TIMER") +#TimingAuditor().TIMER.NameSize = 60 diff --git a/Phys/StrippingCache/options/DV-Stripping21r1p2-Stripping.py b/Phys/StrippingCache/options/DV-Stripping21r1p2-Stripping.py new file mode 100644 index 0000000000000000000000000000000000000000..cdebef34ee69ab0cb70de998a7321d757e494764 --- /dev/null +++ b/Phys/StrippingCache/options/DV-Stripping21r1p2-Stripping.py @@ -0,0 +1,167 @@ +############################################################################### +# (c) Copyright 2000-2019 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### +""" +Options for building Stripping21r1p2. +""" + +stripping='stripping21r1p2' + +my_wg=['B2OC', 'B2CC', 'BandQ', 'Semileptonic', 'RD', 'Charm', 'QEE', 'BnoC', 'Calib'] + +from CommonParticlesArchive import CommonParticlesArchiveConf +CommonParticlesArchiveConf().redirect(stripping) + +# Tighten Trk Chi2 to <3 +from CommonParticles.Utils import DefaultTrackingCuts +DefaultTrackingCuts().Cuts = { "Chi2Cut" : [ 0, 3 ], + "CloneDistCut" : [5000, 9e+99 ] } + +from Gaudi.Configuration import * +MessageSvc().Format = "% F%30W%S%7W%R%T %0W%M" + +# +# Disable the cache in Tr/TrackExtrapolators +# +from Configurables import TrackStateProvider +TrackStateProvider().CacheStatesOnDemand = False + +from Configurables import GaudiSequencer, RawEventJuggler +jseq=GaudiSequencer("RawEventSplitSeq") +juggler=RawEventJuggler("rdstjuggler") +juggler.Sequencer=jseq +juggler.Input="Reco14" +juggler.Output=4.3 + + +# +# Build the streams and stripping object +# +from StrippingConf.Configuration import StrippingConf, StrippingStream +from StrippingSettings.Utils import strippingConfiguration +from StrippingArchive.Utils import buildStreams +from StrippingArchive import strippingArchive + +#get the configuration dictionary from the database +config = strippingConfiguration(stripping) +#get the line builders from the archive +archive = strippingArchive(stripping) + +streams = buildStreams(stripping = config, archive = archive, WGs = my_wg) + +leptonicMicroDSTname = 'Leptonic' +charmMicroDSTname = 'Charm' +pidMicroDSTname = 'PID' +bhadronMicroDSTname = 'Bhadron' +mdstStreams = [ leptonicMicroDSTname,charmMicroDSTname,pidMicroDSTname,bhadronMicroDSTname ] +dstStreams = [ "BhadronCompleteEvent", "CharmCompleteEvent", "Dimuon", + "EW", "Semileptonic", "Calibration", "MiniBias", "Radiative" ] + +stripTESPrefix = 'Strip' + +from Configurables import ProcStatusCheck, GaudiSequencer + +from PhysConf.Filters import LoKi_Filters +flts = LoKi_Filters(VOID_Code = "( TrSource(TrSOURCE('/Event/Rec/Track/Best', TrLONG))"\ + " >> ( sum( TrPT,TrP < 1 * TeV ) > 1 * TeV ) )" , + VOID_Preambulo = ["from LoKiTracks.decorators import *" , + "from LoKiCore.functions import * ", + "from GaudiKernel.SystemOfUnits import *"]) +filterBadEvents = GaudiSequencer("BadEventFilter", + ModeOR = True, + Members = [ flts.sequencer("GECFilter"), + ProcStatusCheck() ] ) +streamFilter = { 'default' : filterBadEvents, + 'MiniBias' : ProcStatusCheck() } + + +sc = StrippingConf( Streams = streams, + MaxCandidates = 2000, + AcceptBadEvents = False, + BadEventSelection = streamFilter, + TESPrefix = stripTESPrefix, + ActiveMDSTStream = True, + DSTStreams = dstStreams, + MicroDSTStreams = mdstStreams ) + + +# +# Configure the dst writers for the output +# +enablePacking = True + +from DSTWriters.microdstelements import * +from DSTWriters.Configuration import ( SelDSTWriter, + stripDSTStreamConf, + stripDSTElements, + stripMicroDSTStreamConf, + stripMicroDSTElements, + stripCalibMicroDSTStreamConf) + +# +# Configuration of MicroDST +# per-event an per-line selective writing of the raw event is active (selectiveRawEvent=True) +# +mdstStreamConf = stripMicroDSTStreamConf(pack=enablePacking, selectiveRawEvent=True) +mdstElements = stripMicroDSTElements(pack=enablePacking) + +# +# Configuration of SelDSTWriter +# per-event an per-line selective writing of the raw event is active (selectiveRawEvent=True) +# +SelDSTWriterElements = { + 'default' : stripDSTElements(pack=enablePacking), + charmMicroDSTname : mdstElements, + leptonicMicroDSTname : mdstElements, + pidMicroDSTname : mdstElements, + bhadronMicroDSTname : mdstElements + } + +SelDSTWriterConf = { + 'default' : stripDSTStreamConf(pack=enablePacking, selectiveRawEvent=True), + charmMicroDSTname : mdstStreamConf, + leptonicMicroDSTname : mdstStreamConf, + bhadronMicroDSTname : mdstStreamConf, + pidMicroDSTname : stripCalibMicroDSTStreamConf(pack=enablePacking, selectiveRawEvent=True) + } + +# Items that might get lost when running the CALO+PROTO ReProcessing in DV +caloProtoReprocessLocs = [ "/Event/pRec/ProtoP#99", "/Event/pRec/Calo#99" ] + +# Make sure they are present on full DST streams +SelDSTWriterConf['default'].extraItems += caloProtoReprocessLocs + + +dstWriter = SelDSTWriter( "MyDSTWriter", + StreamConf = SelDSTWriterConf, + MicroDSTElements = SelDSTWriterElements, + OutputFileSuffix ='000000', + SelectionSequences = sc.activeStreams() ) + +# Add stripping TCK +from Configurables import StrippingTCK +stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK=0x39162112) + +# +# DaVinci Configuration +# +#from Configurables import DaVinci +#DaVinci().EvtMax = -1# Number of events +#DaVinci().HistogramFile = "DVHistos.root" +#DaVinci().prependToMainSequence( [jseq] ) +#DaVinci().appendToMainSequence( [ sc.sequence() ] ) +#DaVinci().appendToMainSequence( [ stck ] ) +#DaVinci().appendToMainSequence( [ dstWriter.sequence() ] ) +#DaVinci().ProductionType = "Stripping" + +# Change the column size of Timing table +#from Configurables import AuditorSvc, TimingAuditor, SequencerTimerTool, NameAuditor +#TimingAuditor().addTool(SequencerTimerTool,name="TIMER") +#TimingAuditor().TIMER.NameSize = 60 diff --git a/Phys/StrippingCache/options/LoKiAddParticleHeader.py b/Phys/StrippingCache/options/LoKiAddParticleHeader.py new file mode 100644 index 0000000000000000000000000000000000000000..f89afa64cfb246d1a1ee9befba842204f45be198 --- /dev/null +++ b/Phys/StrippingCache/options/LoKiAddParticleHeader.py @@ -0,0 +1,30 @@ +############################################################################### +# (c) Copyright 2000-2019 CERN for the benefit of the LHCb Collaboration # +# # +# This software is distributed under the terms of the GNU General Public # +# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING". # +# # +# In applying this licence, CERN does not waive the privileges and immunities # +# granted to it by virtue of its status as an Intergovernmental Organization # +# or submit itself to any jurisdiction. # +############################################################################### + +#!/usr/bin/env gaudirun.py +### Need to add a header for some of the functors to prevent a crash. +def post_action_for_fix( ): + """ + Post-config action to add a header for Event/Particle. + """ + import Configurables + for obj, name in [('Tool', 'HybridFactory'), ('CoreFactory', 'CoreFactory'), ('HltFactory', 'HltFactory')]: + obj = 'LoKi__Hybrid__%s' % obj + try: + factory = getattr(Configurables, obj) + name = 'ToolSvc.%s' %name + factory(name).CppLines += ['#include "Event/Particle.h"', + '#include "LoKi/ParticleCuts.h"'] + except AttributeError: pass + +from Gaudi.Configuration import appendPostConfigAction +appendPostConfigAction( post_action_for_fix ) +