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.
- `cosmicsZeroTesla`: If set to 'True' a 0T-specific selection 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 13 of file trackselectionRefitting.py.
References _getModule(), reco.get(), join(), and update.
14 momentumConstraint =
None):
15 """This function returns a cms.Sequence containing as last element the
16 module 'FinalTrackRefitter', which can be used as cms.InputTag for
17 subsequent processing steps.
18 The modules in the sequence are already attached to the given `process`
19 object using the given track collection `collection` and the given
23 - `process`: 'cms.Process' object to which the modules of the sequence will
25 - `collection`: String indicating the input track collection.
26 - `saveCPU`: If set to 'True', some steps are merged to reduce CPU time.
27 Reduces a little the accuracy of the results.
28 This option is currently not recommended.
29 - `TTRHBuilder`: Option used for the Track(Re)Fitter modules.
30 - `usePixelQualityFlag`: Option used for the TrackHitFilter module.
31 - `openMassWindow`: Used to configure the TwoBodyDecaySelector for ZMuMu.
32 - `cosmicsDecoMode`: If set to 'True' a lower Signal/Noise cut is used.
33 - `cosmicsZeroTesla`: If set to 'True' a 0T-specific selection is used.
34 - `momentumConstraint`: If you want to apply a momentum constraint for the
35 track refitting, e.g. for CRUZET data, you need
36 to provide here the name of the constraint module.
44 options = {
"TrackHitFilter": {},
49 options[
"TrackSelector"][
"HighPurity"] = {
50 "trackQualities": [
"highPurity"],
55 options[
"TrackSelector"][
"Alignment"] = {
66 options[
"TrackRefitter"][
"First"] = {
67 "NavigationSchool":
"",
69 options[
"TrackRefitter"][
"Second"] = {
70 "NavigationSchool":
"",
71 "TTRHBuilder": TTRHBuilder
73 options[
"TrackHitFilter"][
"Tracker"] = {
74 "useTrajectories":
True,
76 "commands": cms.vstring(
"keep PXB",
"keep PXE",
"keep TIB",
"keep TID",
77 "keep TOB",
"keep TEC"),
78 "replaceWithInactiveHits":
True,
79 "rejectBadStoNHits":
True,
80 "rejectLowAngleHits":
True,
81 "usePixelQualityFlag": usePixelQualityFlag,
82 "StoNcommands": cms.vstring(
"ALL 12.0"),
85 options[
"TrackFitter"][
"HitFilteredTracks"] = {
86 "NavigationSchool":
"",
87 "TTRHBuilder": TTRHBuilder
96 if collection
is "ALCARECOTkAlMinBias":
97 options[
"TrackSelector"][
"Alignment"].
update({
100 elif collection
is "ALCARECOTkAlCosmicsCTF0T":
102 options[
"TrackSelector"][
"HighPurity"] = {}
103 if not cosmicsDecoMode:
104 options[
"TrackHitFilter"][
"Tracker"].
update({
105 "StoNcommands": cms.vstring(
"ALL 18.0")
108 options[
"TrackHitFilter"][
"Tracker"].
update({
109 "TrackAngleCut": 0.087
112 options[
"TrackHitFilter"][
"Tracker"].
update({
113 "TrackAngleCut": 0.087
115 options[
"TrackSelector"][
"Alignment"].
update({
120 elif collection
is "ALCARECOTkAlMuonIsolated":
121 options[
"TrackSelector"][
"Alignment"].
update({
122 (
"minHitsPerSubDet",
"inPIXEL"): 1,
124 elif collection
is "ALCARECOTkAlZMuMu":
125 options[
"TrackSelector"][
"Alignment"].
update({
130 "applyMultiplicityFilter":
True,
131 "minMultiplicity": 2,
132 "maxMultiplicity": 2,
133 (
"minHitsPerSubDet",
"inPIXEL"): 1,
134 (
"TwoBodyDecaySelector",
"applyChargeFilter"):
True,
135 (
"TwoBodyDecaySelector",
136 "applyMassrangeFilter"):
not openMassWindow,
137 (
"TwoBodyDecaySelector",
"minXMass"): 85.8,
138 (
"TwoBodyDecaySelector",
"maxXMass"): 95.8
142 print "Unknown input track collection:", collection
152 mods = [(
"TrackSelector",
"Alignment", {
"method":
"load"}),
153 (
"TrackRefitter",
"First", {
"method":
"load",
155 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
156 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"})]
157 options[
"TrackSelector"][
"Alignment"].
update(
158 options[
"TrackSelector"][
"HighPurity"])
160 mods = [(
"TrackSelector",
"HighPurity", {
"method":
"import"}),
161 (
"TrackRefitter",
"First", {
"method":
"load",
163 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
164 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"}),
165 (
"TrackSelector",
"Alignment", {
"method":
"load"}),
166 (
"TrackRefitter",
"Second", {
"method":
"load",
168 if isCosmics: mods = mods[1:]
176 if momentumConstraint
is not None:
177 for mod
in options[
"TrackRefitter"]:
178 options[
"TrackRefitter"][mod].
update({
179 "constraint":
"momentum",
180 "srcConstr": momentumConstraint
191 for mod
in mods[:-1]:
192 src =
_getModule(process, src, mod[0],
"".
join(reversed(mod[:-1])),
193 options[mod[0]][mod[1]], isCosmics = isCosmics,
195 modules.append(getattr(process, src))
197 if mods[-1][-1][
"method"]
is "load" and \
198 not mods[-1][-1].
get(
"clone",
False):
199 print "Name of the last module needs to be modifiable."
201 src =
_getModule(process, src, mods[-1][0],
"FinalTrackRefitter",
202 options[mods[-1][0]][mods[-1][1]],
203 isCosmics = isCosmics, **(mods[-1][2]))
204 modules.append(getattr(process, src))
206 moduleSum = modules[0]
207 for mod
in modules[1:]:
209 return cms.Sequence(moduleSum)
static std::string join(char **cmd)
def _getModule
### Auxiliary functions ###
T get(const Candidate &c)