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"
61 useMassDropTagger_(
false),
65 useCMSBoostedTauSeedingAlgorithm_(
false),
75 if ( iConfig.
exists(
"UseOnlyVertexTracks") )
80 if ( iConfig.
exists(
"UseOnlyOnePV") )
85 if ( iConfig.
exists(
"DzTrVtxMax") )
89 if ( iConfig.
exists(
"DxyTrVtxMax") )
93 if ( iConfig.
exists(
"MinVtxNdof") )
97 if ( iConfig.
exists(
"MaxVtxZ") )
103 if ( iConfig.
exists(
"useFiltering") ||
104 iConfig.
exists(
"useTrimming") ||
105 iConfig.
exists(
"usePruning") ||
106 iConfig.
exists(
"useMassDropTagger") ||
107 iConfig.
exists(
"useCMSBoostedTauSeedingAlgorithm") ) {
130 if ( iConfig.
exists(
"useMassDropTagger") ) {
136 if ( iConfig.
exists(
"useFiltering") ) {
142 if ( iConfig.
exists(
"useTrimming") ) {
148 if ( iConfig.
exists(
"usePruning") ) {
155 if ( iConfig.
exists(
"useCMSBoostedTauSeedingAlgorithm") ) {
207 std::vector<edm::Ptr<reco::RecoChargedRefCandidate> > allInputs;
208 std::vector<edm::Ptr<reco::Candidate> > origInputs;
209 for (
size_t i = 0;
i < inputsHandle->size(); ++
i) {
210 allInputs.push_back(inputsHandle->ptrAt(
i));
211 origInputs.push_back(inputsHandle->ptrAt(
i));
218 std::auto_ptr<std::vector<reco::TrackJet> >
jets(
new std::vector<reco::TrackJet>() );
221 for (reco::VertexCollection::const_iterator itVtx = pvCollection->begin(); itVtx != pvCollection->end(); ++itVtx) {
222 if (itVtx->isFake() || itVtx->ndof() <
minVtxNdof_ || fabs(itVtx->z()) >
maxVtxZ_)
continue;
240 if ((*itIn)->track() == trref) {
245 allInputs.erase(itIn);
251 if (!found)
edm::LogInfo(
"FastjetTrackJetProducer") <<
"Ignoring a track at vertex which is not in input track collection!";
258 float dz = (*itIn)->track()->dz(itVtx->position());
259 float dxy = (*itIn)->track()->dxy(itVtx->position());
262 bool closervtx =
false;
264 for (reco::VertexCollection::const_iterator itVtx2 = pvCollection->begin(); itVtx2 != pvCollection->end(); ++itVtx2) {
265 if (itVtx->isFake() || itVtx->ndof() <
minVtxNdof_ || fabs(itVtx->z()) >
maxVtxZ_)
continue;
269 fabs((*itIn)->track()->dz(itVtx2->position())) < fabs(dz)) {
275 if (closervtx)
continue;
279 allInputs.erase(itIn);
288 LogDebug(
"FastjetTrackJetProducer") <<
"Inputted towers\n";
292 LogDebug(
"FastjetTrackJetProducer") <<
"Ran algorithm\n";
295 for (
unsigned int ijet=0;ijet<
fjJets_.size();++ijet) {
297 std::vector<fastjet::PseudoJet> fjConstituents = sorted_by_pt(
fjClusterSeq_->constituents(
fjJets_[ijet]));
299 std::vector<reco::CandidatePtr> constituents =
getConstituents(fjConstituents);
305 vertex_, constituents, iSetup);
310 jets->push_back(jet);
317 LogDebug(
"FastjetTrackJetProducer") <<
"Put " << jets->size() <<
" jets in the event.\n";
358 std::vector<fastjet::PseudoJet> tempJets = fastjet::sorted_by_pt(
fjClusterSeq_->inclusive_jets(
jetPtMin_));
360 fastjet::MassDropTagger md_tagger(
muCut_,
yCut_ );
366 std::vector<fastjet::Transformer const *> transformers;
369 transformers.push_back(&md_tagger);
372 transformers.push_back(&tau_tagger);
375 transformers.push_back(&trimmer);
378 transformers.push_back(&filter);
381 transformers.push_back(&pruner);
384 for ( std::vector<fastjet::PseudoJet>::const_iterator ijet = tempJets.begin(),
385 ijetEnd = tempJets.end(); ijet != ijetEnd; ++ijet ) {
387 fastjet::PseudoJet transformedJet = *ijet;
389 for ( std::vector<fastjet::Transformer const *>::const_iterator itransf = transformers.begin(),
390 itransfEnd = transformers.end(); itransf != itransfEnd; ++itransf ) {
391 if ( transformedJet != 0 ) {
392 transformedJet = (**itransf)(transformedJet);
398 fjJets_.push_back( transformedJet );
double muMin_
for CMSBoostedTauSeedingAlgorithm : subjet pt min
T getParameter(std::string const &) const
double yMin_
for CMSBoostedTauSeedingAlgorithm : max mass-drop
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_
double dRMax_
for CMSBoostedTauSeedingAlgorithm : min dR
double subjetPtMin_
for pruning: constituent dR * pt/2m < rcut_factor
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
double yMax_
for CMSBoostedTauSeedingAlgorithm : min asymmetry
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_
bool useCMSBoostedTauSeedingAlgorithm_
Jet pruning technique.
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 muMax_
for CMSBoostedTauSeedingAlgorithm : min mass-drop
double muCut_
algorithm for seeding reconstruction of boosted Taus (similar to mass-drop tagging) ...
void setPrimaryVertex(const reco::VertexRef &vtx)
set associated primary vertex
double dRMin_
for CMSBoostedTauSeedingAlgorithm : max asymmetry
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
int maxDepth_
for CMSBoostedTauSeedingAlgorithm : max dR
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_
volatile std::atomic< bool > shutdown_flag false
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_