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"],
56 options[
"TrackSelector"][
"Alignment"] = {
67 options[
"TrackRefitter"][
"First"] = {
68 "NavigationSchool":
"",
70 options[
"TrackRefitter"][
"Second"] = {
71 "NavigationSchool":
"",
72 "TTRHBuilder": TTRHBuilder
74 options[
"TrackHitFilter"][
"Tracker"] = {
75 "useTrajectories":
True,
77 "commands": cms.vstring(
"keep PXB",
"keep PXE",
"keep TIB",
"keep TID",
78 "keep TOB",
"keep TEC"),
79 "replaceWithInactiveHits":
True,
80 "rejectBadStoNHits":
True,
81 "rejectLowAngleHits":
True,
82 "usePixelQualityFlag": usePixelQualityFlag,
83 "StoNcommands": cms.vstring(
"ALL 12.0"),
84 "TrackAngleCut": 0.087
86 options[
"TrackFitter"][
"HitFilteredTracks"] = {
87 "NavigationSchool":
"",
88 "TTRHBuilder": TTRHBuilder
97 if collection ==
"ALCARECOTkAlMinBias" or collection ==
"generalTracks":
98 options[
"TrackSelector"][
"Alignment"].
update({
102 options[
"TrackHitFilter"][
"Tracker"].
update({
105 elif collection ==
"ALCARECOTkAlCosmicsCTF0T":
107 options[
"TrackSelector"][
"HighPurity"] = {}
108 if not cosmicsDecoMode:
109 options[
"TrackHitFilter"][
"Tracker"].
update({
110 "StoNcommands": cms.vstring(
"ALL 18.0")
113 options[
"TrackHitFilter"][
"Tracker"].
update({
117 options[
"TrackHitFilter"][
"Tracker"].
update({
120 options[
"TrackSelector"][
"Alignment"].
update({
124 "applyMultiplicityFilter":
True,
127 elif collection ==
"ALCARECOTkAlMuonIsolated":
128 options[
"TrackSelector"][
"Alignment"].
update({
129 (
"minHitsPerSubDet",
"inPIXEL"): 1,
132 "applyMultiplicityFilter":
True,
133 "maxMultiplicity": 1,
135 elif collection ==
"ALCARECOTkAlZMuMu":
136 options[
"TrackSelector"][
"Alignment"].
update({
141 "applyMultiplicityFilter":
True,
142 "minMultiplicity": 2,
143 "maxMultiplicity": 2,
144 (
"minHitsPerSubDet",
"inPIXEL"): 1,
145 (
"TwoBodyDecaySelector",
"applyChargeFilter"):
True,
146 (
"TwoBodyDecaySelector",
"charge"): 0,
147 (
"TwoBodyDecaySelector",
148 "applyMassrangeFilter"):
not openMassWindow,
149 (
"TwoBodyDecaySelector",
"minXMass"): 85.8,
150 (
"TwoBodyDecaySelector",
"maxXMass"): 95.8,
151 (
"TwoBodyDecaySelector",
"daughterMass"): 0.105
153 options[
"TrackHitFilter"][
"Tracker"].
update({
158 print "Unknown input track collection:", collection
168 mods = [(
"TrackSelector",
"Alignment", {
"method":
"load"}),
169 (
"TrackRefitter",
"First", {
"method":
"load",
171 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
172 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"})]
173 options[
"TrackSelector"][
"Alignment"].
update(
174 options[
"TrackSelector"][
"HighPurity"])
176 mods = [(
"TrackSelector",
"HighPurity", {
"method":
"import"}),
177 (
"TrackRefitter",
"First", {
"method":
"load",
179 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
180 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"}),
181 (
"TrackSelector",
"Alignment", {
"method":
"load"}),
182 (
"TrackRefitter",
"Second", {
"method":
"load",
184 if isCosmics: mods = mods[1:]
192 if momentumConstraint
is not None:
193 for mod
in options[
"TrackRefitter"]:
194 options[
"TrackRefitter"][mod].
update({
195 "constraint":
"momentum",
196 "srcConstr": momentumConstraint
207 for mod
in mods[:-1]:
208 src =
_getModule(process, src, mod[0],
"".
join(reversed(mod[:-1])),
209 options[mod[0]][mod[1]], isCosmics = isCosmics,
211 modules.append(getattr(process, src))
213 if mods[-1][-1][
"method"]
is "load" and \
214 not mods[-1][-1].
get(
"clone",
False):
215 print "Name of the last module needs to be modifiable."
217 src =
_getModule(process, src, mods[-1][0],
"FinalTrackRefitter",
218 options[mods[-1][0]][mods[-1][1]],
219 isCosmics = isCosmics, **(mods[-1][2]))
220 modules.append(getattr(process, src))
222 moduleSum = modules[0]
223 for mod
in modules[1:]:
225 return cms.Sequence(moduleSum)
static std::string join(char **cmd)
def _getModule
### Auxiliary functions ###
T get(const Candidate &c)