This function returns a cms.Sequence containing as last element the
module 'FinalTrackRefitter', which can be used as cms.InputTag for
subsequent processing steps.
The modules in the sequence are already attached to the given `process`
object using the given track collection `collection` and the given
optionial arguments.
Arguments:
- `process`: 'cms.Process' object to which the modules of the sequence will
be attached.
- `collection`: String indicating the input track collection.
- `saveCPU`: If set to 'True', some steps are merged to reduce CPU time.
Reduces a little the accuracy of the results.
This option is currently not recommended.
- `TTRHBuilder`: Option used for the Track(Re)Fitter modules.
- `usePixelQualityFlag`: Option used for the TrackHitFilter module.
- `openMassWindow`: Used to configure the TwoBodyDecaySelector for ZMuMu.
- `cosmicsDecoMode`: If set to 'True' a lower Signal/Noise cut is used.
- `momentumConstraint`: If you want to apply a momentum constraint for the
track refitting, e.g. for CRUZET data, you need
to provide here the name of the constraint module.
Definition at line 12 of file trackselectionRefitting.py.
References _getModule(), reco.get(), join(), and update.
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 - `openMassWindow`: Used to configure the TwoBodyDecaySelector for ZMuMu.
31 - `cosmicsDecoMode`: If set to 'True' a lower Signal/Noise cut is used.
32 - `momentumConstraint`: If you want to apply a momentum constraint for the
33 track refitting, e.g. for CRUZET data, you need
34 to provide here the name of the constraint module.
42 options = {
"TrackHitFilter": {},
47 options[
"TrackSelector"][
"HighPurity"] = {
48 "trackQualities": [
"highPurity"],
53 options[
"TrackSelector"][
"Alignment"] = {
64 options[
"TrackRefitter"][
"First"] = {
65 "NavigationSchool":
"",
67 options[
"TrackRefitter"][
"Second"] = {
68 "NavigationSchool":
"",
69 "TTRHBuilder": TTRHBuilder
71 options[
"TrackHitFilter"][
"Tracker"] = {
72 "useTrajectories":
True,
74 "commands": cms.vstring(
"keep PXB",
"keep PXE",
"keep TIB",
"keep TID",
75 "keep TOB",
"keep TEC"),
76 "replaceWithInactiveHits":
True,
77 "rejectBadStoNHits":
True,
78 "rejectLowAngleHits":
True,
79 "usePixelQualityFlag": usePixelQualityFlag,
80 "StoNcommands": cms.vstring(
"ALL 12.0"),
81 "TrackAngleCut": 0.087
83 options[
"TrackFitter"][
"HitFilteredTracks"] = {
84 "TTRHBuilder": TTRHBuilder
93 if collection
is "ALCARECOTkAlMinBias":
94 options[
"TrackSelector"][
"Alignment"].
update({
97 elif collection
is "ALCARECOTkAlCosmicsCTF0T":
99 options[
"TrackSelector"][
"HighPurity"] = {}
100 if not cosmicsDecoMode:
101 options[
"TrackHitFilter"][
"Tracker"].
update({
102 "StoNcommands": cms.vstring(
"ALL 18.0")
104 options[
"TrackSelector"][
"Alignment"].
update({
109 elif collection
is "ALCARECOTkAlMuonIsolated":
110 options[
"TrackSelector"][
"Alignment"].
update({
111 (
"minHitsPerSubDet",
"inPIXEL"): 1,
113 elif collection
is "ALCARECOTkAlZMuMu":
114 options[
"TrackSelector"][
"Alignment"].
update({
119 "applyMultiplicityFilter":
True,
120 "minMultiplicity": 2,
121 "maxMultiplicity": 2,
122 (
"minHitsPerSubDet",
"inPIXEL"): 1,
123 (
"TwoBodyDecaySelector",
"applyChargeFilter"):
True,
124 (
"TwoBodyDecaySelector",
125 "applyMassrangeFilter"):
not openMassWindow,
126 (
"TwoBodyDecaySelector",
"minXMass"): 85.8,
127 (
"TwoBodyDecaySelector",
"maxXMass"): 95.8
131 print "Unknown input track collection:", collection
141 mods = [(
"TrackSelector",
"Alignment", {
"method":
"load"}),
142 (
"TrackRefitter",
"First", {
"method":
"load",
144 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
145 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"})]
146 options[
"TrackSelector"][
"Alignment"].
update(
147 options[
"TrackSelector"][
"HighPurity"])
149 mods = [(
"TrackSelector",
"HighPurity", {
"method":
"import"}),
150 (
"TrackRefitter",
"First", {
"method":
"load",
152 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
153 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"}),
154 (
"TrackSelector",
"Alignment", {
"method":
"load"}),
155 (
"TrackRefitter",
"Second", {
"method":
"load",
157 if isCosmics: mods = mods[1:]
165 if momentumConstraint
is not None:
166 for mod
in options[
"TrackRefitter"]:
167 options[
"TrackRefitter"][mod].
update({
168 "constraint":
"momentum",
169 "srcConstr": momentumConstraint
180 for mod
in mods[:-1]:
181 src =
_getModule(process, src, mod[0],
"".
join(reversed(mod[:-1])),
182 options[mod[0]][mod[1]], isCosmics = isCosmics,
184 modules.append(getattr(process, src))
186 if mods[-1][-1][
"method"]
is "load" and \
187 not mods[-1][-1].
get(
"clone",
False):
188 print "Name of the last module needs to be modifiable."
190 src =
_getModule(process, src, mods[-1][0],
"FinalTrackRefitter",
191 options[mods[-1][0]][mods[-1][1]],
192 isCosmics = isCosmics, **(mods[-1][2]))
193 modules.append(getattr(process, src))
195 moduleSum = modules[0]
196 for mod
in modules[1:]:
198 return cms.Sequence(moduleSum)
static std::string join(char **cmd)
def _getModule
### Auxiliary functions ###
T get(const Candidate &c)