CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
l1tpf::PFClusterProducerFromHGC3DClusters Class Reference
Inheritance diagram for l1tpf::PFClusterProducerFromHGC3DClusters:
edm::stream::EDProducer<>

Public Member Functions

 PFClusterProducerFromHGC3DClusters (const edm::ParameterSet &)
 
 ~PFClusterProducerFromHGC3DClusters () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

l1tpf::corrector corrector_
 
bool emOnly_
 
l1tpf::HGC3DClusterEgID emVsPionID_
 
l1tpf::HGC3DClusterEgID emVsPUID_
 
double etCut_
 
bool hasEmId_
 
StringCutObjectSelector< l1t::HGCalMulticlusterpreEmId_
 
l1tpf::ParametricResolution resol_
 
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollectionsrc_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 15 of file PFClusterProducerFromHGC3DClusters.cc.

Constructor & Destructor Documentation

◆ PFClusterProducerFromHGC3DClusters()

l1tpf::PFClusterProducerFromHGC3DClusters::PFClusterProducerFromHGC3DClusters ( const edm::ParameterSet iConfig)
explicit

Definition at line 35 of file PFClusterProducerFromHGC3DClusters.cc.

36  : src_(consumes<l1t::HGCalMulticlusterBxCollection>(iConfig.getParameter<edm::InputTag>("src"))),
37  emOnly_(iConfig.getParameter<bool>("emOnly")),
38  etCut_(iConfig.getParameter<double>("etMin")),
39  preEmId_(iConfig.getParameter<std::string>("preEmId")),
40  emVsPionID_(iConfig.getParameter<edm::ParameterSet>("emVsPionID")),
41  emVsPUID_(iConfig.getParameter<edm::ParameterSet>("emVsPUID")),
42  hasEmId_((iConfig.existsAs<std::string>("preEmId") && !iConfig.getParameter<std::string>("preEmId").empty()) ||
43  !emVsPionID_.method().empty()),
44  corrector_(iConfig.getParameter<std::string>("corrector"),
45  emOnly_ || iConfig.getParameter<std::string>("corrector").empty()
46  ? -1
47  : iConfig.getParameter<double>("correctorEmfMax")),
48  resol_(iConfig.getParameter<edm::ParameterSet>("resol")) {
49  if (!emVsPionID_.method().empty()) {
51  }
52  if (!emVsPUID_.method().empty()) {
54  }
55 
56  produces<l1t::PFClusterCollection>();
57  if (hasEmId_) {
58  produces<l1t::PFClusterCollection>("em");
59  produces<l1t::PFClusterCollection>("had");
60  }
61 }

References emVsPionID_, emVsPUID_, hasEmId_, l1tpf::HGC3DClusterEgID::method(), and l1tpf::HGC3DClusterEgID::prepareTMVA().

◆ ~PFClusterProducerFromHGC3DClusters()

l1tpf::PFClusterProducerFromHGC3DClusters::~PFClusterProducerFromHGC3DClusters ( )
inlineoverride

Definition at line 18 of file PFClusterProducerFromHGC3DClusters.cc.

18 {}

Member Function Documentation

◆ produce()

void l1tpf::PFClusterProducerFromHGC3DClusters::produce ( edm::Event iEvent,
const edm::EventSetup  
)
overrideprivate

Definition at line 63 of file PFClusterProducerFromHGC3DClusters.cc.

63  {
64  auto out = std::make_unique<l1t::PFClusterCollection>();
65  std::unique_ptr<l1t::PFClusterCollection> outEm, outHad;
66  if (hasEmId_) {
67  outEm.reset(new l1t::PFClusterCollection());
68  outHad.reset(new l1t::PFClusterCollection());
69  }
71  iEvent.getByToken(src_, multiclusters);
72 
73  for (auto it = multiclusters->begin(0), ed = multiclusters->end(0); it != ed; ++it) {
74  float pt = it->pt(), hoe = it->hOverE();
75  bool isEM = hasEmId_ ? preEmId_(*it) : emOnly_;
76  if (emOnly_) {
77  if (hoe == -1)
78  continue;
79  pt /= (1 + hoe);
80  hoe = 0;
81  }
82  if (pt <= etCut_)
83  continue;
84 
85  l1t::PFCluster cluster(pt, it->eta(), it->phi(), hoe, /*isEM=*/isEM);
86  if (!emVsPUID_.method().empty()) {
87  if (!emVsPUID_.passID(*it, cluster)) {
88  continue;
89  }
90  }
91  if (!emVsPionID_.method().empty()) {
92  cluster.setIsEM(emVsPionID_.passID(*it, cluster));
93  }
94  if (corrector_.valid())
95  corrector_.correctPt(cluster);
96  cluster.setPtError(resol_(cluster.pt(), std::abs(cluster.eta())));
97 
98  out->push_back(cluster);
99  out->back().addConstituent(edm::Ptr<l1t::L1Candidate>(multiclusters, multiclusters->key(it)));
100  if (hasEmId_) {
101  (isEM ? outEm : outHad)->push_back(out->back());
102  }
103  }
104 
105  iEvent.put(std::move(out));
106  if (hasEmId_) {
107  iEvent.put(std::move(outEm), "em");
108  iEvent.put(std::move(outHad), "had");
109  }
110 }

References funct::abs(), BXVector< T >::begin(), BXVector< T >::end(), electrons_cff::hoe, iEvent, BXVector< T >::key(), eostools::move(), MillePedeFileConverter_cfg::out, DiDispStaMuonMonitor_cfi::pt, and l1t::PFCluster::setIsEM().

Member Data Documentation

◆ corrector_

l1tpf::corrector l1tpf::PFClusterProducerFromHGC3DClusters::corrector_
private

Definition at line 27 of file PFClusterProducerFromHGC3DClusters.cc.

◆ emOnly_

bool l1tpf::PFClusterProducerFromHGC3DClusters::emOnly_
private

Definition at line 22 of file PFClusterProducerFromHGC3DClusters.cc.

◆ emVsPionID_

l1tpf::HGC3DClusterEgID l1tpf::PFClusterProducerFromHGC3DClusters::emVsPionID_
private

◆ emVsPUID_

l1tpf::HGC3DClusterEgID l1tpf::PFClusterProducerFromHGC3DClusters::emVsPUID_
private

◆ etCut_

double l1tpf::PFClusterProducerFromHGC3DClusters::etCut_
private

Definition at line 23 of file PFClusterProducerFromHGC3DClusters.cc.

◆ hasEmId_

bool l1tpf::PFClusterProducerFromHGC3DClusters::hasEmId_
private

◆ preEmId_

StringCutObjectSelector<l1t::HGCalMulticluster> l1tpf::PFClusterProducerFromHGC3DClusters::preEmId_
private

Definition at line 24 of file PFClusterProducerFromHGC3DClusters.cc.

◆ resol_

l1tpf::ParametricResolution l1tpf::PFClusterProducerFromHGC3DClusters::resol_
private

Definition at line 28 of file PFClusterProducerFromHGC3DClusters.cc.

◆ src_

edm::EDGetTokenT<l1t::HGCalMulticlusterBxCollection> l1tpf::PFClusterProducerFromHGC3DClusters::src_
private

Definition at line 21 of file PFClusterProducerFromHGC3DClusters.cc.

DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
l1tpf::HGC3DClusterEgID::prepareTMVA
void prepareTMVA()
Definition: HGC3DClusterEgID.cc:17
l1tpf::PFClusterProducerFromHGC3DClusters::etCut_
double etCut_
Definition: PFClusterProducerFromHGC3DClusters.cc:23
l1tpf::HGC3DClusterEgID::passID
float passID(l1t::HGCalMulticluster c, l1t::PFCluster &cpf)
Definition: HGC3DClusterEgID.cc:28
l1t::PFCluster::setIsEM
void setIsEM(bool isEM)
Definition: PFCluster.h:60
l1tpf::corrector::valid
bool valid() const
Definition: corrector.h:35
l1tpf::PFClusterProducerFromHGC3DClusters::preEmId_
StringCutObjectSelector< l1t::HGCalMulticluster > preEmId_
Definition: PFClusterProducerFromHGC3DClusters.cc:24
edm::ParameterSet::existsAs
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:160
edm::Handle
Definition: AssociativeIterator.h:50
l1tpf::HGC3DClusterEgID::method
std::string method()
Definition: HGC3DClusterEgID.h:29
l1tpf::PFClusterProducerFromHGC3DClusters::resol_
l1tpf::ParametricResolution resol_
Definition: PFClusterProducerFromHGC3DClusters.cc:28
BXVector::begin
const_iterator begin(int bx) const
l1tpf::PFClusterProducerFromHGC3DClusters::emOnly_
bool emOnly_
Definition: PFClusterProducerFromHGC3DClusters.cc:22
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
l1tpf::PFClusterProducerFromHGC3DClusters::src_
edm::EDGetTokenT< l1t::HGCalMulticlusterBxCollection > src_
Definition: PFClusterProducerFromHGC3DClusters.cc:21
BXVector::end
const_iterator end(int bx) const
edm::ParameterSet
Definition: ParameterSet.h:36
BXVector::key
unsigned int key(const_iterator &iter) const
Definition: BXVector.h:101
l1tpf::PFClusterProducerFromHGC3DClusters::hasEmId_
bool hasEmId_
Definition: PFClusterProducerFromHGC3DClusters.cc:26
iEvent
int iEvent
Definition: GenABIO.cc:224
edm::Ptr
Definition: AssociationVector.h:31
electrons_cff.hoe
hoe
Definition: electrons_cff.py:404
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
l1t::PFCluster
Definition: PFCluster.h:10
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
l1tpf::corrector::correctPt
void correctPt(l1t::PFCluster &cluster, float preserveEmEt=true) const
Definition: corrector.cc:154
l1tpf::PFClusterProducerFromHGC3DClusters::corrector_
l1tpf::corrector corrector_
Definition: PFClusterProducerFromHGC3DClusters.cc:27
l1t::PFClusterCollection
std::vector< l1t::PFCluster > PFClusterCollection
Definition: PFCluster.h:73
edm::InputTag
Definition: InputTag.h:15
l1tpf::PFClusterProducerFromHGC3DClusters::emVsPionID_
l1tpf::HGC3DClusterEgID emVsPionID_
Definition: PFClusterProducerFromHGC3DClusters.cc:25
l1tpf::PFClusterProducerFromHGC3DClusters::emVsPUID_
l1tpf::HGC3DClusterEgID emVsPUID_
Definition: PFClusterProducerFromHGC3DClusters.cc:25