parameters: (db, tag,since,filename='histo.root')
docstring: Make histograms and save to file. tag can be an xml file
docstring_summary: Make histograms and save to file. tag can be an xml file
docstring_tokens: Make histograms and save to file . tag can be an xml file
function: def histo (db, tag,since,filename='histo.root'):
      '''Make histograms and save to file. tag can be an xml file'''
      
      coeff_barl=[]
      coeff_endc=[]
      
      if  tag.find(".xml")< 0:
        found=0
        try:  
  #          exec('import '+db.moduleName(tag)+' as Plug')
          db.startReadOnlyTransaction()
          Plug = __import__(str(db.payloadModules(tag)[0]))
          payload = Plug.Object(db)
          listOfIovElem= [iovElem for iovElem in db.iov(tag).elements]
          what = {'how':'barrel'}
          w = inspect.setWhat(Plug.What(),what)
          exb = Plug.Extractor(w)
          what = {'how':'endcap'}
          w = inspect.setWhat(Plug.What(),what)
          exe = Plug.Extractor(w)
          for elem in db.iov(tag).elements :       
            if str(elem.since())==str(since):
              found=1
              payload.load(elem)
              payload.extract(exb)
              coeff_barl = [i for i in exb.values()]
              payload.extract(exe)
              coeff_endc = [i for i in exe.values()]
          db.commitTransaction()
  
        except Exception as er :
            print(" histo exception ",er)
        if not found :
          print("Could not retrieve payload for tag: " , tag, " since: ", since)
          sys.exit(0)
  
      else :
        coeff_barl,coeff_endc=EcalPyUtils.fromXML(tag)
  
      savefile = TFile(filename,"RECREATE")
  
      ebmap, ebeta, ebphi, eePmap, ebdist, eeMmap, prof_eePL, prof_eePR, prof_eeML, prof_eeMR, ebBorderdist = makedist(coeff_barl, coeff_endc)
  
      gStyle.SetPalette(1)
  
      c =  TCanvas("CCdist")
      c.Divide(2,2)
  
      c.cd(1)  
      ebmap.Draw("colz")
      c.cd(2)
      eePmap.Draw("colz")
      c.cd(3)
      ebdist.Draw()
      c.cd(4)
      eeMmap.Draw("colz")
  
  #    c.SaveAs(filename)
  
      prof_eb_eta = ebeta.ProfileX()
      prof_eb_phi = ebphi.ProfileX()
  
      c2 = TCanvas("CCprofiles")
      c2.Divide(2,2)
  
      leg = TLegend(0.1,0.7,0.48,0.9)
  
      c2.cd(1)
      prof_eb_eta.Draw()
      c2.cd(2)
      prof_eb_phi.Draw()
      c2.cd(3)
      prof_eePL.SetMarkerStyle(8)
      prof_eePL.Draw()
      prof_eePR.SetMarkerStyle(8)
      prof_eePR.SetMarkerColor(2)
      prof_eePR.Draw("same")
      prof_eeML.SetMarkerStyle(8)
      prof_eeML.SetMarkerColor(3)
      prof_eeML.Draw("same")
      prof_eeMR.SetMarkerStyle(8)
      prof_eeMR.SetMarkerColor(5)
      prof_eeMR.Draw("same")
      leg.AddEntry(prof_eePL,"Dee1","lp")
      leg.AddEntry(prof_eePR,"Dee2","lp")
      leg.AddEntry(prof_eeMR,"Dee3","lp")
      leg.AddEntry(prof_eeML,"Dee4","lp")
      leg.Draw()
      c2.cd(4)
      ebBorderdist.Draw()
  
      extrafilename = "profiles_"+filename
   #   c2.SaveAs(extrafilename)
  
      savefile.Write()
function_tokens: def histo ( db , tag , since , filename = 'histo.root' ) : coeff_barl = [ ] coeff_endc = [ ] if tag . find ( ".xml" ) < 0 : found = 0 try : #          exec('import '+db.moduleName(tag)+' as Plug') db . startReadOnlyTransaction ( ) Plug = __import__ ( str ( db . payloadModules ( tag ) [ 0 ] ) ) payload = Plug . Object ( db ) listOfIovElem = [ iovElem for iovElem in db . iov ( tag ) . elements ] what = { 'how' : 'barrel' } w = inspect . setWhat ( Plug . What ( ) , what ) exb = Plug . Extractor ( w ) what = { 'how' : 'endcap' } w = inspect . setWhat ( Plug . What ( ) , what ) exe = Plug . Extractor ( w ) for elem in db . iov ( tag ) . elements : if str ( elem . since ( ) ) == str ( since ) : found = 1 payload . load ( elem ) payload . extract ( exb ) coeff_barl = [ i for i in exb . values ( ) ] payload . extract ( exe ) coeff_endc = [ i for i in exe . values ( ) ] db . commitTransaction ( ) except Exception as er : print ( " histo exception " , er ) if not found : print ( "Could not retrieve payload for tag: " , tag , " since: " , since ) sys . exit ( 0 ) else : coeff_barl , coeff_endc = EcalPyUtils . fromXML ( tag ) savefile = TFile ( filename , "RECREATE" ) ebmap , ebeta , ebphi , eePmap , ebdist , eeMmap , prof_eePL , prof_eePR , prof_eeML , prof_eeMR , ebBorderdist = makedist ( coeff_barl , coeff_endc ) gStyle . SetPalette ( 1 ) c = TCanvas ( "CCdist" ) c . Divide ( 2 , 2 ) c . cd ( 1 ) ebmap . Draw ( "colz" ) c . cd ( 2 ) eePmap . Draw ( "colz" ) c . cd ( 3 ) ebdist . Draw ( ) c . cd ( 4 ) eeMmap . Draw ( "colz" ) #    c.SaveAs(filename) prof_eb_eta = ebeta . ProfileX ( ) prof_eb_phi = ebphi . ProfileX ( ) c2 = TCanvas ( "CCprofiles" ) c2 . Divide ( 2 , 2 ) leg = TLegend ( 0.1 , 0.7 , 0.48 , 0.9 ) c2 . cd ( 1 ) prof_eb_eta . Draw ( ) c2 . cd ( 2 ) prof_eb_phi . Draw ( ) c2 . cd ( 3 ) prof_eePL . SetMarkerStyle ( 8 ) prof_eePL . Draw ( ) prof_eePR . SetMarkerStyle ( 8 ) prof_eePR . SetMarkerColor ( 2 ) prof_eePR . Draw ( "same" ) prof_eeML . SetMarkerStyle ( 8 ) prof_eeML . SetMarkerColor ( 3 ) prof_eeML . Draw ( "same" ) prof_eeMR . SetMarkerStyle ( 8 ) prof_eeMR . SetMarkerColor ( 5 ) prof_eeMR . Draw ( "same" ) leg . AddEntry ( prof_eePL , "Dee1" , "lp" ) leg . AddEntry ( prof_eePR , "Dee2" , "lp" ) leg . AddEntry ( prof_eeMR , "Dee3" , "lp" ) leg . AddEntry ( prof_eeML , "Dee4" , "lp" ) leg . Draw ( ) c2 . cd ( 4 ) ebBorderdist . Draw ( ) extrafilename = "profiles_" + filename #   c2.SaveAs(extrafilename) savefile . Write ( )