#include <RecoJets/JetAlgorithms/interface/ExtKtJetAlgorithmWrapper.h>
Public Member Functions | |
ExtKtJetAlgorithmWrapper (const edm::ParameterSet &ps) | |
ExtKtJetAlgorithmWrapper () | |
void | run (const JetReco::InputCollection &fInput, JetReco::OutputCollection *fOutput) const |
~ExtKtJetAlgorithmWrapper () | |
Private Attributes | |
int | theAngle |
int | theColType |
double | theDcut |
int | theMode |
int | theNjets |
double | thePtMin |
int | theRecom |
double | theRparam |
Definition at line 25 of file ExtKtJetAlgorithmWrapper.h.
ExtKtJetAlgorithmWrapper::ExtKtJetAlgorithmWrapper | ( | ) |
ExtKtJetAlgorithmWrapper::ExtKtJetAlgorithmWrapper | ( | const edm::ParameterSet & | ps | ) |
Definition at line 33 of file ExtKtJetAlgorithmWrapper.cc.
References edm::ParameterSet::getParameter(), theAngle, theColType, theDcut, theMode, theNjets, thePtMin, theRecom, and theRparam.
00034 { 00035 00036 //Getting information from the ParameterSet (reading config files): 00037 theRparam=ps.getParameter<double>("ExtKtRParam"); 00038 thePtMin=ps.getParameter<double>("PtMin"); 00039 theDcut=ps.getParameter<double>("dcut"); 00040 theNjets=ps.getParameter<int>("njets"); 00041 theAngle=ps.getParameter<int>("KtAngle"); 00042 theRecom=ps.getParameter<int>("KtRecom"); 00043 00044 00045 theColType=4; //set to pp-collision 00046 00047 //configuring algorithm 00048 theMode=-1; 00049 00050 if ((theDcut==-1)&&(theNjets==-1)) theMode=0; 00051 else if ((theDcut!=-1)&&(theNjets==-1)&&(thePtMin==-1)) theMode=1; 00052 else if ((theDcut==-1)&&(theNjets!=-1)&&(thePtMin==-1)) theMode=2; 00053 else LogWarning("ExtKtJetDefinition")<<"[ExtKtJetWrapper] Wrong Configuration! - will not produce KtJets!"; 00054 }
ExtKtJetAlgorithmWrapper::~ExtKtJetAlgorithmWrapper | ( | ) | [inline] |
void ExtKtJetAlgorithmWrapper::run | ( | const JetReco::InputCollection & | fInput, | |
JetReco::OutputCollection * | fOutput | |||
) | const |
Definition at line 56 of file ExtKtJetAlgorithmWrapper.cc.
References p, p4, theAngle, theColType, theDcut, theJets, theMode, theNjets, thePtMin, theRecom, theRparam, and StDecayID::tID.
Referenced by cms::ExtKtPilupSubtractionJetProducer::runAlgorithm().
00057 { 00058 if (theMode==-1) return; 00059 int index_=0; 00060 vector<KtJet::KtLorentzVector> theInput; 00061 //map<KtJet::KtLorentzVector,const std::vector<FJCand>> theMap; 00062 map<const unsigned int,JetReco::InputItem> theIDMap; 00063 for (JetReco::InputCollection::const_iterator inputCand=fInput.begin(); 00064 inputCand!=fInput.end();inputCand++){ 00065 double px=(*inputCand)->px(); 00066 double py=(*inputCand)->py(); 00067 double pz=(*inputCand)->pz(); 00068 double E=(*inputCand)->energy(); 00069 KtJet::KtLorentzVector p(px,py,pz,E); 00070 //p.set_user_index(index_); 00071 const unsigned int lvID=p.getID(); 00072 theIDMap[lvID]=(*inputCand); 00073 theInput.push_back(p); 00074 index_++; 00075 } 00076 00077 //Construct KtEvent 00078 KtJet::KtEvent *ktev; 00079 if (theMode==0) ktev=new KtJet::KtEvent(theInput,theColType,theAngle,theRecom,theRparam); 00080 else ktev=new KtJet::KtEvent(theInput,theColType,theAngle,theRecom); 00081 00082 if (theMode==1) ktev->findJetsD(theDcut); 00083 else if (theMode==2) ktev->findJetsN(theNjets); 00084 00085 //getJets 00086 vector<KtJet::KtLorentzVector>* theJets=new vector<KtJet::KtLorentzVector>(ktev->getJetsPt()); 00087 00088 00089 00090 // run the jet clustering with the above jet definition 00091 00092 //make CMSSW-Objects: 00093 JetReco::InputCollection jetConst; 00094 for (std::vector<KtJet::KtLorentzVector>::const_iterator itJet=theJets->begin(); 00095 itJet!=theJets->end();itJet++){ 00096 const std::vector<const KtJet::KtLorentzVector*> jet_constituents = (*itJet).getConstituents(); 00097 for (std::vector<const KtJet::KtLorentzVector*>::const_iterator itConst=jet_constituents.begin(); 00098 itConst!=jet_constituents.end();++itConst){ 00099 const unsigned int tID=(*itConst)->getID(); 00100 jetConst.push_back(theIDMap[tID]); 00101 } 00102 double px=(*itJet).px(); 00103 double py=(*itJet).py(); 00104 double pz=(*itJet).pz(); 00105 double E=(*itJet).e(); 00106 math::XYZTLorentzVector p4(px,py,pz,E); 00107 if (p4.Pt()>=thePtMin) fOutput->push_back(ProtoJet(p4,jetConst)); 00108 jetConst.clear(); 00109 } 00110 delete theJets; 00111 delete ktev; 00112 00113 }
int ExtKtJetAlgorithmWrapper::theAngle [private] |
Definition at line 37 of file ExtKtJetAlgorithmWrapper.h.
Referenced by ExtKtJetAlgorithmWrapper(), and run().
int ExtKtJetAlgorithmWrapper::theColType [private] |
Definition at line 41 of file ExtKtJetAlgorithmWrapper.h.
Referenced by ExtKtJetAlgorithmWrapper(), and run().
double ExtKtJetAlgorithmWrapper::theDcut [private] |
Definition at line 35 of file ExtKtJetAlgorithmWrapper.h.
Referenced by ExtKtJetAlgorithmWrapper(), and run().
int ExtKtJetAlgorithmWrapper::theMode [private] |
Definition at line 33 of file ExtKtJetAlgorithmWrapper.h.
Referenced by ExtKtJetAlgorithmWrapper(), and run().
int ExtKtJetAlgorithmWrapper::theNjets [private] |
Definition at line 36 of file ExtKtJetAlgorithmWrapper.h.
Referenced by ExtKtJetAlgorithmWrapper(), and run().
double ExtKtJetAlgorithmWrapper::thePtMin [private] |
Definition at line 34 of file ExtKtJetAlgorithmWrapper.h.
Referenced by ExtKtJetAlgorithmWrapper(), and run().
int ExtKtJetAlgorithmWrapper::theRecom [private] |
Definition at line 38 of file ExtKtJetAlgorithmWrapper.h.
Referenced by ExtKtJetAlgorithmWrapper(), and run().
double ExtKtJetAlgorithmWrapper::theRparam [private] |
Definition at line 39 of file ExtKtJetAlgorithmWrapper.h.
Referenced by ExtKtJetAlgorithmWrapper(), and run().