HiggsAnalysis-KITHiggsToTauTau
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros
convertEfficienciesToArtusRootInput Namespace Reference

Variables

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

Variable Documentation

tuple convertEfficienciesToArtusRootInput.args = parser.parse_args()
tuple convertEfficienciesToArtusRootInput.effError = graph.GetErrorY(ipoint)
tuple convertEfficienciesToArtusRootInput.effHisto = ROOT.TH2F(effHistoName, effHistoName, len(pt_bins)-1, pt_bins, len(eta_bins)-1, eta_bins)
string convertEfficienciesToArtusRootInput.effHistoName = "identificationEfficiency"
list convertEfficienciesToArtusRootInput.eta = eta_string_to_float[eta_labels[ieta]]
tuple convertEfficienciesToArtusRootInput.eta_bins = array.array("d", yBinslist)
list convertEfficienciesToArtusRootInput.eta_labels = []
dictionary convertEfficienciesToArtusRootInput.eta_string_to_float
Initial value:
1 = {
2  "EtaLt1p48" : 0.5,
3  "EtaGt1p48" : 2.0,
4  "Eta1p48to2p1" : 2.0,
5  "EtaGt2p1" : 2.2,
6  "EtaLt0p9" : 0.5,
7  "EtaGt0p9" : 1.0,
8  "Eta0p9to1p2" : 1.0,
9  "Eta0p9to2p1" : 1.0,
10  "EtaGt1p2" : 2.0,
11  "Eta1p2to2p1" : 1.5,
12  "EtaGt2p1" : 2.2
13 }
tuple convertEfficienciesToArtusRootInput.etaBin = effHisto.GetYaxis()
tuple convertEfficienciesToArtusRootInput.etaBinsHisto = f.Get("etaBinsH")
tuple convertEfficienciesToArtusRootInput.f = ROOT.TFile(os.path.join(file_dir, file_name), "READ")
tuple convertEfficienciesToArtusRootInput.file_dir = os.path.join(args.input_dir, directory)
tuple convertEfficienciesToArtusRootInput.firstGraph = f.Get("ZMass"+eta_labels[0]+"_Data")
tuple convertEfficienciesToArtusRootInput.graph = f.Get("ZMass"+eta_labels[ieta]+"_"+datatype)
string convertEfficienciesToArtusRootInput.graphName = "ZMass"
string convertEfficienciesToArtusRootInput.help = "Input directory (for example $CMSSW_BASE/src/LeptonEfficiencies)."
tuple convertEfficienciesToArtusRootInput.input_dir = os.path.join(args.input_dir)
tuple convertEfficienciesToArtusRootInput.log = logging.getLogger(__name__)
tuple convertEfficienciesToArtusRootInput.outFile = ROOT.TFile(os.path.join(outFolderPath, outFileName), "RECREATE")
string convertEfficienciesToArtusRootInput.outFileName = effHistoName+'_'
string convertEfficienciesToArtusRootInput.outFolderName = "identificationWeights"
tuple convertEfficienciesToArtusRootInput.outFolderPath = os.path.join(args.output, outFolderName)
tuple convertEfficienciesToArtusRootInput.parser = argparse.ArgumentParser(description="Convert efficiencies ROOT files from DESY-like format to ROOT inputs usable by Artus)", parents=[logger.loggingParser])
tuple convertEfficienciesToArtusRootInput.pt_bins = array.array("d", xBinslist)
tuple convertEfficienciesToArtusRootInput.ptBin = effHisto.GetXaxis()
string convertEfficienciesToArtusRootInput.typelabel = "Run2017"
list convertEfficienciesToArtusRootInput.xBinslist = []
tuple convertEfficienciesToArtusRootInput.xErrHigh = firstGraph.GetErrorXhigh(ipoint)
list convertEfficienciesToArtusRootInput.yBinslist = [-2.5, -2.1, -1.48, 0.0, 1.48, 2.1, 2.5]