diff --git a/GenVarsProducer.py b/GenVarsProducer.py index ab38830..d7786b1 100644 --- a/GenVarsProducer.py +++ b/GenVarsProducer.py @@ -264,7 +264,7 @@ def analyze(self, event): self.out.fillBranch("Pz_neutrino1", pz1) self.out.fillBranch("delta_pz_neutrino", delta_pz_neutrino) - self.out.fillBranch("Pz_neutrino", Pz) + # self.out.fillBranch("Pz_neutrino", Pz) self.out.fillBranch("BoostZ1", boost_Z1_mag) self.out.fillBranch("BoostZ2", boost_Z2_mag) self.out.fillBranch("Boostdiff", boost_diff_mag) diff --git a/external/nanoAODTools_py2to3.patch b/external/nanoAODTools_py2to3.patch index 2def76f..e7885d9 100644 --- a/external/nanoAODTools_py2to3.patch +++ b/external/nanoAODTools_py2to3.patch @@ -29,7 +29,7 @@ index 405b055..53613a7 100644 from PhysicsTools.NanoAODTools.postprocessing.framework.postprocessor import * import sys diff --git a/python/postprocessing/framework/postprocessor.py b/python/postprocessing/framework/postprocessor.py -index c7cc3ca..c82361d 100755 +index c7cc3ca..ea54b4a 100755 --- a/python/postprocessing/framework/postprocessor.py +++ b/python/postprocessing/framework/postprocessor.py @@ -1,4 +1,4 @@ @@ -38,7 +38,7 @@ index c7cc3ca..c82361d 100755 from PhysicsTools.NanoAODTools.postprocessing.framework.jobreport import JobReport from PhysicsTools.NanoAODTools.postprocessing.framework.preskimming import preSkim from PhysicsTools.NanoAODTools.postprocessing.framework.output import FriendOutput, FullOutput -@@ -261,8 +261,16 @@ class PostProcessor: +@@ -261,8 +261,18 @@ class PostProcessor: if self.haddFileName: haddnano = "./haddnano.py" if os.path.isfile( "./haddnano.py") else "haddnano.py" @@ -46,14 +46,18 @@ index c7cc3ca..c82361d 100755 + print("") + os.system('date') + startTime = time.time() ++ print("%s %s %s" % ++ (haddnano, self.outputDir + "/" + self.haddFileName, " ".join(outFileNames))) os.system("%s %s %s" % - (haddnano, self.haddFileName, " ".join(outFileNames))) +- (haddnano, self.haddFileName, " ".join(outFileNames))) ++ (haddnano, self.outputDir + "/" + self.haddFileName, " ".join(outFileNames))) + os.system('date') + print("Total time to merge %i files: %.1f sec" % + (len(outFileNames), time.time() - startTime)) + print("Done") if self.jobReport: - self.jobReport.addOutputFile(self.haddFileName) +- self.jobReport.addOutputFile(self.haddFileName) ++ self.jobReport.addOutputFile( self.outputDir + "/" + self.haddFileName) self.jobReport.save() diff --git a/python/postprocessing/modules/common/puWeightProducer.py b/python/postprocessing/modules/common/puWeightProducer.py index b9062b4..7c5a1da 100644 diff --git a/post_proc.py b/post_proc.py index 77b0073..723975f 100644 --- a/post_proc.py +++ b/post_proc.py @@ -23,6 +23,7 @@ def parse_arguments(): parser = argparse.ArgumentParser() parser.add_argument("-i", "--inputFile", default="", type=str, help="Input file name") parser.add_argument('-o', '--outputFile', default="skimmed_nano.root", type=str, help="Output file name") + parser.add_argument('-outDir', '--outputDir', default=".", type=str, help="Output directory") parser.add_argument('-c', '--cutFlowFile', default="cutFlow.json", type=str, help="Cut flow file name") parser.add_argument("-n", "--entriesToRun", default=100, type=int, help="Set to 0 if need to run over all entries else put number of entries to run") parser.add_argument("-d", "--DownloadFileToLocalThenRun", default=True, type=bool, help="Download file to local then run") @@ -127,7 +128,7 @@ def main(): # otherwise the output file will have larger size then expected. Reference: https://github.com/cms-nanoAOD/nanoAOD-tools/issues/249 temp_keep_drop_file = create_temp_keep_drop_file(keep_drop_rules_GEN + keep_drop_rules_Data_MC) print("DEBUG: Keep and drop file: {}".format(temp_keep_drop_file)) - p=PostProcessor(".",testfilelist, None, None,modules = modulesToRun, + p=PostProcessor(args.outputDir,testfilelist, None, None,modules = modulesToRun, provenance=True,fwkJobReport=True, haddFileName=args.outputFile, maxEntries=entriesToRun, @@ -141,7 +142,7 @@ def main(): temp_keep_drop_file = create_temp_keep_drop_file(keep_drop_rules_Data_MC) print("DEBUG: Keep and drop file: {}".format(temp_keep_drop_file)) - p=PostProcessor(".",testfilelist, None, None, modules = modulesToRun, + p=PostProcessor(args.outputDir,testfilelist, None, None, modules = modulesToRun, provenance=True, fwkJobReport=True, haddFileName=args.outputFile, jsonInput=jsonFileName,