File indexing completed on 2024-04-06 12:20:23
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010 #include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2TauAlgorithmImp.h"
0011 #include "DataFormats/L1CaloTrigger/interface/L1CaloRegionDetId.h"
0012
0013 #include "L1Trigger/L1TCalorimeter/interface/PUSubtractionMethods.h"
0014 #include "L1Trigger/L1TCalorimeter/interface/legacyGtHelper.h"
0015 #include "L1Trigger/L1TCalorimeter/interface/HardwareSortingMethods.h"
0016
0017 l1t::Stage1Layer2SingleTrackHI::Stage1Layer2SingleTrackHI(CaloParamsHelper const* params) : params_(params) {}
0018
0019 void findRegions(const std::vector<l1t::CaloRegion>* sr, std::vector<l1t::Tau>* t, const int etaMask);
0020
0021 void l1t::Stage1Layer2SingleTrackHI::processEvent(const std::vector<l1t::CaloEmCand>& clusters,
0022 const std::vector<l1t::CaloRegion>& regions,
0023 std::vector<l1t::Tau>* isoTaus,
0024 std::vector<l1t::Tau>* taus) {
0025 int etaMask = params_->tauRegionMask();
0026
0027 std::vector<l1t::CaloRegion> subRegions;
0028 std::vector<l1t::Tau> preGtEtaTaus;
0029 std::vector<l1t::Tau> preGtTaus;
0030 std::vector<l1t::Tau> unsortedTaus;
0031
0032 HICaloRingSubtraction(regions, &subRegions, params_);
0033 findRegions(&subRegions, &preGtTaus, etaMask);
0034 TauToGtPtScales(params_, &preGtTaus, &unsortedTaus);
0035 SortTaus(&unsortedTaus, &preGtEtaTaus);
0036
0037
0038 TauToGtEtaScales(params_, &preGtEtaTaus, taus);
0039
0040 isoTaus->resize(4);
0041
0042 }
0043
0044 void findRegions(const std::vector<l1t::CaloRegion>* sr, std::vector<l1t::Tau>* t, const int etaMask) {
0045 for (std::vector<l1t::CaloRegion>::const_iterator region = sr->begin(); region != sr->end(); region++) {
0046 int tauEta = region->hwEta();
0047 if (tauEta < 4 || tauEta > 17)
0048 continue;
0049 if ((etaMask & (1 << tauEta)) >> tauEta)
0050 continue;
0051
0052 ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > TauLorentz(0, 0, 0, 0);
0053 l1t::Tau taucand(*&TauLorentz, region->hwPt(), region->hwEta(), region->hwPhi());
0054
0055 t->push_back(taucand);
0056 }
0057 }