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
ESListOfFEDSProducer Class Reference

#include <ESListOfFEDSProducer.h>

Inheritance diagram for ESListOfFEDSProducer:
edm::EDProducer edm::ProducerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob (void)
 
void Egamma (edm::Event &e, const edm::EventSetup &es, std::vector< int > &done, std::vector< int > &FEDs)
 
void endJob (void)
 
 ESListOfFEDSProducer (const edm::ParameterSet &pset)
 
void Jets (edm::Event &e, const edm::EventSetup &es, std::vector< int > &done, std::vector< int > &FEDs)
 
void Muon (edm::Event &e, const edm::EventSetup &es, std::vector< int > &done, std::vector< int > &FEDs)
 
void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~ESListOfFEDSProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
boost::function< void(const
BranchDescription &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 

Private Member Functions

std::vector< int > ListOfFEDS (double etaLow, double etaHigh, double phiLow, double phiHigh, double etamargin, double phimargin)
 

Private Attributes

edm::InputTag CentralSource_
 
bool debug_
 
bool EGamma_
 
bool EMdoIsolated_
 
bool EMdoNonIsolated_
 
edm::InputTag EMl1TagIsolated_
 
edm::InputTag EMl1TagNonIsolated_
 
double EMregionEtaMargin_
 
double EMregionPhiMargin_
 
bool first_
 
edm::InputTag ForwardSource_
 
bool Jets_
 
bool JETSdoCentral_
 
bool JETSdoForward_
 
bool JETSdoTau_
 
double JETSregionEtaMargin_
 
double JETSregionPhiMargin_
 
bool Muon_
 
edm::InputTag MuonSource_
 
double MUregionEtaMargin_
 
double MUregionPhiMargin_
 
std::string OutputLabel_
 
edm::InputTag Pi0ListToIgnore_
 
double Ptmin_iso_
 
double Ptmin_jets_
 
double Ptmin_muon_
 
double Ptmin_noniso_
 
edm::InputTag TauSource_
 
ESElectronicsMapperTheESMapping
 ESElectronicsMapping* TheESMapping;. More...
 
EcalElectronicsMappingTheMapping
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- 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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- Protected Member Functions inherited from edm::ProducerBase
template<class TProducer , class TMethod >
void callWhenNewProductsRegistered (TProducer *iProd, TMethod iMethod)
 

Detailed Description

Definition at line 20 of file ESListOfFEDSProducer.h.

Constructor & Destructor Documentation

ESListOfFEDSProducer::ESListOfFEDSProducer ( const edm::ParameterSet pset)

Definition at line 45 of file ESListOfFEDSProducer.cc.

References edm::hlt::Exception, and edm::ParameterSet::getUntrackedParameter().

45  {
46 
47  debug_ = pset.getUntrackedParameter<bool>("debug");
48 
49 
50  // Pi0ListToIgnore_ = pset.getParameter<edm::InputTag>("Pi0ListToIgnore");
51 
52  EGamma_ = pset.getUntrackedParameter<bool>("EGamma",false);
53  Muon_ = pset.getUntrackedParameter<bool>("Muon",false);
54  Jets_ = pset.getUntrackedParameter<bool>("Jets",false);
55 
56  if (EGamma_ && Muon_) {
57  throw cms::Exception("ESListOfFEDSProducer") <<
58  " Wrong configuration : EGamma and Muon should not be true at the same time." ;
59  }
60 
61 
62  if (EGamma_) {
63 
64  EMl1TagIsolated_ = pset.getUntrackedParameter<edm::InputTag>("EM_l1TagIsolated");
65  EMl1TagNonIsolated_ = pset.getUntrackedParameter<edm::InputTag>("EM_l1TagNonIsolated");
66  EMdoIsolated_ = pset.getUntrackedParameter<bool>("EM_doIsolated",true);
67  EMdoNonIsolated_ = pset.getUntrackedParameter<bool>("EM_doNonIsolated",true);
68  EMregionEtaMargin_ = pset.getUntrackedParameter<double>("EM_regionEtaMargin",0.25);
69  EMregionPhiMargin_ = pset.getUntrackedParameter<double>("EM_regionPhiMargin",0.40);
70  Ptmin_iso_ = pset.getUntrackedParameter<double>("Ptmin_iso",0.);
71  Ptmin_noniso_ = pset.getUntrackedParameter<double>("Ptmin_noniso",0.);
72  }
73 
74  if (Muon_) {
75  MUregionEtaMargin_ = pset.getUntrackedParameter<double>("MU_regionEtaMargin",1.0);
76  MUregionPhiMargin_ = pset.getUntrackedParameter<double>("MU_regionPhiMargin",1.0);
77  Ptmin_muon_ = pset.getUntrackedParameter<double>("Ptmin_muon",0.);
78  MuonSource_ = pset.getUntrackedParameter<edm::InputTag>("MuonSource");
79  }
80 
81  if (Jets_) {
82  JETSregionEtaMargin_ = pset.getUntrackedParameter<double>("JETS_regionEtaMargin",1.0);
83  JETSregionPhiMargin_ = pset.getUntrackedParameter<double>("JETS_regionPhiMargin",1.0);
84  Ptmin_jets_ = pset.getUntrackedParameter<double>("Ptmin_jets",0.);
85  CentralSource_ = pset.getUntrackedParameter<edm::InputTag>("CentralSource");
86  ForwardSource_ = pset.getUntrackedParameter<edm::InputTag>("ForwardSource");
87  TauSource_ = pset.getUntrackedParameter<edm::InputTag>("TauSource");
88  JETSdoCentral_ = pset.getUntrackedParameter<bool>("JETS_doCentral",true);
89  JETSdoForward_ = pset.getUntrackedParameter<bool>("JETS_doForward",true);
90  JETSdoTau_ = pset.getUntrackedParameter<bool>("JETS_doTau",true);
91  }
92 
93 
94  OutputLabel_ = pset.getUntrackedParameter<std::string>("OutputLabel");
95 
97  first_ = true;
98 
100 
101  produces<ESListOfFEDS>(OutputLabel_);
102 
103 
104 
105 }
T getUntrackedParameter(std::string const &, T const &) const
ESElectronicsMapper * TheESMapping
ESElectronicsMapping* TheESMapping;.
edm::InputTag EMl1TagIsolated_
EcalElectronicsMapping * TheMapping
edm::InputTag EMl1TagNonIsolated_
ESListOfFEDSProducer::~ESListOfFEDSProducer ( )
virtual

Definition at line 109 of file ESListOfFEDSProducer.cc.

109  {
110  delete TheMapping;
111 }
EcalElectronicsMapping * TheMapping

Member Function Documentation

void ESListOfFEDSProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 114 of file ESListOfFEDSProducer.cc.

114  {
115 }
void ESListOfFEDSProducer::Egamma ( edm::Event e,
const edm::EventSetup es,
std::vector< int > &  done,
std::vector< int > &  FEDs 
)

Definition at line 213 of file ESListOfFEDSProducer.cc.

References gather_cfg::cout, spr::find(), edm::EventSetup::get(), edm::Event::getByLabel(), and i.

213  {
214 
215  // std::vector<int> FEDs;
216 
217  if (debug_) std::cout << std::endl << std::endl << " enter in EcalListOfFEDSProducer::Egamma" << std::endl;
218 
219  //Get the L1 EM Particle Collection
220  //Get the L1 EM Particle Collection
222  if(EMdoIsolated_)
223  e.getByLabel(EMl1TagIsolated_, emIsolColl);
224  //Get the L1 EM Particle Collection
226  if (EMdoNonIsolated_)
227  e.getByLabel(EMl1TagNonIsolated_, emNonIsolColl);
228 
229  // Get the CaloGeometry
230  edm::ESHandle<L1CaloGeometry> l1CaloGeom ;
231  es.get<L1CaloGeometryRecord>().get(l1CaloGeom) ;
232 
233  if(EMdoIsolated_) {
234 
235  for( l1extra::L1EmParticleCollection::const_iterator emItr = emIsolColl->begin();
236  emItr != emIsolColl->end() ;++emItr ){
237 
238  float pt = emItr -> pt();
239  if (pt < Ptmin_iso_ ) continue;
240  if (debug_) std::cout << " Here is an L1 isoEM candidate of pt " << pt << std::endl;
241  // Access the GCT hardware object corresponding to the L1Extra EM object.
242  int etaIndex = emItr->gctEmCand()->etaIndex() ;
243  int phiIndex = emItr->gctEmCand()->phiIndex() ;
244  // Use the L1CaloGeometry to find the eta, phi bin boundaries.
245  double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
246  double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
247  double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
248  double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
249 
250  std::vector<int> feds = ListOfFEDS(etaLow, etaHigh, phiLow, phiHigh, EMregionEtaMargin_, EMregionPhiMargin_);
251  for (int i=0; i < (int)feds.size(); i++) {
252  if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
253  std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
254  }
255 
256  } // end loop on L1EmParticleCollection
257 
258  } // endif doIsolated_
259 
260 
261  if (EMdoNonIsolated_) {
262 
263  for( l1extra::L1EmParticleCollection::const_iterator emItr = emNonIsolColl->begin();
264  emItr != emNonIsolColl->end() ;++emItr ){
265 
266  float pt = emItr -> pt();
267  if (debug_) std::cout << " Here is an L1 nonisoEM candidate of pt " << pt << std::endl;
268  if (pt < Ptmin_noniso_ ) continue;
269  // Access the GCT hardware object corresponding to the L1Extra EM object.
270  int etaIndex = emItr->gctEmCand()->etaIndex() ;
271  int phiIndex = emItr->gctEmCand()->phiIndex() ;
272  // std::cout << " etaIndex phiIndex " << etaIndex << " " << phiIndex << std::endl;
273  // Use the L1CaloGeometry to find the eta, phi bin boundaries.
274  double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
275  double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
276  double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
277  double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
278 
279  std::vector<int> feds = ListOfFEDS(etaLow, etaHigh, phiLow, phiHigh, EMregionEtaMargin_, EMregionPhiMargin_);
280  for (int i=0; i < (int)feds.size(); i++) {
281  if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
282  std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
283 
284  }
285 
286  } // end loop on L1EmParticleCollection
287  }
288 
289  // std::cout << "end of get list of feds " << std::endl;
290 
291  if (debug_) {
292  std::cout << std::endl;
293  for (int i=0; i < (int)FEDs.size(); i++) {
294  std::cout << "Egamma: unpack FED " << FEDs[i] << std::endl;
295  }
296  std::cout << "Number of FEDS is " << FEDs.size() << std::endl;
297  }
298 
299  // return FEDs;
300 
301 }
int i
Definition: DBlmapReader.cc:9
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
edm::InputTag EMl1TagIsolated_
std::vector< int > ListOfFEDS(double etaLow, double etaHigh, double phiLow, double phiHigh, double etamargin, double phimargin)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
const T & get() const
Definition: EventSetup.h:55
tuple cout
Definition: gather_cfg.py:121
edm::InputTag EMl1TagNonIsolated_
void ESListOfFEDSProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 117 of file ESListOfFEDSProducer.cc.

117  {
118 }
void ESListOfFEDSProducer::Jets ( edm::Event e,
const edm::EventSetup es,
std::vector< int > &  done,
std::vector< int > &  FEDs 
)

Definition at line 352 of file ESListOfFEDSProducer.cc.

References gather_cfg::cout, epsilon, eta(), spr::find(), edm::Event::getByLabel(), i, and phi.

352  {
353 
354  // std::vector<int> FEDs;
355 
356  if (debug_) std::cout << std::endl << std::endl << " enter in EcalListOfFEDSProducer::Jets" << std::endl;
357  double epsilon = 0.01;
358 
359  // Get the CaloGeometry
360  // edm::ESHandle<L1CaloGeometry> l1CaloGeom ;
361  // es.get<L1CaloGeometryRecord>().get(l1CaloGeom) ;
362 
363  if (JETSdoCentral_) {
364 
366  e.getByLabel(CentralSource_,jetColl);
367 
368  for (L1JetParticleCollection::const_iterator it=jetColl->begin(); it != jetColl->end(); it++) {
369 
370  double pt = it -> pt();
371  double eta = it -> eta();
372  double phi = it -> phi();
373 
374  if (debug_) std::cout << " here is a L1 CentralJet Seed with (eta,phi) = " <<
375  eta << " " << phi << " and pt " << pt << std::endl;
376  // int etaIndex = it->gctJetCand()->etaIndex() ;
377  // int phiIndex = it->gctJetCand()->phiIndex() ;
378  // double etaLow = l1CaloGeom->etaBinLowEdge( etaIndex ) ;
379  // double etaHigh = l1CaloGeom->etaBinHighEdge( etaIndex ) ;
380  // double phiLow = l1CaloGeom->emJetPhiBinLowEdge( phiIndex ) ;
381  // double phiHigh = l1CaloGeom->emJetPhiBinHighEdge( phiIndex ) ;
382  // if (debug_) std::cout << " etaLow .. " << etaLow << " " << etaHigh << " " << phiLow << " " << phiHigh << std::endl;
383 
384  if (pt < Ptmin_jets_ ) continue;
385 
386  std::vector<int> feds = ListOfFEDS(eta, eta, phi-epsilon, phi+epsilon, JETSregionEtaMargin_, JETSregionPhiMargin_);
387 
388  for (int i=0; i < (int)feds.size(); i++) {
389  if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
390  std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
391  }
392  }
393  }
394 
395  if (JETSdoForward_) {
396 
398  e.getByLabel(ForwardSource_,jetColl);
399 
400  for (L1JetParticleCollection::const_iterator it=jetColl->begin(); it != jetColl->end(); it++) {
401 
402  double pt = it -> pt();
403  double eta = it -> eta();
404  double phi = it -> phi();
405 
406  if (debug_) std::cout << " here is a L1 ForwardJet Seed with (eta,phi) = " <<
407  eta << " " << phi << " and pt " << pt << std::endl;
408  if (pt < Ptmin_jets_ ) continue;
409 
410  std::vector<int> feds = ListOfFEDS(eta, eta, phi-epsilon, phi+epsilon, JETSregionEtaMargin_, JETSregionPhiMargin_);
411 
412  for (int i=0; i < (int)feds.size(); i++) {
413  if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
414  std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
415  }
416  }
417  }
418 
419  if (JETSdoTau_) {
420 
422  e.getByLabel(TauSource_,jetColl);
423 
424  for (L1JetParticleCollection::const_iterator it=jetColl->begin(); it != jetColl->end(); it++) {
425 
426  double pt = it -> pt();
427  double eta = it -> eta();
428  double phi = it -> phi();
429 
430  if (debug_) std::cout << " here is a L1 TauJet Seed with (eta,phi) = " <<
431  eta << " " << phi << " and pt " << pt << std::endl;
432  if (pt < Ptmin_jets_ ) continue;
433 
434  std::vector<int> feds = ListOfFEDS(eta, eta, phi-epsilon, phi+epsilon, JETSregionEtaMargin_, JETSregionPhiMargin_);
435 
436  for (int i=0; i < (int)feds.size(); i++) {
437  if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
438  std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
439  }
440  }
441  }
442 
443 
444 
445  if (debug_) {
446  std::cout << std::endl;
447  for (int i=0; i < (int)FEDs.size(); i++) {
448  std::cout << "Jets: unpack FED " << FEDs[i] << std::endl;
449  }
450  std::cout << "Number of FEDS is " << FEDs.size() << std::endl;
451  }
452 
453 
454  // return FEDs;
455 
456 }
int i
Definition: DBlmapReader.cc:9
T eta() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< int > ListOfFEDS(double etaLow, double etaHigh, double phiLow, double phiHigh, double etamargin, double phimargin)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple cout
Definition: gather_cfg.py:121
const double epsilon
Definition: DDAxes.h:10
std::vector< int > ESListOfFEDSProducer::ListOfFEDS ( double  etaLow,
double  etaHigh,
double  phiLow,
double  phiHigh,
double  etamargin,
double  phimargin 
)
private

Definition at line 459 of file ESListOfFEDSProducer.cc.

References cond::ecalcond::all, gather_cfg::cout, createTree::dd, reco_application_2006h2rawdata_ecalLocalReco_cfg::FEDs, and Geom::pi().

461 {
462 
463  std::vector<int> FEDs;
464 
465  if (phimargin > Geom::pi()) phimargin = Geom::pi() ;
466 
467 
468  if (debug_) std::cout << " etaLow etaHigh phiLow phiHigh " << etaLow << " " <<
469  etaHigh << " " << phiLow << " " << phiHigh << std::endl;
470 
471  etaLow -= etamargin;
472  etaHigh += etamargin;
473  double phiMinus = phiLow - phimargin;
474  double phiPlus = phiHigh + phimargin;
475 
476  bool all = false;
477  double dd = fabs(phiPlus-phiMinus);
478  if (debug_) std::cout << " dd = " << dd << std::endl;
479  if (dd > 2.*Geom::pi() ) all = true;
480 
481  while (phiPlus > Geom::pi()) { phiPlus -= 2.*Geom::pi() ; }
482  while (phiMinus < 0) { phiMinus += 2.*Geom::pi() ; }
483  if ( phiMinus > Geom::pi()) phiMinus -= 2.*Geom::pi() ;
484 
485  double dphi = phiPlus - phiMinus;
486  if (dphi < 0) dphi += 2.*Geom::pi() ;
487  if (debug_) std::cout << "dphi = " << dphi << std::endl;
488  if (dphi > Geom::pi()) {
489  int fed_low1 = TheMapping -> GetFED(etaLow,phiMinus*180./Geom::pi());
490  int fed_low2 = TheMapping -> GetFED(etaLow,phiPlus*180./Geom::pi());
491  if (debug_) std::cout << "fed_low1 fed_low2 " << fed_low1 << " " << fed_low2 << std::endl;
492  if (fed_low1 == fed_low2) all = true;
493  int fed_hi1 = TheMapping -> GetFED(etaHigh,phiMinus*180./Geom::pi());
494  int fed_hi2 = TheMapping -> GetFED(etaHigh,phiPlus*180./Geom::pi());
495  if (debug_) std::cout << "fed_hi1 fed_hi2 " << fed_hi1 << " " << fed_hi2 << std::endl;
496  if (fed_hi1 == fed_hi2) all = true;
497  }
498 
499 
500  if (all) {
501  if (debug_) std::cout << " unpack everything in phi ! " << std::endl;
502  phiMinus = -20 * Geom::pi() / 180.; // -20 deg
503  phiPlus = -40 * Geom::pi() / 180.; // -20 deg
504  }
505 
506  if (debug_) std::cout << " with margins : " << etaLow << " " << etaHigh << " " <<
507  phiMinus << " " << phiPlus << std::endl;
508 
509 
510  const EcalEtaPhiRegion ecalregion(etaLow,etaHigh,phiMinus,phiPlus);
511 
512  FEDs = TheMapping -> GetListofFEDs(ecalregion);
513 
514 /*
515  if (debug_) {
516  int nn = (int)FEDs.size();
517  for (int ii=0; ii < nn; ii++) {
518  std::cout << "unpack fed " << FEDs[ii] << std::endl;
519  }
520  }
521 */
522 
523  return FEDs;
524 
525 }
EcalElectronicsMapping * TheMapping
double pi()
Definition: Pi.h:31
tuple cout
Definition: gather_cfg.py:121
void ESListOfFEDSProducer::Muon ( edm::Event e,
const edm::EventSetup es,
std::vector< int > &  done,
std::vector< int > &  FEDs 
)

Definition at line 305 of file ESListOfFEDSProducer.cc.

References gather_cfg::cout, epsilon, eta(), spr::find(), edm::Event::getByLabel(), i, and phi.

305  {
306 
307  // std::vector<int> FEDs;
308 
309  if (debug_) std::cout << std::endl << std::endl << " enter in EcalListOfFEDSProducer::Muon" << std::endl;
310 
312  e.getByLabel(MuonSource_, muColl);
313 
314 
315  double epsilon = 0.01;
316 
317  for (L1MuonParticleCollection::const_iterator it=muColl->begin(); it != muColl->end(); it++) {
318 
319  const L1MuGMTExtendedCand muonCand = (*it).gmtMuonCand();
320  double pt = (*it).pt();
321  double eta = (*it).eta();
322  double phi = (*it).phi();
323 
324  if (debug_) std::cout << " here is a L1 muon Seed with (eta,phi) = " <<
325  eta << " " << phi << " and pt " << pt << std::endl;
326  if (pt < Ptmin_muon_ ) continue;
327 
328  std::vector<int> feds = ListOfFEDS(eta, eta, phi-epsilon, phi+epsilon, MUregionEtaMargin_, MUregionPhiMargin_);
329 
330  for (int i=0; i < (int)feds.size(); i++) {
331  if ( std::find(FEDs.begin(), FEDs.end(), feds[i]) == FEDs.end() &&
332  std::find(done.begin(), done.end(), feds[i]) == done.end() ) FEDs.push_back(feds[i]);
333  }
334  }
335 
336  if (debug_) {
337  std::cout << std::endl;
338  for (int i=0; i < (int)FEDs.size(); i++) {
339  std::cout << "Muons: unpack FED " << FEDs[i] << std::endl;
340  }
341  std::cout << "Number of FEDS is " << FEDs.size() << std::endl;
342  }
343 
344 
345  // return FEDs;
346 
347 }
int i
Definition: DBlmapReader.cc:9
T eta() const
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< int > ListOfFEDS(double etaLow, double etaHigh, double phiLow, double phiHigh, double etamargin, double phimargin)
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:356
tuple cout
Definition: gather_cfg.py:121
const double epsilon
Definition: DDAxes.h:10
void ESListOfFEDSProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

commented out at this moment, for muon and jets.

get ES List of FEDs ,given the ecal FED list

now push list of ES FEDs into event.

Implements edm::EDProducer.

Definition at line 120 of file ESListOfFEDSProducer.cc.

References gather_cfg::cout, run_regression::done, edm::EventID::event(), spr::find(), edm::EventSetup::get(), edm::Event::getManyByType(), i, edm::EventBase::id(), j, FEDNumbering::MINECALFEDID, n, edm::ESHandle< class >::product(), edm::Event::put(), and edm::EventID::run().

120  {
121 
122  if (first_) {
124  iSetup.get< EcalMappingRcd >().get(ecalmapping);
125  const EcalElectronicsMapping* TheMapping_ = ecalmapping.product();
126  *TheMapping = *TheMapping_;
127  first_ = false;
128 
129  }
130 
131  std::auto_ptr<ESListOfFEDS> productAddress(new ESListOfFEDS);
132 
133  std::vector<int> feds; // the list of Ecal FEDS produced
134 
135 
137  std::vector<int> Done;
138  if (EGamma_) {
139  // feds = Egamma(e, iSetup, Done);
140  Egamma(e, iSetup, Done, feds);
141  }
142 
143  if (Muon_) {
145  // feds = Muon(e, iSetup, Done);
146  // Muon(e, iSetup, Done, feds);
147  }
148 
149  if (Jets_) {
150  // feds = Jets(e, iSetup, Done);
151  //Jets(e, iSetup, Done, feds);
152  }
153 
154  if ( !EGamma_ && !Muon_ && ! Jets_) {
155  for (int i=1; i <= 54; i++) {
156  if ( std::find(Done.begin(), Done.end(), i) == Done.end())
157  feds.push_back(i);
158  }
159  }
160 
161 
162  int nf = (int)feds.size();
163  for (int i=0; i <nf; i++) {
164  feds[i] += FEDNumbering::MINECALFEDID;
165  if (debug_) std::cout << "Will unpack FED " << feds[i] << std::endl;
166  }
167 
168  if (debug_ && nf < 1 )
169  std::cout << " Warning : no ECAL FED to unpack for Run " << e.id().run() << " Event " << e.id().event() << std::endl;
170 
172  std::vector<int> es_feds = TheESMapping->GetListofFEDs(feds);
173 
174  //check ES List if some of them already done
175  std::vector< edm::Handle<ESListOfFEDS> > esFEDs_Done;
176  e.getManyByType(esFEDs_Done);
177  unsigned int esnDone = esFEDs_Done.size();
178 
179  if(debug_){
180  std::cout<<int(es_feds.size())<<" feds requested, and ESunpacking have already been done "<<esnDone<<" times."<<std::endl;
181  }
182 
183  for(int i=0; i<int(esFEDs_Done.size());i++){
184  std::vector<int> done = esFEDs_Done[i]-> GetList();
185  for(int n=0; n<int(done.size());n++){
186  for(int j=0; j<int(es_feds.size());j++){
187  std::vector<int>::iterator it = find(es_feds.begin(),es_feds.end(),done[n]);
188  if( it != es_feds.end()){
189  es_feds.erase(it);
190  j--;
191  }
192  }
193  }
194  }
195 
196  if (debug_ ){
197  std::cout<<"ESListofFEDSProducer: new ES_list will be put into event: total "<<int(es_feds.size())<<std::endl;
198  for(int j=0; j<int(es_feds.size());j++){
199  std::cout<<es_feds[j]<<" ";
200  }
201  std::cout<<std::endl;
202  }
203 
204 
206  productAddress.get() -> SetList(es_feds);
207  e.put(productAddress,OutputLabel_);
208 
209 }
RunNumber_t run() const
Definition: EventID.h:42
void getManyByType(std::vector< Handle< PROD > > &results) const
Definition: Event.h:408
EventNumber_t event() const
Definition: EventID.h:44
int i
Definition: DBlmapReader.cc:9
ESElectronicsMapper * TheESMapping
ESElectronicsMapping* TheESMapping;.
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
int j
Definition: DBlmapReader.cc:9
std::vector< int > GetListofFEDs(const std::vector< int > eeFEDs) const
void Egamma(edm::Event &e, const edm::EventSetup &es, std::vector< int > &done, std::vector< int > &FEDs)
T const * product() const
Definition: ESHandle.h:62
EcalElectronicsMapping * TheMapping
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

edm::InputTag ESListOfFEDSProducer::CentralSource_
private

Definition at line 60 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::debug_
private

Definition at line 71 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::EGamma_
private

Definition at line 37 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::EMdoIsolated_
private

Definition at line 40 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::EMdoNonIsolated_
private

Definition at line 41 of file ESListOfFEDSProducer.h.

edm::InputTag ESListOfFEDSProducer::EMl1TagIsolated_
private

Definition at line 38 of file ESListOfFEDSProducer.h.

edm::InputTag ESListOfFEDSProducer::EMl1TagNonIsolated_
private

Definition at line 39 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::EMregionEtaMargin_
private

Definition at line 42 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::EMregionPhiMargin_
private

Definition at line 43 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::first_
private

Definition at line 70 of file ESListOfFEDSProducer.h.

edm::InputTag ESListOfFEDSProducer::ForwardSource_
private

Definition at line 61 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::Jets_
private

Definition at line 53 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::JETSdoCentral_
private

Definition at line 54 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::JETSdoForward_
private

Definition at line 55 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::JETSdoTau_
private

Definition at line 56 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::JETSregionEtaMargin_
private

Definition at line 57 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::JETSregionPhiMargin_
private

Definition at line 58 of file ESListOfFEDSProducer.h.

bool ESListOfFEDSProducer::Muon_
private

Definition at line 47 of file ESListOfFEDSProducer.h.

edm::InputTag ESListOfFEDSProducer::MuonSource_
private

Definition at line 51 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::MUregionEtaMargin_
private

Definition at line 48 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::MUregionPhiMargin_
private

Definition at line 49 of file ESListOfFEDSProducer.h.

std::string ESListOfFEDSProducer::OutputLabel_
private

Definition at line 64 of file ESListOfFEDSProducer.h.

edm::InputTag ESListOfFEDSProducer::Pi0ListToIgnore_
private

Definition at line 36 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::Ptmin_iso_
private

Definition at line 44 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::Ptmin_jets_
private

Definition at line 59 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::Ptmin_muon_
private

Definition at line 50 of file ESListOfFEDSProducer.h.

double ESListOfFEDSProducer::Ptmin_noniso_
private

Definition at line 45 of file ESListOfFEDSProducer.h.

edm::InputTag ESListOfFEDSProducer::TauSource_
private

Definition at line 62 of file ESListOfFEDSProducer.h.

ESElectronicsMapper* ESListOfFEDSProducer::TheESMapping
private

ESElectronicsMapping* TheESMapping;.

Definition at line 68 of file ESListOfFEDSProducer.h.

EcalElectronicsMapping* ESListOfFEDSProducer::TheMapping
private

Definition at line 65 of file ESListOfFEDSProducer.h.