CMS 3D CMS Logo

trackSplittingValidationTemplates.py
Go to the documentation of this file.
1 
3 TrackSplittingTemplate="""
4 
5 #adding this ~doubles the efficiency of selection
6 process.FittingSmootherRKP5.EstimateCut = -1
7 
8 .oO[subdetselection]Oo.
9 
10 # Use compressions settings of TFile
11 # see https://root.cern.ch/root/html534/TFile.html#TFile:SetCompressionSettings
12 # settings = 100 * algorithm + level
13 # level is from 1 (small) to 9 (large compression)
14 # algo: 1 (ZLIB), 2 (LMZA)
15 # see more about compression & performance: https://root.cern.ch/root/html534/guides/users-guide/InputOutput.html#compression-and-performance
16 compressionSettings = 207
17 process.cosmicValidation = cms.EDAnalyzer("CosmicSplitterValidation",
18  compressionSettings = cms.untracked.int32(compressionSettings),
19  ifSplitMuons = cms.bool(False),
20  ifTrackMCTruth = cms.bool(False),
21  checkIfGolden = cms.bool(False),
22  splitTracks = cms.InputTag("FinalTrackRefitter","","splitter"),
23  splitGlobalMuons = cms.InputTag("muons","","splitter"),
24  originalTracks = cms.InputTag("FirstTrackRefitter","","splitter"),
25  originalGlobalMuons = cms.InputTag("muons","","Rec")
26 )
27 """
28 
29 
31 TrackSplittingSequence = "process.cosmicValidation"
32 
33 
34 
36 trackSplitPlotExecution="""
37 #make track splitting plots
38 
39 cp .oO[trackSplitPlotScriptPath]Oo. .
40 root -x -b -q TkAlTrackSplitPlot.C++
41 
42 """
43 
44 
46 
47 trackSplitPlotTemplate="""
48 #include "Alignment/OfflineValidation/macros/trackSplitPlot.C"
49 
50 /****************************************
51 This can be run directly in root, or you
52  can run ./TkAlMerge.sh in this directory
53 It can be run as is, or adjusted to fit
54  for misalignments or to only make
55  certain plots
56 ****************************************/
57 
58 /********************************
59 To make ALL plots (247 in total):
60  leave this file as is
61 ********************************/
62 
63 /**************************************************************************
64 to make all plots involving a single x or y variable, or both:
65 Uncomment the line marked (B), and fill in for xvar and yvar
66 
67 Examples:
68 
69  xvar = "dxy", yvar = "ptrel" - makes plots of dxy vs Delta_pT/pT
70  (4 total - profile and resolution,
71  of Delta_pT/pT and its pull
72  distribution)
73  xvar = "all", yvar = "pt" - makes all plots involving Delta_pT
74  (not Delta_pT/pT)
75  (30 plots total:
76  histogram and pull distribution, and
77  their mean and width as a function
78  of the 7 x variables)
79  xvar = "", yvar = "all" - makes all histograms of all y variables
80  (including Delta_pT/pT)
81  (16 plots total - 8 y variables,
82  regular and pull histograms)
83 **************************************************************************/
84 
85 /**************************************************************************************
86 To make a custom selection of plots:
87 Uncomment the lines marked (C) and this section, and fill in matrix however you want */
88 
89 /*
90 Bool_t plotmatrix[xsize][ysize];
91 void fillmatrix()
92 {
93  for (int x = 0; x < xsize; x++)
94  for (int y = 0; y < ysize; y++)
95  plotmatrix[x][y] = (.............................);
96 }
97 */
98 
99 /*
100 The variables are defined in Alignment/OfflineValidation/macros/trackSplitPlot.h
101  as follows:
102 TString xvariables[xsize] = {"", "pt", "eta", "phi", "dz", "dxy", "theta",
103  "qoverpt"};
104 
105 TString yvariables[ysize] = {"pt", "pt", "eta", "phi", "dz", "dxy", "theta",
106  "qoverpt", ""};
107 Bool_t relativearray[ysize] = {true, false, false, false, false, false, false,
108  false, false};
109 Use matrix[x][y] = true to make that plot, and false not to make it.
110 **************************************************************************************/
111 
112 /*************************************************************************************
113 To fit for a misalignment, which can be combined with any other option:
114 Uncomment the line marked (A) and this section, and choose your misalignment */
115 
116 /*
117 TString misalignment = "choose one";
118 double *values = 0;
119 double *phases = 0;
120 //or:
121 // double values[number of files] = {...};
122 // double phases[number of files] = {...};
123 */
124 
125 /*
126 The options for misalignment are sagitta, elliptical, skew, telescope, or layerRot.
127 If the magnitude and phase of the misalignment are known (i.e. Monte Carlo data using
128  a geometry produced by the systematic misalignment tool), make values and phases into
129  arrays, with one entry for each file, to make a plot of the result of the fit vs. the
130  misalignment value.
131 phases must be filled in for sagitta, elliptical, and skew if values is;
132  for the others it has no effect
133 *************************************************************************************/
134 
135 void TkAlTrackSplitPlot()
136 {
137  TkAlStyle::legendheader = ".oO[legendheader]Oo.";
138  TkAlStyle::legendoptions = ".oO[legendoptions]Oo.";
139  TkAlStyle::set(.oO[publicationstatus]Oo., .oO[era]Oo., ".oO[customtitle]Oo.", ".oO[customrighttitle]Oo.");
140  outliercut = .oO[outliercut]Oo.;
141  //fillmatrix(); //(C)
142  subdetector = ".oO[subdetector]Oo.";
143  makePlots(
144 .oO[PlottingInstantiation]Oo.
145  ,
146  //misalignment,values,phases, //(A)
147  ".oO[datadir]Oo./.oO[PlotsDirName]Oo."
148  //,"xvar","yvar" //(B)
149  //,plotmatrix //(C)
150  );
151 }
152 """