CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
CMSIterativeConeAlgorithm Class Reference

#include <CMSIterativeConeAlgorithm.h>

Public Member Functions

 CMSIterativeConeAlgorithm (double seed, double radius)
 
void run (const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput) const
 Find the ProtoJets from the collection of input Candidates. More...
 

Private Attributes

double theConeRadius
 
double theSeedThreshold
 

Detailed Description

CMSIterativeConeAlgorithm - iterative cone algorithm without jet merging/splitting. Originally implemented in ORCA by H.P.Wellish. Documented in CMS NOTE-2006/036

Author
A.Ulyanov, ITEP
Id:
CMSIterativeConeAlgorithm.h,v 1.7 2007/04/18 22:04:31 fedor Exp

Definition at line 19 of file CMSIterativeConeAlgorithm.h.

Constructor & Destructor Documentation

CMSIterativeConeAlgorithm::CMSIterativeConeAlgorithm ( double  seed,
double  radius 
)
inline
Constructor
Parameters
seeddefines the minimum ET in GeV of a tower that can seed a jet.
radiusdefines the maximum radius of a jet in eta-phi space.

Definition at line 25 of file CMSIterativeConeAlgorithm.h.

Member Function Documentation

void CMSIterativeConeAlgorithm::run ( const JetReco::InputCollection fInput,
JetReco::OutputCollection fOutput 
) const

Find the ProtoJets from the collection of input Candidates.

Definition at line 20 of file CMSIterativeConeAlgorithm.cc.

References Geom::deltaR2(), reco::Candidate::et(), reco::Candidate::eta(), eta(), collect_tpl::input, align_cfg::iteration, M_PI, phi, reco::Candidate::phi(), and python.multivaluedict::sort().

20  {
21  if (!fOutput) return;
22  //make a list of input objects ordered by ET
23  list<InputItem> input;
24  for (InputCollection::const_iterator towerIter = fInput.begin();
25  towerIter != fInput.end(); ++towerIter) {
26  input.push_back(*towerIter);
27  }
28  GreaterByEtRef <InputItem> compCandidate;
29  input.sort(compCandidate);
30 
31  //find jets
32  while( !input.empty() && input.front()->et() > theSeedThreshold ) {
33  //cone centre
34  double eta0=input.front()->eta();
35  double phi0=input.front()->phi();
36  //protojet properties
37  double eta=0;
38  double phi=0;
39  double et=0;
40  //list of towers in cone
41  list< list<InputItem>::iterator> cone;
42  for(int iteration=0;iteration<100;iteration++){
43  cone.clear();
44  eta=0;
45  phi=0;
46  et=0;
47  for(list<InputItem>::iterator inp=input.begin();
48  inp!=input.end();inp++){
49  InputItem tower = *inp;
50  if( deltaR2(eta0,phi0,tower->eta(),tower->phi()) <
52  cone.push_back(inp);
53  eta+= tower->et()*tower->eta();
54  double dphi=tower->phi()-phi0;
55  if(dphi>M_PI) dphi-=2*M_PI;
56  else if(dphi<=-M_PI) dphi+=2*M_PI;
57  phi+=tower->et()*dphi;
58  et +=tower->et();
59  }
60  }
61  eta=eta/et;
62  phi=phi0+phi/et;
63  if(phi>M_PI)phi-=2*M_PI;
64  else if(phi<=-M_PI)phi+=2*M_PI;
65 
66  if(fabs(eta-eta0)<.001 && fabs(phi-phi0)<.001) break;//stable cone found
67  eta0=eta;
68  phi0=phi;
69  }
70 
71  //make a final jet and remove the jet constituents from the input list
72  InputCollection jetConstituents;
73  list< list<InputItem>::iterator>::const_iterator inp;
74  for(inp=cone.begin();inp!=cone.end();inp++) {
75  jetConstituents.push_back(**inp);
76  input.erase(*inp);
77  }
78  fOutput->push_back (ProtoJet (jetConstituents));
79 
80  } //loop over seeds ended
81  GreaterByPt<ProtoJet> compJets;
82  sort (fOutput->begin (), fOutput->end (), compJets);
83 }
virtual double et() const =0
transverse energy
std::vector< InputItem > InputCollection
Definition: JetRecoTypes.h:62
Transient Jet class used by the reconstruction algorithms.
Definition: ProtoJet.h:25
T eta() const
tuple iteration
Definition: align_cfg.py:5
double deltaR2(const Vector1 &v1, const Vector2 &v2)
Definition: VectorUtil.h:78
tuple input
Definition: collect_tpl.py:10
#define M_PI
Definition: BFit3D.cc:3
virtual double phi() const =0
momentum azimuthal angle
virtual double eta() const =0
momentum pseudorapidity
Definition: DDAxes.h:10

Member Data Documentation

double CMSIterativeConeAlgorithm::theConeRadius
private

Definition at line 36 of file CMSIterativeConeAlgorithm.h.

double CMSIterativeConeAlgorithm::theSeedThreshold
private

Definition at line 35 of file CMSIterativeConeAlgorithm.h.