|
[Rivet-svn] rivet: 2 new changesetsRivet Mercurial rivet at projects.hepforge.orgMon Aug 28 09:45:01 BST 2017
details: https://rivet.hepforge.org/hg/rivet/rev/666d49545270 branches: changeset: 5983:666d49545270 user: Andy Buckley <andy at insectnation.org> date: Mon Aug 28 00:00:07 2017 +0100 description: Make mkanalysis histo-booking specific to whether an MC_ analysis (where autobooking doesn't make sense) is being written details: https://rivet.hepforge.org/hg/rivet/rev/2b6045e9fc31 branches: changeset: 5984:2b6045e9fc31 user: Andy Buckley <andy at insectnation.org> date: Mon Aug 28 09:35:08 2017 +0100 description: Typo fix diffs (50 lines): --- a/bin/rivet-mkanalysis Sat Aug 19 17:11:16 2017 +0100 +++ b/bin/rivet-mkanalysis Mon Aug 28 09:35:08 2017 +0100 @@ -153,10 +153,10 @@ except Exception, e: logging.error("HepData oops: %s" % e) - + INLINEMETHODS = "" if opts.INLINE: KEYWORDS["ANAREFREPO_LOWER"] = KEYWORDS["ANAREFREPO"].lower() - INLINEMETHODS=""" + INLINEMETHODS = """ public: string experiment() const { return "%(ANAEXPT)s"; } string year() const { return "%(ANAYEAR)s"; } @@ -173,10 +173,20 @@ vector<std::string> todos() const { return vector<string>(); } """ % KEYWORDS del KEYWORDS["ANAREFREPO_LOWER"] + KEYWORDS["INLINEMETHODS"] = INLINEMETHODS + + + if ANANAME.startswith("MC_"): + HISTOBOOKING = """\ + _h_XXXX = bookProfile1D("myobs1", 20, 0.0, 100.0); + _h_YYYY = bookHisto1D("myobs2", {0.0, 1.0, 2.0, 4.0, 8.0, 16.0}); // or logspace(20, 1e-2, 1e3) + _h_ZZZZ = bookCounter("myobs3");""" % KEYWORDS else: - INLINEMETHODS="" - - KEYWORDS["INLINEMETHODS"] = INLINEMETHODS + HISTOBOOKING = """\ + _h_XXXX = bookProfile1D(1, 1, 1); + _h_YYYY = bookHisto1D(2, 1, 1); + _h_ZZZZ = bookCounter(3, 1, 1);""" % KEYWORDS + KEYWORDS["HISTOBOOKING"] = HISTOBOOKING ANASRCFILE = os.path.join(ANASRCDIR, ANANAME+".cc") @@ -209,9 +219,7 @@ declare(FinalState(Cuts::abseta < 5 && Cuts::pT > 100*MeV), "FS"); // Book histograms - _h_XXXX = bookProfile1D(1, 1, 1); - _h_YYYY = bookHisto1D(2, 1, 1); - _h_ZZZZ = bookCounter(3, 1, 1); +%(HISTOBOOKING)s }
More information about the Rivet-svn mailing list |