FastJet 3.0alpha3
MassDropTagger.cc
00001 //STARTHEADER
00002 // $Id: MassDropTagger.cc 2209 2011-06-02 19:47:54Z soyez $
00003 //
00004 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin Salam and Gregory Soyez
00005 //
00006 //----------------------------------------------------------------------
00007 // This file is part of FastJet.
00008 //
00009 //  FastJet is free software; you can redistribute it and/or modify
00010 //  it under the terms of the GNU General Public License as published by
00011 //  the Free Software Foundation; either version 2 of the License, or
00012 //  (at your option) any later version.
00013 //
00014 //  The algorithms that underlie FastJet have required considerable
00015 //  development and are described in hep-ph/0512210. If you use
00016 //  FastJet as part of work towards a scientific publication, please
00017 //  include a citation to the FastJet paper.
00018 //
00019 //  FastJet is distributed in the hope that it will be useful,
00020 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00021 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00022 //  GNU General Public License for more details.
00023 //
00024 //  You should have received a copy of the GNU General Public License
00025 //  along with FastJet; if not, write to the Free Software
00026 //  Foundation, Inc.:
00027 //      59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00028 //----------------------------------------------------------------------
00029 //ENDHEADER
00030 
00031 #include <fastjet/tools/MassDropTagger.hh>
00032 #include <fastjet/ClusterSequence.hh>
00033 #include <sstream>
00034 
00035 FASTJET_BEGIN_NAMESPACE
00036 
00037 using namespace std;
00038 
00039 //----------------------------------------------------------------------
00040 // MassDropTagger class implementation
00041 //----------------------------------------------------------------------
00042 
00043 //------------------------------------------------------------------------
00044 // description of the tagger
00045 string MassDropTagger::description() const{ 
00046   ostringstream oss;
00047   oss << "MassDropTagger with mu=" << _mu << " and ycut=" << _ycut;
00048   return oss.str();
00049 }
00050 
00051 //------------------------------------------------------------------------
00052 // the tagging itself
00053 //  - jet   the PseudoJet to tag
00054 PseudoJet MassDropTagger::result(const PseudoJet & jet) const{
00055   PseudoJet j = jet;
00056   PseudoJet j1, j2;
00057   bool had_parents;
00058 
00059   // we just ask that we can "walk" in the cluster sequence.
00060   // appropriate errors will be thrown automatically if this is not
00061   // the case
00062   while ((had_parents = j.has_parents(j1,j2))) {
00063     // make parent1 the more massive jet
00064     if (j1.m() < j2.m()) std::swap(j1,j2);
00065 
00066     // if we pass the conditions on the mass drop and its degree of
00067     // asymmetry (kt_dist/m^2 > rtycut [where kt_dist/m^2 \sim
00068     // z/(1-z)), then we've found something interesting, so exit the
00069     // loop
00070     if ( (j1.m() < _mu*j.m()) && (j1.kt_distance(j2) > _ycut*j.m2()) )
00071       break;
00072     else
00073       j = j1;
00074   }
00075     
00076   if (!had_parents)
00077     // no Higgs found, return an empty PseudoJet
00078     return PseudoJet();
00079 
00080   // create the result and its structure
00081   const JetDefinition::Recombiner *rec
00082     = jet.associated_cluster_sequence()->jet_def().recombiner();
00083   PseudoJet result = join<MassDropStructure>(j1,j2,*rec);
00084   MassDropStructure * s = (MassDropStructure *) result.structure_non_const_ptr();
00085   s->_mu = (j.m()!=0.0) ? j1.m()/j.m() : 0.0;
00086   s->_y  = (j1.m2()!=0.0) ? j1.kt_distance(j2)/j.m2() : 0.0;
00087 
00088   return result;
00089 }
00090 
00091 FASTJET_END_NAMESPACE
00092 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends