9 ROOT.PyConfig.IgnoreCommandLineOptions =
True 15 base = os.getenv(
"NANOAODTOOLS_BASE")
18 if "/MhtjuProducerCppWorker_cc.so" not in ROOT.gSystem.GetLibraries():
19 print(
"Load C++ MhtjuProducerCppWorker worker module")
20 ROOT.gROOT.ProcessLine(
21 ".L %s/test/examples/MhtjuProducerCppWorker.cc+O" % base)
26 base =
"%s/src/PhysicsTools/NanoAODTools" % os.getenv(
"CMSSW_BASE")
27 ROOT.gSystem.Load(
"libPhysicsToolsNanoAODToolsTest.so")
28 ROOT.gROOT.ProcessLine(
".L %s/test/examples/MhtjuProducerCppWorker.h" % base)
29 self.
worker = ROOT.MhtjuProducerCppWorker()
38 def beginFile(self, inputFile, outputFile, inputTree, wrappedOutputTree):
39 self.initReaders(inputTree)
40 self.
out = wrappedOutputTree
44 def endFile(self, inputFile, outputFile, inputTree, wrappedOutputTree):
50 self.
nJet = tree.valueReader(
"nJet")
51 self.
Jet_pt = tree.arrayReader(
"Jet_pt")
52 self.
Jet_phi = tree.arrayReader(
"Jet_phi")
59 """process event, return True (go to next module) or False (fail, 68 output = self.
worker.getHT()
70 self.
out.fillBranch(
"MHTju_pt", output[0])
71 self.
out.fillBranch(
"MHTju_phi", -output[1])
def endFile(self, inputFile, outputFile, inputTree, wrappedOutputTree)
void print(TMatrixD &m, const char *label=nullptr, bool mathematicaFormat=false)
def beginFile(self, inputFile, outputFile, inputTree, wrappedOutputTree)
def initReaders(self, tree)