CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Functions
EcalCondTools Namespace Reference

Functions

def compare
 
def compareBarrel
 
def compareBarrelBorder
 
def compareEndcap
 
def compareEndcapBorder
 
def dumpXML
 
def getObject
 
def getToken
 
def histo
 
def listIovs
 
def listTags
 
def makedist
 
def plot
 

Function Documentation

def EcalCondTools.compare (   tag1,
  db1,
  since1,
  tag2,
  db2,
  since2,
  filename = 'compare.root' 
)
Produce comparison plots for two records. Save plots to file \
   according to format. tag can be an xml file

Definition at line 91 of file EcalCondTools.py.

References compareBarrel(), compareBarrelBorder(), compareEndcap(), compareEndcapBorder(), EcalPyUtils.fromXML(), print(), and str.

Referenced by plot().

91 
92  tag2,db2,since2,filename='compare.root'):
93  '''Produce comparison plots for two records. Save plots to file \
94  according to format. tag can be an xml file'''
95  print("EcalCondTools.py compare tag1 ", tag1, "since1 : ", since1, " tag2 ", tag2," s2 ", since2)
96 
97  coeff_1_b=[]
98  coeff_2_b=[]
99 
100  coeff_1_e=[]
101  coeff_2_e=[]
102 
103  if tag1.find(".xml") < 0:
104  found=0
105  try:
106  db1.startReadOnlyTransaction()
107  Plug = __import__(str(db1.payloadModules(tag1)[0]))
108  payload = Plug.Object(db1)
109  listOfIovElem= [iovElem for iovElem in db1.iov(tag1).elements]
110  what = {'how':'barrel'}
111  w = inspect.setWhat(Plug.What(),what)
112  exb = Plug.Extractor(w)
113  what = {'how':'endcap'}
114  w = inspect.setWhat(Plug.What(),what)
115  exe = Plug.Extractor(w)
116 # p = getObject(db1,tag1,since1,ex)
117 # p.extract(ex)
118  print(" before loop")
119  for elem in db1.iov(tag1).elements :
120  if str(elem.since())==str(since1):
121  found=1
122  payload.load(elem)
123  payload.extract(exb)
124  coeff_1_b = [i for i in exb.values()]# first set of coefficients
125  payload.extract(exe)
126  coeff_1_e = [i for i in exe.values()]
127  db1.commitTransaction()
128 
129  except Exception as er :
130  print(" compare first set exception ",er)
131  if not found :
132  print("Could not retrieve payload for tag: " , tag1, " since: ", since1)
133  sys.exit(0)
134 
135  else:
136  coeff_1_b,coeff_1_e = EcalPyUtils.fromXML(tag1)
137 
138  if tag2.find(".xml")<0:
139  found=0
140  try:
141  db2.startReadOnlyTransaction()
142  Plug = __import__(str(db2.payloadModules(tag2)[0]))
143  what = {'how':'barrel'}
144  w = inspect.setWhat(Plug.What(),what)
145  exb = Plug.Extractor(w)
146  what = {'how':'endcap'}
147  w = inspect.setWhat(Plug.What(),what)
148  exe = Plug.Extractor(w)
149 # p = getObject(db2,tag2,since2)
150 # p.extract(ex)
151  for elem in db2.iov(tag2).elements :
152  if str(elem.since())==str(since2):
153  found=1
154  payload.load(elem)
155  payload.extract(exb)
156  coeff_2_b = [i for i in exb.values()]# second set of coefficients
157  payload.extract(exe)
158  coeff_2_e = [i for i in exe.values()]
159  db2.commitTransaction()
160 
161  except Exception as er :
162  print(" compare second set exception ",er)
163  if not found :
164  print("Could not retrieve payload for tag: " , tag2, " since: ", since2)
165  sys.exit(0)
166 
167  else:
168  coeff_2_b,coeff_2_e = EcalPyUtils.fromXML(tag2)
169 
170  gStyle.SetPalette(1)
171 
172  savefile = TFile(filename,"RECREATE")
173 
174  ebhisto,ebmap, profx, profy= compareBarrel(coeff_1_b,coeff_2_b)
175  eephisto,eepmap,eemhisto,eemmap=compareEndcap(coeff_1_e,coeff_2_e)
176 
177 #make more canvas (suppressed : use a root file)
178 
179 # cEBdiff = TCanvas("EBdiff","EBdiff")
180 # cEBdiff.Divide(2,2)
181 
182 # cEBdiff.cd(1)
183 # ebhisto.Draw()
184 # cEBdiff.cd(2)
185 # ebmap.Draw("colz")
186 # cEBdiff.cd(3)
187 # profx.Draw()
188 # cEBdiff.cd(4)
189 # profy.Draw()
190 
191 # EBfilename = "EB_"+filename
192 # cEBdiff.SaveAs(EBfilename)
193 
194 # cEEdiff = TCanvas("EEdiff","EEdiff")
195 # cEEdiff.Divide(2,2)
196 
197 # cEEdiff.cd(1)
198 # eephisto.Draw()
199 # cEEdiff.cd(2)
200 # eepmap.Draw("colz")
201 # cEEdiff.cd(3)
202 # eemhisto.Draw()
203 # cEEdiff.cd(4)
204 # eemmap.Draw("colz")
205 
206 # EEfilename = "EE_"+filename
207 # cEEdiff.SaveAs(EEfilename)
208 
209 
210  eeborderphisto,eeborderpmap,eebordermhisto,eebordermmap=compareEndcapBorder(coeff_1_e,coeff_2_e)
211  ebborderhisto,ebbordermap = compareBarrelBorder(coeff_1_b,coeff_2_b)
212 
213  border_diff_distro_can = TCanvas("border_difference","borders difference")
214  border_diff_distro_can.Divide(2,3)
215 
216  border_diff_distro_can.cd(1)
217  ebborderhisto.Draw()
218  border_diff_distro_can.cd(2)
219  ebbordermap.Draw("colz")
220  border_diff_distro_can.cd(3)
221  eeborderphisto.Draw()
222  border_diff_distro_can.cd(4)
223  eeborderpmap.Draw("colz")
224  border_diff_distro_can.cd(5)
225  eebordermhisto.Draw()
226  border_diff_distro_can.cd(6)
227  eebordermmap.Draw("colz")
228 
229  bordersfilename = "borders_"+filename
230  prof_filename = "profiles_"+filename
231 
232 # border_diff_distro_can.SaveAs(bordersfilename)
233 
234  savefile.Write()
235 
236 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def EcalCondTools.compareBarrel (   coeff_barl_1,
  coeff_barl_2 
)
Return an histogram and a map of the differences 

Definition at line 429 of file EcalCondTools.py.

References EcalPyUtils.unhashEBIndex().

Referenced by compare().

430 def compareBarrel(coeff_barl_1,coeff_barl_2) :
431  '''Return an histogram and a map of the differences '''
432 
433  diff_distro_h = TH1F("diffh","diffh",100,-2,2)
434  diff_distro_m = TH2F("diffm","diffm",360,1,361,171,-85,86)
435  diff_distro_m.SetStats(0)
436  ebeta = TH2F("ebeta","ebeta",171,-85,86,100,-2,2)
437  ebphi = TH2F("ebphi","ebphi",360,1,361,100,-2,2)
438 
439 
440  for i,c in enumerate(coeff_barl_1):
441  diff = c - coeff_barl_2[i]
442  ieta,iphi= EcalPyUtils.unhashEBIndex(i)
443  diff_distro_h.Fill(diff)
444  diff_distro_m.Fill(iphi,ieta,diff)
445  ebeta.Fill(ieta,diff)
446  ebphi.Fill(iphi,diff)
447 
448  prof_x_h = ebeta.ProfileX()
449  prof_y_h = ebphi.ProfileX()
450 
451  return diff_distro_h, diff_distro_m, prof_x_h, prof_y_h
452 
453 
def unhashEBIndex
Definition: EcalPyUtils.py:9
def EcalCondTools.compareBarrelBorder (   coeff_barl_1,
  coeff_barl_2 
)
Return an histogram and a map of the differences 

Definition at line 454 of file EcalCondTools.py.

References funct.abs(), and EcalPyUtils.unhashEBIndex().

Referenced by compare().

455 def compareBarrelBorder(coeff_barl_1,coeff_barl_2) :
456  '''Return an histogram and a map of the differences '''
457 
458  diff_distro_border_h = TH1F("diffborderh","diffh",100,-2,2)
459  diff_distro_border_m = TH2F("diffborderm","diffm",360,1,361,171,-85,86)
460  diff_distro_border_m.SetStats(0)
461 
462  for i,c in enumerate(coeff_barl_1):
463  diff = c - coeff_barl_2[i]
464  ieta,iphi= EcalPyUtils.unhashEBIndex(i)
465  if (abs(ieta)==85 or abs(ieta)==65 or abs(ieta)==64 or abs(ieta)==45 or abs(ieta)==44 or abs(ieta)==25 or abs(ieta)==24 or abs(ieta)==1 or iphi%20==1 or iphi%20==0):
466  diff_distro_border_h.Fill(diff)
467  if (abs(ieta)==85 or abs(ieta)==65 or abs(ieta)==64 or abs(ieta)==45 or abs(ieta)==44 or abs(ieta)==25 or abs(ieta)==24 or abs(ieta)==1 or iphi%20==0 or iphi%20==1):
468  diff_distro_border_m.Fill(iphi,ieta,diff)
469 
470  return diff_distro_border_h, diff_distro_border_m
471 
472 
473 
474 
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def unhashEBIndex
Definition: EcalPyUtils.py:9
def EcalCondTools.compareEndcap (   coeff_endc_1,
  coeff_endc_2 
)
Return an histogram and a map of the differences for each endcap

Definition at line 475 of file EcalCondTools.py.

References mathSSE.sqrt(), and EcalPyUtils.unhashEEIndex().

Referenced by compare().

476 def compareEndcap(coeff_endc_1, coeff_endc_2) :
477  ''' Return an histogram and a map of the differences for each endcap'''
478 
479  diff_distro_h_eep = TH1F("diff EE+","diff EE+",100,-2,2)
480  diff_distro_h_eem = TH1F("diff EE-","diff EE-",100,-2,2)
481 
482 
483  diff_distro_m_eep = TH2F("map EE+","map EE+",100,1,101,100,1,101)
484  diff_distro_m_eem = TH2F("map EE-","map EE-",100,1,101,100,1,101)
485 
486  temp_h = TH1F("tempR","tempR",50,0,50)
487 
488  diff_distro_m_eep.SetStats(0)
489  diff_distro_m_eem.SetStats(0)
490 
491 
492  for i,c in enumerate(coeff_endc_1):
493  diff = c - coeff_endc_2[i]
494  ix,iy,iz = EcalPyUtils.unhashEEIndex(i)
495  R = sqrt((ix-50)*(ix-50)+(iy-50)*(iy-50))
496 
497  if iz >0:
498  diff_distro_h_eep.Fill(diff)
499  diff_distro_m_eep.Fill(ix,iy,diff)
500 
501  else:
502  diff_distro_h_eem.Fill(diff)
503  diff_distro_m_eem.Fill(ix,iy,diff)
504 
505  return diff_distro_h_eep, \
506  diff_distro_m_eep, \
507  diff_distro_h_eem, \
508  diff_distro_m_eem
509 
510 
T sqrt(T t)
Definition: SSEVec.h:19
def unhashEEIndex
Definition: EcalPyUtils.py:14
def EcalCondTools.compareEndcapBorder (   coeff_endc_1,
  coeff_endc_2 
)
Return an histogram and a map of the differences for each endcap

Definition at line 511 of file EcalCondTools.py.

References EcalPyUtils.unhashEEIndex().

Referenced by compare().

512 def compareEndcapBorder(coeff_endc_1, coeff_endc_2) :
513  ''' Return an histogram and a map of the differences for each endcap'''
514 
515  border_diff_distro_h_eep = TH1F("borderdiff EE+","diff EE+",100,-2,2)
516  border_diff_distro_h_eem = TH1F("borderdiff EE-","diff EE-",100,-2,2)
517 
518 
519  border_diff_distro_m_eep = TH2F("bordermap EE+","map EE+",100,1,101,100,1,101)
520  border_diff_distro_m_eem = TH2F("bordermap EE-","map EE-",100,1,101,100,1,101)
521 
522  border_diff_distro_m_eep.SetStats(0)
523  border_diff_distro_m_eem.SetStats(0)
524 
525 
526  for i,c in enumerate(coeff_endc_1):
527  diff = c - coeff_endc_2[i]
528  ix,iy,iz = EcalPyUtils.unhashEEIndex(i)
529  Rsq = ((ix-50.0)**2+(iy-50.0)**2)
530 
531  if (iz >0 and (Rsq<144.0 or Rsq>2500.0)):
532  border_diff_distro_h_eep.Fill(diff)
533  border_diff_distro_m_eep.Fill(ix,iy,diff)
534  elif (iz<0 and (Rsq<144.0 or Rsq>2500.0)):
535  border_diff_distro_h_eem.Fill(diff)
536  border_diff_distro_m_eem.Fill(ix,iy,diff)
537 
538 
539  return border_diff_distro_h_eep, \
540  border_diff_distro_m_eep, \
541  border_diff_distro_h_eem, \
542  border_diff_distro_m_eem
def unhashEEIndex
Definition: EcalPyUtils.py:14
def EcalCondTools.dumpXML (   db,
  tag,
  since,
  filename = 'dump.xml' 
)
Dump record in XML format for a given tag 

Definition at line 44 of file EcalCondTools.py.

References print(), and str.

Referenced by EcalFloatCondObjectContainerXMLTranslator.dumpXML(), EcalTPGCrystalStatusXMLTranslator.writeXML(), EcalTPGLinearizationConstXMLTranslator.writeXML(), EcalTimeBiasCorrectionsXMLTranslator.writeXML(), EcalClusterLocalContCorrXMLTranslator.writeXML(), EcalTPGStripStatusXMLTranslator.writeXML(), EcalTPGTowerStatusXMLTranslator.writeXML(), ESGainXMLTranslator.writeXML(), EcalPulseShapesXMLTranslator.writeXML(), EcalPulseSymmCovariancesXMLTranslator.writeXML(), EcalDCSTowerStatusXMLTranslator.writeXML(), EcalDAQTowerStatusXMLTranslator.writeXML(), EcalPedestalsXMLTranslator.writeXML(), EcalChannelStatusXMLTranslator.writeXML(), EcalLinearCorrectionsXMLTranslator.writeXML(), EcalClusterCrackCorrXMLTranslator.writeXML(), EcalLaserAPDPNRatiosXMLTranslator.writeXML(), EcalGainRatiosXMLTranslator.writeXML(), EcalAlignmentXMLTranslator.writeXML(), EcalWeightGroupXMLTranslator.writeXML(), EcalClusterEnergyCorrectionXMLTranslator.writeXML(), EcalClusterEnergyCorrectionObjectSpecificXMLTranslator.writeXML(), EcalADCToGeVXMLTranslator.writeXML(), EcalTimeOffsetXMLTranslator.writeXML(), EcalTBWeightsXMLTranslator.writeXML(), EcalWeightSetXMLTranslator.writeXML(), and EcalFloatCondObjectContainerXMLTranslator.writeXML().

44 
45 def dumpXML(db,tag,since,filename='dump.xml'):
46  '''Dump record in XML format for a given tag '''
47  try :
48  iov = inspect.Iov(db,tag)
49  db.startReadOnlyTransaction()
50  Plug = __import__(str(db.payloadModules(tag)[0]))
51  payload = Plug.Object(db)
52  listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
53  inst = 0
54  for elem in db.iov(tag).elements :
55  inst = inst + 1
56  if str(elem.since())==str(since):
57  found = inst
58  break
59  db.commitTransaction()
60  payload = inspect.PayLoad(db, tag, elem)
61  out = open(filename,'w')
62  print(payload, file=out)
63 
64  except Exception as er :
65  print(" dumpXML exception ",er)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def EcalCondTools.getObject (   db,
  tag,
  since 
)
Return payload object for a given iov, tag, db

Definition at line 350 of file EcalCondTools.py.

References print(), and str.

351 def getObject(db,tag,since):
352  ''' Return payload object for a given iov, tag, db'''
353  found=0
354  try:
355 # exec('import '+db.moduleName(tag)+' as Plug')
356  db.startReadOnlyTransaction()
357  Plug = __import__(str(db.payloadModules(tag)[0]))
358  print(" getObject Plug")
359  payload = Plug.Object(db)
360  db.commitTransaction()
361  listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
362  print(" getObject before loop")
363  for elem in db.iov(tag).elements :
364  if str(elem.since())==str(since):
365  found=1
366  print(" getObject found ", elem.since())
367 # return Plug.Object(elem)
368  return elem
369 
370  except Exception as er :
371  print(" getObject exception ",er)
372 
373  if not found :
374  print("Could not retrieve payload for tag: " , tag, " since: ", since)
375  sys.exit(0)
376 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def EcalCondTools.getToken (   db,
  tag,
  since 
)
Return payload token for a given iov, tag, db

Definition at line 334 of file EcalCondTools.py.

References print(), and str.

335 def getToken(db,tag,since):
336  ''' Return payload token for a given iov, tag, db'''
337  try :
338  iov = inspect.Iov(db,tag)
339  iovlist = iov.list()
340  for p in iovlist:
341  tmpsince=p[1]
342  if str(tmpsince)==str(since) :
343  return p[0]
344  print("Could not retrieve token for tag: " , tag, " since: ", since)
345  sys.exit(0)
346 
347  except Exception as er :
348  print(er)
349 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def EcalCondTools.histo (   db,
  tag,
  since,
  filename = 'histo.root' 
)
Make histograms and save to file. tag can be an xml file

Definition at line 237 of file EcalCondTools.py.

References EcalPyUtils.fromXML(), makedist(), print(), and str.

238 def histo (db, tag,since,filename='histo.root'):
239  '''Make histograms and save to file. tag can be an xml file'''
240 
241  coeff_barl=[]
242  coeff_endc=[]
243 
244  if tag.find(".xml")< 0:
245  found=0
246  try:
247 # exec('import '+db.moduleName(tag)+' as Plug')
248  db.startReadOnlyTransaction()
249  Plug = __import__(str(db.payloadModules(tag)[0]))
250  payload = Plug.Object(db)
251  listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
252  what = {'how':'barrel'}
253  w = inspect.setWhat(Plug.What(),what)
254  exb = Plug.Extractor(w)
255  what = {'how':'endcap'}
256  w = inspect.setWhat(Plug.What(),what)
257  exe = Plug.Extractor(w)
258  for elem in db.iov(tag).elements :
259  if str(elem.since())==str(since):
260  found=1
261  payload.load(elem)
262  payload.extract(exb)
263  coeff_barl = [i for i in exb.values()]
264  payload.extract(exe)
265  coeff_endc = [i for i in exe.values()]
266  db.commitTransaction()
267 
268  except Exception as er :
269  print(" histo exception ",er)
270  if not found :
271  print("Could not retrieve payload for tag: " , tag, " since: ", since)
272  sys.exit(0)
273 
274  else :
275  coeff_barl,coeff_endc=EcalPyUtils.fromXML(tag)
276 
277  savefile = TFile(filename,"RECREATE")
278 
279  ebmap, ebeta, ebphi, eePmap, ebdist, eeMmap, prof_eePL, prof_eePR, prof_eeML, prof_eeMR, ebBorderdist = makedist(coeff_barl, coeff_endc)
280 
281  gStyle.SetPalette(1)
282 
283  c = TCanvas("CCdist")
284  c.Divide(2,2)
285 
286  c.cd(1)
287  ebmap.Draw("colz")
288  c.cd(2)
289  eePmap.Draw("colz")
290  c.cd(3)
291  ebdist.Draw()
292  c.cd(4)
293  eeMmap.Draw("colz")
294 
295 # c.SaveAs(filename)
296 
297  prof_eb_eta = ebeta.ProfileX()
298  prof_eb_phi = ebphi.ProfileX()
299 
300  c2 = TCanvas("CCprofiles")
301  c2.Divide(2,2)
302 
303  leg = TLegend(0.1,0.7,0.48,0.9)
304 
305  c2.cd(1)
306  prof_eb_eta.Draw()
307  c2.cd(2)
308  prof_eb_phi.Draw()
309  c2.cd(3)
310  prof_eePL.SetMarkerStyle(8)
311  prof_eePL.Draw()
312  prof_eePR.SetMarkerStyle(8)
313  prof_eePR.SetMarkerColor(2)
314  prof_eePR.Draw("same")
315  prof_eeML.SetMarkerStyle(8)
316  prof_eeML.SetMarkerColor(3)
317  prof_eeML.Draw("same")
318  prof_eeMR.SetMarkerStyle(8)
319  prof_eeMR.SetMarkerColor(5)
320  prof_eeMR.Draw("same")
321  leg.AddEntry(prof_eePL,"Dee1","lp")
322  leg.AddEntry(prof_eePR,"Dee2","lp")
323  leg.AddEntry(prof_eeMR,"Dee3","lp")
324  leg.AddEntry(prof_eeML,"Dee4","lp")
325  leg.Draw()
326  c2.cd(4)
327  ebBorderdist.Draw()
328 
329  extrafilename = "profiles_"+filename
330  # c2.SaveAs(extrafilename)
331 
332  savefile.Write()
333 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)
def EcalCondTools.listIovs (   db,
  tag 
)
List all available iovs for a given tag

Definition at line 31 of file EcalCondTools.py.

References print().

31 
32 def listIovs(db,tag):
33  '''List all available iovs for a given tag'''
34 
35  try :
36  iov = inspect.Iov(db,tag)
37  iovlist = iov.list()
38  print("Available iovs for tag: ",tag)
39  for p in iovlist:
40  print(" Since " , p[1], " Till " , p[2])
41 
42  except Exception as er :
43  print(" listIovs exception ",er)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def EcalCondTools.listTags (   db)
List all available tags for a given db 

Definition at line 20 of file EcalCondTools.py.

References print().

20 
21 def listTags(db):
22  '''List all available tags for a given db '''
23  try:
24  db.startReadOnlyTransaction()
25  tags = db.allTags()
26  db.commitTransaction()
27  for tag in tags.split():
28  print(tag)
29  except:
30  return ""
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
def EcalCondTools.makedist (   coeff_barl,
  coeff_endc 
)

Definition at line 377 of file EcalCondTools.py.

References funct.abs(), mathSSE.sqrt(), EcalPyUtils.unhashEBIndex(), and EcalPyUtils.unhashEEIndex().

Referenced by histo().

378 def makedist(coeff_barl, coeff_endc) :
379 
380  ebmap = TH2F("EB","EB",360,1,261,171, -85,86)
381  eePmap = TH2F("EE","EE",100, 1,101,100,1,101)
382  eeMmap = TH2F("EEminus","EEminus",100,1,101,100,1,101)
383  ebdist = TH1F("EBdist","EBdist",100,-2,2)
384  ebBorderdist = TH1F("EBBorderdist","EBBorderdist",100,-2,2)
385 
386  ebeta = TH2F("ebeta","ebeta",171,-85,86,100,-2,2)
387  ebphi = TH2F("ebphi","ebphi",360,1,361,100,-2,2)
388 
389  eePL = TH2F("EEPL","EEPlus Left",50,10,55,100,-2,2)
390  eePR = TH2F("EEPR","EEPlus Right",50,10,55,100,-2,2)
391  eeML = TH2F("EEML","EEMinus Left",50,10,55,100,-2,2)
392  eeMR = TH2F("EEMR","EEMinus Right",50,10,55,100,-2,2)
393 
394  for i,c in enumerate(coeff_barl):
395  ieta,iphi = EcalPyUtils.unhashEBIndex(i)
396  ebmap.Fill(iphi,ieta,c)
397  ebdist.Fill(c)
398  ebeta.Fill(ieta,c)
399  ebphi.Fill(iphi,c)
400 
401  if (abs(ieta)==85 or abs(ieta)==65 or abs(ieta)==64 or abs(ieta)==45 or abs(ieta)==44 or abs(ieta)==25 or abs(ieta)==24 or abs(ieta)==1 or iphi%20==1 or iphi%20==0):
402  ebBorderdist.Fill(c)
403 
404 
405  for i,c in enumerate(coeff_endc):
406  ix,iy,iz = EcalPyUtils.unhashEEIndex(i)
407  R = sqrt((ix-50)*(ix-50)+(iy-50)*(iy-50))
408 
409  if iz>0:
410  eePmap.Fill(ix,iy,c)
411  if ix<50:
412  eePL.Fill(R,c,1)
413  if ix>50:
414  eePR.Fill(R,c,1)
415 
416  if iz<0:
417  eeMmap.Fill(ix,iy,c)
418  if ix<50:
419  eeML.Fill(R,c,1)
420  if ix>50:
421  eeMR.Fill(R,c,1)
422 
423  prof_eePL = eePL.ProfileX()
424  prof_eePR = eePR.ProfileX()
425  prof_eeML = eeML.ProfileX()
426  prof_eeMR = eeMR.ProfileX()
427 
428  return ebmap, ebeta, ebphi, eePmap, ebdist, eeMmap, prof_eePL, prof_eePR, prof_eeML, prof_eeMR, ebBorderdist
T sqrt(T t)
Definition: SSEVec.h:19
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
def unhashEBIndex
Definition: EcalPyUtils.py:9
def unhashEEIndex
Definition: EcalPyUtils.py:14
def EcalCondTools.plot (   db,
  tag,
  since,
  filename = 'plot.root' 
)
Invoke the plot function from the wrapper and save to the specified \
   file. The file format will reflect the extension given.

Definition at line 66 of file EcalCondTools.py.

References compare(), print(), and str.

66 
67 def plot (db, tag,since,filename='plot.root'):
68  '''Invoke the plot function from the wrapper and save to the specified \
69  file. The file format will reflect the extension given.'''
70 
71  try :
72  iov = inspect.Iov(db,tag)
73  db.startReadOnlyTransaction()
74  Plug = __import__(str(db.payloadModules(tag)[0]))
75  payload = Plug.Object(db)
76  listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
77  inst = 0
78  for elem in db.iov(tag).elements :
79  inst = inst + 1
80  if str(elem.since())==str(since):
81  found = inst
82  break
83  db.commitTransaction()
84  payload = inspect.PayLoad(db, tag, elem)
85  payload.plot(filename,"",[],[])
86 
87  except Exception as er :
88  print(" plot exception ",er)
89 
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
Definition: Utilities.cc:47
#define str(s)