CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
L1EGCrystalClusterEmulatorProducer Class Reference
Inheritance diagram for L1EGCrystalClusterEmulatorProducer:
edm::stream::EDProducer<>

Classes

struct  mycluster
 
class  SimpleCaloHit
 

Public Member Functions

 L1EGCrystalClusterEmulatorProducer (const edm::ParameterSet &)
 
 ~L1EGCrystalClusterEmulatorProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndRuns () const final
 

Private Member Functions

float get_calibrate (float uncorr)
 
bool passes_iso (float pt, float iso)
 
bool passes_looseTkiso (float pt, float iso)
 
bool passes_looseTkss (float pt, float ss)
 
bool passes_photon (float pt, float pss)
 
bool passes_ss (float pt, float ss)
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

l1tp2::ParametricCalibration calib_
 
edm::ESHandle< CaloGeometrycaloGeometry_
 
edm::ESHandle< CaloTPGTranscoderdecoder_
 
const CaloSubdetectorGeometryebGeometry
 
edm::EDGetTokenT< EcalEBTrigPrimDigiCollectionecalTPEBToken_
 
const CaloSubdetectorGeometryhbGeometry
 
edm::ESHandle< HcalTopologyhbTopology
 
edm::EDGetTokenT< edm::SortedCollection< HcalTriggerPrimitiveDigi > > hcalTPToken_
 
const HcalTopologyhcTopology_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 227 of file L1EGammaCrystalsEmulatorProducer.cc.

Constructor & Destructor Documentation

◆ L1EGCrystalClusterEmulatorProducer()

L1EGCrystalClusterEmulatorProducer::L1EGCrystalClusterEmulatorProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 340 of file L1EGammaCrystalsEmulatorProducer.cc.

341  : ecalTPEBToken_(consumes<EcalEBTrigPrimDigiCollection>(iConfig.getParameter<edm::InputTag>("ecalTPEB"))),
342  hcalTPToken_(
344  calib_(iConfig.getParameter<edm::ParameterSet>("calib")) {
345  produces<l1tp2::CaloCrystalClusterCollection>();
346  produces<BXVector<l1t::EGamma> >();
347  produces<l1tp2::CaloTowerCollection>();
348 }

◆ ~L1EGCrystalClusterEmulatorProducer()

L1EGCrystalClusterEmulatorProducer::~L1EGCrystalClusterEmulatorProducer ( )
override

Definition at line 350 of file L1EGammaCrystalsEmulatorProducer.cc.

350 {}

Member Function Documentation

◆ get_calibrate()

float L1EGCrystalClusterEmulatorProducer::get_calibrate ( float  uncorr)
private

◆ passes_iso()

bool L1EGCrystalClusterEmulatorProducer::passes_iso ( float  pt,
float  iso 
)
private

Definition at line 1179 of file L1EGammaCrystalsEmulatorProducer.cc.

1179  {
1180  bool is_iso = true;
1181  if (pt < slideIsoPtThreshold) {
1182  if (!((a0_80 - a1_80 * pt) > iso))
1183  is_iso = false;
1184  } else {
1185  if (iso > a0)
1186  is_iso = false;
1187  }
1188  if (pt > plateau_ss)
1189  is_iso = true;
1190  return is_iso;
1191 }

References a0, a0_80, a1_80, plateau_ss, DiDispStaMuonMonitor_cfi::pt, and slideIsoPtThreshold.

Referenced by produce().

◆ passes_looseTkiso()

bool L1EGCrystalClusterEmulatorProducer::passes_looseTkiso ( float  pt,
float  iso 
)
private

Definition at line 1193 of file L1EGammaCrystalsEmulatorProducer.cc.

1193  {
1194  bool is_iso = (b0 + b1 * std::exp(-b2 * pt) > iso);
1195  if (pt > plateau_ss)
1196  is_iso = true;
1197  return is_iso;
1198 }

References b0, b1, b2, JetChargeProducer_cfi::exp, plateau_ss, and DiDispStaMuonMonitor_cfi::pt.

Referenced by produce().

◆ passes_looseTkss()

bool L1EGCrystalClusterEmulatorProducer::passes_looseTkss ( float  pt,
float  ss 
)
private

Definition at line 1214 of file L1EGammaCrystalsEmulatorProducer.cc.

1214  {
1215  bool is_ss = ((e0_looseTkss - e1_looseTkss * std::exp(-e2_looseTkss * pt)) <= ss);
1216  if (pt > plateau_ss)
1217  is_ss = true;
1218  return is_ss;
1219 }

References e0_looseTkss, e1_looseTkss, e2_looseTkss, JetChargeProducer_cfi::exp, plateau_ss, DiDispStaMuonMonitor_cfi::pt, and contentValuesCheck::ss.

Referenced by produce().

◆ passes_photon()

bool L1EGCrystalClusterEmulatorProducer::passes_photon ( float  pt,
float  pss 
)
private

Definition at line 1207 of file L1EGammaCrystalsEmulatorProducer.cc.

1207  {
1208  bool is_ss = (pss > d0 - d1 * pt);
1209  if (pt > plateau_ss)
1210  is_ss = true;
1211  return is_ss;
1212 }

References d0, d1, plateau_ss, and DiDispStaMuonMonitor_cfi::pt.

Referenced by produce().

◆ passes_ss()

bool L1EGCrystalClusterEmulatorProducer::passes_ss ( float  pt,
float  ss 
)
private

Definition at line 1200 of file L1EGammaCrystalsEmulatorProducer.cc.

1200  {
1201  bool is_ss = ((c0_ss + c1_ss * std::exp(-c2_ss * pt)) <= ss);
1202  if (pt > plateau_ss)
1203  is_ss = true;
1204  return is_ss;
1205 }

References c0_ss, c1_ss, c2_ss, JetChargeProducer_cfi::exp, plateau_ss, DiDispStaMuonMonitor_cfi::pt, and contentValuesCheck::ss.

Referenced by produce().

◆ produce()

void L1EGCrystalClusterEmulatorProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 352 of file L1EGammaCrystalsEmulatorProducer.cc.

352  {
353  using namespace edm;
354 
356  iEvent.getByToken(ecalTPEBToken_, pcalohits);
357 
363  HcalTrigTowerGeometry theTrigTowerGeometry(hcTopology_);
364  iSetup.get<CaloTPGRecord>().get(decoder_);
365 
366  //****************************************************************
367  //******************* Get all the hits ***************************
368  //****************************************************************
369 
370  // Get all the ECAL hits
371  iEvent.getByToken(ecalTPEBToken_, pcalohits);
372  std::vector<SimpleCaloHit> ecalhits;
373 
374  for (const auto& hit : *pcalohits.product()) {
375  if (hit.encodedEt() > 0) // hit.encodedEt() returns an int corresponding to 2x the crystal Et
376  {
377  // Et is 10 bit, by keeping the ADC saturation Et at 120 GeV it means that you have to divide by 8
378  float et = hit.encodedEt() / 8.;
379  if (et < cut_500_MeV)
380  continue; // keep the 500 MeV ET Cut
381 
382  auto cell = ebGeometry->getGeometry(hit.id());
383 
384  SimpleCaloHit ehit;
385  ehit.setId(hit.id());
386  ehit.setPosition(GlobalVector(cell->getPosition().x(), cell->getPosition().y(), cell->getPosition().z()));
387  ehit.setEnergy(et);
388  ehit.setPt();
389  ecalhits.push_back(ehit);
390  }
391  }
392 
393  // Get all the HCAL hits
394  std::vector<SimpleCaloHit> hcalhits;
396  iEvent.getByToken(hcalTPToken_, hbhecoll);
397  for (const auto& hit : *hbhecoll.product()) {
398  float et = decoder_->hcaletValue(hit.id(), hit.t0());
399  if (et <= 0)
400  continue;
401  if (!(hcTopology_->validHT(hit.id()))) {
402  LogError("L1EGCrystalClusterEmulatorProducer")
403  << " -- Hcal hit DetID not present in HCAL Geom: " << hit.id() << std::endl;
404  throw cms::Exception("L1EGCrystalClusterEmulatorProducer");
405  continue;
406  }
407  const std::vector<HcalDetId>& hcId = theTrigTowerGeometry.detIds(hit.id());
408  if (hcId.empty()) {
409  LogError("L1EGCrystalClusterEmulatorProducer")
410  << "Cannot find any HCalDetId corresponding to " << hit.id() << std::endl;
411  throw cms::Exception("L1EGCrystalClusterEmulatorProducer");
412  continue;
413  }
414  if (hcId[0].subdetId() > 1)
415  continue;
416  GlobalVector hcal_tp_position = GlobalVector(0., 0., 0.);
417  for (const auto& hcId_i : hcId) {
418  if (hcId_i.subdetId() > 1)
419  continue;
420  auto cell = hbGeometry->getGeometry(hcId_i);
421  if (cell == nullptr)
422  continue;
423  GlobalVector tmpVector = GlobalVector(cell->getPosition().x(), cell->getPosition().y(), cell->getPosition().z());
424  hcal_tp_position = tmpVector;
425  break;
426  }
427  SimpleCaloHit hhit;
428  hhit.setId(hit.id());
429  hhit.setIdHcal(hit.id());
430  hhit.setPosition(hcal_tp_position);
431  hhit.setEnergy(et);
432  hhit.setPt();
433  hcalhits.push_back(hhit);
434  }
435 
436  //*******************************************************************
437  //********************** Do layer 1 *********************************
438  //*******************************************************************
439 
440  // Definition of L1 outputs
441  // 36 L1 cards send each 4 links with 17 towers
442  float ECAL_tower_L1Card[n_links_card][n_towers_per_link][n_towers_halfPhi];
443  float HCAL_tower_L1Card[n_links_card][n_towers_per_link][n_towers_halfPhi];
444  int iEta_tower_L1Card[n_links_card][n_towers_per_link][n_towers_halfPhi];
445  int iPhi_tower_L1Card[n_links_card][n_towers_per_link][n_towers_halfPhi];
446  // 36 L1 cards send each 4 links with 3 clusters
447  float energy_cluster_L1Card[n_links_card][n_clusters_link][n_towers_halfPhi];
448  // 36 L1 cards send each 4 links with 3 clusters
449  int brem_cluster_L1Card[n_links_card][n_clusters_link][n_towers_halfPhi];
450  int towerID_cluster_L1Card[n_links_card][n_clusters_link][n_towers_halfPhi];
451  int crystalID_cluster_L1Card[n_links_card][n_clusters_link][n_towers_halfPhi];
452  int showerShape_cluster_L1Card[n_links_card][n_clusters_link][n_towers_halfPhi];
453  int showerShapeLooseTk_cluster_L1Card[n_links_card][n_clusters_link][n_towers_halfPhi];
454  int photonShowerShape_cluster_L1Card[n_links_card][n_clusters_link][n_towers_halfPhi];
455 
456  for (int ii = 0; ii < n_links_card; ++ii) {
457  for (int jj = 0; jj < n_towers_per_link; ++jj) {
458  for (int ll = 0; ll < n_towers_halfPhi; ++ll) {
459  ECAL_tower_L1Card[ii][jj][ll] = 0;
460  HCAL_tower_L1Card[ii][jj][ll] = 0;
461  iPhi_tower_L1Card[ii][jj][ll] = -999;
462  iEta_tower_L1Card[ii][jj][ll] = -999;
463  }
464  }
465  }
466  for (int ii = 0; ii < n_links_card; ++ii) {
467  for (int jj = 0; jj < n_clusters_link; ++jj) {
468  for (int ll = 0; ll < n_towers_halfPhi; ++ll) {
469  energy_cluster_L1Card[ii][jj][ll] = 0;
470  brem_cluster_L1Card[ii][jj][ll] = 0;
471  towerID_cluster_L1Card[ii][jj][ll] = 0;
472  crystalID_cluster_L1Card[ii][jj][ll] = 0;
473  }
474  }
475  }
476 
477  // There is one list of clusters per card. We take the 12 highest pt per card
478  vector<mycluster> cluster_list[n_towers_halfPhi];
479  // After merging the clusters in different regions of a single L1 card
480  vector<mycluster> cluster_list_merged[n_towers_halfPhi];
481 
482  for (int cc = 0; cc < n_towers_halfPhi; ++cc) { // Loop over 36 L1 cards
483  // Loop over 3x4 etaxphi regions to search for max 5 clusters
484  for (int nregion = 0; nregion <= n_clusters_max; ++nregion) {
485  int nclusters = 0;
486  bool build_cluster = true;
487 
488  // Continue until 5 clusters have been built or there is no cluster left
489  while (nclusters < n_clusters_max && build_cluster) {
490  build_cluster = false;
491  SimpleCaloHit centerhit;
492 
493  for (const auto& hit : ecalhits) {
494  if (getCrystal_phiID(hit.position().phi()) <= getPhiMax_card(cc) &&
495  getCrystal_phiID(hit.position().phi()) >= getPhiMin_card(cc) &&
496  getCrystal_etaID(hit.position().eta()) <= getEtaMax_card(cc) &&
497  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) &&
498  // Check that the hit is in the good card
499  getCrystal_etaID(hit.position().eta()) < getEtaMin_card(cc) + n_crystals_3towers * (nregion + 1) &&
500  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) + n_crystals_3towers * nregion &&
501  !hit.used() && hit.pt() >= 1.0 && hit.pt() > centerhit.pt()) // 3 towers x 5 crystals
502  {
503  // Highest hit in good region with pt>1 and not used in any other cluster
504  centerhit = hit;
505  build_cluster = true;
506  }
507  }
508  if (build_cluster)
509  nclusters++;
510 
511  // Use only the 5 most energetic clusters
512  if (build_cluster && nclusters > 0 && nclusters <= n_clusters_max) {
513  mycluster mc1;
514  mc1.cpt = 0.0;
515  mc1.cWeightedEta_ = 0.0;
516  mc1.cWeightedPhi_ = 0.0;
517  float leftlobe = 0;
518  float rightlobe = 0;
519  float e5x5 = 0;
520  float n5x5 = 0;
521  float e2x5_1 = 0;
522  float n2x5_1 = 0;
523  float e2x5_2 = 0;
524  float n2x5_2 = 0;
525  float e2x2_1 = 0;
526  float n2x2_1 = 0;
527  float e2x2_2 = 0;
528  float n2x2_2 = 0;
529  float e2x2_3 = 0;
530  float n2x2_3 = 0;
531  float e2x2_4 = 0;
532  float n2x2_4 = 0;
533  for (auto& hit : ecalhits) {
534  if (getCrystal_phiID(hit.position().phi()) <= getPhiMax_card(cc) &&
535  getCrystal_phiID(hit.position().phi()) >= getPhiMin_card(cc) &&
536  getCrystal_etaID(hit.position().eta()) <= getEtaMax_card(cc) &&
537  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) && hit.pt() > 0 &&
538  getCrystal_etaID(hit.position().eta()) < getEtaMin_card(cc) + n_crystals_3towers * (nregion + 1) &&
539  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) + n_crystals_3towers * nregion) {
540  if (abs(hit.dieta(centerhit)) <= 1 && hit.diphi(centerhit) > 2 && hit.diphi(centerhit) <= 7) {
541  rightlobe += hit.pt();
542  }
543  if (abs(hit.dieta(centerhit)) <= 1 && hit.diphi(centerhit) < -2 && hit.diphi(centerhit) >= -7) {
544  leftlobe += hit.pt();
545  }
546  if (abs(hit.dieta(centerhit)) <= 2 && abs(hit.diphi(centerhit)) <= 2) {
547  e5x5 += hit.energy();
548  n5x5++;
549  }
550  if ((hit.dieta(centerhit) == 1 or hit.dieta(centerhit) == 0) &&
551  (hit.diphi(centerhit) == 1 or hit.diphi(centerhit) == 0)) {
552  e2x2_1 += hit.energy();
553  n2x2_1++;
554  }
555  if ((hit.dieta(centerhit) == 0 or hit.dieta(centerhit) == -1) &&
556  (hit.diphi(centerhit) == 0 or hit.diphi(centerhit) == 1)) {
557  e2x2_2 += hit.energy();
558  n2x2_2++;
559  }
560  if ((hit.dieta(centerhit) == 0 or hit.dieta(centerhit) == 1) &&
561  (hit.diphi(centerhit) == 0 or hit.diphi(centerhit) == -1)) {
562  e2x2_3 += hit.energy();
563  n2x2_3++;
564  }
565  if ((hit.dieta(centerhit) == 0 or hit.dieta(centerhit) == -1) &&
566  (hit.diphi(centerhit) == 0 or hit.diphi(centerhit) == -1)) {
567  e2x2_4 += hit.energy();
568  n2x2_4++;
569  }
570  if ((hit.dieta(centerhit) == 0 or hit.dieta(centerhit) == 1) && abs(hit.diphi(centerhit)) <= 2) {
571  e2x5_1 += hit.energy();
572  n2x5_1++;
573  }
574  if ((hit.dieta(centerhit) == 0 or hit.dieta(centerhit) == -1) && abs(hit.diphi(centerhit)) <= 2) {
575  e2x5_2 += hit.energy();
576  n2x5_2++;
577  }
578  }
579  if (getCrystal_phiID(hit.position().phi()) <= getPhiMax_card(cc) &&
580  getCrystal_phiID(hit.position().phi()) >= getPhiMin_card(cc) &&
581  getCrystal_etaID(hit.position().eta()) <= getEtaMax_card(cc) &&
582  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) && !hit.used() && hit.pt() > 0 &&
583  abs(hit.dieta(centerhit)) <= 1 && abs(hit.diphi(centerhit)) <= 2 &&
584  getCrystal_etaID(hit.position().eta()) < getEtaMin_card(cc) + n_crystals_3towers * (nregion + 1) &&
585  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) + n_crystals_3towers * nregion) {
586  // clusters 3x5 in etaxphi using only the hits in the corresponding card and in the corresponding 3x4 region
587  hit.setUsed(true);
588  mc1.cpt += hit.pt();
589  mc1.cWeightedEta_ += float(hit.pt()) * float(hit.position().eta());
590  mc1.cWeightedPhi_ = mc1.cWeightedPhi_ + (float(hit.pt()) * float(hit.position().phi()));
591  }
592  }
593  if (do_brem && (rightlobe > 0.10 * mc1.cpt or leftlobe > 0.10 * mc1.cpt)) {
594  for (auto& hit : ecalhits) {
595  if (getCrystal_phiID(hit.position().phi()) <= getPhiMax_card(cc) &&
596  getCrystal_phiID(hit.position().phi()) >= getPhiMin_card(cc) &&
597  getCrystal_etaID(hit.position().eta()) <= getEtaMax_card(cc) &&
598  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) && hit.pt() > 0 &&
599  getCrystal_etaID(hit.position().eta()) < getEtaMin_card(cc) + n_crystals_3towers * (nregion + 1) &&
600  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) + n_crystals_3towers * nregion &&
601  !hit.used()) {
602  if (rightlobe > 0.10 * mc1.cpt && (leftlobe < 0.10 * mc1.cpt or rightlobe > leftlobe) &&
603  abs(hit.dieta(centerhit)) <= 1 && hit.diphi(centerhit) > 2 && hit.diphi(centerhit) <= 7) {
604  mc1.cpt += hit.pt();
605  hit.setUsed(true);
606  mc1.cbrem_ = 1;
607  }
608  if (leftlobe > 0.10 * mc1.cpt && (rightlobe < 0.10 * mc1.cpt or leftlobe >= rightlobe) &&
609  abs(hit.dieta(centerhit)) <= 1 && hit.diphi(centerhit) < -2 && hit.diphi(centerhit) >= -7) {
610  mc1.cpt += hit.pt();
611  hit.setUsed(true);
612  mc1.cbrem_ = 1;
613  }
614  }
615  }
616  }
617  mc1.c5x5_ = e5x5;
618  mc1.c2x5_ = max(e2x5_1, e2x5_2);
619  mc1.c2x2_ = e2x2_1;
620  if (e2x2_2 > mc1.c2x2_)
621  mc1.c2x2_ = e2x2_2;
622  if (e2x2_3 > mc1.c2x2_)
623  mc1.c2x2_ = e2x2_3;
624  if (e2x2_4 > mc1.c2x2_)
625  mc1.c2x2_ = e2x2_4;
626  mc1.cWeightedEta_ = mc1.cWeightedEta_ / mc1.cpt;
627  mc1.cWeightedPhi_ = mc1.cWeightedPhi_ / mc1.cpt;
628  mc1.ceta_ = getCrystal_etaID(centerhit.position().eta());
629  mc1.cphi_ = getCrystal_phiID(centerhit.position().phi());
630  mc1.crawphi_ = centerhit.position().phi();
631  mc1.craweta_ = centerhit.position().eta();
632  cluster_list[cc].push_back(mc1);
633  } // End if 5 clusters per region
634  } // End while to find the 5 clusters
635  } // End loop over regions to search for clusters
636  std::sort(begin(cluster_list[cc]), end(cluster_list[cc]), [](mycluster a, mycluster b) { return a.cpt > b.cpt; });
637 
638  // Merge clusters from different regions
639  for (unsigned int jj = 0; jj < unsigned(cluster_list[cc].size()); ++jj) {
640  for (unsigned int kk = jj + 1; kk < unsigned(cluster_list[cc].size()); ++kk) {
641  if (std::abs(cluster_list[cc][jj].ceta_ - cluster_list[cc][kk].ceta_) < 2 &&
642  std::abs(cluster_list[cc][jj].cphi_ - cluster_list[cc][kk].cphi_) < 2) { //Diagonale + exact neighbors
643  if (cluster_list[cc][kk].cpt > cluster_list[cc][jj].cpt) {
644  cluster_list[cc][kk].cpt += cluster_list[cc][jj].cpt;
645  cluster_list[cc][kk].c5x5_ += cluster_list[cc][jj].c5x5_;
646  cluster_list[cc][kk].c2x5_ += cluster_list[cc][jj].c2x5_;
647  cluster_list[cc][jj].cpt = 0;
648  cluster_list[cc][jj].c5x5_ = 0;
649  cluster_list[cc][jj].c2x5_ = 0;
650  cluster_list[cc][jj].c2x2_ = 0;
651  } else {
652  cluster_list[cc][jj].cpt += cluster_list[cc][kk].cpt;
653  cluster_list[cc][jj].c5x5_ += cluster_list[cc][kk].c5x5_;
654  cluster_list[cc][jj].c2x5_ += cluster_list[cc][kk].c2x5_;
655  cluster_list[cc][kk].cpt = 0;
656  cluster_list[cc][kk].c2x2_ = 0;
657  cluster_list[cc][kk].c2x5_ = 0;
658  cluster_list[cc][kk].c5x5_ = 0;
659  }
660  }
661  }
662  if (cluster_list[cc][jj].cpt > 0) {
663  cluster_list[cc][jj].cpt =
664  cluster_list[cc][jj].cpt *
665  calib_(cluster_list[cc][jj].cpt,
666  std::abs(cluster_list[cc][jj].craweta_)); //Mark's calibration as a function of eta and pt
667  cluster_list_merged[cc].push_back(cluster_list[cc][jj]);
668  }
669  }
670  std::sort(begin(cluster_list_merged[cc]), end(cluster_list_merged[cc]), [](mycluster a, mycluster b) {
671  return a.cpt > b.cpt;
672  });
673 
674  // Fill cluster information in the arrays. We keep max 12 clusters (distributed between 4 links)
675  for (unsigned int jj = 0; jj < unsigned(cluster_list_merged[cc].size()) && jj < n_clusters_4link; ++jj) {
676  crystalID_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] =
677  getCrystalIDInTower(cluster_list_merged[cc][jj].ceta_, cluster_list_merged[cc][jj].cphi_);
678  towerID_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] =
679  getTowerID(cluster_list_merged[cc][jj].ceta_, cluster_list_merged[cc][jj].cphi_);
680  energy_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] = cluster_list_merged[cc][jj].cpt;
681  brem_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] = cluster_list_merged[cc][jj].cbrem_;
682  if (passes_ss(cluster_list_merged[cc][jj].cpt,
683  cluster_list_merged[cc][jj].c2x5_ / cluster_list_merged[cc][jj].c5x5_))
684  showerShape_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] = 1;
685  else
686  showerShape_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] = 0;
687  if (passes_looseTkss(cluster_list_merged[cc][jj].cpt,
688  cluster_list_merged[cc][jj].c2x5_ / cluster_list_merged[cc][jj].c5x5_))
689  showerShapeLooseTk_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] = 1;
690  else
691  showerShapeLooseTk_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] = 0;
692  if (passes_photon(cluster_list_merged[cc][jj].cpt,
693  cluster_list_merged[cc][jj].c2x2_ / cluster_list_merged[cc][jj].c2x5_))
694  photonShowerShape_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] = 1;
695  else
696  photonShowerShape_cluster_L1Card[jj % n_links_card][jj / n_links_card][cc] = 0;
697  }
698 
699  // Loop over calo ecal hits to get the ECAL towers. Take only hits that have not been used to make clusters
700  for (const auto& hit : ecalhits) {
701  if (getCrystal_phiID(hit.position().phi()) <= getPhiMax_card(cc) &&
702  getCrystal_phiID(hit.position().phi()) >= getPhiMin_card(cc) &&
703  getCrystal_etaID(hit.position().eta()) <= getEtaMax_card(cc) &&
704  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) &&
705  !hit.used()) { // Take all the hits inside the card that have not been used yet
706  for (int jj = 0; jj < n_links_card; ++jj) { // loop over 4 links per card
707  if ((getCrystal_phiID(hit.position().phi()) / n_crystals_towerPhi) % 4 == jj) { // Go to ID tower modulo 4
708  for (int ii = 0; ii < n_towers_per_link; ++ii) {
709  //Apply Mark's calibration at the same time (row of the lowest pT, as a function of eta)
710  if ((getCrystal_etaID(hit.position().eta()) / n_crystals_towerEta) % n_towers_per_link == ii) {
711  ECAL_tower_L1Card[jj][ii][cc] += hit.pt() * calib_(0, std::abs(hit.position().eta()));
712  iEta_tower_L1Card[jj][ii][cc] = getTower_absoluteEtaID(hit.position().eta()); //hit.id().ieta();
713  iPhi_tower_L1Card[jj][ii][cc] = getTower_absolutePhiID(hit.position().phi()); //hit.id().iphi();
714  }
715  } // end of loop over eta towers
716  }
717  } // end of loop over phi links
718  // Make sure towers with 0 ET are initialized with proper iEta, iPhi coordinates
719  static constexpr float tower_width = 0.0873;
720  for (int jj = 0; jj < n_links_card; ++jj) {
721  for (int ii = 0; ii < n_towers_per_link; ++ii) {
722  float phi = getPhiMin_card(cc) * tower_width / n_crystals_towerPhi - M_PI + (jj + 0.5) * tower_width;
723  float eta = getEtaMin_card(cc) * tower_width / n_crystals_towerEta - n_towers_per_link * tower_width +
724  (ii + 0.5) * tower_width;
725  iEta_tower_L1Card[jj][ii][cc] = getTower_absoluteEtaID(eta);
726  iPhi_tower_L1Card[jj][ii][cc] = getTower_absolutePhiID(phi);
727  }
728  }
729 
730  } // end of check if inside card
731  } // end of loop over hits to build towers
732 
733  // Loop over hcal hits to get the HCAL towers.
734  for (const auto& hit : hcalhits) {
735  if (getCrystal_phiID(hit.position().phi()) <= getPhiMax_card(cc) &&
736  getCrystal_phiID(hit.position().phi()) >= getPhiMin_card(cc) &&
737  getCrystal_etaID(hit.position().eta()) <= getEtaMax_card(cc) &&
738  getCrystal_etaID(hit.position().eta()) >= getEtaMin_card(cc) && hit.pt() > 0) {
739  for (int jj = 0; jj < n_links_card; ++jj) {
740  if ((getCrystal_phiID(hit.position().phi()) / n_crystals_towerPhi) % n_links_card == jj) {
741  for (int ii = 0; ii < n_towers_per_link; ++ii) {
742  if ((getCrystal_etaID(hit.position().eta()) / n_crystals_towerEta) % n_towers_per_link == ii) {
743  HCAL_tower_L1Card[jj][ii][cc] += hit.pt();
744  iEta_tower_L1Card[jj][ii][cc] = getTower_absoluteEtaID(hit.position().eta()); //hit.id().ieta();
745  iPhi_tower_L1Card[jj][ii][cc] = getTower_absolutePhiID(hit.position().phi()); //hit.id().iphi();
746  }
747  } // end of loop over eta towers
748  }
749  } // end of loop over phi links
750  } // end of check if inside card
751  } // end of loop over hits to build towers
752 
753  // Give back energy of not used clusters to the towers (if there are more than 12 clusters)
754  for (unsigned int kk = n_clusters_4link; kk < cluster_list_merged[cc].size(); ++kk) {
755  if (cluster_list_merged[cc][kk].cpt > 0) {
756  ECAL_tower_L1Card[getTower_phiID(cluster_list_merged[cc][kk].cphi_)]
757  [getTower_etaID(cluster_list_merged[cc][kk].ceta_)][cc] += cluster_list_merged[cc][kk].cpt;
758  }
759  }
760  } //End of loop over cards
761 
762  //*********************************************************
763  //******************** Do layer 2 *************************
764  //*********************************************************
765 
766  // Definition of L2 outputs
767  float HCAL_tower_L2Card[n_links_GCTcard][n_towers_per_link]
768  [n_GCTcards]; // 3 L2 cards send each 48 links with 17 towers
769  float ECAL_tower_L2Card[n_links_GCTcard][n_towers_per_link][n_GCTcards];
770  int iEta_tower_L2Card[n_links_GCTcard][n_towers_per_link][n_GCTcards];
771  int iPhi_tower_L2Card[n_links_GCTcard][n_towers_per_link][n_GCTcards];
772  float energy_cluster_L2Card[n_links_GCTcard][n_clusters_per_link]
773  [n_GCTcards]; // 3 L2 cards send each 48 links with 2 clusters
774  float brem_cluster_L2Card[n_links_GCTcard][n_clusters_per_link][n_GCTcards];
775  int towerID_cluster_L2Card[n_links_GCTcard][n_clusters_per_link][n_GCTcards];
776  int crystalID_cluster_L2Card[n_links_GCTcard][n_clusters_per_link][n_GCTcards];
777  float isolation_cluster_L2Card[n_links_GCTcard][n_clusters_per_link][n_GCTcards];
778  float HE_cluster_L2Card[n_links_GCTcard][n_clusters_per_link][n_GCTcards];
779  int showerShape_cluster_L2Card[n_links_GCTcard][n_clusters_per_link][n_GCTcards];
780  int showerShapeLooseTk_cluster_L2Card[n_links_GCTcard][n_clusters_per_link][n_GCTcards];
781  int photonShowerShape_cluster_L2Card[n_links_GCTcard][n_clusters_per_link][n_GCTcards];
782 
783  for (int ii = 0; ii < n_links_GCTcard; ++ii) {
784  for (int jj = 0; jj < n_towers_per_link; ++jj) {
785  for (int ll = 0; ll < n_GCTcards; ++ll) {
786  HCAL_tower_L2Card[ii][jj][ll] = 0;
787  ECAL_tower_L2Card[ii][jj][ll] = 0;
788  iEta_tower_L2Card[ii][jj][ll] = 0;
789  iPhi_tower_L2Card[ii][jj][ll] = 0;
790  }
791  }
792  }
793  for (int ii = 0; ii < n_links_GCTcard; ++ii) {
794  for (int jj = 0; jj < n_clusters_per_link; ++jj) {
795  for (int ll = 0; ll < n_GCTcards; ++ll) {
796  energy_cluster_L2Card[ii][jj][ll] = 0;
797  brem_cluster_L2Card[ii][jj][ll] = 0;
798  towerID_cluster_L2Card[ii][jj][ll] = 0;
799  crystalID_cluster_L2Card[ii][jj][ll] = 0;
800  isolation_cluster_L2Card[ii][jj][ll] = 0;
801  HE_cluster_L2Card[ii][jj][ll] = 0;
802  photonShowerShape_cluster_L2Card[ii][jj][ll] = 0;
803  showerShape_cluster_L2Card[ii][jj][ll] = 0;
804  showerShapeLooseTk_cluster_L2Card[ii][jj][ll] = 0;
805  }
806  }
807  }
808 
809  // There is one list of clusters per equivalent of L1 card. We take the 8 highest pt.
810  vector<mycluster> cluster_list_L2[n_towers_halfPhi];
811 
812  // Merge clusters on the phi edges
813  for (int ii = 0; ii < n_borders_phi; ++ii) { // 18 borders in phi
814  for (int jj = 0; jj < n_eta_bins; ++jj) { // 2 eta bins
815  int card_left = 2 * ii + jj;
816  int card_right = 2 * ii + jj + 2;
817  if (card_right > 35)
818  card_right = card_right - n_towers_halfPhi;
819  for (int kk = 0; kk < n_clusters_4link; ++kk) { // 12 clusters in the first card. We check the right side
820  if (towerID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] > 50 &&
821  crystalID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] > 19 &&
822  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] > 0) {
823  for (int ll = 0; ll < n_clusters_4link; ++ll) { // We check the 12 clusters in the card on the right
824  if (towerID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] < n_towers_per_link &&
825  crystalID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] < 5 &&
826  std::abs(
827  5 * (towerID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right]) % n_towers_per_link +
828  crystalID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] % 5 -
829  5 * (towerID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left]) % n_towers_per_link -
830  crystalID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] % 5) < 2) {
831  if (energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] >
832  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right]) {
833  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] +=
834  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right];
835  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] = 0;
836  } // The least energetic cluster is merged to the most energetic one
837  else {
838  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] +=
839  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left];
840  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] = 0;
841  }
842  }
843  }
844  }
845  }
846  }
847  }
848 
849  // Bremsstrahlung corrections. Merge clusters on the phi edges depending on pT (pt more than 10 percent, dphi leq 5, deta leq 1)
850  if (do_brem) {
851  for (int ii = 0; ii < n_borders_phi; ++ii) { // 18 borders in phi
852  for (int jj = 0; jj < n_eta_bins; ++jj) { // 2 eta bins
853  int card_left = 2 * ii + jj;
854  int card_right = 2 * ii + jj + 2;
855  if (card_right > 35)
856  card_right = card_right - n_towers_halfPhi;
857  // 12 clusters in the first card. We check the right side crystalID_cluster_L1Card[kk%4][kk/4][card_left]
858  for (int kk = 0; kk < n_clusters_4link; ++kk) {
859  // if the tower is at the edge there might be brem corrections, whatever the crystal ID
860  if (towerID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] > 50 &&
861  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] > 0) {
862  for (int ll = 0; ll < n_clusters_4link; ++ll) { // We check the 12 clusters in the card on the right
863  //Distance of 1 max in eta
864  if (towerID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] < n_towers_per_link &&
865  std::abs(5 * (towerID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right]) %
867  crystalID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] % 5 -
868  5 * (towerID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left]) %
870  crystalID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] % 5) <= 1) {
871  //Distance of 5 max in phi
872  if (towerID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] < n_towers_per_link &&
873  std::abs(5 + crystalID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] / 5 -
874  (crystalID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] / 5)) <= 5) {
875  if (energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] >
876  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] &&
877  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] >
878  0.10 * energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left]) {
879  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] +=
880  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right];
881  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] = 0;
882  brem_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] = 1;
883  }
884  // The least energetic cluster is merged to the most energetic one, if its pt is at least ten percent
885  else if (energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_right] >=
886  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_left] &&
887  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_left] >
888  0.10 * energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_right]) {
889  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] +=
890  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left];
891  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_left] = 0;
892  brem_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_right] = 1;
893  }
894  } //max distance eta
895  } //max distance phi
896  } //max distance phi
897  }
898  }
899  }
900  }
901  }
902 
903  // Merge clusters on the eta edges
904  for (int ii = 0; ii < n_borders_eta; ++ii) { // 18 borders in eta
905  int card_bottom = 2 * ii;
906  int card_top = 2 * ii + 1;
907  for (int kk = 0; kk < n_clusters_4link; ++kk) { // 12 clusters in the first card. We check the top side
908  if (towerID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom] % n_towers_per_link == 16 &&
909  crystalID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom] % 5 == n_links_card &&
910  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom] >
911  0) { // If there is one cluster on the right side of the first card
912  for (int ll = 0; ll < n_clusters_4link; ++ll) { // We check the card on the right
913  if (std::abs(
914  5 * (towerID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom] / n_towers_per_link) +
915  crystalID_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom] / 5 -
916  5 * (towerID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_top] / n_towers_per_link) -
917  crystalID_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_top] / 5) < 2) {
918  if (energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom] >
919  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_bottom]) {
920  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom] +=
921  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_top];
922  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_top] = 0;
923  } else {
924  energy_cluster_L1Card[ll % n_links_card][ll / n_links_card][card_top] +=
925  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom];
926  energy_cluster_L1Card[kk % n_links_card][kk / n_links_card][card_bottom] = 0;
927  }
928  }
929  }
930  }
931  }
932  }
933 
934  // Regroup the new clusters per equivalent of L1 card geometry
935  for (int ii = 0; ii < n_towers_halfPhi; ++ii) {
936  for (int jj = 0; jj < n_clusters_4link; ++jj) {
937  if (energy_cluster_L1Card[jj % n_links_card][jj / n_links_card][ii] > 0) {
938  mycluster mc1;
939  mc1.cpt = energy_cluster_L1Card[jj % n_links_card][jj / n_links_card][ii];
940  mc1.cbrem_ = brem_cluster_L1Card[jj % n_links_card][jj / n_links_card][ii];
941  mc1.ctowerid_ = towerID_cluster_L1Card[jj % n_links_card][jj / n_links_card][ii];
942  mc1.ccrystalid_ = crystalID_cluster_L1Card[jj % n_links_card][jj / n_links_card][ii];
943  mc1.cshowershape_ = showerShape_cluster_L1Card[jj % n_links_card][jj / n_links_card][ii];
944  mc1.cshowershapeloosetk_ = showerShapeLooseTk_cluster_L1Card[jj % n_links_card][jj / n_links_card][ii];
945  mc1.cphotonshowershape_ = photonShowerShape_cluster_L1Card[jj % n_links_card][jj / n_links_card][ii];
946  cluster_list_L2[ii].push_back(mc1);
947  }
948  }
949  std::sort(
950  begin(cluster_list_L2[ii]), end(cluster_list_L2[ii]), [](mycluster a, mycluster b) { return a.cpt > b.cpt; });
951  }
952 
953  // If there are more than 8 clusters per equivalent of L1 card we need to put them back in the towers
954  for (int ii = 0; ii < n_towers_halfPhi; ++ii) {
955  for (unsigned int jj = 8; jj < n_clusters_4link && jj < cluster_list_L2[ii].size(); ++jj) {
956  if (cluster_list_L2[ii][jj].cpt > 0) {
957  ECAL_tower_L1Card[cluster_list_L2[ii][jj].ctowerid_ / n_towers_per_link]
958  [cluster_list_L2[ii][jj].ctowerid_ % n_towers_per_link][ii] += cluster_list_L2[ii][jj].cpt;
959  cluster_list_L2[ii][jj].cpt = 0;
960  cluster_list_L2[ii][jj].ctowerid_ = 0;
961  cluster_list_L2[ii][jj].ccrystalid_ = 0;
962  }
963  }
964  }
965 
966  // Compute isolation (7*7 ECAL towers) and HCAL energy (5x5 HCAL towers)
967  for (int ii = 0; ii < n_towers_halfPhi; ++ii) { // Loop over the new cluster list (stored in 36x8 format)
968  for (unsigned int jj = 0; jj < 8 && jj < cluster_list_L2[ii].size(); ++jj) {
969  int cluster_etaOfTower_fullDetector = get_towerEta_fromCardTowerInCard(ii, cluster_list_L2[ii][jj].ctowerid_);
970  int cluster_phiOfTower_fullDetector = get_towerPhi_fromCardTowerInCard(ii, cluster_list_L2[ii][jj].ctowerid_);
971  float hcal_nrj = 0.0;
972  float isolation = 0.0;
973  int ntowers = 0;
974  for (int iii = 0; iii < n_towers_halfPhi; ++iii) { // The clusters have to be added to the isolation
975  for (unsigned int jjj = 0; jjj < 8 && jjj < cluster_list_L2[iii].size(); ++jjj) {
976  if (!(iii == ii && jjj == jj)) {
977  int cluster2_eta = get_towerEta_fromCardTowerInCard(iii, cluster_list_L2[iii][jjj].ctowerid_);
978  int cluster2_phi = get_towerPhi_fromCardTowerInCard(iii, cluster_list_L2[iii][jjj].ctowerid_);
979  if (abs(cluster2_eta - cluster_etaOfTower_fullDetector) <= 2 &&
980  (abs(cluster2_phi - cluster_phiOfTower_fullDetector) <= 2 or
981  abs(cluster2_phi - n_towers_Phi - cluster_phiOfTower_fullDetector) <= 2)) {
982  isolation += cluster_list_L2[iii][jjj].cpt;
983  }
984  }
985  }
986  }
987  for (int kk = 0; kk < n_towers_halfPhi; ++kk) { // 36 cards
988  for (int ll = 0; ll < n_links_card; ++ll) { // 4 links per card
989  for (int mm = 0; mm < n_towers_per_link; ++mm) { // 17 towers per link
990  int etaOftower_fullDetector = get_towerEta_fromCardLinkTower(kk, ll, mm);
991  int phiOftower_fullDetector = get_towerPhi_fromCardLinkTower(kk, ll, mm);
992  // First do ECAL
993  // The towers are within 3. Needs to stitch the two phi sides together
994  if (abs(etaOftower_fullDetector - cluster_etaOfTower_fullDetector) <= 2 &&
995  (abs(phiOftower_fullDetector - cluster_phiOfTower_fullDetector) <= 2 or
996  abs(phiOftower_fullDetector - n_towers_Phi - cluster_phiOfTower_fullDetector) <= 2)) {
997  // Remove the column outside of the L2 card: values (0,71), (23,26), (24,21), (47,50), (48,50), (71,2)
998  if (!((cluster_phiOfTower_fullDetector == 0 && phiOftower_fullDetector == 71) or
999  (cluster_phiOfTower_fullDetector == 23 && phiOftower_fullDetector == 26) or
1000  (cluster_phiOfTower_fullDetector == 24 && phiOftower_fullDetector == 21) or
1001  (cluster_phiOfTower_fullDetector == 47 && phiOftower_fullDetector == 50) or
1002  (cluster_phiOfTower_fullDetector == 48 && phiOftower_fullDetector == 45) or
1003  (cluster_phiOfTower_fullDetector == 71 && phiOftower_fullDetector == 2))) {
1004  isolation += ECAL_tower_L1Card[ll][mm][kk];
1005  ntowers++;
1006  }
1007  }
1008  // Now do HCAL
1009  // The towers are within 2. Needs to stitch the two phi sides together
1010  if (abs(etaOftower_fullDetector - cluster_etaOfTower_fullDetector) <= 2 &&
1011  (abs(phiOftower_fullDetector - cluster_phiOfTower_fullDetector) <= 2 or
1012  abs(phiOftower_fullDetector - n_towers_Phi - cluster_phiOfTower_fullDetector) <= 2)) {
1013  hcal_nrj += HCAL_tower_L1Card[ll][mm][kk];
1014  }
1015  }
1016  }
1017  }
1018  cluster_list_L2[ii][jj].ciso_ = ((isolation) * (25.0 / ntowers)) / cluster_list_L2[ii][jj].cpt;
1019  cluster_list_L2[ii][jj].chovere_ = hcal_nrj / cluster_list_L2[ii][jj].cpt;
1020  }
1021  }
1022 
1023  //Reformat the information inside the 3 L2 cards
1024  //First let's fill the towers
1025  for (int ii = 0; ii < n_links_GCTcard; ++ii) {
1026  for (int jj = 0; jj < n_towers_per_link; ++jj) {
1027  for (int ll = 0; ll < 3; ++ll) {
1028  ECAL_tower_L2Card[ii][jj][ll] =
1030  HCAL_tower_L2Card[ii][jj][ll] =
1032  iEta_tower_L2Card[ii][jj][ll] =
1034  iPhi_tower_L2Card[ii][jj][ll] =
1036  }
1037  }
1038  }
1039 
1040  //Second let's fill the clusters
1041  for (int ii = 0; ii < n_towers_halfPhi; ++ii) { // The cluster list is still in the L1 like geometry
1042  for (unsigned int jj = 0; jj < unsigned(cluster_list_L2[ii].size()) && jj < n_clusters_4link; ++jj) {
1043  crystalID_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1044  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].ccrystalid_;
1045  towerID_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1046  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].ctowerid_;
1047  energy_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1048  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].cpt;
1049  brem_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1050  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].cbrem_;
1051  isolation_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1052  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].ciso_;
1053  HE_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1054  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].chovere_;
1055  showerShape_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1056  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].cshowershape_;
1057  showerShapeLooseTk_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1058  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].cshowershapeloosetk_;
1059  photonShowerShape_cluster_L2Card[n_links_card * (ii % n_clusters_4link) + jj % n_links_card][jj / n_links_card]
1060  [ii / n_clusters_4link] = cluster_list_L2[ii][jj].cphotonshowershape_;
1061  }
1062  }
1063 
1064  auto L1EGXtalClusters = std::make_unique<l1tp2::CaloCrystalClusterCollection>();
1065  auto L1EGammas = std::make_unique<l1t::EGammaBxCollection>();
1066  auto L1CaloTowers = std::make_unique<l1tp2::CaloTowerCollection>();
1067 
1068  // Fill the cluster collection and towers as well
1069  for (int ii = 0; ii < n_links_GCTcard; ++ii) { // 48 links
1070  for (int ll = 0; ll < n_GCTcards; ++ll) { // 3 cards
1071  // For looping over the Towers a few lines below
1072  for (int jj = 0; jj < 2; ++jj) { // 2 L1EGs
1073  if (energy_cluster_L2Card[ii][jj][ll] > 0.45) {
1075  energy_cluster_L2Card[ii][jj][ll],
1077  ii, ll, towerID_cluster_L2Card[ii][jj][ll], crystalID_cluster_L2Card[ii][jj][ll]),
1079  ii, ll, towerID_cluster_L2Card[ii][jj][ll], crystalID_cluster_L2Card[ii][jj][ll]),
1080  0.);
1081  SimpleCaloHit centerhit;
1082  bool is_iso = passes_iso(energy_cluster_L2Card[ii][jj][ll], isolation_cluster_L2Card[ii][jj][ll]);
1083  bool is_looseTkiso =
1084  passes_looseTkiso(energy_cluster_L2Card[ii][jj][ll], isolation_cluster_L2Card[ii][jj][ll]);
1085  bool is_ss = (showerShape_cluster_L2Card[ii][jj][ll] == 1);
1086  bool is_photon = (photonShowerShape_cluster_L2Card[ii][jj][ll] == 1) && is_ss && is_iso;
1087  bool is_looseTkss = (showerShapeLooseTk_cluster_L2Card[ii][jj][ll] == 1);
1088  // All the ID set to Standalone WP! Some dummy values for non calculated variables
1089  l1tp2::CaloCrystalCluster cluster(p4calibrated,
1090  energy_cluster_L2Card[ii][jj][ll],
1091  HE_cluster_L2Card[ii][jj][ll],
1092  isolation_cluster_L2Card[ii][jj][ll],
1093  centerhit.id(),
1094  -1000,
1095  float(brem_cluster_L2Card[ii][jj][ll]),
1096  -1000,
1097  -1000,
1098  energy_cluster_L2Card[ii][jj][ll],
1099  -1,
1100  is_iso&& is_ss,
1101  is_iso&& is_ss,
1102  is_photon,
1103  is_iso&& is_ss,
1104  is_looseTkiso&& is_looseTkss,
1105  is_iso&& is_ss);
1106  // Experimental parameters, don't want to bother with hardcoding them in data format
1107  std::map<std::string, float> params;
1108  params["standaloneWP_showerShape"] = is_ss;
1109  params["standaloneWP_isolation"] = is_iso;
1110  params["trkMatchWP_showerShape"] = is_looseTkss;
1111  params["trkMatchWP_isolation"] = is_looseTkiso;
1112  params["TTiEta"] = getToweriEta_fromAbsoluteID(getTower_absoluteEtaID(p4calibrated.eta()));
1113  params["TTiPhi"] = getToweriPhi_fromAbsoluteID(getTower_absolutePhiID(p4calibrated.phi()));
1114  cluster.setExperimentalParams(params);
1115  L1EGXtalClusters->push_back(cluster);
1116 
1117  int standaloneWP = (int)(is_iso && is_ss);
1118  int looseL1TkMatchWP = (int)(is_looseTkiso && is_looseTkss);
1119  int photonWP = (int)(is_photon);
1120  int quality =
1121  (standaloneWP * std::pow(2, 0)) + (looseL1TkMatchWP * std::pow(2, 1)) + (photonWP * std::pow(2, 2));
1122  L1EGammas->push_back(
1123  0, l1t::EGamma(p4calibrated, p4calibrated.pt(), p4calibrated.eta(), p4calibrated.phi(), quality, 1));
1124  }
1125  }
1126  }
1127  }
1128 
1129  for (int ii = 0; ii < n_links_GCTcard; ++ii) { // 48 links
1130  for (int ll = 0; ll < n_GCTcards; ++ll) { // 3 cards
1131  // Fill the tower collection
1132  for (int jj = 0; jj < n_towers_per_link; ++jj) { // 17 TTs
1133  l1tp2::CaloTower l1CaloTower;
1134  l1CaloTower.setEcalTowerEt(ECAL_tower_L2Card[ii][jj][ll]);
1135  l1CaloTower.setHcalTowerEt(HCAL_tower_L2Card[ii][jj][ll]);
1136  l1CaloTower.setTowerIEta(getToweriEta_fromAbsoluteID(iEta_tower_L2Card[ii][jj][ll]));
1137  l1CaloTower.setTowerIPhi(getToweriPhi_fromAbsoluteID(iPhi_tower_L2Card[ii][jj][ll]));
1138  l1CaloTower.setTowerEta(getTowerEta_fromAbsoluteID(iEta_tower_L2Card[ii][jj][ll]));
1139  l1CaloTower.setTowerPhi(getTowerPhi_fromAbsoluteID(iPhi_tower_L2Card[ii][jj][ll]));
1140  // Some towers have incorrect eta/phi because that wasn't initialized in certain cases, fix these
1141  static float constexpr towerEtaUpperUnitialized = -80;
1142  static float constexpr towerPhiUpperUnitialized = -90;
1143  if (l1CaloTower.towerEta() < towerEtaUpperUnitialized && l1CaloTower.towerPhi() < towerPhiUpperUnitialized) {
1144  l1CaloTower.setTowerEta(l1t::CaloTools::towerEta(l1CaloTower.towerIEta()));
1145  l1CaloTower.setTowerPhi(l1t::CaloTools::towerPhi(l1CaloTower.towerIEta(), l1CaloTower.towerIPhi()));
1146  }
1147  l1CaloTower.setIsBarrel(true);
1148 
1149  // Add L1EGs if they match in iEta / iPhi
1150  // L1EGs are already pT ordered, we will take the ID info for the leading one, but pT as the sum
1151  for (const auto& l1eg : *L1EGXtalClusters) {
1152  if (l1eg.experimentalParam("TTiEta") != l1CaloTower.towerIEta())
1153  continue;
1154  if (l1eg.experimentalParam("TTiPhi") != l1CaloTower.towerIPhi())
1155  continue;
1156 
1157  int n_L1eg = l1CaloTower.nL1eg();
1158  l1CaloTower.setNL1eg(n_L1eg++);
1159  l1CaloTower.setL1egTowerEt(l1CaloTower.l1egTowerEt() + l1eg.pt());
1160  // Don't record L1EG quality info for subleading L1EG
1161  if (l1CaloTower.nL1eg() > 1)
1162  continue;
1163  l1CaloTower.setL1egTrkSS(l1eg.experimentalParam("trkMatchWP_showerShape"));
1164  l1CaloTower.setL1egTrkIso(l1eg.experimentalParam("trkMatchWP_isolation"));
1165  l1CaloTower.setL1egStandaloneSS(l1eg.experimentalParam("standaloneWP_showerShape"));
1166  l1CaloTower.setL1egStandaloneIso(l1eg.experimentalParam("standaloneWP_isolation"));
1167  }
1168 
1169  L1CaloTowers->push_back(l1CaloTower);
1170  }
1171  }
1172  }
1173 
1174  iEvent.put(std::move(L1EGXtalClusters));
1175  iEvent.put(std::move(L1EGammas));
1176  iEvent.put(std::move(L1CaloTowers));
1177 }

References a, funct::abs(), b, begin, L1EGCrystalClusterEmulatorProducer::mycluster::c2x2_, L1EGCrystalClusterEmulatorProducer::mycluster::c2x5_, L1EGCrystalClusterEmulatorProducer::mycluster::c5x5_, calib_, caloGeometry_, L1EGCrystalClusterEmulatorProducer::mycluster::cbrem_, L1EGCrystalClusterEmulatorProducer::mycluster::ccrystalid_, L1EGCrystalClusterEmulatorProducer::mycluster::ceta_, convert_L2toL1_card(), convert_L2toL1_link(), convert_L2toL1_tower(), L1EGCrystalClusterEmulatorProducer::mycluster::cphi_, L1EGCrystalClusterEmulatorProducer::mycluster::cphotonshowershape_, L1EGCrystalClusterEmulatorProducer::mycluster::cpt, L1EGCrystalClusterEmulatorProducer::mycluster::craweta_, L1EGCrystalClusterEmulatorProducer::mycluster::crawphi_, L1EGCrystalClusterEmulatorProducer::mycluster::cshowershape_, L1EGCrystalClusterEmulatorProducer::mycluster::cshowershapeloosetk_, L1EGCrystalClusterEmulatorProducer::mycluster::ctowerid_, cut_500_MeV, L1EGCrystalClusterEmulatorProducer::mycluster::cWeightedEta_, L1EGCrystalClusterEmulatorProducer::mycluster::cWeightedPhi_, decoder_, HcalTrigTowerGeometry::detIds(), do_brem, ebGeometry, DetId::Ecal, EcalBarrel, ecalTPEBToken_, end, EgHLTOffHistBins_cfi::et, PVValHelper::eta, PV3DBase< T, PVType, FrameType >::eta(), Exception, dqmMemoryStats::float, edm::EventSetup::get(), get, get_towerEta_fromCardLinkTower(), get_towerEta_fromCardTowerInCard(), get_towerPhi_fromCardLinkTower(), get_towerPhi_fromCardTowerInCard(), getCrystal_etaID(), getCrystal_phiID(), getCrystalIDInTower(), getEta_fromL2LinkCardTowerCrystal(), getEtaMax_card(), getEtaMin_card(), CaloSubdetectorGeometry::getGeometry(), getPhi_fromL2LinkCardTowerCrystal(), getPhiMax_card(), getPhiMin_card(), CaloGeometry::getSubdetectorGeometry(), getTower_absoluteEtaID(), getTower_absolutePhiID(), getTower_etaID(), getTower_phiID(), getTowerEta_fromAbsoluteID(), getTowerID(), getToweriEta_fromAbsoluteID(), getToweriPhi_fromAbsoluteID(), getTowerPhi_fromAbsoluteID(), hbGeometry, hbTopology, DetId::Hcal, HcalBarrel, CaloTPGTranscoder::hcaletValue(), hcalTPToken_, hcTopology_, hit::id, L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::id(), iEvent, cuy::ii, createfilelist::int, findQualityFiles::jj, GetRecoTauVFromDQM_MC_cff::kk, l1tp2::CaloTower::l1egTowerEt(), M_PI, SiStripPI::max, eostools::move(), n_borders_eta, n_borders_phi, n_clusters_4link, n_clusters_link, n_clusters_max, n_clusters_per_link, n_crystals_3towers, n_crystals_towerEta, n_crystals_towerPhi, n_eta_bins, n_GCTcards, n_links_card, n_links_GCTcard, n_towers_halfPhi, n_towers_per_link, n_towers_Phi, l1tp2::CaloTower::nL1eg(), or, CalibrationSummaryClient_cfi::params, passes_iso(), passes_looseTkiso(), passes_looseTkss(), passes_photon(), passes_ss(), phi, PV3DBase< T, PVType, FrameType >::phi(), L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::position(), funct::pow(), edm::Handle< T >::product(), edm::ESHandle< T >::product(), L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::pt(), qcdUeDQM_cfi::quality, l1tp2::CaloTower::setEcalTowerEt(), L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setEnergy(), l1tp2::CaloTower::setHcalTowerEt(), L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setId(), L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setIdHcal(), l1tp2::CaloTower::setIsBarrel(), l1tp2::CaloTower::setL1egStandaloneIso(), l1tp2::CaloTower::setL1egStandaloneSS(), l1tp2::CaloTower::setL1egTowerEt(), l1tp2::CaloTower::setL1egTrkIso(), l1tp2::CaloTower::setL1egTrkSS(), l1tp2::CaloTower::setNL1eg(), L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setPosition(), L1EGCrystalClusterEmulatorProducer::SimpleCaloHit::setPt(), l1tp2::CaloTower::setTowerEta(), l1tp2::CaloTower::setTowerIEta(), l1tp2::CaloTower::setTowerIPhi(), l1tp2::CaloTower::setTowerPhi(), findQualityFiles::size, l1tp2::CaloTower::towerEta(), l1t::CaloTools::towerEta(), l1tp2::CaloTower::towerIEta(), l1tp2::CaloTower::towerIPhi(), l1tp2::CaloTower::towerPhi(), l1t::CaloTools::towerPhi(), and HcalTopology::validHT().

Member Data Documentation

◆ calib_

l1tp2::ParametricCalibration L1EGCrystalClusterEmulatorProducer::calib_
private

Definition at line 245 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ caloGeometry_

edm::ESHandle<CaloGeometry> L1EGCrystalClusterEmulatorProducer::caloGeometry_
private

Definition at line 247 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ decoder_

edm::ESHandle<CaloTPGTranscoder> L1EGCrystalClusterEmulatorProducer::decoder_
private

Definition at line 243 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ ebGeometry

const CaloSubdetectorGeometry* L1EGCrystalClusterEmulatorProducer::ebGeometry
private

Definition at line 248 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ ecalTPEBToken_

edm::EDGetTokenT<EcalEBTrigPrimDigiCollection> L1EGCrystalClusterEmulatorProducer::ecalTPEBToken_
private

Definition at line 241 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ hbGeometry

const CaloSubdetectorGeometry* L1EGCrystalClusterEmulatorProducer::hbGeometry
private

Definition at line 249 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ hbTopology

edm::ESHandle<HcalTopology> L1EGCrystalClusterEmulatorProducer::hbTopology
private

Definition at line 250 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ hcalTPToken_

edm::EDGetTokenT<edm::SortedCollection<HcalTriggerPrimitiveDigi> > L1EGCrystalClusterEmulatorProducer::hcalTPToken_
private

Definition at line 242 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ hcTopology_

const HcalTopology* L1EGCrystalClusterEmulatorProducer::hcTopology_
private

Definition at line 251 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

Vector3DBase
Definition: Vector3DBase.h:8
getTower_etaID
int getTower_etaID(int cluster_etaID)
Definition: L1EGammaCrystalsEmulatorProducer.cc:195
getEtaMax_card
int getEtaMax_card(int card)
Definition: L1EGammaCrystalsEmulatorProducer.cc:199
l1tp2::CaloTower::towerIEta
int towerIEta() const
Definition: CaloTower.h:38
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
L1EGCrystalClusterEmulatorProducer::passes_ss
bool passes_ss(float pt, float ss)
Definition: L1EGammaCrystalsEmulatorProducer.cc:1200
convert_L2toL1_tower
int convert_L2toL1_tower(int tower)
Definition: L1EGammaCrystalsEmulatorProducer.cc:122
dqmMemoryStats.float
float
Definition: dqmMemoryStats.py:127
l1tp2::CaloTower::towerEta
float towerEta() const
Definition: CaloTower.h:40
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
edm::Handle::product
T const * product() const
Definition: Handle.h:70
getPhiMax_card
int getPhiMax_card(int card)
Definition: L1EGammaCrystalsEmulatorProducer.cc:217
getTowerID
int getTowerID(int etaID, int phiID)
Definition: L1EGammaCrystalsEmulatorProducer.cc:186
getTower_absoluteEtaID
int getTower_absoluteEtaID(float eta)
Definition: L1EGammaCrystalsEmulatorProducer.cc:132
L1EGCrystalClusterEmulatorProducer::ecalTPEBToken_
edm::EDGetTokenT< EcalEBTrigPrimDigiCollection > ecalTPEBToken_
Definition: L1EGammaCrystalsEmulatorProducer.cc:241
l1tp2::CaloTower::setTowerPhi
void setTowerPhi(float phi)
Definition: CaloTower.h:53
DiDispStaMuonMonitor_cfi.pt
pt
Definition: DiDispStaMuonMonitor_cfi.py:39
CalibrationSummaryClient_cfi.params
params
Definition: CalibrationSummaryClient_cfi.py:14
slideIsoPtThreshold
static constexpr float slideIsoPtThreshold
Definition: L1EGammaCrystalsEmulatorProducer.cc:80
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
edm
HLT enums.
Definition: AlignableModifier.h:19
pss
std::pair< ALIstring, ALIstring > pss
Definition: Fit.h:25
getCrystalIDInTower
int getCrystalIDInTower(int etaID, int phiID)
Definition: L1EGammaCrystalsEmulatorProducer.cc:170
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
L1EGCrystalClusterEmulatorProducer::decoder_
edm::ESHandle< CaloTPGTranscoder > decoder_
Definition: L1EGammaCrystalsEmulatorProducer.cc:243
DetId::Hcal
Definition: DetId.h:28
n_towers_Phi
static constexpr int n_towers_Phi
Definition: L1EGammaCrystalsEmulatorProducer.cc:73
CaloGeometry::getSubdetectorGeometry
const CaloSubdetectorGeometry * getSubdetectorGeometry(const DetId &id) const
access the subdetector geometry for the given subdetector directly
Definition: CaloGeometry.cc:34
l1tp2::CaloTower::setL1egTowerEt
void setL1egTowerEt(float et)
Definition: CaloTower.h:55
n_links_card
static constexpr int n_links_card
Definition: L1EGammaCrystalsEmulatorProducer.cc:75
edm::SortedCollection
Definition: SortedCollection.h:49
do_brem
static constexpr bool do_brem
Definition: L1EGammaCrystalsEmulatorProducer.cc:59
l1tp2::CaloTower::setHcalTowerEt
void setHcalTowerEt(float et)
Definition: CaloTower.h:50
a1_80
static constexpr float a1_80
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
getEtaMin_card
int getEtaMin_card(int card)
Definition: L1EGammaCrystalsEmulatorProducer.cc:208
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
HcalBarrel
Definition: HcalAssistant.h:33
b2
static constexpr float b2
Definition: L1EGammaCrystalsEmulatorProducer.cc:83
n_towers_halfPhi
static constexpr int n_towers_halfPhi
Definition: L1EGammaCrystalsEmulatorProducer.cc:74
getPhi_fromL2LinkCardTowerCrystal
float getPhi_fromL2LinkCardTowerCrystal(int link, int card, int tower, int crystal)
Definition: L1EGammaCrystalsEmulatorProducer.cc:107
edm::Handle
Definition: AssociativeIterator.h:50
L1EGCrystalClusterEmulatorProducer::passes_looseTkss
bool passes_looseTkss(float pt, float ss)
Definition: L1EGammaCrystalsEmulatorProducer.cc:1214
EcalBarrel
Definition: EcalSubdetector.h:10
n_borders_phi
static constexpr int n_borders_phi
Definition: L1EGammaCrystalsEmulatorProducer.cc:62
n_clusters_max
static constexpr int n_clusters_max
Definition: L1EGammaCrystalsEmulatorProducer.cc:64
end
#define end
Definition: vmac.h:39
cc
l1tp2::CaloTower::nL1eg
int nL1eg() const
Definition: CaloTower.h:42
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
b1
static constexpr float b1
Definition: L1EGammaCrystalsEmulatorProducer.cc:83
convert_L2toL1_card
int convert_L2toL1_card(int card, int link)
Definition: L1EGammaCrystalsEmulatorProducer.cc:124
n_borders_eta
static constexpr int n_borders_eta
Definition: L1EGammaCrystalsEmulatorProducer.cc:63
l1t::CaloTools::towerPhi
static float towerPhi(int ieta, int iphi)
Definition: CaloTools.cc:208
e0_looseTkss
static constexpr float e0_looseTkss
Definition: L1EGammaCrystalsEmulatorProducer.cc:86
getTower_absolutePhiID
int getTower_absolutePhiID(float phi)
Definition: L1EGammaCrystalsEmulatorProducer.cc:138
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
L1EGCrystalClusterEmulatorProducer::ebGeometry
const CaloSubdetectorGeometry * ebGeometry
Definition: L1EGammaCrystalsEmulatorProducer.cc:248
e2_looseTkss
static constexpr float e2_looseTkss
Definition: L1EGammaCrystalsEmulatorProducer.cc:86
getCrystal_phiID
int getCrystal_phiID(float phi)
Definition: L1EGammaCrystalsEmulatorProducer.cc:126
getEta_fromL2LinkCardTowerCrystal
float getEta_fromL2LinkCardTowerCrystal(int link, int card, int tower, int crystal)
Definition: L1EGammaCrystalsEmulatorProducer.cc:100
n_towers_per_link
static constexpr int n_towers_per_link
Definition: L1EGammaCrystalsEmulatorProducer.cc:70
PVValHelper::eta
Definition: PVValidationHelpers.h:69
L1EGCrystalClusterEmulatorProducer::hbGeometry
const CaloSubdetectorGeometry * hbGeometry
Definition: L1EGammaCrystalsEmulatorProducer.cc:249
l1tp2::CaloCrystalCluster
Definition: CaloCrystalCluster.h:14
c2_ss
static constexpr float c2_ss
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
convert_L2toL1_link
int convert_L2toL1_link(int link)
Definition: L1EGammaCrystalsEmulatorProducer.cc:120
l1tp2::CaloTower::setL1egStandaloneIso
void setL1egStandaloneIso(int staIso)
Definition: CaloTower.h:60
GetRecoTauVFromDQM_MC_cff.kk
kk
Definition: GetRecoTauVFromDQM_MC_cff.py:84
HcalTopology::validHT
bool validHT(const HcalTrigTowerDetId &id) const
Definition: HcalTopology.cc:239
c0_ss
static constexpr float c0_ss
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
n_links_GCTcard
static constexpr int n_links_GCTcard
Definition: L1EGammaCrystalsEmulatorProducer.cc:76
n_GCTcards
static constexpr int n_GCTcards
Definition: L1EGammaCrystalsEmulatorProducer.cc:77
b
double b
Definition: hdecay.h:118
l1tp2::CaloTower
Definition: CaloTower.h:16
getCrystal_etaID
int getCrystal_etaID(float eta)
Definition: L1EGammaCrystalsEmulatorProducer.cc:114
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
getToweriEta_fromAbsoluteID
int getToweriEta_fromAbsoluteID(int id)
Definition: L1EGammaCrystalsEmulatorProducer.cc:144
getTower_phiID
int getTower_phiID(int cluster_phiID)
Definition: L1EGammaCrystalsEmulatorProducer.cc:191
L1EGCrystalClusterEmulatorProducer::caloGeometry_
edm::ESHandle< CaloGeometry > caloGeometry_
Definition: L1EGammaCrystalsEmulatorProducer.cc:247
edm::ParameterSet
Definition: ParameterSet.h:36
edm::LogError
Definition: MessageLogger.h:183
a
double a
Definition: hdecay.h:119
c1_ss
static constexpr float c1_ss
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
getPhiMin_card
int getPhiMin_card(int card)
Definition: L1EGammaCrystalsEmulatorProducer.cc:222
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CaloTPGRecord
Definition: CaloTPGRecord.h:26
L1EGCrystalClusterEmulatorProducer::calib_
l1tp2::ParametricCalibration calib_
Definition: L1EGammaCrystalsEmulatorProducer.cc:245
n_crystals_towerPhi
static constexpr int n_crystals_towerPhi
Definition: L1EGammaCrystalsEmulatorProducer.cc:68
L1EGCrystalClusterEmulatorProducer::hcalTPToken_
edm::EDGetTokenT< edm::SortedCollection< HcalTriggerPrimitiveDigi > > hcalTPToken_
Definition: L1EGammaCrystalsEmulatorProducer.cc:242
n_crystals_towerEta
static constexpr int n_crystals_towerEta
Definition: L1EGammaCrystalsEmulatorProducer.cc:67
l1tp2::CaloTower::setTowerEta
void setTowerEta(float eta)
Definition: CaloTower.h:54
createfilelist.int
int
Definition: createfilelist.py:10
l1tp2::CaloTower::setEcalTowerEt
void setEcalTowerEt(float et)
Definition: CaloTower.h:49
n_clusters_4link
static constexpr int n_clusters_4link
Definition: L1EGammaCrystalsEmulatorProducer.cc:66
iEvent
int iEvent
Definition: GenABIO.cc:224
l1tp2::CaloTower::towerIPhi
int towerIPhi() const
Definition: CaloTower.h:37
L1EGCrystalClusterEmulatorProducer::passes_looseTkiso
bool passes_looseTkiso(float pt, float iso)
Definition: L1EGammaCrystalsEmulatorProducer.cc:1193
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
l1tp2::CaloTower::setL1egStandaloneSS
void setL1egStandaloneSS(int staSS)
Definition: CaloTower.h:59
l1tp2::CaloTower::setTowerIPhi
void setTowerIPhi(int iPhi)
Definition: CaloTower.h:51
n_clusters_link
static constexpr int n_clusters_link
Definition: L1EGammaCrystalsEmulatorProducer.cc:65
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
l1t::EGamma
Definition: EGamma.h:20
b0
static constexpr float b0
Definition: L1EGammaCrystalsEmulatorProducer.cc:83
l1tp2::CaloTower::towerPhi
float towerPhi() const
Definition: CaloTower.h:39
CaloSubdetectorGeometry::getGeometry
virtual std::shared_ptr< const CaloCellGeometry > getGeometry(const DetId &id) const
Get the cell geometry of a given detector id. Should return false if not found.
Definition: CaloSubdetectorGeometry.cc:36
DetId::Ecal
Definition: DetId.h:27
HcalTrigTowerGeometry
Definition: HcalTrigTowerGeometry.h:10
get
#define get
get_towerEta_fromCardTowerInCard
int get_towerEta_fromCardTowerInCard(int card, int towerincard)
Definition: L1EGammaCrystalsEmulatorProducer.cc:174
a0_80
static constexpr float a0_80
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
e1_looseTkss
static constexpr float e1_looseTkss
Definition: L1EGammaCrystalsEmulatorProducer.cc:86
DDAxes::phi
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
L1EGCrystalClusterEmulatorProducer::passes_iso
bool passes_iso(float pt, float iso)
Definition: L1EGammaCrystalsEmulatorProducer.cc:1179
eostools.move
def move(src, dest)
Definition: eostools.py:511
l1t::CaloTools::towerEta
static float towerEta(int ieta)
Definition: CaloTools.cc:201
l1tp2::CaloTower::setIsBarrel
void setIsBarrel(bool isBarrel)
Definition: CaloTower.h:61
get_towerEta_fromCardLinkTower
int get_towerEta_fromCardLinkTower(int card, int link, int tower)
Definition: L1EGammaCrystalsEmulatorProducer.cc:182
qcdUeDQM_cfi.quality
quality
Definition: qcdUeDQM_cfi.py:31
n_crystals_3towers
static constexpr int n_crystals_3towers
Definition: L1EGammaCrystalsEmulatorProducer.cc:69
Exception
Definition: hltDiff.cc:246
l1tp2::CaloTower::setL1egTrkIso
void setL1egTrkIso(int trkIso)
Definition: CaloTower.h:58
l1tp2::CaloTower::setNL1eg
void setNL1eg(int n)
Definition: CaloTower.h:56
plateau_ss
static constexpr float plateau_ss
Definition: L1EGammaCrystalsEmulatorProducer.cc:81
findQualityFiles.jj
string jj
Definition: findQualityFiles.py:188
L1EGCrystalClusterEmulatorProducer::hcTopology_
const HcalTopology * hcTopology_
Definition: L1EGammaCrystalsEmulatorProducer.cc:251
or
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
Definition: Activities.doc:12
cut_500_MeV
static constexpr float cut_500_MeV
Definition: L1EGammaCrystalsEmulatorProducer.cc:87
CaloTPGTranscoder::hcaletValue
virtual double hcaletValue(const int &ieta, const int &iphi, const int &version, const int &compressedValue) const =0
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
get_towerPhi_fromCardLinkTower
int get_towerPhi_fromCardLinkTower(int card, int link, int tower)
Definition: L1EGammaCrystalsEmulatorProducer.cc:184
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
getTowerEta_fromAbsoluteID
float getTowerEta_fromAbsoluteID(int id)
Definition: L1EGammaCrystalsEmulatorProducer.cc:158
get_towerPhi_fromCardTowerInCard
int get_towerPhi_fromCardTowerInCard(int card, int towerincard)
Definition: L1EGammaCrystalsEmulatorProducer.cc:178
n_eta_bins
static constexpr int n_eta_bins
Definition: L1EGammaCrystalsEmulatorProducer.cc:61
l1tp2::CaloTower::setL1egTrkSS
void setL1egTrkSS(int trkSS)
Definition: CaloTower.h:57
JetChargeProducer_cfi.exp
exp
Definition: JetChargeProducer_cfi.py:6
L1EGCrystalClusterEmulatorProducer::hbTopology
edm::ESHandle< HcalTopology > hbTopology
Definition: L1EGammaCrystalsEmulatorProducer.cc:250
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
l1tp2::CaloTower::l1egTowerEt
float l1egTowerEt() const
Definition: CaloTower.h:41
a0
static constexpr float a0
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
l1tp2::CaloTower::setTowerIEta
void setTowerIEta(int iEta)
Definition: CaloTower.h:52
getTowerPhi_fromAbsoluteID
float getTowerPhi_fromAbsoluteID(int id)
Definition: L1EGammaCrystalsEmulatorProducer.cc:164
cuy.ii
ii
Definition: cuy.py:590
L1EGCrystalClusterEmulatorProducer::passes_photon
bool passes_photon(float pt, float pss)
Definition: L1EGammaCrystalsEmulatorProducer.cc:1207
edm::InputTag
Definition: InputTag.h:15
begin
#define begin
Definition: vmac.h:32
d1
static constexpr float d1
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
isolation
double isolation
Definition: AssociatedVariableMaxCutCandRefSelector.cc:25
hit
Definition: SiStripHitEffFromCalibTree.cc:88
n_clusters_per_link
static constexpr int n_clusters_per_link
Definition: L1EGammaCrystalsEmulatorProducer.cc:71
getToweriPhi_fromAbsoluteID
int getToweriPhi_fromAbsoluteID(int id)
Definition: L1EGammaCrystalsEmulatorProducer.cc:151
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443