CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Member Functions | Private Attributes
contrib::CMSBoostedTauSeedingAlgorithm Class Reference

#include <CMSBoostedTauSeedingAlgorithm.h>

Inheritance diagram for contrib::CMSBoostedTauSeedingAlgorithm:

Public Types

typedef CMSBoostedTauSeedingAlgorithmStructure StructureType
 

Public Member Functions

 CMSBoostedTauSeedingAlgorithm (double ptMin, double muMin, double muMax, double yMin, double yMax, double dRMin, double dRMax, int maxDepth, int verbosity=0)
 
std::string description () const override
 
PseudoJet result (const PseudoJet &jet) const override
 
 ~CMSBoostedTauSeedingAlgorithm () override
 

Protected Member Functions

void dumpSubJetStructure (const fastjet::PseudoJet &jet, int depth, int maxDepth, const std::string &depth_and_idx_string) const
 
std::pair< PseudoJet, PseudoJet > findSubjets (const PseudoJet &jet, int depth, bool &subjetsFound) const
 

Private Attributes

double dRMax_
 the max value of the dR parameter More...
 
double dRMin_
 the min value of the dR parameter More...
 
int maxDepth_
 the max depth for descending into clustering sequence More...
 
double muMax_
 the max value of the mass-drop parameter More...
 
double muMin_
 the min value of the mass-drop parameter More...
 
double ptMin_
 minimum sub-jet pt More...
 
int verbosity_
 flag to enable/disable debug output More...
 
double yMax_
 the max value of the asymmetry parameter More...
 
double yMin_
 the min value of the asymmetry parameter More...
 

Detailed Description

This class implements the CMS boosted tau algorithm

Definition at line 53 of file CMSBoostedTauSeedingAlgorithm.h.

Member Typedef Documentation

Definition at line 68 of file CMSBoostedTauSeedingAlgorithm.h.

Constructor & Destructor Documentation

contrib::CMSBoostedTauSeedingAlgorithm::CMSBoostedTauSeedingAlgorithm ( double  ptMin,
double  muMin,
double  muMax,
double  yMin,
double  yMax,
double  dRMin,
double  dRMax,
int  maxDepth,
int  verbosity = 0 
)

Definition at line 32 of file CMSBoostedTauSeedingAlgorithm.cc.

38  : ptMin_(iminPt),
39  muMin_(iminMassDrop), muMax_(imaxMassDrop),
40  yMin_(iminY), yMax_(imaxY),
41  dRMin_(iminDeltaR), dRMax_(imaxDeltaR),
44  {}
double dRMax_
the max value of the dR parameter
int maxDepth_
the max depth for descending into clustering sequence
double yMax_
the max value of the asymmetry parameter
double yMin_
the min value of the asymmetry parameter
double muMax_
the max value of the mass-drop parameter
int verbosity_
flag to enable/disable debug output
double dRMin_
the min value of the dR parameter
double muMin_
the min value of the mass-drop parameter
contrib::CMSBoostedTauSeedingAlgorithm::~CMSBoostedTauSeedingAlgorithm ( )
inlineoverride

Member Function Documentation

std::string contrib::CMSBoostedTauSeedingAlgorithm::description ( ) const
override

Definition at line 48 of file CMSBoostedTauSeedingAlgorithm.cc.

Referenced by ~CMSBoostedTauSeedingAlgorithm().

48  {
49  std::ostringstream oss;
50  oss << "CMSBoostedTauSeedingAlgorithm algorithm";
51  return oss.str();
52  }
void contrib::CMSBoostedTauSeedingAlgorithm::dumpSubJetStructure ( const fastjet::PseudoJet &  jet,
int  depth,
int  maxDepth,
const std::string &  depth_and_idx_string 
) const
protected

Definition at line 56 of file CMSBoostedTauSeedingAlgorithm.cc.

References gather_cfg::cout, particleFlowClusterECALTimeSelected_cfi::depth, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, dumpSubJetStructure(), SiStripPI::max, and AlCaHLTBitMon_QueryRunRegistry::string.

Referenced by dumpSubJetStructure(), and result().

57  {
58  if ( maxDepth != -1 && depth > maxDepth ) return;
59  fastjet::PseudoJet subjet1, subjet2;
60  bool hasSubjets = jet.has_parents(subjet1, subjet2);
61  if ( !hasSubjets ) return;
62  std::string depth_and_idx_string_subjet1 = depth_and_idx_string;
63  if ( depth_and_idx_string_subjet1.length() > 0 ) depth_and_idx_string_subjet1.append(".");
64  depth_and_idx_string_subjet1.append("0");
65  for ( int iSpace = 0; iSpace < depth; ++iSpace ) {
66  std::cout << " ";
67  }
68  std::cout << " jetConstituent #" << depth_and_idx_string_subjet1 << " (depth = " << depth << "): Pt = " << subjet1.pt() << ","
69  << " eta = " << subjet1.eta() << ", phi = " << subjet1.phi() << ", mass = " << subjet1.m()
70  << " (constituents = " << subjet1.constituents().size() << ")" << std::endl;
71  dumpSubJetStructure(subjet1, depth + 1, maxDepth, depth_and_idx_string_subjet1);
72  std::string depth_and_idx_string_subjet2 = depth_and_idx_string;
73  if ( depth_and_idx_string_subjet2.length() > 0 ) depth_and_idx_string_subjet2.append(".");
74  depth_and_idx_string_subjet2.append("1");
75  for ( int iSpace = 0; iSpace < depth; ++iSpace ) {
76  std::cout << " ";
77  }
78  std::cout << " jetConstituent #" << depth_and_idx_string_subjet2 << " (depth = " << depth << "): Pt = " << subjet2.pt() << ","
79  << " eta = " << subjet2.eta() << ", phi = " << subjet2.phi() << ", mass = " << subjet2.m()
80  << " (constituents = " << subjet2.constituents().size() << ")" << std::endl;
81  dumpSubJetStructure(subjet2, depth + 1, maxDepth, depth_and_idx_string_subjet2);
82  for ( int iSpace = 0; iSpace < depth; ++iSpace ) {
83  std::cout << " ";
84  }
85  double dR = subjet1.delta_R(subjet2);
86  std::cout << " (mass-drop @ " << depth_and_idx_string << " = " << std::max(subjet1.m(), subjet2.m())/jet.m() << ", dR = " << dR << ")" << std::endl;
87  }
void dumpSubJetStructure(const fastjet::PseudoJet &jet, int depth, int maxDepth, const std::string &depth_and_idx_string) const
std::pair< PseudoJet, PseudoJet > contrib::CMSBoostedTauSeedingAlgorithm::findSubjets ( const PseudoJet &  jet,
int  depth,
bool &  subjetsFound 
) const
protected

Definition at line 89 of file CMSBoostedTauSeedingAlgorithm.cc.

References gather_cfg::cout, PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, dRMin_, SiStripPI::max, maxDepth_, RPCpg::mu, muMax_, muMin_, ptMin_, mathSSE::sqrt(), std::swap(), verbosity_, yMax_, and yMin_.

Referenced by result().

90  {
91  const float etaMax_ = 3.0; // cut on eta subjets <3. Anyway taus are cut at 2.3
92  if ( verbosity_ >= 2 ) {
93  std::cout << "<CMSBoostedTauSeedingAlgorithm::findSubjets>:" << std::endl;
94  std::cout << " jet: Pt = " << jet.pt() << ", eta = " << jet.eta() << ", phi = " << jet.phi() << ", mass = " << jet.m() << std::endl;
95  }
96 
97  PseudoJet subjet1, subjet2;
98  bool hasSubjets = jet.has_parents(subjet1, subjet2);
99  if ( hasSubjets && (maxDepth_ == -1 || depth <= maxDepth_) ) {
100  // make subjet1 the more massive jet
101  if ( subjet1.m2() < subjet2.m2() ) {
102  std::swap(subjet1, subjet2);
103  }
104  double dR = subjet1.delta_R(subjet2);
105  double kT = subjet1.kt_distance(subjet2);
106  double mu = ( jet.m() > 0. ) ?
107  sqrt(std::max(subjet1.m2(), subjet2.m2())/jet.m2()) : -1.;
108  // check if subjets pass selection required for seeding boosted tau reconstruction
109  if ( subjet1.pt() > ptMin_ && fabs(subjet1.eta()) < etaMax_ && subjet2.pt() > ptMin_ && fabs(subjet2.eta()) < etaMax_ && dR > dRMin_ && dR < dRMax_ && mu > muMin_ && mu < muMax_ && kT < (yMax_*jet.m2()) && kT > (yMin_*jet.m2()) ) {
110  subjetsFound = true;
111  return std::make_pair(subjet1, subjet2);
112  } else if ( subjet1.pt() > ptMin_ ) {
113  return findSubjets(subjet1, depth + 1, subjetsFound);
114  } else if ( subjet2.pt() > ptMin_ ) {
115  return findSubjets(subjet2, depth + 1, subjetsFound);
116  }
117  }
118  subjetsFound = false;
119  PseudoJet dummy_subjet1, dummy_subjet2;
120  return std::make_pair(dummy_subjet1, dummy_subjet2);
121  }
int maxDepth_
the max depth for descending into clustering sequence
double yMax_
the max value of the asymmetry parameter
void swap(edm::DataFrameContainer &lhs, edm::DataFrameContainer &rhs)
T sqrt(T t)
Definition: SSEVec.h:18
double yMin_
the min value of the asymmetry parameter
double muMax_
the max value of the mass-drop parameter
const int mu
Definition: Constants.h:22
std::pair< PseudoJet, PseudoJet > findSubjets(const PseudoJet &jet, int depth, bool &subjetsFound) const
int verbosity_
flag to enable/disable debug output
double dRMin_
the min value of the dR parameter
double muMin_
the min value of the mass-drop parameter
PseudoJet contrib::CMSBoostedTauSeedingAlgorithm::result ( const PseudoJet &  jet) const
override

Definition at line 123 of file CMSBoostedTauSeedingAlgorithm.cc.

References contrib::CMSBoostedTauSeedingAlgorithmStructure::_dR, contrib::CMSBoostedTauSeedingAlgorithmStructure::_mu, contrib::CMSBoostedTauSeedingAlgorithmStructure::_pt, contrib::CMSBoostedTauSeedingAlgorithmStructure::_y, gather_cfg::cout, dumpSubJetStructure(), findSubjets(), join(), SiStripPI::max, maxDepth_, alignCSCRings::s, mathSSE::sqrt(), and verbosity_.

Referenced by ~CMSBoostedTauSeedingAlgorithm().

124  {
125  if ( verbosity_ >= 1 ) {
126  std::cout << "<CMSBoostedTauSeedingAlgorithm::findSubjets>:" << std::endl;
127  std::cout << " jet: Pt = " << jet.pt() << ", eta = " << jet.eta() << ", phi = " << jet.phi() << ", mass = " << jet.m() << std::endl;
128  }
129 
130  if ( verbosity_ >= 2 ) {
132  }
133 
134  bool subjetsFound = false;
135  std::pair<PseudoJet, PseudoJet> subjets = findSubjets(jet, 0, subjetsFound);
136  if ( subjetsFound ) {
137  // fill structure for returning result
138  PseudoJet subjet1 = subjets.first;
139  PseudoJet subjet2 = subjets.second;
140  if ( verbosity_ >= 1 ) {
141  std::cout << "before recombination:" << std::endl;
142  std::cout << " subjet #1: Pt = " << subjet1.pt() << ", eta = " << subjet1.eta() << ", phi = " << subjet1.phi() << ", mass = " << subjet1.m() << std::endl;
143  std::cout << " subjet #2: Pt = " << subjet2.pt() << ", eta = " << subjet2.eta() << ", phi = " << subjet2.phi() << ", mass = " << subjet2.m() << std::endl;
144  }
145 
146  const JetDefinition::Recombiner* rec = jet.associated_cluster_sequence()->jet_def().recombiner();
147  PseudoJet result_local = join(subjet1, subjet2, *rec);
148  if ( verbosity_ >= 1 ) {
149  std::cout << "after recombination:" << std::endl;
150  std::vector<fastjet::PseudoJet> subjets = result_local.pieces();
151  int idx_subjet = 0;
152  for ( std::vector<fastjet::PseudoJet>::const_iterator subjet = subjets.begin();
153  subjet != subjets.end(); ++subjet ) {
154  std::cout << " subjet #" << idx_subjet << ": Pt = " << subjet->pt() << ", eta = " << subjet->eta() << ", phi = " << subjet->phi() << ", mass = " << subjet->m()
155  << " (#constituents = " << subjet->constituents().size() << ")" << std::endl;
156  std::vector<fastjet::PseudoJet> constituents = subjet->constituents();
157  int idx_constituent = 0;
158  for ( std::vector<fastjet::PseudoJet>::const_iterator constituent = constituents.begin();
159  constituent != constituents.end(); ++constituent ) {
160  if ( constituent->pt() < 1.e-3 ) continue; // CV: skip ghosts
161  std::cout << " constituent #" << idx_constituent << ": Pt = " << constituent->pt() << ", eta = " << constituent->eta() << ", phi = " << constituent->phi() << ","
162  << " mass = " << constituent->m() << std::endl;
163  ++idx_constituent;
164  }
165  ++idx_subjet;
166  }
167  }
168 
169  CMSBoostedTauSeedingAlgorithmStructure* s = new CMSBoostedTauSeedingAlgorithmStructure(result_local);
170  //s->_original_jet = jet;
171  s->_mu = ( jet.m2() > 0. ) ? sqrt(std::max(subjet1.m2(), subjet2.m2())/jet.m2()) : 0.;
172  s->_y = ( jet.m2() > 0. ) ? subjet1.kt_distance(subjet2)/jet.m2() : 0.;
173  s->_dR = subjet1.delta_R(subjet2);
174  s->_pt = subjet2.pt();
175 
176  result_local.set_structure_shared_ptr(SharedPtr<PseudoJetStructureBase>(s));
177 
178  return result_local;
179  } else {
180  // no subjets for seeding boosted tau reconstruction found, return an empty PseudoJet
181  if ( verbosity_ >= 1 ) {
182  std::cout << "No subjets found." << std::endl;
183  }
184  return PseudoJet();
185  }
186  }
void dumpSubJetStructure(const fastjet::PseudoJet &jet, int depth, int maxDepth, const std::string &depth_and_idx_string) const
int maxDepth_
the max depth for descending into clustering sequence
T sqrt(T t)
Definition: SSEVec.h:18
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)
Definition: RemoteFile.cc:18

Member Data Documentation

double contrib::CMSBoostedTauSeedingAlgorithm::dRMax_
private

the max value of the dR parameter

Definition at line 81 of file CMSBoostedTauSeedingAlgorithm.h.

double contrib::CMSBoostedTauSeedingAlgorithm::dRMin_
private

the min value of the dR parameter

Definition at line 80 of file CMSBoostedTauSeedingAlgorithm.h.

Referenced by findSubjets().

int contrib::CMSBoostedTauSeedingAlgorithm::maxDepth_
private

the max depth for descending into clustering sequence

Definition at line 82 of file CMSBoostedTauSeedingAlgorithm.h.

Referenced by findSubjets(), and result().

double contrib::CMSBoostedTauSeedingAlgorithm::muMax_
private

the max value of the mass-drop parameter

Definition at line 77 of file CMSBoostedTauSeedingAlgorithm.h.

Referenced by findSubjets().

double contrib::CMSBoostedTauSeedingAlgorithm::muMin_
private

the min value of the mass-drop parameter

Definition at line 76 of file CMSBoostedTauSeedingAlgorithm.h.

Referenced by findSubjets().

double contrib::CMSBoostedTauSeedingAlgorithm::ptMin_
private

minimum sub-jet pt

Definition at line 75 of file CMSBoostedTauSeedingAlgorithm.h.

Referenced by findSubjets().

int contrib::CMSBoostedTauSeedingAlgorithm::verbosity_
private

flag to enable/disable debug output

Definition at line 84 of file CMSBoostedTauSeedingAlgorithm.h.

Referenced by findSubjets(), and result().

double contrib::CMSBoostedTauSeedingAlgorithm::yMax_
private

the max value of the asymmetry parameter

Definition at line 79 of file CMSBoostedTauSeedingAlgorithm.h.

Referenced by findSubjets().

double contrib::CMSBoostedTauSeedingAlgorithm::yMin_
private

the min value of the asymmetry parameter

Definition at line 78 of file CMSBoostedTauSeedingAlgorithm.h.

Referenced by findSubjets().