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 hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () 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 226 of file L1EGammaCrystalsEmulatorProducer.cc.

Constructor & Destructor Documentation

◆ L1EGCrystalClusterEmulatorProducer()

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

Definition at line 339 of file L1EGammaCrystalsEmulatorProducer.cc.

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

◆ ~L1EGCrystalClusterEmulatorProducer()

L1EGCrystalClusterEmulatorProducer::~L1EGCrystalClusterEmulatorProducer ( )
override

Definition at line 349 of file L1EGammaCrystalsEmulatorProducer.cc.

349 {}

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 1178 of file L1EGammaCrystalsEmulatorProducer.cc.

1178  {
1179  if (pt < slideIsoPtThreshold) {
1180  if (!((a0_80 - a1_80 * pt) > iso))
1181  return false;
1182  } else {
1183  if (iso > a0)
1184  return false;
1185  }
1186  return true;
1187 }

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

Referenced by produce().

◆ passes_looseTkiso()

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

Definition at line 1189 of file L1EGammaCrystalsEmulatorProducer.cc.

1189  {
1190  return (b0 + b1 * std::exp(-b2 * pt) > iso);
1191 }

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

Referenced by produce().

◆ passes_looseTkss()

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

◆ passes_photon()

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

Definition at line 1197 of file L1EGammaCrystalsEmulatorProducer.cc.

1197 { return (pss > d0 - d1 * pt); }

References d0, d1, and DiDispStaMuonMonitor_cfi::pt.

Referenced by produce().

◆ passes_ss()

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

Definition at line 1193 of file L1EGammaCrystalsEmulatorProducer.cc.

1193  {
1194  return ((c0_ss + c1_ss * std::exp(-c2_ss * pt)) <= ss);
1195 }

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

Referenced by produce().

◆ produce()

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

Definition at line 351 of file L1EGammaCrystalsEmulatorProducer.cc.

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

References a, funct::abs(), b, 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_, mps_fire::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 244 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ caloGeometry_

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

Definition at line 246 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ decoder_

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

Definition at line 242 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ ebGeometry

const CaloSubdetectorGeometry* L1EGCrystalClusterEmulatorProducer::ebGeometry
private

Definition at line 247 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ ecalTPEBToken_

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

Definition at line 240 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ hbGeometry

const CaloSubdetectorGeometry* L1EGCrystalClusterEmulatorProducer::hbGeometry
private

Definition at line 248 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ hbTopology

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

Definition at line 249 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ hcalTPToken_

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

Definition at line 241 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

◆ hcTopology_

const HcalTopology* L1EGCrystalClusterEmulatorProducer::hcTopology_
private

Definition at line 250 of file L1EGammaCrystalsEmulatorProducer.cc.

Referenced by produce().

Vector3DBase
Definition: Vector3DBase.h:8
getTower_etaID
int getTower_etaID(int cluster_etaID)
Definition: L1EGammaCrystalsEmulatorProducer.cc:194
getEtaMax_card
int getEtaMax_card(int card)
Definition: L1EGammaCrystalsEmulatorProducer.cc:198
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:1193
convert_L2toL1_tower
int convert_L2toL1_tower(int tower)
Definition: L1EGammaCrystalsEmulatorProducer.cc:121
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:216
getTowerID
int getTowerID(int etaID, int phiID)
Definition: L1EGammaCrystalsEmulatorProducer.cc:185
getTower_absoluteEtaID
int getTower_absoluteEtaID(float eta)
Definition: L1EGammaCrystalsEmulatorProducer.cc:131
L1EGCrystalClusterEmulatorProducer::ecalTPEBToken_
edm::EDGetTokenT< EcalEBTrigPrimDigiCollection > ecalTPEBToken_
Definition: L1EGammaCrystalsEmulatorProducer.cc:240
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:169
reco::Candidate::PolarLorentzVector
math::PtEtaPhiMLorentzVector PolarLorentzVector
Lorentz vector.
Definition: Candidate.h:38
L1EGCrystalClusterEmulatorProducer::decoder_
edm::ESHandle< CaloTPGTranscoder > decoder_
Definition: L1EGammaCrystalsEmulatorProducer.cc:242
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:81
getEtaMin_card
int getEtaMin_card(int card)
Definition: L1EGammaCrystalsEmulatorProducer.cc:207
GlobalVector
Global3DVector GlobalVector
Definition: GlobalVector.h:10
HcalBarrel
Definition: HcalAssistant.h:33
b2
static constexpr float b2
Definition: L1EGammaCrystalsEmulatorProducer.cc:82
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:106
edm::Handle
Definition: AssociativeIterator.h:50
L1EGCrystalClusterEmulatorProducer::passes_looseTkss
bool passes_looseTkss(float pt, float ss)
Definition: L1EGammaCrystalsEmulatorProducer.cc:1199
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
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:82
convert_L2toL1_card
int convert_L2toL1_card(int card, int link)
Definition: L1EGammaCrystalsEmulatorProducer.cc:123
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:85
getTower_absolutePhiID
int getTower_absolutePhiID(float phi)
Definition: L1EGammaCrystalsEmulatorProducer.cc:137
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
L1EGCrystalClusterEmulatorProducer::ebGeometry
const CaloSubdetectorGeometry * ebGeometry
Definition: L1EGammaCrystalsEmulatorProducer.cc:247
e2_looseTkss
static constexpr float e2_looseTkss
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
getCrystal_phiID
int getCrystal_phiID(float phi)
Definition: L1EGammaCrystalsEmulatorProducer.cc:125
getEta_fromL2LinkCardTowerCrystal
float getEta_fromL2LinkCardTowerCrystal(int link, int card, int tower, int crystal)
Definition: L1EGammaCrystalsEmulatorProducer.cc:99
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:248
l1tp2::CaloCrystalCluster
Definition: CaloCrystalCluster.h:14
mps_fire.end
end
Definition: mps_fire.py:242
c2_ss
static constexpr float c2_ss
Definition: L1EGammaCrystalsEmulatorProducer.cc:83
convert_L2toL1_link
int convert_L2toL1_link(int link)
Definition: L1EGammaCrystalsEmulatorProducer.cc:119
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:83
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:113
HcalRecNumberingRecord
Definition: HcalRecNumberingRecord.h:23
getToweriEta_fromAbsoluteID
int getToweriEta_fromAbsoluteID(int id)
Definition: L1EGammaCrystalsEmulatorProducer.cc:143
getTower_phiID
int getTower_phiID(int cluster_phiID)
Definition: L1EGammaCrystalsEmulatorProducer.cc:190
L1EGCrystalClusterEmulatorProducer::caloGeometry_
edm::ESHandle< CaloGeometry > caloGeometry_
Definition: L1EGammaCrystalsEmulatorProducer.cc:246
edm::ParameterSet
Definition: ParameterSet.h:47
a
double a
Definition: hdecay.h:119
c1_ss
static constexpr float c1_ss
Definition: L1EGammaCrystalsEmulatorProducer.cc:83
getPhiMin_card
int getPhiMin_card(int card)
Definition: L1EGammaCrystalsEmulatorProducer.cc:221
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
CaloTPGRecord
Definition: CaloTPGRecord.h:26
L1EGCrystalClusterEmulatorProducer::calib_
l1tp2::ParametricCalibration calib_
Definition: L1EGammaCrystalsEmulatorProducer.cc:244
n_crystals_towerPhi
static constexpr int n_crystals_towerPhi
Definition: L1EGammaCrystalsEmulatorProducer.cc:68
L1EGCrystalClusterEmulatorProducer::hcalTPToken_
edm::EDGetTokenT< edm::SortedCollection< HcalTriggerPrimitiveDigi > > hcalTPToken_
Definition: L1EGammaCrystalsEmulatorProducer.cc:241
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:1189
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:49
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:82
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
edm::LogError
Log< level::Error, false > LogError
Definition: MessageLogger.h:123
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:173
a0_80
static constexpr float a0_80
Definition: L1EGammaCrystalsEmulatorProducer.cc:81
e1_looseTkss
static constexpr float e1_looseTkss
Definition: L1EGammaCrystalsEmulatorProducer.cc:85
DDAxes::phi
L1EGCrystalClusterEmulatorProducer::passes_iso
bool passes_iso(float pt, float iso)
Definition: L1EGammaCrystalsEmulatorProducer.cc:1178
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:181
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
findQualityFiles.jj
string jj
Definition: findQualityFiles.py:188
L1EGCrystalClusterEmulatorProducer::hcTopology_
const HcalTopology * hcTopology_
Definition: L1EGammaCrystalsEmulatorProducer.cc:250
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:86
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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:29
get_towerPhi_fromCardLinkTower
int get_towerPhi_fromCardLinkTower(int card, int link, int tower)
Definition: L1EGammaCrystalsEmulatorProducer.cc:183
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
getTowerEta_fromAbsoluteID
float getTowerEta_fromAbsoluteID(int id)
Definition: L1EGammaCrystalsEmulatorProducer.cc:157
get_towerPhi_fromCardTowerInCard
int get_towerPhi_fromCardTowerInCard(int card, int towerincard)
Definition: L1EGammaCrystalsEmulatorProducer.cc:177
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:249
d0
static constexpr float d0
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
l1tp2::CaloTower::l1egTowerEt
float l1egTowerEt() const
Definition: CaloTower.h:41
a0
static constexpr float a0
Definition: L1EGammaCrystalsEmulatorProducer.cc:81
l1tp2::CaloTower::setTowerIEta
void setTowerIEta(int iEta)
Definition: CaloTower.h:52
getTowerPhi_fromAbsoluteID
float getTowerPhi_fromAbsoluteID(int id)
Definition: L1EGammaCrystalsEmulatorProducer.cc:163
cuy.ii
ii
Definition: cuy.py:590
L1EGCrystalClusterEmulatorProducer::passes_photon
bool passes_photon(float pt, float pss)
Definition: L1EGammaCrystalsEmulatorProducer.cc:1197
edm::InputTag
Definition: InputTag.h:15
d1
static constexpr float d1
Definition: L1EGammaCrystalsEmulatorProducer.cc:84
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:150
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443