From 8975db44398d8a3fba6c5d8d6c89bda6e6fe636f Mon Sep 17 00:00:00 2001
From: Yang-Jie Su <yangjie@cern.ch>
Date: Thu, 24 Mar 2022 15:21:41 +0800
Subject: [PATCH 1/4] initial commit

---
 .../Lb2LcPi_strip28r2_filtering_mDST.py       | 140 ++++++++++++++++++
 .../Lb2LcPi_strip29r2_filtering_mDST.py       | 140 ++++++++++++++++++
 .../Lb2LcPi_strip34_filtering_mDST.py         | 140 ++++++++++++++++++
 3 files changed, 420 insertions(+)
 create mode 100644 options/MCFiltering/Lb2LcPi_strip28r2_filtering_mDST.py
 create mode 100644 options/MCFiltering/Lb2LcPi_strip29r2_filtering_mDST.py
 create mode 100644 options/MCFiltering/Lb2LcPi_strip34_filtering_mDST.py

diff --git a/options/MCFiltering/Lb2LcPi_strip28r2_filtering_mDST.py b/options/MCFiltering/Lb2LcPi_strip28r2_filtering_mDST.py
new file mode 100644
index 0000000..35d8c67
--- /dev/null
+++ b/options/MCFiltering/Lb2LcPi_strip28r2_filtering_mDST.py
@@ -0,0 +1,140 @@
+"""
+Stripping filtering for Lb -> Lc Pi, Lc -> p K pi PHSP
+@author Yang-Jie Su
+@date   2022-03-07
+"""
+##################################################################
+# ONLY THESE SECTIONS NEED TO BE MODIFIED FOR STANDARD FILTERING
+##################################################################
+
+#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("Lb2LcPi.Strip")
+##################################################################
+linesToAdd = []
+
+#LIST OF FILTERED LINES
+##################################################################
+MyLines = [ 
+'StrippingLb2LcPiNoIPLc2PKPiBeauty2CharmLine',
+'StrippingLb2LcPiLc2PKPiBeauty2CharmLine',
+            ]
+##################################################################
+
+ 
+for stream in streams:
+    if 'Bhadron' 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 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=0x44a52820)
+##################################################################
+
+#
+# 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
+
diff --git a/options/MCFiltering/Lb2LcPi_strip29r2_filtering_mDST.py b/options/MCFiltering/Lb2LcPi_strip29r2_filtering_mDST.py
new file mode 100644
index 0000000..fdf5144
--- /dev/null
+++ b/options/MCFiltering/Lb2LcPi_strip29r2_filtering_mDST.py
@@ -0,0 +1,140 @@
+"""
+Stripping filtering for Lb -> Lc Pi, Lc -> p K pi PHSP
+@author Yang-Jie Su
+@date   2022-03-07
+"""
+##################################################################
+# ONLY THESE SECTIONS NEED TO BE MODIFIED FOR STANDARD FILTERING
+##################################################################
+
+#stripping version
+##################################################################
+stripping='stripping29r2'
+##################################################################
+
+#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("Lb2LcPi.Strip")
+##################################################################
+linesToAdd = []
+
+#LIST OF FILTERED LINES
+##################################################################
+MyLines = [ 
+'StrippingLb2LcPiNoIPLc2PKPiBeauty2CharmLine',
+'StrippingLb2LcPiLc2PKPiBeauty2CharmLine',
+            ]
+##################################################################
+
+ 
+for stream in streams:
+    if 'Bhadron' 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 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=0x42722920)
+##################################################################
+
+#
+# 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
+
diff --git a/options/MCFiltering/Lb2LcPi_strip34_filtering_mDST.py b/options/MCFiltering/Lb2LcPi_strip34_filtering_mDST.py
new file mode 100644
index 0000000..224ca93
--- /dev/null
+++ b/options/MCFiltering/Lb2LcPi_strip34_filtering_mDST.py
@@ -0,0 +1,140 @@
+"""
+Stripping filtering for Lb -> Lc Pi, Lc -> p K pi PHSP
+@author Yang-Jie Su
+@date   2022-03-07
+"""
+##################################################################
+# ONLY THESE SECTIONS NEED TO BE MODIFIED FOR STANDARD FILTERING
+##################################################################
+
+#stripping version
+##################################################################
+stripping='stripping34'
+##################################################################
+
+#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("Lb2LcPi.Strip")
+##################################################################
+linesToAdd = []
+
+#LIST OF FILTERED LINES
+##################################################################
+MyLines = [ 
+'StrippingLb2LcPiNoIPLc2PKPiBeauty2CharmLine',
+'StrippingLb2LcPiLc2PKPiBeauty2CharmLine',
+            ]
+##################################################################
+
+ 
+for stream in streams:
+    if 'Bhadron' 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 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=0x44403400)
+##################################################################
+
+#
+# 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
+
-- 
GitLab


From 34d2f0d7acd97e06d8feb9b5925fa8b4ac9fba72 Mon Sep 17 00:00:00 2001
From: Yang-Jie Su <yangjie@cern.ch>
Date: Fri, 25 Mar 2022 15:14:03 +0800
Subject: [PATCH 2/4] update release.notes

---
 doc/release.notes | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/doc/release.notes b/doc/release.notes
index 5daefb3..c06f84f 100644
--- a/doc/release.notes
+++ b/doc/release.notes
@@ -3,6 +3,11 @@
 ! Responsible : Louis Gerken, Yuya Shimizu
 ! Purpose     : Script repository for B2OC configurables
 -----------------------------------------------------------------------------
+=========================== 2022-03-25 B2OCConfig v1r138 =========================
+!2022-03-25 - Yang-Jie Su
+- Added options/MCFiltering/Lb2LcPi_strip28r2_filtering_mDST.py
+- Added options/MCFiltering/Lb2LcPi_strip29r2_filtering_mDST.py
+- Added options/MCFiltering/Lb2LcPi_strip34_filtering_mDST.py
 =========================== 2022-01-10 B2OCConfig v1r137 =========================
 !2022-01-10 - Xiaokang Zhou
 - Modified options/MCFiltering/Bs2D0phi_Strip21r1_Filtering_mDST.py 
-- 
GitLab


From 8d2ede6f9811f2b7a2fe05d00868f98b7c1844a6 Mon Sep 17 00:00:00 2001
From: Yuya Shimizu <yuya.shimizu@cern.ch>
Date: Mon, 25 Apr 2022 10:09:14 +0200
Subject: [PATCH 3/4] Update release.notes

---
 doc/release.notes | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/doc/release.notes b/doc/release.notes
index c06f84f..c3d0ae2 100644
--- a/doc/release.notes
+++ b/doc/release.notes
@@ -1,6 +1,6 @@
 !-----------------------------------------------------------------------------
-! Package     : B2OCConfig/v1r137
-! Responsible : Louis Gerken, Yuya Shimizu
+! Package     : B2OCConfig/v1r138
+! Responsible : Jessy Daniel, Yuya Shimizu
 ! Purpose     : Script repository for B2OC configurables
 -----------------------------------------------------------------------------
 =========================== 2022-03-25 B2OCConfig v1r138 =========================
-- 
GitLab


From e8429a15321b2c41ea43f4aebcd48f11326ba931 Mon Sep 17 00:00:00 2001
From: Yuya Shimizu <yuya.shimizu@cern.ch>
Date: Mon, 25 Apr 2022 10:09:47 +0200
Subject: [PATCH 4/4] Update requirements

---
 cmt/requirements | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/cmt/requirements b/cmt/requirements
index 1565025..4ad55c1 100644
--- a/cmt/requirements
+++ b/cmt/requirements
@@ -1,9 +1,9 @@
 #============================================================================
 # Created    : 2012-11-27
-# Maintainer : Louis Gerken, Yuya Shimizu
+# Maintainer : Jessy Daniel, Yuya Shimizu
 #============================================================================
 package           B2OCConfig
-version           v1r137
+version           v1r138
 
 branches	  cmt doc options python scripts
 include_path 	  none
-- 
GitLab