Back to home page

Project CMSSW displayed by LXR

 
 

    


Warning, /Validation/DTRecHits/test/summaryPlot.gnu is written in an unsupported language. File is not indexed.

0001 # Produce summary plots from the tables generated with writeSummaryTable.r.
0002 #
0003 # Requires gnuplot 4.6. The font path can be set with the environment variable GDFONTPATH.
0004 # 
0005 
0006 reset
0007 set macro
0008 
0009 #Set the input file here
0010 myfile =  '"<sort -gs -k 2 RelValZMM5312_BP7X_noDRR_summary.txt "'
0011 
0012 
0013 #Set this to 1 to print plots to png files
0014 print=1
0015 
0016 # Output to png viewer
0017 set terminal png enhanced font "Arial,14" size 800,600
0018 set output '| display png:-'
0019 
0020 
0021 ######################################################################
0022 set pointsize 1
0023 set grid
0024 
0025 set key reverse Left font ",14" opaque
0026 
0027 theta=0
0028 phi=1
0029 
0030 set arrow 2 from 180-18,graph 0 to 180-18,graph 1 nohead  back lt 1 lc -1 lw 1
0031 set arrow 3 from 360-18,graph 0 to 360-18,graph 1 nohead  back lt 1 lc -1 lw 1
0032 set arrow 4 from 540-18,graph 0 to 540-18,graph 1 nohead  back lt 1 lc -1 lw 1
0033 
0034 #set arrow 2 from 180,graph 0 to 180,graph 1 nohead  back lt 22 lw 1
0035 #set arrow 3 from 360,graph 0 to 360,graph 1 nohead  back lt 22 lw 1
0036 #set arrow 4 from 540,graph 0 to 540,graph 0.85 nohead  back lt 22 lw 1
0037 
0038 set xtics ("W-2 MB1" 0, "W-1" 36, "W0" 72, "W1" 108, "W2" 144, \
0039            "W-2 MB2" 180, "W-1" 216, "W0" 252, "W1" 288, "W2" 324, \
0040            "W-2 MB3" 360, "W-1" 396, "W0" 432, "W1" 468, "W2" 504, \
0041            "W-2 MB4" 540, "W-1" 568, "W0" 596, "W1" 624, "W2" 652) ;\
0042 #set xrange[0:]
0043 set xrange[-18:668]
0044 set xtics rotate by -45
0045 
0046 
0047 set label 1 "MB1" at  72,graph 0.05 center
0048 set label 2 "MB2" at 252,graph 0.05 center
0049 set label 3 "MB3" at 432,graph 0.05 center
0050 set label 4 "MB4" at 596,graph 0.05 center
0051 
0052 
0053 ######################################################################
0054 
0055 sl=phi
0056 #sl=theta
0057 
0058 if (sl==theta) unset arrow 4
0059 
0060 
0061 
0062 # Fields:
0063 # 1:W 2:St 3:sec 4:SL 5:effS1RPhi 6:effS3RPhi 7:effSeg 8:resHit 9:pullHit 10:meanAngle  11:sigmaAngle 12:meanAngle_pull 13:sigmaAngle_pull 14:meanPos_pull 15:sigmaPos_pull
0064 
0065 
0066 # We use "set label 99" instead of ylabel, so that it can be right-aligned. 
0067 set ylabel " " 
0068 
0069 #### Hit Resolution
0070 if (print) {set output "TrueHitReso.png"}
0071 set yrange [100:900]
0072 set label 99 "True Hit Resolution [{/Symbol m}m]" rotate right at screen 0.02,0.97
0073 plot \
0074 @myfile using (($3)==1&&int($4)==1?$8*10000:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0075 @myfile using (($3)==1&&int($4)==2?$8*10000:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13
0076 
0077 
0078 #horizontal line for pull and eff plots
0079 set arrow 1 from -18,1 to 668,1 nohead back lt 0 lw 2 lc 0
0080 
0081 #### Hit Pull
0082 if (print) {set output "TrueHitPull.png"}
0083 set yrange [0:2]
0084 set label 99 "True Hit Pull" rotate right at screen 0.02,0.97
0085 plot \
0086 @myfile using (($3)==1&&int($4)==1?$9:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0087 @myfile using (($3)==1&&int($4)==2?$9:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13
0088 
0089 
0090 #### Hit Eff
0091 if (print) {set output "TrueHitEff.png"}
0092 set yrange [0.8:1.05]
0093 set label 99 "True Hit Efficiency" rotate right at screen 0.02,0.97
0094 plot \
0095 @myfile using (($3)==1&&int($4)==1?$5:1/0) title '{/Symbol f} SLs, S1' w p pt  5 ps 1.4 lc 4, \
0096 @myfile using (($3)==1&&int($4)==1?$6:1/0) title '{/Symbol f} SLs, S3' w p pt  4 ps 1.4 lc 4, \
0097 @myfile using (($3)==1&&int($4)==2?$5:1/0) title '{/Symbol q} SLs, S1' w p pt 13 ps 1.5 lc 13, \
0098 @myfile using (($3)==1&&int($4)==2?$6:1/0) title '{/Symbol q} SLs, S3' w p pt 12 ps 1.5 lc 13
0099 
0100 
0101 ### Segment eff
0102 if (print) {set output "TrueSegmentEff.png"}
0103 set yrange [0.8:1.05]
0104 set label 99 "True Segment Efficiency" rotate right at screen 0.02,0.97
0105 plot \
0106 @myfile using (($3)==1&&int($4)==1?$7:1/0) title '4D segment' w p pt  5 ps 1.4 lc 4
0107 
0108 
0109 ### Segment position resolution
0110 unset arrow 1
0111 if (print) {set output "TrueSegmentPosReso.png"}
0112 set yrange [0:500]
0113 set label 99 "Segment Position Resolution [{/Symbol m}m]" rotate right at screen 0.02,0.97
0114 plot \
0115 @myfile using (($3)==1&&int($4)==1?$17*10000:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0116 @myfile using (($3)==1&&int($4)==2?$17*10000:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13
0117 
0118 
0119 ### Segment angular resolution
0120 #unset arrow 1
0121 if (print) {set output "TrueSegmentAngleReso.png"}
0122 set yrange [0:20]
0123 set label 99 "Segment Angle Resolution [mrad]" rotate right at screen 0.02,0.97
0124 plot \
0125 @myfile using (($3)==1&&int($4)==1?$11*1000.:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0126 @myfile using (($3)==1&&int($4)==1?$11*10000.:1/0) title '{/Symbol f} SLs (10x)' w p pt 4 ps 1.4 lc 4, \
0127 @myfile using (($3)==1&&int($4)==2?$11*1000.:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13
0128 
0129 
0130 ### Segment average angle bias
0131 if (print) {set output "TrueSegmentAngleBias.png"}
0132 set arrow 1 from -18,0 to 668,0 nohead back lt 0 lw 2 lc 0
0133 set yrange [-3:3]
0134 set label 99 "Segment Average Angle bias [mrad]" rotate right at screen 0.02,0.97
0135 plot \
0136 @myfile using (($3)==1&&int($4)==1?$10*1000.:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0137 @myfile using (($3)==1&&int($4)==2?$10*1000.:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13
0138 
0139 ### Segment angular pull width
0140 set arrow 1 from -18,1 to 668,1 nohead back lt 0 lw 2 lc 0
0141 if (print) {set output "TrueSegmentAnglePull.png"}
0142 set yrange [0:2]
0143 set label 99 "Segment Angle Pull Width" rotate right at screen 0.02,0.97
0144 plot \
0145 @myfile using (($3)==1&&int($4)==1?$13:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0146 @myfile using (($3)==1&&int($4)==2?$13:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13
0147 
0148 ### Segment position pull width
0149 if (print) {set output "TrueSegmentPosPull.png"}
0150 set yrange [0:2]
0151 set label 99 "Segment Position Pull Width" rotate right at screen 0.02,0.97
0152 plot \
0153 @myfile using (($3)==1&&int($4)==1?$15:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0154 @myfile using (($3)==1&&int($4)==2?$15:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13
0155 
0156 ### Number of segment ratio
0157 if (print) {set output "TrueNSegRatio.png"}
0158 set yrange [0:0.15]
0159 set label 99 "(ev with more than 2 seg)/(ev with more than 1 seg) " rotate right at screen 0.02,0.97
0160 plot \
0161 @myfile using (($3)==1&&int($4)==1?$18:1/0) title '4D segment' w p pt  5 ps 1.4 lc 4
0162 
0163 
0164 ### p0
0165 if (print) {set output "TrueP0.png"}
0166 set yrange [0:0.8]
0167 set label 99 "p0" rotate right at screen 0.02,0.97
0168 plot \
0169 @myfile using (($3)==1&&int($4)==1?$19:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0170 @myfile using (($3)==1&&int($4)==2?$19:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13
0171 
0172 ### p1
0173 if (print) {set output "TrueP1.png"}
0174 set yrange [-1:1]
0175 set label 99 "p0" rotate right at screen 0.02,0.97
0176 plot \
0177 @myfile using (($3)==1&&int($4)==1?$20:1/0) title '{/Symbol f} SLs' w p pt  5 ps 1.4 lc 4, \
0178 @myfile using (($3)==1&&int($4)==2?$20:1/0) title '{/Symbol q} SLs' w p pt 13 ps 1.5 lc 13