#include <RecoJets/JetAlgorithms/interface/CMSIterativeConeAlgorithm.h>
Public Member Functions | |
CMSIterativeConeAlgorithm (double seed, double radius) | |
Constructor. | |
void | run (const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput) const |
Find the ProtoJets from the collection of input Candidates. | |
Private Attributes | |
double | theConeRadius |
double | theSeedThreshold |
Originally implemented in ORCA by H.P.Wellish. Documented in CMS NOTE-2006/036
Definition at line 19 of file CMSIterativeConeAlgorithm.h.
CMSIterativeConeAlgorithm::CMSIterativeConeAlgorithm | ( | double | seed, | |
double | radius | |||
) | [inline] |
Constructor.
seed | defines the minimum ET in GeV of a tower that can seed a jet. | |
radius | defines the maximum radius of a jet in eta-phi space. |
Definition at line 25 of file CMSIterativeConeAlgorithm.h.
00025 : 00026 theSeedThreshold(seed), 00027 theConeRadius(radius) 00028 { }
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 deltaR2(), eta, iggi_31X_cfg::input, iteration, phi, python::multivaluedict::sort(), theConeRadius, and theSeedThreshold.
Referenced by FWLiteJetProducer::makeIterativeConeJets(), and cms::IterativeConePilupSubtractionJetProducer::runAlgorithm().
00020 { 00021 if (!fOutput) return; 00022 //make a list of input objects ordered by ET 00023 list<InputItem> input; 00024 for (InputCollection::const_iterator towerIter = fInput.begin(); 00025 towerIter != fInput.end(); ++towerIter) { 00026 input.push_back(*towerIter); 00027 } 00028 GreaterByEtRef <InputItem> compCandidate; 00029 input.sort(compCandidate); 00030 00031 //find jets 00032 while( !input.empty() && input.front()->et() > theSeedThreshold ) { 00033 //cone centre 00034 double eta0=input.front()->eta(); 00035 double phi0=input.front()->phi(); 00036 //protojet properties 00037 double eta=0; 00038 double phi=0; 00039 double et=0; 00040 //list of towers in cone 00041 list< list<InputItem>::iterator> cone; 00042 for(int iteration=0;iteration<100;iteration++){ 00043 cone.clear(); 00044 eta=0; 00045 phi=0; 00046 et=0; 00047 for(list<InputItem>::iterator inp=input.begin(); 00048 inp!=input.end();inp++){ 00049 InputItem tower = *inp; 00050 if( deltaR2(eta0,phi0,tower->eta(),tower->phi()) < 00051 theConeRadius*theConeRadius) { 00052 cone.push_back(inp); 00053 eta+= tower->et()*tower->eta(); 00054 double dphi=tower->phi()-phi0; 00055 if(dphi>M_PI) dphi-=2*M_PI; 00056 else if(dphi<=-M_PI) dphi+=2*M_PI; 00057 phi+=tower->et()*dphi; 00058 et +=tower->et(); 00059 } 00060 } 00061 eta=eta/et; 00062 phi=phi0+phi/et; 00063 if(phi>M_PI)phi-=2*M_PI; 00064 else if(phi<=-M_PI)phi+=2*M_PI; 00065 00066 if(fabs(eta-eta0)<.001 && fabs(phi-phi0)<.001) break;//stable cone found 00067 eta0=eta; 00068 phi0=phi; 00069 } 00070 00071 //make a final jet and remove the jet constituents from the input list 00072 InputCollection jetConstituents; 00073 list< list<InputItem>::iterator>::const_iterator inp; 00074 for(inp=cone.begin();inp!=cone.end();inp++) { 00075 jetConstituents.push_back(**inp); 00076 input.erase(*inp); 00077 } 00078 fOutput->push_back (ProtoJet (jetConstituents)); 00079 00080 } //loop over seeds ended 00081 GreaterByPt<ProtoJet> compJets; 00082 sort (fOutput->begin (), fOutput->end (), compJets); 00083 }
double CMSIterativeConeAlgorithm::theConeRadius [private] |
double CMSIterativeConeAlgorithm::theSeedThreshold [private] |