Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-11-28 23:11:14

0001 from ROOT import TStyle, kWhite, kTRUE
0002 from ROOT import gROOT, gStyle
0003 from ROOT import kGray, kAzure, kMagenta, kOrange, kWhite
0004 from ROOT import kRed, kBlue, kGreen, kPink, kYellow
0005 from ROOT import TLine, TLatex, TColor
0006 
0007 from collections import namedtuple, OrderedDict
0008 from math import sin, cos, tan, atan, exp, pi
0009 from array import array
0010 
0011 from Validation.Geometry.plot_utils import Plot_params
0012 
0013 plots = {}
0014 plots.setdefault('x_vs_eta', Plot_params(10, '#eta', 'x/X_{0}', 0.0, 145., -4.0, 4.0, '', 0, 0., 0., 0, 1))
0015 plots.setdefault('x_vs_phi', Plot_params(20, '#varphi [rad]', 'x/X_{0}', 0.0, 6.2, -4.0, 4.0, '', 0, 0., 0., 0, 1))
0016 plots.setdefault('x_vs_R',   Plot_params(40, 'R [cm]', 'x/X_{0}', 0.0, 70.0, 0.0, 1200.0, '', 0, 0., 0., 0, 1))
0017 plots.setdefault('l_vs_eta', Plot_params(10010, '#eta', 'x/#lambda_{I}', 0.0, 22.8, -4.0, 4.0, '', 0, 0., 0., 0, 1))
0018 plots.setdefault('l_vs_phi', Plot_params(10020, '#varphi [rad]', 'x/#lambda_{I}', 0.0, 1.2, -4.0, 4.0, '', 0, 0., 0., 0, 1))
0019 plots.setdefault('l_vs_R',   Plot_params(10040, 'R [cm]', 'x/#lambda_{I}', 0.0, 7.5, 0.0, 1200.0, '', 0, 0., 0., 0, 1))
0020 plots.setdefault('x_vs_eta_vs_phi', Plot_params(30, '#eta', '#varphi', 0., 0., 0., 0., 'x/X_{0}', 0, -1., -1., 0, 1))
0021 plots.setdefault('l_vs_eta_vs_phi', Plot_params(10030, '#eta', '#varphi', 0., 0., 0., 0., 'x/#lambda_{I}', 0, -1, -1, 0, 1))
0022 plots.setdefault('x_vs_z_vs_Rsum', Plot_params(50, 'z [mm]', 'R [mm]', 0., 0., 0., 0., '#Sigmax/X_{0}', 1, -1., -1., 0, 0))
0023 plots.setdefault('x_vs_z_vs_Rsumcos', Plot_params(52, 'z [mm]', 'R [mm]', 0., 0., 0., 0., '#Sigmax/X_{0}', 1, -1., -1., 0, 0))
0024 #plots.setdefault('x_vs_z_vs_R', Plot_params(60, 'z [mm]', 'R [mm]', 0., 0., 0., 0., '1/X_{0}', 1, -1., -1., 0, 0))
0025 plots.setdefault('x_vs_z_vs_Rloc', Plot_params(70, 'z [mm]', 'R [mm]', 0., 0., 0., 0., 'x/X_{0}', 1, -1., -1., 0, 0))
0026 plots.setdefault('x_vs_z_vs_Rloccos', Plot_params(72, 'z [mm]', 'R [mm]', 0., 0., 0., 0., 'x/X_{0}', 1, -1., -1., 0, 0))
0027 plots.setdefault('l_vs_z_vs_Rsum', Plot_params(10050, 'z [mm]', 'R [mm]', 0., 0., 0., 0., '#Sigmax/#lambda_{I}', 1, -1., -1., 0, 0))
0028 plots.setdefault('l_vs_z_vs_Rsumcos', Plot_params(10052, 'z [mm]', 'R [mm]', 0., 0., 0., 0., '#Sigmax/#lambda_{I}', 1, -1., -1., 0, 0))
0029 plots.setdefault('l_vs_z_vs_R', Plot_params(10060, 'z [mm]', 'R [mm]', 0., 0., 0., 0., '1/#lambda_{I}', 1, -1., -1., 0, 0))
0030 plots.setdefault('l_vs_z_vs_Rloc', Plot_params(10070, 'z [mm]', 'R [mm]', 0., 0., 0., 0., 'x/#lambda_{I}', 1, -1., -1., 0, 0))
0031 plots.setdefault('l_vs_z_vs_Rloccos', Plot_params(10072, 'z [mm]', 'R [mm]', 0., 0., 0., 0., 'x/#lambda_{I}', 1, -1., -1., 0, 0))
0032 plots.setdefault('x_over_l_vs_eta', Plot_params(10, '#eta', '(x/X_{0})/(x/#lambda_{I})', 0., 0., 0., 0., '', 0, -1, -1, 0, 0))
0033 plots.setdefault('x_over_l_vs_phi', Plot_params(20, '#varphi [rad]', '(x/X_{0})/(x/#lambda_{I})', 0., 0., 0., 0., '', 0, -1, -1, 0, 0))
0034 
0035 # Conversion name from the label (key) to the components in CMSSW/Geometry
0036 _LABELS2COMPS = {'BeamPipe': 'BEAM', #There are other BEAM volumes but there are behind the region of our interest. 
0037                  'Tracker': 'Tracker', 
0038                  #CALOECTSFront contains both CALOECTSModerator and EndcapTimingLayer plus 
0039                  #thermal screen but I want to split those. 
0040                  #In V16(D86) there is no CALOECTSMiddle.
0041                  'EndcapTimingLayer': 'EndcapTimingLayer',
0042                  'Neutron Moderator + Thermal Screen' : 'CALOECTSModerator',
0043                  'HGCal + HGCal Service + Thermal Screen' : 'CALOECTSRear',
0044                  'Solenoid Magnet' : 'MGNT',
0045                  'Muon Wheels and Cables' : 'MB',
0046                  'ECAL': 'ECAL',
0047                  'HCal': 'HCal',
0048                  'FromVertexToBackOfHGCal' : ['BEAM','Tracker','ECAL','HCal','EndcapTimingLayer','CALOECTSModerator','CALOECTSRear','MGNT','MB'],
0049                  'HGCal': 'HGCal',
0050                  'HGCalEE': 'HGCalEE',
0051                  'HGCalHE': ['HGCalHEsil', 'HGCalHEmix']
0052                  }
0053 
0054 # Compounds are used to stick together different part of the HGCal
0055 # detector, so that their cumulative material description can be
0056 # derived. The key name can be generic, while the names in the
0057 # associated list must be such that an appropriate material
0058 # description file, in ROOT format, is present while producing the
0059 # cumulative plot. A missing element will invalidate the full
0060 # procedure.
0061 COMPOUNDS = OrderedDict()
0062 COMPOUNDS["HGCal"] = ["HGCal"]
0063 COMPOUNDS["HGCalEE"] = ["HGCalEE"]
0064 COMPOUNDS["HGCalHE"] = ["HGCalHEsil", "HGCalHEmix"]
0065 COMPOUNDS["FromVertexToBackOfHGCal"] = ["BeamPipe","Tracker","ECAL","HCal","EndcapTimingLayer","Neutron Moderator + Thermal Screen","HGCal + HGCal Service + Thermal Screen","Solenoid Magnet","Muon Wheels and Cables"]
0066 
0067 # The DETECTORS must be the single component of the HGCal for which
0068 # the user can ask for the corresponding material description.
0069 # BE CAREFUL: When running on a single detector and not through all 
0070 # only uncomment that one below. e.g. when running on HGCal only you should 
0071 # have only: 
0072 # DETECTORS["HGCal"] = kAzure-5
0073 # and others should be commented out.
0074 DETECTORS = OrderedDict()
0075 DETECTORS["BeamPipe"] = kGray+2
0076 DETECTORS["Tracker"]  = 9 #kAzure-5
0077 DETECTORS["ECAL"] = 2 #kOrange+10
0078 DETECTORS["HCal"] = 6  #kMagenta-2
0079 DETECTORS["EndcapTimingLayer"] = 7#kAzure-9 
0080 DETECTORS["Neutron Moderator + Thermal Screen"] = 46#kOrange+5
0081 DETECTORS["HGCal + HGCal Service + Thermal Screen"] = 5#kOrange-2
0082 DETECTORS["Solenoid Magnet"] = 4#kGray+5
0083 DETECTORS["Muon Wheels and Cables"] = 28
0084 #When running to get the R vs z sum of all subdetectors comment out above and 
0085 #uncomment the next line
0086 #DETECTORS["FromVertexToBackOfHGCal"] = 30
0087 
0088 
0089 # sDETS are the label of the HGCal elements in the Reconstruction
0090 # geometry. They are all used to derive the reconstruction material
0091 # profile to be compared to the one obtained directly from the
0092 # simulation. A missing key in the real reconstruction geometry is not
0093 # a problem, since this will imply that the corresponding plotting
0094 # routine will skip that missing part. For this reason this map can be
0095 # made as inclusive as possible with respect to the many
0096 # reconstruction geometries in CMSSW.
0097 sDETS = OrderedDict()
0098 #sDETS["HGCalEE"] = kRed
0099 #sDETS["HGCalHEsil"] = kBlue
0100 #sDETS["HGCalHEmix"] = kGreen
0101 sDETS["ECAL"] = kBlue
0102 sDETS["HCal"] = kOrange
0103 #sDETS[""] = kYellow
0104 #sDETS[""] = kOrange
0105 #sDETS[""] = kPink
0106 
0107 # hist_label_to_num contains the logical names of the HGCal detector
0108 # that holds material. They are therefore not aware of which detector
0109 # they belong to, but they are stored in specific plots in all the
0110 # mat*root files produced. The numbering of the plots is identical
0111 # across all files.
0112 hist_label_to_num = OrderedDict()
0113 hist_label_to_num['COP'] = [100, 2, 'Copper'] # Index first, color second, legend label third
0114 hist_label_to_num['SCI'] = [200, 3, 'Scintillator']
0115 hist_label_to_num['CAB'] = [300, 4, 'Cables']
0116 hist_label_to_num['MNE'] = [400, 5, 'HGC_G10-FR4']
0117 hist_label_to_num['SIL'] = [500, 6, 'Silicon']
0118 hist_label_to_num['OTH'] = [600, 7, 'Other']
0119 hist_label_to_num['AIR'] = [700, 8, 'Air']
0120 hist_label_to_num['SST'] = [800, 9, 'Stainless Steel']
0121 hist_label_to_num['WCU'] = [900, 28, 'WCu']
0122 hist_label_to_num['LEA'] = [1000, 12, 'Lead']
0123 hist_label_to_num['EPX'] = [1100, 46, 'Epoxy']
0124 hist_label_to_num['KAP'] = [1200, 49, 'Kapton']
0125 hist_label_to_num['ALU'] = [1300, 33, 'Aluminium']
0126 hist_label_to_num['POL'] = [1400, 800, 'Polystyrene']
0127 hist_label_to_num['EEC'] = [1500, 900, 'HGC_EEConnector']
0128 hist_label_to_num['HEC'] = [1600, 40, 'HGC_HEConnector']
0129 
0130 def TwikiPrintout(plotname, label, zoom): 
0131     """The plots in the twiki are already too much and to avoid mistakes 
0132        we will try to automatize the procedure
0133     """
0134 
0135     #Twiki will strip out spaces
0136     label = label.replace(" ", "_")
0137 
0138     zoomstring = ""
0139 
0140     if zoom == "all":
0141         zoomstring = ""
0142         zoomtitle = "in all HGCal"
0143         zoomdir = "%s/" % label
0144     elif zoom == "zplus":
0145         zoomstring = "_ZplusZoom"
0146         zoomtitle = "in Z+ endcap of HGCal"
0147         zoomdir = "%s/ZPlusZoom/" % label
0148     elif zoom == "zminus":
0149         zoomstring = "_ZminusZoom"
0150         zoomtitle = "in Z- endcap of HGCal"
0151         zoomdir = "%s/ZMinusZoom/" % label
0152     else :
0153         print("WRONG OPTION")
0154 
0155 
0156     #Here for the hide button
0157     if plotname == "x_vs_z_vs_Rsum":
0158         print("%%TWISTY{ mode=\"div\" showlink=\"Click to see the %s plots %s \" hidelink=\"Hide %s %s\" showimgright=\"%%ICONURLPATH{toggleopen-small}%%\" hideimgright=\"%%ICONURLPATH{toggleclose-small}%%\"}%%" % (label,zoomtitle, label, zoomtitle))
0159 
0160     if "Rsum" in plotname and "x_vs" in plotname and not "cos" in plotname: 
0161         print("| <img alt=\"HGCal_%s%s%s.png\" height=\"300\" width=\"550\" src=\"http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.png\" /> | The plot on the left shows the 2D profile histogram for *%s* %s that displays the mean value of the material budget in units of radiation length in each R-z cell. R-z cell is 1 cm x 1 mm. The plot depicts the accumulated material budget as seen by the track, as the track travels throughout the detector.[[http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.pdf][Click to enlarge plot]] |" % (plotname,label,zoomstring,zoomdir,plotname,label,zoomstring, label, zoomtitle,zoomdir,plotname,label,zoomstring))
0162 
0163     if "Rsum" in plotname and "l_vs" in plotname and not "cos" in plotname: 
0164         print("| <img alt=\"HGCal_%s%s%s.png\" height=\"300\" width=\"550\" src=\"http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.png\" /> | The plot on the left shows the 2D profile histogram for *%s* %s that displays the mean value of the material budget in units of interaction length in each R-z cell. R-z cell is 1 cm x 1 mm. The plot depicts the accumulated material budget as seen by the track, as the track travels throughout the detector.[[http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.pdf][Click to enlarge plot]] |" % (plotname,label,zoomstring,zoomdir,plotname,label,zoomstring, label, zoomtitle,zoomdir,plotname,label,zoomstring))
0165 
0166     if "Rsumcos" in plotname and "x_vs" in plotname: 
0167         print("| <img alt=\"HGCal_%s%s%s.png\" height=\"300\" width=\"550\" src=\"http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.png\" /> | The plot on the left shows the 2D profile histogram for *%s* %s that displays the mean value of the material budget in units of radiation length in each R-z cell. R-z cell is 1 cm x 1 mm. The plot depicts the orthogonal accumulated material budget, that is cos(theta) what the track sees.[[http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.pdf][Click to enlarge plot]] |" % (plotname,label,zoomstring,zoomdir,plotname,label,zoomstring, label, zoomtitle,zoomdir,plotname,label,zoomstring))
0168 
0169     if "Rsumcos" in plotname and "l_vs" in plotname: 
0170         print("| <img alt=\"HGCal_%s%s%s.png\" height=\"300\" width=\"550\" src=\"http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.png\" /> | The plot on the left shows the 2D profile histogram for *%s* %s that displays the mean value of the material budget in units of interaction length in each R-z cell. R-z cell is 1 cm x 1 mm. The plot depicts the orthogonal accumulated material budget, that is cos(theta) what the track sees.[[http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.pdf][Click to enlarge plot]] |" % (plotname,label,zoomstring,zoomdir,plotname,label,zoomstring, label, zoomtitle,zoomdir,plotname,label,zoomstring))
0171 
0172     if "Rloc" in plotname and "x_vs" in plotname and not "cos" in plotname: 
0173         print("| <img alt=\"HGCal_%s%s%s.png\" height=\"300\" width=\"550\" src=\"http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.png\" /> | The plot on the left shows the 2D profile histogram for *%s* %s that displays the local mean value of the material budget in units of radiation length in each R-z cell. R-z cell is 1 cm x 1 mm. The plot depicts the local material budget as seen by the track, as the track travels throughout the detector.[[http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.pdf][Click to enlarge plot]] |" % (plotname,label,zoomstring,zoomdir,plotname,label,zoomstring, label, zoomtitle,zoomdir,plotname,label,zoomstring))
0174 
0175     if "Rloc" in plotname and "l_vs" in plotname and not "cos" in plotname: 
0176         print("| <img alt=\"HGCal_%s%s%s.png\" height=\"300\" width=\"550\" src=\"http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.png\" /> | The plot on the left shows the 2D profile histogram for *%s* %s that displays the local mean value of the material budget in units of interaction length in each R-z cell. R-z cell is 1 cm x 1 mm. The plot depicts the local material budget as seen by the track, as the track travels throughout the detector.[[http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.pdf][Click to enlarge plot]] |" % (plotname,label,zoomstring,zoomdir,plotname,label,zoomstring, label, zoomtitle,zoomdir,plotname,label,zoomstring))
0177 
0178     #Here again for the closing of the hide button
0179     if plotname == "l_vs_z_vs_Rloc":
0180         print("%ENDTWISTY%")
0181 
0182     """ 
0183     I won't put the local cos plots for now, only the sum cos above
0184     if "Rloccos" in plotname and "x_vs" in plotname: 
0185          print "| <img alt=\"HGCal_%s%s%s.png\" height=\"300\" width=\"550\" src=\"http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.png\" /> | The plot on the left shows the 2D profile histogram for *%s* %s that displays the local mean value of the material budget in units of radiation length in each R-z cell. R-z cell is 1 cm x 1 mm. The plot depicts the orthogonal accumulated material budget, that is cos(theta) what the track sees.[[http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.pdf][Click to enlarge plot]] |" % (plotname,label,zoomstring,zoomdir,plotname,label,zoomstring, label, zoomtitle,zoomdir,plotname,label,zoomstring)
0186 
0187     if "Rloccos" in plotname and "l_vs" in plotname: 
0188          print "| <img alt=\"HGCal_%s%s%s.png\" height=\"300\" width=\"550\" src=\"http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.png\" /> | The plot on the left shows the 2D profile histogram for *%s* %s that displays the local mean value of the material budget in units of interaction length in each R-z cell. R-z cell is 1 cm x 1 mm. The plot depicts the orthogonal accumulated material budget, that is cos(theta) what the track sees.[[http://apsallid.web.cern.ch/apsallid/HGCalMaterial/%sHGCal_%s%s%s.pdf][Click to enlarge plot]] |" % (plotname,label,zoomstring,zoomdir,plotname,label,zoomstring, label, zoomtitle,zoomdir,plotname,label,zoomstring)
0189     """
0190 
0191 def acustompalette(): 
0192     NRGBs = 7
0193     NCont = 100
0194     ncolors = array('i', [])
0195     gStyle.SetNumberContours(NCont);
0196     stops   = [ 0.00, 0.10, 0.25, 0.45, 0.60, 0.75, 1.00 ]
0197     red     = [ 1.00, 0.00, 0.00, 0.00, 0.97, 0.97, 0.10 ]
0198     green   = [ 1.00, 0.97, 0.30, 0.40, 0.97, 0.00, 0.00 ]
0199     blue    = [ 1.00, 0.97, 0.97, 0.00, 0.00, 0.00, 0.00 ]
0200     stopsArray = array('d', stops)
0201     redArray = array('d', red)
0202     greenArray = array('d', green)
0203     blueArray = array('d', blue)
0204     first_color_number = TColor.CreateGradientColorTable(NRGBs, stopsArray, redArray, greenArray, blueArray, NCont);
0205     gStyle.SetNumberContours(NCont)
0206 
0207 
0208     palsize = NCont
0209     palette = []
0210     for i in range(palsize):
0211         palette.append(first_color_number+i)
0212         palarray = array('i',palette)
0213 
0214     gStyle.SetPalette(palsize,palarray)
0215 
0216 
0217 #In MeV/mm
0218 dEdx = OrderedDict()
0219 #--------
0220 #Some elements necessary to build our materials
0221 dEdx['Fe'] = 1.143
0222 dEdx['Mn'] = 1.062
0223 dEdx['Cr'] = 1.046
0224 dEdx['Ni'] = 1.307
0225 dEdx['C']  = 0.3952
0226 dEdx['0']  = 0. # 2.398E-04 -> essentially zero
0227 dEdx['H']  = 0. #3.437E-05 -> essentially zero
0228 dEdx['Br'] = 0. #9.814E-04 -> essentially zero
0229 dEdx['W'] = 2.210
0230 dEdx['Al'] = 0.4358
0231 #-------- 
0232 
0233 dEdx['Copper'] = 1.257
0234 #http://cmslxr.fnal.gov/source/Geometry/CMSCommonData/data/materials.xml#1996
0235 dEdx['H_Scintillator'] = 0.91512109*dEdx['C'] + 0.084878906*dEdx['H']
0236 dEdx['Silicon'] = 0.3876
0237 #http://cmslxr.fnal.gov/source/Geometry/CMSCommonData/data/materials.xml#2730
0238 dEdx['HGC_G10-FR4'] = 0.18077359*dEdx['Silicon'] + 0.4056325*dEdx['0'] + 0.27804208*dEdx['C'] + 0.068442752*dEdx['H'] + 0.067109079*dEdx['Br']
0239 dEdx['Other'] = 0.
0240 #http://cmslxr.fnal.gov/source/Geometry/CMSCommonData/data/materials.xml#0290
0241 dEdx['Air'] = 0.
0242 #http://cmslxr.fnal.gov/source/Geometry/CMSCommonData/data/materials.xml#3692
0243 dEdx['StainlessSteel'] = 0.6996*dEdx['Fe']+0.01*dEdx['Mn']+0.19*dEdx['Cr']+0.1*dEdx['Ni']+0.0004*dEdx['C'];
0244 #http://cmslxr.fnal.gov/source/Geometry/CMSCommonData/data/materials.xml#0568
0245 dEdx['WCu'] = 0.75*dEdx['W']+0.25*dEdx['Copper']
0246 #--------
0247 dEdx['Lead'] = 1.274 #Pb
0248 dEdx['Epoxy'] = 0.53539691*dEdx['C'] + 0.13179314*dEdx['H'] + 0.33280996*dEdx['0']
0249 dEdx['Kapton'] = 0.59985105*dEdx['C'] + 0.080541353*dEdx['H'] + 0.31960759*dEdx['0']
0250 #Composition of cable as Sunanda uses them is here: 
0251 #http://cmslxr.fnal.gov/source/Geometry/CMSCommonData/data/materials.xml#2841
0252 dEdx['Cables'] = 0.586*dEdx['Copper'] + 0.259*dEdx['C'] + 0.138*dEdx['0'] + 0.017*dEdx['H']
0253 
0254 #In mm
0255 MatXo = OrderedDict()
0256 MatXo['Copper'] = 14.3559
0257 MatXo['H_Scintillator'] = 425.393
0258 MatXo['Cables'] = 66.722
0259 MatXo['HGC_G10-FR4'] = 175.056
0260 MatXo['Silicon'] = 93.6762
0261 MatXo['Other'] = 0.
0262 MatXo['Air'] = 301522.
0263 MatXo['StainlessSteel'] = 17.3555
0264 MatXo['WCu'] = 5.1225
0265 MatXo['Lead'] = 5.6118
0266 MatXo['Epoxy'] = 315.901
0267 MatXo['Kapton'] = 365.309
0268 
0269 def drawHalfEtaValues():
0270     """Function to draw the eta.
0271     Function to draw the eta references on top of an already existing
0272     TCanvas. The lines and labels drawn are collected inside a list and
0273     the list is returned to the user to extend the live of the objects
0274     contained, otherwise no lines and labels will be drawn, since they
0275     will be garbage-collected as soon as this function returns.
0276     """
0277 
0278     # Add eta labels
0279     keep_alive = []
0280     etas = [ 0.2*i for i in range(0,18) ]
0281 
0282     etax = 2850.#6850.
0283     etay = 1240.#5200.
0284     lineL = 110#8600.
0285     offT = 10.
0286 
0287     for ieta in etas:
0288         th = 2*atan(exp(-ieta))
0289         talign = 21
0290 
0291         #IP
0292         lineh = TLine(-20.,0.,20.,0.)
0293         lineh.Draw()
0294         linev = TLine(0.,-10.,0.,10.)
0295         linev.Draw()
0296         keep_alive.append(lineh)
0297         keep_alive.append(linev)
0298 
0299         x1 = 0
0300         y1 = 0
0301         if ieta>-1.6 and ieta<1.6:
0302             x1 = etay/tan(th)
0303             y1 = etay
0304         elif ieta <=-1.6:
0305             x1 = -etax
0306             y1 = -etax*tan(th)
0307             talign = 11
0308         elif ieta>=1.6:
0309             x1 = etax
0310             y1 = etax*tan(th)
0311             talign = 31
0312         x2 = x1+lineL*cos(th)
0313         y2 = y1+lineL*sin(th)
0314         xt = x2
0315         yt = y2+offT
0316 
0317         line1 = TLine(x1,y1,x2,y2)
0318         line1.Draw()
0319         keep_alive.append(line1)
0320 
0321         text = "%3.1f" % ieta
0322         t1 = TLatex(xt, yt, '%s' % ('#eta = 0' if ieta == 0 else text))
0323         t1.SetTextSize(0.03)
0324         t1.SetTextAlign(talign)
0325         t1.Draw()
0326         keep_alive.append(t1)
0327     return keep_alive