CMS 3D CMS Logo

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