HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
convertEfficienciesToArtusRootInput.py File Reference

Namespaces

 convertEfficienciesToArtusRootInput
 

Variables

tuple convertEfficienciesToArtusRootInput.log = logging.getLogger(__name__)
 
dictionary convertEfficienciesToArtusRootInput.eta_string_to_float
 
tuple convertEfficienciesToArtusRootInput.parser = argparse.ArgumentParser(description="Convert efficiencies ROOT files from DESY-like format to ROOT inputs usable by Artus)", parents=[logger.loggingParser])
 
string convertEfficienciesToArtusRootInput.help = "Input directory (for example $CMSSW_BASE/src/LeptonEfficiencies)."
 
tuple convertEfficienciesToArtusRootInput.args = parser.parse_args()
 
tuple convertEfficienciesToArtusRootInput.input_dir = os.path.join(args.input_dir)
 
tuple convertEfficienciesToArtusRootInput.file_dir = os.path.join(args.input_dir, directory)
 
string convertEfficienciesToArtusRootInput.outFolderName = "identificationWeights"
 
tuple convertEfficienciesToArtusRootInput.outFolderPath = os.path.join(args.output, outFolderName)
 
tuple convertEfficienciesToArtusRootInput.f = ROOT.TFile(os.path.join(file_dir, file_name), "READ")
 
tuple convertEfficienciesToArtusRootInput.etaBinsHisto = f.Get("etaBinsH")
 
list convertEfficienciesToArtusRootInput.eta_labels = []
 
tuple convertEfficienciesToArtusRootInput.firstGraph = f.Get("ZMass"+eta_labels[0]+"_Data")
 
list convertEfficienciesToArtusRootInput.yBinslist = [-2.5, -2.1, -1.48, 0.0, 1.48, 2.1, 2.5]
 
list convertEfficienciesToArtusRootInput.xBinslist = []
 
tuple convertEfficienciesToArtusRootInput.xErrHigh = firstGraph.GetErrorXhigh(ipoint)
 
tuple convertEfficienciesToArtusRootInput.pt_bins = array.array("d", xBinslist)
 
tuple convertEfficienciesToArtusRootInput.eta_bins = array.array("d", yBinslist)
 
string convertEfficienciesToArtusRootInput.typelabel = "Run2017"
 
string convertEfficienciesToArtusRootInput.effHistoName = "identificationEfficiency"
 
string convertEfficienciesToArtusRootInput.outFileName = effHistoName+'_'
 
tuple convertEfficienciesToArtusRootInput.outFile = ROOT.TFile(os.path.join(outFolderPath, outFileName), "RECREATE")
 
tuple convertEfficienciesToArtusRootInput.effHisto = ROOT.TH2F(effHistoName, effHistoName, len(pt_bins)-1, pt_bins, len(eta_bins)-1, eta_bins)
 
string convertEfficienciesToArtusRootInput.graphName = "ZMass"
 
tuple convertEfficienciesToArtusRootInput.graph = f.Get("ZMass"+eta_labels[ieta]+"_"+datatype)
 
list convertEfficienciesToArtusRootInput.eta = eta_string_to_float[eta_labels[ieta]]
 
tuple convertEfficienciesToArtusRootInput.effError = graph.GetErrorY(ipoint)
 
tuple convertEfficienciesToArtusRootInput.ptBin = effHisto.GetXaxis()
 
tuple convertEfficienciesToArtusRootInput.etaBin = effHisto.GetYaxis()