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 Attributes
FastL1CaloSim Class Reference

#include <FastSimuluation/L1CaloTriggerProducer/src/FastL1CaloSim.cc>

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

Public Member Functions

 FastL1CaloSim (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
 ~FastL1CaloSim ()
 
- 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 Attributes

std::string m_AlgorithmSource
 
bool m_DoBitInfo
 
FastL1GlobalAlgom_FastL1GlobalAlgo
 

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

Description: Fast Simulation of the L1 Calo Trigger.

Implementation: <Notes on="" implementation>="">

Definition at line 39 of file FastL1CaloSim.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file FastL1CaloSim.cc.

References edm::ParameterSet::getParameter(), m_AlgorithmSource, m_DoBitInfo, and m_FastL1GlobalAlgo.

28 {
29  //register your products
30  /* old labels
31  produces<l1extra::L1EtMissParticle>("MET");
32  produces<l1extra::L1JetParticleCollection>("TauJets");
33  produces<l1extra::L1JetParticleCollection>("CenJets");
34  produces<l1extra::L1JetParticleCollection>("ForJets");
35  produces<l1extra::L1EmParticleCollection>("Egammas");
36  produces<l1extra::L1EmParticleCollection>("isoEgammas");
37  */
38 
39  //produces<l1extra::L1EtMissParticle>();
40  produces<l1extra::L1EtMissParticleCollection>("MET");
41  produces<l1extra::L1JetParticleCollection>("Tau");
42  produces<l1extra::L1JetParticleCollection>("Central");
43  produces<l1extra::L1JetParticleCollection>("Forward");
44  produces<l1extra::L1EmParticleCollection>("NonIsolated");
45  produces<l1extra::L1EmParticleCollection>("Isolated");
46  produces<l1extra::L1MuonParticleCollection>(); // muon is dummy for L1extraParticleMap!
47 
48  m_AlgorithmSource = iConfig.getParameter<std::string>("AlgorithmSource");
49 
50  // No BitInfos for release versions
51  m_DoBitInfo = iConfig.getParameter<bool>("DoBitInfo");
52  if (m_DoBitInfo)
53  produces<FastL1BitInfoCollection>("L1BitInfos");
54 
55  m_FastL1GlobalAlgo = new FastL1GlobalAlgo(iConfig);
56 }
T getParameter(std::string const &) const
std::string m_AlgorithmSource
Definition: FastL1CaloSim.h:51
FastL1GlobalAlgo * m_FastL1GlobalAlgo
Definition: FastL1CaloSim.h:48
FastL1CaloSim::~FastL1CaloSim ( )

Definition at line 58 of file FastL1CaloSim.cc.

References m_FastL1GlobalAlgo.

59 {
60  delete m_FastL1GlobalAlgo;
61 }
FastL1GlobalAlgo * m_FastL1GlobalAlgo
Definition: FastL1CaloSim.h:48

Member Function Documentation

void FastL1CaloSim::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDProducer.

Definition at line 70 of file FastL1CaloSim.cc.

References dtNoiseDBValidation_cfg::cerr, FastL1GlobalAlgo::FillBitInfos(), FastL1GlobalAlgo::FillEgammas(), FastL1GlobalAlgo::FillEgammasTP(), FastL1GlobalAlgo::FillJets(), FastL1GlobalAlgo::FillL1Regions(), FastL1GlobalAlgo::FillL1RegionsTP(), FastL1GlobalAlgo::FillMET(), FastL1GlobalAlgo::getBitInfos(), FastL1GlobalAlgo::getCenJets(), FastL1GlobalAlgo::getEgammas(), FastL1GlobalAlgo::getForJets(), FastL1GlobalAlgo::getisoEgammas(), FastL1GlobalAlgo::getMET(), FastL1GlobalAlgo::getTauJets(), i, m_AlgorithmSource, m_DoBitInfo, m_FastL1GlobalAlgo, min, and edm::Event::put().

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

71 {
72  //edm::LogInfo("FastL1CaloSim::produce()");
73 
74  if (m_AlgorithmSource == "RecHits") {
75  m_FastL1GlobalAlgo->FillL1Regions(iEvent, iSetup);
77  } else if (m_AlgorithmSource == "TrigPrims") {
78  m_FastL1GlobalAlgo->FillL1RegionsTP(iEvent,iSetup);
80  } else {
81  std::cerr<<"AlgorithmSource not valid: "<<m_AlgorithmSource<<std::endl;
82  return;
83  }
84  m_FastL1GlobalAlgo->FillMET(iEvent); // using CaloTowers
85  //m_FastL1GlobalAlgo->FillMET(); // using Regions
87 
88  if (m_DoBitInfo)
90 
91  //std::auto_ptr<l1extra::L1EtMissParticle> METResult(new l1extra::L1EtMissParticle);
92  std::auto_ptr<l1extra::L1EtMissParticleCollection> METResult(new l1extra::L1EtMissParticleCollection);
93  std::auto_ptr<l1extra::L1JetParticleCollection> TauJetResult(new l1extra::L1JetParticleCollection);
94  std::auto_ptr<l1extra::L1JetParticleCollection> CenJetResult(new l1extra::L1JetParticleCollection);
95  std::auto_ptr<l1extra::L1JetParticleCollection> ForJetResult(new l1extra::L1JetParticleCollection);
96  std::auto_ptr<l1extra::L1EmParticleCollection> EgammaResult(new l1extra::L1EmParticleCollection);
97  std::auto_ptr<l1extra::L1EmParticleCollection> isoEgammaResult(new l1extra::L1EmParticleCollection);
98  // muon is dummy!
99  std::auto_ptr<l1extra::L1MuonParticleCollection> muonDummy(new l1extra::L1MuonParticleCollection);
100  //
101  //*METResult = m_FastL1GlobalAlgo->getMET();
102  for (int i=0; i<(int)m_FastL1GlobalAlgo->getMET().size(); i++) {
103  METResult->push_back(m_FastL1GlobalAlgo->getMET().at(i));
104  }
105  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getTauJets().size()); i++) {
106  TauJetResult->push_back(m_FastL1GlobalAlgo->getTauJets().at(i));
107  }
108  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getCenJets().size()); i++) {
109  CenJetResult->push_back(m_FastL1GlobalAlgo->getCenJets().at(i));
110  }
111  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getForJets().size()); i++) {
112  ForJetResult->push_back(m_FastL1GlobalAlgo->getForJets().at(i));
113  }
114  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getEgammas().size()); i++) {
115  EgammaResult->push_back(m_FastL1GlobalAlgo->getEgammas().at(i));
116  }
117  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getisoEgammas().size()); i++) {
118  isoEgammaResult->push_back(m_FastL1GlobalAlgo->getisoEgammas().at(i));
119  }
120 
121  if (m_DoBitInfo) {
122  std::auto_ptr<FastL1BitInfoCollection> L1BitInfoResult(new FastL1BitInfoCollection);
123  for (int i=0; i<(int)m_FastL1GlobalAlgo->getBitInfos().size(); i++) {
124  L1BitInfoResult->push_back(m_FastL1GlobalAlgo->getBitInfos().at(i));
125  }
126  iEvent.put(L1BitInfoResult,"L1BitInfos");
127  }
128 
129  // put the collections into the event
130  /* old labels
131  iEvent.put(METResult,"MET");
132  iEvent.put(TauJetResult,"TauJets");
133  iEvent.put(CenJetResult,"CenJets");
134  iEvent.put(ForJetResult,"ForJets");
135  iEvent.put(EgammaResult,"Egammas");
136  iEvent.put(isoEgammaResult,"isoEgammas");
137  */
138  iEvent.put(METResult);
139  iEvent.put(TauJetResult,"Tau");
140  iEvent.put(CenJetResult,"Central");
141  iEvent.put(ForJetResult,"Forward");
142  iEvent.put(EgammaResult,"NonIsolated");
143  iEvent.put(isoEgammaResult,"Isolated");
144  iEvent.put(muonDummy);
145 
146 }
int i
Definition: DBlmapReader.cc:9
l1extra::L1JetParticleCollection getForJets() const
l1extra::L1JetParticleCollection getCenJets() const
l1extra::L1EmParticleCollection getEgammas() const
std::vector< L1JetParticle > L1JetParticleCollection
std::vector< FastL1BitInfo > FastL1BitInfoCollection
Definition: FastL1BitInfo.h:86
#define min(a, b)
Definition: mlp_lapack.h:161
std::string m_AlgorithmSource
Definition: FastL1CaloSim.h:51
void FillEgammas(edm::Event const &)
FastL1GlobalAlgo * m_FastL1GlobalAlgo
Definition: FastL1CaloSim.h:48
void FillEgammasTP(edm::Event const &)
l1extra::L1EtMissParticleCollection getMET() const
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:85
FastL1BitInfoCollection getBitInfos()
void FillJets(const edm::EventSetup &e)
void FillL1RegionsTP(edm::Event const &e, const edm::EventSetup &c)
void FillL1Regions(edm::Event const &e, const edm::EventSetup &c)
l1extra::L1JetParticleCollection getTauJets() const
l1extra::L1EmParticleCollection getisoEgammas() const
std::vector< L1EtMissParticle > L1EtMissParticleCollection
std::vector< L1EmParticle > L1EmParticleCollection
std::vector< L1MuonParticle > L1MuonParticleCollection

Member Data Documentation

std::string FastL1CaloSim::m_AlgorithmSource
private

Definition at line 51 of file FastL1CaloSim.h.

Referenced by FastL1CaloSim(), and produce().

bool FastL1CaloSim::m_DoBitInfo
private

Definition at line 50 of file FastL1CaloSim.h.

Referenced by FastL1CaloSim(), and produce().

FastL1GlobalAlgo* FastL1CaloSim::m_FastL1GlobalAlgo
private

Definition at line 48 of file FastL1CaloSim.h.

Referenced by FastL1CaloSim(), produce(), and ~FastL1CaloSim().