From c8b45c9393984592c7ed3964998fe78f2de757b7 Mon Sep 17 00:00:00 2001
From: Carlos Vazquez Sierra <carlos.vazquez@cern.ch>
Date: Thu, 21 Jun 2018 15:14:31 +0200
Subject: [PATCH] Preparing StrippingCache tests - first attempt

---
 Phys/StrippingCache/CMakeLists.txt            |   4 +-
 .../options/DV-Stripping32-Stripping.py       | 120 ++++++++++++++++++
 .../options/DV-Stripping33-Stripping.py       | 119 +++++++++++++++++
 3 files changed, 241 insertions(+), 2 deletions(-)
 create mode 100644 Phys/StrippingCache/options/DV-Stripping32-Stripping.py
 create mode 100644 Phys/StrippingCache/options/DV-Stripping33-Stripping.py

diff --git a/Phys/StrippingCache/CMakeLists.txt b/Phys/StrippingCache/CMakeLists.txt
index 067527417..2b8341b30 100644
--- a/Phys/StrippingCache/CMakeLists.txt
+++ b/Phys/StrippingCache/CMakeLists.txt
@@ -17,7 +17,7 @@ gaudi_depends_on_subdirs(Phys/DaVinci
                          Phys/IsolationTools
                          Phys/RelatedInfoTools)
 
-set(extraopts_29r2
+set(extraopts_32
     ${AppConfig_DIR}/options/DaVinci/DataType-2017.py
     )
 
@@ -47,7 +47,7 @@ if ( NOT "$ENV{CMTCONFIG}" STREQUAL "x86_64-slc6-gcc48-do0" )
  set ( conf_deps ${deps} MergedConfDB )
 
  # Build the cache only for the most recent stripping.
- foreach(strip 29r2)
+ foreach(strip 32)
  
   # Stripping cache name
   set ( sname S${strip}FunctorCache )
diff --git a/Phys/StrippingCache/options/DV-Stripping32-Stripping.py b/Phys/StrippingCache/options/DV-Stripping32-Stripping.py
new file mode 100644
index 000000000..9c887520d
--- /dev/null
+++ b/Phys/StrippingCache/options/DV-Stripping32-Stripping.py
@@ -0,0 +1,120 @@
+"""
+Options for building Stripping32. 
+"""
+
+stripping='stripping32'
+
+#use CommonParticlesArchive
+from CommonParticlesArchive import CommonParticlesArchiveConf
+CommonParticlesArchiveConf().redirect(stripping)
+
+
+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
+
+#
+# Fix for TrackEff lines
+#
+from Configurables import DecodeRawEvent
+DecodeRawEvent().setProp("OverrideInputs",4.2)
+
+#
+# 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)
+	
+charmMicroDSTname      = 'Charm'
+mdstStreams = [ charmMicroDSTname ]
+dstStreams  = [ "EW", "Semileptonic"]
+
+stripTESPrefix = 'Strip'
+
+from Configurables import ProcStatusCheck
+
+# Fix for removal of default constructor for AALLSAMEBPV after DV v41r3.
+# Thi has been fixed from S28 onwards.
+#from Gaudi.Configuration import allConfigurables
+#for conf in allConfigurables.values() :
+#    if hasattr(conf, 'CombinationCut') and 'AALLSAMEBPV' in conf.CombinationCut :
+#        conf.CombinationCut = conf.CombinationCut.replace('AALLSAMEBPV', 'AALLSAMEBPV(-1, -1, -1)')
+
+sc = StrippingConf( Streams = streams,
+                    MaxCandidates = 2000,
+                    MaxCombinations = 10000000,
+                    AcceptBadEvents = False,
+                    BadEventSelection = ProcStatusCheck(),
+                    TESPrefix = stripTESPrefix,
+                    ActiveMDSTStream = True,
+                    Verbose = True,
+                    DSTStreams = dstStreams,
+                    MicroDSTStreams = mdstStreams )
+
+from Configurables import ApplicationMgr, AuditorSvc, SequencerTimerTool
+	
+# Initial IOV time
+# http://www.onlineconversion.com/unix_time.htm
+# values in ns (so multiply values from above link by 1e9)
+#from Configurables import EventClockSvc
+#EventClockSvc().EventTimeDecoder = "OdinTimeDecoder"
+
+appMgr = ApplicationMgr()
+appMgr.OutputLevel = 6
+appMgr.ExtSvc += [ 'ToolSvc', 'AuditorSvc' ]
+
+appMgr.HistogramPersistency = "ROOT"
+ntSvc = NTupleSvc()
+appMgr.ExtSvc += [ ntSvc ]
+
+from Configurables import ( LHCbApp, PhysConf, AnalysisConf,
+                            DstConf, LumiAlgsConf, DDDBConf )
+
+LHCbApp().DDDBtag   = "dddb-20150724"
+LHCbApp().CondDBtag = "cond-20170724"
+
+# Can be enabled for next full stack release
+PhysConf().OutputLevel     = appMgr.OutputLevel
+#AnalysisConf().OutputLevel = appMgr.OutputLevel
+
+datatype =  "2017"
+PhysConf().DataType      = datatype
+AnalysisConf().DataType  = datatype
+LumiAlgsConf().DataType  = datatype
+DDDBConf().DataType      = datatype
+
+inputType = "RDST"
+LumiAlgsConf().InputType = inputType
+PhysConf().InputType     = inputType
+
+unPack = ["Reconstruction"]
+PhysConf().EnableUnpack = unPack
+DstConf().EnableUnpack  = unPack
+
+lumiSeq = GaudiSequencer("LumiSeq")
+LumiAlgsConf().LumiSequencer = lumiSeq
+
+appMgr.TopAlg += [ PhysConf().initSequence(),
+                   AnalysisConf().initSequence(),
+                   sc.sequence(), lumiSeq ]
+
+#from Configurables import DaVinci
+#DaVinci().ProductionType = "Stripping"
+#DaVinci().DataType   = datatype
+#DaVinci().DDDBtag    = LHCbApp().DDDBtag
+#DaVinci().CondDBtag  = LHCbApp().CondDBtag
+#DaVinci().appendToMainSequence( [ sc.sequence() ] )
diff --git a/Phys/StrippingCache/options/DV-Stripping33-Stripping.py b/Phys/StrippingCache/options/DV-Stripping33-Stripping.py
new file mode 100644
index 000000000..8e4736c58
--- /dev/null
+++ b/Phys/StrippingCache/options/DV-Stripping33-Stripping.py
@@ -0,0 +1,119 @@
+"""
+Options for building Stripping33. 
+"""
+
+stripping='stripping33'
+
+#use CommonParticlesArchive
+from CommonParticlesArchive import CommonParticlesArchiveConf
+CommonParticlesArchiveConf().redirect(stripping)
+
+
+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
+
+#
+# Fix for TrackEff lines
+#
+from Configurables import DecodeRawEvent
+DecodeRawEvent().setProp("OverrideInputs",4.2)
+
+#
+# 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)
+	
+mdstStreams = []
+dstStreams  = [ "IFT" ]
+
+stripTESPrefix = 'Strip'
+
+from Configurables import ProcStatusCheck
+
+# Fix for removal of default constructor for AALLSAMEBPV after DV v41r3.
+# Thi has been fixed from S28 onwards.
+#from Gaudi.Configuration import allConfigurables
+#for conf in allConfigurables.values() :
+#    if hasattr(conf, 'CombinationCut') and 'AALLSAMEBPV' in conf.CombinationCut :
+#        conf.CombinationCut = conf.CombinationCut.replace('AALLSAMEBPV', 'AALLSAMEBPV(-1, -1, -1)')
+
+sc = StrippingConf( Streams = streams,
+                    MaxCandidates = 2000,
+                    MaxCombinations = 10000000,
+                    AcceptBadEvents = False,
+                    BadEventSelection = ProcStatusCheck(),
+                    TESPrefix = stripTESPrefix,
+                    ActiveMDSTStream = True,
+                    Verbose = True,
+                    DSTStreams = dstStreams,
+                    MicroDSTStreams = mdstStreams )
+
+from Configurables import ApplicationMgr, AuditorSvc, SequencerTimerTool
+	
+# Initial IOV time
+# http://www.onlineconversion.com/unix_time.htm
+# values in ns (so multiply values from above link by 1e9)
+#from Configurables import EventClockSvc
+#EventClockSvc().EventTimeDecoder = "OdinTimeDecoder"
+
+appMgr = ApplicationMgr()
+appMgr.OutputLevel = 6
+appMgr.ExtSvc += [ 'ToolSvc', 'AuditorSvc' ]
+
+appMgr.HistogramPersistency = "ROOT"
+ntSvc = NTupleSvc()
+appMgr.ExtSvc += [ ntSvc ]
+
+from Configurables import ( LHCbApp, PhysConf, AnalysisConf,
+                            DstConf, LumiAlgsConf, DDDBConf )
+
+LHCbApp().DDDBtag   = "dddb-20150724"
+LHCbApp().CondDBtag = "cond-20170724"
+
+# Can be enabled for next full stack release
+PhysConf().OutputLevel     = appMgr.OutputLevel
+#AnalysisConf().OutputLevel = appMgr.OutputLevel
+
+datatype =  "2017"
+PhysConf().DataType      = datatype
+AnalysisConf().DataType  = datatype
+LumiAlgsConf().DataType  = datatype
+DDDBConf().DataType      = datatype
+
+inputType = "RDST"
+LumiAlgsConf().InputType = inputType
+PhysConf().InputType     = inputType
+
+unPack = ["Reconstruction"]
+PhysConf().EnableUnpack = unPack
+DstConf().EnableUnpack  = unPack
+
+lumiSeq = GaudiSequencer("LumiSeq")
+LumiAlgsConf().LumiSequencer = lumiSeq
+
+appMgr.TopAlg += [ PhysConf().initSequence(),
+                   AnalysisConf().initSequence(),
+                   sc.sequence(), lumiSeq ]
+
+#from Configurables import DaVinci
+#DaVinci().ProductionType = "Stripping"
+#DaVinci().DataType   = datatype
+#DaVinci().DDDBtag    = LHCbApp().DDDBtag
+#DaVinci().CondDBtag  = LHCbApp().CondDBtag
+#DaVinci().appendToMainSequence( [ sc.sequence() ] )
-- 
GitLab