|
|
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 ###########################################
31 ##necessary fix for the moment to avoid
32 ##Assymmetric forward layers in TrackerException going through path p
33 ##---- ScheduleExecutionFailure END
34 ##an exception occurred during current event processing
35 ##cms::Exception caught in EventProcessor and rethrown
36 ##---- EventProcessorFailure END
37 ############################################
38 #import CalibTracker.Configuration.Common.PoolDBESSource_cfi
39 from CondCore.DBCommon.CondDBSetup_cfi import *
40 #load the Global Position Rcd
41 process.globalPosition = cms.ESSource("PoolDBESSource", CondDBSetup,
42 toGet = cms.VPSet(cms.PSet(
43 record =cms.string('GlobalPositionRcd'),
44 tag= cms.string('IdealGeometry')
46 connect = cms.string('frontier://FrontierProd/CMS_COND_31X_FROM21X')
48 process.es_prefer_GPRcd = cms.ESPrefer("PoolDBESSource","globalPosition")
49 ##########################################
52 # track selectors and refitting
53 process.load("Alignment.CommonAlignmentProducer.AlignmentTrackSelector_cfi")
54 process.load("RecoVertex.BeamSpotProducer.BeamSpot_cff")
55 process.load("RecoTracker.TrackProducer.TrackRefitters_cff")
58 .oO[datasetDefinition]Oo.
60 ## for craft SP skim v5
61 #process.source.inputCommands = cms.untracked.vstring("keep *","drop *_*_*_FU","drop *_*_*_HLT","drop *_MEtoEDMConverter_*_*","drop *_lumiProducer_*_REPACKER")
62 #process.source.dropDescendantsOfDroppedBranches = cms.untracked.bool( False )
66 process.load("Configuration.StandardSequences..oO[magneticField]Oo._cff")
69 from CondCore.DBCommon.CondDBSetup_cfi import *
72 ## tracker alignment for craft...............................................................
75 ## track hit filter.............................................................
78 import RecoTracker.TrackProducer.TrackRefitters_cff
79 process.TrackRefitter1 = RecoTracker.TrackProducer.TrackRefitterP5_cfi.TrackRefitterP5.clone(
80 src = '.oO[TrackCollection]Oo.',
81 TrajectoryInEvent = True,
82 TTRHBuilder = "WithTrackAngle",
86 process.FittingSmootherRKP5.EstimateCut = -1
88 # module configuration
89 # alignment track selector
90 process.AlignmentTrackSelector.src = "TrackRefitter1"
91 process.AlignmentTrackSelector.filter = True
92 process.AlignmentTrackSelector.applyBasicCuts = True
93 process.AlignmentTrackSelector.ptMin = 0.
94 process.AlignmentTrackSelector.pMin = 4.
95 process.AlignmentTrackSelector.ptMax = 9999.
96 process.AlignmentTrackSelector.pMax = 9999.
97 process.AlignmentTrackSelector.etaMin = -9999.
98 process.AlignmentTrackSelector.etaMax = 9999.
99 process.AlignmentTrackSelector.nHitMin = 10
100 process.AlignmentTrackSelector.nHitMin2D = 2
101 process.AlignmentTrackSelector.chi2nMax = 9999.
102 process.AlignmentTrackSelector.applyMultiplicityFilter = True
103 process.AlignmentTrackSelector.maxMultiplicity = 1
104 process.AlignmentTrackSelector.applyNHighestPt = False
105 process.AlignmentTrackSelector.nHighestPt = 1
106 process.AlignmentTrackSelector.seedOnlyFrom = 0
107 process.AlignmentTrackSelector.applyIsolationCut = False
108 process.AlignmentTrackSelector.minHitIsolation = 0.8
109 process.AlignmentTrackSelector.applyChargeCheck = False
110 process.AlignmentTrackSelector.minHitChargeStrip = 50.
111 process.AlignmentTrackSelector.minHitsPerSubDet.in.oO[subdetector]Oo. = 2
112 #process.AlignmentTrackSelector.trackQualities = ["highPurity"]
113 #process.AlignmentTrackSelector.iterativeTrackingSteps = ["iter1","iter2"]
114 process.KFFittingSmootherWithOutliersRejectionAndRK.EstimateCut=30.0
115 process.KFFittingSmootherWithOutliersRejectionAndRK.MinNumberOfHits=4
116 #process.FittingSmootherRKP5.EstimateCut = 20.0
117 #process.FittingSmootherRKP5.MinNumberOfHits = 4
119 # configuration of the track spitting module
120 # new cuts allow for cutting on the impact parameter of the original track
121 process.load("RecoTracker.FinalTrackSelectors.cosmicTrackSplitter_cfi")
122 process.cosmicTrackSplitter.tracks = 'AlignmentTrackSelector'
123 process.cosmicTrackSplitter.tjTkAssociationMapTag = 'TrackRefitter1'
124 #process.cosmicTrackSplitter.excludePixelHits = False
126 #---------------------------------------------------------------------
127 # the output of the track hit filter are track candidates
128 # give them to the TrackProducer
129 process.load("RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff")
130 process.HitFilteredTracks = RecoTracker.TrackProducer.CTFFinalFitWithMaterialP5_cff.ctfWithMaterialTracksCosmics.clone(
131 src = 'cosmicTrackSplitter',
132 TrajectoryInEvent = True,
133 TTRHBuilder = "WithTrackAngle",
134 NavigationSchool = ""
137 process.TrackRefitter2 = process.TrackRefitter1.clone(
138 src = 'HitFilteredTracks'
141 ### Now adding the construction of global Muons
143 # In 74X it no longer works if ReconstructionCosmics is imported
144 # Results in 73X are identical with or without it so it seems safe to remove
145 #process.load("Configuration.StandardSequences.ReconstructionCosmics_cff")
147 process.cosmicValidation = cms.EDAnalyzer("CosmicSplitterValidation",
148 ifSplitMuons = cms.bool(False),
149 ifTrackMCTruth = cms.bool(False),
150 checkIfGolden = cms.bool(False),
151 splitTracks = cms.InputTag("TrackRefitter2","","splitter"),
152 splitGlobalMuons = cms.InputTag("muons","","splitter"),
153 originalTracks = cms.InputTag("TrackRefitter1","","splitter"),
154 originalGlobalMuons = cms.InputTag("muons","","Rec")
157 process.TFileService = cms.Service("TFileService",
158 fileName = cms.string('.oO[outputFile]Oo.')
161 process.p = cms.Path(process.offlineBeamSpot*process.TrackRefitter1*process.AlignmentTrackSelector*process.cosmicTrackSplitter*process.HitFilteredTracks*process.TrackRefitter2*process.cosmicValidation)
168 trackSplitPlotExecution=
"""
169 #make track splitting plots
171 rfcp .oO[trackSplitPlotScriptPath]Oo. .
172 root -x -b -q TkAlTrackSplitPlot.C++
179 trackSplitPlotTemplate=
"""
180 #include ".oO[CMSSW_BASE]Oo./src/Alignment/OfflineValidation/macros/trackSplitPlot.C"
182 /****************************************
183 This can be run directly in root, or you
184 can run ./TkAlMerge.sh in this directory
185 It can be run as is, or adjusted to fit
186 for misalignments or to only make
188 ****************************************/
190 /********************************
191 To make ALL plots (313 in total):
192 leave this file as is
193 ********************************/
195 /**************************************************************************
196 to make all plots involving a single x or y variable, or both:
197 Uncomment the line marked (B), and fill in for xvar and yvar
201 xvar = "nHits", yvar = "ptrel" - makes plots of nHits vs Delta_pt/pt_org
202 (4 total - profile and resolution,
203 of Delta_pt/pt_org and its pull
205 xvar = "all", yvar = "pt" - makes all plots involving Delta_pt
206 (not Delta_pt/pt_org)
208 histogram and pull distribution, and
209 their mean and width as a function
210 of the 9 x variables)
211 xvar = "", yvar = "all" - makes all histograms of all y variables
212 (including Delta_pt/pt_org)
213 (16 plots total - 8 y variables,
214 regular and pull histograms)
215 **************************************************************************/
217 /**************************************************************************************
218 To make a custom selection of plots:
219 Uncomment the lines marked (C) and this section, and fill in matrix however you want */
222 Bool_t plotmatrix[xsize][ysize];
225 for (int x = 0; x < xsize; x++)
226 for (int y = 0; y < ysize; y++)
227 plotmatrix[x][y] = (.............................);
232 The variables are defined in Alignment/OfflineValidation/macros/trackSplitPlot.h
234 TString xvariables[xsize] = {"", "pt", "eta", "phi", "dz", "dxy", "theta",
235 "qoverpt", "runNumber", "nHits"};
237 TString yvariables[ysize] = {"pt", "pt", "eta", "phi", "dz", "dxy", "theta",
239 Bool_t relativearray[ysize] = {true, false, false, false, false, false, false,
241 Use matrix[x][y] = true to make that plot, and false not to make it.
242 **************************************************************************************/
244 /*************************************************************************************
245 To fit for a misalignment, which can be combined with any other option:
246 Uncomment the line marked (A) and this section, and choose your misalignment */
249 TString misalignment = "choose one";
253 // double values[number of files] = {...};
254 // double phases[number of files] = {...};
258 The options for misalignment are sagitta, elliptical, skew, telescope, or layerRot.
259 If the magnitude and phase of the misalignment are known (i.e. Monte Carlo data using
260 a geometry produced by the systematic misalignment tool), make values and phases into
261 arrays, with one entry for each file, to make a plot of the result of the fit vs. the
263 phases must be filled in for sagitta, elliptical, and skew if values is;
264 for the others it has no effect
265 *************************************************************************************/
267 void TkAlTrackSplitPlot()
269 //fillmatrix(); //(C)
271 ".oO[trackSplitPlotInstantiation]Oo.",
272 //misalignment,values,phases, //(A)
273 ".oO[datadir]Oo./TrackSplittingPlots"
274 //,"xvar","yvar" //(B)