FastJet 3.0beta1
MassDropTagger.cc
00001 //STARTHEADER
00002 // $Id: MassDropTagger.cc 2474 2011-07-26 13:13:54Z cacciari $
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 LimitedWarning MassDropTagger::_warnings_nonca;
00038 
00039 using namespace std;
00040 
00041 //----------------------------------------------------------------------
00042 // MassDropTagger class implementation
00043 //----------------------------------------------------------------------
00044 
00045 //------------------------------------------------------------------------
00046 // description of the tagger
00047 string MassDropTagger::description() const{ 
00048   ostringstream oss;
00049   oss << "MassDropTagger with mu=" << _mu << " and ycut=" << _ycut;
00050   return oss.str();
00051 }
00052 
00053 //------------------------------------------------------------------------
00054 // returns the tagged PseudoJet if successful, 0 otherwise
00055 //  - jet   the PseudoJet to tag
00056 PseudoJet MassDropTagger::result(const PseudoJet & jet) const{
00057   PseudoJet j = jet;
00058 
00059   // issue a warning if the jet is not obtained through a C/A
00060   // clustering
00061   if ((! j.has_associated_cluster_sequence()) ||
00062       (! j.validated_cs()->jet_def().jet_algorithm() == cambridge_algorithm))
00063     _warnings_nonca.warn("MassDropTagger should only be applied on jets from a Cambridge/Aachen clustering; use it with other algorithms at your own risk.");
00064 
00065 
00066   PseudoJet j1, j2;
00067   bool had_parents;
00068 
00069   // we just ask that we can "walk" in the cluster sequence.
00070   // appropriate errors will be thrown automatically if this is not
00071   // the case
00072   while ((had_parents = j.has_parents(j1,j2))) {
00073     // make parent1 the more massive jet
00074     if (j1.m() < j2.m()) std::swap(j1,j2);
00075 
00076     // if we pass the conditions on the mass drop and its degree of
00077     // asymmetry (kt_dist/m^2 > rtycut [where kt_dist/m^2 \sim
00078     // z/(1-z)), then we've found something interesting, so exit the
00079     // loop
00080     if ( (j1.m() < _mu*j.m()) && (j1.kt_distance(j2) > _ycut*j.m2()) )
00081       break;
00082     else
00083       j = j1;
00084   }
00085     
00086   if (!had_parents)
00087     // no Higgs found, return an empty PseudoJet
00088     return PseudoJet();
00089 
00090   // create the result and its structure
00091   const JetDefinition::Recombiner *rec
00092     = jet.associated_cluster_sequence()->jet_def().recombiner();
00093   PseudoJet result = join<StructureType>(j1,j2,*rec);
00094   StructureType * s = (StructureType *) result.structure_non_const_ptr();
00095 //  s->_original_jet = jet;
00096   s->_mu = (j.m()!=0.0) ? j1.m()/j.m() : 0.0;
00097   s->_y  = (j1.m2()!=0.0) ? j1.kt_distance(j2)/j.m2() : 0.0;
00098 
00099   return result;
00100 }
00101 
00102 FASTJET_END_NAMESPACE
00103 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends