![]() |
![]() |
#include <src/L1Trigger/GlobalCaloTrigger/src/L1GctEmulator.h>
Public Types | |
typedef L1GlobalCaloTrigger::lutPtr | lutPtr |
typedefs | |
typedef L1GlobalCaloTrigger::lutPtrVector | lutPtrVector |
Public Member Functions | |
L1GctEmulator (const edm::ParameterSet &ps) | |
constructor | |
~L1GctEmulator () | |
destructor | |
Private Member Functions | |
void | beginJob (const edm::EventSetup &c) |
int | configureGct (const edm::EventSetup &c) |
void | endJob () |
void | produce (edm::Event &e, const edm::EventSetup &c) |
Private Attributes | |
L1GlobalCaloTrigger * | m_gct |
std::string | m_inputLabel |
lutPtrVector | m_jetEtCalibLuts |
bool | m_verbose |
Implementation: An EDProducer that contains an instance of L1GlobalCaloTrigger.
Definition at line 30 of file L1GctEmulator.h.
Definition at line 35 of file L1GctEmulator.h.
L1GctEmulator::L1GctEmulator | ( | const edm::ParameterSet & | ps | ) | [explicit] |
constructor
Definition at line 42 of file L1GctEmulator.cc.
References L1GctJetFinderBase::COL_OFFSET, edm::ParameterSet::getParameter(), L1GctJetLeafCard::hardwareJetFinder, m_gct, m_inputLabel, m_jetEtCalibLuts, m_verbose, L1GlobalCaloTrigger::print(), L1GlobalCaloTrigger::setBxRange(), and L1GctJetLeafCard::tdrJetFinder.
00042 : 00043 m_jetEtCalibLuts(), 00044 m_verbose(ps.getUntrackedParameter<bool>("verbose", false)) 00045 { 00046 00047 // list of products 00048 produces<L1GctEmCandCollection>("isoEm"); 00049 produces<L1GctEmCandCollection>("nonIsoEm"); 00050 produces<L1GctJetCandCollection>("cenJets"); 00051 produces<L1GctJetCandCollection>("forJets"); 00052 produces<L1GctJetCandCollection>("tauJets"); 00053 produces<L1GctEtTotalCollection>(); 00054 produces<L1GctEtHadCollection>(); 00055 produces<L1GctEtMissCollection>(); 00056 produces<L1GctEtMissCollection>("missingHt"); 00057 produces<L1GctJetCountsCollection>(); 00058 produces<L1GctHFBitCountsCollection>(); 00059 produces<L1GctHFRingEtSumsCollection>(); 00060 00061 // get the input label 00062 edm::InputTag inputTag = ps.getParameter<edm::InputTag>("inputLabel"); 00063 m_inputLabel = inputTag.label(); 00064 00065 // Get the number of bunch crossings to be processed 00066 int firstBx = -ps.getParameter<unsigned>("preSamples"); 00067 int lastBx = ps.getParameter<unsigned>("postSamples"); 00068 00069 // instantiate the GCT. Argument selects the type of jetFinder to be used. 00070 L1GctJetLeafCard::jetFinderType jfType=L1GctJetLeafCard::hardwareJetFinder; 00071 std::string jfTypeStr = ps.getParameter<std::string>("jetFinderType"); 00072 if (jfTypeStr == "tdrJetFinder") { jfType = L1GctJetLeafCard::tdrJetFinder; } 00073 else if (jfTypeStr != "hardwareJetFinder") { 00074 edm::LogWarning ("L1GctEmulatorSetup") << "Unrecognised jetFinder option " << jfTypeStr 00075 << "\nHardware jetFinder will be used"; 00076 } 00077 m_gct = new L1GlobalCaloTrigger(jfType); 00078 m_gct->setBxRange(firstBx, lastBx); 00079 00080 // Fill the jetEtCalibLuts vector 00081 lutPtr nextLut( new L1GctJetEtCalibrationLut() ); 00082 00083 for (unsigned ieta=0; ieta<L1GctJetFinderBase::COL_OFFSET; ieta++) { 00084 nextLut->setEtaBin(ieta); 00085 m_jetEtCalibLuts.push_back(nextLut); 00086 nextLut.reset ( new L1GctJetEtCalibrationLut() ); 00087 } 00088 00089 // set verbosity (not implemented yet!) 00090 // m_gct->setVerbose(m_verbose); 00091 00092 // print debug info? 00093 if (m_verbose) { 00094 m_gct->print(); 00095 00096 } 00097 }
L1GctEmulator::~L1GctEmulator | ( | ) |
void L1GctEmulator::beginJob | ( | const edm::EventSetup & | c | ) | [private, virtual] |
int L1GctEmulator::configureGct | ( | const edm::EventSetup & | c | ) | [private] |
Definition at line 112 of file L1GctEmulator.cc.
References lat::endl(), edm::EventSetup::get(), m_gct, m_jetEtCalibLuts, m_verbose, edm::ESHandle< T >::product(), L1GlobalCaloTrigger::setChannelMask(), L1GlobalCaloTrigger::setJetEtCalibrationLuts(), L1GlobalCaloTrigger::setJetFinderParams(), L1GlobalCaloTrigger::setupHfSumLuts(), and L1GlobalCaloTrigger::setupJetCounterLuts().
Referenced by produce().
00113 { 00114 int success = 0; 00115 if (&c==0) { 00116 success = -1; 00117 if (m_verbose) { 00118 edm::LogWarning("L1GctConfigFailure") << "Cannot find EventSetup information." << std::endl; 00119 } 00120 } 00121 00122 if (success == 0) { 00123 // get data from EventSetup 00124 edm::ESHandle< L1GctJetFinderParams > jfPars ; 00125 c.get< L1GctJetFinderParamsRcd >().get( jfPars ) ; // which record? 00126 edm::ESHandle< L1GctJetCounterSetup > jcPosPars ; 00127 c.get< L1GctJetCounterPositiveEtaRcd >().get( jcPosPars ) ; // which record? 00128 edm::ESHandle< L1GctJetCounterSetup > jcNegPars ; 00129 c.get< L1GctJetCounterNegativeEtaRcd >().get( jcNegPars ) ; // which record? 00130 edm::ESHandle< L1GctJetEtCalibrationFunction > calibFun ; 00131 c.get< L1GctJetCalibFunRcd >().get( calibFun ) ; // which record? 00132 edm::ESHandle< L1GctHfLutSetup > hfLSetup ; 00133 c.get< L1GctHfLutSetupRcd >().get( hfLSetup ) ; // which record? 00134 edm::ESHandle< L1GctChannelMask > chanMask ; 00135 c.get< L1GctChannelMaskRcd >().get( chanMask ) ; // which record? 00136 edm::ESHandle< L1CaloEtScale > etScale ; 00137 c.get< L1JetEtScaleRcd >().get( etScale ) ; // which record? 00138 00139 if (jfPars.product() == 0) { 00140 success = -1; 00141 if (m_verbose) { 00142 edm::LogWarning("L1GctConfigFailure") 00143 << "Failed to find a L1GctJetFinderParamsRcd:L1GctJetFinderParams in EventSetup!" << std::endl; 00144 } 00145 } 00146 00147 if (calibFun.product() == 0) { 00148 success = -1; 00149 if (m_verbose) { 00150 edm::LogWarning("L1GctConfigFailure") 00151 << "Failed to find a L1GctJetCalibFunRcd:L1GctJetEtCalibrationFunction in EventSetup!" << std::endl; 00152 } 00153 } 00154 00155 if (hfLSetup.product() == 0) { 00156 success = -1; 00157 if (m_verbose) { 00158 edm::LogWarning("L1GctConfigFailure") 00159 << "Failed to find a L1GctHfLutSetupRcd:L1GctHfLutSetup in EventSetup!" << std::endl; 00160 } 00161 } 00162 00163 if (chanMask.product() == 0) { 00164 success = -1; 00165 if (m_verbose) { 00166 edm::LogWarning("L1GctConfigFailure") 00167 << "Failed to find a L1GctChannelMaskRcd:L1GctChannelMask in EventSetup!" << std::endl; 00168 } 00169 } 00170 00171 if (success==0) { 00172 // tell the jet Et Luts about the scales 00173 for (unsigned ieta=0; ieta<m_jetEtCalibLuts.size(); ieta++) { 00174 m_jetEtCalibLuts.at(ieta)->setFunction(calibFun.product()); 00175 m_jetEtCalibLuts.at(ieta)->setOutputEtScale(etScale.product()); 00176 } 00177 00178 00179 // pass all the setup info to the gct 00180 m_gct->setJetEtCalibrationLuts(m_jetEtCalibLuts); 00181 m_gct->setJetFinderParams(jfPars.product()); 00182 m_gct->setupJetCounterLuts(jcPosPars.product(), jcNegPars.product()); 00183 m_gct->setupHfSumLuts(hfLSetup.product()); 00184 m_gct->setChannelMask(chanMask.product()); 00185 } 00186 } 00187 00188 if (success != 0 && m_verbose) { 00189 edm::LogError("L1GctConfigError") 00190 << "Configuration failed - GCT emulator will not be run" << std::endl; 00191 } 00192 return success; 00193 }
void L1GctEmulator::produce | ( | edm::Event & | e, | |
const edm::EventSetup & | c | |||
) | [private, virtual] |
Implements edm::EDProducer.
Definition at line 195 of file L1GctEmulator.cc.
References configureGct(), em, L1GlobalCaloTrigger::fillEmCands(), L1GlobalCaloTrigger::fillRegions(), edm::Event::getByLabel(), L1GlobalCaloTrigger::getCentralJets(), L1GlobalCaloTrigger::getEtHadCollection(), L1GlobalCaloTrigger::getEtMissCollection(), L1GlobalCaloTrigger::getEtSumCollection(), L1GlobalCaloTrigger::getForwardJets(), L1GlobalCaloTrigger::getHFBitCountsCollection(), L1GlobalCaloTrigger::getHFRingEtSumsCollection(), L1GlobalCaloTrigger::getHtMissCollection(), L1GlobalCaloTrigger::getIsoElectrons(), L1GlobalCaloTrigger::getJetCountsCollection(), L1GlobalCaloTrigger::getNonIsoElectrons(), L1GlobalCaloTrigger::getTauJets(), m_gct, m_inputLabel, L1GlobalCaloTrigger::process(), edm::Event::put(), L1GlobalCaloTrigger::reset(), and rgn.
00195 { 00196 00197 // get config data from EventSetup. 00198 // check this has been done successfully before proceeding 00199 if (configureGct(c) == 0) { 00200 00201 // get the RCT data 00202 edm::Handle<L1CaloEmCollection> em; 00203 edm::Handle<L1CaloRegionCollection> rgn; 00204 e.getByLabel(m_inputLabel, em); 00205 e.getByLabel(m_inputLabel, rgn); 00206 00207 // reset the GCT internal buffers 00208 m_gct->reset(); 00209 00210 // fill the GCT source cards 00211 m_gct->fillEmCands(*em); 00212 m_gct->fillRegions(*rgn); 00213 00214 // process the event 00215 m_gct->process(); 00216 00217 // create the em and jet collections 00218 std::auto_ptr<L1GctEmCandCollection> isoEmResult (new L1GctEmCandCollection(m_gct->getIsoElectrons() ) ); 00219 std::auto_ptr<L1GctEmCandCollection> nonIsoEmResult(new L1GctEmCandCollection(m_gct->getNonIsoElectrons() ) ); 00220 std::auto_ptr<L1GctJetCandCollection> cenJetResult(new L1GctJetCandCollection(m_gct->getCentralJets() ) ); 00221 std::auto_ptr<L1GctJetCandCollection> forJetResult(new L1GctJetCandCollection(m_gct->getForwardJets() ) ); 00222 std::auto_ptr<L1GctJetCandCollection> tauJetResult(new L1GctJetCandCollection(m_gct->getTauJets() ) ); 00223 00224 // create the energy sum digis 00225 std::auto_ptr<L1GctEtTotalCollection> etTotResult (new L1GctEtTotalCollection(m_gct->getEtSumCollection() ) ); 00226 std::auto_ptr<L1GctEtHadCollection> etHadResult (new L1GctEtHadCollection (m_gct->getEtHadCollection() ) ); 00227 std::auto_ptr<L1GctEtMissCollection> etMissResult(new L1GctEtMissCollection (m_gct->getEtMissCollection() ) ); 00228 std::auto_ptr<L1GctEtMissCollection> htMissResult(new L1GctEtMissCollection (m_gct->getHtMissCollection() ) ); 00229 00230 // create the jet counts digis 00231 std::auto_ptr<L1GctJetCountsCollection> jetCountResult(new L1GctJetCountsCollection(m_gct->getJetCountsCollection() ) ); 00232 00233 // create the Hf sums digis 00234 std::auto_ptr<L1GctHFBitCountsCollection> hfBitCountResult (new L1GctHFBitCountsCollection (m_gct->getHFBitCountsCollection () ) ); 00235 std::auto_ptr<L1GctHFRingEtSumsCollection> hfRingEtSumResult(new L1GctHFRingEtSumsCollection(m_gct->getHFRingEtSumsCollection() ) ); 00236 00237 // put the collections into the event 00238 e.put(isoEmResult,"isoEm"); 00239 e.put(nonIsoEmResult,"nonIsoEm"); 00240 e.put(cenJetResult,"cenJets"); 00241 e.put(forJetResult,"forJets"); 00242 e.put(tauJetResult,"tauJets"); 00243 e.put(etTotResult); 00244 e.put(etHadResult); 00245 e.put(etMissResult); 00246 e.put(htMissResult,"missingHt"); 00247 e.put(jetCountResult); 00248 e.put(hfBitCountResult); 00249 e.put(hfRingEtSumResult); 00250 } 00251 }
L1GlobalCaloTrigger* L1GctEmulator::m_gct [private] |
Definition at line 54 of file L1GctEmulator.h.
Referenced by configureGct(), L1GctEmulator(), produce(), and ~L1GctEmulator().
std::string L1GctEmulator::m_inputLabel [private] |
lutPtrVector L1GctEmulator::m_jetEtCalibLuts [private] |
bool L1GctEmulator::m_verbose [private] |