Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00014
00015
00016
00017
00018
00019
00020
00021 #include "FastSimulation/L1CaloTriggerProducer/interface/FastL1CaloSim.h"
00022
00023
00024
00025
00026
00027 FastL1CaloSim::FastL1CaloSim(const edm::ParameterSet& iConfig)
00028 {
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040 produces<l1extra::L1EtMissParticleCollection>("MET");
00041 produces<l1extra::L1JetParticleCollection>("Tau");
00042 produces<l1extra::L1JetParticleCollection>("Central");
00043 produces<l1extra::L1JetParticleCollection>("Forward");
00044 produces<l1extra::L1EmParticleCollection>("NonIsolated");
00045 produces<l1extra::L1EmParticleCollection>("Isolated");
00046 produces<l1extra::L1MuonParticleCollection>();
00047
00048 m_AlgorithmSource = iConfig.getParameter<std::string>("AlgorithmSource");
00049
00050
00051 m_DoBitInfo = iConfig.getParameter<bool>("DoBitInfo");
00052 if (m_DoBitInfo)
00053 produces<FastL1BitInfoCollection>("L1BitInfos");
00054
00055 m_FastL1GlobalAlgo = new FastL1GlobalAlgo(iConfig);
00056 }
00057
00058 FastL1CaloSim::~FastL1CaloSim()
00059 {
00060 delete m_FastL1GlobalAlgo;
00061 }
00062
00063
00064
00065
00066
00067
00068
00069 void
00070 FastL1CaloSim::produce(edm::Event& iEvent, const edm::EventSetup& iSetup)
00071 {
00072
00073
00074 if (m_AlgorithmSource == "RecHits") {
00075 m_FastL1GlobalAlgo->FillL1Regions(iEvent, iSetup);
00076 m_FastL1GlobalAlgo->FillEgammas(iEvent);
00077 } else if (m_AlgorithmSource == "TrigPrims") {
00078 m_FastL1GlobalAlgo->FillL1RegionsTP(iEvent,iSetup);
00079 m_FastL1GlobalAlgo->FillEgammasTP(iEvent);
00080 } else {
00081 std::cerr<<"AlgorithmSource not valid: "<<m_AlgorithmSource<<std::endl;
00082 return;
00083 }
00084 m_FastL1GlobalAlgo->FillMET(iEvent);
00085
00086 m_FastL1GlobalAlgo->FillJets(iSetup);
00087
00088 if (m_DoBitInfo)
00089 m_FastL1GlobalAlgo->FillBitInfos();
00090
00091
00092 std::auto_ptr<l1extra::L1EtMissParticleCollection> METResult(new l1extra::L1EtMissParticleCollection);
00093 std::auto_ptr<l1extra::L1JetParticleCollection> TauJetResult(new l1extra::L1JetParticleCollection);
00094 std::auto_ptr<l1extra::L1JetParticleCollection> CenJetResult(new l1extra::L1JetParticleCollection);
00095 std::auto_ptr<l1extra::L1JetParticleCollection> ForJetResult(new l1extra::L1JetParticleCollection);
00096 std::auto_ptr<l1extra::L1EmParticleCollection> EgammaResult(new l1extra::L1EmParticleCollection);
00097 std::auto_ptr<l1extra::L1EmParticleCollection> isoEgammaResult(new l1extra::L1EmParticleCollection);
00098
00099 std::auto_ptr<l1extra::L1MuonParticleCollection> muonDummy(new l1extra::L1MuonParticleCollection);
00100
00101
00102 for (int i=0; i<(int)m_FastL1GlobalAlgo->getMET().size(); i++) {
00103 METResult->push_back(m_FastL1GlobalAlgo->getMET().at(i));
00104 }
00105 for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getTauJets().size()); i++) {
00106 TauJetResult->push_back(m_FastL1GlobalAlgo->getTauJets().at(i));
00107 }
00108 for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getCenJets().size()); i++) {
00109 CenJetResult->push_back(m_FastL1GlobalAlgo->getCenJets().at(i));
00110 }
00111 for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getForJets().size()); i++) {
00112 ForJetResult->push_back(m_FastL1GlobalAlgo->getForJets().at(i));
00113 }
00114 for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getEgammas().size()); i++) {
00115 EgammaResult->push_back(m_FastL1GlobalAlgo->getEgammas().at(i));
00116 }
00117 for (int i=0; i<std::min(4,(int)m_FastL1GlobalAlgo->getisoEgammas().size()); i++) {
00118 isoEgammaResult->push_back(m_FastL1GlobalAlgo->getisoEgammas().at(i));
00119 }
00120
00121 if (m_DoBitInfo) {
00122 std::auto_ptr<FastL1BitInfoCollection> L1BitInfoResult(new FastL1BitInfoCollection);
00123 for (int i=0; i<(int)m_FastL1GlobalAlgo->getBitInfos().size(); i++) {
00124 L1BitInfoResult->push_back(m_FastL1GlobalAlgo->getBitInfos().at(i));
00125 }
00126 iEvent.put(L1BitInfoResult,"L1BitInfos");
00127 }
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138 iEvent.put(METResult);
00139 iEvent.put(TauJetResult,"Tau");
00140 iEvent.put(CenJetResult,"Central");
00141 iEvent.put(ForJetResult,"Forward");
00142 iEvent.put(EgammaResult,"NonIsolated");
00143 iEvent.put(isoEgammaResult,"Isolated");
00144 iEvent.put(muonDummy);
00145
00146 }
00147
00148
00149 DEFINE_FWK_MODULE(FastL1CaloSim);