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" or collection ==
"ALCARECOTkAlMinBiasHI" or collection ==
"hiGeneralTracks":
98 options[
"TrackSelector"][
"Alignment"].
update({
102 options[
"TrackHitFilter"][
"Tracker"].
update({
105 elif collection
in (
"ALCARECOTkAlCosmicsCTF0T",
106 "ALCARECOTkAlCosmicsInCollisions"):
108 options[
"TrackSelector"][
"HighPurity"] = {}
109 if not cosmicsDecoMode:
110 options[
"TrackHitFilter"][
"Tracker"].
update({
111 "StoNcommands": cms.vstring(
"ALL 18.0")
114 options[
"TrackHitFilter"][
"Tracker"].
update({
118 options[
"TrackHitFilter"][
"Tracker"].
update({
121 options[
"TrackSelector"][
"Alignment"].
update({
125 "applyMultiplicityFilter":
True,
128 elif collection ==
"ALCARECOTkAlMuonIsolated" or collection ==
"ALCARECOTkAlMuonIsolatedHI" or collection ==
"ALCARECOTkAlMuonIsolatedPA":
129 options[
"TrackSelector"][
"Alignment"].
update({
130 (
"minHitsPerSubDet",
"inPIXEL"): 1,
133 "applyMultiplicityFilter":
True,
134 "maxMultiplicity": 1,
136 elif collection ==
"ALCARECOTkAlZMuMu" or collection ==
"ALCARECOTkAlZMuMuHI" or collection ==
"ALCARECOTkAlZMuMuPA":
137 options[
"TrackSelector"][
"Alignment"].
update({
142 "applyMultiplicityFilter":
True,
143 "minMultiplicity": 2,
144 "maxMultiplicity": 2,
145 (
"minHitsPerSubDet",
"inPIXEL"): 1,
146 (
"TwoBodyDecaySelector",
"applyChargeFilter"):
True,
147 (
"TwoBodyDecaySelector",
"charge"): 0,
148 (
"TwoBodyDecaySelector",
149 "applyMassrangeFilter"):
not openMassWindow,
150 (
"TwoBodyDecaySelector",
"minXMass"): 85.8,
151 (
"TwoBodyDecaySelector",
"maxXMass"): 95.8,
152 (
"TwoBodyDecaySelector",
"daughterMass"): 0.105
154 options[
"TrackHitFilter"][
"Tracker"].
update({
159 print "Unknown input track collection:", collection
169 mods = [(
"TrackSelector",
"Alignment", {
"method":
"load"}),
170 (
"TrackRefitter",
"First", {
"method":
"load",
172 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
173 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"})]
174 options[
"TrackSelector"][
"Alignment"].
update(
175 options[
"TrackSelector"][
"HighPurity"])
177 mods = [(
"TrackSelector",
"HighPurity", {
"method":
"import"}),
178 (
"TrackRefitter",
"First", {
"method":
"load",
180 (
"TrackHitFilter",
"Tracker", {
"method":
"load"}),
181 (
"TrackFitter",
"HitFilteredTracks", {
"method":
"import"}),
182 (
"TrackSelector",
"Alignment", {
"method":
"load"}),
183 (
"TrackRefitter",
"Second", {
"method":
"load",
185 if isCosmics: mods = mods[1:]
193 if momentumConstraint
is not None:
194 for mod
in options[
"TrackRefitter"]:
195 options[
"TrackRefitter"][mod].
update({
196 "constraint":
"momentum",
197 "srcConstr": momentumConstraint
208 for mod
in mods[:-1]:
209 src =
_getModule(process, src, mod[0],
"".
join(reversed(mod[:-1])),
210 options[mod[0]][mod[1]], isCosmics = isCosmics,
212 modules.append(getattr(process, src))
214 if mods[-1][-1][
"method"]
is "load" and \
215 not mods[-1][-1].
get(
"clone",
False):
216 print "Name of the last module needs to be modifiable."
218 src =
_getModule(process, src, mods[-1][0],
"FinalTrackRefitter",
219 options[mods[-1][0]][mods[-1][1]],
220 isCosmics = isCosmics, **(mods[-1][2]))
221 modules.append(getattr(process, src))
223 moduleSum = modules[0]
224 for mod
in modules[1:]:
226 return cms.Sequence(moduleSum)
static std::string join(char **cmd)
def _getModule
### Auxiliary functions ###
T get(const Candidate &c)