diff --git a/doc/release.notes b/doc/release.notes index b5b80e5f6b320f52995804e119e76b9d990e4e76..5c74f56bfc7b79c5fced7b8757e64292bf21a3b2 100644 --- a/doc/release.notes +++ b/doc/release.notes @@ -3,6 +3,11 @@ ! Responsible : Jessy Daniel, Yuya Shimizu ! Purpose : Script repository for B2OC configurables ----------------------------------------------------------------------------- +=========================== 2023-08-23 B2OCConfig v1r146 ========================= +!2023-08-23 - Federica Borgato +- Added options/MCFiltering/Lb2LcstDs_strip28r2_filtering_DST.py +- Added options/MCFiltering/Lb2LcstDs_strip29r2p1_filtering_DST.py +- Added options/MCFiltering/Lb2LcstDs_strip34r0p1_filtering_DST.py =========================== 2023-05-16 B2OCConfig v1r145 ========================= !2023-05-16 - Linxuan Zhu - Added options/MCFiltering/B2DDhh_strip21_filter.py diff --git a/options/MCFiltering/Lb2LcstDs_strip28r2_filtering_DST.py b/options/MCFiltering/Lb2LcstDs_strip28r2_filtering_DST.py new file mode 100644 index 0000000000000000000000000000000000000000..4ea619b49c822eea0e4e6f7cbe395462c8197e19 --- /dev/null +++ b/options/MCFiltering/Lb2LcstDs_strip28r2_filtering_DST.py @@ -0,0 +1,165 @@ +""" +Stripping filtering for Lb2LcstDs and Lb2LcDs decays +@author Federica Borgato +@date 2023-08-23 +""" + +#stripping version +################################################################## +stripping='stripping28r2' +################################################################## + +#use CommonParticlesArchive +from CommonParticlesArchive import CommonParticlesArchiveConf +CommonParticlesArchiveConf().redirect(stripping) + +from Gaudi.Configuration import * +MessageSvc().Format = "% F%30W%S%7W%R%T %0W%M" + +#Raw event juggler to split Other/RawEvent into Velo/RawEvent and Tracker/RawEvent +# +from Configurables import RawEventJuggler +juggler = RawEventJuggler( DataOnDemand=True, Input=2.0, Output=4.0 ) +# +# Build the streams and stripping object +# +from StrippingConf.Configuration import StrippingConf, StrippingStream +from StrippingSettings.Utils import strippingConfiguration +from StrippingArchive.Utils import buildStreams, cloneLinesFromStream +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) +# Select my lines +#OUTPUT STREAM NAME +################################################################## +AllStreams = StrippingStream("lb2lcstds.Strip") +################################################################## +linesToAdd = [] + +#LIST OF FILTERED LINES +################################################################## +MyLines = [ 'StrippingInclusiveCharmBaryons_LcLine' ] +################################################################## + + +for stream in streams: + if 'BhadronCompleteEvent' in stream.name(): + for line in stream.lines: + line._prescale = 1.0 + if line.name() in MyLines: + linesToAdd.append(line) +AllStreams.appendLines(linesToAdd) + + + +sc = StrippingConf( Streams = [ AllStreams ], + MaxCandidates = 2000, + TESPrefix = 'Strip' + ) + + +AllStreams.sequence().IgnoreFilterPassed = False # so that we do not get all events written out + +# + +# Configuration of SelDSTWriter +# +#STANDARD CONFIGURATION FOR FULL DST OUTPUT +#(change this for the following commented section for mDST output) +################################################################## +enablePacking = True +from DSTWriters.microdstelements import * +from DSTWriters.Configuration import (SelDSTWriter, + stripDSTStreamConf, + stripDSTElements + ) + +SelDSTWriterElements = { + 'default' : stripDSTElements(pack=enablePacking) + } + +SelDSTWriterConf = { + 'default' : stripDSTStreamConf(pack=enablePacking) + } +################################################################## + +''' +#STANDARD CONFIGURATION FOR MDST OUTPUT +################################################################## +enablePacking = True +from DSTWriters.microdstelements import * +from DSTWriters.Configuration import (SelDSTWriter, + stripDSTStreamConf, + stripDSTElements, + stripMicroDSTStreamConf, + stripMicroDSTElements, + stripCalibMicroDSTStreamConf + ) + +SelDSTWriterElements = { + 'default' : stripMicroDSTElements(pack=enablePacking,isMC=True) + } + +SelDSTWriterConf = { + 'default' : stripMicroDSTStreamConf(pack=enablePacking, isMC=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 ='Filtered', + SelectionSequences = sc.activeStreams() + ) + +# Add stripping TCK +from Configurables import StrippingTCK + +#TCK IN THE FOLLOWING FORMAT: DaVinci version (XXrXpX) Stripping version (XXrXpX) (i.e. DaVinci 41r4p5 with Stripping28r1p1 -> TCK:41452811) +#you can find the associated DaVinci version for each stripping in: https://twiki.cern.ch/twiki/bin/view/Main/ProcessingPasses +################################################################## +stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK=0x44105282) +################################################################## + + +# +# DaVinci Configuration +# +from Configurables import DaVinci +DaVinci().Simulation = True +DaVinci().EvtMax = -1 # Number of events +DaVinci().HistogramFile = "DVHistos.root" +DaVinci().appendToMainSequence( [ sc.sequence() ] ) +DaVinci().appendToMainSequence( [ stck ] ) +DaVinci().appendToMainSequence( [ dstWriter.sequence() ] ) +DaVinci().ProductionType = "Stripping" + +# Change the column size of Timing table +from Configurables import TimingAuditor, SequencerTimerTool +TimingAuditor().addTool(SequencerTimerTool,name="TIMER") +TimingAuditor().TIMER.NameSize = 60 + + +#Testing on local data +################################################################## +# from GaudiConf import IOHelper +# DaVinci().DataType = '2016' +# IOHelper().inputFiles([ +# ], clear=True) +################################################################## + + diff --git a/options/MCFiltering/Lb2LcstDs_strip29r2p1_filtering_DST.py b/options/MCFiltering/Lb2LcstDs_strip29r2p1_filtering_DST.py new file mode 100644 index 0000000000000000000000000000000000000000..4094c6a20c4c6674ff262e882a2f9075ff38f6b4 --- /dev/null +++ b/options/MCFiltering/Lb2LcstDs_strip29r2p1_filtering_DST.py @@ -0,0 +1,165 @@ +""" +Stripping filtering for Lb2LcstDs and Lb2LcDs decays +@author Federica Borgato +@date 2023-08-23 +""" + +#stripping version +################################################################## +stripping='stripping29r2p1' +################################################################## + +#use CommonParticlesArchive +from CommonParticlesArchive import CommonParticlesArchiveConf +CommonParticlesArchiveConf().redirect(stripping) + +from Gaudi.Configuration import * +MessageSvc().Format = "% F%30W%S%7W%R%T %0W%M" + +#Raw event juggler to split Other/RawEvent into Velo/RawEvent and Tracker/RawEvent +# +from Configurables import RawEventJuggler +juggler = RawEventJuggler( DataOnDemand=True, Input=2.0, Output=4.0 ) +# +# Build the streams and stripping object +# +from StrippingConf.Configuration import StrippingConf, StrippingStream +from StrippingSettings.Utils import strippingConfiguration +from StrippingArchive.Utils import buildStreams, cloneLinesFromStream +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) +# Select my lines +#OUTPUT STREAM NAME +################################################################## +AllStreams = StrippingStream("lb2lcstds.Strip") +################################################################## +linesToAdd = [] + +#LIST OF FILTERED LINES +################################################################## +MyLines = [ 'StrippingInclusiveCharmBaryons_LcLine' ] +################################################################## + + +for stream in streams: + if 'BhadronCompleteEvent' in stream.name(): + for line in stream.lines: + line._prescale = 1.0 + if line.name() in MyLines: + linesToAdd.append(line) +AllStreams.appendLines(linesToAdd) + + + +sc = StrippingConf( Streams = [ AllStreams ], + MaxCandidates = 2000, + TESPrefix = 'Strip' + ) + + +AllStreams.sequence().IgnoreFilterPassed = False # so that we do not get all events written out + +# + +# Configuration of SelDSTWriter +# +#STANDARD CONFIGURATION FOR FULL DST OUTPUT +#(change this for the following commented section for mDST output) +################################################################## +enablePacking = True +from DSTWriters.microdstelements import * +from DSTWriters.Configuration import (SelDSTWriter, + stripDSTStreamConf, + stripDSTElements + ) + +SelDSTWriterElements = { + 'default' : stripDSTElements(pack=enablePacking) + } + +SelDSTWriterConf = { + 'default' : stripDSTStreamConf(pack=enablePacking) + } +################################################################## + +''' +#STANDARD CONFIGURATION FOR MDST OUTPUT +################################################################## +enablePacking = True +from DSTWriters.microdstelements import * +from DSTWriters.Configuration import (SelDSTWriter, + stripDSTStreamConf, + stripDSTElements, + stripMicroDSTStreamConf, + stripMicroDSTElements, + stripCalibMicroDSTStreamConf + ) + +SelDSTWriterElements = { + 'default' : stripMicroDSTElements(pack=enablePacking,isMC=True) + } + +SelDSTWriterConf = { + 'default' : stripMicroDSTStreamConf(pack=enablePacking, isMC=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 ='Filtered', + SelectionSequences = sc.activeStreams() + ) + +# Add stripping TCK +from Configurables import StrippingTCK + +#TCK IN THE FOLLOWING FORMAT: DaVinci version (XXrXpX) Stripping version (XXrXpX) (i.e. DaVinci 41r4p5 with Stripping28r1p1 -> TCK:41452811) +#you can find the associated DaVinci version for each stripping in: https://twiki.cern.ch/twiki/bin/view/Main/ProcessingPasses +################################################################## +stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK=0x42922921) +################################################################## + + +# +# DaVinci Configuration +# +from Configurables import DaVinci +DaVinci().Simulation = True +DaVinci().EvtMax = -1 # Number of events +DaVinci().HistogramFile = "DVHistos.root" +DaVinci().appendToMainSequence( [ sc.sequence() ] ) +DaVinci().appendToMainSequence( [ stck ] ) +DaVinci().appendToMainSequence( [ dstWriter.sequence() ] ) +DaVinci().ProductionType = "Stripping" + +# Change the column size of Timing table +from Configurables import TimingAuditor, SequencerTimerTool +TimingAuditor().addTool(SequencerTimerTool,name="TIMER") +TimingAuditor().TIMER.NameSize = 60 + + +#Testing on local data +################################################################## +# from GaudiConf import IOHelper +# DaVinci().DataType = '2017' +# IOHelper().inputFiles([ +# ], clear=True) +################################################################## + + diff --git a/options/MCFiltering/Lb2LcstDs_strip34r0p1_filtering_DST.py b/options/MCFiltering/Lb2LcstDs_strip34r0p1_filtering_DST.py new file mode 100644 index 0000000000000000000000000000000000000000..f6368d1bff61cad85329afe53d41edff27c3748a --- /dev/null +++ b/options/MCFiltering/Lb2LcstDs_strip34r0p1_filtering_DST.py @@ -0,0 +1,165 @@ +""" +Stripping filtering for Lb2LcstDs and Lb2LcDs decays +@author Federica Borgato +@date 2023-08-23 +""" + +#stripping version +################################################################## +stripping='stripping34r0p1' +################################################################## + +#use CommonParticlesArchive +from CommonParticlesArchive import CommonParticlesArchiveConf +CommonParticlesArchiveConf().redirect(stripping) + +from Gaudi.Configuration import * +MessageSvc().Format = "% F%30W%S%7W%R%T %0W%M" + +#Raw event juggler to split Other/RawEvent into Velo/RawEvent and Tracker/RawEvent +# +from Configurables import RawEventJuggler +juggler = RawEventJuggler( DataOnDemand=True, Input=2.0, Output=4.0 ) +# +# Build the streams and stripping object +# +from StrippingConf.Configuration import StrippingConf, StrippingStream +from StrippingSettings.Utils import strippingConfiguration +from StrippingArchive.Utils import buildStreams, cloneLinesFromStream +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) +# Select my lines +#OUTPUT STREAM NAME +################################################################## +AllStreams = StrippingStream("lb2lcstds.Strip") +################################################################## +linesToAdd = [] + +#LIST OF FILTERED LINES +################################################################## +MyLines = [ 'StrippingInclusiveCharmBaryons_LcLine' ] +################################################################## + + +for stream in streams: + if 'BhadronCompleteEvent' in stream.name(): + for line in stream.lines: + line._prescale = 1.0 + if line.name() in MyLines: + linesToAdd.append(line) +AllStreams.appendLines(linesToAdd) + + + +sc = StrippingConf( Streams = [ AllStreams ], + MaxCandidates = 2000, + TESPrefix = 'Strip' + ) + + +AllStreams.sequence().IgnoreFilterPassed = False # so that we do not get all events written out + +# + +# Configuration of SelDSTWriter +# +#STANDARD CONFIGURATION FOR FULL DST OUTPUT +#(change this for the following commented section for mDST output) +################################################################## +enablePacking = True +from DSTWriters.microdstelements import * +from DSTWriters.Configuration import (SelDSTWriter, + stripDSTStreamConf, + stripDSTElements + ) + +SelDSTWriterElements = { + 'default' : stripDSTElements(pack=enablePacking) + } + +SelDSTWriterConf = { + 'default' : stripDSTStreamConf(pack=enablePacking) + } +################################################################## + +''' +#STANDARD CONFIGURATION FOR MDST OUTPUT +################################################################## +enablePacking = True +from DSTWriters.microdstelements import * +from DSTWriters.Configuration import (SelDSTWriter, + stripDSTStreamConf, + stripDSTElements, + stripMicroDSTStreamConf, + stripMicroDSTElements, + stripCalibMicroDSTStreamConf + ) + +SelDSTWriterElements = { + 'default' : stripMicroDSTElements(pack=enablePacking,isMC=True) + } + +SelDSTWriterConf = { + 'default' : stripMicroDSTStreamConf(pack=enablePacking, isMC=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 ='Filtered', + SelectionSequences = sc.activeStreams() + ) + +# Add stripping TCK +from Configurables import StrippingTCK + +#TCK IN THE FOLLOWING FORMAT: DaVinci version (XXrXpX) Stripping version (XXrXpX) (i.e. DaVinci 41r4p5 with Stripping28r1p1 -> TCK:41452811) +#you can find the associated DaVinci version for each stripping in: https://twiki.cern.ch/twiki/bin/view/Main/ProcessingPasses +################################################################## +stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK=0x44103401) +################################################################## + + +# +# DaVinci Configuration +# +from Configurables import DaVinci +DaVinci().Simulation = True +DaVinci().EvtMax = -1 # Number of events +DaVinci().HistogramFile = "DVHistos.root" +DaVinci().appendToMainSequence( [ sc.sequence() ] ) +DaVinci().appendToMainSequence( [ stck ] ) +DaVinci().appendToMainSequence( [ dstWriter.sequence() ] ) +DaVinci().ProductionType = "Stripping" + +# Change the column size of Timing table +from Configurables import TimingAuditor, SequencerTimerTool +TimingAuditor().addTool(SequencerTimerTool,name="TIMER") +TimingAuditor().TIMER.NameSize = 60 + + +#Testing on local data +################################################################## +# from GaudiConf import IOHelper +# DaVinci().DataType = '2018' +# IOHelper().inputFiles([ +# ], clear=True) +################################################################## + +