CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
AlCaGammaJetProducer Class Reference
Inheritance diagram for AlCaGammaJetProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 AlCaGammaJetProducer (const edm::ParameterSet &)
 
void beginJob () override
 
void endJob () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~AlCaGammaJetProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (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::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

bool select (const reco::PhotonCollection &, const reco::PFJetCollection &)
 

Private Attributes

edm::InputTag labelBeamSpot_
 
edm::InputTag labelConv_
 
edm::InputTag labelGsfEle_
 
edm::InputTag labelHBHE_
 
edm::InputTag labelHF_
 
edm::InputTag labelHO_
 
edm::InputTag labelLoosePhot_
 
edm::InputTag labelPFCandidate_
 
edm::InputTag labelPFJet_
 
edm::InputTag labelPFMET_
 
edm::InputTag labelPhoton_
 
edm::InputTag labelRho_
 
edm::InputTag labelTightPhot_
 
edm::InputTag labelTrigger_
 
edm::InputTag labelVertex_
 
double minPtJet_
 
double minPtPhoton_
 
int nAll_
 
int nSelect_
 
edm::EDGetTokenT< reco::BeamSpottok_BS_
 
edm::EDGetTokenT< reco::ConversionCollectiontok_Conv_
 
edm::EDGetTokenT< reco::GsfElectronCollectiontok_GsfElec_
 
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit, edm::StrictWeakOrdering< HBHERecHit > > > tok_HBHE_
 
edm::EDGetTokenT< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > tok_HF_
 
edm::EDGetTokenT< edm::SortedCollection< HORecHit, edm::StrictWeakOrdering< HORecHit > > > tok_HO_
 
edm::EDGetTokenT< edm::ValueMap< Bool_t > > tok_loosePhoton_
 
edm::EDGetTokenT< reco::PFCandidateCollectiontok_PFCand_
 
edm::EDGetTokenT< reco::PFJetCollectiontok_PFJet_
 
edm::EDGetTokenT< reco::PFMETCollectiontok_PFMET_
 
edm::EDGetTokenT< reco::PhotonCollectiontok_Photon_
 
edm::EDGetTokenT< double > tok_Rho_
 
edm::EDGetTokenT< edm::ValueMap< Bool_t > > tok_tightPhoton_
 
edm::EDGetTokenT< edm::TriggerResultstok_TrigRes_
 
edm::EDGetTokenT< reco::VertexCollectiontok_Vertex_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 40 of file AlCaGammaJetProducer.cc.

Constructor & Destructor Documentation

◆ AlCaGammaJetProducer()

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

Definition at line 75 of file AlCaGammaJetProducer.cc.

75  : nAll_(0), nSelect_(0) {
76  // Take input
77  labelPhoton_ = iConfig.getParameter<edm::InputTag>("PhoInput");
78  labelPFJet_ = iConfig.getParameter<edm::InputTag>("PFjetInput");
79  labelHBHE_ = iConfig.getParameter<edm::InputTag>("HBHEInput");
80  labelHF_ = iConfig.getParameter<edm::InputTag>("HFInput");
81  labelHO_ = iConfig.getParameter<edm::InputTag>("HOInput");
82  labelTrigger_ = iConfig.getParameter<edm::InputTag>("TriggerResults");
83  labelPFCandidate_ = iConfig.getParameter<edm::InputTag>("particleFlowInput");
84  labelVertex_ = iConfig.getParameter<edm::InputTag>("VertexInput");
85  labelPFMET_ = iConfig.getParameter<edm::InputTag>("METInput");
86  labelGsfEle_ = iConfig.getParameter<edm::InputTag>("gsfeleInput");
87  labelRho_ = iConfig.getParameter<edm::InputTag>("rhoInput");
88  labelConv_ = iConfig.getParameter<edm::InputTag>("ConversionsInput");
89  labelBeamSpot_ = iConfig.getParameter<edm::InputTag>("BeamSpotInput");
90  labelLoosePhot_ = iConfig.getParameter<edm::InputTag>("PhoLoose");
91  labelTightPhot_ = iConfig.getParameter<edm::InputTag>("PhoTight");
92  minPtJet_ = iConfig.getParameter<double>("MinPtJet");
93  minPtPhoton_ = iConfig.getParameter<double>("MinPtPhoton");
94 
95  tok_Photon_ = consumes<reco::PhotonCollection>(labelPhoton_);
96  tok_PFJet_ = consumes<reco::PFJetCollection>(labelPFJet_);
97  tok_HBHE_ = consumes<edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit>>>(labelHBHE_);
98  tok_HF_ = consumes<edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>>(labelHF_);
99  tok_HO_ = consumes<edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>>(labelHO_);
100  tok_TrigRes_ = consumes<edm::TriggerResults>(labelTrigger_);
101  tok_PFCand_ = consumes<reco::PFCandidateCollection>(labelPFCandidate_);
102  tok_Vertex_ = consumes<reco::VertexCollection>(labelVertex_);
103  tok_PFMET_ = consumes<reco::PFMETCollection>(labelPFMET_);
104  tok_loosePhoton_ = consumes<edm::ValueMap<Bool_t>>(labelLoosePhot_);
105  tok_tightPhoton_ = consumes<edm::ValueMap<Bool_t>>(labelTightPhot_);
106  tok_GsfElec_ = consumes<reco::GsfElectronCollection>(labelGsfEle_);
107  tok_Rho_ = consumes<double>(labelRho_);
108  tok_Conv_ = consumes<reco::ConversionCollection>(labelConv_);
109  tok_BS_ = consumes<reco::BeamSpot>(labelBeamSpot_);
110 
111  // register your products
112  produces<reco::PhotonCollection>(labelPhoton_.encode());
113  produces<reco::PFJetCollection>(labelPFJet_.encode());
114  produces<edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit>>>(labelHBHE_.encode());
115  produces<edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>>(labelHF_.encode());
116  produces<edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>>(labelHO_.encode());
117  produces<edm::TriggerResults>(labelTrigger_.encode());
118  produces<std::vector<Bool_t>>(labelLoosePhot_.encode());
119  produces<std::vector<Bool_t>>(labelTightPhot_.encode());
120  produces<double>(labelRho_.encode());
121  produces<reco::PFCandidateCollection>(labelPFCandidate_.encode());
122  produces<reco::VertexCollection>(labelVertex_.encode());
123  produces<reco::PFMETCollection>(labelPFMET_.encode());
124  produces<reco::GsfElectronCollection>(labelGsfEle_.encode());
125  produces<reco::ConversionCollection>(labelConv_.encode());
126  produces<reco::BeamSpot>(labelBeamSpot_.encode());
127 }

References edm::InputTag::encode(), edm::ParameterSet::getParameter(), labelBeamSpot_, labelConv_, labelGsfEle_, labelHBHE_, labelHF_, labelHO_, labelLoosePhot_, labelPFCandidate_, labelPFJet_, labelPFMET_, labelPhoton_, labelRho_, labelTightPhot_, labelTrigger_, labelVertex_, minPtJet_, minPtPhoton_, tok_BS_, tok_Conv_, tok_GsfElec_, tok_HBHE_, tok_HF_, tok_HO_, tok_loosePhoton_, tok_PFCand_, tok_PFJet_, tok_PFMET_, tok_Photon_, tok_Rho_, tok_tightPhoton_, tok_TrigRes_, and tok_Vertex_.

◆ ~AlCaGammaJetProducer()

AlCaGammaJetProducer::~AlCaGammaJetProducer ( )
override

Definition at line 129 of file AlCaGammaJetProducer.cc.

129 {}

Member Function Documentation

◆ beginJob()

void AlCaGammaJetProducer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 131 of file AlCaGammaJetProducer.cc.

131 {}

◆ endJob()

void AlCaGammaJetProducer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 133 of file AlCaGammaJetProducer.cc.

133  {
134  edm::LogInfo("AlcaGammaJet") << "Accepts " << nSelect_ << " events from a total of " << nAll_ << " events";
135 }

References nAll_, and nSelect_.

Referenced by o2olib.O2ORunMgr::executeJob().

◆ produce()

void AlCaGammaJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDProducer.

Definition at line 157 of file AlCaGammaJetProducer.cc.

157  {
158  nAll_++;
159 
160  // Access the collections from iEvent
162  iEvent.getByToken(tok_Photon_, phoHandle);
163  if (!phoHandle.isValid()) {
164  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get the product " << labelPhoton_;
165  return;
166  }
167  const reco::PhotonCollection photon = *(phoHandle.product());
168 
170  iEvent.getByToken(tok_PFJet_, pfjet);
171  if (!pfjet.isValid()) {
172  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFJet_;
173  return;
174  }
175  const reco::PFJetCollection pfjets = *(pfjet.product());
176 
178  iEvent.getByToken(tok_PFCand_, pfc);
179  if (!pfc.isValid()) {
180  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFCandidate_;
181  return;
182  }
183  const reco::PFCandidateCollection pfcand = *(pfc.product());
184 
186  iEvent.getByToken(tok_Vertex_, vt);
187  if (!vt.isValid()) {
188  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelVertex_;
189  return;
190  }
191  const reco::VertexCollection vtx = *(vt.product());
192 
194  iEvent.getByToken(tok_PFMET_, pfmt);
195  if (!pfmt.isValid()) {
196  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFMET_;
197  return;
198  }
199  const reco::PFMETCollection pfmet = *(pfmt.product());
200 
202  iEvent.getByToken(tok_HBHE_, hbhe);
203  if (!hbhe.isValid()) {
204  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHBHE_;
205  return;
206  }
208 
210  iEvent.getByToken(tok_HO_, ho);
211  if (!ho.isValid()) {
212  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHO_;
213  return;
214  }
216 
218  iEvent.getByToken(tok_HF_, hf);
219  if (!hf.isValid()) {
220  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHF_;
221  return;
222  }
224 
226  iEvent.getByToken(tok_TrigRes_, trig);
227  if (!trig.isValid()) {
228  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelTrigger_;
229  return;
230  }
231  const edm::TriggerResults trigres = *(trig.product());
232 
234  iEvent.getByToken(tok_Rho_, rh);
235  if (!rh.isValid()) {
236  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelRho_;
237  return;
238  }
239  const double rho_val = *(rh.product());
240 
242  iEvent.getByToken(tok_GsfElec_, gsf);
243  if (!gsf.isValid()) {
244  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelGsfEle_;
245  return;
246  }
247  const reco::GsfElectronCollection gsfele = *(gsf.product());
248 
250  iEvent.getByToken(tok_Conv_, con);
251  if (!con.isValid()) {
252  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelConv_;
253  return;
254  }
255  const reco::ConversionCollection conv = *(con.product());
256 
258  iEvent.getByToken(tok_BS_, bs);
259  if (!bs.isValid()) {
260  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelBeamSpot_;
261  return;
262  }
263  const reco::BeamSpot beam = *(bs.product());
264 
265  // declare variables
266  // copy from standard place, if the event is useful
267  auto miniPFjetCollection = std::make_unique<reco::PFJetCollection>();
268  auto miniPhotonCollection = std::make_unique<reco::PhotonCollection>();
269  auto miniPFCandCollection = std::make_unique<reco::PFCandidateCollection>();
270  auto miniVtxCollection = std::make_unique<reco::VertexCollection>();
271  auto miniPFMETCollection = std::make_unique<reco::PFMETCollection>();
272  auto miniHBHECollection = std::make_unique<edm::SortedCollection<HBHERecHit, edm::StrictWeakOrdering<HBHERecHit>>>();
273  auto miniHOCollection = std::make_unique<edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>>();
274  auto miniHFCollection = std::make_unique<edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>>();
275  auto miniGSFeleCollection = std::make_unique<reco::GsfElectronCollection>();
276  auto miniConversionCollection = std::make_unique<reco::ConversionCollection>();
277 
278  auto miniBeamSpotCollection = std::make_unique<reco::BeamSpot>(
279  beam.position(), beam.sigmaZ(), beam.dxdz(), beam.dydz(), beam.BeamWidthX(), beam.covariance(), beam.type());
280 
281  auto miniTriggerCollection = std::make_unique<edm::TriggerResults>();
282 
283  auto miniRhoCollection = std::make_unique<double>();
284  auto miniLoosePhoton = std::make_unique<std::vector<Bool_t>>();
285  auto miniTightPhoton = std::make_unique<std::vector<Bool_t>>();
286 
287  // See if this event is useful
288  bool accept = select(photon, pfjets);
289  if (accept) {
290  nSelect_++;
291 
292  //Copy from standard place
293  for (reco::PFJetCollection::const_iterator pfjetItr = pfjets.begin(); pfjetItr != pfjets.end(); pfjetItr++) {
294  miniPFjetCollection->push_back(*pfjetItr);
295  }
296 
297  for (reco::PhotonCollection::const_iterator phoItr = photon.begin(); phoItr != photon.end(); phoItr++) {
298  miniPhotonCollection->push_back(*phoItr);
299  }
300 
301  for (reco::PFCandidateCollection::const_iterator pfcItr = pfcand.begin(); pfcItr != pfcand.end(); pfcItr++) {
302  miniPFCandCollection->push_back(*pfcItr);
303  }
304 
305  for (reco::VertexCollection::const_iterator vtxItr = vtx.begin(); vtxItr != vtx.end(); vtxItr++) {
306  miniVtxCollection->push_back(*vtxItr);
307  }
308 
309  for (reco::PFMETCollection::const_iterator pfmetItr = pfmet.begin(); pfmetItr != pfmet.end(); pfmetItr++) {
310  miniPFMETCollection->push_back(*pfmetItr);
311  }
312 
314  Hithbhe.begin();
315  hbheItr != Hithbhe.end();
316  hbheItr++) {
317  miniHBHECollection->push_back(*hbheItr);
318  }
319 
320  for (edm::SortedCollection<HORecHit, edm::StrictWeakOrdering<HORecHit>>::const_iterator hoItr = Hitho.begin();
321  hoItr != Hitho.end();
322  hoItr++) {
323  miniHOCollection->push_back(*hoItr);
324  }
325 
326  for (edm::SortedCollection<HFRecHit, edm::StrictWeakOrdering<HFRecHit>>::const_iterator hfItr = Hithf.begin();
327  hfItr != Hithf.end();
328  hfItr++) {
329  miniHFCollection->push_back(*hfItr);
330  }
331 
332  for (reco::GsfElectronCollection::const_iterator gsfItr = gsfele.begin(); gsfItr != gsfele.end(); gsfItr++) {
333  miniGSFeleCollection->push_back(*gsfItr);
334  }
335 
336  for (reco::ConversionCollection::const_iterator convItr = conv.begin(); convItr != conv.end(); convItr++) {
337  miniConversionCollection->push_back(*convItr);
338  }
339 
340  *miniTriggerCollection = trigres;
341  *miniRhoCollection = rho_val;
342 
343  edm::Handle<edm::ValueMap<Bool_t>> loosePhotonQual;
344  iEvent.getByToken(tok_loosePhoton_, loosePhotonQual);
345  edm::Handle<edm::ValueMap<Bool_t>> tightPhotonQual;
346  iEvent.getByToken(tok_tightPhoton_, tightPhotonQual);
347  if (loosePhotonQual.isValid() && tightPhotonQual.isValid()) {
348  miniLoosePhoton->reserve(miniPhotonCollection->size());
349  miniTightPhoton->reserve(miniPhotonCollection->size());
350  for (int iPho = 0; iPho < int(miniPhotonCollection->size()); ++iPho) {
351  edm::Ref<reco::PhotonCollection> photonRef(phoHandle, iPho);
352  if (!photonRef) {
353  std::cout << "failed ref" << std::endl;
354  miniLoosePhoton->push_back(-1);
355  miniTightPhoton->push_back(-1);
356  } else {
357  miniLoosePhoton->push_back((*loosePhotonQual)[photonRef]);
358  miniTightPhoton->push_back((*tightPhotonQual)[photonRef]);
359  }
360  }
361  }
362  }
363 
364  //Put them in the event
365  iEvent.put(std::move(miniPhotonCollection), labelPhoton_.encode());
366  iEvent.put(std::move(miniPFjetCollection), labelPFJet_.encode());
367  iEvent.put(std::move(miniHBHECollection), labelHBHE_.encode());
368  iEvent.put(std::move(miniHFCollection), labelHF_.encode());
369  iEvent.put(std::move(miniHOCollection), labelHO_.encode());
370  iEvent.put(std::move(miniTriggerCollection), labelTrigger_.encode());
371  iEvent.put(std::move(miniPFCandCollection), labelPFCandidate_.encode());
372  iEvent.put(std::move(miniVtxCollection), labelVertex_.encode());
373  iEvent.put(std::move(miniPFMETCollection), labelPFMET_.encode());
374  iEvent.put(std::move(miniGSFeleCollection), labelGsfEle_.encode());
375  iEvent.put(std::move(miniRhoCollection), labelRho_.encode());
376  iEvent.put(std::move(miniConversionCollection), labelConv_.encode());
377  iEvent.put(std::move(miniBeamSpotCollection), labelBeamSpot_.encode());
378  iEvent.put(std::move(miniLoosePhoton), labelLoosePhot_.encode());
379  iEvent.put(std::move(miniTightPhoton), labelTightPhot_.encode());
380 
381  return;
382 }

References accept(), EcalCondDBWriter_cfi::beam, edm::SortedCollection< T, SORT >::begin(), cms::cuda::bs, conv, gather_cfg::cout, edm::InputTag::encode(), edm::SortedCollection< T, SORT >::end(), ntupleEnum::gsf, photonIsolationHIProducer_cfi::hbhe, photonIsolationHIProducer_cfi::hf, photonIsolationHIProducer_cfi::ho, iEvent, createfilelist::int, edm::HandleBase::isValid(), labelBeamSpot_, labelConv_, labelGsfEle_, labelHBHE_, labelHF_, labelHO_, labelLoosePhot_, labelPFCandidate_, labelPFJet_, labelPFMET_, labelPhoton_, labelRho_, labelTightPhot_, labelTrigger_, labelVertex_, eostools::move(), nAll_, nSelect_, pfDeepBoostedJetPreprocessParams_cfi::pfcand, muons2muons_cfi::photon, edm::Handle< T >::product(), select(), tok_BS_, tok_Conv_, tok_GsfElec_, tok_HBHE_, tok_HF_, tok_HO_, tok_loosePhoton_, tok_PFCand_, tok_PFJet_, tok_PFMET_, tok_Photon_, tok_Rho_, tok_tightPhoton_, tok_TrigRes_, tok_Vertex_, ClusterTask_cfi::trig, and badGlobalMuonTaggersAOD_cff::vtx.

◆ select()

bool AlCaGammaJetProducer::select ( const reco::PhotonCollection ph,
const reco::PFJetCollection jt 
)
private

Definition at line 137 of file AlCaGammaJetProducer.cc.

137  {
138  // Check the requirement for minimum pT
139  if (ph.empty())
140  return false;
141  bool ok(false);
142  for (reco::PFJetCollection::const_iterator itr = jt.begin(); itr != jt.end(); ++itr) {
143  if (itr->pt() >= minPtJet_) {
144  ok = true;
145  break;
146  }
147  }
148  if (!ok)
149  return ok;
150  for (reco::PhotonCollection::const_iterator itr = ph.begin(); itr != ph.end(); ++itr) {
151  if (itr->pt() >= minPtPhoton_)
152  return ok;
153  }
154  return false;
155 }

References minPtJet_, minPtPhoton_, and convertSQLiteXML::ok.

Referenced by produce().

Member Data Documentation

◆ labelBeamSpot_

edm::InputTag AlCaGammaJetProducer::labelBeamSpot_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelConv_

edm::InputTag AlCaGammaJetProducer::labelConv_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelGsfEle_

edm::InputTag AlCaGammaJetProducer::labelGsfEle_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelHBHE_

edm::InputTag AlCaGammaJetProducer::labelHBHE_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelHF_

edm::InputTag AlCaGammaJetProducer::labelHF_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelHO_

edm::InputTag AlCaGammaJetProducer::labelHO_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelLoosePhot_

edm::InputTag AlCaGammaJetProducer::labelLoosePhot_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelPFCandidate_

edm::InputTag AlCaGammaJetProducer::labelPFCandidate_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelPFJet_

edm::InputTag AlCaGammaJetProducer::labelPFJet_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelPFMET_

edm::InputTag AlCaGammaJetProducer::labelPFMET_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelPhoton_

edm::InputTag AlCaGammaJetProducer::labelPhoton_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelRho_

edm::InputTag AlCaGammaJetProducer::labelRho_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelTightPhot_

edm::InputTag AlCaGammaJetProducer::labelTightPhot_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelTrigger_

edm::InputTag AlCaGammaJetProducer::labelTrigger_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ labelVertex_

edm::InputTag AlCaGammaJetProducer::labelVertex_
private

Definition at line 53 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ minPtJet_

double AlCaGammaJetProducer::minPtJet_
private

Definition at line 55 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and select().

◆ minPtPhoton_

double AlCaGammaJetProducer::minPtPhoton_
private

Definition at line 55 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and select().

◆ nAll_

int AlCaGammaJetProducer::nAll_
private

Definition at line 56 of file AlCaGammaJetProducer.cc.

Referenced by endJob(), and produce().

◆ nSelect_

int AlCaGammaJetProducer::nSelect_
private

Definition at line 56 of file AlCaGammaJetProducer.cc.

Referenced by endJob(), and produce().

◆ tok_BS_

edm::EDGetTokenT<reco::BeamSpot> AlCaGammaJetProducer::tok_BS_
private

Definition at line 70 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_Conv_

edm::EDGetTokenT<reco::ConversionCollection> AlCaGammaJetProducer::tok_Conv_
private

Definition at line 69 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_GsfElec_

edm::EDGetTokenT<reco::GsfElectronCollection> AlCaGammaJetProducer::tok_GsfElec_
private

Definition at line 67 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_HBHE_

Definition at line 60 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_HF_

Definition at line 61 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_HO_

Definition at line 62 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_loosePhoton_

edm::EDGetTokenT<edm::ValueMap<Bool_t> > AlCaGammaJetProducer::tok_loosePhoton_
private

Definition at line 71 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_PFCand_

edm::EDGetTokenT<reco::PFCandidateCollection> AlCaGammaJetProducer::tok_PFCand_
private

Definition at line 64 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_PFJet_

edm::EDGetTokenT<reco::PFJetCollection> AlCaGammaJetProducer::tok_PFJet_
private

Definition at line 59 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_PFMET_

edm::EDGetTokenT<reco::PFMETCollection> AlCaGammaJetProducer::tok_PFMET_
private

Definition at line 66 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_Photon_

edm::EDGetTokenT<reco::PhotonCollection> AlCaGammaJetProducer::tok_Photon_
private

Definition at line 58 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_Rho_

edm::EDGetTokenT<double> AlCaGammaJetProducer::tok_Rho_
private

Definition at line 68 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_tightPhoton_

edm::EDGetTokenT<edm::ValueMap<Bool_t> > AlCaGammaJetProducer::tok_tightPhoton_
private

Definition at line 72 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_TrigRes_

edm::EDGetTokenT<edm::TriggerResults> AlCaGammaJetProducer::tok_TrigRes_
private

Definition at line 63 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

◆ tok_Vertex_

edm::EDGetTokenT<reco::VertexCollection> AlCaGammaJetProducer::tok_Vertex_
private

Definition at line 65 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

muons2muons_cfi.photon
photon
Definition: muons2muons_cfi.py:28
reco::PFMETCollection
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
Definition: PFMETCollection.h:20
edm::Handle::product
T const * product() const
Definition: Handle.h:70
AlCaGammaJetProducer::labelLoosePhot_
edm::InputTag labelLoosePhot_
Definition: AlCaGammaJetProducer.cc:53
conv
static HepMC::IO_HEPEVT conv
Definition: BeamHaloProducer.cc:48
HORecHit
Definition: HORecHit.h:11
HBHERecHit
Definition: HBHERecHit.h:13
AlCaGammaJetProducer::tok_BS_
edm::EDGetTokenT< reco::BeamSpot > tok_BS_
Definition: AlCaGammaJetProducer.cc:70
reco::VertexCollection
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::LogInfo
Definition: MessageLogger.h:254
AlCaGammaJetProducer::nAll_
int nAll_
Definition: AlCaGammaJetProducer.cc:56
AlCaGammaJetProducer::tok_GsfElec_
edm::EDGetTokenT< reco::GsfElectronCollection > tok_GsfElec_
Definition: AlCaGammaJetProducer.cc:67
edm::SortedCollection
Definition: SortedCollection.h:49
reco::GsfElectronCollection
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
Definition: GsfElectronFwd.h:14
AlCaGammaJetProducer::labelPFCandidate_
edm::InputTag labelPFCandidate_
Definition: AlCaGammaJetProducer.cc:53
convertSQLiteXML.ok
bool ok
Definition: convertSQLiteXML.py:98
edm::Handle< reco::PhotonCollection >
AlCaGammaJetProducer::labelPFJet_
edm::InputTag labelPFJet_
Definition: AlCaGammaJetProducer.cc:53
AlCaGammaJetProducer::labelRho_
edm::InputTag labelRho_
Definition: AlCaGammaJetProducer.cc:53
edm::Ref
Definition: AssociativeIterator.h:58
reco::ConversionCollection
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
pfDeepBoostedJetPreprocessParams_cfi.pfcand
pfcand
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:8
AlCaGammaJetProducer::labelBeamSpot_
edm::InputTag labelBeamSpot_
Definition: AlCaGammaJetProducer.cc:53
accept
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
cms::cuda::bs
bs
Definition: HistoContainer.h:127
photonIsolationHIProducer_cfi.hf
hf
Definition: photonIsolationHIProducer_cfi.py:9
AlCaGammaJetProducer::minPtPhoton_
double minPtPhoton_
Definition: AlCaGammaJetProducer.cc:55
HFRecHit
Definition: HFRecHit.h:11
AlCaGammaJetProducer::labelGsfEle_
edm::InputTag labelGsfEle_
Definition: AlCaGammaJetProducer.cc:53
edm::SortedCollection::begin
const_iterator begin() const
Definition: SortedCollection.h:262
reco::BeamSpot
Definition: BeamSpot.h:21
AlCaGammaJetProducer::tok_Rho_
edm::EDGetTokenT< double > tok_Rho_
Definition: AlCaGammaJetProducer.cc:68
AlCaGammaJetProducer::labelPhoton_
edm::InputTag labelPhoton_
Definition: AlCaGammaJetProducer.cc:53
EcalCondDBWriter_cfi.beam
beam
Definition: EcalCondDBWriter_cfi.py:45
badGlobalMuonTaggersAOD_cff.vtx
vtx
Definition: badGlobalMuonTaggersAOD_cff.py:5
AlCaGammaJetProducer::tok_PFMET_
edm::EDGetTokenT< reco::PFMETCollection > tok_PFMET_
Definition: AlCaGammaJetProducer.cc:66
AlCaGammaJetProducer::tok_Photon_
edm::EDGetTokenT< reco::PhotonCollection > tok_Photon_
Definition: AlCaGammaJetProducer.cc:58
edm::LogWarning
Definition: MessageLogger.h:141
AlCaGammaJetProducer::labelPFMET_
edm::InputTag labelPFMET_
Definition: AlCaGammaJetProducer.cc:53
AlCaGammaJetProducer::minPtJet_
double minPtJet_
Definition: AlCaGammaJetProducer.cc:55
edm::SortedCollection::end
const_iterator end() const
Definition: SortedCollection.h:267
AlCaGammaJetProducer::tok_HBHE_
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit, edm::StrictWeakOrdering< HBHERecHit > > > tok_HBHE_
Definition: AlCaGammaJetProducer.cc:60
AlCaGammaJetProducer::tok_HF_
edm::EDGetTokenT< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > tok_HF_
Definition: AlCaGammaJetProducer.cc:61
AlCaGammaJetProducer::labelHO_
edm::InputTag labelHO_
Definition: AlCaGammaJetProducer.cc:53
AlCaGammaJetProducer::nSelect_
int nSelect_
Definition: AlCaGammaJetProducer.cc:56
createfilelist.int
int
Definition: createfilelist.py:10
iEvent
int iEvent
Definition: GenABIO.cc:224
AlCaGammaJetProducer::tok_TrigRes_
edm::EDGetTokenT< edm::TriggerResults > tok_TrigRes_
Definition: AlCaGammaJetProducer.cc:63
photonIsolationHIProducer_cfi.ho
ho
Definition: photonIsolationHIProducer_cfi.py:10
edm::InputTag::encode
std::string encode() const
Definition: InputTag.cc:159
ntupleEnum.gsf
gsf
Definition: ntupleEnum.py:48
AlCaGammaJetProducer::tok_PFJet_
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJet_
Definition: AlCaGammaJetProducer.cc:59
itr
std::vector< std::pair< float, float > >::iterator itr
Definition: HGCDigitizer.cc:28
ClusterTask_cfi.trig
trig
Definition: ClusterTask_cfi.py:336
photonIsolationHIProducer_cfi.hbhe
hbhe
Definition: photonIsolationHIProducer_cfi.py:8
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
eostools.move
def move(src, dest)
Definition: eostools.py:511
AlCaGammaJetProducer::tok_Vertex_
edm::EDGetTokenT< reco::VertexCollection > tok_Vertex_
Definition: AlCaGammaJetProducer.cc:65
AlCaGammaJetProducer::labelVertex_
edm::InputTag labelVertex_
Definition: AlCaGammaJetProducer.cc:53
reco::PFJetCollection
std::vector< PFJet > PFJetCollection
collection of PFJet objects
Definition: PFJetCollection.h:14
edm::StrictWeakOrdering
Definition: SortedCollection.h:47
AlCaGammaJetProducer::select
bool select(const reco::PhotonCollection &, const reco::PFJetCollection &)
Definition: AlCaGammaJetProducer.cc:137
AlCaGammaJetProducer::labelHF_
edm::InputTag labelHF_
Definition: AlCaGammaJetProducer.cc:53
reco::PFCandidateCollection
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
Definition: PFCandidateFwd.h:12
AlCaGammaJetProducer::labelTightPhot_
edm::InputTag labelTightPhot_
Definition: AlCaGammaJetProducer.cc:53
AlCaGammaJetProducer::labelTrigger_
edm::InputTag labelTrigger_
Definition: AlCaGammaJetProducer.cc:53
reco::PhotonCollection
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
AlCaGammaJetProducer::labelHBHE_
edm::InputTag labelHBHE_
Definition: AlCaGammaJetProducer.cc:53
AlCaGammaJetProducer::tok_loosePhoton_
edm::EDGetTokenT< edm::ValueMap< Bool_t > > tok_loosePhoton_
Definition: AlCaGammaJetProducer.cc:71
AlCaGammaJetProducer::tok_HO_
edm::EDGetTokenT< edm::SortedCollection< HORecHit, edm::StrictWeakOrdering< HORecHit > > > tok_HO_
Definition: AlCaGammaJetProducer.cc:62
AlCaGammaJetProducer::labelConv_
edm::InputTag labelConv_
Definition: AlCaGammaJetProducer.cc:53
AlCaGammaJetProducer::tok_PFCand_
edm::EDGetTokenT< reco::PFCandidateCollection > tok_PFCand_
Definition: AlCaGammaJetProducer.cc:64
AlCaGammaJetProducer::tok_tightPhoton_
edm::EDGetTokenT< edm::ValueMap< Bool_t > > tok_tightPhoton_
Definition: AlCaGammaJetProducer.cc:72
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::InputTag
Definition: InputTag.h:15
edm::TriggerResults
Definition: TriggerResults.h:35
AlCaGammaJetProducer::tok_Conv_
edm::EDGetTokenT< reco::ConversionCollection > tok_Conv_
Definition: AlCaGammaJetProducer.cc:69