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::EDConsumerBase 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 ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 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
 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 (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string m_AlgorithmSource
 
bool m_DoBitInfo
 
FastL1GlobalAlgom_FastL1GlobalAlgo
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- 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::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- 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

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, m_FastL1GlobalAlgo, and AlCaHLTBitMon_QueryRunRegistry::string.

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, bookConverter::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
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:116
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().