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