13 momentumConstraint =
None):
14 """This function returns a cms.Sequence containing as last element the 15 module 'FinalTrackRefitter', which can be used as cms.InputTag for 16 subsequent processing steps. 17 The modules in the sequence are already attached to the given `process` 18 object using the given track collection `collection` and the given 22 - `process`: 'cms.Process' object to which the modules of the sequence will 24 - `collection`: String indicating the input track collection. 25 - `saveCPU`: If set to 'True', some steps are merged to reduce CPU time. 26 Reduces a little the accuracy of the results. 27 This option is currently not recommended. 28 - `TTRHBuilder`: Option used for the Track(Re)Fitter modules. 29 - `usePixelQualityFlag`: Option used for the TrackHitFilter module. 30 Defaults to 'True' but is automatically set to 31 'False' if a `TTRHBuilder` without templates is 33 If this is still wanted for some reason, one can 34 explicitely specify it as 'True'. 35 - `openMassWindow`: Used to configure the TwoBodyDecaySelector for ZMuMu. 36 - `cosmicsDecoMode`: If set to 'True' a lower Signal/Noise cut is used. 37 - `cosmicsZeroTesla`: If set to 'True' a 0T-specific selection is used. 38 - `momentumConstraint`: If you want to apply a momentum constraint for the 39 track refitting, e.g. for CRUZET data, you need 40 to provide here the name of the constraint module. 47 if usePixelQualityFlag
is None:
48 if "Template" not in TTRHBuilder:
49 usePixelQualityFlag =
False 50 print "Using 'TTRHBuilder' without templates:", TTRHBuilder
51 print " --> Turning off pixel quality flag in hit filter." 53 usePixelQualityFlag =
True 60 options = {
"TrackHitFilter": {},
65 options[
"TrackSelector"][
"HighPurity"] = {
66 "trackQualities": [
"highPurity"],
72 options[
"TrackSelector"][
"Alignment"] = {
83 options[
"TrackRefitter"][
"First"] = {
84 "NavigationSchool":
"",
85 "TTRHBuilder": TTRHBuilder
87 options[
"TrackRefitter"][
"Second"] = {
88 "NavigationSchool":
"",
89 "TTRHBuilder": TTRHBuilder
91 options[
"TrackHitFilter"][
"Tracker"] = {
92 "useTrajectories":
True,
94 "commands": cms.vstring(
"keep PXB",
"keep PXE",
"keep TIB",
"keep TID",
95 "keep TOB",
"keep TEC"),
96 "replaceWithInactiveHits":
True,
97 "rejectBadStoNHits":
True,
98 "rejectLowAngleHits":
True,
99 "usePixelQualityFlag": usePixelQualityFlag,
100 "StoNcommands": cms.vstring(
"ALL 12.0"),
101 "TrackAngleCut": 0.087
103 options[
"TrackFitter"][
"HitFilteredTracks"] = {
104 "NavigationSchool":
"",
105 "TTRHBuilder": TTRHBuilder
114 if collection
in (
"ALCARECOTkAlMinBias",
"generalTracks",
115 "ALCARECOTkAlMinBiasHI",
"hiGeneralTracks"):
116 options[
"TrackSelector"][
"Alignment"].
update({
120 options[
"TrackHitFilter"][
"Tracker"].
update({
123 elif collection
in (
"ALCARECOTkAlCosmicsCTF0T",
124 "ALCARECOTkAlCosmicsInCollisions"):
126 options[
"TrackSelector"][
"HighPurity"] = {}
127 if not cosmicsDecoMode:
128 options[
"TrackHitFilter"][
"Tracker"].
update({
129 "StoNcommands": cms.vstring(
"ALL 18.0")
132 options[
"TrackHitFilter"][
"Tracker"].
update({
136 options[
"TrackHitFilter"][
"Tracker"].
update({
139 options[
"TrackSelector"][
"Alignment"].
update({
143 "applyMultiplicityFilter":
True,
146 elif collection
in (
"ALCARECOTkAlMuonIsolated",
147 "ALCARECOTkAlMuonIsolatedHI",
148 "ALCARECOTkAlMuonIsolatedPA"):
149 options[
"TrackSelector"][
"Alignment"].
update({
150 (
"minHitsPerSubDet",
"inPIXEL"): 1,
153 "applyMultiplicityFilter":
True,
154 "maxMultiplicity": 1,
156 elif collection
in (
"ALCARECOTkAlZMuMu",
157 "ALCARECOTkAlZMuMuHI",
158 "ALCARECOTkAlZMuMuPA"):
159 options[
"TrackSelector"][
"Alignment"].
update({
164 "applyMultiplicityFilter":
True,
165 "minMultiplicity": 2,
166 "maxMultiplicity": 2,
167 (
"minHitsPerSubDet",
"inPIXEL"): 1,
168 (
"TwoBodyDecaySelector",
"applyChargeFilter"):
True,
169 (
"TwoBodyDecaySelector",
"charge"): 0,
170 (
"TwoBodyDecaySelector",
171 "applyMassrangeFilter"):
not openMassWindow,
172 (
"TwoBodyDecaySelector",
"minXMass"): 85.8,
173 (
"TwoBodyDecaySelector",
"maxXMass"): 95.8,
174 (
"TwoBodyDecaySelector",
"daughterMass"): 0.105
176 options[
"TrackHitFilter"][
"Tracker"].
update({
179 elif collection ==
"ALCARECOTkAlUpsilonMuMu":
180 options[
"TrackSelector"][
"Alignment"].
update({
185 "applyMultiplicityFilter":
True,
186 "minMultiplicity": 2,
187 "maxMultiplicity": 2,
188 (
"minHitsPerSubDet",
"inPIXEL"): 1,
189 (
"TwoBodyDecaySelector",
"applyChargeFilter"):
True,
190 (
"TwoBodyDecaySelector",
"charge"): 0,
191 (
"TwoBodyDecaySelector",
192 "applyMassrangeFilter"):
not openMassWindow,
193 (
"TwoBodyDecaySelector",
"minXMass"): 9.2,
194 (
"TwoBodyDecaySelector",
"maxXMass"): 9.7,
195 (
"TwoBodyDecaySelector",
"daughterMass"): 0.105
197 options[
"TrackHitFilter"][
"Tracker"].
update({
201 print "Unknown input track collection:", collection
211 mods = [(
"TrackSelector",
"Alignment", {
"method":
"load"}),
212 (
"TrackRefitter",
"First", {
"method":
"load",
214 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
215 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"})]
216 options[
"TrackSelector"][
"Alignment"].
update(
217 options[
"TrackSelector"][
"HighPurity"])
219 mods = [(
"TrackSelector",
"HighPurity", {
"method":
"import"}),
220 (
"TrackRefitter",
"First", {
"method":
"load",
222 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
223 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"}),
224 (
"TrackSelector",
"Alignment", {
"method":
"load"}),
225 (
"TrackRefitter",
"Second", {
"method":
"load",
227 if isCosmics: mods = mods[1:]
235 if momentumConstraint
is not None:
236 for mod
in options[
"TrackRefitter"]:
237 options[
"TrackRefitter"][mod].
update({
238 "constraint":
"momentum",
239 "srcConstr": momentumConstraint
247 process.load(
"RecoVertex.BeamSpotProducer.BeamSpot_cff")
257 for mod
in mods[:-1]:
258 src =
_getModule(process, src, mod[0],
"".
join(reversed(mod[:-1])),
259 options[mod[0]][mod[1]], isCosmics = isCosmics,
261 modules.append(getattr(process, src))
263 if mods[-1][-1][
"method"]
is "load" and \
264 not mods[-1][-1].
get(
"clone",
False):
265 print "Name of the last module needs to be modifiable." 267 src =
_getModule(process, src, mods[-1][0],
"FinalTrackRefitter",
268 options[mods[-1][0]][mods[-1][1]],
269 isCosmics = isCosmics, **(mods[-1][2]))
270 modules.append(getattr(process, src))
272 moduleSum = process.offlineBeamSpot
273 for module
in modules: moduleSum += module
275 return cms.Sequence(moduleSum)
def _getModule(process, src, modType, moduleName, options, kwargs)
Auxiliary functions ###
static std::string join(char **cmd)
T get(const Candidate &c)