[Rivet-svn] r3424 - in branches/2011-07-aida2yoda: include/Rivet/Projections src/Analyses src/Projections

blackhole at projects.hepforge.org blackhole at projects.hepforge.org
Thu Oct 6 22:20:29 BST 2011


Author: hoeth
Date: Thu Oct  6 22:20:28 2011
New Revision: 3424

Log:
merge r3383-3391 from trunk

Modified:
   branches/2011-07-aida2yoda/include/Rivet/Projections/InvMassFinalState.hh
   branches/2011-07-aida2yoda/include/Rivet/Projections/VisibleFinalState.hh
   branches/2011-07-aida2yoda/src/Analyses/ATLAS_2010_S8919674.cc
   branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_CONF_2011_090.cc
   branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S8983313.cc
   branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9019561.cc
   branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9041966.cc
   branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9131140.cc
   branches/2011-07-aida2yoda/src/Analyses/MC_PHOTONJETS.cc
   branches/2011-07-aida2yoda/src/Projections/InvMassFinalState.cc
   branches/2011-07-aida2yoda/src/Projections/VisibleFinalState.cc
   branches/2011-07-aida2yoda/src/Projections/WFinder.cc
   branches/2011-07-aida2yoda/src/Projections/ZFinder.cc

Modified: branches/2011-07-aida2yoda/include/Rivet/Projections/InvMassFinalState.hh
==============================================================================
--- branches/2011-07-aida2yoda/include/Rivet/Projections/InvMassFinalState.hh	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/include/Rivet/Projections/InvMassFinalState.hh	Thu Oct  6 22:20:28 2011	(r3424)
@@ -27,6 +27,17 @@
                       double masstarget=-1.0);
 
 
+    /// Same thing as above, but we want to pass the particles directly to the calc method
+    InvMassFinalState(const std::pair<PdgId, PdgId>& idpair, // pair of decay products
+                      double minmass, // min inv mass
+                      double maxmass, // max inv mass
+                      double masstarget=-1.0);
+    InvMassFinalState(const std::vector<std::pair<PdgId, PdgId> >& idpairs,  // vector of pairs of decay products
+                      double minmass, // min inv mass
+                      double maxmass, // max inv mass
+                      double masstarget=-1.0);
+
+
     /// Clone on the heap.
     virtual const Projection* clone() const {
     	return new InvMassFinalState(*this);

Modified: branches/2011-07-aida2yoda/include/Rivet/Projections/VisibleFinalState.hh
==============================================================================
--- branches/2011-07-aida2yoda/include/Rivet/Projections/VisibleFinalState.hh	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/include/Rivet/Projections/VisibleFinalState.hh	Thu Oct  6 22:20:28 2011	(r3424)
@@ -8,7 +8,6 @@
 #include "Rivet/Event.hh"
 #include "Rivet/Projection.hh"
 #include "Rivet/Projections/FinalState.hh"
-#include "Rivet/Projections/VetoedFinalState.hh"
 
 namespace Rivet {
 
@@ -20,16 +19,21 @@
     /// @name Constructors
     //@{
 
-    /// Default constructor.
-    VisibleFinalState();
-
     /// Constructor with min and max pseudorapidity \f$ \eta \f$ and min \f$ p_T \f$ (in GeV).
     VisibleFinalState(double mineta = -MAXRAPIDITY,
                       double maxeta =  MAXRAPIDITY,
-                      double minpt  =  0.0*GeV);
+                      double minpt  =  0.0*GeV)
+    {
+      setName("VisibleFinalState");
+      addProjection(FinalState(mineta, maxeta, minpt), "FS");
+    }
 
     /// Constructor with specific FinalState.
-    VisibleFinalState(const FinalState& fsp);
+    VisibleFinalState(const FinalState& fsp)
+    {
+      setName("VisibleFinalState");
+      addProjection(fsp, "FS");
+    }
 
     /// Clone on the heap.
     virtual const Projection* clone() const {

Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2010_S8919674.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/ATLAS_2010_S8919674.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Analyses/ATLAS_2010_S8919674.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -3,6 +3,7 @@
 #include "Rivet/RivetYODA.hh"
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/Projections/IdentifiedFinalState.hh"
+#include "Rivet/Projections/VetoedFinalState.hh"
 #include "Rivet/Projections/MissingMomentum.hh"
 #include "Rivet/Projections/FastJets.hh"
 #include "Rivet/Projections/ClusteredPhotons.hh"

Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_CONF_2011_090.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_CONF_2011_090.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_CONF_2011_090.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -7,6 +7,7 @@
 #include "Rivet/Projections/ChargedFinalState.hh"
 #include "Rivet/Projections/VisibleFinalState.hh"
 #include "Rivet/Projections/IdentifiedFinalState.hh"
+#include "Rivet/Projections/VetoedFinalState.hh"
 #include "Rivet/Projections/FastJets.hh"
 
 namespace Rivet {
@@ -62,8 +63,7 @@
 
       // Jet finder
       VetoedFinalState vfs;
-      vfs.addVetoPairDetail(MUON,10*GeV,7000*GeV);
-      vfs.addVetoPairDetail(ELECTRON,20*GeV,7000*GeV);
+      vfs.addVetoPairId(MUON);
       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4),
                    "AntiKtJets04");
 
@@ -81,10 +81,10 @@
       _count_e_channel = bookHisto1D("count_electron_channel", 1, 0., 1.);
       _hist_eTmiss_e = bookHisto1D("Et_miss_e", 50, 0., 500.);
       _hist_eTmiss_mu = bookHisto1D("Et_miss_mu", 50, 0., 500.);
-      _hist_m_eff_e = bookHisto1D("m_eff_e", 30, 0., 1500.);
-      _hist_m_eff_mu = bookHisto1D("m_eff_mu", 30, 0., 1500.);
-      _hist_m_eff_e_final = bookHisto1D("m_eff_e_final", 30, 0., 1500.);
-      _hist_m_eff_mu_final = bookHisto1D("m_eff_mu_final", 30, 0., 1500.);
+      _hist_m_eff_e = bookHisto1D("m_eff_e", 60, 0., 1500.);
+      _hist_m_eff_mu = bookHisto1D("m_eff_mu", 60, 0., 1500.);
+      _hist_m_eff_e_final = bookHisto1D("m_eff_e_final", 60, 0., 1500.);
+      _hist_m_eff_mu_final = bookHisto1D("m_eff_mu_final", 60, 0., 1500.);
 
 
 
@@ -171,20 +171,20 @@
 	       deltaR(e.momentum(),jet.momentum()) > 0.2 )
 	    e_near_jet = true;
 	}
-        if ( e_near_jet == false )
+        if ( ! e_near_jet )
           recon_e.push_back( e );
-       }
+      }
 
       foreach ( const Particle & mu, cand_mu ) {
-         bool mu_near_jet = false;
-         foreach ( const Jet& jet, cand_jets_2 ) {
-           if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 )
-	     mu_near_jet = true;
-	 }
-	 if ( mu_near_jet == false )
+	bool mu_near_jet = false;
+	foreach ( const Jet& jet, cand_jets_2 ) {
+	  if ( deltaR(mu.momentum(),jet.momentum()) < 0.4 )
+	    mu_near_jet = true;
+	}
+	if ( ! mu_near_jet )
 	  recon_mu.push_back( mu );
-       }
-
+      }
+      
       // pTmiss
       ParticleVector vfs_particles
 	= applyProjection<VisibleFinalState>(event, "vfs").particles();
@@ -338,10 +338,10 @@
 
 	scale( _hist_eTmiss_e, 10. * 165. * crossSection()/sumOfWeights() );
 	scale( _hist_eTmiss_mu, 10. * 165. * crossSection()/sumOfWeights() );
-	scale( _hist_m_eff_e, 50. * 165. * crossSection()/sumOfWeights() );
-	scale( _hist_m_eff_mu, 50. * 165. * crossSection()/sumOfWeights() );
-	scale( _hist_m_eff_e_final, 50. * 165. * crossSection()/sumOfWeights() );
-	scale( _hist_m_eff_mu_final, 50. * 165. * crossSection()/sumOfWeights() );
+	scale( _hist_m_eff_e, 25. * 165. * crossSection()/sumOfWeights() );
+	scale( _hist_m_eff_mu, 25. * 165. * crossSection()/sumOfWeights() );
+	scale( _hist_m_eff_e_final, 25. * 165. * crossSection()/sumOfWeights() );
+	scale( _hist_m_eff_mu_final, 25. * 165. * crossSection()/sumOfWeights() );
 
 
     }

Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S8983313.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S8983313.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S8983313.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -6,6 +6,7 @@
 #include "Rivet/Projections/FinalState.hh"
 #include "Rivet/Projections/ChargedFinalState.hh"
 #include "Rivet/Projections/VisibleFinalState.hh"
+#include "Rivet/Projections/VetoedFinalState.hh"
 #include "Rivet/Projections/IdentifiedFinalState.hh"
 #include "Rivet/Projections/FastJets.hh"
 #include "Rivet/Tools/RivetMT2.hh"
@@ -63,8 +64,7 @@
 
 
       VetoedFinalState vfs;
-      vfs.addVetoPairDetail(MUON,20*GeV,7000*GeV);
-      vfs.addVetoPairDetail(ELECTRON,20*GeV,7000*GeV);
+      vfs.addVetoPairId(MUON);
 
 
       /// Jet finder

Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9019561.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9019561.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9019561.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -8,6 +8,7 @@
 #include "Rivet/Projections/VisibleFinalState.hh"
 #include "Rivet/Projections/IdentifiedFinalState.hh"
 #include "Rivet/Projections/FastJets.hh"
+#include "Rivet/Projections/VetoedFinalState.hh"
 
 namespace Rivet {
 
@@ -62,8 +63,7 @@
 
       // jet finder
       VetoedFinalState vfs;
-      vfs.addVetoPairDetail(MUON,20*GeV,7000*GeV);
-      vfs.addVetoPairDetail(ELECTRON,20*GeV,7000*GeV);
+      vfs.addVetoPairId(MUON);
       addProjection(FastJets(vfs, FastJets::ANTIKT, 0.4),
                    "AntiKtJets04");
 

Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9041966.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9041966.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9041966.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -7,6 +7,7 @@
 #include "Rivet/Projections/ChargedFinalState.hh"
 #include "Rivet/Projections/VisibleFinalState.hh"
 #include "Rivet/Projections/IdentifiedFinalState.hh"
+#include "Rivet/Projections/VetoedFinalState.hh"
 #include "Rivet/Projections/FastJets.hh"
 
 namespace Rivet {

Modified: branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9131140.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9131140.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Analyses/ATLAS_2011_S9131140.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -32,7 +32,7 @@
       // Set up projections
       ZFinder zfinder_dressed_el(-2.4, 2.4, 20, ELECTRON, 66.0*GeV, 116.0*GeV, 0.1, true, false);
       addProjection(zfinder_dressed_el, "ZFinder_dressed_el");
-      ZFinder zfinder_bare_el(-2.4, 2.4, 20, ELECTRON, 66.0*GeV, 116.0*GeV, 0.1, true, false);
+      ZFinder zfinder_bare_el(-2.4, 2.4, 20, ELECTRON, 66.0*GeV, 116.0*GeV, 0.0, true, false);
       addProjection(zfinder_bare_el, "ZFinder_bare_el");
       ZFinder zfinder_dressed_mu(-2.4, 2.4, 20, MUON, 66.0*GeV, 116.0*GeV, 0.1, true, false);
       addProjection(zfinder_dressed_mu, "ZFinder_dressed_mu");
@@ -73,7 +73,7 @@
       }
 
       const ZFinder& zfinder_bare_mu = applyProjection<ZFinder>(evt, "ZFinder_bare_mu");
-      if (zfinder_bare_mu.bosons().empty()) {
+      if (!zfinder_bare_mu.bosons().empty()) {
         _sumw_mu_bare += weight;
         const FourMomentum pZ = zfinder_bare_mu.bosons()[0].momentum();
         _hist_zpt_mu_bare->fill(pZ.pT()/GeV, weight);

Modified: branches/2011-07-aida2yoda/src/Analyses/MC_PHOTONJETS.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Analyses/MC_PHOTONJETS.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Analyses/MC_PHOTONJETS.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -1,6 +1,7 @@
 // -*- C++ -*-
 #include "Rivet/Analyses/MC_JetAnalysis.hh"
 #include "Rivet/Projections/LeadingParticlesFinalState.hh"
+#include "Rivet/Projections/VetoedFinalState.hh"
 #include "Rivet/Projections/FastJets.hh"
 #include "Rivet/Tools/Logging.hh"
 #include "Rivet/RivetYODA.hh"

Modified: branches/2011-07-aida2yoda/src/Projections/InvMassFinalState.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Projections/InvMassFinalState.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Projections/InvMassFinalState.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -31,6 +31,27 @@
   }
 
 
+  InvMassFinalState::InvMassFinalState(const pair<PdgId, PdgId>& idpair, // pair of decay products
+                                       double minmass, // min inv mass
+                                       double maxmass, // max inv mass
+                                       double masstarget)
+    : _minmass(minmass), _maxmass(maxmass), _masstarget(masstarget), _useTransverseMass(false)
+  {
+    setName("InvMassFinalState");
+    _decayids.push_back(idpair);
+  }
+
+
+  InvMassFinalState::InvMassFinalState(const vector<pair<PdgId, PdgId> >& idpairs,  // vector of pairs of decay products
+                                       double minmass, // min inv mass
+                                       double maxmass, // max inv mass
+                                       double masstarget)
+    : _decayids(idpairs), _minmass(minmass), _maxmass(maxmass), _masstarget(masstarget), _useTransverseMass(false)
+  {
+    setName("InvMassFinalState");
+  }
+
+
   int InvMassFinalState::compare(const Projection& p) const {
     // First compare the final states we are running on
     int fscmp = mkNamedPCmp(p, "FS");

Modified: branches/2011-07-aida2yoda/src/Projections/VisibleFinalState.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Projections/VisibleFinalState.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Projections/VisibleFinalState.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -1,56 +1,45 @@
 // -*- C++ -*-
 #include "Rivet/Rivet.hh"
+#include "Rivet/Tools/ParticleIdUtils.hh"
 #include "Rivet/Projections/VisibleFinalState.hh"
 #include "Rivet/Cmp.hh"
-#include "Rivet/Tools/Utils.hh"
 #include <algorithm>
 
 namespace Rivet {
 
 
-  namespace {
-    void _setup_vfs(VetoedFinalState& vfs) {
-      vfs.vetoNeutrinos();
-      vfs.addVetoId(1000022); // lightest neutralino
-      vfs.addVetoId(1000039); // gravitino
-      /// @todo More?
-    }
+  int VisibleFinalState::compare(const Projection& p) const {
+    return FinalState::compare(p);
   }
 
 
-  VisibleFinalState::VisibleFinalState() {
-    setName("VisibleFinalState");
-    VetoedFinalState vfs;
-    _setup_vfs(vfs);
-    addProjection(vfs, "VetoedFS");
-  }
+  // Since we remove inivisibles from the FinalState in project(),
+  // we need a filter where invisible --> true
+  bool isInvisibleFilter(const Particle& p) {
+    // charged particles are visible
+    if ( PID::threeCharge( p.pdgId() ) != 0 ) 
+      return false;
 
+    // neutral hadrons are visible
+    if ( PID::isHadron( p.pdgId() ) ) 
+      return false;
 
-  VisibleFinalState::VisibleFinalState(double mineta, double maxeta, double minpt) {
-    setName("VisibleFinalState");
-    VetoedFinalState vfs(FinalState(mineta, maxeta, minpt));
-    _setup_vfs(vfs);
-    addProjection(vfs, "VetoedFS");
-  }
+    // photons are visible
+    if ( p.pdgId() == PHOTON ) 
+      return false;
 
-
-  VisibleFinalState::VisibleFinalState(const FinalState& fsp) {
-    setName("VisibleFinalState");
-    VetoedFinalState vfs(fsp);
-    _setup_vfs(vfs);
-    addProjection(vfs, "VetoedFS");
-  }
-
-
-  int VisibleFinalState::compare(const Projection& p) const {
-    return mkNamedPCmp(p, "VetoedFS");
+    // everything else is invisible
+    return true;
   }
 
 
   void VisibleFinalState::project(const Event& e) {
-    const FinalState& vfs = applyProjection<FinalState>(e, "VetoedFS");
-    _theParticles = vfs.particles();
+    const FinalState& fs = applyProjection<FinalState>(e, "FS");
+    _theParticles.clear();
+    std::remove_copy_if(fs.particles().begin(), fs.particles().end(),
+                        std::back_inserter(_theParticles), isInvisibleFilter);
+    MSG_DEBUG("Number of visible final-state particles = "
+             << _theParticles.size());
   }
 
-
 }

Modified: branches/2011-07-aida2yoda/src/Projections/WFinder.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Projections/WFinder.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Projections/WFinder.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -119,7 +119,7 @@
     vector<pair<PdgId, PdgId> > l_nu_ids;
     l_nu_ids += make_pair(abs(_pid), -abs(_nu_pid));
     l_nu_ids += make_pair(-abs(_pid), abs(_nu_pid));
-    InvMassFinalState imfs(FinalState(), l_nu_ids, _minmass, _maxmass, _masstarget);
+    InvMassFinalState imfs(l_nu_ids, _minmass, _maxmass, _masstarget);
     imfs.useTransverseMass(_useTransverseMass);
     ParticleVector tmp;
     tmp.insert(tmp.end(), leptons.clusteredLeptons().begin(), leptons.clusteredLeptons().end());

Modified: branches/2011-07-aida2yoda/src/Projections/ZFinder.cc
==============================================================================
--- branches/2011-07-aida2yoda/src/Projections/ZFinder.cc	Thu Oct  6 22:12:14 2011	(r3423)
+++ branches/2011-07-aida2yoda/src/Projections/ZFinder.cc	Thu Oct  6 22:20:28 2011	(r3424)
@@ -84,7 +84,7 @@
 
     const LeptonClusters& leptons = applyProjection<LeptonClusters>(e, "LeptonClusters");
 
-    InvMassFinalState imfs(FinalState(), std::make_pair(_pid, -_pid), _minmass, _maxmass, _masstarget);
+    InvMassFinalState imfs(std::make_pair(_pid, -_pid), _minmass, _maxmass, _masstarget);
     ParticleVector tmp;
     tmp.insert(tmp.end(), leptons.clusteredLeptons().begin(), leptons.clusteredLeptons().end());
     imfs.calc(tmp);


More information about the Rivet-svn mailing list