|
[Rivet-svn] r3541 - in trunk: include/Rivet/Projections src/Analyses src/Projectionsblackhole at projects.hepforge.org blackhole at projects.hepforge.orgMon Jan 16 22:39:10 GMT 2012
Author: fsiegert Date: Mon Jan 16 22:39:10 2012 New Revision: 3541 Log: Bugfix in ATLAS_2010_S8919674: Really use neutrino with highest pT for Etmiss. Doesn't seem to make very much difference, but is more correct in principal. Modified: trunk/include/Rivet/Projections/LeadingParticlesFinalState.hh trunk/include/Rivet/Projections/LeptonClusters.hh trunk/src/Analyses/ATLAS_2010_S8919674.cc trunk/src/Projections/LeadingParticlesFinalState.cc Modified: trunk/include/Rivet/Projections/LeadingParticlesFinalState.hh ============================================================================== --- trunk/include/Rivet/Projections/LeadingParticlesFinalState.hh Mon Jan 16 09:51:26 2012 (r3540) +++ trunk/include/Rivet/Projections/LeadingParticlesFinalState.hh Mon Jan 16 22:39:10 2012 (r3541) @@ -17,7 +17,7 @@ /// Constructor: the supplied FinalState projection is assumed to live through the run. LeadingParticlesFinalState(const FinalState& fsp) - : FinalState() + : FinalState(), _leading_only(false) { setName("LeadingParticlesFinalState"); addProjection(fsp, "FS"); @@ -41,6 +41,13 @@ return *this; } + /// Toggle whether to keep track only of the leading particle of any ID, + /// or the leading particle of all IDs separately + /// Default is the latter (=false) + void setLeadingOnly(const bool& leadingonly) { + _leading_only = leadingonly; + } + // /// Check if a particle of a particular ID was found in the current event // bool hasParticleId(const PdgId pid) const; @@ -63,6 +70,7 @@ /// IDs of the leading particles to be selected std::set<long>_ids; + bool _leading_only; }; Modified: trunk/include/Rivet/Projections/LeptonClusters.hh ============================================================================== --- trunk/include/Rivet/Projections/LeptonClusters.hh Mon Jan 16 09:51:26 2012 (r3540) +++ trunk/include/Rivet/Projections/LeptonClusters.hh Mon Jan 16 22:39:10 2012 (r3541) @@ -39,11 +39,6 @@ /// leptons) from signal and store the original charged particles and photons /// as particles() while the newly created clustered lepton objects are /// accessible as clusteredLeptons() - /// @brief Use LeptonClustersConstituents projection to cluster all photons to - /// leptons. This projection here makes the clustered objects available - /// in a FinalState manner, i.e. as particles(). The given pT and eta cuts are - /// applied to those objects. The underlying (original) leptons and photons - /// are available by means of the constituentsFinalState() method. class LeptonClusters : public FinalState { public: Modified: trunk/src/Analyses/ATLAS_2010_S8919674.cc ============================================================================== --- trunk/src/Analyses/ATLAS_2010_S8919674.cc Mon Jan 16 09:51:26 2012 (r3540) +++ trunk/src/Analyses/ATLAS_2010_S8919674.cc Mon Jan 16 22:39:10 2012 (r3541) @@ -63,9 +63,11 @@ FinalState fs; LeadingParticlesFinalState muon_neutrino(fs); muon_neutrino.addParticleIdPair(NU_MU); + muon_neutrino.setLeadingOnly(true); addProjection(muon_neutrino, "muon_neutrino"); LeadingParticlesFinalState elec_neutrino(fs); elec_neutrino.addParticleIdPair(NU_E); + elec_neutrino.setLeadingOnly(true); addProjection(elec_neutrino, "elec_neutrino"); // Input for the jets: No neutrinos, no muons, and no electron which Modified: trunk/src/Projections/LeadingParticlesFinalState.cc ============================================================================== --- trunk/src/Projections/LeadingParticlesFinalState.cc Mon Jan 16 09:51:26 2012 (r3540) +++ trunk/src/Projections/LeadingParticlesFinalState.cc Mon Jan 16 22:39:10 2012 (r3541) @@ -14,6 +14,9 @@ fscmp = FinalState::compare(other); if (fscmp != EQUIVALENT) return fscmp; + int locmp = cmp(_leading_only, other._leading_only); + if (locmp != EQUIVALENT) return locmp; + // Finally compare the IDs if (_ids < other._ids) return ORDERED; else if (other._ids < _ids) return UNORDERED; @@ -54,6 +57,21 @@ << " with momentum " << i->second->momentum()); _theParticles.push_back(*(i->second)); } + + if (_leading_only) { + double ptmax=0.0; + Particle pmax; + + foreach (const Particle& p, _theParticles) { + if (p.momentum().pT() > ptmax) { + ptmax = p.momentum().pT(); + pmax = p; + } + } + + _theParticles.clear(); + _theParticles.push_back(pmax); + } }
More information about the Rivet-svn mailing list |