Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:23

0001 // Stage1Layer2SingleTrackHI.cc
0002 // Authors: Michael Northup
0003 //          Alex Barbieri
0004 //
0005 // This is a special-purpose single-track seed trigger which uses the
0006 // Tau channel to communicate with GT. Be wary of any naming scheme
0007 // because we are masquerading as both a tau and track trigger when
0008 // we are really just looking for the hottest region.
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   //SortTaus(preGtTaus, unsortedTaus);
0037   //TauToGtPtScales(params_, unsortedTaus, preGtEtaTaus);
0038   TauToGtEtaScales(params_, &preGtEtaTaus, taus);
0039 
0040   isoTaus->resize(4);
0041   //taus->resize(4);
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;  // taus CANNOT be in the forward region
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 }