From 167283473868de6b7fe8e3bfc2d3cd712748ced4 Mon Sep 17 00:00:00 2001
From: Lei Hao <hao.lei@cern.ch>
Date: Thu, 23 Jun 2022 13:18:31 +0200
Subject: [PATCH 1/6] Upload Filter_B2OC_bdh_strip24r2_mdst.py for B2Dsth

---
 .../Filter_B2OC_bdh_strip24r2_mdst.py         | 183 ++++++++++++++++++
 1 file changed, 183 insertions(+)
 create mode 100644 options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py

diff --git a/options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py b/options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py
new file mode 100644
index 0000000..d3808e1
--- /dev/null
+++ b/options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py
@@ -0,0 +1,183 @@
+"""
+Stripping filtering file for B^\pm -> D0(*) h^\pm MC
+@date   2017-04-20
+
+Margarete Schellenberg, 13/12/2017
+copy of Filter_B2OC_bdh_strip28.py 
+Stripping version S28 -> S28r1 
+StrippingTCK 0x41432800 --> 0x41442810
+
+Lei Hao, 21/3/2019
+copy of  Filter_B2OC_bdh_strip28.py
+Stripping version s28r1 -> s29r2
+StrippingTCK 0x41442810 --> 0x42722920
+
+Lei Hao, 23/6/2022
+copy of  Filter_B2OC_bdh_strip24r2.py
+Stripping version s29r2 -> s24r2
+StrippingTCK 0x42722920 --> 0x44105242
+
+"""
+
+
+year = 2015
+assert(year in [2015, 2016, 2017])
+
+#stripping version
+#stripping='stripping28r1'
+stripping = {2015: 'stripping24r2', 2016: 'stripping28r2', 2017: 'stripping29r2'}[year]
+
+#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
+AllStreams = StrippingStream("bdsth.Strip")
+linesToAdd = []
+MyLines = [ 'StrippingB2D0PiD2KSHHDDBeauty2CharmLine',
+            'StrippingB2D0PiD2KSHHDDWSBeauty2CharmLine',
+            'StrippingB2D0PiD2KSHHLLBeauty2CharmLine',
+            'StrippingB2D0PiD2KSHHLLWSBeauty2CharmLine',
+            'StrippingB2D0KD2KSHHDDBeauty2CharmLine',
+            'StrippingB2D0KD2KSHHDDWSBeauty2CharmLine',
+            'StrippingB2D0KD2KSHHLLBeauty2CharmLine',
+            'StrippingB2D0KD2KSHHLLWSBeauty2CharmLine',
+            'StrippingB2Dstar0KDst02D0GammaD2KSHHDDBeauty2CharmLine',
+            'StrippingB2Dstar0KDst02D0GammaD2KSHHDDWSBeauty2CharmLine',
+            'StrippingB2Dstar0KDst02D0GammaD2KSHHLLBeauty2CharmLine',
+            'StrippingB2Dstar0KDst02D0GammaD2KSHHLLWSBeautyCharmLine',
+            'StrippingB2Dstar0KDst02D0Pi0D2KSHHDDBeauty2CharmLine',
+            'StrippingB2Dstar0KDst02D0Pi0D2KSHHDDWSBeauty2CharmLine',
+            'StrippingB2Dstar0KDst02D0Pi0D2KSHHLLBeauty2CharmLine',
+            'StrippingB2Dstar0KDst02D0Pi0D2KSHHLLWSBeauty2CharmLine',
+            'StrippingB2Dstar0PiDst02D0GammaD2KSHHDDBeauty2CharmLine',
+            'StrippingB2Dstar0PiDst02D0GammaD2KSHHDDWSBeauty2CharmLine',
+            'StrippingB2Dstar0PiDst02D0GammaD2KSHHLLBeauty2CharmLine',
+            'StrippingB2Dstar0PiDst02D0GammaD2KSHHLLWSBeautyCharmLine',
+            'StrippingB2Dstar0PiDst02D0Pi0D2KSHHDDBeauty2CharmLine',
+            'StrippingB2Dstar0PiDst02D0Pi0D2KSHHDDWSBeauty2CharmLine',
+            'StrippingB2Dstar0PiDst02D0Pi0D2KSHHLLBeauty2CharmLine',
+            'StrippingB2Dstar0PiDst02D0Pi0D2KSHHLLWSBeauty2CharmLine'
+          ]
+
+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
+#
+###For DST
+'''
+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 ='000000',
+                          SelectionSequences = sc.activeStreams()
+                          )
+
+# Add stripping TCK 
+from Configurables import StrippingTCK
+#davinci 44r10p5
+stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK = {2015: 0x44105242, 2016: 0x44105282, 2017: 0x4272292}[2017])
+
+#
+# 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"
+DaVinci().DataType = "2015"
+
+# Change the column size of Timing table
+from Configurables import TimingAuditor, SequencerTimerTool
+TimingAuditor().addTool(SequencerTimerTool,name="TIMER")
+TimingAuditor().TIMER.NameSize = 60
+
+
+
-- 
GitLab


From 56d9e22549d393e0d39f853b7c73ddacb85f9d07 Mon Sep 17 00:00:00 2001
From: Lei Hao <hao.lei@cern.ch>
Date: Thu, 23 Jun 2022 13:25:15 +0200
Subject: [PATCH 2/6] Update release.notes

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

diff --git a/doc/release.notes b/doc/release.notes
index c3d0ae2..8300b05 100644
--- a/doc/release.notes
+++ b/doc/release.notes
@@ -4,6 +4,9 @@
 ! Purpose     : Script repository for B2OC configurables
 -----------------------------------------------------------------------------
 =========================== 2022-03-25 B2OCConfig v1r138 =========================
+!2022-06-23 - Lei Hao
+- Added options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py
+=========================== 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
-- 
GitLab


From f23b959e442447747d6431a2e95e49848c52b391 Mon Sep 17 00:00:00 2001
From: Lei Hao <hao.lei@cern.ch>
Date: Thu, 23 Jun 2022 13:25:37 +0200
Subject: [PATCH 3/6] Update release.notes

---
 doc/release.notes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/release.notes b/doc/release.notes
index 8300b05..fb1e098 100644
--- a/doc/release.notes
+++ b/doc/release.notes
@@ -3,7 +3,7 @@
 ! Responsible : Jessy Daniel, Yuya Shimizu
 ! Purpose     : Script repository for B2OC configurables
 -----------------------------------------------------------------------------
-=========================== 2022-03-25 B2OCConfig v1r138 =========================
+=========================== 2022-03-25 B2OCConfig v1r139 =========================
 !2022-06-23 - Lei Hao
 - Added options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py
 =========================== 2022-03-25 B2OCConfig v1r138 =========================
-- 
GitLab


From 530c7c3d3247f18c21580408aa9f7c308090557f Mon Sep 17 00:00:00 2001
From: Lei Hao <hao.lei@cern.ch>
Date: Thu, 23 Jun 2022 13:25:57 +0200
Subject: [PATCH 4/6] Update release.notes

---
 doc/release.notes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/release.notes b/doc/release.notes
index fb1e098..0869042 100644
--- a/doc/release.notes
+++ b/doc/release.notes
@@ -3,7 +3,7 @@
 ! Responsible : Jessy Daniel, Yuya Shimizu
 ! Purpose     : Script repository for B2OC configurables
 -----------------------------------------------------------------------------
-=========================== 2022-03-25 B2OCConfig v1r139 =========================
+=========================== 2022-06-23 B2OCConfig v1r139 =========================
 !2022-06-23 - Lei Hao
 - Added options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py
 =========================== 2022-03-25 B2OCConfig v1r138 =========================
-- 
GitLab


From 5b3842c43ce64e5fe5f63ff60afc13fb8e589efc Mon Sep 17 00:00:00 2001
From: Lei Hao <hao.lei@cern.ch>
Date: Thu, 23 Jun 2022 13:26:16 +0200
Subject: [PATCH 5/6] Update release.notes

---
 doc/release.notes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/doc/release.notes b/doc/release.notes
index 0869042..b316c79 100644
--- a/doc/release.notes
+++ b/doc/release.notes
@@ -1,5 +1,5 @@
 !-----------------------------------------------------------------------------
-! Package     : B2OCConfig/v1r138
+! Package     : B2OCConfig/v1r139
 ! Responsible : Jessy Daniel, Yuya Shimizu
 ! Purpose     : Script repository for B2OC configurables
 -----------------------------------------------------------------------------
-- 
GitLab


From 8cc45a1ab1c4415ad8af71f1ddcc5c8022934e60 Mon Sep 17 00:00:00 2001
From: Lei Hao <hao.lei@cern.ch>
Date: Thu, 23 Jun 2022 13:38:10 +0200
Subject: [PATCH 6/6] Update Filter_B2OC_bdh_strip24r2_mdst.py

---
 options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py b/options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py
index d3808e1..f3ed126 100644
--- a/options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py
+++ b/options/MCFiltering/Filter_B2OC_bdh_strip24r2_mdst.py
@@ -159,7 +159,7 @@ dstWriter = SelDSTWriter( "MyDSTWriter",
 # Add stripping TCK 
 from Configurables import StrippingTCK
 #davinci 44r10p5
-stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK = {2015: 0x44105242, 2016: 0x44105282, 2017: 0x4272292}[2017])
+stck = StrippingTCK(HDRLocation = '/Event/Strip/Phys/DecReports', TCK = {2015: 0x44105242, 2016: 0x44105282, 2017: 0x4272292}[2015])
 
 #
 # DaVinci Configuration
-- 
GitLab