203 LogDebug(
"GtRecordDump") <<
"retrieved L1 data " << endl;
209 const std::vector<std::pair<std::string, int> > prescales =
m_gtUtil->
prescales();
210 const std::vector<std::pair<std::string, std::vector<int> > > masks =
m_gtUtil->
masks();
212 LogDebug(
"GtRecordDump") <<
"retrieved all event vectors " << endl;
216 cout <<
" Bit Algorithm Name Init aBXM Final PS Factor Num Bx Masked " << endl;
217 cout <<
"===============================================================================================================================" << endl;
219 for(
unsigned int i=0;
i<initialDecisions.size();
i++) {
223 bool resultInit = (initialDecisions.at(
i)).
second;
227 std::vector<int> tst;
231 if (resultInit) (
m_algoSummary.find(name)->second).at(0) += 1;
234 bool resultInterm = (intermDecisions.at(
i)).
second;
235 if (resultInterm) (
m_algoSummary.find(name)->second).at(1) += 1;
236 bool resultFin = (finalDecisions.at(
i)).
second;
237 if (resultFin) (
m_algoSummary.find(name)->second).at(2) += 1;
243 if(
m_dumpTriggerResults && name !=
"NULL")
cout <<
std::dec << setfill(
' ') <<
" " << setw(5) <<
i <<
" " << setw(60) << name.c_str() <<
" " << setw(7) << resultInit << setw(7) << resultInterm << setw(7) << resultFin << setw(10) << prescale << setw(11) << mask.size() << endl;
247 cout <<
" FinalOR = " << finOR <<endl;
248 cout <<
"================================================================================================================================" << endl;
253 if (!gtObjectMapRecord.
isValid()) {
254 edm::LogWarning(
"GtRecordDump") <<
" Warning: GlobalObjectMapRecord requested in configuration, but not found in the event." << std::endl;
257 const std::vector<GlobalObjectMap>& objMaps = gtObjectMapRecord->
gtObjectMap();
258 for (
size_t imap =0; imap < objMaps.size(); imap++) {
266 if(mapDecision != (finalDecisions.at(bit)).
second) {
267 std::cout <<
"WARNING: GlobalAlgBlk and ObjectMap Disagree on result for bit " << bit <<
" Alg: " << oMap.
algoName() << std::endl;
272 if(mapDecision != 0) {
275 std::cout <<
" -------------------------------------------------------------------------------------------- \n" <<
276 " Bit " << setw(3) << bit <<
" Decision " << setw(2) << mapDecision <<
" Alg Name " << setw(40) << oMap.
algoName() << std::endl;
279 const std::vector<GlobalLogicParser::OperandToken>& opTokenVecObjMap = oMap.
operandTokenVector();
280 const std::vector<L1TObjectTypeInCond>& condObjTypeVec = oMap.
objectTypeVector();
283 for(
size_t iCond=0; iCond<opTokenVecObjMap.size(); iCond++) {
285 std::cout <<
" " << iCond <<
") Condition Token: " << opTokenVecObjMap.at(iCond).tokenName <<
" Types: ";
286 std::vector<l1t::GlobalObject> condObjType = condObjTypeVec[iCond];
287 for(
size_t iCondType=0; iCondType<condObjType.size(); iCondType++) {
288 std::cout << condObjType.at(iCondType) <<
" ";
293 std::cout <<
" Combinations in Condition [" << condComb->size() <<
"] : ";
294 for (std::vector<SingleCombInCond>::const_iterator itComb = (*condComb).begin(); itComb != (*condComb).end(); itComb++) {
298 unsigned int iType = 0;
300 for (SingleCombInCond::const_iterator itObject = (*itComb).begin(); itObject != (*itComb).end(); itObject++) {
313 if(iType<condObjType.size()-1)
std::cout <<
",";
334 cout <<
" ----------------------------------------------------- " << endl;
335 cout <<
" *********** Run " <<
std::dec << iEvent.
id().
run() <<
" Event " << iEvent.
id().
event() <<
" ************** " << endl;
336 cout <<
" ----------------------------------------------------- " << endl;
341 cout <<
" ========= Rel BX = " <<
std::dec <<
i <<
" ====== Total BX = " <<
m_absBx <<
" ==========" << endl;
345 cout <<
" ------ EGammas -------- " << endl;
347 if(
i>=egammas->getFirstBX() &&
i<=egammas->getLastBX()) {
348 for(std::vector<l1t::EGamma>::const_iterator eg = egammas->begin(
i); eg != egammas->end(
i); ++eg) {
349 cout <<
" " <<
std::dec << std::setw(2) << std::setfill(
' ') << nObj << std::setfill(
'0')<<
")";
350 cout <<
" Pt " <<
std::dec << std::setw(3) << eg->hwPt() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') << eg->hwPt() <<
")";
351 cout <<
" Eta " <<
std::dec << std::setw(3) << eg->hwEta() <<
" (0x" << std::hex << std::setw(2) << std::setfill(
'0') << (eg->hwEta()&0xff) <<
")";
352 cout <<
" Phi " <<
std::dec << std::setw(3) << eg->hwPhi() <<
" (0x" << std::hex << std::setw(2) << std::setfill(
'0') << eg->hwPhi() <<
")";
353 cout <<
" Iso " <<
std::dec << std::setw(1) << eg->hwIso() ;
354 cout <<
" Qual "<<
std::dec << std::setw(1) << eg->hwQual() ;
359 cout <<
"No EG stored for this bx " <<
i << endl;
362 cout <<
"No EG Data in this event " << endl;
367 cout <<
" ------ Muons --------" << endl;
369 if(
i>=muons->getFirstBX() &&
i<=muons->getLastBX()) {
370 for(std::vector<l1t::Muon>::const_iterator
mu = muons->begin(
i);
mu != muons->end(
i); ++
mu) {
371 cout <<
" " <<
std::dec << std::setw(2) << std::setfill(
' ') << nObj << std::setfill(
'0')<<
")";
372 cout <<
" Pt " <<
std::dec << std::setw(3) <<
mu->hwPt() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') <<
mu->hwPt() <<
")";
373 cout <<
" EtaAtVtx " <<
std::dec << std::setw(3) <<
mu->hwEtaAtVtx() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') << (
mu->hwEtaAtVtx()&0x1ff) <<
")";
374 cout <<
" Eta " <<
std::dec << std::setw(3) <<
mu->hwEta() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') << (
mu->hwEta()&0x1ff) <<
")";
375 cout <<
" PhiAtVtx " <<
std::dec << std::setw(3) <<
mu->hwPhiAtVtx() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') <<
mu->hwPhiAtVtx() <<
")";
376 cout <<
" Phi " <<
std::dec << std::setw(3) <<
mu->hwPhi() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') <<
mu->hwPhi() <<
")";
384 cout <<
"No Muons stored for this bx " <<
i << endl;
387 cout <<
"No Muon Data in this event " << endl;
392 cout <<
" ------ Taus ----------" << endl;
394 if(
i>=taus->getFirstBX() &&
i<=taus->getLastBX()) {
395 for(std::vector<l1t::Tau>::const_iterator
tau = taus->begin(
i);
tau != taus->end(
i); ++
tau) {
396 cout <<
" " <<
std::dec << std::setw(2) << std::setfill(
' ') << nObj << std::setfill(
'0')<<
")";
397 cout <<
" Pt " <<
std::dec << std::setw(3) <<
tau->hwPt() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') <<
tau->hwPt() <<
")";
398 cout <<
" Eta " <<
std::dec << std::setw(3) <<
tau->hwEta() <<
" (0x" << std::hex << std::setw(2) << std::setfill(
'0') << (
tau->hwEta()&0xff) <<
")";
399 cout <<
" Phi " <<
std::dec << std::setw(3) <<
tau->hwPhi() <<
" (0x" << std::hex << std::setw(2) << std::setfill(
'0') <<
tau->hwPhi() <<
")";
406 cout <<
"No Taus stored for this bx " <<
i << endl;
409 cout <<
"No Tau Data in this event " << endl;
414 cout <<
" ------ Jets ----------" << endl;
416 if(
i>=jets->getFirstBX() &&
i<=jets->getLastBX()) {
417 for(std::vector<l1t::Jet>::const_iterator
jet = jets->begin(
i);
jet != jets->end(
i); ++
jet) {
418 cout <<
" " <<
std::dec << std::setw(2) << std::setfill(
' ') << nObj << std::setfill(
'0')<<
")";
419 cout <<
" Pt " <<
std::dec << std::setw(3) <<
jet->hwPt() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') <<
jet->hwPt() <<
")";
420 cout <<
" Eta " <<
std::dec << std::setw(3) <<
jet->hwEta() <<
" (0x" << std::hex << std::setw(2) << std::setfill(
'0') << (
jet->hwEta()&0xff) <<
")";
421 cout <<
" Phi " <<
std::dec << std::setw(3) <<
jet->hwPhi() <<
" (0x" << std::hex << std::setw(2) << std::setfill(
'0') <<
jet->hwPhi() <<
")";
427 cout <<
"No Jets stored for this bx " <<
i << endl;
430 cout <<
"No jet Data in this event " << endl;
434 cout <<
" ------ EtSums ----------" << endl;
436 if(
i>=etsums->getFirstBX() &&
i<=etsums->getLastBX()) {
437 for(std::vector<l1t::EtSum>::const_iterator etsum = etsums->begin(
i); etsum != etsums->end(
i); ++etsum) {
438 switch ( etsum->getType() ) {
461 cout <<
" TowerCounts: ";
470 cout <<
" AsymEtHF: ";
473 cout <<
" AsymHtHF: ";
488 cout <<
" Centrality: ";
491 cout <<
" Unknown: ";
494 cout <<
" Et " <<
std::dec << std::setw(3) << etsum->hwPt() <<
" (0x" << std::hex << std::setw(3) << std::setfill(
'0') << etsum->hwPt() <<
")";
498 cout <<
" Phi " <<
std::dec << std::setw(3) << etsum->hwPhi() <<
" (0x" << std::hex << std::setw(2) << std::setfill(
'0') << etsum->hwPhi() <<
")";
502 cout <<
"No EtSums stored for this bx " <<
i << endl;
505 cout <<
"No EtSum Data in this event " << endl;
509 cout <<
" ------ uGtExt ----------" << endl;
511 if(
i>=uGtExt->getFirstBX() &&
i<=uGtExt->getLastBX()) {
512 for(std::vector<GlobalExtBlk>::const_iterator extBlk = uGtExt->begin(
i); extBlk != uGtExt->end(
i); ++extBlk) {
516 cout <<
"No Ext Conditions stored for this bx " <<
i << endl;
519 cout <<
"No uGtExt Data in this event " << endl;
523 cout <<
" ------ uGtAlg ----------" << endl;
525 if(
i>=uGtAlg->getFirstBX() &&
i<=uGtAlg->getLastBX()) {
526 for(std::vector<GlobalAlgBlk>::const_iterator algBlk = uGtAlg->begin(
i); algBlk != uGtAlg->end(
i); ++algBlk) {
530 cout <<
"No Alg Decisions stored for this bx " <<
i << endl;
533 cout <<
"No uGtAlg Data in this event " << endl;
EventNumber_t event() const
std::map< std::string, std::vector< int > > m_algoSummary
EDGetToken uGtObjectMapToken
const std::vector< L1TObjectTypeInCond > & objectTypeVector() const
const std::vector< std::pair< std::string, int > > & prescales()
bool getByToken(EDGetToken token, Handle< PROD > &result) const
bool algoGtlResult() const
void dumpTestVectors(int bx, std::ofstream &myCout, Handle< BXVector< l1t::Muon >> muons, Handle< BXVector< l1t::EGamma >> egammas, Handle< BXVector< l1t::Tau >> taus, Handle< BXVector< l1t::Jet >> jets, Handle< BXVector< l1t::EtSum >> etsums, Handle< BXVector< GlobalAlgBlk >> uGtAlg, Handle< BXVector< GlobalExtBlk >> uGtExt)
const std::vector< GlobalObjectMap > & gtObjectMap() const
get / set the vector of object maps
U second(std::pair< T, U > const &p)
const std::vector< std::pair< std::string, bool > > & decisionsInterm()
const std::vector< std::pair< std::string, bool > > & decisionsInitial()
int algoBitNumber() const
get / set bit number for algorithm in the object map
bool m_dumpTriggerResults
const std::vector< GlobalLogicParser::OperandToken > & operandTokenVector() const
const std::string & algoName() const
destructor
const CombinationsInCond * getCombinationsInCond(const std::string &condNameVal) const
return all the combinations passing the requirements imposed in condition condNameVal ...
const std::vector< std::pair< std::string, bool > > & decisionsFinal()
const std::vector< std::pair< std::string, std::vector< int > > > & masks()
std::vector< SingleCombInCond > CombinationsInCond
all the object combinations evaluated to true in the condition
std::ofstream m_testVectorFile
void retrieveL1(const edm::Event &iEvent, const edm::EventSetup &evSetup)
initialize the class (mainly reserve)