#include <L1Trigger/GlobalCaloTrigger/test/DumpGctDigis.cc>
Public Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
void | doEM (const edm::Event &, const edm::InputTag &label) |
void | doEnergySums (const edm::Event &, const edm::InputTag &label) |
void | doFibres (const edm::Event &, const edm::InputTag &label) |
void | doInternEM (const edm::Event &, const edm::InputTag &label) |
void | doJets (const edm::Event &, const edm::InputTag &label) |
void | doRctEM (const edm::Event &, const edm::InputTag &label) |
void | doRegions (const edm::Event &, const edm::InputTag &label) |
DumpGctDigis (const edm::ParameterSet &) | |
~DumpGctDigis () | |
Private Attributes | |
bool | doEM_ |
bool | doEmu_ |
bool | doEnergySums_ |
bool | doFibres_ |
bool | doHW_ |
bool | doInternEM_ |
bool | doJets_ |
bool | doRctEM_ |
bool | doRegions_ |
edm::InputTag | emuGctLabel_ |
edm::InputTag | emuRctLabel_ |
std::ofstream | outFile_ |
std::string | outFilename_ |
edm::InputTag | rawLabel_ |
unsigned | rctEmMinRank_ |
Implementation: <Notes on="" implementation>="">
Definition at line 36 of file DumpGctDigis.h.
DumpGctDigis::DumpGctDigis | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 30 of file DumpGctDigis.cc.
References out, outFile_, and outFilename_.
00030 : 00031 rawLabel_( iConfig.getUntrackedParameter<edm::InputTag>("rawInput", edm::InputTag("L1GctRawDigis") ) ), 00032 emuRctLabel_( iConfig.getUntrackedParameter<edm::InputTag>("emuRctInput", edm::InputTag("L1RctEmuDigis") ) ), 00033 emuGctLabel_( iConfig.getUntrackedParameter<edm::InputTag>("emuGctInput", edm::InputTag("L1GctEmuDigis") ) ), 00034 outFilename_( iConfig.getUntrackedParameter<string>("outFile", "gctAnalyzer.txt") ), 00035 doHW_( iConfig.getUntrackedParameter<bool>("doHardware", true) ), 00036 doEmu_( iConfig.getUntrackedParameter<bool>("doEmulated", true) ), 00037 doRctEM_( iConfig.getUntrackedParameter<bool>("doRctEm", true) ), 00038 doEM_( iConfig.getUntrackedParameter<bool>("doEm", true) ), 00039 doRegions_( iConfig.getUntrackedParameter<bool>("doRegions", false) ), 00040 doJets_( iConfig.getUntrackedParameter<bool>("doJets", false) ), 00041 doInternEM_( iConfig.getUntrackedParameter<bool>("doInternEm", true) ), 00042 doFibres_( iConfig.getUntrackedParameter<bool>("doFibres", false) ), 00043 doEnergySums_( iConfig.getUntrackedParameter<bool>("doEnergySums", false) ), 00044 rctEmMinRank_( iConfig.getUntrackedParameter<unsigned>("rctEmMinRank", 0) ) 00045 { 00046 //now do what ever initialization is needed 00047 00048 outFile_.open(outFilename_.c_str(), ios::out); 00049 00050 }
DumpGctDigis::~DumpGctDigis | ( | ) |
Definition at line 53 of file DumpGctDigis.cc.
References outFile_.
00054 { 00055 00056 // do anything here that needs to be done at desctruction time 00057 // (e.g. close files, deallocate resources etc.) 00058 00059 outFile_.close(); 00060 00061 }
void DumpGctDigis::analyze | ( | const edm::Event & | iEvent, | |
const edm::EventSetup & | iSetup | |||
) | [virtual] |
Implements edm::EDAnalyzer.
Definition at line 70 of file DumpGctDigis.cc.
References doEM(), doEM_, doEmu_, doEnergySums(), doEnergySums_, doFibres(), doFibres_, doHW_, doInternEM(), doInternEM_, doJets(), doJets_, doRctEM(), doRctEM_, doRegions(), doRegions_, emuGctLabel_, emuRctLabel_, lat::endl(), edm::Event::id(), outFile_, and rawLabel_.
00071 { 00072 using namespace edm; 00073 00074 outFile_ << "Run :" << iEvent.id().run() << " Event :" << iEvent.id().event() << endl; 00075 00076 // EM 00077 if (doRctEM_ && doHW_) { doRctEM(iEvent, rawLabel_); } 00078 if (doRctEM_ && doEmu_) { doRctEM(iEvent, emuRctLabel_); } 00079 if (doEM_ && doHW_) { doEM(iEvent, rawLabel_); } 00080 if (doEM_ && doEmu_){ doEM(iEvent, emuGctLabel_); } 00081 00082 // Jets 00083 if (doRegions_ && doHW_) { doRegions(iEvent, rawLabel_); } 00084 if (doRegions_ && doEmu_) { doRegions(iEvent, emuRctLabel_); } 00085 if (doJets_ && doHW_) { doJets(iEvent, rawLabel_); } 00086 if (doJets_ && doEmu_) { doJets(iEvent, emuGctLabel_); } 00087 00088 // Energy Sums 00089 if (doEnergySums_ && doHW_) { doEnergySums(iEvent, rawLabel_); } 00090 if (doEnergySums_ && doEmu_) { doEnergySums(iEvent, emuGctLabel_); } 00091 00092 // debugging 00093 if (doInternEM_ && doHW_) { doInternEM(iEvent, rawLabel_); } 00094 if (doFibres_ && doHW_) { doFibres(iEvent, rawLabel_); } 00095 00096 }
void DumpGctDigis::doEM | ( | const edm::Event & | iEvent, | |
const edm::InputTag & | label | |||
) |
Definition at line 98 of file DumpGctDigis.cc.
References lat::endl(), edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.
Referenced by analyze().
00098 { 00099 00100 using namespace edm; 00101 00102 Handle<L1GctEmCandCollection> isoEm; 00103 Handle<L1GctEmCandCollection> nonIsoEm; 00104 00105 L1GctEmCandCollection::const_iterator ie; 00106 L1GctEmCandCollection::const_iterator ne; 00107 00108 iEvent.getByLabel(label.label(),"isoEm",isoEm); 00109 iEvent.getByLabel(label.label(),"nonIsoEm",nonIsoEm); 00110 00111 outFile_ << "Iso EM from : " << label.label() << endl; 00112 for (ie=isoEm->begin(); ie!=isoEm->end(); ie++) { 00113 outFile_ << (*ie) 00114 << " ieta(detID)=" << ie->regionId().ieta() 00115 << " iphi(detID)=" << ie->regionId().iphi() 00116 << endl; 00117 } 00118 outFile_ << endl; 00119 00120 outFile_ << "Non-iso EM from : " << label.label() << endl; 00121 for (ne=nonIsoEm->begin(); ne!=nonIsoEm->end(); ne++) { 00122 outFile_ << (*ne) 00123 << " ieta(detID)=" << ne->regionId().ieta() 00124 << " iphi(detID)=" << ne->regionId().iphi() 00125 << endl; 00126 } 00127 outFile_ << endl; 00128 00129 }
void DumpGctDigis::doEnergySums | ( | const edm::Event & | iEvent, | |
const edm::InputTag & | label | |||
) |
Definition at line 257 of file DumpGctDigis.cc.
References lat::endl(), etHad, etMiss, edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.
Referenced by analyze().
00258 { 00259 using namespace edm; 00260 00261 Handle<L1GctEtTotal> etTotal; 00262 Handle<L1GctEtHad> etHad; 00263 Handle<L1GctEtMiss> etMiss; 00264 00265 iEvent.getByLabel(label, etTotal); 00266 iEvent.getByLabel(label, etHad); 00267 iEvent.getByLabel(label, etMiss); 00268 00269 outFile_ << "Energy sums from: " << label.label() << endl; 00270 outFile_ << *(etTotal.product()) << endl; 00271 outFile_ << *(etHad.product()) << endl; 00272 outFile_ << *(etMiss.product()) << endl << endl; 00273 }
void DumpGctDigis::doFibres | ( | const edm::Event & | iEvent, | |
const edm::InputTag & | label | |||
) |
Definition at line 239 of file DumpGctDigis.cc.
References lat::endl(), f, edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.
Referenced by analyze().
00239 { 00240 00241 using namespace edm; 00242 00243 Handle<L1GctFibreCollection> fibres; 00244 00245 L1GctFibreCollection::const_iterator f; 00246 00247 iEvent.getByLabel(label, fibres); 00248 00249 outFile_ << "Fibres from : " << label.label() << endl; 00250 for (f=fibres->begin(); f!=fibres->end(); f++) { 00251 outFile_ << (*f) << endl; 00252 } 00253 outFile_ << endl; 00254 00255 }
void DumpGctDigis::doInternEM | ( | const edm::Event & | iEvent, | |
const edm::InputTag & | label | |||
) |
Definition at line 217 of file DumpGctDigis.cc.
References e, em, lat::endl(), edm::Event::getByLabel(), edm::InputTag::label(), and outFile_.
Referenced by analyze().
00217 { 00218 00219 using namespace edm; 00220 00221 Handle<L1GctInternEmCandCollection> em; 00222 00223 L1GctInternEmCandCollection::const_iterator e; 00224 00225 iEvent.getByLabel(label, em); 00226 00227 outFile_ << "Internal EM from : " << label.label() << endl; 00228 for (e=em->begin(); e!=em->end(); e++) { 00229 outFile_ << (*e) 00230 << " ieta(detID)=" << e->regionId().ieta() 00231 << " iphi(detID)=" << e->regionId().iphi() 00232 << endl; 00233 } 00234 outFile_ << endl; 00235 00236 }
void DumpGctDigis::doJets | ( | const edm::Event & | iEvent, | |
const edm::InputTag & | label | |||
) |
Definition at line 174 of file DumpGctDigis.cc.
References lat::endl(), edm::Event::getByLabel(), jetCounts, edm::InputTag::label(), and outFile_.
Referenced by analyze().
00174 { 00175 00176 using namespace edm; 00177 00178 Handle<L1GctJetCandCollection> cenJets; 00179 Handle<L1GctJetCandCollection> forJets; 00180 Handle<L1GctJetCandCollection> tauJets; 00181 Handle<L1GctJetCounts> jetCounts; 00182 00183 L1GctJetCandCollection::const_iterator cj; 00184 L1GctJetCandCollection::const_iterator fj; 00185 L1GctJetCandCollection::const_iterator tj; 00186 00187 const std::string labelStr = label.label(); 00188 00189 iEvent.getByLabel(labelStr,"cenJets",cenJets); 00190 iEvent.getByLabel(labelStr,"forJets",forJets); 00191 iEvent.getByLabel(labelStr,"tauJets",tauJets); 00192 iEvent.getByLabel(label, jetCounts); 00193 00194 outFile_ << "Central jets from : " << labelStr << endl; 00195 for (cj=cenJets->begin(); cj!=cenJets->end(); cj++) { 00196 outFile_ << (*cj) << endl; 00197 } 00198 outFile_ << endl; 00199 00200 outFile_ << "Forward jets from : " << labelStr << endl; 00201 for (fj=forJets->begin(); fj!=forJets->end(); fj++) { 00202 outFile_ << (*fj) << endl; 00203 } 00204 outFile_ << endl; 00205 00206 outFile_ << "Tau jets from : " << labelStr << endl; 00207 for (tj=tauJets->begin(); tj!=tauJets->end(); tj++) { 00208 outFile_ << (*tj) << endl; 00209 } 00210 00211 outFile_ << "\nJet counts from : " << labelStr << endl; 00212 outFile_ << *(jetCounts.product()) << endl << endl; 00213 00214 }
void DumpGctDigis::doRctEM | ( | const edm::Event & | iEvent, | |
const edm::InputTag & | label | |||
) |
Definition at line 131 of file DumpGctDigis.cc.
References e, em, lat::endl(), edm::Event::getByLabel(), edm::InputTag::label(), outFile_, and rctEmMinRank_.
Referenced by analyze().
00131 { 00132 00133 using namespace edm; 00134 00135 Handle<L1CaloEmCollection> em; 00136 00137 L1CaloEmCollection::const_iterator e; 00138 00139 iEvent.getByLabel(label, em); 00140 00141 outFile_ << "RCT EM from : " << label.label() << endl; 00142 for (e=em->begin(); e!=em->end(); e++) { 00143 if (e->rank() >= rctEmMinRank_) { 00144 outFile_ << (*e) 00145 << " ieta(detID)=" << e->regionId().ieta() 00146 << " iphi(detID)=" << e->regionId().iphi() 00147 << endl; 00148 } 00149 } 00150 outFile_ << endl; 00151 00152 }
void DumpGctDigis::doRegions | ( | const edm::Event & | iEvent, | |
const edm::InputTag & | label | |||
) |
Definition at line 155 of file DumpGctDigis.cc.
References lat::endl(), edm::Event::getByLabel(), edm::InputTag::label(), outFile_, and r.
Referenced by analyze().
00155 { 00156 00157 using namespace edm; 00158 00159 Handle<L1CaloRegionCollection> rgns; 00160 00161 L1CaloRegionCollection::const_iterator r; 00162 00163 iEvent.getByLabel(label, rgns); 00164 00165 outFile_ << "Regions from : " << label.label() << endl; 00166 for (r=rgns->begin(); r!=rgns->end(); r++) { 00167 outFile_ << (*r) << endl; 00168 } 00169 outFile_ << endl; 00170 00171 }
bool DumpGctDigis::doEM_ [private] |
bool DumpGctDigis::doEmu_ [private] |
bool DumpGctDigis::doEnergySums_ [private] |
bool DumpGctDigis::doFibres_ [private] |
bool DumpGctDigis::doHW_ [private] |
bool DumpGctDigis::doInternEM_ [private] |
bool DumpGctDigis::doJets_ [private] |
bool DumpGctDigis::doRctEM_ [private] |
bool DumpGctDigis::doRegions_ [private] |
edm::InputTag DumpGctDigis::emuGctLabel_ [private] |
edm::InputTag DumpGctDigis::emuRctLabel_ [private] |
std::ofstream DumpGctDigis::outFile_ [private] |
Definition at line 71 of file DumpGctDigis.h.
Referenced by analyze(), doEM(), doEnergySums(), doFibres(), doInternEM(), doJets(), doRctEM(), doRegions(), DumpGctDigis(), and ~DumpGctDigis().
std::string DumpGctDigis::outFilename_ [private] |
edm::InputTag DumpGctDigis::rawLabel_ [private] |
unsigned DumpGctDigis::rctEmMinRank_ [private] |