|
|
Go to the documentation of this file.
3 TrackSplittingTemplate=
"""
4 import FWCore.ParameterSet.Config as cms
6 process = cms.Process("splitter")
11 process.load("FWCore.MessageLogger.MessageLogger_cfi")
12 MessageLogger = cms.Service("MessageLogger",
13 destinations = cms.untracked.vstring('LOGFILE_TrackSplitting_.oO[name]Oo.',
16 ## report only every 100th record
17 process.MessageLogger.cerr.FwkReport.reportEvery = 100
19 process.load('Configuration.StandardSequences.Services_cff')
20 process.load("Configuration.Geometry.GeometryDB_cff")
22 # including global tag
23 process.load("Configuration.StandardSequences.FrontierConditions_GlobalTag_cff")
25 #process.GlobalTag.connect = "frontier://FrontierProd/CMS_COND_21X_GLOBALTAG"
26 # process.GlobalTag.connect="frontier://FrontierProd/CMS_COND_31X_GLOBALTAG"
27 process.GlobalTag.globaltag = ".oO[GlobalTag]Oo."
30 # track selectors and refitting
31 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
32 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
33 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
36 .oO[datasetDefinition]Oo.
38 ## for craft SP skim v5
39 #process.source.inputCommands = cms.untracked.vstring("keep *","drop *_*_*_FU","drop *_*_*_HLT","drop *_MEtoEDMConverter_*_*","drop *_lumiProducer_*_REPACKER")
40 #process.source.dropDescendantsOfDroppedBranches = cms.untracked.bool( False )
44 process.load("Configuration.StandardSequences..oO[magneticField]Oo._cff")
47 from CondCore.DBCommon.CondDBSetup_cfi import *
50 ## tracker alignment for craft...............................................................
53 ## track hit filter.............................................................
56 import RecoTracker.TrackProducer.TrackRefitters_cff
57 process.TrackRefitter1 = RecoTracker.TrackProducer.TrackRefitterP5_cfi.TrackRefitterP5.clone(
58 src = '.oO[TrackCollection]Oo.',
59 TrajectoryInEvent = True,
60 TTRHBuilder = "WithTrackAngle",
64 process.FittingSmootherRKP5.EstimateCut = -1
66 # module configuration
67 # alignment track selector
68 process.AlignmentTrackSelector.src = "TrackRefitter1"
69 process.AlignmentTrackSelector.filter = True
70 process.AlignmentTrackSelector.applyBasicCuts = True
71 process.AlignmentTrackSelector.ptMin = 0.
72 process.AlignmentTrackSelector.pMin = 4.
73 process.AlignmentTrackSelector.ptMax = 9999.
74 process.AlignmentTrackSelector.pMax = 9999.
75 process.AlignmentTrackSelector.etaMin = -9999.
76 process.AlignmentTrackSelector.etaMax = 9999.
77 process.AlignmentTrackSelector.nHitMin = 10
78 process.AlignmentTrackSelector.nHitMin2D = 2
79 process.AlignmentTrackSelector.chi2nMax = 9999.
80 process.AlignmentTrackSelector.applyMultiplicityFilter = True
81 process.AlignmentTrackSelector.maxMultiplicity = 1
82 process.AlignmentTrackSelector.applyNHighestPt = False
83 process.AlignmentTrackSelector.nHighestPt = 1
84 process.AlignmentTrackSelector.seedOnlyFrom = 0
85 process.AlignmentTrackSelector.applyIsolationCut = False
86 process.AlignmentTrackSelector.minHitIsolation = 0.8
87 process.AlignmentTrackSelector.applyChargeCheck = False
88 process.AlignmentTrackSelector.minHitChargeStrip = 50.
89 process.AlignmentTrackSelector.minHitsPerSubDet.in.oO[subdetector]Oo. = 2
90 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
91 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
92 process.KFFittingSmootherWithOutliersRejectionAndRK.EstimateCut=30.0
93 process.KFFittingSmootherWithOutliersRejectionAndRK.MinNumberOfHits=4
94 #process.FittingSmootherRKP5.EstimateCut = 20.0
95 #process.FittingSmootherRKP5.MinNumberOfHits = 4
97 # configuration of the track spitting module
98 # new cuts allow for cutting on the impact parameter of the original track
99 process.load("RecoTracker.FinalTrackSelectors.cosmicTrackSplitter_cfi")
100 process.cosmicTrackSplitter.tracks = 'AlignmentTrackSelector'
101 process.cosmicTrackSplitter.tjTkAssociationMapTag = 'TrackRefitter1'
102 #process.cosmicTrackSplitter.excludePixelHits = False
104 #---------------------------------------------------------------------
105 # the output of the track hit filter are track candidates
106 # give them to the TrackProducer
107 process.load("RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff")
108 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
109 src = 'cosmicTrackSplitter',
110 TrajectoryInEvent = True,
111 TTRHBuilder = "WithTrackAngle",
112 NavigationSchool = ""
115 process.TrackRefitter2 = process.TrackRefitter1.clone(
116 src = 'HitFilteredTracks'
119 ### Now adding the construction of global Muons
121 # In 74X it no longer works if ReconstructionCosmics is imported
122 # Results in 73X are identical with or without it so it seems safe to remove
123 #process.load("Configuration.StandardSequences.ReconstructionCosmics_cff")
125 process.cosmicValidation = cms.EDAnalyzer("CosmicSplitterValidation",
126 ifSplitMuons = cms.bool(False),
127 ifTrackMCTruth = cms.bool(False),
128 checkIfGolden = cms.bool(False),
129 splitTracks = cms.InputTag("TrackRefitter2","","splitter"),
130 splitGlobalMuons = cms.InputTag("muons","","splitter"),
131 originalTracks = cms.InputTag("TrackRefitter1","","splitter"),
132 originalGlobalMuons = cms.InputTag("muons","","Rec")
135 process.TFileService = cms.Service("TFileService",
136 fileName = cms.string('.oO[outputFile]Oo.')
139 process.p = cms.Path(process.offlineBeamSpot*process.TrackRefitter1*process.AlignmentTrackSelector*process.cosmicTrackSplitter*process.HitFilteredTracks*process.TrackRefitter2*process.cosmicValidation)
146 trackSplitPlotExecution=
"""
147 #make track splitting plots
149 rfcp .oO[trackSplitPlotScriptPath]Oo. .
150 root -x -b -q TkAlTrackSplitPlot.C++
157 trackSplitPlotTemplate=
"""
158 #include ".oO[CMSSW_BASE]Oo./src/Alignment/OfflineValidation/macros/trackSplitPlot.C"
160 /****************************************
161 This can be run directly in root, or you
162 can run ./TkAlMerge.sh in this directory
163 It can be run as is, or adjusted to fit
164 for misalignments or to only make
166 ****************************************/
168 /********************************
169 To make ALL plots (313 in total):
170 leave this file as is
171 ********************************/
173 /**************************************************************************
174 to make all plots involving a single x or y variable, or both:
175 Uncomment the line marked (B), and fill in for xvar and yvar
179 xvar = "nHits", yvar = "ptrel" - makes plots of nHits vs Delta_pt/pt_org
180 (4 total - profile and resolution,
181 of Delta_pt/pt_org and its pull
183 xvar = "all", yvar = "pt" - makes all plots involving Delta_pt
184 (not Delta_pt/pt_org)
186 histogram and pull distribution, and
187 their mean and width as a function
188 of the 9 x variables)
189 xvar = "", yvar = "all" - makes all histograms of all y variables
190 (including Delta_pt/pt_org)
191 (16 plots total - 8 y variables,
192 regular and pull histograms)
193 **************************************************************************/
195 /**************************************************************************************
196 To make a custom selection of plots:
197 Uncomment the lines marked (C) and this section, and fill in matrix however you want */
200 Bool_t plotmatrix[xsize][ysize];
203 for (int x = 0; x < xsize; x++)
204 for (int y = 0; y < ysize; y++)
205 plotmatrix[x][y] = (.............................);
210 The variables are defined in Alignment/OfflineValidation/macros/trackSplitPlot.h
212 TString xvariables[xsize] = {"", "pt", "eta", "phi", "dz", "dxy", "theta",
213 "qoverpt", "runNumber", "nHits"};
215 TString yvariables[ysize] = {"pt", "pt", "eta", "phi", "dz", "dxy", "theta",
217 Bool_t relativearray[ysize] = {true, false, false, false, false, false, false,
219 Use matrix[x][y] = true to make that plot, and false not to make it.
220 **************************************************************************************/
222 /*************************************************************************************
223 To fit for a misalignment, which can be combined with any other option:
224 Uncomment the line marked (A) and this section, and choose your misalignment */
227 TString misalignment = "choose one";
231 // double values[number of files] = {...};
232 // double phases[number of files] = {...};
236 The options for misalignment are sagitta, elliptical, skew, telescope, or layerRot.
237 If the magnitude and phase of the misalignment are known (i.e. Monte Carlo data using
238 a geometry produced by the systematic misalignment tool), make values and phases into
239 arrays, with one entry for each file, to make a plot of the result of the fit vs. the
241 phases must be filled in for sagitta, elliptical, and skew if values is;
242 for the others it has no effect
243 *************************************************************************************/
245 void TkAlTrackSplitPlot()
247 //fillmatrix(); //(C)
249 ".oO[trackSplitPlotInstantiation]Oo.",
250 //misalignment,values,phases, //(A)
251 ".oO[datadir]Oo./TrackSplittingPlots"
252 //,"xvar","yvar" //(B)