CMS 3D CMS Logo

Public Member Functions | Private Attributes

FastL1CaloSim Class Reference

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

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

List of all members.

Public Member Functions

 FastL1CaloSim (const edm::ParameterSet &)
virtual void produce (edm::Event &, const edm::EventSetup &)
 ~FastL1CaloSim ()

Private Attributes

std::string m_AlgorithmSource
bool m_DoBitInfo
FastL1GlobalAlgom_FastL1GlobalAlgo

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.

{
  //register your products
  /* old labels
  produces<l1extra::L1EtMissParticle>("MET");
  produces<l1extra::L1JetParticleCollection>("TauJets");
  produces<l1extra::L1JetParticleCollection>("CenJets");
  produces<l1extra::L1JetParticleCollection>("ForJets");
  produces<l1extra::L1EmParticleCollection>("Egammas");
  produces<l1extra::L1EmParticleCollection>("isoEgammas");
  */

  //produces<l1extra::L1EtMissParticle>();
  produces<l1extra::L1EtMissParticleCollection>("MET");
  produces<l1extra::L1JetParticleCollection>("Tau");
  produces<l1extra::L1JetParticleCollection>("Central");
  produces<l1extra::L1JetParticleCollection>("Forward");
  produces<l1extra::L1EmParticleCollection>("NonIsolated");
  produces<l1extra::L1EmParticleCollection>("Isolated");
  produces<l1extra::L1MuonParticleCollection>(); // muon is dummy for L1extraParticleMap!

  m_AlgorithmSource = iConfig.getParameter<std::string>("AlgorithmSource");

  // No BitInfos for release versions
  m_DoBitInfo = iConfig.getParameter<bool>("DoBitInfo");
  if (m_DoBitInfo)
    produces<FastL1BitInfoCollection>("L1BitInfos");

  m_FastL1GlobalAlgo = new FastL1GlobalAlgo(iConfig);
}
FastL1CaloSim::~FastL1CaloSim ( )

Definition at line 58 of file FastL1CaloSim.cc.

References m_FastL1GlobalAlgo.

{
  delete m_FastL1GlobalAlgo;
}

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 ExpressReco_HICollisions_FallBack::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().

{
  //edm::LogInfo("FastL1CaloSim::produce()");

  if (m_AlgorithmSource == "RecHits") {
    m_FastL1GlobalAlgo->FillL1Regions(iEvent, iSetup);
    m_FastL1GlobalAlgo->FillEgammas(iEvent);
  } else if (m_AlgorithmSource == "TrigPrims") {
    m_FastL1GlobalAlgo->FillL1RegionsTP(iEvent,iSetup);
    m_FastL1GlobalAlgo->FillEgammasTP(iEvent);
  } else {
    std::cerr<<"AlgorithmSource not valid: "<<m_AlgorithmSource<<std::endl;
    return;
  }
  m_FastL1GlobalAlgo->FillMET(iEvent); // using CaloTowers
  //m_FastL1GlobalAlgo->FillMET();     // using Regions
  m_FastL1GlobalAlgo->FillJets(iSetup);
  
  if (m_DoBitInfo)
    m_FastL1GlobalAlgo->FillBitInfos();

  //std::auto_ptr<l1extra::L1EtMissParticle> METResult(new l1extra::L1EtMissParticle);
  std::auto_ptr<l1extra::L1EtMissParticleCollection> METResult(new l1extra::L1EtMissParticleCollection);
  std::auto_ptr<l1extra::L1JetParticleCollection> TauJetResult(new l1extra::L1JetParticleCollection);
  std::auto_ptr<l1extra::L1JetParticleCollection> CenJetResult(new l1extra::L1JetParticleCollection);
  std::auto_ptr<l1extra::L1JetParticleCollection> ForJetResult(new l1extra::L1JetParticleCollection);
  std::auto_ptr<l1extra::L1EmParticleCollection> EgammaResult(new l1extra::L1EmParticleCollection);
  std::auto_ptr<l1extra::L1EmParticleCollection> isoEgammaResult(new l1extra::L1EmParticleCollection);
  // muon is dummy!
  std::auto_ptr<l1extra::L1MuonParticleCollection> muonDummy(new l1extra::L1MuonParticleCollection);
  //
  //*METResult = m_FastL1GlobalAlgo->getMET();
  for (int i=0; i<(int)m_FastL1GlobalAlgo->getMET().size(); i++) {
    METResult->push_back(m_FastL1GlobalAlgo->getMET().at(i));
  }
  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getTauJets().size()); i++) {
    TauJetResult->push_back(m_FastL1GlobalAlgo->getTauJets().at(i));
  }
  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getCenJets().size()); i++) {
    CenJetResult->push_back(m_FastL1GlobalAlgo->getCenJets().at(i));
  }
  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getForJets().size()); i++) {
    ForJetResult->push_back(m_FastL1GlobalAlgo->getForJets().at(i));
  }
  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getEgammas().size()); i++) {
    EgammaResult->push_back(m_FastL1GlobalAlgo->getEgammas().at(i));
  }
  for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getisoEgammas().size()); i++) {
    isoEgammaResult->push_back(m_FastL1GlobalAlgo->getisoEgammas().at(i));
  }

  if (m_DoBitInfo) {
  std::auto_ptr<FastL1BitInfoCollection> L1BitInfoResult(new FastL1BitInfoCollection);
    for (int i=0; i<(int)m_FastL1GlobalAlgo->getBitInfos().size(); i++) {
      L1BitInfoResult->push_back(m_FastL1GlobalAlgo->getBitInfos().at(i));
    }
    iEvent.put(L1BitInfoResult,"L1BitInfos");
  }

  // put the collections into the event
  /* old labels
  iEvent.put(METResult,"MET");
  iEvent.put(TauJetResult,"TauJets");
  iEvent.put(CenJetResult,"CenJets");
  iEvent.put(ForJetResult,"ForJets");
  iEvent.put(EgammaResult,"Egammas");
  iEvent.put(isoEgammaResult,"isoEgammas");
  */
  iEvent.put(METResult);
  iEvent.put(TauJetResult,"Tau");
  iEvent.put(CenJetResult,"Central");
  iEvent.put(ForJetResult,"Forward");
  iEvent.put(EgammaResult,"NonIsolated");
  iEvent.put(isoEgammaResult,"Isolated");
  iEvent.put(muonDummy);

}

Member Data Documentation

std::string FastL1CaloSim::m_AlgorithmSource [private]

Definition at line 51 of file FastL1CaloSim.h.

Referenced by FastL1CaloSim(), and produce().

Definition at line 50 of file FastL1CaloSim.h.

Referenced by FastL1CaloSim(), and produce().

Definition at line 48 of file FastL1CaloSim.h.

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