|
[Rivet-svn] r3504 - in branches/2011-07-aida2yoda: bin include/Rivet src/Projectionsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgTue Dec 6 13:36:13 GMT 2011
Author: hoeth Date: Tue Dec 6 13:36:13 2011 New Revision: 3504 Log: merge r3469-3471 from trunk Modified: branches/2011-07-aida2yoda/bin/root2flat branches/2011-07-aida2yoda/include/Rivet/Makefile.am branches/2011-07-aida2yoda/src/Projections/InvMassFinalState.cc branches/2011-07-aida2yoda/src/Projections/WFinder.cc Modified: branches/2011-07-aida2yoda/bin/root2flat ============================================================================== --- branches/2011-07-aida2yoda/bin/root2flat Mon Dec 5 16:43:59 2011 (r3503) +++ branches/2011-07-aida2yoda/bin/root2flat Tue Dec 6 13:36:13 2011 (r3504) @@ -47,7 +47,7 @@ f = ROOT.TFile(rootfile) # Initial browse to see the structure - subdirs, histonames, tgraphnames = browse(f) + subdirs, histonames, tgraphnames, tcanvases = browse(f) # Keep browsing if there are subdirectories TODO: Make this work for # arbitrarily deep directory structures @@ -61,6 +61,9 @@ writeHisto(histoname, f.Get(histoname), num+nobs) for num, tgraphname in enumerate(tgraphnames): writeHisto(tgraphname, f.Get(tgraphname), num + len(histonames)+nobs, True) + # TCanvas items + for num, tc in enumerate(tcanvases): + writeHisto(tc[0], tc[-1], num + len(histonames) + len(tgraphnames) + nobs, tc[1]) nobs += len(histonames) nobs += len(tgraphnames) @@ -76,6 +79,7 @@ histos = [] tgraphs = [] subdirs = [] + tcanvases = [] # Get Iterator if branch: @@ -105,8 +109,15 @@ histos.append(t_n) elif f.Get(t_n).InheritsFrom("TGraphAsymmErrors"): tgraphs.append(t_n) + # Also support graphs, histos stored in TCanvases + elif f.Get(t_n).InheritsFrom("TCanvas"): + for ci in f.Get(t_n).GetListOfPrimitives(): + if ci.InheritsFrom("TH1") or ci.InheritsFrom("TProfile"): + tcanvases.append((t_n,False,ci)) + elif ci.InheritsFrom("TGraphAsymmErrors"): + tcanvases.append((t_n,True,ci)) - return subdirs, histos, tgraphs + return subdirs, histos, tgraphs, tcanvases def convertHisto(R_histo): Modified: branches/2011-07-aida2yoda/include/Rivet/Makefile.am ============================================================================== --- branches/2011-07-aida2yoda/include/Rivet/Makefile.am Mon Dec 5 16:43:59 2011 (r3503) +++ branches/2011-07-aida2yoda/include/Rivet/Makefile.am Tue Dec 6 13:36:13 2011 (r3504) @@ -63,6 +63,7 @@ Projections/MissingMomentum.hh \ Projections/Multiplicity.hh \ Projections/NeutralFinalState.hh \ + Projections/NonHadronicFinalState.hh \ Projections/ParisiTensor.hh \ Projections/Sphericity.hh \ Projections/Spherocity.hh \ Modified: branches/2011-07-aida2yoda/src/Projections/InvMassFinalState.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Projections/InvMassFinalState.cc Mon Dec 5 16:43:59 2011 (r3503) +++ branches/2011-07-aida2yoda/src/Projections/InvMassFinalState.cc Tue Dec 6 13:36:13 2011 (r3504) @@ -79,12 +79,12 @@ } - void InvMassFinalState::project(const Event& e) { const FinalState& fs = applyProjection<FinalState>(e, "FS"); calc(fs.particles()); } + void InvMassFinalState::calc(const ParticleVector& inparticles) { _theParticles.clear(); _particlePairs.clear(); @@ -107,7 +107,7 @@ } } } - if(type1.empty() || type2.empty()) return; + if (type1.empty() || type2.empty()) return; // Temporary container of selected particles iterators // Useful to compare iterators and avoid double occurrences of the same @@ -119,7 +119,7 @@ closestPair.first = 1e30; foreach (const Particle* i1, type1) { foreach (const Particle* i2, type2) { - // check this is actually a pair + // Check this is actually a pair // (if more than one pair in vector particles can be unrelated) bool found = false; foreach (const PdgIdPair& ipair, _decayids) { Modified: branches/2011-07-aida2yoda/src/Projections/WFinder.cc ============================================================================== --- branches/2011-07-aida2yoda/src/Projections/WFinder.cc Mon Dec 5 16:43:59 2011 (r3503) +++ branches/2011-07-aida2yoda/src/Projections/WFinder.cc Tue Dec 6 13:36:13 2011 (r3504) @@ -107,7 +107,6 @@ cmp(_useTransverseMass, other._useTransverseMass) || cmp(_etMiss, other._etMiss) || cmp(_pid, other._pid) || cmp(_trackPhotons, other._trackPhotons)); - } @@ -168,7 +167,7 @@ const PdgId wpid = (wcharge == 1) ? WPLUSBOSON : WMINUSBOSON; _bosons.push_back(Particle(wpid, pW)); - // find the LeptonClusters and neutrinos which survived the IMFS cut such that we can + // Find the LeptonClusters and neutrinos which survived the IMFS cut such that we can // extract their original particles foreach (const Particle& p, _constituentNeutrinos) { _theParticles.push_back(p);
More information about the Rivet-svn mailing list |