22 FASTJET_BEGIN_NAMESPACE
30 double iminMassDrop,
double imaxMassDrop,
31 double iminY,
double imaxY,
32 double iminDeltaR,
double imaxDeltaR,
36 muMin_(iminMassDrop), muMax_(imaxMassDrop),
37 yMin_(iminY), yMax_(imaxY),
38 dRMin_(iminDeltaR), dRMax_(imaxDeltaR),
46 std::ostringstream oss;
47 oss <<
"CMSBoostedTauSeedingAlgorithm algorithm";
55 if ( maxDepth != -1 && depth > maxDepth )
return;
56 fastjet::PseudoJet subjet1, subjet2;
57 bool hasSubjets = jet.has_parents(subjet1, subjet2);
58 if ( !hasSubjets )
return;
59 std::string depth_and_idx_string_subjet1 = depth_and_idx_string;
60 if ( depth_and_idx_string_subjet1.length() > 0 ) depth_and_idx_string_subjet1.append(
".");
61 depth_and_idx_string_subjet1.append(
"0");
62 for (
int iSpace = 0; iSpace <
depth; ++iSpace ) {
65 std::cout <<
" jetConstituent #" << depth_and_idx_string_subjet1 <<
" (depth = " << depth <<
"): Pt = " << subjet1.pt() <<
","
66 <<
" eta = " << subjet1.eta() <<
", phi = " << subjet1.phi() <<
", mass = " << subjet1.m()
67 <<
" (constituents = " << subjet1.constituents().size() <<
")" << std::endl;
69 std::string depth_and_idx_string_subjet2 = depth_and_idx_string;
70 if ( depth_and_idx_string_subjet2.length() > 0 ) depth_and_idx_string_subjet2.append(
".");
71 depth_and_idx_string_subjet2.append(
"1");
72 for (
int iSpace = 0; iSpace <
depth; ++iSpace ) {
75 std::cout <<
" jetConstituent #" << depth_and_idx_string_subjet2 <<
" (depth = " << depth <<
"): Pt = " << subjet2.pt() <<
","
76 <<
" eta = " << subjet2.eta() <<
", phi = " << subjet2.phi() <<
", mass = " << subjet2.m()
77 <<
" (constituents = " << subjet2.constituents().size() <<
")" << std::endl;
79 for (
int iSpace = 0; iSpace <
depth; ++iSpace ) {
82 double dR = subjet1.delta_R(subjet2);
83 std::cout <<
" (mass-drop @ " << depth_and_idx_string <<
" = " <<
std::max(subjet1.m(), subjet2.m())/jet.m() <<
", dR = " << dR <<
")" << std::endl;
89 std::cout <<
"<CMSBoostedTauSeedingAlgorithm::findSubjets>:" << std::endl;
90 std::cout <<
" jet: Pt = " << jet.pt() <<
", eta = " << jet.eta() <<
", phi = " << jet.phi() <<
", mass = " << jet.m() << std::endl;
93 PseudoJet subjet1, subjet2;
94 bool hasSubjets = jet.has_parents(subjet1, subjet2);
97 if ( subjet1.m2() < subjet2.m2() ) {
100 double dR = subjet1.delta_R(subjet2);
101 double kT = subjet1.kt_distance(subjet2);
102 double mu = ( jet.m() > 0. ) ?
103 sqrt(
std::max(subjet1.m2(), subjet2.m2())/jet.m2()) : -1.;
107 return std::make_pair(subjet1, subjet2);
108 }
else if ( subjet1.pt() >
ptMin_ ) {
109 return findSubjets(subjet1, depth + 1, subjetsFound);
110 }
else if ( subjet2.pt() >
ptMin_ ) {
111 return findSubjets(subjet2, depth + 1, subjetsFound);
114 subjetsFound =
false;
115 PseudoJet dummy_subjet1, dummy_subjet2;
116 return std::make_pair(dummy_subjet1, dummy_subjet2);
122 std::cout <<
"<CMSBoostedTauSeedingAlgorithm::findSubjets>:" << std::endl;
123 std::cout <<
" jet: Pt = " << jet.pt() <<
", eta = " << jet.eta() <<
", phi = " << jet.phi() <<
", mass = " << jet.m() << std::endl;
130 bool subjetsFound =
false;
131 std::pair<PseudoJet, PseudoJet> subjets =
findSubjets(jet, 0, subjetsFound);
132 if ( subjetsFound ) {
134 PseudoJet subjet1 = subjets.first;
135 PseudoJet subjet2 = subjets.second;
137 std::cout <<
"before recombination:" << std::endl;
138 std::cout <<
" subjet #1: Pt = " << subjet1.pt() <<
", eta = " << subjet1.eta() <<
", phi = " << subjet1.phi() <<
", mass = " << subjet1.m() << std::endl;
139 std::cout <<
" subjet #2: Pt = " << subjet2.pt() <<
", eta = " << subjet2.eta() <<
", phi = " << subjet2.phi() <<
", mass = " << subjet2.m() << std::endl;
142 const JetDefinition::Recombiner* rec = jet.associated_cluster_sequence()->jet_def().recombiner();
143 PseudoJet result_local =
join(subjet1, subjet2, *rec);
145 std::cout <<
"after recombination:" << std::endl;
146 std::vector<fastjet::PseudoJet> subjets = result_local.pieces();
148 for ( std::vector<fastjet::PseudoJet>::const_iterator subjet = subjets.begin();
149 subjet != subjets.end(); ++subjet ) {
150 std::cout <<
" subjet #" << idx_subjet <<
": Pt = " << subjet->pt() <<
", eta = " << subjet->eta() <<
", phi = " << subjet->phi() <<
", mass = " << subjet->m()
151 <<
" (#constituents = " << subjet->constituents().size() <<
")" << std::endl;
152 std::vector<fastjet::PseudoJet> constituents = subjet->constituents();
153 int idx_constituent = 0;
154 for ( std::vector<fastjet::PseudoJet>::const_iterator constituent = constituents.begin();
155 constituent != constituents.end(); ++constituent ) {
156 if ( constituent->pt() < 1.e-3 )
continue;
157 std::cout <<
" constituent #" << idx_constituent <<
": Pt = " << constituent->pt() <<
", eta = " << constituent->eta() <<
", phi = " << constituent->phi() <<
","
158 <<
" mass = " << constituent->m() << std::endl;
167 s->
_mu = ( jet.m2() > 0. ) ?
sqrt(
std::max(subjet1.m2(), subjet2.m2())/jet.m2()) : 0.;
168 s->
_y = ( jet.m2() > 0. ) ? subjet1.kt_distance(subjet2)/jet.m2() : 0.;
169 s->
_dR = subjet1.delta_R(subjet2);
170 s->
_pt = subjet2.pt();
172 result_local.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(s));
178 std::cout <<
"No subjets found." << std::endl;
187 FASTJET_END_NAMESPACE
void dumpSubJetStructure(const fastjet::PseudoJet &jet, int depth, int maxDepth, const std::string &depth_and_idx_string) const
double ptMin_
minimum sub-jet pt
double _pt
the value of the pt parameter
int maxDepth_
the max depth for descending into clustering sequence
double _mu
the value of the mass-drop parameter
double yMax_
the max value of the asymmetry parameter
virtual PseudoJet result(const PseudoJet &jet) const
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
double yMin_
the min value of the asymmetry parameter
CMSBoostedTauSeedingAlgorithm(double ptMin, double muMin, double muMax, double yMin, double yMax, double dRMin, double dRMax, int maxDepth, int verbosity=0)
double muMax_
the max value of the mass-drop parameter
double _y
the value of the asymmetry parameter
std::pair< PseudoJet, PseudoJet > findSubjets(const PseudoJet &jet, int depth, bool &subjetsFound) const
int verbosity_
flag to enable/disable debug output
static std::string join(char **cmd)
double _dR
the value of the dR parameter
double dRMin_
the min value of the dR parameter
double muMin_
the min value of the mass-drop parameter
virtual std::string description() const