CMS 3D CMS Logo

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

#include <L1Trigger/L1TNtuples/src/L1JetRecoTreeProducer.cc>

Inheritance diagram for L1JetRecoTreeProducer:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1JetRecoTreeProducer (const edm::ParameterSet &)
 
 ~L1JetRecoTreeProducer () override
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const *> *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const *> const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Public Attributes

L1Analysis::L1AnalysisRecoJetDataFormatjet_data
 
L1Analysis::L1AnalysisRecoMetDataFormatmet_data
 

Private Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob (void) override
 
bool caloJetID (const reco::CaloJet &jet)
 
void doCaloJetCorr (edm::Handle< reco::CaloJetCollection > caloJets, edm::Handle< reco::JetCorrector > caloJetCorr)
 
void doCaloJets (edm::Handle< reco::CaloJetCollection > caloJets)
 
void doCaloMet (edm::Handle< reco::CaloMETCollection > caloMet)
 
void doCaloMetBE (edm::Handle< reco::CaloMETCollection > caloMetBE)
 
void doCorrPUPPIJets (edm::Handle< std::vector< pat::Jet > > corrPuppiJets)
 
void doPFJetCorr (edm::Handle< reco::PFJetCollection > pfJets, edm::Handle< reco::JetCorrector > pfJetCorr)
 
void doPFJets (edm::Handle< reco::PFJetCollection > pfJets)
 
void doPFMet (edm::Handle< reco::PFMETCollection > pfMet)
 
void doPFMetNoMu (edm::Handle< reco::PFMETCollection > pfMet, edm::Handle< reco::MuonCollection >)
 
void doPUPPIJets (edm::Handle< reco::PFJetCollection > puppiJets)
 
void doPUPPIMetNoMu (edm::Handle< reco::PFMETCollection > puppiMet, edm::Handle< reco::MuonCollection >)
 
void doZPt (edm::Handle< reco::MuonCollection >)
 
void endJob () override
 
bool pfJetID (const reco::PFJet &jet)
 
bool puppiJetID (const pat::Jet &jet)
 

Private Attributes

edm::EDGetTokenT< reco::JetCorrectorcaloJECToken_
 
bool caloJetCorrMissing_
 
bool caloJetIDMissing_
 
edm::EDGetTokenT< edm::ValueMap< reco::JetID > > caloJetIDToken_
 
bool caloJetsMissing_
 
edm::EDGetTokenT< reco::CaloJetCollectioncaloJetToken_
 
bool caloMetBEMissing_
 
edm::EDGetTokenT< reco::CaloMETCollectioncaloMetBEToken_
 
bool caloMetMissing_
 
edm::EDGetTokenT< reco::CaloMETCollectioncaloMetToken_
 
bool corrPuppiJetsMissing_
 
edm::EDGetTokenT< std::vector< pat::Jet > > corrPuppiJetToken_
 
double jetetaMax_
 
double jetptThreshold_
 
unsigned int maxCl_
 
unsigned int maxJet_
 
unsigned int maxTrk_
 
unsigned int maxVtx_
 
bool muonsMissing_
 
edm::EDGetTokenT< reco::MuonCollectionmuonToken_
 
edm::EDGetTokenT< reco::JetCorrectorpfJECToken_
 
bool pfJetCorrMissing_
 
bool pfJetsMissing_
 
edm::EDGetTokenT< reco::PFJetCollectionpfJetToken_
 
bool pfMetMissing_
 
edm::EDGetTokenT< reco::PFMETCollectionpfMetToken_
 
bool puppiJetsMissing_
 
edm::EDGetTokenT< reco::PFJetCollectionpuppiJetToken_
 
bool puppiMetMissing_
 
edm::EDGetTokenT< reco::PFMETCollectionpuppiMetToken_
 
TTree * tree_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Description: Produces tree containing reco quantities

Definition at line 60 of file L1JetRecoTreeProducer.cc.

Constructor & Destructor Documentation

◆ L1JetRecoTreeProducer()

L1JetRecoTreeProducer::L1JetRecoTreeProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 136 of file L1JetRecoTreeProducer.cc.

References caloJECToken_, caloJetIDToken_, caloJetToken_, caloMetBEToken_, caloMetToken_, corrPuppiJetToken_, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), ProducerED_cfi::InputTag, jet_data, jetetaMax_, jetptThreshold_, TFileService::kSharedResource, TFileService::make(), maxJet_, met_data, muonToken_, pfJECToken_, pfJetToken_, pfMetToken_, puppiJetToken_, puppiMetToken_, and tree_.

137  : pfJetsMissing_(false),
138  puppiJetsMissing_(false),
139  corrPuppiJetsMissing_(false),
140  pfJetCorrMissing_(false),
141  caloJetCorrMissing_(false),
142  caloJetsMissing_(false),
143  caloJetIDMissing_(false),
144  pfMetMissing_(false),
145  puppiMetMissing_(false),
146  caloMetMissing_(false),
147  caloMetBEMissing_(false),
148  muonsMissing_(false) {
149  caloJetToken_ =
150  consumes<reco::CaloJetCollection>(iConfig.getUntrackedParameter("caloJetToken", edm::InputTag("ak4CaloJets")));
151  pfJetToken_ =
152  consumes<reco::PFJetCollection>(iConfig.getUntrackedParameter("pfJetToken", edm::InputTag("ak4PFJetsCHS")));
153  puppiJetToken_ = consumes<reco::PFJetCollection>(iConfig.getParameter<edm::InputTag>("puppiJetToken"));
154  corrPuppiJetToken_ = consumes<std::vector<pat::Jet> >(
155  iConfig.getUntrackedParameter("corrPuppiJetToken", edm::InputTag("patJetsCorrectedPuppiJets")));
157  consumes<edm::ValueMap<reco::JetID> >(iConfig.getUntrackedParameter("caloJetIDToken", edm::InputTag("ak4JetID")));
158  pfJECToken_ = consumes<reco::JetCorrector>(
159  iConfig.getUntrackedParameter<edm::InputTag>("pfJECToken", edm::InputTag("ak4PFCHSL1FastL2L3ResidualCorrector")));
160  caloJECToken_ = consumes<reco::JetCorrector>(iConfig.getUntrackedParameter<edm::InputTag>(
161  "caloJECToken", edm::InputTag("ak4CaloL1FastL2L3ResidualCorrector")));
162 
163  pfMetToken_ = consumes<reco::PFMETCollection>(iConfig.getUntrackedParameter("pfMetToken", edm::InputTag("pfMetT1")));
165  consumes<reco::PFMETCollection>(iConfig.getUntrackedParameter("puppiMetToken", edm::InputTag("pfMetPuppi")));
166  caloMetToken_ =
167  consumes<reco::CaloMETCollection>(iConfig.getUntrackedParameter("caloMetToken", edm::InputTag("caloMet")));
169  consumes<reco::CaloMETCollection>(iConfig.getUntrackedParameter("caloMetBEToken", edm::InputTag("caloMetBE")));
170 
171  muonToken_ = consumes<reco::MuonCollection>(iConfig.getUntrackedParameter("muonToken", edm::InputTag("muons")));
172 
173  usesResource(TFileService::kSharedResource);
174 
175  jetptThreshold_ = iConfig.getParameter<double>("jetptThreshold");
176  jetetaMax_ = iConfig.getParameter<double>("jetetaMax");
177  maxJet_ = iConfig.getParameter<unsigned int>("maxJet");
178 
181 
182  // set up output
184  tree_ = fs_->make<TTree>("JetRecoTree", "JetRecoTree");
185  tree_->Branch("Jet", "L1Analysis::L1AnalysisRecoJetDataFormat", &jet_data, 32000, 3);
186  tree_->Branch("Sums", "L1Analysis::L1AnalysisRecoMetDataFormat", &met_data, 32000, 3);
187 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< reco::PFMETCollection > puppiMetToken_
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
edm::EDGetTokenT< reco::CaloMETCollection > caloMetToken_
edm::EDGetTokenT< reco::JetCorrector > pfJECToken_
edm::EDGetTokenT< reco::PFJetCollection > puppiJetToken_
T getUntrackedParameter(std::string const &, T const &) const
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
edm::EDGetTokenT< edm::ValueMap< reco::JetID > > caloJetIDToken_
edm::EDGetTokenT< reco::PFJetCollection > pfJetToken_
edm::EDGetTokenT< std::vector< pat::Jet > > corrPuppiJetToken_
edm::EDGetTokenT< reco::PFMETCollection > pfMetToken_
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< reco::JetCorrector > caloJECToken_
edm::EDGetTokenT< reco::CaloJetCollection > caloJetToken_
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64
edm::EDGetTokenT< reco::CaloMETCollection > caloMetBEToken_

◆ ~L1JetRecoTreeProducer()

L1JetRecoTreeProducer::~L1JetRecoTreeProducer ( )
override

Definition at line 189 of file L1JetRecoTreeProducer.cc.

189  {
190  // do anything here that needs to be done at desctruction time
191  // (e.g. close files, deallocate resources etc.)
192 }

Member Function Documentation

◆ analyze()

void L1JetRecoTreeProducer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 199 of file L1JetRecoTreeProducer.cc.

References caloJECToken_, caloJetCorrMissing_, caloJetIDMissing_, caloJetIDToken_, isolatedTracks_cfi::caloJets, caloJetsMissing_, caloJetToken_, heavyionUCCDQM_cfi::caloMet, CaloMET_cfi::caloMetBE, caloMetBEMissing_, caloMetBEToken_, caloMetMissing_, caloMetToken_, corrPuppiJetsMissing_, corrPuppiJetToken_, doCaloJetCorr(), doCaloJets(), doCaloMet(), doCaloMetBE(), doCorrPUPPIJets(), doPFJetCorr(), doPFJets(), doPFMet(), doPFMetNoMu(), doPUPPIJets(), doPUPPIMetNoMu(), doZPt(), iEvent, edm::HandleBase::isValid(), jet_data, met_data, PDWG_BPHSkim_cff::muons, muonsMissing_, muonToken_, L1Analysis::L1AnalysisRecoJetDataFormat::nCaloJets, L1Analysis::L1AnalysisRecoJetDataFormat::nJets, pfJECToken_, pfJetCorrMissing_, pfJetBenchmark_cfi::pfJets, pfJetsMissing_, pfJetToken_, RecoPFMET_cff::pfMet, pfMetMissing_, pfMetToken_, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_nJets, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_nUncorrJets, puppiJetsMissing_, puppiJetToken_, puppiMetMissing_, puppiMetToken_, L1Analysis::L1AnalysisRecoMetDataFormat::Reset(), L1Analysis::L1AnalysisRecoJetDataFormat::Reset(), and tree_.

199  {
200  jet_data->Reset();
201  met_data->Reset();
202 
203  // get jets
205  iEvent.getByToken(pfJetToken_, pfJets);
206 
207  // get puppi jets
209  iEvent.getByToken(puppiJetToken_, puppiJets);
210 
211  // get corrected puppi jets
212  edm::Handle<std::vector<pat::Jet> > corrPuppiJets;
213  iEvent.getByToken(corrPuppiJetToken_, corrPuppiJets);
214 
215  // get calo jets
217  iEvent.getByToken(caloJetToken_, caloJets);
218 
219  //get sums
221  iEvent.getByToken(pfMetToken_, pfMet);
222 
223  //get sums
225  iEvent.getByToken(puppiMetToken_, puppiMet);
226 
227  // get jet ID
229  iEvent.getByToken(caloJetIDToken_, jetsID);
230 
232  iEvent.getByToken(pfJECToken_, pfJetCorr);
233 
235  iEvent.getByToken(caloJECToken_, caloJetCorr);
236 
238  iEvent.getByToken(caloMetToken_, caloMet);
239 
241  iEvent.getByToken(caloMetBEToken_, caloMetBE);
242 
243  // get muons
245  iEvent.getByToken(muonToken_, muons);
246 
247  if (pfJets.isValid()) {
248  jet_data->nJets = 0;
249 
250  doPFJets(pfJets);
251 
252  } else {
253  if (!pfJetsMissing_) {
254  edm::LogWarning("MissingProduct") << "PFJets not found. Branch will not be filled" << std::endl;
255  }
256  pfJetsMissing_ = true;
257  }
258 
259  if (pfJetCorr.isValid()) {
260  doPFJetCorr(pfJets, pfJetCorr);
261 
262  } else {
263  if (!pfJetCorrMissing_) {
264  edm::LogWarning("MissingProduct") << "PF Jet Corrector not found. Branch will not be filled" << std::endl;
265  }
266  pfJetCorrMissing_ = true;
267  }
268 
269  if (puppiJets.isValid()) {
271 
272  doPUPPIJets(puppiJets);
273 
274  } else {
275  if (!puppiJetsMissing_) {
276  edm::LogWarning("MissingProduct") << "PUPPIJets not found. Branch will not be filled" << std::endl;
277  }
278  puppiJetsMissing_ = true;
279  }
280 
281  if (corrPuppiJets.isValid()) {
282  jet_data->puppi_nJets = 0;
283 
284  doCorrPUPPIJets(corrPuppiJets);
285 
286  } else {
287  if (!corrPuppiJetsMissing_) {
288  edm::LogWarning("MissingProduct") << "Corrected PUPPIJets not found. Branch will not be filled" << std::endl;
289  }
290  corrPuppiJetsMissing_ = true;
291  }
292 
293  if (caloJets.isValid()) {
294  jet_data->nCaloJets = 0;
295 
297 
298  } else {
299  if (!caloJetsMissing_) {
300  edm::LogWarning("MissingProduct") << "Calo Jets not found. Branch will not be filled" << std::endl;
301  }
302  caloJetsMissing_ = true;
303  }
304 
305  if (caloJetCorr.isValid()) {
306  doCaloJetCorr(caloJets, caloJetCorr);
307 
308  } else {
309  if (!caloJetCorrMissing_) {
310  edm::LogWarning("MissingProduct") << "Calo Jet Corrector not found. Branch will not be filled" << std::endl;
311  }
312  caloJetCorrMissing_ = true;
313  }
314 
315  if (!jetsID.isValid()) {
316  if (!caloJetIDMissing_) {
317  edm::LogWarning("MissingProduct") << "Calo Jet ID not found. Branch will not be filled" << std::endl;
318  }
319  caloJetIDMissing_ = true;
320  }
321 
322  if (pfMet.isValid()) {
323  doPFMet(pfMet);
324 
325  if (muons.isValid()) {
327 
328  } else {
329  if (!muonsMissing_) {
330  edm::LogWarning("MissingProduct") << "Muons not found. PFMetNoMu branch will not be filled" << std::endl;
331  }
332  muonsMissing_ = true;
333  }
334  } else {
335  if (!pfMetMissing_) {
336  edm::LogWarning("MissingProduct") << "PFMet not found. Branch will not be filled" << std::endl;
337  }
338  pfMetMissing_ = true;
339  }
340 
341  if (puppiMet.isValid()) {
342  if (muons.isValid()) {
343  doPUPPIMetNoMu(puppiMet, muons);
344 
345  } else {
346  if (!muonsMissing_) {
347  edm::LogWarning("MissingProduct") << "Muons not found. PUPPIMetNoMu branch will not be filled" << std::endl;
348  }
349  muonsMissing_ = true;
350  }
351  } else {
352  if (!puppiMetMissing_) {
353  edm::LogWarning("MissingProduct") << "PUPPIMet not found. Branch will not be filled" << std::endl;
354  }
355  puppiMetMissing_ = true;
356  }
357 
358  if (caloMet.isValid()) {
360 
361  } else {
362  if (!caloMetMissing_) {
363  edm::LogWarning("MissingProduct") << "CaloMet not found. Branch will not be filled" << std::endl;
364  }
365  caloMetMissing_ = true;
366  }
367 
368  if (caloMetBE.isValid()) {
370 
371  } else {
372  if (!caloMetBEMissing_) {
373  edm::LogWarning("MissingProduct") << "CaloMetBE not found. Branch will not be filled" << std::endl;
374  }
375  caloMetBEMissing_ = true;
376  }
377 
378  if (muons.isValid()) {
379  doZPt(muons);
380 
381  } else {
382  if (!muonsMissing_) {
383  edm::LogWarning("MissingProduct") << "Muons not found. ZPt branch will not be filled" << std::endl;
384  }
385  muonsMissing_ = true;
386  }
387 
388  tree_->Fill();
389 }
void doPFMet(edm::Handle< reco::PFMETCollection > pfMet)
edm::EDGetTokenT< reco::PFMETCollection > puppiMetToken_
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
void doPFJetCorr(edm::Handle< reco::PFJetCollection > pfJets, edm::Handle< reco::JetCorrector > pfJetCorr)
edm::EDGetTokenT< reco::CaloMETCollection > caloMetToken_
void doPFJets(edm::Handle< reco::PFJetCollection > pfJets)
caloMetBE
____________________________________________________________________________||
Definition: CaloMET_cfi.py:19
edm::EDGetTokenT< reco::JetCorrector > pfJECToken_
void doCaloMetBE(edm::Handle< reco::CaloMETCollection > caloMetBE)
edm::EDGetTokenT< reco::PFJetCollection > puppiJetToken_
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
int iEvent
Definition: GenABIO.cc:224
edm::EDGetTokenT< edm::ValueMap< reco::JetID > > caloJetIDToken_
edm::EDGetTokenT< reco::PFJetCollection > pfJetToken_
void doCaloJetCorr(edm::Handle< reco::CaloJetCollection > caloJets, edm::Handle< reco::JetCorrector > caloJetCorr)
void doPFMetNoMu(edm::Handle< reco::PFMETCollection > pfMet, edm::Handle< reco::MuonCollection >)
void doCaloMet(edm::Handle< reco::CaloMETCollection > caloMet)
edm::EDGetTokenT< std::vector< pat::Jet > > corrPuppiJetToken_
void doPUPPIMetNoMu(edm::Handle< reco::PFMETCollection > puppiMet, edm::Handle< reco::MuonCollection >)
edm::EDGetTokenT< reco::PFMETCollection > pfMetToken_
void doZPt(edm::Handle< reco::MuonCollection >)
void doCaloJets(edm::Handle< reco::CaloJetCollection > caloJets)
bool isValid() const
Definition: HandleBase.h:70
void doPUPPIJets(edm::Handle< reco::PFJetCollection > puppiJets)
edm::EDGetTokenT< reco::MuonCollection > muonToken_
edm::EDGetTokenT< reco::JetCorrector > caloJECToken_
edm::EDGetTokenT< reco::CaloJetCollection > caloJetToken_
Log< level::Warning, false > LogWarning
edm::EDGetTokenT< reco::CaloMETCollection > caloMetBEToken_
void doCorrPUPPIJets(edm::Handle< std::vector< pat::Jet > > corrPuppiJets)

◆ beginJob()

void L1JetRecoTreeProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 781 of file L1JetRecoTreeProducer.cc.

781 {}

◆ caloJetID()

bool L1JetRecoTreeProducer::caloJetID ( const reco::CaloJet jet)
private

Definition at line 774 of file L1JetRecoTreeProducer.cc.

References createJobs::tmp.

Referenced by doCaloJetCorr(), and doCaloJets().

774  {
775  bool tmp = true;
776 
777  return tmp;
778 }
tmp
align.sh
Definition: createJobs.py:716

◆ doCaloJetCorr()

void L1JetRecoTreeProducer::doCaloJetCorr ( edm::Handle< reco::CaloJetCollection caloJets,
edm::Handle< reco::JetCorrector caloJetCorr 
)
private

Definition at line 550 of file L1JetRecoTreeProducer.cc.

References funct::abs(), L1Analysis::L1AnalysisRecoJetDataFormat::caloCorrFactor, L1Analysis::L1AnalysisRecoJetDataFormat::caloEtCorr, L1Analysis::L1AnalysisRecoMetDataFormat::caloHt, caloJetID(), caloJetIDMissing_, isolatedTracks_cfi::caloJets, reco::JetCorrector::correction(), jet_data, jetetaMax_, jetptThreshold_, maxJet_, met_data, and edm::Handle< T >::product().

Referenced by analyze().

551  {
552  float caloCorrFactor = 1.;
553  unsigned int nCaloJets = 0;
554 
555  met_data->caloHt = 0;
556 
557  for (auto it = caloJets->begin(); it != caloJets->end() && nCaloJets < maxJet_; ++it) {
558  if (!caloJetIDMissing_)
559  if (!caloJetID(*it))
560  continue;
561 
562  caloCorrFactor = caloJetCorr.product()->correction(*it);
563 
564  jet_data->caloEtCorr.push_back(it->et() * caloCorrFactor);
565  jet_data->caloCorrFactor.push_back(caloCorrFactor);
566 
567  nCaloJets++;
568 
569  if (it->pt() * caloCorrFactor > jetptThreshold_ && std::abs(it->eta()) < jetetaMax_) {
570  met_data->caloHt += it->pt() * caloCorrFactor;
571  }
572  }
573 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
T const * product() const
Definition: Handle.h:70
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:46
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
bool caloJetID(const reco::CaloJet &jet)

◆ doCaloJets()

void L1JetRecoTreeProducer::doCaloJets ( edm::Handle< reco::CaloJetCollection caloJets)
private

Definition at line 391 of file L1JetRecoTreeProducer.cc.

References L1Analysis::L1AnalysisRecoJetDataFormat::caloE, L1Analysis::L1AnalysisRecoJetDataFormat::caloEt, L1Analysis::L1AnalysisRecoJetDataFormat::caloEta, caloJetID(), caloJetIDMissing_, isolatedTracks_cfi::caloJets, L1Analysis::L1AnalysisRecoJetDataFormat::caloPhi, L1Analysis::L1AnalysisRecoJetDataFormat::eEmEB, L1Analysis::L1AnalysisRecoJetDataFormat::eEmEE, L1Analysis::L1AnalysisRecoJetDataFormat::eEMF, L1Analysis::L1AnalysisRecoJetDataFormat::eEmHF, L1Analysis::L1AnalysisRecoJetDataFormat::eHadHB, L1Analysis::L1AnalysisRecoJetDataFormat::eHadHE, L1Analysis::L1AnalysisRecoJetDataFormat::eHadHF, L1Analysis::L1AnalysisRecoJetDataFormat::eHadHO, L1Analysis::L1AnalysisRecoJetDataFormat::eMaxEcalTow, L1Analysis::L1AnalysisRecoJetDataFormat::eMaxHcalTow, jet_data, maxJet_, L1Analysis::L1AnalysisRecoJetDataFormat::n60, L1Analysis::L1AnalysisRecoJetDataFormat::nCaloJets, and L1Analysis::L1AnalysisRecoJetDataFormat::towerArea.

Referenced by analyze().

391  {
392  for (auto it = caloJets->begin(); it != caloJets->end() && jet_data->nCaloJets < maxJet_; ++it) {
393  if (!caloJetIDMissing_)
394  if (!caloJetID(*it))
395  continue;
396 
397  jet_data->caloEt.push_back(it->et());
398  jet_data->caloEta.push_back(it->eta());
399  jet_data->caloPhi.push_back(it->phi());
400  jet_data->caloE.push_back(it->energy());
401 
402  jet_data->eEMF.push_back(it->emEnergyFraction());
403  jet_data->eEmEB.push_back(it->emEnergyInEB());
404  jet_data->eEmEE.push_back(it->emEnergyInEE());
405  jet_data->eEmHF.push_back(it->emEnergyInHF());
406  jet_data->eHadHB.push_back(it->hadEnergyInHB());
407  jet_data->eHadHE.push_back(it->hadEnergyInHE());
408  jet_data->eHadHO.push_back(it->hadEnergyInHO());
409  jet_data->eHadHF.push_back(it->hadEnergyInHF());
410  jet_data->eMaxEcalTow.push_back(it->maxEInEmTowers());
411  jet_data->eMaxHcalTow.push_back(it->maxEInHadTowers());
412  jet_data->towerArea.push_back(it->towersArea());
413  jet_data->n60.push_back(it->n60());
414 
415  jet_data->nCaloJets++;
416  }
417 }
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
bool caloJetID(const reco::CaloJet &jet)

◆ doCaloMet()

void L1JetRecoTreeProducer::doCaloMet ( edm::Handle< reco::CaloMETCollection caloMet)
private

Definition at line 648 of file L1JetRecoTreeProducer.cc.

References heavyionUCCDQM_cfi::caloMet, L1Analysis::L1AnalysisRecoMetDataFormat::caloMet, L1Analysis::L1AnalysisRecoMetDataFormat::caloMetPhi, L1Analysis::L1AnalysisRecoMetDataFormat::caloSumEt, reco::LeafCandidate::et(), met_data, reco::LeafCandidate::phi(), and reco::MET::sumEt().

Referenced by analyze().

648  {
649  const reco::CaloMETCollection* metCol = caloMet.product();
650  const reco::CaloMET theMet = metCol->front();
651 
652  met_data->caloMet = theMet.et();
653  met_data->caloMetPhi = theMet.phi();
654  met_data->caloSumEt = theMet.sumEt();
655 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
double sumEt() const
Definition: MET.h:56
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
double et() const final
transverse energy
double phi() const final
momentum azimuthal angle

◆ doCaloMetBE()

void L1JetRecoTreeProducer::doCaloMetBE ( edm::Handle< reco::CaloMETCollection caloMetBE)
private

Definition at line 657 of file L1JetRecoTreeProducer.cc.

References CaloMET_cfi::caloMetBE, L1Analysis::L1AnalysisRecoMetDataFormat::caloMetBE, L1Analysis::L1AnalysisRecoMetDataFormat::caloMetPhiBE, L1Analysis::L1AnalysisRecoMetDataFormat::caloSumEtBE, reco::LeafCandidate::et(), met_data, reco::LeafCandidate::phi(), and reco::MET::sumEt().

Referenced by analyze().

657  {
658  const reco::CaloMETCollection* metCol = caloMetBE.product();
659  const reco::CaloMET theMet = metCol->front();
660 
661  met_data->caloMetBE = theMet.et();
662  met_data->caloMetPhiBE = theMet.phi();
663  met_data->caloSumEtBE = theMet.sumEt();
664 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
caloMetBE
____________________________________________________________________________||
Definition: CaloMET_cfi.py:19
double sumEt() const
Definition: MET.h:56
std::vector< reco::CaloMET > CaloMETCollection
collection of CaloMET objects
double et() const final
transverse energy
double phi() const final
momentum azimuthal angle

◆ doCorrPUPPIJets()

void L1JetRecoTreeProducer::doCorrPUPPIJets ( edm::Handle< std::vector< pat::Jet > >  corrPuppiJets)
private

Definition at line 498 of file L1JetRecoTreeProducer.cc.

References funct::abs(), jet_data, jetetaMax_, jetptThreshold_, maxJet_, met_data, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_cemef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_chef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_chMult, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_cmef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_cMult, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_e, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_eef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_elMult, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_eta, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_etCorr, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_hfemef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_hfemMult, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_hfhef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_hfhMult, L1Analysis::L1AnalysisRecoMetDataFormat::puppi_Ht, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_mef, L1Analysis::L1AnalysisRecoMetDataFormat::puppi_mHt, L1Analysis::L1AnalysisRecoMetDataFormat::puppi_mHtPhi, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_muMult, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_nemef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_nhef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_nhMult, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_nJets, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_nMult, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_pef, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_phi, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_phMult, and puppiJetID().

Referenced by analyze().

498  {
499  float mHx = 0;
500  float mHy = 0;
501 
502  met_data->puppi_Ht = 0;
503  met_data->puppi_mHt = -999.;
504  met_data->puppi_mHtPhi = -999.;
505 
506  for (auto it = corrPuppiJets->begin(); it != corrPuppiJets->end() && jet_data->puppi_nJets < maxJet_; ++it) {
507  if (!puppiJetID(*it))
508  continue;
509 
510  jet_data->puppi_etCorr.push_back(it->et());
511  jet_data->puppi_eta.push_back(it->eta());
512  jet_data->puppi_phi.push_back(it->phi());
513  jet_data->puppi_e.push_back(it->energy());
514 
515  jet_data->puppi_chef.push_back(it->chargedHadronEnergyFraction());
516  jet_data->puppi_nhef.push_back(it->neutralHadronEnergyFraction());
517  jet_data->puppi_pef.push_back(it->photonEnergyFraction());
518  jet_data->puppi_eef.push_back(it->electronEnergyFraction());
519  jet_data->puppi_mef.push_back(it->muonEnergyFraction());
520  jet_data->puppi_hfhef.push_back(it->HFHadronEnergyFraction());
521  jet_data->puppi_hfemef.push_back(it->HFEMEnergyFraction());
522  jet_data->puppi_chMult.push_back(it->chargedHadronMultiplicity());
523  jet_data->puppi_nhMult.push_back(it->neutralHadronMultiplicity());
524  jet_data->puppi_phMult.push_back(it->photonMultiplicity());
525  jet_data->puppi_elMult.push_back(it->electronMultiplicity());
526  jet_data->puppi_muMult.push_back(it->muonMultiplicity());
527  jet_data->puppi_hfhMult.push_back(it->HFHadronMultiplicity());
528  jet_data->puppi_hfemMult.push_back(it->HFEMMultiplicity());
529 
530  jet_data->puppi_cemef.push_back(it->chargedEmEnergyFraction());
531  jet_data->puppi_cmef.push_back(it->chargedMuEnergyFraction());
532  jet_data->puppi_nemef.push_back(it->neutralEmEnergyFraction());
533  jet_data->puppi_cMult.push_back(it->chargedMultiplicity());
534  jet_data->puppi_nMult.push_back(it->neutralMultiplicity());
535 
537 
538  if (it->pt() > jetptThreshold_ && std::abs(it->eta()) < jetetaMax_) {
539  mHx += -1. * it->px();
540  mHy += -1. * it->py();
541  met_data->puppi_Ht += it->pt();
542  }
543  }
544 
545  TVector2 tv2 = TVector2(mHx, mHy);
546  met_data->puppi_mHt = tv2.Mod();
547  met_data->puppi_mHtPhi = tv2.Phi();
548 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
bool puppiJetID(const pat::Jet &jet)
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ doPFJetCorr()

void L1JetRecoTreeProducer::doPFJetCorr ( edm::Handle< reco::PFJetCollection pfJets,
edm::Handle< reco::JetCorrector pfJetCorr 
)
private

Definition at line 454 of file L1JetRecoTreeProducer.cc.

References funct::abs(), reco::JetCorrector::correction(), L1Analysis::L1AnalysisRecoJetDataFormat::corrFactor, L1Analysis::L1AnalysisRecoJetDataFormat::etCorr, L1Analysis::L1AnalysisRecoMetDataFormat::Ht, jet_data, jetetaMax_, jetptThreshold_, maxJet_, met_data, L1Analysis::L1AnalysisRecoMetDataFormat::mHt, L1Analysis::L1AnalysisRecoMetDataFormat::mHtPhi, l1tJetFileWriter_cfi::nJets, pfJetID(), pfJetBenchmark_cfi::pfJets, and edm::Handle< T >::product().

Referenced by analyze().

455  {
456  float corrFactor = 1.;
457  unsigned int nJets = 0;
458 
459  float mHx = 0;
460  float mHy = 0;
461 
462  met_data->Ht = 0;
463  met_data->mHt = -999.;
464  met_data->mHtPhi = -999.;
465 
466  for (auto it = pfJets->begin(); it != pfJets->end() && nJets < maxJet_; ++it) {
467  if (!pfJetID(*it))
468  continue;
469 
470  corrFactor = pfJetCorr.product()->correction(*it);
471 
472  jet_data->etCorr.push_back(it->et() * corrFactor);
473  jet_data->corrFactor.push_back(corrFactor);
474 
475  nJets++;
476 
477  if (it->pt() * corrFactor > jetptThreshold_ && std::abs(it->eta()) < jetetaMax_) {
478  mHx += -1. * it->px() * corrFactor;
479  mHy += -1. * it->py() * corrFactor;
480  met_data->Ht += it->pt() * corrFactor;
481  }
482  }
483 
484  TVector2 tv2 = TVector2(mHx, mHy);
485  met_data->mHt = tv2.Mod();
486  met_data->mHtPhi = tv2.Phi();
487 }
bool pfJetID(const reco::PFJet &jet)
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
T const * product() const
Definition: Handle.h:70
double correction(const LorentzVector &fJet) const
get correction using Jet information only
Definition: JetCorrector.h:46
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ doPFJets()

void L1JetRecoTreeProducer::doPFJets ( edm::Handle< reco::PFJetCollection pfJets)
private

Definition at line 419 of file L1JetRecoTreeProducer.cc.

References L1Analysis::L1AnalysisRecoJetDataFormat::cemef, L1Analysis::L1AnalysisRecoJetDataFormat::chef, L1Analysis::L1AnalysisRecoJetDataFormat::chMult, L1Analysis::L1AnalysisRecoJetDataFormat::cmef, L1Analysis::L1AnalysisRecoJetDataFormat::cMult, L1Analysis::L1AnalysisRecoJetDataFormat::e, L1Analysis::L1AnalysisRecoJetDataFormat::eef, L1Analysis::L1AnalysisRecoJetDataFormat::elMult, L1Analysis::L1AnalysisRecoJetDataFormat::et, L1Analysis::L1AnalysisRecoJetDataFormat::eta, L1Analysis::L1AnalysisRecoJetDataFormat::hfemef, L1Analysis::L1AnalysisRecoJetDataFormat::hfemMult, L1Analysis::L1AnalysisRecoJetDataFormat::hfhef, L1Analysis::L1AnalysisRecoJetDataFormat::hfhMult, jet_data, maxJet_, L1Analysis::L1AnalysisRecoJetDataFormat::mef, L1Analysis::L1AnalysisRecoJetDataFormat::muMult, L1Analysis::L1AnalysisRecoJetDataFormat::nemef, L1Analysis::L1AnalysisRecoJetDataFormat::nhef, L1Analysis::L1AnalysisRecoJetDataFormat::nhMult, L1Analysis::L1AnalysisRecoJetDataFormat::nJets, L1Analysis::L1AnalysisRecoJetDataFormat::nMult, L1Analysis::L1AnalysisRecoJetDataFormat::pef, pfJetID(), pfJetBenchmark_cfi::pfJets, L1Analysis::L1AnalysisRecoJetDataFormat::phi, and L1Analysis::L1AnalysisRecoJetDataFormat::phMult.

Referenced by analyze().

419  {
420  for (auto it = pfJets->begin(); it != pfJets->end() && jet_data->nJets < maxJet_; ++it) {
421  if (!pfJetID(*it))
422  continue;
423 
424  jet_data->et.push_back(it->et());
425  jet_data->eta.push_back(it->eta());
426  jet_data->phi.push_back(it->phi());
427  jet_data->e.push_back(it->energy());
428 
429  jet_data->chef.push_back(it->chargedHadronEnergyFraction());
430  jet_data->nhef.push_back(it->neutralHadronEnergyFraction());
431  jet_data->pef.push_back(it->photonEnergyFraction());
432  jet_data->eef.push_back(it->electronEnergyFraction());
433  jet_data->mef.push_back(it->muonEnergyFraction());
434  jet_data->hfhef.push_back(it->HFHadronEnergyFraction());
435  jet_data->hfemef.push_back(it->HFEMEnergyFraction());
436  jet_data->chMult.push_back(it->chargedHadronMultiplicity());
437  jet_data->nhMult.push_back(it->neutralHadronMultiplicity());
438  jet_data->phMult.push_back(it->photonMultiplicity());
439  jet_data->elMult.push_back(it->electronMultiplicity());
440  jet_data->muMult.push_back(it->muonMultiplicity());
441  jet_data->hfhMult.push_back(it->HFHadronMultiplicity());
442  jet_data->hfemMult.push_back(it->HFEMMultiplicity());
443 
444  jet_data->cemef.push_back(it->chargedEmEnergyFraction());
445  jet_data->cmef.push_back(it->chargedMuEnergyFraction());
446  jet_data->nemef.push_back(it->neutralEmEnergyFraction());
447  jet_data->cMult.push_back(it->chargedMultiplicity());
448  jet_data->nMult.push_back(it->neutralMultiplicity());
449 
450  jet_data->nJets++;
451  }
452 }
bool pfJetID(const reco::PFJet &jet)
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data

◆ doPFMet()

void L1JetRecoTreeProducer::doPFMet ( edm::Handle< reco::PFMETCollection pfMet)
private

Definition at line 575 of file L1JetRecoTreeProducer.cc.

References reco::LeafCandidate::et(), L1Analysis::L1AnalysisRecoMetDataFormat::met, met_data, L1Analysis::L1AnalysisRecoMetDataFormat::metPhi, L1Analysis::L1AnalysisRecoMetDataFormat::metPx, L1Analysis::L1AnalysisRecoMetDataFormat::metPy, RecoPFMET_cff::pfMet, reco::LeafCandidate::phi(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), reco::MET::sumEt(), and L1Analysis::L1AnalysisRecoMetDataFormat::sumEt.

Referenced by analyze().

575  {
576  const reco::PFMETCollection* metCol = pfMet.product();
577  const reco::PFMET theMet = metCol->front();
578 
579  met_data->met = theMet.et();
580  met_data->metPhi = theMet.phi();
581  met_data->sumEt = theMet.sumEt();
582  met_data->metPx = theMet.px();
583  met_data->metPy = theMet.py();
584 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
double sumEt() const
Definition: MET.h:56
double px() const final
x coordinate of momentum vector
double py() const final
y coordinate of momentum vector
double et() const final
transverse energy
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
double phi() const final
momentum azimuthal angle

◆ doPFMetNoMu()

void L1JetRecoTreeProducer::doPFMetNoMu ( edm::Handle< reco::PFMETCollection pfMet,
edm::Handle< reco::MuonCollection muons 
)
private

Definition at line 586 of file L1JetRecoTreeProducer.cc.

References reco::LeafCandidate::et(), met_data, PDWG_BPHSkim_cff::muons, RecoPFMET_cff::pfMet, L1Analysis::L1AnalysisRecoMetDataFormat::pfMetNoMu, L1Analysis::L1AnalysisRecoMetDataFormat::pfMetNoMuPhi, L1Analysis::L1AnalysisRecoMetDataFormat::pfMetNoMuPx, L1Analysis::L1AnalysisRecoMetDataFormat::pfMetNoMuPy, reco::LeafCandidate::phi(), reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::LeafCandidate::setP4().

Referenced by analyze().

587  {
588  const reco::PFMETCollection* metCol = pfMet.product();
589  const reco::PFMET theMet = metCol->front();
590  reco::PFMET thePFMetNoMu = metCol->front();
591 
592  double pfMetNoMuPx = theMet.px();
593  double pfMetNoMuPy = theMet.py();
594 
595  double muPx(0.), muPy(0.);
596 
597  for (auto it = muons->begin(); it != muons->end(); ++it) {
598  if (it->isPFMuon()) {
599  muPx += it->px();
600  muPy += it->py();
601  }
602  }
603 
604  pfMetNoMuPx += muPx;
605  pfMetNoMuPy += muPy;
606 
607  math::XYZTLorentzVector pfMetNoMuP4(pfMetNoMuPx, pfMetNoMuPy, 0, hypot(pfMetNoMuPx, pfMetNoMuPy));
608 
609  thePFMetNoMu.setP4(pfMetNoMuP4);
610 
611  met_data->pfMetNoMu = thePFMetNoMu.et();
612  met_data->pfMetNoMuPhi = thePFMetNoMu.phi();
613  met_data->pfMetNoMuPx = thePFMetNoMu.px();
614  met_data->pfMetNoMuPy = thePFMetNoMu.py();
615 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double px() const final
x coordinate of momentum vector
double py() const final
y coordinate of momentum vector
double et() const final
transverse energy
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
double phi() const final
momentum azimuthal angle
void setP4(const LorentzVector &p4) final
set 4-momentum

◆ doPUPPIJets()

void L1JetRecoTreeProducer::doPUPPIJets ( edm::Handle< reco::PFJetCollection puppiJets)
private

Definition at line 489 of file L1JetRecoTreeProducer.cc.

References jet_data, maxJet_, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_et, L1Analysis::L1AnalysisRecoJetDataFormat::puppi_nUncorrJets, and puppiJetID().

Referenced by analyze().

489  {
490  for (auto it = puppiJets->begin(); it != puppiJets->end() && jet_data->puppi_nUncorrJets < maxJet_; ++it) {
491  if (!puppiJetID(*it))
492  continue;
493  jet_data->puppi_et.push_back(it->et());
495  }
496 }
bool puppiJetID(const pat::Jet &jet)
L1Analysis::L1AnalysisRecoJetDataFormat * jet_data

◆ doPUPPIMetNoMu()

void L1JetRecoTreeProducer::doPUPPIMetNoMu ( edm::Handle< reco::PFMETCollection puppiMet,
edm::Handle< reco::MuonCollection muons 
)
private

Definition at line 617 of file L1JetRecoTreeProducer.cc.

References reco::LeafCandidate::et(), met_data, PDWG_BPHSkim_cff::muons, reco::LeafCandidate::phi(), edm::Handle< T >::product(), L1Analysis::L1AnalysisRecoMetDataFormat::puppi_metNoMu, L1Analysis::L1AnalysisRecoMetDataFormat::puppi_metNoMuPhi, L1Analysis::L1AnalysisRecoMetDataFormat::puppi_metNoMuPx, L1Analysis::L1AnalysisRecoMetDataFormat::puppi_metNoMuPy, reco::LeafCandidate::px(), reco::LeafCandidate::py(), and reco::LeafCandidate::setP4().

Referenced by analyze().

618  {
619  const reco::PFMETCollection* metCol = puppiMet.product();
620  const reco::PFMET theMet = metCol->front();
621  reco::PFMET thePUPPIMetNoMu = metCol->front();
622 
623  double puppiMetNoMuPx = theMet.px();
624  double puppiMetNoMuPy = theMet.py();
625 
626  double muPx(0.), muPy(0.);
627 
628  for (auto it = muons->begin(); it != muons->end(); ++it) {
629  if (it->isPFMuon()) {
630  muPx += it->px();
631  muPy += it->py();
632  }
633  }
634 
635  puppiMetNoMuPx += muPx;
636  puppiMetNoMuPy += muPy;
637 
638  math::XYZTLorentzVector puppiMetNoMuP4(puppiMetNoMuPx, puppiMetNoMuPy, 0, hypot(puppiMetNoMuPx, puppiMetNoMuPy));
639 
640  thePUPPIMetNoMu.setP4(puppiMetNoMuP4);
641 
642  met_data->puppi_metNoMu = thePUPPIMetNoMu.et();
643  met_data->puppi_metNoMuPhi = thePUPPIMetNoMu.phi();
644  met_data->puppi_metNoMuPx = thePUPPIMetNoMu.px();
645  met_data->puppi_metNoMuPy = thePUPPIMetNoMu.py();
646 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
T const * product() const
Definition: Handle.h:70
XYZTLorentzVectorD XYZTLorentzVector
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:29
double px() const final
x coordinate of momentum vector
double py() const final
y coordinate of momentum vector
double et() const final
transverse energy
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
double phi() const final
momentum azimuthal angle
void setP4(const LorentzVector &p4) final
set 4-momentum

◆ doZPt()

void L1JetRecoTreeProducer::doZPt ( edm::Handle< reco::MuonCollection muons)
private

Definition at line 666 of file L1JetRecoTreeProducer.cc.

References funct::abs(), change_name::diff, met_data, PDWG_BPHSkim_cff::muons, GetRecoTauVFromDQM_MC_cff::next, reco::LeafCandidate::p4(), DiDispStaMuonMonitor_cfi::pt, HLTMuonOfflineAnalyzer_cfi::zMass, and L1Analysis::L1AnalysisRecoMetDataFormat::zPt.

Referenced by analyze().

666  {
667  if (muons->size() < 2) {
668  met_data->zPt = -999;
669  return;
670  }
671 
672  reco::Muon muon1;
673  reco::Muon muon2;
674 
675  float zMass = 91.2;
676  float diMuMass = 0;
677  float closestDiff = 999.;
678  bool found2PFMuons = false;
679 
680  for (auto it1 = muons->begin(); it1 != muons->end(); ++it1) {
681  if (!it1->isPFMuon())
682  continue;
683  for (auto it2 = std::next(it1); it2 != muons->end(); ++it2) {
684  if (!it2->isPFMuon())
685  continue;
686  if (it1->charge() != (-1 * it2->charge()))
687  continue;
688 
689  found2PFMuons = true;
690  diMuMass = (it1->p4() + it2->p4()).M();
691  float diff = abs(diMuMass - zMass);
692  if (diff < closestDiff) {
693  closestDiff = diff;
694  muon1 = *it1;
695  muon2 = *it2;
696  }
697  }
698  }
699 
700  diMuMass = (muon1.p4() + muon2.p4()).M();
701  if (abs(diMuMass - zMass) > 30 || !found2PFMuons) {
702  met_data->zPt = -999;
703  return;
704  }
705 
706  float zPt = (muon1.p4() + muon2.p4()).pt();
707  met_data->zPt = zPt;
708 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
const LorentzVector & p4() const final
four-momentum Lorentz vector
Abs< T >::type abs(const T &t)
Definition: Abs.h:22

◆ endJob()

void L1JetRecoTreeProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 784 of file L1JetRecoTreeProducer.cc.

784 {}

◆ pfJetID()

bool L1JetRecoTreeProducer::pfJetID ( const reco::PFJet jet)
private

Definition at line 710 of file L1JetRecoTreeProducer.cc.

References funct::abs(), metsig::jet, and createJobs::tmp.

Referenced by doPFJetCorr(), and doPFJets().

710  {
711  bool tmp = true;
712  if (std::abs(jet.eta()) <= 2.6) {
713  tmp &= jet.neutralHadronEnergyFraction() < 0.9;
714  tmp &= jet.neutralEmEnergyFraction() < 0.9;
715  tmp &= (jet.chargedMultiplicity() + jet.neutralMultiplicity()) > 1;
716  tmp &= jet.muonEnergyFraction() < 0.8;
717  tmp &= jet.chargedHadronEnergyFraction() > 0.01;
718  tmp &= jet.chargedMultiplicity() > 0;
719  tmp &= jet.chargedEmEnergyFraction() < 0.8;
720  }
721  if (std::abs(jet.eta()) > 2.6 && std::abs(jet.eta()) <= 2.7) {
722  tmp &= jet.neutralHadronEnergyFraction() < 0.9;
723  tmp &= jet.neutralEmEnergyFraction() < 0.99;
724  tmp &= jet.muonEnergyFraction() < 0.8;
725  tmp &= jet.chargedMultiplicity() > 0;
726  tmp &= jet.chargedEmEnergyFraction() < 0.8;
727  }
728  if (std::abs(jet.eta()) > 2.7 && std::abs(jet.eta()) < 3.0) {
729  tmp &= jet.neutralEmEnergyFraction() < 0.99;
730  tmp &= jet.neutralMultiplicity() > 1;
731  }
732  if (std::abs(jet.eta()) > 3.0) {
733  tmp &= jet.neutralHadronEnergyFraction() > 0.2;
734  tmp &= jet.neutralEmEnergyFraction() < 0.9;
735  tmp &= jet.neutralMultiplicity() > 10;
736  }
737 
738  // our custom selection
739  //tmp &= jet.muonMultiplicity() == 0;
740  //tmp &= jet.electronMultiplicity() == 0;
741 
742  return tmp;
743 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tmp
align.sh
Definition: createJobs.py:716

◆ puppiJetID()

bool L1JetRecoTreeProducer::puppiJetID ( const pat::Jet jet)
private

Definition at line 746 of file L1JetRecoTreeProducer.cc.

References funct::abs(), metsig::jet, and createJobs::tmp.

Referenced by doCorrPUPPIJets(), and doPUPPIJets().

746  {
747  bool tmp = true;
748  if (std::abs(jet.eta()) <= 2.6) {
749  tmp &= jet.neutralHadronEnergyFraction() < 0.9;
750  tmp &= jet.neutralEmEnergyFraction() < 0.9;
751  tmp &= (jet.chargedMultiplicity() + jet.neutralMultiplicity()) > 1;
752  tmp &= jet.muonEnergyFraction() < 0.8;
753  tmp &= jet.chargedHadronEnergyFraction() > 0.01;
754  tmp &= jet.chargedMultiplicity() > 0;
755  tmp &= jet.chargedEmEnergyFraction() < 0.8;
756  }
757  if (std::abs(jet.eta()) > 2.6 && std::abs(jet.eta()) <= 2.7) {
758  tmp &= jet.neutralHadronEnergyFraction() < 0.9;
759  tmp &= jet.neutralEmEnergyFraction() < 0.99;
760  tmp &= jet.muonEnergyFraction() < 0.8;
761  tmp &= jet.chargedEmEnergyFraction() < 0.8;
762  }
763  if (std::abs(jet.eta()) > 2.7 && std::abs(jet.eta()) <= 3.0) {
764  tmp &= jet.neutralHadronEnergyFraction() < 0.9999;
765  }
766  if (std::abs(jet.eta()) > 3.0) {
767  tmp &= jet.neutralEmEnergyFraction() < 0.9;
768  tmp &= jet.neutralMultiplicity() > 2;
769  }
770 
771  return tmp;
772 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
tmp
align.sh
Definition: createJobs.py:716

Member Data Documentation

◆ caloJECToken_

edm::EDGetTokenT<reco::JetCorrector> L1JetRecoTreeProducer::caloJECToken_
private

Definition at line 104 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ caloJetCorrMissing_

bool L1JetRecoTreeProducer::caloJetCorrMissing_
private

Definition at line 125 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ caloJetIDMissing_

bool L1JetRecoTreeProducer::caloJetIDMissing_
private

Definition at line 127 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), doCaloJetCorr(), and doCaloJets().

◆ caloJetIDToken_

edm::EDGetTokenT<edm::ValueMap<reco::JetID> > L1JetRecoTreeProducer::caloJetIDToken_
private

Definition at line 102 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ caloJetsMissing_

bool L1JetRecoTreeProducer::caloJetsMissing_
private

Definition at line 126 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ caloJetToken_

edm::EDGetTokenT<reco::CaloJetCollection> L1JetRecoTreeProducer::caloJetToken_
private

Definition at line 101 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ caloMetBEMissing_

bool L1JetRecoTreeProducer::caloMetBEMissing_
private

Definition at line 131 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ caloMetBEToken_

edm::EDGetTokenT<reco::CaloMETCollection> L1JetRecoTreeProducer::caloMetBEToken_
private

Definition at line 109 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ caloMetMissing_

bool L1JetRecoTreeProducer::caloMetMissing_
private

Definition at line 130 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ caloMetToken_

edm::EDGetTokenT<reco::CaloMETCollection> L1JetRecoTreeProducer::caloMetToken_
private

Definition at line 108 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ corrPuppiJetsMissing_

bool L1JetRecoTreeProducer::corrPuppiJetsMissing_
private

Definition at line 116 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ corrPuppiJetToken_

edm::EDGetTokenT<std::vector<pat::Jet> > L1JetRecoTreeProducer::corrPuppiJetToken_
private

Definition at line 100 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ jet_data

L1Analysis::L1AnalysisRecoJetDataFormat* L1JetRecoTreeProducer::jet_data

◆ jetetaMax_

double L1JetRecoTreeProducer::jetetaMax_
private

◆ jetptThreshold_

double L1JetRecoTreeProducer::jetptThreshold_
private

◆ maxCl_

unsigned int L1JetRecoTreeProducer::maxCl_
private

Definition at line 119 of file L1JetRecoTreeProducer.cc.

◆ maxJet_

unsigned int L1JetRecoTreeProducer::maxJet_
private

◆ maxTrk_

unsigned int L1JetRecoTreeProducer::maxTrk_
private

Definition at line 122 of file L1JetRecoTreeProducer.cc.

◆ maxVtx_

unsigned int L1JetRecoTreeProducer::maxVtx_
private

Definition at line 121 of file L1JetRecoTreeProducer.cc.

◆ met_data

L1Analysis::L1AnalysisRecoMetDataFormat* L1JetRecoTreeProducer::met_data

◆ muonsMissing_

bool L1JetRecoTreeProducer::muonsMissing_
private

Definition at line 133 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ muonToken_

edm::EDGetTokenT<reco::MuonCollection> L1JetRecoTreeProducer::muonToken_
private

Definition at line 111 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ pfJECToken_

edm::EDGetTokenT<reco::JetCorrector> L1JetRecoTreeProducer::pfJECToken_
private

Definition at line 103 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ pfJetCorrMissing_

bool L1JetRecoTreeProducer::pfJetCorrMissing_
private

Definition at line 124 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ pfJetsMissing_

bool L1JetRecoTreeProducer::pfJetsMissing_
private

Definition at line 114 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ pfJetToken_

edm::EDGetTokenT<reco::PFJetCollection> L1JetRecoTreeProducer::pfJetToken_
private

Definition at line 98 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ pfMetMissing_

bool L1JetRecoTreeProducer::pfMetMissing_
private

Definition at line 128 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ pfMetToken_

edm::EDGetTokenT<reco::PFMETCollection> L1JetRecoTreeProducer::pfMetToken_
private

Definition at line 106 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ puppiJetsMissing_

bool L1JetRecoTreeProducer::puppiJetsMissing_
private

Definition at line 115 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ puppiJetToken_

edm::EDGetTokenT<reco::PFJetCollection> L1JetRecoTreeProducer::puppiJetToken_
private

Definition at line 99 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ puppiMetMissing_

bool L1JetRecoTreeProducer::puppiMetMissing_
private

Definition at line 129 of file L1JetRecoTreeProducer.cc.

Referenced by analyze().

◆ puppiMetToken_

edm::EDGetTokenT<reco::PFMETCollection> L1JetRecoTreeProducer::puppiMetToken_
private

Definition at line 107 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().

◆ tree_

TTree* L1JetRecoTreeProducer::tree_
private

Definition at line 95 of file L1JetRecoTreeProducer.cc.

Referenced by analyze(), and L1JetRecoTreeProducer().