FastJet 3.0.2
MassDropTagger.cc
00001 //STARTHEADER
00002 // $Id: MassDropTagger.cc 2732 2011-11-21 17:28:31Z soyez $
00003 //
00004 // Copyright (c) 2005-2011, Matteo Cacciari, Gavin P. 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, see <http://www.gnu.org/licenses/>.
00026 //----------------------------------------------------------------------
00027 //ENDHEADER
00028 
00029 #include <fastjet/tools/MassDropTagger.hh>
00030 #include <fastjet/ClusterSequence.hh>
00031 #include <sstream>
00032 
00033 FASTJET_BEGIN_NAMESPACE
00034 
00035 LimitedWarning MassDropTagger::_warnings_nonca;
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 // returns the tagged PseudoJet if successful, 0 otherwise
00053 //  - jet   the PseudoJet to tag
00054 PseudoJet MassDropTagger::result(const PseudoJet & jet) const{
00055   PseudoJet j = jet;
00056 
00057   // issue a warning if the jet is not obtained through a C/A
00058   // clustering
00059   if ((! j.has_associated_cluster_sequence()) ||
00060       (! j.validated_cs()->jet_def().jet_algorithm() == cambridge_algorithm))
00061     _warnings_nonca.warn("MassDropTagger should only be applied on jets from a Cambridge/Aachen clustering; use it with other algorithms at your own risk.");
00062 
00063 
00064   PseudoJet j1, j2;
00065   bool had_parents;
00066 
00067   // we just ask that we can "walk" in the cluster sequence.
00068   // appropriate errors will be thrown automatically if this is not
00069   // the case
00070   while ((had_parents = j.has_parents(j1,j2))) {
00071     // make parent1 the more massive jet
00072     if (j1.m2() < j2.m2()) std::swap(j1,j2);
00073 
00074     // if we pass the conditions on the mass drop and its degree of
00075     // asymmetry (kt_dist/m^2 > rtycut [where kt_dist/m^2 \sim
00076     // z/(1-z)), then we've found something interesting, so exit the
00077     // loop
00078     if ( (j1.m2() < _mu*_mu*j.m2()) && (j1.kt_distance(j2) > _ycut*j.m2()) )
00079       break;
00080     else
00081       j = j1;
00082   }
00083     
00084   if (!had_parents)
00085     // no Higgs found, return an empty PseudoJet
00086     return PseudoJet();
00087 
00088   // create the result and its structure
00089   PseudoJet result_local = j;
00090   MassDropTaggerStructure * s = new MassDropTaggerStructure(result_local);
00091 //  s->_original_jet = jet;
00092   s->_mu = (j.m2()!=0.0) ? sqrt(j1.m2()/j.m2()) : 0.0;
00093   s->_y  = (j.m2()!=0.0) ? j1.kt_distance(j2)/j.m2() : 0.0;
00094 
00095   result_local.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(s));
00096 
00097   return result_local;
00098 }
00099 
00100 FASTJET_END_NAMESPACE
00101 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends