From 4dbd9e3fbd7ddcfe3363ea9c816381522b39a9ee Mon Sep 17 00:00:00 2001
From: Nicholas Styles <nicholas.styles@desy.de>
Date: Fri, 27 Feb 2015 08:26:09 +0100
Subject: [PATCH] fix typo (InDetRecExample-02-05-39)

  * Vertex EDM conversion for fast fitting added (ATLASRECTS-1313)
  * Tagged as InDetRecExample-02-05-38 (-39 to fix typo introduced...)

2015-02-25  Nick Styles
  * No PRD-associated pixel tracklets for ITK
  * Tagged as InDetRecExample-02-05-37

2015-02-24  Nick Styles
  * Changing settings for ITK forward tracking, so that they will be added to merged collection, and vertexing will run on them.
  * Fix for re-running pattern from ESD (ATLASRECTS-1696)
  * Tagged as InDetRecExample-02-05-36

2015-02-20 Nick Styles
  * Storegate deletion false for Heavy Ion (ATLASRECTS-1313)
  * Tagged as InDetRecExample-02-05-35

2015-02-18 Nick Styles
  * Loosen Forward track pT cut for ITK
  * Tagged as InDetRecExample-02-05-34

...
(Long ChangeLog diff - truncated)
---
 .../python/ConfiguredNewTrackingCuts.py         |  4 ++--
 .../python/InDetJobProperties.py                |  2 +-
 .../share/ConfiguredPriVtxAndPartCreation.py    |  4 +++-
 .../InDetRecExample/share/InDetRecLoadTools.py  | 17 ++++++++++++++++-
 .../share/InDetRecPreProcessingSilicon.py       |  6 +++++-
 .../share/InDetRec_jobOptions.py                |  8 ++++----
 .../InDetRecExample/share/InDetxAODCreator.py   |  3 ++-
 .../InDetRecExample/share/WriteInDetAOD.py      |  5 +++--
 .../InDetRecExample/share/WriteInDetESD.py      |  5 +++--
 9 files changed, 39 insertions(+), 15 deletions(-)

diff --git a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py
index 3fe29714fd0..cdddc636ff3 100755
--- a/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/ConfiguredNewTrackingCuts.py
@@ -365,7 +365,7 @@ class ConfiguredNewTrackingCuts :
       self.__extension        = "ForwardSLHCTracks" # this runs parallel to NewTracking
       self.__minEta           = 2.4 # restrict to minimal eta
       self.__maxEta           = 3.0
-      self.__minPT            = 2 * Units.GeV
+      self.__minPT            = 0.9 * Units.GeV
       self.__minClusters      = 5
       self.__minSiNotShared   = 3
       self.__maxShared        = 1
@@ -384,7 +384,7 @@ class ConfiguredNewTrackingCuts :
       self.__extension        = "VeryForwardSLHCTracks" # this runs parallel to NewTracking 
       self.__minEta           = 2.4 # restrict to minimal eta 
       self.__maxEta           = 4.0 
-      self.__minPT            = 2 * Units.GeV 
+      self.__minPT            = 0.9 * Units.GeV 
       self.__minClusters      = 5 
       self.__minSiNotShared   = 3 
       self.__maxShared        = 1 
diff --git a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
index db709156897..d0634a76a03 100644
--- a/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
+++ b/InnerDetector/InDetExample/InDetRecExample/python/InDetJobProperties.py
@@ -1122,7 +1122,6 @@ class InDetJobProperties(JobPropertyContainer):
        self.checkThenSet(self.doConversions          , False)
        self.checkThenSet(self.doStatistics           , False)
        self.checkThenSet(self.doSlimming             , True )
-       self.checkThenSet(self.doSGDeletion           , True )       
        self.checkThenSet(self.writeRDOs              , False)
        self.checkThenSet(self.useMBTSTimeDiff        , True )
        self.checkThenSet(self.cutLevel               , 2    )
@@ -1159,6 +1158,7 @@ class InDetJobProperties(JobPropertyContainer):
        # TEMPORARY FIX TO STOP SEG FAULT
        self.checkThenSet(self.doPixelClusterSplitting, False)
        self.checkThenSet(self.doTIDE_Ambi, False)
+       self.checkThenSet(self.doTrackSegmentsPixelPrdAssociation, False)
 
     elif (self.doIBL()):
        print "----> InDetJobProperties for IBL"
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredPriVtxAndPartCreation.py b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredPriVtxAndPartCreation.py
index ba8c8ada31b..e4623a08b30 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredPriVtxAndPartCreation.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/ConfiguredPriVtxAndPartCreation.py
@@ -30,7 +30,9 @@ class ConfiguredPriVtxAndPartCreation:
     #  --- now load primary vertex finder
     #
     # ------------------------------------------------------------
-    if InDetFlags.doVertexFinding() and not extension == "ForwardTracks" and not extension == "ForwardSLHCTracks" and not extension == "VeryForwardSLHCTracks":
+
+    # For ITK we *do* want vertexing to run on forward tracks, so we don't leave out SLHCForward/VeryForward
+    if InDetFlags.doVertexFinding() and not extension == "ForwardTracks":
     
       if InDetFlags.primaryVertexSetup() == 'DummyVxFinder':
         from InDetPriVxFinder.InDetPriVxFinderConf import InDet__InDetPriVxDummyFinder
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
index cd7c962fc36..cd988a1c45c 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecLoadTools.py
@@ -361,6 +361,17 @@ if InDetFlags.loadExtrapolator():
       InDetMaterialUpdator.ForcedMomentumValue = 1000*MeV
 
     ToolSvc += InDetMaterialUpdator
+
+    from TrkExTools.TrkExToolsConf import Trk__MultipleScatteringUpdator 
+    InDetMultipleScatteringUpdator = Trk__MultipleScatteringUpdator(name = "InDetMultipleScatteringUpdator", 
+ 		                                                    UseTrkUtils = False) 
+ 		 
+    ToolSvc += InDetMultipleScatteringUpdator 
+ 		     
+    if (InDetFlags.doPrintConfigurables()): 
+        print      InDetMultipleScatteringUpdator 
+
+
     
     if (InDetFlags.doPrintConfigurables()):
       print      InDetMaterialUpdator
@@ -544,6 +555,7 @@ if InDetFlags.loadFitter():
                                                  PropagatorTool        = InDetPropagator,
                                                  RotCreatorTool        = InDetRotCreator,
                                                  BroadRotCreatorTool   = BroadInDetRotCreator,
+                                                 MultipleScatteringTool = InDetMultipleScatteringUpdator,
                                                  MeasurementUpdateTool = InDetUpdator,
                                                  TrackingGeometrySvc   = AtlasTrackingGeometrySvc,
                                                  MaterialUpdateTool    = InDetMaterialUpdator,
@@ -587,6 +599,7 @@ if InDetFlags.loadFitter():
                                                           PropagatorTool        = InDetPropagator,
                                                           RotCreatorTool        = InDetRotCreator,
                                                           BroadRotCreatorTool   = BroadInDetRotCreator,
+                                                          MultipleScatteringTool = InDetMultipleScatteringUpdator,
                                                           MeasurementUpdateTool = InDetUpdator,
                                                           StraightLine          = not InDetFlags.solenoidOn(),
                                                           OutlierCut            = 5.0,
@@ -609,6 +622,7 @@ if InDetFlags.loadFitter():
                                                     PropagatorTool        = InDetPropagator,
                                                     RotCreatorTool        = InDetRefitRotCreator,
                                                     MeasurementUpdateTool = InDetUpdator,
+                                                    MultipleScatteringTool = InDetMultipleScatteringUpdator,
                                                     StraightLine          = not InDetFlags.solenoidOn(),
                                                     ReintegrateOutliers   = False, 
                                                     MaxIterations         = 10,
@@ -1361,7 +1375,8 @@ if (InDetFlags.doVertexFinding() or InDetFlags.doVertexFindingForMonitoring()) o
     from TrkVertexBilloirTools.TrkVertexBilloirToolsConf import Trk__FastVertexFitter
     InDetVxFitterTool = Trk__FastVertexFitter(name                   = "InDetFastVertexFitterTool",
                                               LinearizedTrackFactory = InDetLinFactory,
-                                              Extrapolator           = InDetExtrapolator)
+                                              Extrapolator           = InDetExtrapolator,
+                                              XAODConverter = InDetVxEdmCnv)
 
   elif InDetFlags.primaryVertexSetup() == 'DefaultFullFinding':
     #
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
index e71ddee33f9..f945f14e663 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRecPreProcessingSilicon.py
@@ -6,6 +6,10 @@
 #
 # ----------- PrepRawData creation from Raw Data Objects
 #
+
+if not 'redoPatternRecoAndTracking' in dir():
+  redoPatternRecoAndTracking = False
+
 if InDetFlags.doPRDFormation():
    #
    # --- Slim BCM RDOs by zero-suppressing
@@ -40,7 +44,7 @@ if InDetFlags.doPRDFormation():
    #
    # -- Pixel Clusterization
    #
-   if DetFlags.makeRIO.pixel_on() and InDetFlags.doPixelPRDFormation():     
+   if (DetFlags.makeRIO.pixel_on() and InDetFlags.doPixelPRDFormation()) or redoPatternRecoAndTracking:     
       #
       # --- MergedPixelTool (public)
       #
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
index 470c56dd661..c36e48b84a6 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetRec_jobOptions.py
@@ -516,8 +516,8 @@ else:
  		                                                      InDetNewTrackingCutsForwardTracks, 
  		                                                      TrackCollectionKeys, 
  		                                                      TrackCollectionTruthKeys)   
- 		          # --- do not add into list for combination YET 
-         #InputCombinedInDetTracks += [ InDetForwardTracksSiPattern.SiTrackCollection() ] 
+         # for ITK, forward tracks get added to the combined collection
+         InputCombinedInDetTracks += [ InDetForwardTracksSiPattern.SiTrackCollection() ] 
 
 
       else:
@@ -536,8 +536,8 @@ else:
                                                                    InDetNewTrackingCutsForwardTracks,
                                                                    TrackCollectionKeys,
                                                                    TrackCollectionTruthKeys)  
-        # --- do not add into list for combination YET
-        #InputCombinedInDetTracks += [ InDetForwardTracksSiPattern.SiTrackCollection() ]
+        # for ITK, forward tracks get added to the combined collection
+        InputCombinedInDetTracks += [ InDetForwardTracksSiPattern.SiTrackCollection() ]
 
 
     elif InDetFlags.doForwardTracks():
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py b/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
index a35272e2cd2..37ed1b454fe 100644
--- a/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/InDetxAODCreator.py
@@ -48,7 +48,8 @@ if not InDetFlags.doVertexFinding():
  xAODVertexCnvAlg.TPContainerName = InDetKeys.xAODTrackParticleContainer()
  topSequence += xAODVertexCnvAlg
 
-if (InDetFlags.doForwardTracks() and InDetFlags.doParticleCreation()) or doConversion:       
+#For forward tracks, no separate collection for ITK, since they are already merged
+if (InDetFlags.doForwardTracks() and InDetFlags.doParticleCreation() and not InDetFlags.doSLHC()) or doConversion:       
  xAODForwardTrackParticleCnvAlg = xAODMaker__TrackParticleCnvAlg(InDetKeys.xAODForwardTrackParticleContainer())
  xAODForwardTrackParticleCnvAlg.xAODContainerName = InDetKeys.xAODForwardTrackParticleContainer()
  xAODForwardTrackParticleCnvAlg.xAODTrackParticlesFromTracksContainerName = InDetKeys.xAODForwardTrackParticleContainer()
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
index 93454c6ebdf..d752a0bfaa6 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetAOD.py
@@ -39,8 +39,9 @@ if InDetFlags.doxAOD():
   excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation.-trackParameterCovarianceMatrices.-parameterX.-parameterY.-parameterZ.-parameterPX.-parameterPY.-parameterPZ.-parameterPosition"
   InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODTrackParticleContainer()]
   InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODTrackParticleContainer()+'Aux.' + excludedAuxData]
-  InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
-  InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData]
+  if not InDetFlags.doSLHC():
+   InDetAODList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
+   InDetAODList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData]
   InDetAODList+=['xAOD::VertexContainer#'+InDetKeys.xAODVertexContainer()]
   InDetAODList+=['xAOD::VertexAuxContainer#'+InDetKeys.xAODVertexContainer()+'Aux.-vxTrackAtVertex']
   InDetAODList+=['xAOD::VertexContainer#'+InDetKeys.xAODV0VertexContainer()]
diff --git a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
index 26c885867f7..87df4c07c62 100755
--- a/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
+++ b/InnerDetector/InDetExample/InDetRecExample/share/WriteInDetESD.py
@@ -101,8 +101,9 @@ if InDetFlags.doxAOD():
   excludedAuxData = "-caloExtension.-cellAssociation.-clusterAssociation.-trackParameterCovarianceMatrices.-parameterX.-parameterY.-parameterZ.-parameterPX.-parameterPY.-parameterPZ.-parameterPosition"
   InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODTrackParticleContainer()]
   InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODTrackParticleContainer()+'Aux.' + excludedAuxData]
-  InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
-  InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData ]
+  if not InDetFlags.doSLHC():
+     InDetESDList+=['xAOD::TrackParticleContainer#'+InDetKeys.xAODForwardTrackParticleContainer()]
+     InDetESDList+=['xAOD::TrackParticleAuxContainer#'+InDetKeys.xAODForwardTrackParticleContainer()+'Aux.' + excludedAuxData ]
   InDetESDList+=['xAOD::VertexContainer#'+InDetKeys.xAODVertexContainer()]
   InDetESDList+=['xAOD::VertexAuxContainer#'+InDetKeys.xAODVertexContainer()+'Aux.-vxTrackAtVertex']
   if InDetFlags.doTrackSegmentsPixel():
-- 
GitLab