CMS 3D CMS Logo

PFClusterProducerFromL1EGClusters.cc
Go to the documentation of this file.
6 
11 
12 namespace l1tpf {
14  public:
17 
18  private:
20  double etCut_;
23 
24  void produce(edm::Event &, const edm::EventSetup &) override;
25 
26  }; // class
27 } // namespace l1tpf
28 
30  : src_(consumes<l1tp2::CaloCrystalClusterCollection>(iConfig.getParameter<edm::InputTag>("src"))),
31  etCut_(iConfig.getParameter<double>("etMin")),
32  corrector_(iConfig.getParameter<std::string>("corrector"), -1),
33  resol_(iConfig.getParameter<edm::ParameterSet>("resol")) {
34  produces<l1t::PFClusterCollection>();
35 }
36 
38  std::unique_ptr<l1t::PFClusterCollection> out(new l1t::PFClusterCollection());
40  iEvent.getByToken(src_, clusters);
41 
42  unsigned int index = 0;
43  for (auto it = clusters->begin(), ed = clusters->end(); it != ed; ++it, ++index) {
44  if (it->pt() <= etCut_)
45  continue;
46 
47  l1t::PFCluster cluster(
48  it->pt(), it->eta(), it->phi(), /*hOverE=*/0., /*isEM=*/true); // it->hovere() seems to return random values
49  if (corrector_.valid())
50  corrector_.correctPt(cluster);
51  cluster.setPtError(resol_(cluster.pt(), std::abs(cluster.eta())));
52 
53  out->push_back(cluster);
54  out->back().addConstituent(edm::Ptr<l1t::L1Candidate>(clusters, index));
55  }
56 
57  iEvent.put(std::move(out));
58 }
ParametricResolution.h
l1tp2::CaloCrystalClusterCollection
std::vector< l1tp2::CaloCrystalCluster > CaloCrystalClusterCollection
Definition: CaloCrystalCluster.h:150
l1tpf::PFClusterProducerFromL1EGClusters::produce
void produce(edm::Event &, const edm::EventSetup &) override
Definition: PFClusterProducerFromL1EGClusters.cc:37
l1tpf::PFClusterProducerFromL1EGClusters::~PFClusterProducerFromL1EGClusters
~PFClusterProducerFromL1EGClusters() override
Definition: PFClusterProducerFromL1EGClusters.cc:16
edm::EDGetTokenT< l1tp2::CaloCrystalClusterCollection >
edm
HLT enums.
Definition: AlignableModifier.h:19
l1tpf::PFClusterProducerFromL1EGClusters::etCut_
double etCut_
Definition: PFClusterProducerFromL1EGClusters.cc:20
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89285
EDProducer.h
edm::Handle
Definition: AssociativeIterator.h:50
l1t::PFCluster::setPtError
void setPtError(float ptError)
Definition: PFCluster.h:57
MakerMacros.h
l1tpf::ParametricResolution
Definition: ParametricResolution.h:10
l1tpf::corrector
Definition: corrector.h:15
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
l1tpf::PFClusterProducerFromL1EGClusters::src_
edm::EDGetTokenT< l1tp2::CaloCrystalClusterCollection > src_
Definition: PFClusterProducerFromL1EGClusters.cc:19
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
bsc_activity_cfg.clusters
clusters
Definition: bsc_activity_cfg.py:36
l1tpf::PFClusterProducerFromL1EGClusters::resol_
l1tpf::ParametricResolution resol_
Definition: PFClusterProducerFromL1EGClusters.cc:22
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
ParameterSet
Definition: Functions.h:16
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::stream::EDProducer
Definition: EDProducer.h:38
edm::EventSetup
Definition: EventSetup.h:58
l1tpf::PFClusterProducerFromL1EGClusters::corrector_
l1tpf::corrector corrector_
Definition: PFClusterProducerFromL1EGClusters.cc:21
CaloCrystalCluster.h
edm::Ptr
Definition: AssociationVector.h:31
PFCluster.h
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
Frameworkfwd.h
l1t::PFCluster
Definition: PFCluster.h:10
l1tpf
Definition: HGC3DClusterEgID.h:20
l1tpf::PFClusterProducerFromL1EGClusters::PFClusterProducerFromL1EGClusters
PFClusterProducerFromL1EGClusters(const edm::ParameterSet &)
Definition: PFClusterProducerFromL1EGClusters.cc:29
AlignmentPI::index
index
Definition: AlignmentPayloadInspectorHelper.h:46
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
ParameterSet.h
edm::Event
Definition: Event.h:73
corrector.h
l1tp2
Definition: CaloCrystalCluster.h:11
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition: PFCluster.h:73
l1tpf::PFClusterProducerFromL1EGClusters
Definition: PFClusterProducerFromL1EGClusters.cc:13