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 noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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 > muons, edm::Handle< std::vector< pat::Jet > > corrPuppiJets)
 
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 135 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_.

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

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 198 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, DiMuonV_cfg::muons, muonsMissing_, muonToken_, L1Analysis::L1AnalysisRecoJetDataFormat::nCaloJets, L1Analysis::L1AnalysisRecoJetDataFormat::nJets, pfJECToken_, pfJetCorrMissing_, pfJets_cff::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_.

198  {
199  jet_data->Reset();
200  met_data->Reset();
201 
202  // get jets
204  iEvent.getByToken(pfJetToken_, pfJets);
205 
206  // get puppi jets
208  iEvent.getByToken(puppiJetToken_, puppiJets);
209 
210  // get corrected puppi jets
211  edm::Handle<std::vector<pat::Jet> > corrPuppiJets;
212  iEvent.getByToken(corrPuppiJetToken_, corrPuppiJets);
213 
214  // get calo jets
216  iEvent.getByToken(caloJetToken_, caloJets);
217 
218  //get sums
220  iEvent.getByToken(pfMetToken_, pfMet);
221 
222  //get sums
224  iEvent.getByToken(puppiMetToken_, puppiMet);
225 
226  // get jet ID
228  iEvent.getByToken(caloJetIDToken_, jetsID);
229 
231  iEvent.getByToken(pfJECToken_, pfJetCorr);
232 
234  iEvent.getByToken(caloJECToken_, caloJetCorr);
235 
237  iEvent.getByToken(caloMetToken_, caloMet);
238 
240  iEvent.getByToken(caloMetBEToken_, caloMetBE);
241 
242  // get muons
244  iEvent.getByToken(muonToken_, muons);
245 
246  if (pfJets.isValid()) {
247  jet_data->nJets = 0;
248 
249  doPFJets(pfJets);
250 
251  } else {
252  if (!pfJetsMissing_) {
253  edm::LogWarning("MissingProduct") << "PFJets not found. Branch will not be filled" << std::endl;
254  }
255  pfJetsMissing_ = true;
256  }
257 
258  if (pfJetCorr.isValid()) {
259  doPFJetCorr(pfJets, pfJetCorr);
260 
261  } else {
262  if (!pfJetCorrMissing_) {
263  edm::LogWarning("MissingProduct") << "PF Jet Corrector not found. Branch will not be filled" << std::endl;
264  }
265  pfJetCorrMissing_ = true;
266  }
267 
268  if (puppiJets.isValid()) {
270 
271  doPUPPIJets(puppiJets);
272 
273  } else {
274  if (!puppiJetsMissing_) {
275  edm::LogWarning("MissingProduct") << "PUPPIJets not found. Branch will not be filled" << std::endl;
276  }
277  puppiJetsMissing_ = true;
278  }
279 
280  if (corrPuppiJets.isValid()) {
281  jet_data->puppi_nJets = 0;
282 
283  doCorrPUPPIJets(corrPuppiJets);
284 
285  } else {
286  if (!corrPuppiJetsMissing_) {
287  edm::LogWarning("MissingProduct") << "Corrected PUPPIJets not found. Branch will not be filled" << std::endl;
288  }
289  corrPuppiJetsMissing_ = true;
290  }
291 
292  if (caloJets.isValid()) {
293  jet_data->nCaloJets = 0;
294 
296 
297  } else {
298  if (!caloJetsMissing_) {
299  edm::LogWarning("MissingProduct") << "Calo Jets not found. Branch will not be filled" << std::endl;
300  }
301  caloJetsMissing_ = true;
302  }
303 
304  if (caloJetCorr.isValid()) {
305  doCaloJetCorr(caloJets, caloJetCorr);
306 
307  } else {
308  if (!caloJetCorrMissing_) {
309  edm::LogWarning("MissingProduct") << "Calo Jet Corrector not found. Branch will not be filled" << std::endl;
310  }
311  caloJetCorrMissing_ = true;
312  }
313 
314  if (!jetsID.isValid()) {
315  if (!caloJetIDMissing_) {
316  edm::LogWarning("MissingProduct") << "Calo Jet ID not found. Branch will not be filled" << std::endl;
317  }
318  caloJetIDMissing_ = true;
319  }
320 
321  if (pfMet.isValid()) {
322  doPFMet(pfMet);
323 
324  if (muons.isValid()) {
326 
327  } else {
328  if (!muonsMissing_) {
329  edm::LogWarning("MissingProduct") << "Muons not found. PFMetNoMu branch will not be filled" << std::endl;
330  }
331  muonsMissing_ = true;
332  }
333  } else {
334  if (!pfMetMissing_) {
335  edm::LogWarning("MissingProduct") << "PFMet not found. Branch will not be filled" << std::endl;
336  }
337  pfMetMissing_ = true;
338  }
339 
340  if (puppiMet.isValid()) {
341  if (muons.isValid()) {
342  doPUPPIMetNoMu(puppiMet, muons);
343 
344  } else {
345  if (!muonsMissing_) {
346  edm::LogWarning("MissingProduct") << "Muons not found. PUPPIMetNoMu branch will not be filled" << std::endl;
347  }
348  muonsMissing_ = true;
349  }
350  } else {
351  if (!puppiMetMissing_) {
352  edm::LogWarning("MissingProduct") << "PUPPIMet not found. Branch will not be filled" << std::endl;
353  }
354  puppiMetMissing_ = true;
355  }
356 
357  if (caloMet.isValid()) {
359 
360  } else {
361  if (!caloMetMissing_) {
362  edm::LogWarning("MissingProduct") << "CaloMet not found. Branch will not be filled" << std::endl;
363  }
364  caloMetMissing_ = true;
365  }
366 
367  if (caloMetBE.isValid()) {
369 
370  } else {
371  if (!caloMetBEMissing_) {
372  edm::LogWarning("MissingProduct") << "CaloMetBE not found. Branch will not be filled" << std::endl;
373  }
374  caloMetBEMissing_ = true;
375  }
376 
377  if (muons.isValid()) {
378  if (puppiJets.isValid()) {
379  doZPt(muons, corrPuppiJets);
380 
381  } else {
382  if (!puppiJetsMissing_) {
383  edm::LogWarning("MissingProduct") << "PUPPIJets not found. Branch will not be filled" << std::endl;
384  }
385  puppiJetsMissing_ = true;
386  }
387  } else {
388  if (!muonsMissing_) {
389  edm::LogWarning("MissingProduct") << "Muons not found. ZPt branch will not be filled" << std::endl;
390  }
391  muonsMissing_ = true;
392  }
393 
394  tree_->Fill();
395 }
void doZPt(edm::Handle< reco::MuonCollection > muons, edm::Handle< std::vector< pat::Jet > > corrPuppiJets)
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)
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
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 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 799 of file L1JetRecoTreeProducer.cc.

799 {}

◆ caloJetID()

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

Definition at line 792 of file L1JetRecoTreeProducer.cc.

References createJobs::tmp.

Referenced by doCaloJetCorr(), and doCaloJets().

792  {
793  bool tmp = true;
794 
795  return tmp;
796 }
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 556 of file L1JetRecoTreeProducer.cc.

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

Referenced by analyze().

557  {
558  float caloCorrFactor = 1.;
559  unsigned int nCaloJets = 0;
560 
561  met_data->caloHt = 0;
562 
563  for (auto it = caloJets->begin(); it != caloJets->end() && nCaloJets < maxJet_; ++it) {
564  if (!caloJetIDMissing_)
565  if (!caloJetID(*it))
566  continue;
567 
568  caloCorrFactor = caloJetCorr.product()->correction(*it);
569 
570  jet_data->caloEtCorr.push_back(it->et() * caloCorrFactor);
571  jet_data->caloCorrFactor.push_back(caloCorrFactor);
572 
573  nCaloJets++;
574 
575  if (it->pt() * caloCorrFactor > jetptThreshold_ && std::abs(it->eta()) < jetetaMax_) {
576  met_data->caloHt += it->pt() * caloCorrFactor;
577  }
578  }
579 }
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 397 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, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, jet_data, maxJet_, L1Analysis::L1AnalysisRecoJetDataFormat::n60, L1Analysis::L1AnalysisRecoJetDataFormat::nCaloJets, and L1Analysis::L1AnalysisRecoJetDataFormat::towerArea.

Referenced by analyze().

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

◆ doCaloMet()

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

Definition at line 654 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().

654  {
655  const reco::CaloMETCollection* metCol = caloMet.product();
656  const reco::CaloMET theMet = metCol->front();
657 
658  met_data->caloMet = theMet.et();
659  met_data->caloMetPhi = theMet.phi();
660  met_data->caloSumEt = theMet.sumEt();
661 }
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 663 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().

663  {
664  const reco::CaloMETCollection* metCol = caloMetBE.product();
665  const reco::CaloMET theMet = metCol->front();
666 
667  met_data->caloMetBE = theMet.et();
668  met_data->caloMetPhiBE = theMet.phi();
669  met_data->caloSumEtBE = theMet.sumEt();
670 }
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 504 of file L1JetRecoTreeProducer.cc.

References funct::abs(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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().

504  {
505  float mHx = 0;
506  float mHy = 0;
507 
508  met_data->puppi_Ht = 0;
509  met_data->puppi_mHt = -999.;
510  met_data->puppi_mHtPhi = -999.;
511 
512  for (auto it = corrPuppiJets->begin(); it != corrPuppiJets->end() && jet_data->puppi_nJets < maxJet_; ++it) {
513  if (!puppiJetID(*it))
514  continue;
515 
516  jet_data->puppi_etCorr.push_back(it->et());
517  jet_data->puppi_eta.push_back(it->eta());
518  jet_data->puppi_phi.push_back(it->phi());
519  jet_data->puppi_e.push_back(it->energy());
520 
521  jet_data->puppi_chef.push_back(it->chargedHadronEnergyFraction());
522  jet_data->puppi_nhef.push_back(it->neutralHadronEnergyFraction());
523  jet_data->puppi_pef.push_back(it->photonEnergyFraction());
524  jet_data->puppi_eef.push_back(it->electronEnergyFraction());
525  jet_data->puppi_mef.push_back(it->muonEnergyFraction());
526  jet_data->puppi_hfhef.push_back(it->HFHadronEnergyFraction());
527  jet_data->puppi_hfemef.push_back(it->HFEMEnergyFraction());
528  jet_data->puppi_chMult.push_back(it->chargedHadronMultiplicity());
529  jet_data->puppi_nhMult.push_back(it->neutralHadronMultiplicity());
530  jet_data->puppi_phMult.push_back(it->photonMultiplicity());
531  jet_data->puppi_elMult.push_back(it->electronMultiplicity());
532  jet_data->puppi_muMult.push_back(it->muonMultiplicity());
533  jet_data->puppi_hfhMult.push_back(it->HFHadronMultiplicity());
534  jet_data->puppi_hfemMult.push_back(it->HFEMMultiplicity());
535 
536  jet_data->puppi_cemef.push_back(it->chargedEmEnergyFraction());
537  jet_data->puppi_cmef.push_back(it->chargedMuEnergyFraction());
538  jet_data->puppi_nemef.push_back(it->neutralEmEnergyFraction());
539  jet_data->puppi_cMult.push_back(it->chargedMultiplicity());
540  jet_data->puppi_nMult.push_back(it->neutralMultiplicity());
541 
543 
544  if (it->pt() > jetptThreshold_ && std::abs(it->eta()) < jetetaMax_) {
545  mHx += -1. * it->px();
546  mHy += -1. * it->py();
547  met_data->puppi_Ht += it->pt();
548  }
549  }
550 
551  TVector2 tv2 = TVector2(mHx, mHy);
552  met_data->puppi_mHt = tv2.Mod();
553  met_data->puppi_mHtPhi = tv2.Phi();
554 }
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 460 of file L1JetRecoTreeProducer.cc.

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

Referenced by analyze().

461  {
462  float corrFactor = 1.;
463  unsigned int nJets = 0;
464 
465  float mHx = 0;
466  float mHy = 0;
467 
468  met_data->Ht = 0;
469  met_data->mHt = -999.;
470  met_data->mHtPhi = -999.;
471 
472  for (auto it = pfJets->begin(); it != pfJets->end() && nJets < maxJet_; ++it) {
473  if (!pfJetID(*it))
474  continue;
475 
476  corrFactor = pfJetCorr.product()->correction(*it);
477 
478  jet_data->etCorr.push_back(it->et() * corrFactor);
479  jet_data->corrFactor.push_back(corrFactor);
480 
481  nJets++;
482 
483  if (it->pt() * corrFactor > jetptThreshold_ && std::abs(it->eta()) < jetetaMax_) {
484  mHx += -1. * it->px() * corrFactor;
485  mHy += -1. * it->py() * corrFactor;
486  met_data->Ht += it->pt() * corrFactor;
487  }
488  }
489 
490  TVector2 tv2 = TVector2(mHx, mHy);
491  met_data->mHt = tv2.Mod();
492  met_data->mHtPhi = tv2.Phi();
493 }
bool pfJetID(const reco::PFJet &jet)
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
T const * product() const
Definition: Handle.h:70
static constexpr int nJets
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 425 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, ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, 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(), pfJets_cff::pfJets, L1Analysis::L1AnalysisRecoJetDataFormat::phi, and L1Analysis::L1AnalysisRecoJetDataFormat::phMult.

Referenced by analyze().

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

◆ doPFMet()

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

Definition at line 581 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().

581  {
582  const reco::PFMETCollection* metCol = pfMet.product();
583  const reco::PFMET theMet = metCol->front();
584 
585  met_data->met = theMet.et();
586  met_data->metPhi = theMet.phi();
587  met_data->sumEt = theMet.sumEt();
588  met_data->metPx = theMet.px();
589  met_data->metPy = theMet.py();
590 }
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 592 of file L1JetRecoTreeProducer.cc.

References reco::LeafCandidate::et(), Matriplex::hypot(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, met_data, DiMuonV_cfg::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().

593  {
594  const reco::PFMETCollection* metCol = pfMet.product();
595  const reco::PFMET theMet = metCol->front();
596  reco::PFMET thePFMetNoMu = metCol->front();
597 
598  double pfMetNoMuPx = theMet.px();
599  double pfMetNoMuPy = theMet.py();
600 
601  double muPx(0.), muPy(0.);
602 
603  for (auto it = muons->begin(); it != muons->end(); ++it) {
604  if (it->isPFMuon()) {
605  muPx += it->px();
606  muPy += it->py();
607  }
608  }
609 
610  pfMetNoMuPx += muPx;
611  pfMetNoMuPy += muPy;
612 
613  math::XYZTLorentzVector pfMetNoMuP4(pfMetNoMuPx, pfMetNoMuPy, 0, hypot(pfMetNoMuPx, pfMetNoMuPy));
614 
615  thePFMetNoMu.setP4(pfMetNoMuP4);
616 
617  met_data->pfMetNoMu = thePFMetNoMu.et();
618  met_data->pfMetNoMuPhi = thePFMetNoMu.phi();
619  met_data->pfMetNoMuPx = thePFMetNoMu.px();
620  met_data->pfMetNoMuPy = thePFMetNoMu.py();
621 }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:616
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
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 495 of file L1JetRecoTreeProducer.cc.

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

Referenced by analyze().

495  {
496  for (auto it = puppiJets->begin(); it != puppiJets->end() && jet_data->puppi_nUncorrJets < maxJet_; ++it) {
497  if (!puppiJetID(*it))
498  continue;
499  jet_data->puppi_et.push_back(it->et());
501  }
502 }
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 623 of file L1JetRecoTreeProducer.cc.

References reco::LeafCandidate::et(), Matriplex::hypot(), ALPAKA_ACCELERATOR_NAMESPACE::vertexFinder::it, met_data, DiMuonV_cfg::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().

624  {
625  const reco::PFMETCollection* metCol = puppiMet.product();
626  const reco::PFMET theMet = metCol->front();
627  reco::PFMET thePUPPIMetNoMu = metCol->front();
628 
629  double puppiMetNoMuPx = theMet.px();
630  double puppiMetNoMuPy = theMet.py();
631 
632  double muPx(0.), muPy(0.);
633 
634  for (auto it = muons->begin(); it != muons->end(); ++it) {
635  if (it->isPFMuon()) {
636  muPx += it->px();
637  muPy += it->py();
638  }
639  }
640 
641  puppiMetNoMuPx += muPx;
642  puppiMetNoMuPy += muPy;
643 
644  math::XYZTLorentzVector puppiMetNoMuP4(puppiMetNoMuPx, puppiMetNoMuPy, 0, hypot(puppiMetNoMuPx, puppiMetNoMuPy));
645 
646  thePUPPIMetNoMu.setP4(puppiMetNoMuP4);
647 
648  met_data->puppi_metNoMu = thePUPPIMetNoMu.et();
649  met_data->puppi_metNoMuPhi = thePUPPIMetNoMu.phi();
650  met_data->puppi_metNoMuPx = thePUPPIMetNoMu.px();
651  met_data->puppi_metNoMuPy = thePUPPIMetNoMu.py();
652 }
MPlex< T, D1, D2, N > hypot(const MPlex< T, D1, D2, N > &a, const MPlex< T, D1, D2, N > &b)
Definition: Matriplex.h:616
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
T const * product() const
Definition: Handle.h:70
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
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,
edm::Handle< std::vector< pat::Jet > >  corrPuppiJets 
)
private

Definition at line 672 of file L1JetRecoTreeProducer.cc.

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

Referenced by analyze().

673  {
674  bool passPuppiJetPtCut = false;
675 
676  for (auto it = corrPuppiJets->begin(); it != corrPuppiJets->end(); ++it) {
677  if (!puppiJetID(*it))
678  continue;
679  if (it->muonEnergyFraction() > 0.5 || it->chargedEmEnergyFraction() > 0.5)
680  continue;
681  if (it->pt() > 30)
682  passPuppiJetPtCut = true;
683  }
684 
685  if (!passPuppiJetPtCut || muons->size() < 2) {
686  met_data->zPt = -999;
687  return;
688  }
689 
690  reco::Muon muon1;
691  reco::Muon muon2;
692 
693  float zMass = 91.2;
694  float diMuMass = 0;
695  float closestDiff = 999.;
696  bool found2PFMuons = false;
697 
698  for (auto it1 = muons->begin(); it1 != muons->end(); ++it1) {
699  if (!it1->isPFMuon())
700  continue;
701  for (auto it2 = std::next(it1); it2 != muons->end(); ++it2) {
702  if (!it2->isPFMuon())
703  continue;
704  if (it1->charge() != (-1 * it2->charge()))
705  continue;
706 
707  found2PFMuons = true;
708  diMuMass = (it1->p4() + it2->p4()).M();
709  float diff = abs(diMuMass - zMass);
710  if (diff < closestDiff) {
711  closestDiff = diff;
712  muon1 = *it1;
713  muon2 = *it2;
714  }
715  }
716  }
717 
718  diMuMass = (muon1.p4() + muon2.p4()).M();
719  if (abs(diMuMass - zMass) > 30 || !found2PFMuons) {
720  met_data->zPt = -999;
721  return;
722  }
723 
724  float zPt = (muon1.p4() + muon2.p4()).pt();
725  met_data->zPt = zPt;
726 }
L1Analysis::L1AnalysisRecoMetDataFormat * met_data
bool puppiJetID(const pat::Jet &jet)
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
Definition: DiMuonV_cfg.py:214
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 802 of file L1JetRecoTreeProducer.cc.

802 {}

◆ pfJetID()

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

Definition at line 728 of file L1JetRecoTreeProducer.cc.

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

Referenced by doPFJetCorr(), and doPFJets().

728  {
729  bool tmp = true;
730  if (std::abs(jet.eta()) <= 2.6) {
731  tmp &= jet.neutralHadronEnergyFraction() < 0.9;
732  tmp &= jet.neutralEmEnergyFraction() < 0.9;
733  tmp &= (jet.chargedMultiplicity() + jet.neutralMultiplicity()) > 1;
734  tmp &= jet.muonEnergyFraction() < 0.8;
735  tmp &= jet.chargedHadronEnergyFraction() > 0.01;
736  tmp &= jet.chargedMultiplicity() > 0;
737  tmp &= jet.chargedEmEnergyFraction() < 0.8;
738  }
739  if (std::abs(jet.eta()) > 2.6 && std::abs(jet.eta()) <= 2.7) {
740  tmp &= jet.neutralHadronEnergyFraction() < 0.9;
741  tmp &= jet.neutralEmEnergyFraction() < 0.99;
742  tmp &= jet.muonEnergyFraction() < 0.8;
743  tmp &= jet.chargedMultiplicity() > 0;
744  tmp &= jet.chargedEmEnergyFraction() < 0.8;
745  }
746  if (std::abs(jet.eta()) > 2.7 && std::abs(jet.eta()) < 3.0) {
747  tmp &= jet.neutralEmEnergyFraction() < 0.99;
748  tmp &= jet.neutralMultiplicity() > 1;
749  }
750  if (std::abs(jet.eta()) > 3.0) {
751  tmp &= jet.neutralHadronEnergyFraction() > 0.2;
752  tmp &= jet.neutralEmEnergyFraction() < 0.9;
753  tmp &= jet.neutralMultiplicity() > 10;
754  }
755 
756  // our custom selection
757  //tmp &= jet.muonMultiplicity() == 0;
758  //tmp &= jet.electronMultiplicity() == 0;
759 
760  return tmp;
761 }
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 764 of file L1JetRecoTreeProducer.cc.

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

Referenced by doCorrPUPPIJets(), doPUPPIJets(), and doZPt().

764  {
765  bool tmp = true;
766  if (std::abs(jet.eta()) <= 2.6) {
767  tmp &= jet.neutralHadronEnergyFraction() < 0.9;
768  tmp &= jet.neutralEmEnergyFraction() < 0.9;
769  tmp &= (jet.chargedMultiplicity() + jet.neutralMultiplicity()) > 1;
770  tmp &= jet.muonEnergyFraction() < 0.8;
771  tmp &= jet.chargedHadronEnergyFraction() > 0.01;
772  tmp &= jet.chargedMultiplicity() > 0;
773  tmp &= jet.chargedEmEnergyFraction() < 0.8;
774  }
775  if (std::abs(jet.eta()) > 2.6 && std::abs(jet.eta()) <= 2.7) {
776  tmp &= jet.neutralHadronEnergyFraction() < 0.9;
777  tmp &= jet.neutralEmEnergyFraction() < 0.99;
778  tmp &= jet.muonEnergyFraction() < 0.8;
779  tmp &= jet.chargedEmEnergyFraction() < 0.8;
780  }
781  if (std::abs(jet.eta()) > 2.7 && std::abs(jet.eta()) <= 3.0) {
782  tmp &= jet.neutralHadronEnergyFraction() < 0.9999;
783  }
784  if (std::abs(jet.eta()) > 3.0) {
785  tmp &= jet.neutralEmEnergyFraction() < 0.9;
786  tmp &= jet.neutralMultiplicity() > 2;
787  }
788 
789  return tmp;
790 }
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 132 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().