Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:43

0001 ///
0002 /// \class l1t::Stage1Layer2CentralityAlgorithm
0003 ///
0004 /// \authors: Gian Michele Innocenti
0005 ///           R. Alex Barbieri
0006 ///
0007 /// Description: Centrality Algorithm HI
0008 
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 #include "L1Trigger/L1TCalorimeter/interface/Stage1Layer2HFBitCountAlgorithmImp.h"
0011 #include "L1Trigger/L1TCalorimeter/interface/legacyGtHelper.h"
0012 
0013 l1t::Stage1Layer2HFMinimumBias::Stage1Layer2HFMinimumBias(CaloParamsHelper const*) {}
0014 
0015 void l1t::Stage1Layer2HFMinimumBias::processEvent(const std::vector<l1t::CaloRegion>& regions,
0016                                                   const std::vector<l1t::CaloEmCand>& EMCands,
0017                                                   l1t::CaloSpare* spare) {
0018   int sumBits[4] = {0, 0, 0, 0};
0019 
0020   for (std::vector<CaloRegion>::const_iterator region = regions.begin(); region != regions.end(); region++) {
0021     switch (region->hwEta()) {
0022       case 0:  //1-
0023         sumBits[1] += region->hwQual();
0024         break;
0025       case 1:  //2-
0026         sumBits[3] += region->hwQual();
0027         break;
0028       case 20:  //2+
0029         sumBits[2] += region->hwQual();
0030         break;
0031       case 21:  //1+
0032         sumBits[0] += region->hwQual();
0033         break;
0034       default:
0035         break;
0036     }
0037   }
0038 
0039   for (int i = 0; i < 4; i++) {
0040     if (sumBits[i] > 0x7)
0041       sumBits[i] = 0x7;
0042 
0043     spare->SetRing(i, sumBits[i]);
0044   }
0045 }