29 #include "fastjet/SISConePlugin.hh"
30 #include "fastjet/CMSIterativeConePlugin.hh"
31 #include "fastjet/ATLASConePlugin.hh"
32 #include "fastjet/CDFMidPointPlugin.hh"
33 #include "fastjet/tools/Filter.hh"
34 #include "fastjet/tools/Pruner.hh"
35 #include "fastjet/tools/MassDropTagger.hh"
56 useMassDropTagger_(
false),
60 useCMSBoostedTauSeedingAlgorithm_(
false),
70 if ( iConfig.
exists(
"UseOnlyVertexTracks") )
75 if ( iConfig.
exists(
"UseOnlyOnePV") )
80 if ( iConfig.
exists(
"DzTrVtxMax") )
84 if ( iConfig.
exists(
"DxyTrVtxMax") )
88 if ( iConfig.
exists(
"MinVtxNdof") )
92 if ( iConfig.
exists(
"MaxVtxZ") )
98 if ( iConfig.
exists(
"useFiltering") ||
99 iConfig.
exists(
"useTrimming") ||
100 iConfig.
exists(
"usePruning") ||
101 iConfig.
exists(
"useMassDropTagger") ||
102 iConfig.
exists(
"useCMSBoostedTauSeedingAlgorithm") ) {
125 if ( iConfig.
exists(
"useMassDropTagger") ) {
131 if ( iConfig.
exists(
"useFiltering") ) {
137 if ( iConfig.
exists(
"useTrimming") ) {
143 if ( iConfig.
exists(
"usePruning") ) {
150 if ( iConfig.
exists(
"useCMSBoostedTauSeedingAlgorithm") ) {
205 std::vector<edm::Ptr<reco::RecoChargedRefCandidate> > allInputs;
206 std::vector<edm::Ptr<reco::Candidate> > origInputs;
207 for (
size_t i = 0;
i < inputsHandle->size(); ++
i) {
208 allInputs.push_back(inputsHandle->ptrAt(
i));
209 origInputs.push_back(inputsHandle->ptrAt(
i));
216 std::auto_ptr<std::vector<reco::TrackJet> >
jets(
new std::vector<reco::TrackJet>() );
219 for (reco::VertexCollection::const_iterator itVtx = pvCollection->begin(); itVtx != pvCollection->end(); ++itVtx) {
220 if (itVtx->isFake() || itVtx->ndof() <
minVtxNdof_ || fabs(itVtx->z()) >
maxVtxZ_)
continue;
238 if ((*itIn)->track() == trref) {
243 allInputs.erase(itIn);
249 if (!found)
edm::LogInfo(
"FastjetTrackJetProducer") <<
"Ignoring a track at vertex which is not in input track collection!";
256 float dz = (*itIn)->track()->dz(itVtx->position());
257 float dxy = (*itIn)->track()->dxy(itVtx->position());
260 bool closervtx =
false;
262 for (reco::VertexCollection::const_iterator itVtx2 = pvCollection->begin(); itVtx2 != pvCollection->end(); ++itVtx2) {
263 if (itVtx->isFake() || itVtx->ndof() <
minVtxNdof_ || fabs(itVtx->z()) >
maxVtxZ_)
continue;
267 fabs((*itIn)->track()->dz(itVtx2->position())) < fabs(dz)) {
273 if (closervtx)
continue;
277 allInputs.erase(itIn);
286 LogDebug(
"FastjetTrackJetProducer") <<
"Inputted towers\n";
290 LogDebug(
"FastjetTrackJetProducer") <<
"Ran algorithm\n";
293 for (
unsigned int ijet=0;ijet<
fjJets_.size();++ijet) {
295 std::vector<fastjet::PseudoJet> fjConstituents = sorted_by_pt(
fjClusterSeq_->constituents(
fjJets_[ijet]));
297 std::vector<reco::CandidatePtr> constituents =
getConstituents(fjConstituents);
303 vertex_, constituents, iSetup);
308 jets->push_back(jet);
315 LogDebug(
"FastjetTrackJetProducer") <<
"Put " << jets->size() <<
" jets in the event.\n";
356 std::vector<fastjet::PseudoJet> tempJets = fastjet::sorted_by_pt(
fjClusterSeq_->inclusive_jets(
jetPtMin_));
358 fastjet::MassDropTagger md_tagger(
muCut_,
yCut_ );
364 std::vector<fastjet::Transformer const *> transformers;
367 transformers.push_back(&md_tagger);
370 transformers.push_back(&tau_tagger);
373 transformers.push_back(&trimmer);
376 transformers.push_back(&filter);
379 transformers.push_back(&pruner);
382 for ( std::vector<fastjet::PseudoJet>::const_iterator ijet = tempJets.begin(),
383 ijetEnd = tempJets.end(); ijet != ijetEnd; ++ijet ) {
385 fastjet::PseudoJet transformedJet = *ijet;
387 for ( std::vector<fastjet::Transformer const *>::const_iterator itransf = transformers.begin(),
388 itransfEnd = transformers.end(); itransf != itransfEnd; ++itransf ) {
389 if ( transformedJet != 0 ) {
390 transformedJet = (**itransf)(transformedJet);
396 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_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
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)
edm::EDGetTokenT< edm::View< reco::RecoChargedRefCandidate > > input_chrefcand_token_
for CMSBoostedTauSeedingAlgorithm : max depth for descending into clustering sequence ...
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
int nFilt_
for filtering, trimming: dR scale of sub-clustering
int maxDepth_
for CMSBoostedTauSeedingAlgorithm : max dR
edm::EDGetTokenT< reco::VertexCollection > input_vertex_token_
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_