test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 &)
 
virtual void beginJob ()
 
virtual void endJob ()
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~AlCaGammaJetProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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::ConversionCollection
tok_Conv_
 
edm::EDGetTokenT
< reco::GsfElectronCollection
tok_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::PFCandidateCollection
tok_PFCand_
 
edm::EDGetTokenT
< reco::PFJetCollection
tok_PFJet_
 
edm::EDGetTokenT
< reco::PFMETCollection
tok_PFMET_
 
edm::EDGetTokenT
< reco::PhotonCollection
tok_Photon_
 
edm::EDGetTokenT< double > tok_Rho_
 
edm::EDGetTokenT
< edm::ValueMap< Bool_t > > 
tok_tightPhoton_
 
edm::EDGetTokenT
< edm::TriggerResults
tok_TrigRes_
 
edm::EDGetTokenT
< reco::VertexCollection
tok_Vertex_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
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)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
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)
 

Detailed Description

Definition at line 40 of file AlCaGammaJetProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 75 of file AlCaGammaJetProducer.cc.

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_.

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 
128 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit, edm::StrictWeakOrdering< HBHERecHit > > > tok_HBHE_
edm::EDGetTokenT< edm::ValueMap< Bool_t > > tok_tightPhoton_
edm::EDGetTokenT< reco::BeamSpot > tok_BS_
std::string encode() const
Definition: InputTag.cc:164
edm::EDGetTokenT< edm::SortedCollection< HORecHit, edm::StrictWeakOrdering< HORecHit > > > tok_HO_
edm::EDGetTokenT< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > tok_HF_
edm::EDGetTokenT< reco::VertexCollection > tok_Vertex_
edm::EDGetTokenT< double > tok_Rho_
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJet_
edm::EDGetTokenT< reco::PFMETCollection > tok_PFMET_
edm::EDGetTokenT< reco::ConversionCollection > tok_Conv_
edm::EDGetTokenT< edm::TriggerResults > tok_TrigRes_
edm::EDGetTokenT< reco::GsfElectronCollection > tok_GsfElec_
edm::EDGetTokenT< reco::PhotonCollection > tok_Photon_
edm::EDGetTokenT< edm::ValueMap< Bool_t > > tok_loosePhoton_
edm::EDGetTokenT< reco::PFCandidateCollection > tok_PFCand_
AlCaGammaJetProducer::~AlCaGammaJetProducer ( )

Definition at line 130 of file AlCaGammaJetProducer.cc.

130 { }

Member Function Documentation

void AlCaGammaJetProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 132 of file AlCaGammaJetProducer.cc.

132 { }
void AlCaGammaJetProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 134 of file AlCaGammaJetProducer.cc.

References nAll_, and nSelect_.

Referenced by o2o.O2ORunMgr::executeJob().

134  {
135  edm::LogInfo("AlcaGammaJet") << "Accepts " << nSelect_ << " events from a total of " << nAll_ << " events";
136 }
void AlCaGammaJetProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 158 of file AlCaGammaJetProducer.cc.

References accept(), EcalCondDBWriter_cfi::beam, reco::BeamSpot::BeamWidthX(), edm::SortedCollection< T, SORT >::begin(), conv, gather_cfg::cout, reco::BeamSpot::covariance(), reco::BeamSpot::dxdz(), reco::BeamSpot::dydz(), edm::InputTag::encode(), edm::SortedCollection< T, SORT >::end(), edm::Event::getByToken(), edm::HandleBase::isValid(), labelBeamSpot_, labelConv_, labelGsfEle_, labelHBHE_, labelHF_, labelHO_, labelLoosePhot_, labelPFCandidate_, labelPFJet_, labelPFMET_, labelPhoton_, labelRho_, labelTightPhot_, labelTrigger_, labelVertex_, nAll_, nSelect_, reco::BeamSpot::position(), edm::Handle< T >::product(), edm::Event::put(), reco::return(), select(), reco::BeamSpot::sigmaZ(), 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_, and reco::BeamSpot::type().

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

158  {
159  nAll_++;
160 
161  // Access the collections from iEvent
163  iEvent.getByToken(tok_Photon_,phoHandle);
164  if (!phoHandle.isValid()) {
165  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get the product " << labelPhoton_;
166  return ;
167  }
168  const reco::PhotonCollection photon = *(phoHandle.product());
169 
171  iEvent.getByToken(tok_PFJet_,pfjet);
172  if (!pfjet.isValid()) {
173  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFJet_;
174  return ;
175  }
176  const reco::PFJetCollection pfjets = *(pfjet.product());
177 
179  iEvent.getByToken(tok_PFCand_,pfc);
180  if (!pfc.isValid()) {
181  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFCandidate_;
182  return ;
183  }
184  const reco::PFCandidateCollection pfcand = *(pfc.product());
185 
187  iEvent.getByToken(tok_Vertex_,vt);
188  if (!vt.isValid()) {
189  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelVertex_;
190  return ;
191  }
192  const reco::VertexCollection vtx = *(vt.product());
193 
195  iEvent.getByToken(tok_PFMET_,pfmt);
196  if (!pfmt.isValid()) {
197  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelPFMET_;
198  return ;
199  }
200  const reco::PFMETCollection pfmet = *(pfmt.product());
201 
203  iEvent.getByToken(tok_HBHE_,hbhe);
204  if (!hbhe.isValid()) {
205  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHBHE_;
206  return ;
207  }
209 
211  iEvent.getByToken(tok_HO_,ho);
212  if(!ho.isValid()) {
213  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHO_;
214  return ;
215  }
217 
219  iEvent.getByToken(tok_HF_,hf);
220  if(!hf.isValid()) {
221  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelHF_;
222  return ;
223  }
225 
227  iEvent.getByToken(tok_TrigRes_,trig);
228  if (!trig.isValid()) {
229  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelTrigger_;
230  return ;
231  }
232  const edm::TriggerResults trigres = *(trig.product());
233 
235  iEvent.getByToken(tok_Rho_,rh);
236  if (!rh.isValid()) {
237  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelRho_;
238  return ;
239  }
240  const double rho_val = *(rh.product());
241 
243  iEvent.getByToken(tok_GsfElec_,gsf);
244  if (!gsf.isValid()){
245  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelGsfEle_;
246  return ;
247  }
248  const reco::GsfElectronCollection gsfele = *(gsf.product());
249 
251  iEvent.getByToken(tok_Conv_,con);
252  if (!con.isValid()){
253  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelConv_;
254  return ;
255  }
256  const reco::ConversionCollection conv = *(con.product());
257 
259  iEvent.getByToken(tok_BS_,bs);
260  if (!bs.isValid()){
261  edm::LogWarning("AlCaGammaJet") << "AlCaGammaJetProducer: Error! can't get product " << labelBeamSpot_;
262  return ;
263  }
264  const reco::BeamSpot beam = *(bs.product());
265 
266  // declare variables
267  // copy from standard place, if the event is useful
268  std::auto_ptr<reco::PFJetCollection> miniPFjetCollection(new reco::PFJetCollection);
269  std::auto_ptr<reco::PhotonCollection> miniPhotonCollection(new reco::PhotonCollection);
270  std::auto_ptr<reco::PFCandidateCollection> miniPFCandCollection(new reco::PFCandidateCollection);
271  std::auto_ptr<reco::VertexCollection> miniVtxCollection(new reco::VertexCollection);
272  std::auto_ptr<reco::PFMETCollection> miniPFMETCollection(new reco::PFMETCollection);
273  std::auto_ptr<edm::SortedCollection<HBHERecHit,edm::StrictWeakOrdering<HBHERecHit>>> miniHBHECollection(new edm::SortedCollection<HBHERecHit,edm::StrictWeakOrdering<HBHERecHit>>);
274  std::auto_ptr<edm::SortedCollection<HORecHit,edm::StrictWeakOrdering<HORecHit>>> miniHOCollection(new edm::SortedCollection<HORecHit,edm::StrictWeakOrdering<HORecHit>>);
275  std::auto_ptr<edm::SortedCollection<HFRecHit,edm::StrictWeakOrdering<HFRecHit>>> miniHFCollection(new edm::SortedCollection<HFRecHit,edm::StrictWeakOrdering<HFRecHit>>);
276  std::auto_ptr<reco::GsfElectronCollection> miniGSFeleCollection(new reco::GsfElectronCollection);
277  std::auto_ptr<reco::ConversionCollection> miniConversionCollection(new reco::ConversionCollection);
278 
279  std::auto_ptr<reco::BeamSpot> miniBeamSpotCollection(new reco::BeamSpot(beam.position(),beam.sigmaZ(),
280  beam.dxdz(),beam.dydz(),beam.BeamWidthX(),
281  beam.covariance(),beam.type()));
282 
283  std::auto_ptr<edm::TriggerResults> miniTriggerCollection(new edm::TriggerResults);
284 
285  std::auto_ptr<double> miniRhoCollection(new double);
286  std::auto_ptr<std::vector<Bool_t> > miniLoosePhoton(new std::vector<Bool_t>());
287  std::auto_ptr<std::vector<Bool_t> > miniTightPhoton(new std::vector<Bool_t>());
288 
289 
290  // See if this event is useful
291  bool accept = select(photon, pfjets);
292  if (accept) {
293  nSelect_++;
294 
295  //Copy from standard place
296  for(reco::PFJetCollection::const_iterator pfjetItr=pfjets.begin();
297  pfjetItr!=pfjets.end(); pfjetItr++) {
298  miniPFjetCollection->push_back(*pfjetItr);
299  }
300 
301  for(reco::PhotonCollection::const_iterator phoItr=photon.begin();
302  phoItr!=photon.end(); phoItr++) {
303  miniPhotonCollection->push_back(*phoItr);
304  }
305 
306  for(reco::PFCandidateCollection::const_iterator pfcItr=pfcand.begin();
307  pfcItr!=pfcand.end(); pfcItr++) {
308  miniPFCandCollection->push_back(*pfcItr);
309  }
310 
311  for(reco::VertexCollection::const_iterator vtxItr=vtx.begin();
312  vtxItr!=vtx.end(); vtxItr++) {
313  miniVtxCollection->push_back(*vtxItr);
314  }
315 
316  for(reco::PFMETCollection::const_iterator pfmetItr=pfmet.begin();
317  pfmetItr!=pfmet.end(); pfmetItr++) {
318  miniPFMETCollection->push_back(*pfmetItr);
319  }
320 
321  for(edm::SortedCollection<HBHERecHit,edm::StrictWeakOrdering<HBHERecHit> >::const_iterator hbheItr=Hithbhe.begin();
322  hbheItr!=Hithbhe.end(); hbheItr++) {
323  miniHBHECollection->push_back(*hbheItr);
324  }
325 
326  for(edm::SortedCollection<HORecHit,edm::StrictWeakOrdering<HORecHit> >::const_iterator hoItr=Hitho.begin();
327  hoItr!=Hitho.end(); hoItr++) {
328  miniHOCollection->push_back(*hoItr);
329  }
330 
331  for(edm::SortedCollection<HFRecHit,edm::StrictWeakOrdering<HFRecHit> >::const_iterator hfItr=Hithf.begin();
332  hfItr!=Hithf.end(); hfItr++) {
333  miniHFCollection->push_back(*hfItr);
334  }
335 
336  for(reco::GsfElectronCollection::const_iterator gsfItr=gsfele.begin();
337  gsfItr!=gsfele.end(); gsfItr++) {
338  miniGSFeleCollection->push_back(*gsfItr);
339  }
340 
341  for(reco::ConversionCollection::const_iterator convItr=conv.begin();
342  convItr!=conv.end(); convItr++) {
343  miniConversionCollection->push_back(*convItr);
344  }
345 
346  *miniTriggerCollection = trigres;
347  *miniRhoCollection = rho_val;
348 
349  edm::Handle<edm::ValueMap<Bool_t> > loosePhotonQual;
350  iEvent.getByToken(tok_loosePhoton_, loosePhotonQual);
351  edm::Handle<edm::ValueMap<Bool_t> > tightPhotonQual;
352  iEvent.getByToken(tok_tightPhoton_, tightPhotonQual);
353  if (loosePhotonQual.isValid() && tightPhotonQual.isValid()) {
354  miniLoosePhoton->reserve(miniPhotonCollection->size());
355  miniTightPhoton->reserve(miniPhotonCollection->size());
356  for (int iPho=0; iPho<int(miniPhotonCollection->size()); ++iPho) {
357  edm::Ref<reco::PhotonCollection> photonRef(phoHandle,iPho);
358  if (!photonRef) {
359  std::cout << "failed ref" << std::endl;
360  miniLoosePhoton->push_back(-1);
361  miniTightPhoton->push_back(-1);
362  }
363  else {
364  miniLoosePhoton->push_back((*loosePhotonQual)[photonRef]);
365  miniTightPhoton->push_back((*tightPhotonQual)[photonRef]);
366  }
367  }
368  }
369  }
370 
371  //Put them in the event
372  iEvent.put( miniPhotonCollection, labelPhoton_.encode());
373  iEvent.put( miniPFjetCollection, labelPFJet_.encode());
374  iEvent.put( miniHBHECollection, labelHBHE_.encode());
375  iEvent.put( miniHFCollection, labelHF_.encode());
376  iEvent.put( miniHOCollection, labelHO_.encode());
377  iEvent.put( miniTriggerCollection, labelTrigger_.encode());
378  iEvent.put( miniPFCandCollection, labelPFCandidate_.encode());
379  iEvent.put( miniVtxCollection, labelVertex_.encode());
380  iEvent.put( miniPFMETCollection, labelPFMET_.encode());
381  iEvent.put( miniGSFeleCollection, labelGsfEle_.encode());
382  iEvent.put( miniRhoCollection, labelRho_.encode());
383  iEvent.put( miniConversionCollection, labelConv_.encode());
384  iEvent.put( miniBeamSpotCollection, labelBeamSpot_.encode());
385  iEvent.put( miniLoosePhoton, labelLoosePhot_.encode());
386  iEvent.put( miniTightPhoton, labelTightPhot_.encode());
387 
388  return;
389 
390 }
bool select(const reco::PhotonCollection &, const reco::PFJetCollection &)
edm::EDGetTokenT< edm::SortedCollection< HBHERecHit, edm::StrictWeakOrdering< HBHERecHit > > > tok_HBHE_
static HepMC::IO_HEPEVT conv
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
std::vector< Vertex > VertexCollection
collection of Vertex objects
Definition: VertexFwd.h:9
edm::EDGetTokenT< edm::ValueMap< Bool_t > > tok_tightPhoton_
edm::EDGetTokenT< reco::BeamSpot > tok_BS_
bool accept(const edm::Event &event, const edm::TriggerResults &triggerTable, const std::string &triggerPath)
Definition: TopDQMHelpers.h:30
std::vector< GsfElectron > GsfElectronCollection
collection of GsfElectron objects
std::string encode() const
Definition: InputTag.cc:164
std::vector< Conversion > ConversionCollection
collectin of Conversion objects
Definition: ConversionFwd.h:9
edm::EDGetTokenT< edm::SortedCollection< HORecHit, edm::StrictWeakOrdering< HORecHit > > > tok_HO_
double dydz() const
dydz slope
Definition: BeamSpot.h:84
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< edm::SortedCollection< HFRecHit, edm::StrictWeakOrdering< HFRecHit > > > tok_HF_
edm::EDGetTokenT< reco::VertexCollection > tok_Vertex_
double BeamWidthX() const
beam width X
Definition: BeamSpot.h:86
bool isValid() const
Definition: HandleBase.h:75
double dxdz() const
dxdz slope
Definition: BeamSpot.h:82
const_iterator end() const
std::vector< reco::PFCandidate > PFCandidateCollection
collection of PFCandidates
edm::EDGetTokenT< double > tok_Rho_
T const * product() const
Definition: Handle.h:81
edm::EDGetTokenT< reco::PFJetCollection > tok_PFJet_
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
double sigmaZ() const
sigma z
Definition: BeamSpot.h:80
edm::EDGetTokenT< reco::PFMETCollection > tok_PFMET_
return(e1-e2)*(e1-e2)+dp *dp
edm::EDGetTokenT< reco::ConversionCollection > tok_Conv_
double covariance(int i, int j) const
(i,j)-th element of error matrix
Definition: BeamSpot.h:112
edm::EDGetTokenT< edm::TriggerResults > tok_TrigRes_
std::vector< PFJet > PFJetCollection
collection of PFJet objects
std::vector< reco::PFMET > PFMETCollection
collection of PFMET objects
edm::EDGetTokenT< reco::GsfElectronCollection > tok_GsfElec_
tuple cout
Definition: gather_cfg.py:145
const Point & position() const
position
Definition: BeamSpot.h:62
edm::EDGetTokenT< reco::PhotonCollection > tok_Photon_
edm::EDGetTokenT< edm::ValueMap< Bool_t > > tok_loosePhoton_
edm::EDGetTokenT< reco::PFCandidateCollection > tok_PFCand_
const_iterator begin() const
BeamType type() const
return beam type
Definition: BeamSpot.h:129
bool AlCaGammaJetProducer::select ( const reco::PhotonCollection ph,
const reco::PFJetCollection jt 
)
private

Definition at line 138 of file AlCaGammaJetProducer.cc.

References minPtJet_, minPtPhoton_, and convertSQLiteXML::ok.

Referenced by Vispa.Views.LineDecayView.LineDecayContainer::createObject(), Vispa.Plugins.Browser.BrowserTabController.BrowserTabController::find(), Vispa.Views.LineDecayView.LineDecayContainer::mousePressEvent(), Vispa.Gui.PortConnection.PointToPointConnection::mousePressEvent(), Vispa.Gui.VispaWidget.VispaWidget::mousePressEvent(), produce(), and Vispa.Views.AbstractView.AbstractView::restoreSelection().

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

Member Data Documentation

edm::InputTag AlCaGammaJetProducer::labelBeamSpot_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelConv_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelGsfEle_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelHBHE_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelHF_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelHO_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelLoosePhot_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelPFCandidate_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelPFJet_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelPFMET_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelPhoton_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelRho_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelTightPhot_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelTrigger_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

edm::InputTag AlCaGammaJetProducer::labelVertex_
private

Definition at line 54 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

double AlCaGammaJetProducer::minPtJet_
private

Definition at line 55 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and select().

double AlCaGammaJetProducer::minPtPhoton_
private

Definition at line 55 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and select().

int AlCaGammaJetProducer::nAll_
private

Definition at line 56 of file AlCaGammaJetProducer.cc.

Referenced by endJob(), and produce().

int AlCaGammaJetProducer::nSelect_
private

Definition at line 56 of file AlCaGammaJetProducer.cc.

Referenced by endJob(), and produce().

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

Definition at line 70 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 69 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 67 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

Definition at line 60 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

Definition at line 61 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

Definition at line 62 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 71 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 64 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 59 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 66 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 58 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 68 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 72 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 63 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().

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

Definition at line 65 of file AlCaGammaJetProducer.cc.

Referenced by AlCaGammaJetProducer(), and produce().