17 #ifndef __TEMPLATE_TAGGER_HH__
18 #define __TEMPLATE_TAGGER_HH__
20 #include "matching.hh"
22 #include "fastjet/FunctionOfPseudoJet.hh"
23 #include <fastjet/Selector.hh>
24 #include <fastjet/CompositeJetStructure.hh>
25 #include <fastjet/tools/Transformer.hh>
34 using namespace TemplateOverlap;
38 FASTJET_BEGIN_NAMESPACE
48 class Noverlap :
public FunctionOfPseudoJet<templ_t> {
51 Noverlap(
int N ,
double sigma,
double R0,
const string & templateFile)
52 : _N(N), _templateFinder(templateFile,
Settings(R0, sigma)), _R0(R0), _sigma(sigma)
56 templ_t
result(
const PseudoJet& jet)
const {
return _templateFinder.getOv(jet);}
71 TemplateTagger(FunctionOfPseudoJet<templ_t> *Ov_func, Selector selector,
const double R1,
const double ovcut ) :
72 _Ovfunc(Ov_func), _selector(selector), _R1(R1), _ovcut(ovcut){};
75 virtual std::string description()
const;
80 virtual PseudoJet result(
const PseudoJet & jet)
const;
87 FunctionOfPseudoJet<templ_t> *_Ovfunc;
98 CompositeJetStructure(pieces_in), _ov(0.0){}
101 inline double ov()
const{
return _ov;}
102 inline std::vector<PseudoJet> maxTempl()
const {
return _peak_template;}
104 virtual std::string description()
const {
return "Template Tagger"; }
122 ostr <<
"Filter with subjet_def = ";
124 ostr <<
"Template Tagger with cone";
125 ostr<<
", selection " <<
_selector.description();
137 templ_t my_result = (*_Ovfunc)(jet);
138 if (my_result.first <
_ovcut || !
_selector.pass(jet) )
return PseudoJet();
140 std::vector<fastjet::PseudoJet> particles = jet.constituents();
141 fastjet::Selector sel = fastjet::SelectorCircle(
_R1);
142 std::vector<fastjet::PseudoJet> subjets;
143 for (
unsigned int i=0; i< my_result.second.size(); ++i){
144 sel.set_reference(my_result.second[i]);
145 fastjet::PseudoJet subjet = fastjet::join(sel(particles));
146 subjets.push_back(subjet);
148 PseudoJet
result = join<StructureType>(subjets);
150 s->
_ov = my_result.first;
151 s->_peak_template = my_result.second;
159 FASTJET_END_NAMESPACE
161 #endif // __TEMPLATE_TAGGER_HH__