21#include "CLHEP/Random/RandomEngine.h"
22#include "CLHEP/Random/Ranlux64Engine.h"
31 static std::mutex s_metadataMutex;
37const std::function< CLHEP::HepRandomEngine*(void) >
CTPSimRanluxFactory = [](
void)->CLHEP::HepRandomEngine*{
38 return new CLHEP::Ranlux64Engine();
57 ATH_MSG_INFO(
"Will use bunchgroup definition from bunchgroup set");
108 return StatusCode::SUCCESS;
123 return StatusCode::SUCCESS;
133 std::map<std::string, unsigned int> thrMultiMap;
139 return StatusCode::SUCCESS;
146 std::map<std::string,std::vector<std::string>> typeMapping = {
148 {
"jet", {
"JET",
"jJ",
"jLJ",
"gJ",
"gLJ"} },
149 {
"xe", {
"XE",
"gXE",
"jXE"} },
150 {
"te", {
"TE",
"jTE",
"gTE"} },
152 {
"em", {
"EM",
"eEM",
"jEM"} },
153 {
"tau", {
"TAU",
"eTAU",
"jTAU",
"cTAU"} }
155 std::vector<TrigConf::L1Threshold> thrV;
156 for(
const std::string & t : typeMapping[
type] ) {
158 TH2* hist =
new TH2I( Form(
"%sMult", t.c_str()),
159 Form(
"%s threshold multiplicity", t.c_str()), xsize, 0, xsize, maxMult, 0, maxMult);
160 sc =
hbook(
"/multi/" +
type, std::unique_ptr<TH2>(hist));
169 std::map<std::string,std::vector<std::string>> typeMapping = {
171 {
"jet", {
"JET",
"jJ",
"jLJ",
"gJ",
"gLJ"} },
172 {
"xe", {
"XE",
"gXE",
"jXE"} },
173 {
"te", {
"TE",
"jTE",
"gTE"} },
175 {
"em", {
"EM",
"eEM",
"jEM"} },
176 {
"tau", {
"TAU",
"eTAU",
"jTAU",
"cTAU"} }
180 std::vector<TrigConf::L1Threshold> thrV;
181 for(
const std::string & t : typeMapping[
type] ) {
183 auto hist =
get2DHist(
"/multi/" +
type +
"/" + t +
"Mult" );
184 auto & thrV = l1menu.thresholds(t);
185 while( hist->GetNbinsX() < (
int)thrV.size() ) {
186 hist->LabelsInflate(
"xaxis");
188 for(
auto thr : thrV) {
189 hist->GetXaxis()->SetBinLabel(thr->mapping()+1, thr->name().c_str() );
191 }
catch (std::exception & ex) {
192 ATH_MSG_DEBUG(
"Caught exception when setting new JSON MultiplicityHistLabel " << t <<
" : " << ex.what());
201 if(baseHistPath.back()!=
'/') baseHistPath +=
"/";
202 baseHistPath +=
name();
208 const std::string & hname(hist->GetName());
210 std::string key(path);
211 if(key.back()!=
'/') key +=
"/";
215 ATH_MSG_WARNING(
"1D-hist " << key <<
" already exists, won't register it");
216 return StatusCode::RECOVERABLE;
219 LockedHandle<TH1> lh;
221 if(
sc.isSuccess() ) {
222 ATH_MSG_DEBUG(
"1D-hist " << hname <<
" registered with key - " << key);
232 const std::string & hname(hist->GetName());
234 std::string key(path);
235 if(key.back()!=
'/') key +=
"/";
239 ATH_MSG_WARNING(
"2D-hist " << key <<
" already exists, won't register it");
240 return StatusCode::RECOVERABLE;
243 LockedHandle<TH2> lh;
245 if(
sc.isSuccess() ) {
246 ATH_MSG_DEBUG(
"2D-hist " << hname <<
" registered with key - " << key);
258 throw GaudiException(
"1D-hist "+histName +
" does not exist",
name(), StatusCode::FAILURE);
269 throw GaudiException(
"2D-hist "+histName +
" does not exist",
name(), StatusCode::FAILURE);
279 ATH_MSG_DEBUG(
"setHistLabels(). L1 menu " << l1menu.size() <<
" items" );
290 std::vector<std::string> connNames = l1menu.connectorNames();
291 for(
const std::string connName : {
"LegacyTopo0",
"LegacyTopo1",
"Topo1El",
"Topo2El",
"Topo3El",
"Topo1Opt0",
"Topo1Opt1",
"Topo1Opt2",
"Topo1Opt3"}) {
292 if(
find(connNames.begin(), connNames.end(), connName) == connNames.end() ) {
295 auto hTopo = *
get1DHist(
"/input/topo/" + connName);
296 for(
uint fpga : {0,1}) {
297 for(
uint clock : {0,1}) {
298 for(
auto & tl : l1menu.connector(connName).triggerLines(fpga,clock)) {
299 uint flatIndex = tl.flatindex();
300 hTopo->GetXaxis()->SetBinLabel(flatIndex+1,tl.name().c_str());
306 std::vector<std::string> orderedItemnames;
307 orderedItemnames.reserve( l1menu.size() );
308 for(
const auto & item : l1menu ) {
309 orderedItemnames.emplace_back(item.name());
311 std::sort(orderedItemnames.begin(), orderedItemnames.end());
314 auto tbpById = *
get1DHist(
"/output/tbpById" );
315 auto tapById = *
get1DHist(
"/output/tapById" );
316 auto tavById = *
get1DHist(
"/output/tavById" );
317 auto tbpByName = *
get1DHist(
"/output/tbpByName" );
318 auto tapByName = *
get1DHist(
"/output/tapByName" );
319 auto tavByName = *
get1DHist(
"/output/tavByName" );
320 unsigned int bin = 1;
321 for (
const std::string & itemname : orderedItemnames ) {
322 unsigned int ctpId(0);
324 ctpId = item.ctpId();
325 tbpById->GetXaxis()->SetBinLabel( ctpId+1, itemname.c_str() );
326 tapById->GetXaxis()->SetBinLabel( ctpId+1, itemname.c_str() );
327 tavById->GetXaxis()->SetBinLabel( ctpId+1, itemname.c_str() );
328 tbpByName->GetXaxis()->SetBinLabel(
bin, itemname.c_str() );
329 tapByName->GetXaxis()->SetBinLabel(
bin, itemname.c_str() );
330 tavByName->GetXaxis()->SetBinLabel(
bin++, itemname.c_str() );
333 return StatusCode::SUCCESS;
340 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"jJetPt",
"Jet p_{T} - jJ", 40, 0, 80) ));
341 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"jJetEta",
"Jet #eta - jJ", 64, -3.2, 3.2) ));
342 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"jJetPhi",
"Jet #phi - jJ", 64, -3.2, 3.2) ));
343 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"jLJetPt",
"Jet p_{T} - jLJ", 40, 0, 80) ));
344 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"jLJetEta",
"Jet #eta - jLJ", 64, -3.2, 3.2) ));
345 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"jLJetPhi",
"Jet #phi - jLJ", 64, -3.2, 3.2) ));
346 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"gJetPt",
"Jet p_{T} - gJ", 40, 0, 80) ));
347 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"gJetEta",
"Jet #eta - gJ", 64, -3.2, 3.2) ));
348 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"gJetPhi",
"Jet #phi - gJ", 64, -3.2, 3.2) ));
349 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"gLJetPt",
"Jet p_{T} - gLJ", 40, 0, 80) ));
350 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"gLJetEta",
"Jet #eta - gLJ", 64, -3.2, 3.2) ));
351 ATH_CHECK (
hbook(
"/input/jets/", std::make_unique<TH1I>(
"gLJetPhi",
"Jet #phi - gLJ", 64, -3.2, 3.2) ));
354 ATH_CHECK (
hbook(
"/input/met/", std::make_unique<TH1I>(
"Pufit",
"Missing ET from algorithm pufit", 40, 0, 80) ));
355 ATH_CHECK (
hbook(
"/input/met/", std::make_unique<TH1I>(
"PufitPhi",
"Missing ET PUfit phi", 64, -3.2, 3.2) ));
356 ATH_CHECK (
hbook(
"/input/met/", std::make_unique<TH1I>(
"Rho",
"Missing ET from algorithm rhosub", 40, 0, 80) ));
357 ATH_CHECK (
hbook(
"/input/met/", std::make_unique<TH1I>(
"RhoPhi",
"Missing ET rhosub phi", 64, -3.2, 3.2) ));
358 ATH_CHECK (
hbook(
"/input/met/", std::make_unique<TH1I>(
"JwoJ",
"Missing ET from algorithm jet without jets", 40, 0, 80) ));
359 ATH_CHECK (
hbook(
"/input/met/", std::make_unique<TH1I>(
"JwoJPhi",
"Missing ET jet without jet phi", 64, -3.2, 3.2) ));
362 ATH_CHECK (
hbook(
"/input/em/", std::make_unique<TH1I>(
"et",
"Cluster et", 40, 0, 40) ));
363 ATH_CHECK (
hbook(
"/input/em/", std::make_unique<TH1I>(
"eta",
"Cluster eta ", 64, -3.2, 3.2) ));
364 ATH_CHECK (
hbook(
"/input/em/", std::make_unique<TH1I>(
"phi",
"Cluster phi", 64, -3.2, 3.2) ));
367 ATH_CHECK (
hbook(
"/input/tau/", std::make_unique<TH1I>(
"et",
"Tau et", 40, 0, 40) ));
368 ATH_CHECK (
hbook(
"/input/tau/", std::make_unique<TH1I>(
"eta",
"Tau eta ", 64, -3.2, 3.2) ));
369 ATH_CHECK (
hbook(
"/input/tau/", std::make_unique<TH1I>(
"phi",
"Tau phi", 64, -3.2, 3.2) ));
370 ATH_CHECK (
hbook(
"/input/tau/", std::make_unique<TH1I>(
"emIso",
"Tau em isolation", 40, 0, 1) ));
371 ATH_CHECK (
hbook(
"/input/tau/", std::make_unique<TH1I>(
"hadIso",
"Tau hadronic isolation", 40, 0, 1) ));
372 ATH_CHECK (
hbook(
"/input/tau/", std::make_unique<TH1I>(
"R3ET",
"Tau eT", 40, 0, 40) ));
373 ATH_CHECK (
hbook(
"/input/tau/", std::make_unique<TH1I>(
"R3Iso",
"Tau isolation", 40, 0, 1) ));
376 ATH_CHECK (
hbook(
"/input/counts/", std::make_unique<TH1I>(
"jJets",
"Number of jets (jJ)", 40, 0, 40) ));
377 ATH_CHECK (
hbook(
"/input/counts/", std::make_unique<TH1I>(
"jLJets",
"Number of jets (jLJ)", 40, 0, 40) ));
378 ATH_CHECK (
hbook(
"/input/counts/", std::make_unique<TH1I>(
"gJets",
"Number of jets (gJ)", 40, 0, 40) ));
379 ATH_CHECK (
hbook(
"/input/counts/", std::make_unique<TH1I>(
"gLJets",
"Number of jets (gLJ)", 40, 0, 40) ));
380 ATH_CHECK (
hbook(
"/input/counts/", std::make_unique<TH1I>(
"muons",
"Number of muons", 10, 0, 10) ));
381 ATH_CHECK (
hbook(
"/input/counts/", std::make_unique<TH1I>(
"emcluster",
"Number of EM clusters", 20, 0, 20) ));
382 ATH_CHECK (
hbook(
"/input/counts/", std::make_unique<TH1I>(
"taus",
"Number of TAU candidates", 20, 0, 20) ));
393 ATH_CHECK (
hbook(
"/multi/all", (std::unique_ptr<TH2>)std::make_unique<TH2I>(
"LegacyMult",
"Legacy thresholds multiplicity", 1, 0, 1, 10, 0, 10) ));
394 ATH_CHECK (
hbook(
"/multi/all", (std::unique_ptr<TH2>)std::make_unique<TH2I>(
"R3Mult",
"New thresholds multiplicity", 1, 0, 1, 10, 0, 10) ));
397 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"LegacyTopo0",
"L1Topo Decision (Legacy 0)", 64, 0, 64) ));
398 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"LegacyTopo1",
"L1Topo Decision (Legacy 1)", 64, 0, 64) ));
399 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"Topo1El",
"L1Topo Decision (Topo 1 electrical)", 64, 0, 64) ));
400 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"Topo2El",
"L1Topo Decision (Topo 2 electrical)", 64, 0, 64) ));
401 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"Topo3El",
"L1Topo Decision (Topo 3 electrical)", 64, 0, 64) ));
402 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"Topo1Opt0",
"L1Topo Decision (Topo 1 optical 0)", 128, 0, 128) ));
403 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"Topo1Opt1",
"L1Topo Decision (Topo 1 optical 1)", 128, 0, 128) ));
404 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"Topo1Opt2",
"L1Topo Decision (Topo 1 optical 2)", 128, 0, 128) ));
405 ATH_CHECK(
hbook(
"/input/topo/", std::make_unique<TH1I>(
"Topo1Opt3",
"L1Topo Decision (Topo 1 optical 3)", 128, 0, 128) ));
408 ATH_CHECK (
hbook(
"/output/", std::make_unique<TH1I>(
"tbpById",
"Items decision (tbp)", 512, 0, 512) ));
409 ATH_CHECK (
hbook(
"/output/", std::make_unique<TH1I>(
"tapById",
"Items decision (tap)", 512, 0, 512) ));
410 ATH_CHECK (
hbook(
"/output/", std::make_unique<TH1I>(
"tavById",
"Items decision (tav)", 512, 0, 512) ));
411 ATH_CHECK (
hbook(
"/output/", std::make_unique<TH1I>(
"tbpByName",
"Items decision (tbp)", 512, 0, 512) ));
412 ATH_CHECK (
hbook(
"/output/", std::make_unique<TH1I>(
"tapByName",
"Items decision (tap)", 512, 0, 512) ));
413 ATH_CHECK (
hbook(
"/output/", std::make_unique<TH1I>(
"tavByName",
"Items decision (tav)", 512, 0, 512) ));
415 ATH_CHECK (
hbook(
"/", std::make_unique<TH1I>(
"bcid",
"Bunch crossing ID", 3564, 0, 3564)) );
419 return StatusCode::SUCCESS;
430 if(jFexJets.isValid()) {
431 get1DHist(
"/input/counts/jJets")->Fill(jFexJets->size());
432 auto h0 = *
get1DHist(
"/input/jets/jJetPt");
433 auto h1 = *
get1DHist(
"/input/jets/jJetEta");
434 auto h2 = *
get1DHist(
"/input/jets/jJetPhi");
435 for(
const auto jet : *jFexJets ) {
436 h0->Fill(fabs(
jet->et8x8()/1000.));
437 h1->Fill(
jet->eta());
438 h2->Fill(
jet->phi());
448 if(jFexLJets.isValid()) {
449 get1DHist(
"/input/counts/jLets")->Fill(jFexLJets->size());
450 auto h0 = *
get1DHist(
"/input/jets/jLJetPt");
451 auto h1 = *
get1DHist(
"/input/jets/jLJetEta");
452 auto h2 = *
get1DHist(
"/input/jets/jLJetPhi");
453 for(
const auto jet : *jFexLJets ) {
454 h0->Fill(fabs(
jet->et8x8()/1000.));
455 h1->Fill(
jet->eta());
456 h2->Fill(
jet->phi());
468 if(gFexJets.isValid()) {
469 get1DHist(
"/input/counts/gJets")->Fill(gFexJets->size());
470 auto h0 = *
get1DHist(
"/input/jets/gJetPt");
471 auto h1 = *
get1DHist(
"/input/jets/gJetEta");
472 auto h2 = *
get1DHist(
"/input/jets/gJetPhi");
473 for(
const auto jet : *gFexJets ) {
474 h0->Fill(fabs(
jet->et8x8()/1000.));
475 h1->Fill(
jet->eta());
476 h2->Fill(
jet->phi());
486 if( gFexMETPufit.isValid() ) {
487 get1DHist(
"/input/met/Pufit")->Fill(gFexMETPufit->energyT()/1000.);
488 get1DHist(
"/input/met/PufitPhi")->Fill(atan2(gFexMETPufit->energyX(), gFexMETPufit->energyY()));
496 if( gFexMETRho.isValid() ) {
497 get1DHist(
"/input/met/Rho")->Fill(gFexMETRho->energyT()/1000.);
498 get1DHist(
"/input/met/RhoPhi")->Fill(atan2(gFexMETRho->energyX(), gFexMETRho->energyY()));
506 if( gFexMETJwoJ.isValid() ) {
507 get1DHist(
"/input/met/JwoJ")->Fill(gFexMETJwoJ->energyT()/1000.);
508 get1DHist(
"/input/met/JwoJPhi")->Fill(atan2(gFexMETJwoJ->energyX(), gFexMETJwoJ->energyY()));
517 if( eFexCluster.isValid() ) {
518 get1DHist(
"/input/counts/emcluster")->Fill(eFexCluster->size());
522 for(
const auto cl : *eFexCluster ) {
535 if( eFexTau.isValid() ) {
536 get1DHist(
"/input/counts/taus")->Fill(eFexTau->size());
540 auto h3 = *
get1DHist(
"/input/tau/emIso");
541 auto h4 = *
get1DHist(
"/input/tau/hadIso");
542 auto h5 = *
get1DHist(
"/input/tau/R3ClusterET");
543 auto h6 = *
get1DHist(
"/input/tau/R3ClusterIso");
546 for(
const auto tau : *eFexTau ) {
548 h1->Fill(tau->eta());
549 h2->Fill(tau->phi());
550 h3->Fill(tau->emIsol());
551 h4->Fill(tau->hadIsol());
552 h5->Fill(accR3ClET(*tau)/1000.);
553 h6->Fill(accR3ClIso(*tau));
563 if(legacyTopoInput.isValid()) {
565 ATH_MSG_DEBUG(
"L1TopoLegacy0 word 0 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << legacyTopoInput->cableWord1(0));
566 ATH_MSG_DEBUG(
"L1TopoLegacy0 word 1 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << legacyTopoInput->cableWord1(1));
567 ATH_MSG_DEBUG(
"L1TopoLegacy1 word 0 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << legacyTopoInput->cableWord2(0));
568 ATH_MSG_DEBUG(
"L1TopoLegacy1 word 1 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << legacyTopoInput->cableWord2(1));
569 auto h0 = *
get1DHist(
"/input/topo/LegacyTopo0");
570 auto h1 = *
get1DHist(
"/input/topo/LegacyTopo1");
571 for(
unsigned int i=0; i<32; ++i) {
572 uint32_t mask = 0x1; mask <<= i;
573 if( (legacyTopoInput->cableWord1(0) & mask) != 0 ) h0->Fill(i);
574 if( (legacyTopoInput->cableWord1(1) & mask) != 0 ) h0->Fill(32 + i);
575 if( (legacyTopoInput->cableWord2(0) & mask) != 0 ) h1->Fill(i);
576 if( (legacyTopoInput->cableWord2(1) & mask) != 0 ) h1->Fill(32 + i);
583 if(topoInput.isValid()) {
585 ATH_MSG_DEBUG(
"L1Topo0 word 0 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << topoInput->cableWord1(0));
586 ATH_MSG_DEBUG(
"L1Topo0 word 1 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << topoInput->cableWord1(1));
587 ATH_MSG_DEBUG(
"L1Topo1 word 0 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << topoInput->cableWord2(0));
588 ATH_MSG_DEBUG(
"L1Topo1 word 1 is: 0x" << std::hex << std::setw( 8 ) << std::setfill(
'0' ) << topoInput->cableWord2(1));
589 auto h0 = *
get1DHist(
"/input/topo/Topo2El");
590 auto h1 = *
get1DHist(
"/input/topo/Topo3El");
591 for(
unsigned int i=0; i<32; ++i) {
592 uint32_t mask = 0x1; mask <<= i;
593 if( (topoInput->cableWord1(0) & mask) != 0 ) h0->Fill(i);
594 if( (topoInput->cableWord1(1) & mask) != 0 ) h0->Fill(32 + i);
595 if( (topoInput->cableWord2(0) & mask) != 0 ) h1->Fill(i);
596 if( (topoInput->cableWord2(1) & mask) != 0 ) h1->Fill(32 + i);
598 auto h2 = *
get1DHist(
"/input/topo/Topo1Opt0");
599 auto h3 = *
get1DHist(
"/input/topo/Topo1Opt1");
600 auto h4 = *
get1DHist(
"/input/topo/Topo1Opt2");
601 auto h5 = *
get1DHist(
"/input/topo/Topo1Opt3");
602 for(
unsigned int i=0; i<128; i += 3) {
603 std::bitset<128> mask = 0x11; mask <<= i;
604 if( (topoInput->optcableWord(
"Topo1Opt0") & mask) != 0 ) h2->Fill(i);
605 if( (topoInput->optcableWord(
"Topo1Opt1") & mask) != 0 ) h3->Fill(i);
606 if( (topoInput->optcableWord(
"Topo1Opt2") & mask) != 0 ) h4->Fill(i);
607 if( (topoInput->optcableWord(
"Topo1Opt3") & mask) != 0 ) h5->Fill(i);
615 auto bcid = context.eventID().bunch_crossing_id();
618 return StatusCode::SUCCESS;
629 std::vector<std::string> connNames = l1menu->connectorNames();
630 for (
const std::string connName : {
"LegacyTopo0",
"LegacyTopo1",
"Topo1El",
"Topo2El",
"Topo3El",
"Topo1Opt0",
"Topo1Opt1",
"Topo1Opt2",
"Topo1Opt3",
"CTPCAL",
"NIM2"})
632 if(
find(connNames.begin(), connNames.end(), connName) == connNames.end() ) {
635 bool opt_cable =
false;
636 std::bitset<128> cable128 {0};
638 if (connName.starts_with(
"Legacy")) {
644 if (not topoInput.isValid()) {
647 if(connName ==
"LegacyTopo0") {
648 cable = ( (uint64_t)topoInput->cableWord1( 1 ) << 32) + topoInput->cableWord1( 0 );
649 }
else if (connName ==
"LegacyTopo1") {
650 cable = ( (uint64_t)topoInput->cableWord2( 1 ) << 32) + topoInput->cableWord2( 0 );
653 else if (connName.starts_with(
"CTPCAL") &&
m_doZDC)
656 if (not zdcInput.isValid())
660 cable =
static_cast<uint64_t
>(zdcInput->cableWord0());
661 auto &conn = l1menu->connector(connName);
662 for (
auto &tl : conn.triggerLines()){
663 if (tl.name().find(
"ZDC") == std::string::npos)
667 uint flatIndex = tl.flatindex();
668 uint pass = (cable & (uint64_t(0x1) << flatIndex)) == 0 ? 0 : 1;
669 thrMultiMap[tl.name()] = pass;
670 ATH_MSG_DEBUG(tl.name() <<
" MULT calculated mult for topo " << pass);
675 else if (connName.starts_with(
"NIM2"))
680 if (not trtInput.isValid())
684 cable =
static_cast<uint64_t
>(trtInput->cableWord0());
685 auto &conn = l1menu->connector(connName);
686 for (
auto &tl : conn.triggerLines()){
687 if (tl.name().find(
"TRT") == std::string::npos)
691 uint flatIndex = tl.flatindex();
692 uint pass = (cable & (uint64_t(0x1) << flatIndex)) == 0 ? 0 : 1;
693 thrMultiMap[tl.name()] = pass;
694 ATH_MSG_DEBUG(tl.name() <<
" MULT calculated mult for topo " << pass);
700 if (not zdcInput.isValid())
704 cable =
static_cast<uint64_t
>(zdcInput->cableWord1());
705 auto &conn = l1menu->connector(connName);
706 for (
const auto &tl : conn.triggerLines()){
707 if (tl.name().find(
"ZDC") == std::string::npos)
711 uint flatIndex = tl.flatindex();
712 uint pass = (cable & (uint64_t(0x1) << flatIndex)) == 0 ? 0 : 1;
713 thrMultiMap[tl.name()] = pass;
714 ATH_MSG_DEBUG(tl.name() <<
" MULT calculated mult for topo " << pass);
726 if (not topoInput.isValid()) {
729 if(connName ==
"Topo1El") {
730 cable = ( (uint64_t)topoInput->cableWord0( 1 ) << 32) + topoInput->cableWord0( 0 );
731 }
else if(connName ==
"Topo2El") {
732 cable = ( (uint64_t)topoInput->cableWord1( 1 ) << 32) + topoInput->cableWord1( 0 );
733 }
else if (connName ==
"Topo3El") {
734 cable = ( (uint64_t)topoInput->cableWord2( 1 ) << 32) + topoInput->cableWord2( 0 );
735 }
else if(connName ==
"Topo1Opt0") {
736 ATH_MSG_DEBUG(
"BIT word Topo1Opt0: " << topoInput->optcableWord( connName ));
738 cable128 = topoInput->optcableWord( connName );
739 }
else if(connName ==
"Topo1Opt1") {
740 ATH_MSG_DEBUG(
"BIT word Topo1Opt1: " << topoInput->optcableWord( connName ));
742 cable128 = topoInput->optcableWord( connName );
743 }
else if(connName ==
"Topo1Opt2") {
744 ATH_MSG_DEBUG(
"BIT word Topo1Opt2: " << topoInput->optcableWord( connName ));
746 cable128 = topoInput->optcableWord( connName );
747 }
else if(connName ==
"Topo1Opt3") {
748 ATH_MSG_DEBUG(
"BIT word Topo1Opt3: " << topoInput->optcableWord( connName ));
750 cable128 = topoInput->optcableWord( connName );
753 auto & conn = l1menu->connector(connName);
754 for(
uint fpga : {0,1}) {
755 for(
uint clock : {0,1}) {
756 for(
auto & tl : conn.triggerLines(fpga,clock)) {
757 uint flatIndex = tl.flatindex();
760 pass = ((cable128 >> flatIndex).test(0)) == 0 ? 0 : 1;
763 pass = (cable & (
static_cast<uint64_t
>(0x1) << flatIndex)) == 0 ? 0 : 1;
765 if(
size_t pos = tl.name().find(
'['); pos == std::string::npos) {
766 thrMultiMap[tl.name()] = pass;
767 ATH_MSG_DEBUG(tl.name() <<
" MULT calculated mult for topo " << pass);
769 auto thrName = tl.name().substr(0,pos);
770 int bit = std::stoi(tl.name().substr(pos+1));
771 thrMultiMap.try_emplace(thrName, 0);
772 thrMultiMap[thrName] += (pass << bit);
773 ATH_MSG_DEBUG(thrName <<
" MULT updated mult for topo " << pass);
779 for (
auto & thr : l1menu->thresholds() ) {
780 if (thr->type() ==
"TOPO" or thr->type() ==
"MULTTOPO" or thr->type() ==
"MUTOPO")
784 if( thr->type() ==
"ZDC" &&
m_doZDC ){
787 if( thr->name() ==
"NIMTRT" &&
m_doTRT ){
793 thrMultiMap[thr->name()] = multiplicity;
794 ATH_MSG_DEBUG( thr->name() <<
" MULT calculated mult for topo " << multiplicity);
798 auto bcid = context.eventID().bunch_crossing_id();
801 for (
size_t bg = 0; bg < 16; ++bg ) {
802 std::string bgName(
"BGRP");
803 bgName += std::to_string(bg);
815 std::shared_ptr<TrigConf::L1BunchGroup> bg = l1bgs->
getBunchGroup(i);
816 thrMultiMap[std::string(
"BGRP") + std::to_string(i)] = bg->contains(bcid) ? 1 : 0;
821 ATH_MSG_ERROR(
"Did not find L1BunchGroupSet in DetectorStore");
826 thrMultiMap[
"RNDM0"] = 1;
827 thrMultiMap[
"RNDM1"] = 1;
828 thrMultiMap[
"RNDM2"] = 1;
829 thrMultiMap[
"RNDM3"] = 1;
831 return StatusCode::SUCCESS;
837 unsigned int multiplicity = 0;
838 if( confThr.
type() ==
"JET" ) {
841 if ( ctpinJet.isValid() ) {
842 if( l1menu->connector(
"JET1").hasLine(confThr.
name()) ) {
843 auto & triggerline = l1menu->connector(
"JET1").triggerLine(confThr.
name());
844 multiplicity =
CTPUtil::getMult( ctpinJet->cableWord0(), triggerline.startbit(), triggerline.endbit() );
845 }
else if( l1menu->connector(
"JET2").hasLine(confThr.
name()) ) {
846 auto & triggerline = l1menu->connector(
"JET2").triggerLine(confThr.
name());
847 multiplicity =
CTPUtil::getMult( ctpinJet->cableWord1(), triggerline.startbit(), triggerline.endbit() );
853 ATH_MSG_DEBUG(
"JET MULT calculated mult for threshold " << confThr.
name() <<
" : " << multiplicity);
860 unsigned int multiplicity (0);
861 if ( confThr.
name()[0]==
'e' ) {
864 float scale = l1menu->getObject(
"thresholds.legacyCalo.EM.emscale").getValue<
float>();
866 for (
const auto cl : *eFexCluster ) {
867 float eta = cl->eta();
868 int ieta = int((
eta + (
eta>0 ? 0.005 : -0.005))/0.1);
869 unsigned int thrV = confThr.
thrValue( ieta );
870 bool clusterPasses = ( ((
unsigned int) cl->et()) > (thrV * scale) );
871 multiplicity += clusterPasses ? 1 : 0;
878 if ( ctpinEM.isValid() ) {
879 if( l1menu->connector(
"EM1").hasLine(confThr.
name()) ) {
880 auto & triggerline = l1menu->connector(
"EM1").triggerLine(confThr.
name());
881 multiplicity =
CTPUtil::getMult( ctpinEM->cableWord0(), triggerline.startbit(), triggerline.endbit() );
882 }
else if( l1menu->connector(
"EM2").hasLine(confThr.
name()) ) {
883 auto & triggerline = l1menu->connector(
"EM2").triggerLine(confThr.
name());
884 multiplicity =
CTPUtil::getMult( ctpinEM->cableWord1(), triggerline.startbit(), triggerline.endbit() );
890 ATH_MSG_DEBUG(
"EM MULT calculated mult for threshold " << confThr.
name() <<
" : " << multiplicity);
897 unsigned int multiplicity = 0;
898 if ( confThr.
name()[0]==
'e' ) {
903 if( eFexTaus.isValid() ) {
904 for (
const auto tau : *eFexTaus ) {
905 unsigned int eT = (
unsigned int) (accR3ClET(*tau)/1000.);
907 unsigned int etCut = confThr.
data().get_child(
"et").get_value<
unsigned int>();
908 bool tauPasses = ( eT >= etCut );
909 multiplicity += tauPasses ? 1 : 0;
916 if ( ctpinEM.isValid() ) {
917 if( l1menu->connector(
"TAU1").hasLine(confThr.
name()) ) {
918 auto & triggerline = l1menu->connector(
"TAU1").triggerLine(confThr.
name());
919 multiplicity =
CTPUtil::getMult( ctpinEM->cableWord2(), triggerline.startbit(), triggerline.endbit() );
920 }
else if( l1menu->connector(
"TAU2").hasLine(confThr.
name()) ) {
921 auto & triggerline = l1menu->connector(
"TAU2").triggerLine(confThr.
name());
922 multiplicity =
CTPUtil::getMult( ctpinEM->cableWord3(), triggerline.startbit(), triggerline.endbit() );
928 ATH_MSG_DEBUG(
"TAU MULT calculated mult for threshold " << confThr.
name() <<
" : " << multiplicity);
935 unsigned int multiplicity = 0;
936 if ( confThr.
type() ==
"XE" or confThr.
type() ==
"TE" or confThr.
type() ==
"XS" ) {
940 if ( ctpinEnergy.isValid() ) {
941 if( l1menu->connector(
"EN1").hasLine(confThr.
name()) ) {
942 auto & triggerline = l1menu->connector(
"EN1").triggerLine(confThr.
name());
943 multiplicity =
CTPUtil::getMult( ctpinEnergy->cableWord0(), triggerline.startbit(), triggerline.endbit() );
944 }
else if( l1menu->connector(
"EN2").hasLine(confThr.
name()) ) {
945 auto & triggerline = l1menu->connector(
"EN2").triggerLine(confThr.
name());
946 multiplicity =
CTPUtil::getMult( ctpinEnergy->cableWord1(), triggerline.startbit(), triggerline.endbit() );
953 if ( confThr.
name().find(
"gXENC")==0 ) {
956 }
else if ( confThr.
name().find(
"gXERHO")==0 ) {
959 }
else if ( confThr.
name().find(
"gXEJWOJ")==0 ) {
968 multiplicity = (
met->energyT()/1000. < confThr.
getAttribute<
unsigned int>(
"xe") ) ? 0 : 1;
971 if(confThr.
type() ==
"TE") {
973 ATH_MSG_DEBUG(
"TE MULT calculated mult for threshold " << confThr.
name() <<
" : " << multiplicity);
974 }
else if(confThr.
type() ==
"XS") {
976 ATH_MSG_DEBUG(
"XS MULT calculated mult for threshold " << confThr.
name() <<
" : " << multiplicity);
979 ATH_MSG_DEBUG(
"XE MULT calculated mult for threshold " << confThr.
name() <<
" : " << multiplicity);
990 unsigned int multiplicity = 0;
992 if ( ctpinMuon.isValid() ) {
993 auto & triggerline = l1menu->connector(
"MuCTPiOpt0").triggerLine(confThr.
name());
997 ATH_MSG_DEBUG(
"MU MULT calculated mult for threshold " << confThr.
name() <<
" : " << multiplicity);
1007 unsigned int multiplicity = 0;
1009 std::string connector =
"";
1010 if (topoInput.isValid()) {
1011 connector = l1menu->connectorNameFromThreshold(confThr.
name());
1012 auto & triggerline = l1menu->connector(connector).triggerLine(confThr.
name());
1013 std::bitset<128> bits = topoInput->optcableWord(connector);
1016 std::string subfolder =
"";
1017 if (confThr.
type().find(
"XE") != std::string::npos) {
1019 }
else if (confThr.
type().find(
"TE") != std::string::npos) {
1021 }
else if (confThr.
type().find(
"TAU") != std::string::npos) {
1023 }
else if (confThr.
type().find(
"EM") != std::string::npos) {
1025 }
else if (confThr.
type().find(
"jJ") != std::string::npos) {
1027 }
else if (confThr.
type().find(
"jLJ") != std::string::npos) {
1029 }
else if (confThr.
type().find(
"gJ") != std::string::npos) {
1031 }
else if (confThr.
type().find(
"gLJ") != std::string::npos) {
1034 get2DHist(
"/multi/" + subfolder +
"/" + confThr.
type() +
"Mult" )->Fill(confThr.
mapping(), multiplicity);
1035 ATH_MSG_DEBUG(
"TOPO OPT input MULT calculated mult for threshold " << confThr.
name() <<
" : " << multiplicity <<
" received via connector: " << connector);
1037 return multiplicity;
1043 unsigned int multiplicity = 0;
1051 if(topoInput.isValid()) {
1053 std::string conn(
"");
1054 if( l1menu->connector(
"LegacyTopo0").hasLine(confThr.
name()) ) {
1055 conn =
"LegacyTopo0";
1056 cable = ( (uint64_t)topoInput->cableWord1( 1 ) << 32) + topoInput->cableWord1( 0 );
1057 }
else if( l1menu->connector(
"LegacyTopo1").hasLine(confThr.
name()) ) {
1058 conn =
"LegacyTopo1";
1059 cable = ( (uint64_t)topoInput->cableWord2( 1 ) << 32) + topoInput->cableWord2( 0 );
1062 auto & triggerline = l1menu->connector(conn).triggerLine(confThr.
name());
1064 <<
", cable start " << triggerline.startbit() <<
" and end " << triggerline.endbit()
1065 <<
" double word 0x" << std::setw(16) << std::setfill(
'0') << std::hex << cable << std::dec << std::setfill(
' ') );
1066 multiplicity =
CTPUtil::getMultTopo( cable, triggerline.startbit(), triggerline.endbit(), triggerline.clock() );
1077 if(topoInput.isValid()) {
1079 std::string conn(
"");
1080 if( l1menu->connector(
"Topo2El").hasLine(confThr.
name()) ) {
1082 cable = ( (uint64_t)topoInput->cableWord1( 1 ) << 32) + topoInput->cableWord1( 0 );
1083 }
else if( l1menu->connector(
"Topo3El").hasLine(confThr.
name()) ) {
1085 cable = ( (uint64_t)topoInput->cableWord2( 1 ) << 32) + topoInput->cableWord2( 0 );
1088 auto & triggerline = l1menu->connector(conn).triggerLine(confThr.
name());
1090 <<
", cable start " << triggerline.startbit() <<
" and end " << triggerline.endbit()
1091 <<
" double word 0x" << std::setw(16) << std::setfill(
'0') << std::hex << cable << std::dec << std::setfill(
' ') );
1092 multiplicity =
CTPUtil::getMultTopo( cable, triggerline.startbit(), triggerline.endbit(), triggerline.clock() );
1096 return multiplicity;
1102 unsigned int multiplicity = 0;
1104 if ( confThr.
type() ==
"EM" ) {
1106 }
else if ( confThr.
type() ==
"TAU" ) {
1108 }
else if ( confThr.
type() ==
"XE" || confThr.
type() ==
"TE" || confThr.
type() ==
"XS" ) {
1110 }
else if ( confThr.
type() ==
"JET" ) {
1112 }
else if ( confThr.
type() ==
"MU" ) {
1114 }
else if ( confThr.
type() ==
"R2TOPO") {
1116 }
else if ( confThr.
type() ==
"TOPO" ) {
1118 }
else if ( confThr.
type()[0] ==
'e' || confThr.
type()[0] ==
'c' || confThr.
type()[0] ==
'j' || confThr.
type()[0] ==
'g' ){
1122 catch(std::exception & ex) {
1123 ATH_MSG_FATAL(
"Caught exception when calculating multiplicity for threshold " << confThr.
name() <<
": " << ex.what());
1127 return multiplicity;
1132 const EventContext& context)
const
1135 std::vector<uint32_t> tip;
1138 std::map<std::string, unsigned int> itemDecisionMap;
1139 CLHEP::HepRandomEngine* rndmEngine =
m_RNGEngines.getEngine( context );
1142 std::vector<uint32_t> tbp;
1143 std::vector<uint32_t> tap;
1144 std::vector<uint32_t> tav;
1145 unsigned char triggerType(0);
1146 CHECK(
m_resultBuilder->constructResultVectors( itemDecisionMap, tbp, tap, tav, triggerType ) );
1150 const std::vector<uint32_t> extra(
size_t{6}, uint32_t{0});
1152 auto eventID = context.eventID();
1156 std::pair< std::unique_ptr<xAOD::CTPResult>, std::unique_ptr<xAOD::CTPResultAuxInfo> > ctpResultAuxPair =
m_resultBuilder->constructCTPResult( eventID, tbp, tap, tav, tip, extra, triggerType);
1157 std::unique_ptr<xAOD::CTPResult> ctpResult = std::move(ctpResultAuxPair.first);
1158 std::unique_ptr<xAOD::CTPResultAuxInfo> ctpResultAux = std::move(ctpResultAuxPair.second);
1160 ATH_CHECK( ctpResultWriteHandle.record( std::move(ctpResult), std::move(ctpResultAux) ));
1163 std::unique_ptr<CTP_RDO> rdo =
m_resultBuilder->constructRDOResult( eventID, tbp, tap, tav, tip, extra );
1165 ATH_CHECK( rdoWriteHandle.record( std::move(rdo) ));
1167 std::unique_ptr<CTPSLink> roi =
m_resultBuilder->constructRoIResult( eventID, tbp, tap, tav, tip, extra, triggerType );
1169 ATH_CHECK( sLinkWriteHandle.record( std::move(roi) ));
1173 auto tbpById = *
get1DHist(
"/output/tbpById" );
1174 auto tapById = *
get1DHist(
"/output/tapById" );
1175 auto tavById = *
get1DHist(
"/output/tavById" );
1176 for(
unsigned int ctpId= 0; ctpId < 512; ++ctpId ) {
1177 unsigned int wordNr = ctpId / 32;
1178 unsigned int posWithinWord = ctpId % 32;
1179 auto mask = 1L << posWithinWord;
1180 if( 0 != (tbp[wordNr] & mask) ) {
1181 tbpById->Fill( ctpId );
1183 if( 0 != (tap[wordNr] & mask) ) {
1184 tapById->Fill( ctpId );
1186 if( 0 != (tav[wordNr] & mask) ) {
1187 tavById->Fill( ctpId );
1191 return StatusCode::SUCCESS;
1201 constexpr unsigned int sizeOfCTPOutput = 512;
1203 unsigned int tbp[sizeOfCTPOutput];
1204 unsigned int tap[sizeOfCTPOutput];
1205 unsigned int tav[sizeOfCTPOutput];
1208 for(
unsigned int id = 0;
id < sizeOfCTPOutput; ++id ) tbp[
id] =
h->GetBinContent(
id+1);
1212 for(
unsigned int id = 0;
id < sizeOfCTPOutput; ++id ) tap[
id] =
h->GetBinContent(
id+1);
1216 for(
unsigned int id = 0;
id < sizeOfCTPOutput; ++id ) tav[
id] =
h->GetBinContent(
id+1);
1221 auto htbp = *
get1DHist(
"/output/tbpByName" );
1222 auto htap = *
get1DHist(
"/output/tapByName" );
1223 auto htav = *
get1DHist(
"/output/tavByName" );
1224 for(
auto & item : *l1menu ) {
1225 unsigned int ctpId = item.ctpId();
1226 htbp->Fill( item.name().c_str(), tbp[ctpId]);
1227 htap->Fill( item.name().c_str(), tap[ctpId]);
1228 htav->Fill( item.name().c_str(), tav[ctpId]);
1233 htbp->LabelsDeflate();
1234 htap->LabelsDeflate();
1235 htav->LabelsDeflate();
1242 std::vector<std::string> thrHists{
"em/EM",
"muon/MU",
"tau/TAU",
"jet/JET",
"xe/XE",
"te/TE",
"xs/XS" };
1243 auto hist = *
get2DHist(
"/multi/all/LegacyMult" );
1244 for(
const std::string & histpath : thrHists) {
1245 auto h = *
get2DHist(
"/multi/" + histpath +
"Mult" );
1246 auto xaxis =
h->GetXaxis();
1247 size_t xsize = xaxis->GetNbins();
1248 size_t ysize =
h->GetNbinsY();
1249 for(
size_t x = 1;
x<xsize;
x++) {
1251 for(
size_t y = 1;
y<=ysize;
y++) {
1252 size_t binContent =
h->GetBinContent(
x,
y);
1253 hist->Fill(xaxis->GetBinLabel(
x),
y-1,binContent);
1254 s += std::to_string(binContent) +
" ";
1256 ATH_MSG_DEBUG(
"REGTEST CTPSim " << xaxis->GetBinLabel(
x) <<
" MULT " << s);
1260 hist->LabelsDeflate();
1264 auto hist = *
get2DHist(
"/multi/all/R3Mult" );
1265 std::vector<std::string> thrHists = {
"em/eEM",
"em/jEM",
"muon/MU",
"tau/eTAU",
"tau/jTAU",
"tau/cTAU",
"jet/jJ",
"jet/jLJ",
"jet/gJ",
"jet/gLJ",
"xe/gXE",
"xe/jXE",
"te/jTE",
"te/gTE" };
1266 for(
const std::string & histpath : thrHists) {
1267 auto h = *
get2DHist(
"/multi/" + histpath +
"Mult" );
1268 auto xaxis =
h->GetXaxis();
1269 size_t xsize = xaxis->GetNbins();
1270 size_t ysize =
h->GetNbinsY();
1271 for(
size_t x = 1;
x<=xsize;
x++) {
1273 for(
size_t y = 1;
y<=ysize;
y++) {
1274 size_t binContent =
h->GetBinContent(
x,
y);
1275 hist->Fill(xaxis->GetBinLabel(
x) ,
y-1, binContent);
1276 s += std::to_string(binContent) +
" ";
1278 ATH_MSG_DEBUG(
"REGTEST CTPSim " << xaxis->GetBinLabel(
x) <<
" MULT " << s);
1282 hist->LabelsDeflate();
1285 if (
msgLvl(MSG::DEBUG) ) {
1286 for(
auto & item : *l1menu ) {
1287 ATH_MSG_DEBUG(
"REGTEST CTPSim " << item.name() <<
" " << item.ctpId() <<
1288 " TBP " << tbp[item.ctpId()] <<
1289 " TAP " << tap[item.ctpId()] <<
1290 " TAV " << tav[item.ctpId()]);
1293 return StatusCode::SUCCESS;
1302 std::vector<std::string> storedPaths;
1309 std::scoped_lock<std::mutex> metadataLock(s_metadataMutex);
1310 for (
const auto & path : storedPaths) {
1311 size_t pos = path.find_last_of(
'/');
1312 auto splitPath = std::make_pair(path.substr(0, pos), path.substr(pos + 1));
1313 std::string treePath = splitPath.first +
"/metadata";
1314 std::string interval(
"run");
1315 char triggerData[] =
"<none>";
1316 const std::string mergeDataStr =
"<default>";
1317 std::vector<char> mergeData{mergeDataStr.begin(), mergeDataStr.end()};
1318 mergeData.push_back(
'\0');
1321 auto tree = std::make_unique<TTree>(
"metadata",
"Monitoring Metadata");
1322 tree->SetDirectory(
nullptr);
1323 tree->Branch(
"Name", &(splitPath.second[0]),
"Name/C");
1324 tree->Branch(
"Interval", &(interval[0]),
"Interval/C");
1325 tree->Branch(
"TriggerChain", triggerData,
"TriggerChain/C");
1326 tree->Branch(
"MergeMethod", mergeData.data(),
"MergeMethod/C");
1331 <<
"Failed to register DQ metadata TTree " << treePath <<
endmsg;
1334 TTree *
tree{
nullptr};
1336 tree->SetBranchAddress(
"Name", &(splitPath.second[0]));
1337 tree->SetBranchAddress(
"Interval", &(interval[0]));
1338 tree->SetBranchAddress(
"TriggerChain", triggerData);
1339 tree->SetBranchAddress(
"MergeMethod", mergeData.data());
1344 <<
"Failed to retrieve DQ metadata TTree " << treePath <<
" which is reported to exist" <<
endmsg;
1348 return StatusCode::SUCCESS;
Scalar eta() const
pseudorapidity method
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_WARNING(x)
Maintain a set of objects, one per slot.
const std::function< CLHEP::HepRandomEngine *(void) > CTPSimRanluxFactory
#define CHECK(...)
Evaluate an expression and check for errors.
Define macros for attributes used to control the static checker.
#define ATLAS_THREAD_SAFE
const ServiceHandle< StoreGateSvc > & detStore() const
bool msgLvl(const MSG::Level lvl) const
An algorithm that can be simultaneously executed in multiple threads.
unsigned int calculateJetMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
Gaudi::Property< std::string > m_histPath
SG::ReadHandleKey< xAOD::EnergySumRoI > m_iKeyGFexMETRho
SG::ReadHandleKey< xAOD::JetRoIContainer > m_iKeyJFexLJets
virtual StatusCode stop() override
StatusCode fillInputHistograms(const EventContext &context) const
Gaudi::Property< bool > m_forceBunchGroupPattern
unsigned int calculateTopoMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context, bool UseLegacy) const
Gaudi::Property< bool > m_doL1TopoLegacy
SG::ReadHandleKey< xAOD::JetRoIContainer > m_iKeyJFexJets
Gaudi::Property< bool > m_doL1Topo
unsigned int calculateTopoOptMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
unsigned int calculateTauMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
SG::ReadHandleKey< LVL1::FrontPanelCTP > m_iKeyTopo
SG::ReadHandleKey< LVL1::FrontPanelCTP > m_iKeyLegacyTopo
SG::ReadHandleKey< LVL1::EmTauCTP > m_iKeyCtpinEM
unsigned int calculateMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
SG::WriteHandleKey< xAOD::CTPResult > m_oKeyCTPResult
virtual StatusCode start() override
StatusCode setHistLabels(const TrigConf::L1Menu &l1menu)
LockedHandle< TH2 > & get2DHist(const std::string &histName) const
LockedHandle< TH1 > & get1DHist(const std::string &histName) const
StatusCode simulateItems(const std::map< std::string, unsigned int > &thrMultiMap, const EventContext &context) const
SG::ReadHandleKey< LVL1::EnergyCTP > m_iKeyCtpinXE
unsigned int calculateMETMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
unsigned int calculateEMMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
virtual StatusCode initialize() override
unsigned int calculateMuonMultiplicity(const TrigConf::L1Threshold &confThr, const TrigConf::L1Menu *l1menu, const EventContext &context) const
SG::WriteHandleKey< CTP_RDO > m_oKeyRDO
std::map< std::string, LockedHandle< TH2 > > m_hist2D
std::map< std::string, LockedHandle< TH1 > > m_hist1D
SG::ReadHandleKey< LVL1::TrtCTP > m_iKeyTRT
SG::ReadHandleKey< xAOD::EnergySumRoI > m_iKeyGFexMETNC
StatusCode setMultiplicityHistLabels(const TrigConf::L1Menu &l1menu, const std::string &type)
Gaudi::Property< bool > m_useEDMxAOD
SG::ReadHandleKey< xAOD::EmTauRoIContainer > m_iKeyEFexTau
virtual StatusCode execute(const EventContext &context) const override
SG::ReadCondHandleKey< TrigConf::L1BunchGroupSet > m_bgKey
SG::ReadHandleKey< xAOD::TrigEMClusterContainer > m_iKeyEFexCluster
ATHRNG::RNGWrapper m_RNGEngines
Gaudi::Property< bool > m_muonRun2Format
ServiceHandle< ITHistSvc > m_histSvc
Gaudi::Property< unsigned int > m_bunchGroupPattern
SG::ReadHandleKey< xAOD::JetRoIContainer > m_iKeyGFexJets
Gaudi::Property< bool > m_doL1CaloLegacy
SG::ReadHandleKey< xAOD::EnergySumRoI > m_iKeyGFexMETJwoJ
SG::WriteHandleKey< CTPSLink > m_oKeySLink
StatusCode hbook(const std::string &path, std::unique_ptr< TH1 > hist)
std::string getBaseHistPath() const
StatusCode storeMetadata()
SG::ReadHandleKey< LVL1::MuCTPICTP > m_iKeyMuctpi
SG::ReadHandleKey< LVL1::ZdcCTP > m_iKeyZDC
Gaudi::Property< bool > m_doTRT
Gaudi::Property< bool > m_isData
SG::ReadHandleKey< LVL1::JetCTP > m_iKeyCtpinJet
ToolHandle< LVL1CTP::ResultBuilder > m_resultBuilder
CTPSimulation(const std::string &name, ISvcLocator *pSvcLocator)
StatusCode createMultiplicityHist(const std::string &type, unsigned int maxMult=10)
StatusCode extractMultiplicities(std::map< std::string, unsigned int > &thrMultiMap, const EventContext &context) const
Gaudi::Property< bool > m_doZDC
static unsigned int getMultTopo(uint64_t word, unsigned int startbit, unsigned int endbit, unsigned int clock)
extract multiplicities from Topo words, were the encoding is different
static int getOptMult(std::bitset< 128 > bits, unsigned int startbit, unsigned int endbit)
static int getMult(uint64_t word, unsigned int startbit, unsigned int endbit)
extract multiplicities using new trigger configuration interface
static int getMuonMult(unsigned int word, int threshold)
get Muon multiplicty in legacy mode
SG::ConstAccessor< T, ALLOC > ConstAccessor
Property holding a SG store/key/clid from which a ReadHandle is made.
bool empty() const
Test if the key is blank.
virtual const std::string & name() const final
const ptree & data() const
Access to the underlying data, if needed.
T getAttribute(const std::string &key, bool ignoreIfMissing=false, const T &def=T()) const
Access to simple attribute.
constexpr std::size_t maxNBunchGroups() const
Maximum number of bunchgroups.
const std::shared_ptr< L1BunchGroup > & getBunchGroup(const std::string &name) const
Accessor to the bunchgroup by name.
L1 threshold configuration.
Standard L1 threshold configuration.
virtual float thrValue(int eta=0) const
Accessor to the threshold value for eta-dependent threholds.
unsigned int mapping() const
Accessor to the mapping number The mapping is unique within a type.
const std::string & type() const
Accessor to the threshold type.
std::string find(const std::string &s)
return a remapped string
IMessageSvc * getMessageSvc(bool quiet=false)
static const std::string DEFAULT_RDOOutputLocation_Rerun
location of CTP RDO output in StoreGate for simulation rerun on data
static const std::string DEFAULT_CTPResultOutputLocation_Rerun
location of CTPResult output in StoreGate for simulation rerun on data
static const std::string DEFAULT_CTPSLinkLocation_Rerun
default StoreGate location for CTPSLink for simulation rerun on data
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())
Forward iterator to traverse the main components of the trigger configuration.
void sort(typename DataModel_detail::iterator< DVL > beg, typename DataModel_detail::iterator< DVL > end)
Specialization of sort for DataVector/List.