CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
NanoAODBaseCrossCleaner Class Reference

#include <PhysicsTools/NanoAODBaseCrossCleaner/plugins/NanoAODBaseCrossCleaner.cc>

Inheritance diagram for NanoAODBaseCrossCleaner:
edm::stream::EDProducer<> NanoAODSimpleCrossCleaner

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 

Private Member Functions

void beginStream (edm::StreamID) override
 
void endStream () override
 
virtual void objectSelection (const edm::View< pat::Jet > &jets, const edm::View< pat::Muon > &muons, const edm::View< pat::Electron > &eles, const edm::View< pat::Tau > &taus, const edm::View< pat::Photon > &photons, std::vector< uint8_t > &jetBits, std::vector< uint8_t > &muonBits, std::vector< uint8_t > &eleBits, std::vector< uint8_t > &tauBits, std::vector< uint8_t > &photonBits)
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

const std::string doc_
 
const std::string electronName_
 
const edm::EDGetTokenT< edm::View< pat::Electron > > electrons_
 
const StringCutObjectSelector< pat::ElectronelectronSel_
 
const std::string jetName_
 
const edm::EDGetTokenT< edm::View< pat::Jet > > jets_
 
const StringCutObjectSelector< pat::JetjetSel_
 
const std::string muonName_
 
const edm::EDGetTokenT< edm::View< pat::Muon > > muons_
 
const StringCutObjectSelector< pat::MuonmuonSel_
 
const std::string name_
 
const std::string photonName_
 
const edm::EDGetTokenT< edm::View< pat::Photon > > photons_
 
const StringCutObjectSelector< pat::PhotonphotonSel_
 
const std::string tauName_
 
const edm::EDGetTokenT< edm::View< pat::Tau > > taus_
 
const StringCutObjectSelector< pat::TautauSel_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T... >
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T... >
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Description: [one line class summary]

Implementation: [Notes on implementation]

Definition at line 48 of file NanoAODBaseCrossCleaner.h.

Constructor & Destructor Documentation

◆ NanoAODBaseCrossCleaner()

NanoAODBaseCrossCleaner::NanoAODBaseCrossCleaner ( const edm::ParameterSet params)
explicit

Definition at line 25 of file NanoAODBaseCrossCleaner.cc.

26  : name_(params.getParameter<std::string>("name")),
27  doc_(params.getParameter<std::string>("doc")),
28  jets_(consumes<edm::View<pat::Jet>>(params.getParameter<edm::InputTag>("jets"))),
29  muons_(consumes<edm::View<pat::Muon>>(params.getParameter<edm::InputTag>("muons"))),
30  electrons_(consumes<edm::View<pat::Electron>>(params.getParameter<edm::InputTag>("electrons"))),
31  taus_(consumes<edm::View<pat::Tau>>(params.getParameter<edm::InputTag>("taus"))),
32  photons_(consumes<edm::View<pat::Photon>>(params.getParameter<edm::InputTag>("photons"))),
33  jetSel_(params.getParameter<std::string>("jetSel")),
34  muonSel_(params.getParameter<std::string>("muonSel")),
35  electronSel_(params.getParameter<std::string>("electronSel")),
36  tauSel_(params.getParameter<std::string>("tauSel")),
37  photonSel_(params.getParameter<std::string>("photonSel")),
38  jetName_(params.getParameter<std::string>("jetName")),
39  muonName_(params.getParameter<std::string>("muonName")),
40  electronName_(params.getParameter<std::string>("electronName")),
41  tauName_(params.getParameter<std::string>("tauName")),
42  photonName_(params.getParameter<std::string>("photonName"))
43 
44 {
45  produces<nanoaod::FlatTable>("jets");
46  produces<nanoaod::FlatTable>("muons");
47  produces<nanoaod::FlatTable>("electrons");
48  produces<nanoaod::FlatTable>("taus");
49  produces<nanoaod::FlatTable>("photons");
50 }

◆ ~NanoAODBaseCrossCleaner()

NanoAODBaseCrossCleaner::~NanoAODBaseCrossCleaner ( )
override

Definition at line 52 of file NanoAODBaseCrossCleaner.cc.

52  {
53  // do anything here that needs to be done at destruction time
54  // (e.g. close files, deallocate resources etc.)
55 }

Member Function Documentation

◆ beginStream()

void NanoAODBaseCrossCleaner::beginStream ( edm::StreamID  )
overrideprivate

Definition at line 121 of file NanoAODBaseCrossCleaner.cc.

121 {}

◆ endStream()

void NanoAODBaseCrossCleaner::endStream ( )
overrideprivate

Definition at line 124 of file NanoAODBaseCrossCleaner.cc.

124 {}

◆ fillDescriptions()

void NanoAODBaseCrossCleaner::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 127 of file NanoAODBaseCrossCleaner.cc.

127  {
128  //The following says we do not know what parameters are allowed so do no validation
129  // Please change this to state exactly what you do use, even if it is no parameters
131  desc.setUnknown();
132  descriptions.addDefault(desc);
133 }

References edm::ConfigurationDescriptions::addDefault(), and submitPVResolutionJobs::desc.

◆ objectSelection()

virtual void NanoAODBaseCrossCleaner::objectSelection ( const edm::View< pat::Jet > &  jets,
const edm::View< pat::Muon > &  muons,
const edm::View< pat::Electron > &  eles,
const edm::View< pat::Tau > &  taus,
const edm::View< pat::Photon > &  photons,
std::vector< uint8_t > &  jetBits,
std::vector< uint8_t > &  muonBits,
std::vector< uint8_t > &  eleBits,
std::vector< uint8_t > &  tauBits,
std::vector< uint8_t > &  photonBits 
)
inlineprivatevirtual

Reimplemented in NanoAODSimpleCrossCleaner.

Definition at line 59 of file NanoAODBaseCrossCleaner.h.

68  {};

Referenced by produce().

◆ produce()

void NanoAODBaseCrossCleaner::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 63 of file NanoAODBaseCrossCleaner.cc.

63  {
64  using namespace edm;
66  iEvent.getByToken(jets_, jetsIn);
67  std::vector<uint8_t> jets;
68  for (const auto& j : *jetsIn) {
69  jets.push_back(jetSel_(j));
70  }
71  auto jetsTable = std::make_unique<nanoaod::FlatTable>(jetsIn->size(), jetName_, false, true);
72 
74  iEvent.getByToken(muons_, muonsIn);
75  std::vector<uint8_t> muons;
76  for (const auto& m : *muonsIn) {
77  muons.push_back(muonSel_(m));
78  }
79  auto muonsTable = std::make_unique<nanoaod::FlatTable>(muonsIn->size(), muonName_, false, true);
80 
82  iEvent.getByToken(electrons_, electronsIn);
83  std::vector<uint8_t> eles;
84  for (const auto& e : *electronsIn) {
85  eles.push_back(electronSel_(e));
86  }
87  auto electronsTable = std::make_unique<nanoaod::FlatTable>(electronsIn->size(), electronName_, false, true);
88 
90  iEvent.getByToken(taus_, tausIn);
91  std::vector<uint8_t> taus;
92  for (const auto& t : *tausIn) {
93  taus.push_back(tauSel_(t));
94  }
95  auto tausTable = std::make_unique<nanoaod::FlatTable>(tausIn->size(), tauName_, false, true);
96 
98  iEvent.getByToken(photons_, photonsIn);
99  std::vector<uint8_t> photons;
100  for (const auto& p : *photonsIn) {
101  photons.push_back(photonSel_(p));
102  }
103  auto photonsTable = std::make_unique<nanoaod::FlatTable>(photonsIn->size(), photonName_, false, true);
104 
105  objectSelection(*jetsIn, *muonsIn, *electronsIn, *tausIn, *photonsIn, jets, muons, eles, taus, photons);
106 
107  muonsTable->addColumn<uint8_t>(name_, muons, doc_);
108  jetsTable->addColumn<uint8_t>(name_, jets, doc_);
109  electronsTable->addColumn<uint8_t>(name_, eles, doc_);
110  tausTable->addColumn<uint8_t>(name_, taus, doc_);
111  photonsTable->addColumn<uint8_t>(name_, photons, doc_);
112 
113  iEvent.put(std::move(jetsTable), "jets");
114  iEvent.put(std::move(muonsTable), "muons");
115  iEvent.put(std::move(electronsTable), "electrons");
116  iEvent.put(std::move(tausTable), "taus");
117  iEvent.put(std::move(photonsTable), "photons");
118 }

References doc_, MillePedeFileConverter_cfg::e, electronName_, electrons_, electronSel_, iEvent, dqmiolumiharvest::j, jetName_, singleTopDQM_cfi::jets, jets_, jetSel_, visualization-live-secondInstance_cfg::m, eostools::move(), muonName_, PDWG_BPHSkim_cff::muons, muons_, muonSel_, name_, objectSelection(), AlCaHLTBitMon_ParallelJobs::p, photonName_, BPHMonitor_cfi::photons, photons_, photonSel_, submitPVValidationJobs::t, tauName_, Tau3MuMonitor_cff::taus, taus_, and tauSel_.

Member Data Documentation

◆ doc_

const std::string NanoAODBaseCrossCleaner::doc_
private

Definition at line 77 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ electronName_

const std::string NanoAODBaseCrossCleaner::electronName_
private

Definition at line 91 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ electrons_

const edm::EDGetTokenT<edm::View<pat::Electron> > NanoAODBaseCrossCleaner::electrons_
private

Definition at line 81 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ electronSel_

const StringCutObjectSelector<pat::Electron> NanoAODBaseCrossCleaner::electronSel_
private

Definition at line 86 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ jetName_

const std::string NanoAODBaseCrossCleaner::jetName_
private

Definition at line 89 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ jets_

const edm::EDGetTokenT<edm::View<pat::Jet> > NanoAODBaseCrossCleaner::jets_
private

Definition at line 79 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ jetSel_

const StringCutObjectSelector<pat::Jet> NanoAODBaseCrossCleaner::jetSel_
private

Definition at line 84 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ muonName_

const std::string NanoAODBaseCrossCleaner::muonName_
private

Definition at line 90 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ muons_

const edm::EDGetTokenT<edm::View<pat::Muon> > NanoAODBaseCrossCleaner::muons_
private

Definition at line 80 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ muonSel_

const StringCutObjectSelector<pat::Muon> NanoAODBaseCrossCleaner::muonSel_
private

Definition at line 85 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ name_

const std::string NanoAODBaseCrossCleaner::name_
private

Definition at line 68 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ photonName_

const std::string NanoAODBaseCrossCleaner::photonName_
private

Definition at line 93 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ photons_

const edm::EDGetTokenT<edm::View<pat::Photon> > NanoAODBaseCrossCleaner::photons_
private

Definition at line 83 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ photonSel_

const StringCutObjectSelector<pat::Photon> NanoAODBaseCrossCleaner::photonSel_
private

Definition at line 88 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ tauName_

const std::string NanoAODBaseCrossCleaner::tauName_
private

Definition at line 92 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ taus_

const edm::EDGetTokenT<edm::View<pat::Tau> > NanoAODBaseCrossCleaner::taus_
private

Definition at line 82 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

◆ tauSel_

const StringCutObjectSelector<pat::Tau> NanoAODBaseCrossCleaner::tauSel_
private

Definition at line 87 of file NanoAODBaseCrossCleaner.h.

Referenced by produce().

PDWG_BPHSkim_cff.muons
muons
Definition: PDWG_BPHSkim_cff.py:47
NanoAODBaseCrossCleaner::electronSel_
const StringCutObjectSelector< pat::Electron > electronSel_
Definition: NanoAODBaseCrossCleaner.h:86
NanoAODBaseCrossCleaner::objectSelection
virtual void objectSelection(const edm::View< pat::Jet > &jets, const edm::View< pat::Muon > &muons, const edm::View< pat::Electron > &eles, const edm::View< pat::Tau > &taus, const edm::View< pat::Photon > &photons, std::vector< uint8_t > &jetBits, std::vector< uint8_t > &muonBits, std::vector< uint8_t > &eleBits, std::vector< uint8_t > &tauBits, std::vector< uint8_t > &photonBits)
Definition: NanoAODBaseCrossCleaner.h:59
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
Tau3MuMonitor_cff.taus
taus
Definition: Tau3MuMonitor_cff.py:7
edm
HLT enums.
Definition: AlignableModifier.h:19
NanoAODBaseCrossCleaner::jetSel_
const StringCutObjectSelector< pat::Jet > jetSel_
Definition: NanoAODBaseCrossCleaner.h:84
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
NanoAODBaseCrossCleaner::name_
const std::string name_
Definition: NanoAODBaseCrossCleaner.h:68
singleTopDQM_cfi.jets
jets
Definition: singleTopDQM_cfi.py:42
NanoAODBaseCrossCleaner::photonSel_
const StringCutObjectSelector< pat::Photon > photonSel_
Definition: NanoAODBaseCrossCleaner.h:88
NanoAODBaseCrossCleaner::tauName_
const std::string tauName_
Definition: NanoAODBaseCrossCleaner.h:92
edm::Handle
Definition: AssociativeIterator.h:50
NanoAODBaseCrossCleaner::jetName_
const std::string jetName_
Definition: NanoAODBaseCrossCleaner.h:89
visualization-live-secondInstance_cfg.m
m
Definition: visualization-live-secondInstance_cfg.py:78
NanoAODBaseCrossCleaner::tauSel_
const StringCutObjectSelector< pat::Tau > tauSel_
Definition: NanoAODBaseCrossCleaner.h:87
NanoAODBaseCrossCleaner::jets_
const edm::EDGetTokenT< edm::View< pat::Jet > > jets_
Definition: NanoAODBaseCrossCleaner.h:79
NanoAODBaseCrossCleaner::muonSel_
const StringCutObjectSelector< pat::Muon > muonSel_
Definition: NanoAODBaseCrossCleaner.h:85
edm::View
Definition: CaloClusterFwd.h:14
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
iEvent
int iEvent
Definition: GenABIO.cc:224
NanoAODBaseCrossCleaner::taus_
const edm::EDGetTokenT< edm::View< pat::Tau > > taus_
Definition: NanoAODBaseCrossCleaner.h:82
NanoAODBaseCrossCleaner::muons_
const edm::EDGetTokenT< edm::View< pat::Muon > > muons_
Definition: NanoAODBaseCrossCleaner.h:80
NanoAODBaseCrossCleaner::photonName_
const std::string photonName_
Definition: NanoAODBaseCrossCleaner.h:93
BPHMonitor_cfi.photons
photons
Definition: BPHMonitor_cfi.py:91
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
NanoAODBaseCrossCleaner::doc_
const std::string doc_
Definition: NanoAODBaseCrossCleaner.h:77
NanoAODBaseCrossCleaner::photons_
const edm::EDGetTokenT< edm::View< pat::Photon > > photons_
Definition: NanoAODBaseCrossCleaner.h:83
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::ConfigurationDescriptions::addDefault
void addDefault(ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:99
edm::InputTag
Definition: InputTag.h:15
NanoAODBaseCrossCleaner::muonName_
const std::string muonName_
Definition: NanoAODBaseCrossCleaner.h:90
NanoAODBaseCrossCleaner::electronName_
const std::string electronName_
Definition: NanoAODBaseCrossCleaner.h:91
NanoAODBaseCrossCleaner::electrons_
const edm::EDGetTokenT< edm::View< pat::Electron > > electrons_
Definition: NanoAODBaseCrossCleaner.h:81
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37