CMS 3D CMS Logo

TrajectoryFactories_cff.py
Go to the documentation of this file.
1 ###############################################################
2 #
3 # Configuration blocks for the TrajectoryFactories inheriting
4 # from TrajectoryFactoryBase.
5 # Include this file and do e.g.
6 # TrajectoryFactory = cms.PSet( ReferenceTrajectoryFactory)
7 #
8 ###############################################################
9 
10 import FWCore.ParameterSet.Config as cms
11 
12 ###############################################################
13 #
14 # Common to all TrajectoryFactories
15 #
16 ###############################################################
17 __muonMass = cms.double(0.10565836)
18 
19 TrajectoryFactoryBase = cms.PSet(
20  PropagationDirection = cms.string('alongMomentum'), ## or "oppositeToMomentum" or "anyDirection"
21  MaterialEffects = cms.string('Combined'), ## or "MultipleScattering" or "EnergyLoss" or "None"
22  ## (see others at 'BrokenLinesTrajectoryFactory')
23  UseProjectedHits = cms.bool(True), ## if false, projected hits are skipped
24  UseInvalidHits = cms.bool(False), ## if false, invalid hits are skipped
25  UseHitWithoutDet = cms.bool(True), ## if false, RecHits that are not attached to GeomDets are skipped
26  UseBeamSpot = cms.bool(False), ## if true, the beam spot is used as a constraint via a virtual TTRecHit
27  IncludeAPEs = cms.bool(False), ## if true, the APEs are included in the hit error
28  AllowZeroMaterial = cms.bool(False) # if true, exceptions due to singular scatter matrices are suppressed
29 )
30 
31 ###############################################################
32 #
33 # ReferenceTrajectoryFactory
34 #
35 ###############################################################
36 ReferenceTrajectoryFactory = cms.PSet(
37  TrajectoryFactoryBase,
38  ParticleMass = __muonMass,
39  TrajectoryFactoryName = cms.string('ReferenceTrajectoryFactory'),
40  UseBzeroIfFieldOff = cms.bool(True), # if true, use BzeroReferenceTrajectory if B == 0
41  MomentumEstimateFieldOff = cms.double(10.) # used if useBzeroIfFieldOff == True
42 
43 )
44 
45 ###############################################################
46 #
47 # BzeroReferenceTrajectoryFactory
48 #
49 ###############################################################
50 BzeroReferenceTrajectoryFactory = cms.PSet(
51  TrajectoryFactoryBase,
52  ParticleMass = __muonMass,
53  TrajectoryFactoryName = cms.string('BzeroReferenceTrajectoryFactory'),
54  MomentumEstimate = cms.double(10.0)
55 )
56 
57 ###############################################################
58 #
59 # DualTrajectoryFactory
60 #
61 ###############################################################
62 DualTrajectoryFactory = cms.PSet(
63  TrajectoryFactoryBase,
64  ParticleMass = __muonMass,
65  TrajectoryFactoryName = cms.string('DualTrajectoryFactory')
66 )
67 
68 ###############################################################
69 #
70 # DualBzeroTrajectoryFactory
71 #
72 ###############################################################
73 DualBzeroTrajectoryFactory = cms.PSet(
74  TrajectoryFactoryBase,
75  ParticleMass = __muonMass,
76  TrajectoryFactoryName = cms.string('DualBzeroTrajectoryFactory'),
77  MomentumEstimate = cms.double(10.0)
78 )
79 
80 ###############################################################
81 #
82 # TwoBodyDecayReferenceTrajectoryFactory
83 #
84 ###############################################################
85 TwoBodyDecayTrajectoryFactory = cms.PSet(
86  TrajectoryFactoryBase,
87  NSigmaCut = cms.double(100.0),
88  Chi2Cut = cms.double(10000.0),
89  ParticleProperties = cms.PSet(
90  PrimaryMass = cms.double(91.1876),
91  PrimaryWidth = cms.double(2.4952),
92  SecondaryMass = cms.double(0.105658)
93  ),
94  ConstructTsosWithErrors = cms.bool(False),
95  UseRefittedState = cms.bool(True),
96  EstimatorParameters = cms.PSet(
97  MaxIterationDifference = cms.untracked.double(0.01),
98  RobustificationConstant = cms.untracked.double(1.0),
99  MaxIterations = cms.untracked.int32(100),
100  UseInvariantMass = cms.untracked.bool(True)
101  ),
102  TrajectoryFactoryName = cms.string('TwoBodyDecayTrajectoryFactory')
103 )
104 
105 ###############################################################
106 #
107 # CombinedTrajectoryFactory using an instance of TwoBodyDecayTrajectoryFactory
108 # and ReferenceTrajectoryFactory, taking the first successful.
109 #
110 ###############################################################
111 CombinedTrajectoryFactory = cms.PSet(
112  TrajectoryFactoryBase, # will not be used!
113  TrajectoryFactoryName = cms.string('CombinedTrajectoryFactory'),
114  # look for PSets called TwoBody and Reference:
115  TrajectoryFactoryNames = cms.vstring(
116  'TwoBodyDecayTrajectoryFactory,TwoBody', # look for PSet called TwoBody
117  'ReferenceTrajectoryFactory,Reference'), # look for PSet called Reference
118  useAllFactories = cms.bool(False),
119  # now one PSet for each of the configured trajectories:
120  TwoBody = cms.PSet( # FIXME: better by reference?
121  TwoBodyDecayTrajectoryFactory
122  ),
123  Reference = cms.PSet( # FIXME: better by reference?
124  ReferenceTrajectoryFactory
125  )
126 )
127 ###############################################################
128 #
129 # CombinedTrajectoryFactory using two instances of BzeroReferenceTrajectoryFactory,
130 # one propagating alongMomentum, one oppositeToMomentum.
131 #
132 ###############################################################
133 # First a helper object, where I'd like to do:
134 #BwdBzeroReferenceTrajectoryFactory = BzeroReferenceTrajectoryFactory.clone(PropagationDirection = 'oppositeToMomentum')
135 # Since there is no clone in cms.PSet (yet?), but clone is needed for python that works by reference,
136 # take solution from https://hypernews.cern.ch/HyperNews/CMS/get/swDevelopment/1890/1.html:
137 import copy
138 BwdBzeroReferenceTrajectoryFactory = copy.deepcopy(BzeroReferenceTrajectoryFactory)
139 BwdBzeroReferenceTrajectoryFactory.PropagationDirection = 'oppositeToMomentum'
140 # now the PSet
141 CombinedFwdBwdBzeroTrajectoryFactory = cms.PSet(
142  TrajectoryFactoryBase, # will not be used!
143  TrajectoryFactoryName = cms.string('CombinedTrajectoryFactory'),
144 
145  TrajectoryFactoryNames = cms.vstring(
146  'BzeroReferenceTrajectoryFactory,FwdBzero', # look for PSet called FwdBzero
147  'BzeroReferenceTrajectoryFactory,BwdBzero'), # look for PSet called BwdBzero
148  useAllFactories = cms.bool(True),
149 
150  # now one PSet for each of the configured trajectories:
151  FwdBzero = cms.PSet(BzeroReferenceTrajectoryFactory), # FIXME: better by reference?
152  BwdBzero = cms.PSet(BwdBzeroReferenceTrajectoryFactory) # FIXME: better by reference?
153 )
154 
155 ###############################################################
156 #
157 # CombinedTrajectoryFactory using three ReferenceTrajectories:
158 # - two instances of BzeroReferenceTrajectoryFactory,
159 # one propagating alongMomentum, one oppositeToMomentum,
160 # - a DualBzeroTrajectory to start in the middle.
161 #
162 ###############################################################
163 CombinedFwdBwdDualBzeroTrajectoryFactory = cms.PSet(
164  TrajectoryFactoryBase, # will not be used!
165  TrajectoryFactoryName = cms.string('CombinedTrajectoryFactory'),
166 
167  TrajectoryFactoryNames = cms.vstring(
168  'BzeroReferenceTrajectoryFactory,FwdBzero', # look for PSet called FwdBzero
169  'BzeroReferenceTrajectoryFactory,BwdBzero', # look for PSet called BwdBzero
170  'DualBzeroTrajectoryFactory,DualBzero'), # look for PSet called DualBzero
171  useAllFactories = cms.bool(True),
172 
173  # now one PSet for each of the configured trajectories:
174  FwdBzero = cms.PSet(BzeroReferenceTrajectoryFactory), # FIXME: better by reference?
175  BwdBzero = cms.PSet(BwdBzeroReferenceTrajectoryFactory), # defined above for CombinedFwdBwdBzeroTrajectoryFactory # FIXME: better by reference?
176  DualBzero = cms.PSet(DualBzeroTrajectoryFactory) # FIXME: better by reference?
177 )
178 
179 
180 ###############################################################
181 #
182 # CombinedTrajectoryFactory using two instances of ReferenceTrajectoryFactory,
183 # one propagating alongMomentum, one oppositeToMomentum.
184 #
185 ###############################################################
186 # First a helper object, see above for CombinedFwdBwdBzeroTrajectoryFactory:
187 BwdReferenceTrajectoryFactory = copy.deepcopy(ReferenceTrajectoryFactory)
188 BwdReferenceTrajectoryFactory.PropagationDirection = 'oppositeToMomentum'
189 # now the PSet
190 CombinedFwdBwdTrajectoryFactory = cms.PSet(
191  TrajectoryFactoryBase, # will not be used!
192  TrajectoryFactoryName = cms.string('CombinedTrajectoryFactory'),
193 
194  TrajectoryFactoryNames = cms.vstring(
195  'ReferenceTrajectoryFactory,Fwd', # look for PSet called Fwd
196  'ReferenceTrajectoryFactory,Bwd'), # look for PSet called Bwd
197  useAllFactories = cms.bool(True),
198 
199  # now one PSet for each of the configured trajectories:
200  Fwd = cms.PSet(ReferenceTrajectoryFactory), # FIXME: better by reference?
201  Bwd = cms.PSet(BwdReferenceTrajectoryFactory) # FIXME: better by reference?
202 )
203 
204 ###############################################################
205 #
206 # CombinedTrajectoryFactory using three ReferenceTrajectories:
207 # - two instances of ReferenceTrajectoryFactory,
208 # one propagating alongMomentum, one oppositeToMomentum,
209 # - a DualTrajectory to start in the middle.
210 #
211 ###############################################################
212 CombinedFwdBwdDualTrajectoryFactory = cms.PSet(
213  TrajectoryFactoryBase, # will not be used!
214  TrajectoryFactoryName = cms.string('CombinedTrajectoryFactory'),
215 
216  TrajectoryFactoryNames = cms.vstring(
217  'ReferenceTrajectoryFactory,Fwd', # look for PSet called Fwd
218  'ReferenceTrajectoryFactory,Bwd', # look for PSet called Bwd
219  'DualTrajectoryFactory,Dual'), # look for PSet called Dual
220  useAllFactories = cms.bool(True),
221 
222  # now one PSet for each of the configured trajectories:
223  Fwd = cms.PSet(ReferenceTrajectoryFactory), # FIXME: better by reference?
224  Bwd = cms.PSet(BwdReferenceTrajectoryFactory), # defined above for CombinedFwdBwdTrajectoryFactory # FIXME: better by reference?
225  Dual = cms.PSet(DualTrajectoryFactory) # FIXME: better by reference?
226 )
227 
228 ###############################################################
229 #
230 # ReferenceTrajectoryFactory with BrokenLines
231 #
232 ###############################################################
233 BrokenLinesTrajectoryFactory = ReferenceTrajectoryFactory.clone(
234  MaterialEffects = 'BrokenLinesCoarse', # same as "BrokenLines"
235  # others are "BrokenLinesCoarsePca" == "BrokenLinesPca",
236  # "BrokenLinesFine", "BrokenLinesFinePca"
237  # or even "BreakPoints"
238  UseInvalidHits = True # to account for multiple scattering in these layers
239  )
240 
241 
242 ###############################################################
243 #
244 # BzeroReferenceTrajectoryFactory with BrokenLines
245 #
246 ###############################################################
247 BrokenLinesBzeroTrajectoryFactory = BzeroReferenceTrajectoryFactory.clone(
248  MaterialEffects = 'BrokenLinesCoarse', # see BrokenLinesTrajectoryFactory
249  UseInvalidHits = True # to account for multiple scattering in these layers
250  )
ReferenceTrajectoryFactory * clone() const override
BzeroReferenceTrajectoryFactory * clone() const override