34 #include "fastjet/SISConePlugin.hh"
35 #include "fastjet/CMSIterativeConePlugin.hh"
36 #include "fastjet/ATLASConePlugin.hh"
37 #include "fastjet/CDFMidPointPlugin.hh"
38 #include "fastjet/tools/Filter.hh"
39 #include "fastjet/tools/Pruner.hh"
40 #include "fastjet/tools/MassDropTagger.hh"
60 useMassDropTagger_(
false),
73 if ( iConfig.
exists(
"UseOnlyVertexTracks") )
78 if ( iConfig.
exists(
"UseOnlyOnePV") )
83 if ( iConfig.
exists(
"DzTrVtxMax") )
87 if ( iConfig.
exists(
"DxyTrVtxMax") )
91 if ( iConfig.
exists(
"MinVtxNdof") )
95 if ( iConfig.
exists(
"MaxVtxZ") )
101 if ( iConfig.
exists(
"useFiltering") ||
102 iConfig.
exists(
"useTrimming") ||
103 iConfig.
exists(
"usePruning") ||
104 iConfig.
exists(
"useMassDropTagger") ) {
119 if ( iConfig.
exists(
"useMassDropTagger") ) {
125 if ( iConfig.
exists(
"useFiltering") ) {
131 if ( iConfig.
exists(
"useTrimming") ) {
137 if ( iConfig.
exists(
"usePruning") ) {
184 std::vector<edm::Ptr<reco::RecoChargedRefCandidate> > allInputs;
185 std::vector<edm::Ptr<reco::Candidate> > origInputs;
186 for (
size_t i = 0;
i < inputsHandle->size(); ++
i) {
187 allInputs.push_back(inputsHandle->ptrAt(
i));
188 origInputs.push_back(inputsHandle->ptrAt(
i));
195 std::auto_ptr<std::vector<reco::TrackJet> >
jets(
new std::vector<reco::TrackJet>() );
198 for (reco::VertexCollection::const_iterator itVtx = pvCollection->begin(); itVtx != pvCollection->end(); ++itVtx) {
199 if (itVtx->isFake() || itVtx->ndof() <
minVtxNdof_ || fabs(itVtx->z()) >
maxVtxZ_)
continue;
217 if ((*itIn)->track() == trref) {
222 allInputs.erase(itIn);
228 if (!found)
edm::LogInfo(
"FastjetTrackJetProducer") <<
"Ignoring a track at vertex which is not in input track collection!";
235 float dz = (*itIn)->track()->dz(itVtx->position());
236 float dxy = (*itIn)->track()->dxy(itVtx->position());
239 bool closervtx =
false;
241 for (reco::VertexCollection::const_iterator itVtx2 = pvCollection->begin(); itVtx2 != pvCollection->end(); ++itVtx2) {
242 if (itVtx->isFake() || itVtx->ndof() <
minVtxNdof_ || fabs(itVtx->z()) >
maxVtxZ_)
continue;
246 fabs((*itIn)->track()->dz(itVtx2->position())) < fabs(dz)) {
252 if (closervtx)
continue;
256 allInputs.erase(itIn);
265 LogDebug(
"FastjetTrackJetProducer") <<
"Inputted towers\n";
269 LogDebug(
"FastjetTrackJetProducer") <<
"Ran algorithm\n";
272 for (
unsigned int ijet=0;ijet<
fjJets_.size();++ijet) {
274 std::vector<fastjet::PseudoJet> fjConstituents = sorted_by_pt(
fjClusterSeq_->constituents(
fjJets_[ijet]));
276 std::vector<reco::CandidatePtr> constituents =
getConstituents(fjConstituents);
282 vertex_, constituents, iSetup);
287 jets->push_back(jet);
294 LogDebug(
"FastjetTrackJetProducer") <<
"Put " << jets->size() <<
" jets in the event.\n";
336 std::vector<fastjet::PseudoJet> tempJets = fastjet::sorted_by_pt(
fjClusterSeq_->inclusive_jets(
jetPtMin_));
338 fastjet::MassDropTagger md_tagger(
muCut_,
yCut_ );
343 std::vector<fastjet::Transformer const *> transformers;
346 transformers.push_back(&md_tagger);
349 transformers.push_back(&trimmer);
352 transformers.push_back(&filter);
355 transformers.push_back(&pruner);
360 for ( std::vector<fastjet::PseudoJet>::const_iterator ijet = tempJets.begin(),
361 ijetEnd = tempJets.end(); ijet != ijetEnd; ++ijet ) {
363 fastjet::PseudoJet transformedJet = *ijet;
365 for ( std::vector<fastjet::Transformer const *>::const_iterator itransf = transformers.begin(),
366 itransfEnd = transformers.end(); itransf != itransfEnd; ++itransf ) {
367 if ( transformedJet != 0 ) {
368 transformedJet = (**itransf)(transformedJet);
375 fjJets_.push_back( transformedJet );
T getParameter(std::string const &) const
bool useFiltering_
Mass-drop tagging for boosted Higgs.
double rFilt_
for mass-drop tagging, symmetry cut: min(pt1^2,pt2^2) * dR(1,2) / mjet > ycut
reco::Particle::Point vertex_
virtual std::vector< reco::CandidatePtr > getConstituents(const std::vector< fastjet::PseudoJet > &fjConstituents)
std::vector< fastjet::PseudoJet > fjJets_
virtual void setPileup(float fEnergy)
Set pileup energy contribution as calculated by algorithm.
virtual void inputTowers()
virtual void runAlgorithm(edm::Event &iEvent, const edm::EventSetup &iSetup)
#define DEFINE_FWK_MODULE(type)
bool useOnlyVertexTracks_
bool exists(std::string const ¶meterName) const
checks if a parameter exists
double RcutFactor_
for pruning: constituent minimum pt fraction of parent cluster
FastjetJetProducer(const edm::ParameterSet &iConfig)
bool useTrimming_
Jet filtering technique.
bool makeTrackJet(const JetType::Type &fTag)
virtual void setJetArea(float fArea)
set jet area
std::vector< fastjet::PseudoJet > fjInputs_
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
double trimPtFracMin_
for filtering, pruning: number of subjets expected
bool usePruning_
Jet trimming technique.
std::vector< edm::Ptr< reco::Candidate > > inputs_
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
ClusterSequencePtr fjClusterSeq_
virtual void produceTrackJets(edm::Event &iEvent, const edm::EventSetup &iSetup)
double muCut_
Jet pruning technique.
void setPrimaryVertex(const reco::VertexRef &vtx)
set associated primary vertex
double zCut_
for trimming: constituent minimum pt fraction of full jet
virtual void setVertex(const Point &vertex)
set vertex
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
int nFilt_
for filtering, trimming: dR scale of sub-clustering
virtual void produce(edm::Event &iEvent, const edm::EventSetup &iSetup)
double yCut_
for mass-drop tagging, m0/mjet (m0 = mass of highest mass subjet)
virtual ~FastjetJetProducer()
std::vector< TrackBaseRef >::const_iterator trackRef_iterator
The iteratator for the vector<TrackRef>
AreaDefinitionPtr fjAreaDefinition_
math::XYZTLorentzVector LorentzVector
Lorentz vector.
boost::shared_ptr< fastjet::ClusterSequence > ClusterSequencePtr
void writeSpecific(reco::CaloJet &jet, reco::Particle::LorentzVector const &p4, reco::Particle::Point const &point, std::vector< reco::CandidatePtr > const &constituents, edm::EventSetup const &c)
JetDefPtr fjJetDefinition_