Skip to content

Commit

Permalink
Filename consistency and other minor changes to complete TICL->PF wor…
Browse files Browse the repository at this point in the history
…kflow
  • Loading branch information
steggema committed Sep 19, 2019
1 parent cd2e586 commit ab24ac4
Show file tree
Hide file tree
Showing 6 changed files with 45 additions and 18 deletions.
4 changes: 2 additions & 2 deletions RecoHGCal/TICL/interface/TICLCandidateBuilderPlugins.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef RecoHGCal_TICL_TICLCandidateBuilderPlugins_H__
#define RecoHGCal_TICL_TICLCandidateBuilderPlugins_H__
#ifndef RecoHGCal_TICL_TracksterMomentumPluginBase_H__
#define RecoHGCal_TICL_TracksterMomentumPluginBase_H__

#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
Expand Down
36 changes: 36 additions & 0 deletions RecoHGCal/TICL/interface/TracksterMomentumPluginBase.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
#ifndef RecoHGCal_TICL_TracksterMomentumPluginBase_H__
#define RecoHGCal_TICL_TracksterMomentumPluginBase_H__

#include "DataFormats/Candidate/interface/Candidate.h"
#include "DataFormats/VertexReco/interface/Vertex.h"
#include "DataFormats/CaloRecHit/interface/CaloCluster.h"
#include "DataFormats/HGCalReco/interface/Trackster.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/PluginManager/interface/PluginFactory.h"

namespace ticl {
class TracksterMomentumPluginBase {
public:
// TracksterMomentumPluginBase() {}
TracksterMomentumPluginBase(const edm::ParameterSet&, edm::ConsumesCollector&& iC) {}
typedef reco::Candidate::LorentzVector LorentzVector;
virtual ~TracksterMomentumPluginBase(){};
virtual LorentzVector calcP4(const ticl::Trackster& trackster) const = 0;

edm::Event& evt() { return *evt_; }

// To be
void beginEvent(edm::Event& evt) {
evt_ = &evt;
this->beginEvt();
}
private:
virtual void beginEvt() = 0;
edm::Event* evt_;
};
} // namespace

typedef edmplugin::PluginFactory<ticl::TracksterMomentumPluginBase*(const edm::ParameterSet&, edm::ConsumesCollector&& iC)> TracksterMomentumPluginFactory;

#endif
15 changes: 1 addition & 14 deletions RecoHGCal/TICL/plugins/PFTICLProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,12 @@
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/MakerMacros.h"

#include "FWCore/MessageLogger/interface/MessageLogger.h"

#include "DataFormats/Common/interface/View.h"

#include "DataFormats/ParticleFlowReco/interface/PFCluster.h"

#include "DataFormats/HGCalReco/interface/TICLCandidate.h"

#include "DataFormats/ParticleFlowCandidate/interface/PFCandidateFwd.h"
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h"
#include "SimDataFormats/Track/interface/SimTrackContainer.h"

#include <unordered_map>
#include <memory>

#include "CLHEP/Units/SystemOfUnits.h"
#include "FWCore/Utilities/interface/isFinite.h"

#include "FWCore/Utilities/interface/transform.h"
#include "DataFormats/HGCalReco/interface/TICLCandidate.h"

class PFTICLProducer : public edm::global::EDProducer<> {
public:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

#include "DataFormats/HGCalReco/interface/TICLCandidate.h"
#include "DataFormats/HGCalReco/interface/Trackster.h"
#include "RecoHGCal/TICL/interface/TICLCandidateBuilderPlugins.h"
#include "RecoHGCal/TICL/interface/TracksterMomentumPluginBase.h"

using namespace ticl;

Expand Down
2 changes: 1 addition & 1 deletion RecoHGCal/TICL/plugins/TracksterP4FromEnergySumPlugin.cc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include "DataFormats/Math/interface/LorentzVector.h"
#include "FWCore/Framework/interface/ConsumesCollector.h"
#include "FWCore/ParameterSet/interface/ParameterSetDescription.h"
#include "RecoHGCal/TICL/interface/TICLCandidateBuilderPlugins.h"
#include "RecoHGCal/TICL/interface/TracksterMomentumPluginBase.h"

namespace ticl {
class TracksterP4FromEnergySum final : public TracksterMomentumPluginBase {
Expand Down
4 changes: 4 additions & 0 deletions RecoHGCal/TICL/src/TracksterMomentumPluginBase.cc
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include "RecoHGCal/TICL/interface/TracksterMomentumPluginBase.h"
#include "FWCore/Framework/interface/MakerMacros.h"

EDM_REGISTER_PLUGINFACTORY(TracksterMomentumPluginFactory, "TracksterMomentumPluginFactory");

0 comments on commit ab24ac4

Please sign in to comment.