CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Typedefs | Enumerations | Functions
l1t Namespace Reference

map containing the conditions More...

Classes

class  AlgorithmEvaluation
 
class  BXVectorInputProducer
 
class  CaloCluster
 
class  CaloCondition
 
class  CaloEmCand
 
class  CaloMainProcessor
 
class  CaloParams
 
class  CaloParamsESProducer
 
class  CaloParamsStage1
 
class  CaloRegion
 
class  CaloSpare
 
class  CaloStage1Cluster
 
class  CaloStage1FirmwareFactory
 
class  CaloStage2JetAlgorithm
 
class  CaloStage2Nav
 
class  CaloStage2TowerAlgorithmFirmwareImp1
 
class  CaloTools
 
class  CaloTower
 
class  ConditionEvaluation
 
class  DataAlreadyPresentException
 
class  DataInvalidException
 
class  DataManager
 
class  DataWriter
 
class  Description
 
class  EGamma
 
class  EtSum
 
class  FakeInputProducer
 
class  GenToInputProducer
 
class  GtBoard
 
struct  GtConditionCategoryStringToEnum
 
struct  GtConditionTypeStringToEnum
 
class  GtInputDump
 
class  GtProducer
 
class  GtRecordDump
 
class  Interval
 
class  IntervalManager
 
class  Jet
 
class  L1Candidate
 
struct  L1GtBoardTypeStringToEnum
 
struct  L1GtPsbQuadStringToEnum
 
class  L1TCaloRCTToUpgradeConverter
 
class  L1TCaloUpgradeToGCTConverter
 
class  LUT
 
class  MuCondition
 
class  Muon
 
class  OMDSReader
 
class  PhysicalEtAdder
 
class  Stage1Layer2CentralityAlgorithm
 
class  Stage1Layer2DiTauAlgorithm
 
class  Stage1Layer2EGammaAlgorithm
 
class  Stage1Layer2EGammaAlgorithmImpPP
 
class  Stage1Layer2EtSumAlgorithm
 
class  Stage1Layer2EtSumAlgorithmImpPP
 
class  Stage1Layer2FirmwareFactory
 
class  Stage1Layer2FlowAlgorithm
 
class  Stage1Layer2HFBitCountAlgorithm
 
class  Stage1Layer2HFRingSumAlgorithm
 
class  Stage1Layer2JetAlgorithm
 
class  Stage1Layer2JetAlgorithmImpHI
 
class  Stage1Layer2JetAlgorithmImpPP
 
class  Stage1Layer2JetAlgorithmImpSimpleHW
 
class  Stage1Layer2MainProcessor
 
class  Stage1Layer2MainProcessorFirmwareImp1
 
class  Stage1Layer2Producer
 
class  Stage1Layer2SingleTrackHI
 
class  Stage1Layer2TauAlgorithm
 
class  Stage1Layer2TauAlgorithmImpPP
 
class  Stage2CaloAnalyzer
 
class  Stage2Layer1FirmwareFactory
 
class  Stage2Layer1Producer
 
class  Stage2Layer2ClusterAlgorithm
 
class  Stage2Layer2ClusterAlgorithmFirmwareImp1
 
class  Stage2Layer2EGammaAlgorithm
 
class  Stage2Layer2EGammaAlgorithmFirmwareImp1
 
class  Stage2Layer2EtSumAlgorithm
 
class  Stage2Layer2EtSumAlgorithmFirmwareImp1
 
class  Stage2Layer2FirmwareFactory
 
class  Stage2Layer2JetAlgorithm
 
class  Stage2Layer2JetAlgorithmFirmwareImp1
 
class  Stage2Layer2JetSumAlgorithm
 
class  Stage2Layer2JetSumAlgorithmFirmwareImp1
 
class  Stage2Layer2MainProcessorFirmwareImp1
 
class  Stage2Layer2Producer
 
class  Stage2Layer2TauAlgorithm
 
class  Stage2Layer2TauAlgorithmFirmwareImp1
 
class  Stage2MainProcessor
 
class  Stage2MainProcessorFirmwareImp1
 
class  Stage2PreProcessor
 
class  Stage2PreProcessorFirmwareImp1
 
class  Stage2TowerCompressAlgorithm
 
class  Stage2TowerCompressAlgorithmFirmwareImp1
 
class  Stage2TowerDecompressAlgorithm
 
class  Stage2TowerDecompressAlgorithmFirmwareImp1
 
class  Tau
 
class  TriggerMenuXmlParser
 
class  TriggerMenuXmlProducer
 
class  WriterProxy
 
class  WriterProxyT
 

Typedefs

typedef std::map< std::string,
L1GtAlgorithm
AlgorithmMap
 map containing the algorithms More...
 
typedef BXVector< CaloClusterCaloClusterBxCollection
 
typedef BXVector< CaloEmCandCaloEmCandBxCollection
 
typedef BXVector< CaloRegionCaloRegionBxCollection
 
typedef BXVector< CaloSpareCaloSpareBxCollection
 
typedef BXVector
< CaloStage1Cluster
CaloStage1ClusterBxCollection
 
typedef BXVector< CaloTowerCaloTowerBxCollection
 
typedef
AlgorithmMap::const_iterator 
CItAlgo
 iterators through map containing the algorithms More...
 
typedef
ConditionMap::const_iterator 
CItCond
 iterators through map containing the conditions More...
 
typedef std::map< std::string,
GtCondition * > 
ConditionMap
 
typedef BXVector< EGammaEGammaBxCollection
 
typedef BXVector< EtSumEtSumBxCollection
 
typedef AlgorithmMap::iterator ItAlgo
 
typedef ConditionMap::iterator ItCond
 
typedef BXVector< JetJetBxCollection
 
typedef BXVector< L1CandidateL1CandidateBxCollection
 
typedef BXVector< MuonMuonBxCollection
 
typedef BXVector< TauTauBxCollection
 
typedef
edmplugin::PluginFactory
< l1t::WriterProxy *()> 
WriterFactory
 

Enumerations

enum  GtConditionCategory {
  CondNull, CondMuon, CondCalo, CondEnergySum,
  CondJetCounts, CondCorrelation, CondCastor, CondHfBitCounts,
  CondHfRingEtSums, CondBptx, CondExternal
}
 condition categories More...
 
enum  GtConditionType {
  TypeNull, Type1s, Type2s, Type2wsc,
  Type2cor, Type3s, Type4s, TypeETM,
  TypeETT, TypeHTT, TypeHTM, TypeJetCounts,
  TypeCastor, TypeHfBitCounts, TypeHfRingEtSums, TypeBptx,
  TypeExternal
}
 
enum  L1GtBoardType {
  GTFE, FDL, PSB, GMT,
  TCS, TIM, BoardNull
}
 board types in GT More...
 
enum  L1GtPsbQuad {
  Free, TechTr, IsoEGQ, NoIsoEGQ,
  CenJetQ, ForJetQ, TauJetQ, ESumsQ,
  JetCountsQ, MQB1, MQB2, MQF3,
  MQF4, MQB5, MQB6, MQF7,
  MQF8, MQB9, MQB10, MQF11,
  MQF12, CastorQ, HfQ, BptxQ,
  GtExternalQ, PsbQuadNull
}
 quadruples sent to GT via PSB More...
 

Functions

int deltaGctPhi (const CaloRegion &region, const CaloRegion &neighbor)
 
void EGammaToGtScales (CaloParamsStage1 *params, const std::vector< l1t::EGamma > *input, std::vector< l1t::EGamma > *output)
 
void EtSumToGtScales (CaloParamsStage1 *params, const std::vector< l1t::EtSum > *input, std::vector< l1t::EtSum > *output)
 
const unsigned int gtEta (const unsigned int iEta)
 
void HICaloRingSubtraction (const std::vector< l1t::CaloRegion > &regions, std::vector< l1t::CaloRegion > *subRegions)
 ------------— For heavy ion ----------------------------------— More...
 
void JetCalibration (std::vector< l1t::Jet > *uncalibjets, std::vector< double > jetCalibrationParams, std::vector< l1t::Jet > *jets, std::string jetCalibrationType, double jetLSB)
 
void JetToGtScales (CaloParamsStage1 *params, const std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
 
std::string l1GtBoardTypeEnumToString (const L1GtBoardType &)
 
L1GtBoardType l1GtBoardTypeStringToEnum (const std::string &)
 
std::string l1GtConditionCategoryEnumToString (const GtConditionCategory &)
 
GtConditionCategory l1GtConditionCategoryStringToEnum (const std::string &)
 
std::string l1GtConditionTypeEnumToString (const GtConditionType &)
 
GtConditionType l1GtConditionTypeStringToEnum (const std::string &)
 
std::string l1GtPsbQuadEnumToString (const L1GtPsbQuad &)
 
L1GtPsbQuad l1GtPsbQuadStringToEnum (const std::string &)
 
void passThroughJets (const std::vector< l1t::CaloRegion > *regions, std::vector< l1t::Jet > *uncalibjets)
 
void RegionCorrection (const std::vector< l1t::CaloRegion > &regions, std::vector< l1t::CaloRegion > *subRegions, std::vector< double > regionPUSParams, std::string regionPUSType)
 ------— New region correction (PUsub, no response correction at the moment) --------— More...
 
void simpleHWSubtraction (const std::vector< l1t::CaloRegion > &regions, std::vector< l1t::CaloRegion > *subRegions)
 
void slidingWindowJetFinder (const int, const std::vector< l1t::CaloRegion > *regions, std::vector< l1t::Jet > *uncalibjets)
 
void SortJets (std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
 
void TauToGtScales (CaloParamsStage1 *params, const std::vector< l1t::Tau > *input, std::vector< l1t::Tau > *output)
 
void TwelveByTwelveFinder (const int, const std::vector< l1t::CaloRegion > *regions, std::vector< l1t::Jet > *uncalibjets)
 

Detailed Description

map containing the conditions

Description: Simple Navigator class for the CaloTowers

Author
: Sam Harper - RAL

Description: Firmware headers

Implementation: Collects concrete algorithm implmentations.

Author
: R. Alex Barbieri MIT Kalanand Mishra, Fermilab

Description: Firmware headers

Implementation: Collects concrete algorithm implmentations.

Author
: R. Alex Barbieri MIT

Description: Firmware headers

Implementation: Concrete firmware implementations

Author
: Jim Brooke - University of Bristol

Description: Firmware headers

Implementation: Concrete firmware implementations

Author
: Jim Brooke - University of Bristol Modified: Adam Elwood - ICL

Description: enums for the L1 GT.

Implementation: Defines various enums for CondFormats L1 GT. For each enum, define the lightweight "maps" for enum string label and enum value

Author
: Vasile Mihai Ghete - HEPHY Vienna

$Date$ $Revision$

Typedef Documentation

typedef std::map<std::string, L1GtAlgorithm> l1t::AlgorithmMap

map containing the algorithms

Definition at line 32 of file TriggerMenuFwd.h.

Definition at line 85 of file CaloCluster.h.

Definition at line 26 of file CaloEmCand.h.

Definition at line 47 of file CaloRegion.h.

Definition at line 10 of file CaloSpare.h.

Definition at line 27 of file CaloStage1Cluster.h.

Definition at line 10 of file CaloTower.h.

typedef AlgorithmMap::const_iterator l1t::CItAlgo

iterators through map containing the algorithms

Definition at line 39 of file TriggerMenuFwd.h.

typedef ConditionMap::const_iterator l1t::CItCond

iterators through map containing the conditions

Definition at line 35 of file TriggerMenuFwd.h.

typedef std::map<std::string, GtCondition*> l1t::ConditionMap

Definition at line 29 of file TriggerMenuFwd.h.

Definition at line 11 of file EGamma.h.

Definition at line 10 of file EtSum.h.

typedef AlgorithmMap::iterator l1t::ItAlgo

Definition at line 40 of file TriggerMenuFwd.h.

typedef ConditionMap::iterator l1t::ItCond

Definition at line 36 of file TriggerMenuFwd.h.

Definition at line 10 of file Jet.h.

Definition at line 9 of file L1Candidate.h.

Definition at line 9 of file Muon.h.

Definition at line 10 of file Tau.h.

Definition at line 88 of file WriterProxy.h.

Enumeration Type Documentation

condition categories

Enumerator
CondNull 
CondMuon 
CondCalo 
CondEnergySum 
CondJetCounts 
CondCorrelation 
CondCastor 
CondHfBitCounts 
CondHfRingEtSums 
CondBptx 
CondExternal 

Definition at line 128 of file GtDefinitions.h.

condition types TypeNull: null type - for condition constructor only Type1s : one particle Type2s : two particles, same type, no spatial correlations among them Type2wsc : two particles, same type, with spatial correlations among them Type2cor : two particles, different type, with spatial correlations among them Type3s : three particles, same type Type4s : four particles, same type TypeETM, TypeETT, TypeHTT, TypeHTM : ETM, ETT, HTT, HTM TypeJetCounts : JetCounts TypeCastor : CASTOR condition (logical result only; definition in CASTOR) TypeHfBitCounts : HfBitCounts TypeHfRingEtSums : HfRingEtSums TypeBptx: BPTX (logical result only; definition in BPTX system) TypeExternal: external conditions (logical result only; definition in L1 GT external systems)

Enumerator
TypeNull 
Type1s 
Type2s 
Type2wsc 
Type2cor 
Type3s 
Type4s 
TypeETM 
TypeETT 
TypeHTT 
TypeHTM 
TypeJetCounts 
TypeCastor 
TypeHfBitCounts 
TypeHfRingEtSums 
TypeBptx 
TypeExternal 

Definition at line 99 of file GtDefinitions.h.

board types in GT

Enumerator
GTFE 
FDL 
PSB 
GMT 
TCS 
TIM 
BoardNull 

Definition at line 28 of file GtDefinitions.h.

28  {
29  GTFE,
30  FDL,
31  PSB,
32  GMT,
33  TCS,
34  TIM,
35  BoardNull
36 };

quadruples sent to GT via PSB

Enumerator
Free 
TechTr 
IsoEGQ 
NoIsoEGQ 
CenJetQ 
ForJetQ 
TauJetQ 
ESumsQ 
JetCountsQ 
MQB1 
MQB2 
MQF3 
MQF4 
MQB5 
MQB6 
MQF7 
MQF8 
MQB9 
MQB10 
MQF11 
MQF12 
CastorQ 
HfQ 
BptxQ 
GtExternalQ 
PsbQuadNull 

Definition at line 47 of file GtDefinitions.h.

Function Documentation

int l1t::deltaGctPhi ( const CaloRegion &  region,
const CaloRegion &  neighbor 
)

Definition at line 18 of file JetFinderMethods.cc.

References funct::abs(), diffTreeTool::diff, l1t::L1Candidate::hwPhi(), and L1CaloRegionDetId::N_PHI.

Referenced by slidingWindowJetFinder(), and TwelveByTwelveFinder().

19  {
20  int phi1 = region.hwPhi();
21  int phi2 = neighbor.hwPhi();
22  int diff = phi1 - phi2;
23  if (std::abs(phi1 - phi2) == L1CaloRegionDetId::N_PHI-1) { //18 regions in phi
24  diff = -diff/std::abs(diff);
25  }
26  return diff;
27  }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const unsigned N_PHI
void l1t::EGammaToGtScales ( CaloParamsStage1 *  params,
const std::vector< l1t::EGamma > *  input,
std::vector< l1t::EGamma > *  output 
)

Definition at line 30 of file legacyGtHelper.cc.

References gtEta().

Referenced by l1t::Stage1Layer2EGammaAlgorithmImpPP::processEvent().

32  {
33 
34  for(std::vector<l1t::EGamma>::const_iterator itEGamma = input->begin();
35  itEGamma != input->end(); ++itEGamma){
36  const unsigned newEta = gtEta(itEGamma->hwEta());
37  const uint16_t rankPt = (uint16_t)itEGamma->hwPt(); //max value?
38 
39  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
40 
41  l1t::EGamma gtEGamma(*&ldummy, rankPt, newEta, itEGamma->hwPhi(),
42  itEGamma->hwQual(), itEGamma->hwIso());
43  output->push_back(gtEGamma);
44  }
45  }
const unsigned int gtEta(const unsigned int iEta)
static std::string const input
Definition: EdmProvDump.cc:44
void l1t::EtSumToGtScales ( CaloParamsStage1 *  params,
const std::vector< l1t::EtSum > *  input,
std::vector< l1t::EtSum > *  output 
)

Definition at line 64 of file legacyGtHelper.cc.

References l1t::CaloParamsStage1::emScale(), l1t::CaloParamsStage1::HtMissScale(), L1CaloEtScale::linearLsb(), and L1CaloEtScale::rank().

Referenced by l1t::Stage1Layer2EtSumAlgorithmImpPP::processEvent().

66  {
67  for(std::vector<l1t::EtSum>::const_iterator itEtSum = input->begin();
68  itEtSum != input->end(); ++itEtSum){
69 
70  uint16_t rankPt;
71  // Hack for now to make sure they come out with the right scale
72  //rankPt = params->jetScale().rank((uint16_t)itEtSum->hwPt());
73  rankPt = (uint16_t)itEtSum->hwPt();
74  if (EtSum::EtSumType::kMissingHt == itEtSum->getType())
75  {
76  // if(rankPt > params->HtMissScale().linScaleMax()) rankPt = params->HtMissScale().linScaleMax();
77  // params->HtMissScale().linScaleMax() always returns zero. Hardcode 512 for now
78  if(rankPt > 512) rankPt = 512;
79  rankPt = params->HtMissScale().rank(rankPt*params->emScale().linearLsb());
80  }
81 
82  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
83 
84  l1t::EtSum gtEtSum(*&ldummy, itEtSum->getType(), rankPt, 0,
85  itEtSum->hwPhi(), itEtSum->hwQual());
86 
87  output->push_back(gtEtSum);
88  }
89  }
static std::string const input
Definition: EdmProvDump.cc:44
const unsigned int l1t::gtEta ( const unsigned int  iEta)

Definition at line 91 of file legacyGtHelper.cc.

Referenced by EGammaToGtScales(), getRegionEta(), JetToGtScales(), and TauToGtScales().

92  {
93  unsigned rctEta = (iEta<11 ? 10-iEta : iEta-11);
94  return (((rctEta % 7) & 0x7) | (iEta<11 ? 0x8 : 0));
95  }
void l1t::HICaloRingSubtraction ( const std::vector< l1t::CaloRegion > &  regions,
std::vector< l1t::CaloRegion > *  subRegions 
)

------------— For heavy ion ----------------------------------—

Definition at line 18 of file PUSubtractionMethods.cc.

References i, max(), and L1CaloRegionDetId::N_ETA.

Referenced by l1t::Stage1Layer2SingleTrackHI::processEvent(), l1t::Stage1Layer2JetAlgorithmImpHI::processEvent(), and RegionCorrection().

20  {
21  int puLevelHI[L1CaloRegionDetId::N_ETA];
22  double r_puLevelHI[L1CaloRegionDetId::N_ETA];
23  int etaCount[L1CaloRegionDetId::N_ETA];
24  for(unsigned i = 0; i < L1CaloRegionDetId::N_ETA; ++i)
25  {
26  puLevelHI[i] = 0;
27  r_puLevelHI[i] = 0.0;
28  etaCount[i] = 0;
29  }
30 
31  for(std::vector<CaloRegion>::const_iterator region = regions.begin();
32  region != regions.end(); region++){
33  r_puLevelHI[region->hwEta()] += region->hwPt();
34  etaCount[region->hwEta()]++;
35  }
36 
37  for(unsigned i = 0; i < L1CaloRegionDetId::N_ETA; ++i)
38  {
39  puLevelHI[i] = floor(r_puLevelHI[i]/etaCount[i] + 0.5);
40  }
41 
42  for(std::vector<CaloRegion>::const_iterator region = regions.begin(); region!= regions.end(); region++){
43  int subPt = std::max(0, region->hwPt() - puLevelHI[region->hwEta()]);
44  int subEta = region->hwEta();
45  int subPhi = region->hwPhi();
46 
47  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
48 
49  CaloRegion newSubRegion(*&ldummy, 0, 0, subPt, subEta, subPhi, region->hwQual(), region->hwEtEm(), region->hwEtHad());
50  subRegions->push_back(newSubRegion);
51  }
52  }
int i
Definition: DBlmapReader.cc:9
static const unsigned N_ETA
const T & max(const T &a, const T &b)
void l1t::JetCalibration ( std::vector< l1t::Jet > *  uncalibjets,
std::vector< double >  jetCalibrationParams,
std::vector< l1t::Jet > *  jets,
std::string  jetCalibrationType,
double  jetLSB 
)

Definition at line 12 of file JetCalibrationMethods.cc.

References alpha, reco::btau::jetEta, reco::btau::jetPhi, and reco::btau::jetPt.

Referenced by l1t::Stage1Layer2JetAlgorithmImpPP::processEvent().

17  {
18 
19  for (std::vector<l1t::Jet>::const_iterator uncalibjet = uncalibjets->begin(); uncalibjet != uncalibjets->end(); ++uncalibjet){
20 
21  if (jetCalibrationType == "None") {
22  l1t::Jet corrjets = *uncalibjet;
23  jets->push_back(corrjets);
24  continue;
25  }
26 
27  if (jetCalibrationType == "Stage1JEC") {
28  int jetPt = (uncalibjet->hwPt())*jetLSB; // correction factors are parameterized as functions of physical pt
29  int jetPhi = uncalibjet->hwPhi();
30  int jetEta = uncalibjet->hwEta();
31  int jetQual = uncalibjet->hwQual();
32  double jpt = 0.0;
33 
34  double alpha = jetCalibrationParams[2*jetEta + 0]; //Scale factor (See jetSF_cfi.py)
35  double gamma = ((jetCalibrationParams[2*jetEta + 1])); //Offset
36 
37  jpt = jetPt*alpha+gamma;
38  unsigned int corjetET =(int) (jpt/jetLSB);
39 
40  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0,0,0,0);
41  l1t::Jet corrjets(*&jetLorentz, corjetET, jetEta, jetPhi, jetQual);
42 
43  jets->push_back(corrjets);
44  }
45  }
46  }
float alpha
Definition: AMPTWrapper.h:95
Definition: Jet.h:13
vector< PseudoJet > jets
void l1t::JetToGtScales ( CaloParamsStage1 *  params,
const std::vector< l1t::Jet > *  input,
std::vector< l1t::Jet > *  output 
)

Definition at line 12 of file legacyGtHelper.cc.

References gtEta(), l1t::CaloParamsStage1::jetScale(), L1CaloEtScale::linScaleMax(), and L1CaloEtScale::rank().

Referenced by l1t::Stage1Layer2JetAlgorithmImpHI::processEvent(), l1t::Stage1Layer2JetAlgorithmImpPP::processEvent(), and l1t::Stage1Layer2JetAlgorithmImpSimpleHW::processEvent().

14  {
15 
16  for(std::vector<l1t::Jet>::const_iterator itJet = input->begin();
17  itJet != input->end(); ++itJet){
18  const unsigned newEta = gtEta(itJet->hwEta());
19  uint16_t linPt = (uint16_t)itJet->hwPt();
20  if(linPt > params->jetScale().linScaleMax() ) linPt = params->jetScale().linScaleMax();
21  const uint16_t rankPt = params->jetScale().rank(linPt);
22 
23  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
24 
25  l1t::Jet gtJet(*&ldummy, rankPt, newEta, itJet->hwPhi(), itJet->hwQual());
26  output->push_back(gtJet);
27  }
28  }
const unsigned int gtEta(const unsigned int iEta)
static std::string const input
Definition: EdmProvDump.cc:44
Definition: Jet.h:13
std::string l1t::l1GtBoardTypeEnumToString ( const L1GtBoardType boardType)

Definition at line 144 of file GtDefinitions.cc.

References BoardNull, and query::result.

144  {
145  char const *result= valueToKey(boardType, l1GtBoardTypeStringToEnumMap);
146  if (boardType == l1t::BoardNull) {
147  edm::LogInfo("GtDefinitions")
148  << "\n l1t::BoardNull means no valid board type defined!";
149  }
150  if (!result) {
151  edm::LogInfo("GtDefinitions") << "\n '" << boardType
152  << "' is not a recognized l1t::L1GtBoardType. "
153  << "\n Return l1t::BoardNull, which means no valid board type defined!";
154  return "l1t::BoardNull";
155  }
156  return result;
157 }
tuple result
Definition: query.py:137
l1t::L1GtBoardType l1t::l1GtBoardTypeStringToEnum ( const std::string &  label)

Definition at line 128 of file GtDefinitions.cc.

References BoardNull, BoardNull, and relativeConstraints::value.

128  {
129  l1t::L1GtBoardType value = keyToValue(label.c_str(), l1GtBoardTypeStringToEnumMap);
130  if (value == (l1t::L1GtBoardType) - 1) {
131  edm::LogInfo("GtDefinitions") << "\n '" << label
132  << "' is not a recognized l1t::L1GtBoardType. \n Return l1t::BoardNull.";
133  value = l1t::BoardNull;
134  }
135 
136  if (value == l1t::BoardNull) {
137  edm::LogInfo("GtDefinitions")
138  << "\n l1t::BoardNull means no valid board type defined!";
139  }
140 
141  return value;
142 }
L1GtBoardType
board types in GT
Definition: GtDefinitions.h:28
std::string l1t::l1GtConditionCategoryEnumToString ( const GtConditionCategory &  conditionCategory)

Definition at line 248 of file GtDefinitions.cc.

References CondNull, and query::result.

248  {
249  char const *result = valueToKey(conditionCategory, l1GtConditionCategoryStringToEnumMap);
250  if (conditionCategory == l1t::CondNull)
251  edm::LogInfo("GtDefinitions")
252  << "\n Return l1t::CondNull, which means no valid condition category defined!";
253 
254  if (!result) {
255  result = "l1t::CondNull";
256  edm::LogInfo("GtDefinitions") << "\n '" << conditionCategory
257  << "' is not a recognized l1t::GtConditionCategory. "
258  << "\n Return l1t::CondNull, which means no valid condition category defined!";
259  }
260 
261  return result;
262 }
tuple result
Definition: query.py:137
l1t::GtConditionCategory l1t::l1GtConditionCategoryStringToEnum ( const std::string &  label)

Definition at line 229 of file GtDefinitions.cc.

References CondNull, CondNull, and relativeConstraints::value.

229  {
230  l1t::GtConditionCategory value = keyToValue(label.c_str(), l1GtConditionCategoryStringToEnumMap);
231  // in case of unrecognized l1t::GtConditionCategory, return l1t::CondNull
232  // to be dealt by the corresponding module
233  if (value == (l1t::GtConditionCategory) -1) {
234  edm::LogInfo("GtDefinitions") << "\n '" << label
235  << "' is not a recognized l1t::GtConditionCategory. \n Return l1t::CondNull.";
236 
237  value = l1t::CondNull;
238  }
239 
240  if (value == l1t::CondNull) {
241  edm::LogInfo("GtDefinitions")
242  << "\n l1t::CondNull means no valid condition category defined!";
243  }
244 
245  return value;
246 }
GtConditionCategory
condition categories
std::string l1t::l1GtConditionTypeEnumToString ( const GtConditionType &  conditionType)

Definition at line 215 of file GtDefinitions.cc.

References query::result, and TypeNull.

215  {
216  const char *result = valueToKey(conditionType, l1GtConditionTypeStringToEnumMap);
217  if (conditionType == l1t::TypeNull)
218  edm::LogInfo("GtDefinitions")
219  << "\n Return l1t::TypeNull, which means no valid condition type defined!";
220  if (!result) {
221  result = "l1t::TypeNull";
222  edm::LogInfo("GtDefinitions") << "\n '" << conditionType
223  << "' is not a recognized l1t::GtConditionType. "
224  << "\n Return l1t::TypeNull, which means no valid condition type defined!";
225  }
226  return result;
227 }
tuple result
Definition: query.py:137
l1t::GtConditionType l1t::l1GtConditionTypeStringToEnum ( const std::string &  label)

Definition at line 195 of file GtDefinitions.cc.

References TypeNull, TypeNull, and relativeConstraints::value.

195  {
196  l1t::GtConditionType value = keyToValue(label.c_str(), l1GtConditionTypeStringToEnumMap);
197 
198  // in case of unrecognized l1t::GtConditionType, return l1t::TypeNull
199  // to be dealt by the corresponding module
200  if (value == (l1t::GtConditionType) -1) {
201  edm::LogInfo("GtDefinitions") << "\n '" << label
202  << "' is not a recognized l1t::GtConditionType. \n Return l1t::TypeNull.";
203 
204  value = l1t::TypeNull;
205  }
206 
207  if (value == l1t::TypeNull) {
208  edm::LogInfo("GtDefinitions")
209  << "\n l1t::TypeNull means no valid condition type defined!";
210  }
211 
212  return value;
213 }
GtConditionType
Definition: GtDefinitions.h:99
std::string l1t::l1GtPsbQuadEnumToString ( const L1GtPsbQuad psbQuad)

Definition at line 180 of file GtDefinitions.cc.

References PsbQuadNull, and query::result.

180  {
181  char const*result = valueToKey(psbQuad, l1GtPsbQuadStringToEnumMap);
182  if (psbQuad == l1t::PsbQuadNull)
183  edm::LogInfo("GtDefinitions") << "\n l1t::PsbQuadNull means no valid PSB quadruplet defined!";
184  if (!result) {
185  result = "l1t::PsbQuadNull";
186  edm::LogInfo("GtDefinitions") << "\n '" << psbQuad
187  << "' is not a recognized l1t::L1GtPsbQuad. "
188  << "\n Return l1t::PsbQuadNull, which means no valid PSB quadruplet defined!";
189  }
190 
191  return result;
192 }
tuple result
Definition: query.py:137
l1t::L1GtPsbQuad l1t::l1GtPsbQuadStringToEnum ( const std::string &  label)

Definition at line 162 of file GtDefinitions.cc.

References PsbQuadNull, PsbQuadNull, and relativeConstraints::value.

162  {
163  l1t::L1GtPsbQuad value = keyToValue(label.c_str(), l1GtPsbQuadStringToEnumMap);
164  // in case of unrecognized l1t::L1GtPsbQuad, return l1t::PsbQuadNull
165  // to be dealt by the corresponding module
166  if (value == -1) {
167  edm::LogInfo("GtDefinitions") << "\n '" << label
168  << "' is not a recognized l1t::L1GtPsbQuad. \n Return l1t::PsbQuadNull.";
169  value = l1t::PsbQuadNull;
170  }
171 
172  if (value == l1t::PsbQuadNull) {
173  edm::LogInfo("GtDefinitions")
174  << "\n l1t::PsbQuadNull means no valid PSB quadruplet defined!";
175  }
176 
177  return value;
178 }
L1GtPsbQuad
quadruples sent to GT via PSB
Definition: GtDefinitions.h:47
void l1t::passThroughJets ( const std::vector< l1t::CaloRegion > *  regions,
std::vector< l1t::Jet > *  uncalibjets 
)

Definition at line 30 of file JetFinderMethods.cc.

References reco::btau::jetEta, and reco::btau::jetPhi.

32  {
33  for(std::vector<CaloRegion>::const_iterator region = regions->begin(); region != regions->end(); region++) {
34  int jetQual = 0;
35  if( region->hwEta() < 4 || region->hwEta() > 17)
36  jetQual = 2;
37  int jetET = region->hwPt();
38  int jetEta = region->hwEta();
39  int jetPhi = region->hwPhi();
40 
41  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0,0,0,0);
42  l1t::Jet theJet(*&jetLorentz, jetET, jetEta, jetPhi, jetQual);
43  uncalibjets->push_back(theJet);
44  }
45  }
Definition: Jet.h:13
void l1t::RegionCorrection ( const std::vector< l1t::CaloRegion > &  regions,
std::vector< l1t::CaloRegion > *  subRegions,
std::vector< double >  regionPUSparams,
std::string  regionPUSType 
)

------— New region correction (PUsub, no response correction at the moment) --------—

Definition at line 79 of file PUSubtractionMethods.cc.

References HICaloRingSubtraction(), and max().

Referenced by l1t::Stage1Layer2EGammaAlgorithmImpPP::processEvent(), l1t::Stage1Layer2EtSumAlgorithmImpPP::processEvent(), l1t::Stage1Layer2TauAlgorithmImpPP::processEvent(), and l1t::Stage1Layer2JetAlgorithmImpPP::processEvent().

83 {
84 
85 
86  if(regionPUSType == "None") {
87  for(std::vector<CaloRegion>::const_iterator notCorrectedRegion = regions.begin();
88  notCorrectedRegion != regions.end(); notCorrectedRegion++){
89  CaloRegion newSubRegion= *notCorrectedRegion;
90  subRegions->push_back(newSubRegion);
91  }
92  }
93 
94  if (regionPUSType == "HICaloRingSub") {
95  HICaloRingSubtraction(regions, subRegions);
96  }
97 
98  if (regionPUSType == "PUM0") {
99  int puMult = 0;
100 
101  // ------------ This calulates PUM0 ------------------
102  for(std::vector<CaloRegion>::const_iterator notCorrectedRegion = regions.begin();
103  notCorrectedRegion != regions.end(); notCorrectedRegion++){
104  int regionET = notCorrectedRegion->hwPt();
105  // cout << "regionET: " << regionET <<endl;
106  if (regionET > 0) {puMult++;}
107  }
108  int pumbin = (int) puMult/22;
109  if(pumbin == 18) pumbin = 17; // if puMult = 396 exactly there is an overflow
110 
111  for(std::vector<CaloRegion>::const_iterator notCorrectedRegion = regions.begin();
112  notCorrectedRegion != regions.end(); notCorrectedRegion++){
113 
114  int regionET = notCorrectedRegion->hwPt();
115  int regionEta = notCorrectedRegion->hwEta();
116  int regionPhi = notCorrectedRegion->hwPhi();
117 
118  int puSub = ceil(regionPUSParams[18*regionEta+pumbin]*2);
119  // The values in regionSubtraction are MULTIPLIED by
120  // RegionLSB=.5 (physicalRegionEt), so to get back unmultiplied
121  // regionSubtraction we want to multiply the number by 2
122  // (aka divide by LSB).
123 
124  int regionEtCorr = std::max(0, regionET - puSub);
125 
126  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > lorentz(0,0,0,0);
127  CaloRegion newSubRegion(*&lorentz, 0, 0, regionEtCorr, regionEta, regionPhi, notCorrectedRegion->hwQual(), notCorrectedRegion->hwEtEm(), notCorrectedRegion->hwEtHad());
128  subRegions->push_back(newSubRegion);
129  }
130  }
131 
132 }
void HICaloRingSubtraction(const std::vector< l1t::CaloRegion > &regions, std::vector< l1t::CaloRegion > *subRegions)
------------— For heavy ion ----------------------------------—
const T & max(const T &a, const T &b)
void l1t::simpleHWSubtraction ( const std::vector< l1t::CaloRegion > &  regions,
std::vector< l1t::CaloRegion > *  subRegions 
)

Definition at line 54 of file PUSubtractionMethods.cc.

Referenced by l1t::Stage1Layer2JetAlgorithmImpSimpleHW::processEvent().

56  {
57  for(std::vector<CaloRegion>::const_iterator region = regions.begin();
58  region != regions.end(); region++){
59  int subEta = region->hwEta();
60  int subPhi = region->hwPhi();
61  int subPt = region->hwPt();
62 
63  //std::cout << "pre sub: " << subPt;
64  if(subPt != (2<<10)-1)
65  subPt = subPt - (10+subEta); // arbitrary value chosen in meeting
66  if(subPt < 0)
67  subPt = 0;
68  //std::cout << " post sub: " << subPt << std::endl;
69  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
70 
71  CaloRegion newSubRegion(*&ldummy, 0, 0, subPt, subEta, subPhi, region->hwQual(), region->hwEtEm(), region->hwEtHad());
72  subRegions->push_back(newSubRegion);
73  }
74  }
void l1t::slidingWindowJetFinder ( const int  jetSeedThreshold,
const std::vector< l1t::CaloRegion > *  regions,
std::vector< l1t::Jet > *  uncalibjets 
)

Definition at line 47 of file JetFinderMethods.cc.

References gather_cfg::cout, deltaGctPhi(), reco::btau::jetEta, and reco::btau::jetPhi.

Referenced by l1t::Stage1Layer2JetAlgorithmImpHI::processEvent(), l1t::Stage1Layer2JetAlgorithmImpPP::processEvent(), and l1t::Stage1Layer2JetAlgorithmImpSimpleHW::processEvent().

50  {
51  // std::cout << "Jet Seed: " << jetSeedThreshold << std::endl;
52  for(std::vector<CaloRegion>::const_iterator region = regions->begin(); region != regions->end(); region++) {
53  int regionET = region->hwPt(); //regionPhysicalEt(*region);
54  if (regionET <= jetSeedThreshold) continue;
55  int neighborN_et = 0;
56  int neighborS_et = 0;
57  int neighborE_et = 0;
58  int neighborW_et = 0;
59  int neighborNE_et = 0;
60  int neighborSW_et = 0;
61  int neighborNW_et = 0;
62  int neighborSE_et = 0;
63  unsigned int nNeighbors = 0;
64  for(std::vector<CaloRegion>::const_iterator neighbor = regions->begin(); neighbor != regions->end(); neighbor++) {
65  int neighborET = neighbor->hwPt(); //regionPhysicalEt(*neighbor);
66  if(deltaGctPhi(*region, *neighbor) == 1 &&
67  (region->hwEta() ) == neighbor->hwEta()) {
68  neighborN_et = neighborET;
69  nNeighbors++;
70  continue;
71  }
72  else if(deltaGctPhi(*region, *neighbor) == -1 &&
73  (region->hwEta() ) == neighbor->hwEta()) {
74  neighborS_et = neighborET;
75  nNeighbors++;
76  continue;
77  }
78  else if(deltaGctPhi(*region, *neighbor) == 0 &&
79  (region->hwEta() + 1) == neighbor->hwEta()) {
80  neighborE_et = neighborET;
81  nNeighbors++;
82  continue;
83  }
84  else if(deltaGctPhi(*region, *neighbor) == 0 &&
85  (region->hwEta() - 1) == neighbor->hwEta()) {
86  neighborW_et = neighborET;
87  nNeighbors++;
88  continue;
89  }
90  else if(deltaGctPhi(*region, *neighbor) == 1 &&
91  (region->hwEta() + 1) == neighbor->hwEta()) {
92  neighborNE_et = neighborET;
93  nNeighbors++;
94  continue;
95  }
96  else if(deltaGctPhi(*region, *neighbor) == -1 &&
97  (region->hwEta() - 1) == neighbor->hwEta()) {
98  neighborSW_et = neighborET;
99  nNeighbors++;
100  continue;
101  }
102  else if(deltaGctPhi(*region, *neighbor) == 1 &&
103  (region->hwEta() - 1) == neighbor->hwEta()) {
104  neighborNW_et = neighborET;
105  nNeighbors++;
106  continue;
107  }
108  else if(deltaGctPhi(*region, *neighbor) == -1 &&
109  (region->hwEta() + 1) == neighbor->hwEta()) {
110  neighborSE_et = neighborET;
111  nNeighbors++;
112  continue;
113  }
114  }
115  if(regionET > neighborN_et &&
116  regionET > neighborNW_et &&
117  regionET > neighborW_et &&
118  regionET > neighborSW_et &&
119  regionET >= neighborNE_et &&
120  regionET >= neighborE_et &&
121  regionET >= neighborSE_et &&
122  regionET >= neighborS_et) {
123  unsigned int jetET = regionET +
124  neighborN_et + neighborS_et + neighborE_et + neighborW_et +
125  neighborNE_et + neighborSW_et + neighborSE_et + neighborNW_et;
126 
127  int jetPhi = region->hwPhi();
128  int jetEta = region->hwEta();
129 
130  bool neighborCheck = (nNeighbors == 8);
131  // On the eta edge we only expect 5 neighbors
132  if (!neighborCheck && (jetEta == 0 || jetEta == 21) && nNeighbors == 5)
133  neighborCheck = true;
134 
135  if (!neighborCheck) {
136  std::cout << "phi: " << jetPhi << " eta: " << jetEta << " n: " << nNeighbors << std::endl;
137  assert(false);
138  }
139 
140  //first iteration, eta cut defines forward
141  //const bool forward = (jetEta <= 4 || jetEta >= 17);
142  const bool forward = (jetEta < 4 || jetEta > 17);
143  int jetQual = 0;
144  if(forward)
145  jetQual |= 0x2;
146 
147  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0,0,0,0);
148  l1t::Jet theJet(*&jetLorentz, jetET, jetEta, jetPhi, jetQual);
149  //l1t::Jet theJet(0, jetET, jetEta, jetPhi);
150 
151  uncalibjets->push_back(theJet);
152  }
153  }
154  }
Definition: Jet.h:13
int deltaGctPhi(const CaloRegion &region, const CaloRegion &neighbor)
tuple cout
Definition: gather_cfg.py:121
void l1t::SortJets ( std::vector< l1t::Jet > *  input,
std::vector< l1t::Jet > *  output 
)

Definition at line 191 of file HardwareSortingMethods.cc.

References fw_to_gt_phi_map, gt_to_fw_phi_map, i, j, presort(), sort_by_row_in_groups(), and super_sort_matrix_rows().

Referenced by l1t::Stage1Layer2JetAlgorithmImpSimpleHW::processEvent().

192  {
193  const int CENTRAL_ETA_SLICES = 14;
194  const int N_PHI_GROUPS = 5;
195  const int N_PRESORTED_ROWS_CENTRAL = CENTRAL_ETA_SLICES*N_PHI_GROUPS;
196  const int PRESORT_DEPTH = 4;
197  const int N_KEEP_CENTRAL = 4;
198  const int N_ETA_GROUP_SIZE_CENTRAL = 4;
199  const int N_ETA_GROUPS_CENTRAL = 4;
200 
201  const int HFM_ETA_SLICES = 4;
202  const int HFP_ETA_SLICES = 4;
203  const int N_PRESORTED_ROWS_HFM = HFM_ETA_SLICES*N_PHI_GROUPS;
204  const int N_PRESORTED_ROWS_HFP = HFP_ETA_SLICES*N_PHI_GROUPS;
205  const int N_KEEP_FORWARD = 4;
206 
207  const int cen_nrows = 18;
208  const int cen_ncols = 14;
209  const int hfm_nrows = 18, hfp_nrows = 18;
210  const int hfm_ncols = 4, hfp_ncols = 4;
211 
212  std::vector<std::vector<l1t::Jet> > cen_input_energy (cen_nrows, std::vector<l1t::Jet>(cen_ncols));
213  std::vector<std::vector<l1t::Jet> > hfm_input_energy (hfm_nrows, std::vector<l1t::Jet>(hfm_ncols));
214  std::vector<std::vector<l1t::Jet> > hfp_input_energy (hfp_nrows, std::vector<l1t::Jet>(hfp_ncols));
215 
216  for (std::vector<l1t::Jet>::const_iterator injet = input->begin();
217  injet != input->end(); ++injet){
218  if(injet->hwEta() >= 4 && injet->hwEta() <= 17 )
219  {
220  unsigned int myrow = gt_to_fw_phi_map[injet->hwPhi()];
221  unsigned int mycol = injet->hwEta()-4; //hardcoding is bad
222  cen_input_energy[myrow][mycol] = *injet;
223  }
224  else if(injet->hwEta() < 4)
225  {
226  unsigned int myrow = gt_to_fw_phi_map[injet->hwPhi()];
227  unsigned int mycol = injet->hwEta(); //hardcoding is bad
228  hfm_input_energy[myrow][mycol] = *injet;
229  }
230  else if(injet->hwEta() > 17)
231  {
232  unsigned int myrow = gt_to_fw_phi_map[injet->hwPhi()];
233  unsigned int mycol = injet->hwEta()-18; //hardcoding is bad
234  hfp_input_energy[myrow][mycol] = *injet;
235  }
236  else
237  edm::LogError("HardwareJetSort") << "Region out of bounds: " << injet->hwEta();
238  }
239 
240  for(int i = 0; i < cen_nrows; ++i)
241  for(int j = 0; j < cen_ncols; ++j)
242  {
243  if(cen_input_energy[i][j].hwPt() == 0)
244  {
245  cen_input_energy[i][j].setHwPhi(fw_to_gt_phi_map[i]);
246  cen_input_energy[i][j].setHwEta(4+j);
247  }
248  }
249 
250  for(int i = 0; i < hfm_nrows; ++i)
251  for(int j = 0; j < hfm_ncols; ++j)
252  {
253  if(hfm_input_energy[i][j].hwPt() == 0)
254  {
255  hfm_input_energy[i][j].setHwPhi(fw_to_gt_phi_map[i]);
256  hfm_input_energy[i][j].setHwEta(j);
257  hfm_input_energy[i][j].setHwQual(2);
258  }
259  }
260 
261  for(int i = 0; i < hfp_nrows; ++i)
262  for(int j = 0; j < hfp_ncols; ++j)
263  {
264  if(hfp_input_energy[i][j].hwPt() == 0)
265  {
266  hfp_input_energy[i][j].setHwPhi(fw_to_gt_phi_map[i]);
267  hfp_input_energy[i][j].setHwEta(j+18);
268  hfp_input_energy[i][j].setHwQual(2);
269  }
270  }
271 
272  //Each CLK is one clock
273 
274  //CLK 1
275  std::vector<std::vector<l1t::Jet> > presorted_energies_matrix_sig = presort(cen_input_energy, N_PRESORTED_ROWS_CENTRAL, PRESORT_DEPTH);
276  std::vector<std::vector<l1t::Jet> > hfm_presorted_energies_matrix_sig = presort(hfm_input_energy, N_PRESORTED_ROWS_HFM, PRESORT_DEPTH);
277  std::vector<std::vector<l1t::Jet> > hfp_presorted_energies_matrix_sig = presort(hfp_input_energy, N_PRESORTED_ROWS_HFP, PRESORT_DEPTH);
278 
279  //CLK 2
280  std::vector<std::vector<l1t::Jet> > row_presorted_energies_matrix_sig = sort_by_row_in_groups(presorted_energies_matrix_sig, N_PHI_GROUPS);
281  std::vector<std::vector<l1t::Jet> > hfm_row_presorted_energies_matrix_sig = sort_by_row_in_groups(hfm_presorted_energies_matrix_sig, N_PHI_GROUPS);
282  std::vector<std::vector<l1t::Jet> > hfp_row_presorted_energies_matrix_sig = sort_by_row_in_groups(hfp_presorted_energies_matrix_sig, N_PHI_GROUPS);
283 
284  //CLK 3
285  std::vector<std::vector<l1t::Jet> > sorted_eta_slices_energies_matrix_sig = super_sort_matrix_rows(row_presorted_energies_matrix_sig, N_PHI_GROUPS, N_KEEP_CENTRAL);
286  std::vector<std::vector<l1t::Jet> > hfm_sorted_eta_slices_energies_matrix_sig = super_sort_matrix_rows(hfm_row_presorted_energies_matrix_sig, N_PHI_GROUPS, N_KEEP_FORWARD);
287  std::vector<std::vector<l1t::Jet> > hfp_sorted_eta_slices_energies_matrix_sig = super_sort_matrix_rows(hfp_row_presorted_energies_matrix_sig, N_PHI_GROUPS, N_KEEP_FORWARD);
288 
289  //CLK 4
290  std::vector<std::vector<l1t::Jet> > row_presorted_eta_slices_energies_matrix_sig = sort_by_row_in_groups(sorted_eta_slices_energies_matrix_sig, N_ETA_GROUP_SIZE_CENTRAL);
291  std::vector<std::vector<l1t::Jet> > hfm_row_presorted_eta_slices_energies_matrix_sig = sort_by_row_in_groups(hfm_sorted_eta_slices_energies_matrix_sig, HFM_ETA_SLICES);
292  std::vector<std::vector<l1t::Jet> > hfp_row_presorted_eta_slices_energies_matrix_sig = sort_by_row_in_groups(hfp_sorted_eta_slices_energies_matrix_sig, HFP_ETA_SLICES);
293 
294  //CLK 5
295  std::vector<std::vector<l1t::Jet> > sorted_eta_groups_energies_matrix_sig = super_sort_matrix_rows(row_presorted_eta_slices_energies_matrix_sig, N_ETA_GROUP_SIZE_CENTRAL, N_KEEP_CENTRAL);
296  std::vector<std::vector<l1t::Jet> > hfm_sorted_final_energies_matrix_sig = super_sort_matrix_rows(hfm_row_presorted_eta_slices_energies_matrix_sig, HFM_ETA_SLICES, N_KEEP_FORWARD);
297  std::vector<std::vector<l1t::Jet> > hfp_sorted_final_energies_matrix_sig = super_sort_matrix_rows(hfp_row_presorted_eta_slices_energies_matrix_sig, HFP_ETA_SLICES, N_KEEP_FORWARD);
298 
299  //CLK 6
300  std::vector<std::vector<l1t::Jet> > row_presorted_eta_groups_energies_matrix_sig = sort_by_row_in_groups(sorted_eta_groups_energies_matrix_sig, N_ETA_GROUPS_CENTRAL);
301  std::vector<std::vector<l1t::Jet> > hf_merged_plus_minus_forward_energies_matrix_sig(2, std::vector<l1t::Jet>(N_KEEP_FORWARD));
302  hf_merged_plus_minus_forward_energies_matrix_sig[0] = hfm_sorted_final_energies_matrix_sig[0];
303  hf_merged_plus_minus_forward_energies_matrix_sig[1] = hfp_sorted_final_energies_matrix_sig[0];
304  std::vector<std::vector<l1t::Jet> > hf_row_presorted_merged_plus_minus_forward_energies_matrix_sig = sort_by_row_in_groups(hf_merged_plus_minus_forward_energies_matrix_sig, 2);
305 
306  //CLK 7
307  std::vector<std::vector<l1t::Jet> > sorted_final_energies_matrix_sig = super_sort_matrix_rows(row_presorted_eta_groups_energies_matrix_sig, N_ETA_GROUPS_CENTRAL, N_KEEP_CENTRAL);
308  std::vector<std::vector<l1t::Jet> > hf_sorted_final_merged_plus_minus_forward_energies_matrix_sig = super_sort_matrix_rows(hf_row_presorted_merged_plus_minus_forward_energies_matrix_sig, 2, N_KEEP_FORWARD);
309 
310  for(unsigned int i = 0; i < 4; ++i)
311  {
312  l1t::Jet intjet = sorted_final_energies_matrix_sig[0][i];
313  output->push_back(intjet);
314  }
315  for(unsigned int i = 0; i < 4; ++i)
316  {
317  l1t::Jet intjet = hf_sorted_final_merged_plus_minus_forward_energies_matrix_sig[0][i];
318  output->push_back(intjet);
319  }
320  }
int i
Definition: DBlmapReader.cc:9
std::vector< std::vector< l1t::Jet > > sort_by_row_in_groups(std::vector< std::vector< l1t::Jet > > input_matrix, int group_size)
static std::string const input
Definition: EdmProvDump.cc:44
Definition: Jet.h:13
std::vector< std::vector< l1t::Jet > > presort(std::vector< std::vector< l1t::Jet > > energies, int rows, int cols)
int fw_to_gt_phi_map[]
int j
Definition: DBlmapReader.cc:9
int gt_to_fw_phi_map[]
std::vector< std::vector< l1t::Jet > > super_sort_matrix_rows(std::vector< std::vector< l1t::Jet > > input_matrix, unsigned int group_size, unsigned int n_keep)
void l1t::TauToGtScales ( CaloParamsStage1 *  params,
const std::vector< l1t::Tau > *  input,
std::vector< l1t::Tau > *  output 
)

Definition at line 47 of file legacyGtHelper.cc.

References gtEta(), l1t::CaloParamsStage1::jetScale(), L1CaloEtScale::linScaleMax(), and L1CaloEtScale::rank().

Referenced by l1t::Stage1Layer2SingleTrackHI::processEvent(), and l1t::Stage1Layer2TauAlgorithmImpPP::processEvent().

49  {
50  for(std::vector<l1t::Tau>::const_iterator itTau = input->begin();
51  itTau != input->end(); ++itTau){
52  const unsigned newEta = gtEta(itTau->hwEta());
53  uint16_t linPt = (uint16_t)itTau->hwPt();
54  if(linPt > params->jetScale().linScaleMax() ) linPt = params->jetScale().linScaleMax();
55  const uint16_t rankPt = params->jetScale().rank(linPt);
56 
57  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
58 
59  l1t::Tau gtTau(*&ldummy, rankPt, newEta, itTau->hwPhi(), itTau->hwQual(), itTau->hwIso());
60  output->push_back(gtTau);
61  }
62  }
Definition: Tau.h:13
const unsigned int gtEta(const unsigned int iEta)
static std::string const input
Definition: EdmProvDump.cc:44
void l1t::TwelveByTwelveFinder ( const int  jetSeedThreshold,
const std::vector< l1t::CaloRegion > *  regions,
std::vector< l1t::Jet > *  uncalibjets 
)

Definition at line 156 of file JetFinderMethods.cc.

References gather_cfg::cout, deltaGctPhi(), reco::btau::jetEta, and reco::btau::jetPhi.

Referenced by l1t::Stage1Layer2EGammaAlgorithmImpPP::processEvent(), and l1t::Stage1Layer2TauAlgorithmImpPP::processEvent().

159  {
160  // std::cout << "Jet Seed: " << jetSeedThreshold << std::endl;
161  for(std::vector<CaloRegion>::const_iterator region = regions->begin(); region != regions->end(); region++) {
162  int regionET = region->hwPt(); //regionPhysicalEt(*region);
163  if (regionET <= jetSeedThreshold) continue;
164  int neighborN_et = 0;
165  int neighborS_et = 0;
166  int neighborE_et = 0;
167  int neighborW_et = 0;
168  int neighborNE_et = 0;
169  int neighborSW_et = 0;
170  int neighborNW_et = 0;
171  int neighborSE_et = 0;
172  unsigned int nNeighbors = 0;
173  for(std::vector<CaloRegion>::const_iterator neighbor = regions->begin(); neighbor != regions->end(); neighbor++) {
174  int neighborET = neighbor->hwPt(); //regionPhysicalEt(*neighbor);
175  if(deltaGctPhi(*region, *neighbor) == 1 &&
176  (region->hwEta() ) == neighbor->hwEta()) {
177  neighborN_et = neighborET;
178  nNeighbors++;
179  continue;
180  }
181  else if(deltaGctPhi(*region, *neighbor) == -1 &&
182  (region->hwEta() ) == neighbor->hwEta()) {
183  neighborS_et = neighborET;
184  nNeighbors++;
185  continue;
186  }
187  else if(deltaGctPhi(*region, *neighbor) == 0 &&
188  (region->hwEta() + 1) == neighbor->hwEta()) {
189  neighborE_et = neighborET;
190  nNeighbors++;
191  continue;
192  }
193  else if(deltaGctPhi(*region, *neighbor) == 0 &&
194  (region->hwEta() - 1) == neighbor->hwEta()) {
195  neighborW_et = neighborET;
196  nNeighbors++;
197  continue;
198  }
199  else if(deltaGctPhi(*region, *neighbor) == 1 &&
200  (region->hwEta() + 1) == neighbor->hwEta()) {
201  neighborNE_et = neighborET;
202  nNeighbors++;
203  continue;
204  }
205  else if(deltaGctPhi(*region, *neighbor) == -1 &&
206  (region->hwEta() - 1) == neighbor->hwEta()) {
207  neighborSW_et = neighborET;
208  nNeighbors++;
209  continue;
210  }
211  else if(deltaGctPhi(*region, *neighbor) == 1 &&
212  (region->hwEta() - 1) == neighbor->hwEta()) {
213  neighborNW_et = neighborET;
214  nNeighbors++;
215  continue;
216  }
217  else if(deltaGctPhi(*region, *neighbor) == -1 &&
218  (region->hwEta() + 1) == neighbor->hwEta()) {
219  neighborSE_et = neighborET;
220  nNeighbors++;
221  continue;
222  }
223  }
224  unsigned int jetET = regionET +
225  neighborN_et + neighborS_et + neighborE_et + neighborW_et +
226  neighborNE_et + neighborSW_et + neighborSE_et + neighborNW_et;
227 
228  int jetPhi = region->hwPhi();
229  int jetEta = region->hwEta();
230 
231  bool neighborCheck = (nNeighbors == 8);
232  // On the eta edge we only expect 5 neighbors
233  if (!neighborCheck && (jetEta == 0 || jetEta == 21) && nNeighbors == 5)
234  neighborCheck = true;
235 
236  if (!neighborCheck) {
237  std::cout << "phi: " << jetPhi << " eta: " << jetEta << " n: " << nNeighbors << std::endl;
238  assert(false);
239  }
240 
241  //first iteration, eta cut defines forward
242  //const bool forward = (jetEta <= 4 || jetEta >= 17);
243  const bool forward = (jetEta < 4 || jetEta > 17);
244  int jetQual = 0;
245  if(forward)
246  jetQual |= 0x2;
247 
248  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0,0,0,0);
249  l1t::Jet theJet(*&jetLorentz, jetET, jetEta, jetPhi, jetQual);
250  //l1t::Jet theJet(0, jetET, jetEta, jetPhi);
251 
252  uncalibjets->push_back(theJet);
253  }
254  }
Definition: Jet.h:13
int deltaGctPhi(const CaloRegion &region, const CaloRegion &neighbor)
tuple cout
Definition: gather_cfg.py:121