CMS 3D CMS Logo

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

map containing the conditions More...

Namespaces

 stage1
 
 stage2
 

Classes

class  AlgorithmEvaluation
 
class  AMC13DumpToRaw
 
class  AMCDumpToRaw
 
class  Block
 
class  BlockHeader
 
class  BXVectorInputProducer
 
class  CaloCluster
 
class  CaloCondition
 
class  CaloConfig
 
class  CaloConfigHelper
 
class  CaloEmCand
 
class  CaloMainProcessor
 
class  CaloParams
 
class  CaloParamsStage1
 
class  CaloRegion
 
class  CaloSpare
 
class  CaloStage1Cluster
 
class  CaloStage1FirmwareFactory
 
class  CaloStage2JetAlgorithm
 
class  CaloStage2Nav
 
class  CaloStage2TowerAlgorithmFirmwareImp1
 
class  CaloTools
 
class  CaloTower
 
class  ConditionEvaluation
 
class  CTP7Payload
 
class  DataAlreadyPresentException
 
class  DataInvalidException
 
class  DataManager
 
class  DataWriter
 
class  Description
 
class  EGamma
 
class  EnergySumCondition
 
class  EtSum
 
class  FakeInputProducer
 
class  GenToInputProducer
 
class  GeometryTranslator
 
class  GMTInputCaloSum
 
class  GMTInternalMuon
 
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  L1TCaloStage1LutWriter
 
class  L1TCaloUpgradeToGCTConverter
 
class  L1TDigiToRaw
 
class  L1TGlobalAnalyzer
 
class  L1TRawToDigi
 
class  L1TStage1Layer2Producer
 
class  L1TStage2CaloAnalyzer
 
class  LUT
 
class  MicroGMTAbsoluteIsolationCheckLUT
 
class  MicroGMTCaloIndexSelectionLUT
 
class  MicroGMTCancelOutUnit
 
class  MicroGMTConfiguration
 
class  MicroGMTExtrapolationLUT
 
class  MicroGMTIsolationUnit
 
class  MicroGMTLUT
 
class  MicroGMTMatchQualLUT
 
class  MicroGMTRankPtQualLUT
 
class  MicroGMTRelativeIsolationCheckLUT
 
class  MP7BufferDumpToRaw
 
class  MP7Payload
 
class  MuCondition
 
class  Muon
 
class  MuonTriggerPrimitive
 
class  OMDSReader
 
class  Packer
 
class  PackerFactory
 
class  PackerTokens
 
class  PackingSetup
 
class  PackingSetupFactory
 
class  Payload
 
class  PhysicsToBitConverter
 
class  rctDataBase
 
class  RegionalMuonCand
 
class  Stage1Layer2CentralityAlgorithm
 
class  Stage1Layer2DiTauAlgorithm
 
class  Stage1Layer2EGammaAlgorithm
 
class  Stage1Layer2EGammaAlgorithmImpHI
 
class  Stage1Layer2EGammaAlgorithmImpHW
 
class  Stage1Layer2EGammaAlgorithmImpPP
 
class  Stage1Layer2EtSumAlgorithm
 
class  Stage1Layer2EtSumAlgorithmImpHW
 
class  Stage1Layer2EtSumAlgorithmImpPP
 
class  Stage1Layer2FirmwareFactory
 
class  Stage1Layer2FlowAlgorithm
 
class  Stage1Layer2HFBitCountAlgorithm
 
class  Stage1Layer2HFMinimumBias
 
class  Stage1Layer2HFRingSumAlgorithm
 
class  Stage1Layer2JetAlgorithm
 
class  Stage1Layer2JetAlgorithmImpHI
 
class  Stage1Layer2JetAlgorithmImpPP
 
class  Stage1Layer2JetAlgorithmImpSimpleHW
 
class  Stage1Layer2MainProcessor
 
class  Stage1Layer2MainProcessorFirmwareImp1
 
class  Stage1Layer2SingleTrackHI
 
class  Stage1Layer2TauAlgorithm
 
class  Stage1Layer2TauAlgorithmImpHW
 
class  Stage1Layer2TauAlgorithmImpPP
 
class  Stage1TauIsolationLUT
 
class  Stage2Layer1FirmwareFactory
 
class  Stage2Layer2ClusterAlgorithm
 
class  Stage2Layer2ClusterAlgorithmFirmwareImp1
 
class  Stage2Layer2DemuxEGAlgo
 
class  Stage2Layer2DemuxEGAlgoFirmwareImp1
 
class  Stage2Layer2DemuxJetAlgo
 
class  Stage2Layer2DemuxJetAlgoFirmwareImp1
 
class  Stage2Layer2DemuxSumsAlgo
 
class  Stage2Layer2DemuxSumsAlgoFirmwareImp1
 
class  Stage2Layer2DemuxTauAlgo
 
class  Stage2Layer2DemuxTauAlgoFirmwareImp1
 
class  Stage2Layer2EGAlgorithmFirmwareImp1
 
class  Stage2Layer2EGammaAlgorithm
 
class  Stage2Layer2EGammaAlgorithmFirmwareImp1
 
class  Stage2Layer2EtSumAlgorithm
 
class  Stage2Layer2EtSumAlgorithmFirmwareImp1
 
class  Stage2Layer2FirmwareFactory
 
class  Stage2Layer2JetAlgorithm
 
class  Stage2Layer2JetAlgorithmFirmwareImp1
 
class  Stage2Layer2JetSumAlgorithm
 
class  Stage2Layer2JetSumAlgorithmFirmwareImp1
 
class  Stage2Layer2MainProcessorFirmwareImp1
 
class  Stage2Layer2SumsAlgorithmFirmwareImp1
 
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  Unpacker
 
class  UnpackerCollections
 
class  UnpackerFactory
 
class  WriterProxy
 
class  WriterProxyT
 

Typedefs

typedef std::map< std::string,
L1GtAlgorithm
AlgorithmMap
 map containing the algorithms More...
 
typedef std::vector< BlockBlocks
 
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 BXVector< GMTInputCaloSumGMTInputCaloSumBxCollection
 
typedef std::vector
< GMTInternalMuon
GMTInternalMuonCollection
 
typedef std::list
< std::shared_ptr
< GMTInternalMuon > > 
GMTInternalMuonList
 
typedef std::map< int,
std::vector< std::shared_ptr
< GMTInternalMuon > > > 
GMTInternalWedges
 
typedef AlgorithmMap::iterator ItAlgo
 
typedef ConditionMap::iterator ItCond
 
typedef BXVector< JetJetBxCollection
 
typedef BXVector< L1CandidateL1CandidateBxCollection
 
typedef BXVector< MuonMuonBxCollection
 
typedef std::vector
< MuonTriggerPrimitive
MuonTriggerPrimitiveCollection
 
typedef std::vector
< MuonTriggerPrimitiveRef
MuonTriggerPrimitiveList
 
typedef edm::Ptr
< MuonTriggerPrimitive
MuonTriggerPrimitivePtr
 
typedef edm::Ref
< MuonTriggerPrimitiveCollection
MuonTriggerPrimitiveRef
 
typedef std::map< unsigned,
MuonTriggerPrimitiveList
MuonTriggerPrimitiveStationMap
 
typedef Packer *( pack_fct )()
 
typedef
edmplugin::PluginFactory
< pack_fct
PackerFactoryT
 
typedef std::map< std::pair
< int, int >, Packers
PackerMap
 
typedef std::vector
< std::shared_ptr< Packer > > 
Packers
 
typedef
edmplugin::PluginFactory
< prov_fct
PackingSetupFactoryT
 
typedef PackingSetup *( prov_fct )()
 
typedef BXVector
< RegionalMuonCand
RegionalMuonCandBxCollection
 
typedef BXVector< TauTauBxCollection
 
typedef Unpacker *( unpack_fct )()
 
typedef
edmplugin::PluginFactory
< unpack_fct
UnpackerFactoryT
 
typedef std::map< int,
std::shared_ptr< Unpacker > > 
UnpackerMap
 
typedef
edmplugin::PluginFactory
< l1t::WriterProxy *()> 
WriterFactory
 

Enumerations

enum  block_t { MP7 = 0, CTP7 }
 
enum  cancel_t {
  bmtf_bmtf, omtf_bmtf_pos, omtf_emtf_pos, omtf_omtf_pos,
  emtf_emtf_pos, omtf_bmtf_neg, omtf_emtf_neg, omtf_omtf_neg,
  emtf_emtf_neg
}
 
enum  cancelmode { tracks, coordinate }
 
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...
 
enum  tftype {
  bmtf, omtf_neg, omtf_pos, emtf_neg,
  emtf_pos
}
 

Functions

void calibrateAndRankJets (CaloParamsStage1 *params, const std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
 
void calibrateAndRankTaus (CaloParamsStage1 *params, const std::vector< l1t::Tau > *input, std::vector< l1t::Tau > *output)
 
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)
 
void getBXRange (int nbx, int &first, int &last)
 
const unsigned int gtEta (const unsigned int iEta)
 
void HICaloRingSubtraction (const std::vector< l1t::CaloRegion > &regions, std::vector< l1t::CaloRegion > *subRegions, std::vector< double > regionPUSParams, std::string regionPUSType)
 ------------— 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 JetToGtEtaScales (CaloParamsStage1 *params, const std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
 
void JetToGtPtScales (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 &)
 
bool operator> (l1t::Jet &a, l1t::Jet &b)
 
unsigned int pack15bits (int pt, int eta, int phi)
 
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 SortEGammas (std::vector< l1t::EGamma > *input, std::vector< l1t::EGamma > *output)
 
void SortJets (std::vector< l1t::Jet > *input, std::vector< l1t::Jet > *output)
 
void SortTaus (std::vector< l1t::Tau > *input, std::vector< l1t::Tau > *output)
 
void TauToGtEtaScales (CaloParamsStage1 *params, const std::vector< l1t::Tau > *input, std::vector< l1t::Tau > *output)
 
void TauToGtPtScales (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)
 
void TwoByTwoFinder (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.

typedef std::vector<Block> l1t::Blocks

Definition at line 68 of file Block.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.

Definition at line 7 of file GMTInputCaloSum.h.

Definition at line 11 of file GMTInternalMuon.h.

Definition at line 14 of file GMTInternalMuon.h.

typedef std::map<int, std::vector<std::shared_ptr<GMTInternalMuon> > > l1t::GMTInternalWedges

Definition at line 13 of file GMTInternalMuon.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 47 of file MuonTriggerPrimitive.h.

Definition at line 51 of file MuonTriggerPrimitive.h.

Definition at line 52 of file MuonTriggerPrimitive.h.

Definition at line 50 of file MuonTriggerPrimitive.h.

Definition at line 53 of file MuonTriggerPrimitive.h.

typedef Packer*( l1t::pack_fct)()

Definition at line 23 of file Packer.h.

Definition at line 24 of file Packer.h.

typedef std::map<std::pair<int, int>, Packers> l1t::PackerMap

Definition at line 25 of file PackingSetup.h.

typedef std::vector<std::shared_ptr<Packer> > l1t::Packers

Definition at line 21 of file Packer.h.

Definition at line 48 of file PackingSetup.h.

typedef PackingSetup*( l1t::prov_fct)()

Definition at line 47 of file PackingSetup.h.

Definition at line 12 of file RegionalMuonCand.h.

Definition at line 10 of file Tau.h.

typedef Unpacker*( l1t::unpack_fct)()

Definition at line 18 of file Unpacker.h.

Definition at line 19 of file Unpacker.h.

typedef std::map<int, std::shared_ptr<Unpacker> > l1t::UnpackerMap

Definition at line 27 of file PackingSetup.h.

Definition at line 88 of file WriterProxy.h.

Enumeration Type Documentation

Enumerator
MP7 
CTP7 

Definition at line 10 of file Block.h.

10 { MP7 = 0, CTP7 };
Definition: Block.h:10
Enumerator
tracks 
coordinate 

Definition at line 8 of file MicroGMTCancelOutUnit.h.

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.

Enumerator
bmtf 
omtf_neg 
omtf_pos 
emtf_neg 
emtf_pos 

Definition at line 9 of file RegionalMuonCand.h.

Function Documentation

void l1t::calibrateAndRankJets ( CaloParamsStage1 *  params,
const std::vector< l1t::Jet > *  input,
std::vector< l1t::Jet > *  output 
)

Definition at line 12 of file legacyGtHelper.cc.

References l1t::LUT::data(), eta, l1t::CaloParams::jetCalibrationLUT(), hltrates_dqm_sourceclient-live_cfg::offset, and EnergyCorrector::pt.

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

14  {
15 
16  for(std::vector<l1t::Jet>::const_iterator itJet = input->begin();
17  itJet != input->end(); ++itJet){
18  unsigned int pt = itJet->hwPt();
19  if(pt > ((1<<10) -1) )
20  pt = ((1<<10) -1);
21  unsigned int eta = itJet->hwEta();
22  if (eta>10){ // LUT is symmetric in eta. For eta>10 map to corresponding eta<10 bin
23  int offset=2*(eta-10)-1;
24  eta=eta-offset;
25  }
26  unsigned int lutAddress = (eta<<10)+pt;
27 
28  unsigned int rank = params->jetCalibrationLUT()->data(lutAddress);
29 
30  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
31  l1t::Jet outJet(*&ldummy, rank, itJet->hwEta(), itJet->hwPhi(), itJet->hwQual());
32  output->push_back(outJet);
33  }
34  }
static std::string const input
Definition: EdmProvDump.cc:43
Definition: Jet.h:13
void l1t::calibrateAndRankTaus ( CaloParamsStage1 *  params,
const std::vector< l1t::Tau > *  input,
std::vector< l1t::Tau > *  output 
)

Definition at line 36 of file legacyGtHelper.cc.

References l1t::LUT::data(), eta, EnergyCorrector::pt, and l1t::CaloParams::tauCalibrationLUT().

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

38  {
39 
40  for(std::vector<l1t::Tau>::const_iterator itTau = input->begin();
41  itTau != input->end(); ++itTau){
42  unsigned int pt = itTau->hwPt();
43  if(pt > ((1<<10) -1) )
44  pt = ((1<<10) -1);
45  unsigned int eta = itTau->hwEta();
46  unsigned int lutAddress = (eta<<10)+pt;
47 
48  unsigned int rank = params->tauCalibrationLUT()->data(lutAddress);
49 
50  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
51  l1t::Tau outTau(*&ldummy, rank, itTau->hwEta(), itTau->hwPhi(), itTau->hwQual());
52  output->push_back(outTau);
53  }
54  }
Definition: Tau.h:13
static std::string const input
Definition: EdmProvDump.cc:43
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(), TwelveByTwelveFinder(), and TwoByTwoFinder().

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 99 of file legacyGtHelper.cc.

References gtEta().

Referenced by l1t::Stage1Layer2EGammaAlgorithmImpPP::processEvent(), l1t::Stage1Layer2EGammaAlgorithmImpHI::processEvent(), and l1t::Stage1Layer2EGammaAlgorithmImpHW::processEvent().

101  {
102 
103  for(std::vector<l1t::EGamma>::const_iterator itEGamma = input->begin();
104  itEGamma != input->end(); ++itEGamma){
105  unsigned newEta = gtEta(itEGamma->hwEta());
106  unsigned newPhi = itEGamma->hwPhi();
107  const uint16_t rankPt = (uint16_t)itEGamma->hwPt(); //max value?
108 
109  //hwQual &10 == 10 means that the object came from a sort and is padding
110  if((itEGamma->hwQual() & 0x10) == 0x10)
111  {
112  newEta = 0x0;
113  newPhi = 0x0;
114  }
115 
116  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
117 
118  l1t::EGamma gtEGamma(*&ldummy, rankPt, newEta, newPhi,
119  itEGamma->hwQual(), itEGamma->hwIso());
120  output->push_back(gtEGamma);
121  }
122  }
const unsigned int gtEta(const unsigned int iEta)
static std::string const input
Definition: EdmProvDump.cc:43
void l1t::EtSumToGtScales ( CaloParamsStage1 *  params,
const std::vector< l1t::EtSum > *  input,
std::vector< l1t::EtSum > *  output 
)

Definition at line 165 of file legacyGtHelper.cc.

Referenced by l1t::Stage1Layer2EtSumAlgorithmImpPP::processEvent(), and l1t::Stage1Layer2EtSumAlgorithmImpHW::processEvent().

167  {
168  for(std::vector<l1t::EtSum>::const_iterator itEtSum = input->begin();
169  itEtSum != input->end(); ++itEtSum){
170 
171  uint16_t rankPt;
172  // Hack for now to make sure they come out with the right scale
173  //rankPt = params->jetScale().rank((uint16_t)itEtSum->hwPt());
174  rankPt = (uint16_t)itEtSum->hwPt();
175  if (EtSum::EtSumType::kMissingHt == itEtSum->getType())
176  {
177  // if(rankPt > params->HtMissScale().linScaleMax()) rankPt = params->HtMissScale().linScaleMax();
178  // params->HtMissScale().linScaleMax() always returns zero. Hardcode 512 for now
179 
180  // comment out for mht/ht (already in GT scale)
181  //if(rankPt > 512) rankPt = 512;
182  //rankPt = params->HtMissScale().rank(rankPt*params->emScale().linearLsb());
183  }
184 
185  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
186 
187  l1t::EtSum gtEtSum(*&ldummy, itEtSum->getType(), rankPt, 0,
188  itEtSum->hwPhi(), itEtSum->hwQual());
189 
190  output->push_back(gtEtSum);
191  }
192  }
static std::string const input
Definition: EdmProvDump.cc:43
void l1t::getBXRange ( int  nbx,
int &  first,
int &  last 
)
const unsigned int l1t::gtEta ( const unsigned int  iEta)

Definition at line 194 of file legacyGtHelper.cc.

Referenced by EGammaToGtScales(), getRegionEta(), JetToGtEtaScales(), and TauToGtEtaScales().

195  {
196  unsigned rctEta = (iEta<11 ? 10-iEta : iEta-11);
197  return (((rctEta % 7) & 0x7) | (iEta<11 ? 0x8 : 0));
198  }
void l1t::HICaloRingSubtraction ( const std::vector< l1t::CaloRegion > &  regions,
std::vector< l1t::CaloRegion > *  subRegions,
std::vector< double >  regionPUSparams,
std::string  regionPUSType 
)

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

Definition at line 19 of file PUSubtractionMethods.cc.

References i, bookConverter::max, L1CaloRegionDetId::N_ETA, L1CaloRegionDetId::N_PHI, and HLT_25ns14e33_v3_cff::region.

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

23  {
24  int puLevelHI[L1CaloRegionDetId::N_ETA];
25 
26  for(unsigned i = 0; i < L1CaloRegionDetId::N_ETA; ++i)
27  {
28  puLevelHI[i] = 0;
29  }
30 
31  for(std::vector<CaloRegion>::const_iterator region = regions.begin();
32  region != regions.end(); region++){
33  puLevelHI[region->hwEta()] += region->hwPt();
34  }
35 
36  for(unsigned i = 0; i < L1CaloRegionDetId::N_ETA; ++i)
37  {
38  puLevelHI[i] = floor(((double)puLevelHI[i] / (double)L1CaloRegionDetId::N_PHI)+0.5);
39  }
40 
41  for(std::vector<CaloRegion>::const_iterator region = regions.begin(); region!= regions.end(); region++){
42  int subPt = std::max(0, region->hwPt() - puLevelHI[region->hwEta()]);
43  int subEta = region->hwEta();
44  int subPhi = region->hwPhi();
45 
46  if((regionPUSType == "zeroWall") && (subEta == 4 || subEta == 17)) {
47  subPt = 0;
48  } else if ((regionPUSType == "zeroWideWall") &&
49  (subEta == 4 || subEta == 17 || subEta == 5 || subEta == 16)) {
50  subPt = 0;
51  }
52 
53  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
54 
55  CaloRegion newSubRegion(*&ldummy, 0, 0, subPt, subEta, subPhi, region->hwQual(), region->hwEtEm(), region->hwEtHad());
56  subRegions->push_back(newSubRegion);
57  }
58  }
int i
Definition: DBlmapReader.cc:9
static const unsigned N_ETA
static const unsigned N_PHI
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::Stage1Layer2EtSumAlgorithmImpPP::processEvent(), and 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::JetToGtEtaScales ( CaloParamsStage1 *  params,
const std::vector< l1t::Jet > *  input,
std::vector< l1t::Jet > *  output 
)

Definition at line 57 of file legacyGtHelper.cc.

References gtEta().

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

59  {
60 
61  for(std::vector<l1t::Jet>::const_iterator itJet = input->begin();
62  itJet != input->end(); ++itJet){
63  unsigned newPhi = itJet->hwPhi();
64  unsigned newEta = gtEta(itJet->hwEta());
65 
66  // jets with hwQual & 10 ==10 are "padding" jets from a sort, set their eta and phi
67  // to the max value
68  if((itJet->hwQual() & 0x10) == 0x10)
69  {
70  newEta = 0x0;
71  newPhi = 0x0;
72  }
73 
74  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
75 
76  l1t::Jet gtJet(*&ldummy, itJet->hwPt(), newEta, newPhi, itJet->hwQual());
77  output->push_back(gtJet);
78  }
79  }
const unsigned int gtEta(const unsigned int iEta)
static std::string const input
Definition: EdmProvDump.cc:43
Definition: Jet.h:13
void l1t::JetToGtPtScales ( CaloParamsStage1 *  params,
const std::vector< l1t::Jet > *  input,
std::vector< l1t::Jet > *  output 
)

Definition at line 81 of file legacyGtHelper.cc.

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

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

83  {
84 
85  for(std::vector<l1t::Jet>::const_iterator itJet = input->begin();
86  itJet != input->end(); ++itJet){
87  uint16_t linPt = (uint16_t)itJet->hwPt();
88  if(linPt > params->jetScale().linScaleMax() ) linPt = params->jetScale().linScaleMax();
89  const uint16_t rankPt = params->jetScale().rank(linPt);
90 
91  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
92 
93  l1t::Jet gtJet(*&ldummy, rankPt, itJet->hwEta(), itJet->hwPhi(), itJet->hwQual());
94  output->push_back(gtJet);
95  }
96  }
static std::string const input
Definition: EdmProvDump.cc:43
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
bool l1t::operator> ( l1t::Jet a,
l1t::Jet b 
)

Definition at line 20 of file Stage2Layer2JetAlgorithmFirmwareImp1.cc.

References l1t::L1Candidate::hwPt().

21  {
22  if ( a.hwPt() > b.hwPt() ) {
23  return true;
24  } else {
25  return false;
26  }
27  }
int hwPt() const
Definition: L1Candidate.cc:69
unsigned int l1t::pack15bits ( int  pt,
int  eta,
int  phi 
)
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, reco::btau::jetPhi, and HLT_25ns14e33_v3_cff::region.

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 85 of file PUSubtractionMethods.cc.

References HICaloRingSubtraction(), and bookConverter::max.

Referenced by l1t::Stage1Layer2EGammaAlgorithmImpPP::processEvent(), l1t::Stage1Layer2EtSumAlgorithmImpPP::processEvent(), l1t::Stage1Layer2TauAlgorithmImpPP::processEvent(), l1t::Stage1Layer2JetAlgorithmImpPP::processEvent(), l1t::Stage1Layer2EtSumAlgorithmImpHW::processEvent(), l1t::Stage1Layer2JetAlgorithmImpSimpleHW::processEvent(), l1t::Stage1Layer2TauAlgorithmImpHW::processEvent(), and l1t::Stage1Layer2EGammaAlgorithmImpHW::processEvent().

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

Definition at line 60 of file PUSubtractionMethods.cc.

References HLT_25ns14e33_v3_cff::region.

62  {
63  for(std::vector<CaloRegion>::const_iterator region = regions.begin();
64  region != regions.end(); region++){
65  int subEta = region->hwEta();
66  int subPhi = region->hwPhi();
67  int subPt = region->hwPt();
68 
69  //std::cout << "pre sub: " << subPt;
70  if(subPt != (2<<10)-1)
71  subPt = subPt - (10+subEta); // arbitrary value chosen in meeting
72  if(subPt < 0)
73  subPt = 0;
74  //std::cout << " post sub: " << subPt << std::endl;
75  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
76 
77  CaloRegion newSubRegion(*&ldummy, 0, 0, subPt, subEta, subPhi, region->hwQual(), region->hwEtEm(), region->hwEtHad());
78  subRegions->push_back(newSubRegion);
79  }
80  }
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 assert(), gather_cfg::cout, deltaGctPhi(), reco::btau::jetEta, reco::btau::jetPhi, and HLT_25ns14e33_v3_cff::region.

Referenced by l1t::Stage1Layer2EtSumAlgorithmImpPP::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  // check for input overflow regions
148  if(forward && regionET == 255) {
149  jetET = 1023; // 10 bit max
150  } else if(!forward && regionET == 1023) {
151  jetET = 1023; // 10 bit max
152  } else if(region->hwEta() == 17) {
153  if(neighborNE_et == 255 || neighborE_et == 255 || neighborSE_et == 255)
154  jetET = 1023; // 10 bit max
155  } else if(region->hwEta() == 4) {
156  if(neighborNW_et == 255 || neighborW_et == 255 || neighborSW_et == 255)
157  jetET = 1023; // 10 bit max
158  }
159 
160  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0,0,0,0);
161  l1t::Jet theJet(*&jetLorentz, jetET, jetEta, jetPhi, jetQual);
162  //l1t::Jet theJet(0, jetET, jetEta, jetPhi);
163 
164  uncalibjets->push_back(theJet);
165  }
166  }
167  }
assert(m_qm.get())
Definition: Jet.h:13
int deltaGctPhi(const CaloRegion &region, const CaloRegion &neighbor)
tuple cout
Definition: gather_cfg.py:121
void l1t::SortEGammas ( std::vector< l1t::EGamma > *  input,
std::vector< l1t::EGamma > *  output 
)

Definition at line 380 of file HardwareSortingMethods.cc.

References gt_to_fw_phi_map, i, cmsHarvester::index, relval_steps::k, reco::HaloData::minus, presort_egamma(), alignCSCRings::r, l1t::L1Candidate::setHwEta(), l1t::L1Candidate::setHwIso(), l1t::L1Candidate::setHwPhi(), l1t::L1Candidate::setHwPt(), l1t::L1Candidate::setHwQual(), sort_by_row_in_groups(), and super_sort_matrix_rows().

Referenced by l1t::Stage1Layer2EGammaAlgorithmImpPP::processEvent(), l1t::Stage1Layer2EGammaAlgorithmImpHI::processEvent(), and l1t::Stage1Layer2EGammaAlgorithmImpHW::processEvent().

382  {
383  //Initialize
384  const int FIBER_PAIRS = 18;
385  const int N_INPUT_EGAMMAS = 4;
386  const int N_PRESORTED_ROWS_EGAMMA = 36;
387  const int PRESORT_DEPTH = 4;
388  const int N_EGAMMA_FIRST_GROUP_SIZE = 6;
389  const int N_EGAMMA_SECOND_GROUP_SIZE = 6;
390  const int N_EGAMMA_FIRST_GROUPS = 6;
391  const int N_KEEP_EGAMMA = 4;
392 
393  //Input
394  //Each egamma: RCT isolation, RCT order, phi index, eta index
395 
396  vector<l1t::L1Candidate> iso_egamma_array_p, iso_egamma_array_m; //reusing objects. should probably rename to something like "object"
397  vector<l1t::L1Candidate> noniso_egamma_array_p, noniso_egamma_array_m;
398 
399  for(int k=0; k<2*N_INPUT_EGAMMAS*FIBER_PAIRS; k++){
400  l1t::L1Candidate dummyJet;
401  dummyJet.setHwPt(0);
402  dummyJet.setHwEta(99);
403  dummyJet.setHwPhi(99);
404  dummyJet.setHwQual(0x10);
405  if(k<N_INPUT_EGAMMAS*FIBER_PAIRS){
406  iso_egamma_array_p.push_back(dummyJet);
407  noniso_egamma_array_p.push_back(dummyJet);
408  }
409  else{
410  iso_egamma_array_m.push_back(dummyJet);
411  noniso_egamma_array_m.push_back(dummyJet);
412  }
413  }
414 
415  for (std::vector<l1t::EGamma>::const_iterator ineg = input->begin();
416  ineg != input->end(); ++ineg){
417  int fiberNum = (int) floor(gt_to_fw_phi_map[ineg->hwPhi()]/2);
418  int index = ineg->hwQual();
419  bool iso = ineg->hwIso();
420  bool minus = (ineg->hwEta() < 11);
421 
422  // while waiting for firmware LUT, set all iso to true
423  //iso = true;
424 
425  if(iso && minus)
426  iso_egamma_array_m[8*fiberNum+index] = *ineg;
427  else if (iso && !minus)
428  iso_egamma_array_p[8*fiberNum+index] = *ineg;
429  else if (!iso && minus)
430  noniso_egamma_array_m[8*fiberNum+index] = *ineg;
431  else if (!iso && !minus)
432  noniso_egamma_array_p[8*fiberNum+index] = *ineg;
433 
434  }
435 
436  // std::cout << "iso_egamma_array_m" << std::endl;
437  // for(int i = 0; i < (int)iso_egamma_array_m.size(); ++i)
438  // {
439  // std::cout << iso_egamma_array_m[i].hwPt() << " "
440  // << iso_egamma_array_m[i].hwEta() << " "
441  // << iso_egamma_array_m[i].hwPhi() << std::endl;
442  // }
443 
444  // std::cout << "iso_egamma_array_p" << std::endl;
445  // for(int i = 0; i < (int)iso_egamma_array_p.size(); ++i)
446  // {
447  // std::cout << iso_egamma_array_p[i].hwPt() << " "
448  // << iso_egamma_array_p[i].hwEta() << " "
449  // << iso_egamma_array_p[i].hwPhi() << std::endl;
450  // }
451 
452  //verbose = true;
453  //1
454  std::vector<std::vector<l1t::L1Candidate> > presorted_iso_matrix_sig_p = presort_egamma(iso_egamma_array_p, N_PRESORTED_ROWS_EGAMMA/2, PRESORT_DEPTH);
455  std::vector<std::vector<l1t::L1Candidate> > presorted_iso_matrix_sig_m = presort_egamma(iso_egamma_array_m, N_PRESORTED_ROWS_EGAMMA/2, PRESORT_DEPTH);
456  std::vector<std::vector<l1t::L1Candidate> > presorted_non_iso_matrix_sig_p = presort_egamma(noniso_egamma_array_p, N_PRESORTED_ROWS_EGAMMA/2, PRESORT_DEPTH);
457  std::vector<std::vector<l1t::L1Candidate> > presorted_non_iso_matrix_sig_m = presort_egamma(noniso_egamma_array_m, N_PRESORTED_ROWS_EGAMMA/2, PRESORT_DEPTH);
458 
459  //2
460  std::vector<std::vector<l1t::L1Candidate> > iso_row_presorted_energies_matrix_sig_p = sort_by_row_in_groups(presorted_iso_matrix_sig_p, N_EGAMMA_FIRST_GROUP_SIZE);
461  std::vector<std::vector<l1t::L1Candidate> > iso_row_presorted_energies_matrix_sig_m = sort_by_row_in_groups(presorted_iso_matrix_sig_m, N_EGAMMA_FIRST_GROUP_SIZE);
462  std::vector<std::vector<l1t::L1Candidate> > non_iso_row_presorted_energies_matrix_sig_p = sort_by_row_in_groups(presorted_non_iso_matrix_sig_p, N_EGAMMA_FIRST_GROUP_SIZE);
463  std::vector<std::vector<l1t::L1Candidate> > non_iso_row_presorted_energies_matrix_sig_m = sort_by_row_in_groups(presorted_non_iso_matrix_sig_m, N_EGAMMA_FIRST_GROUP_SIZE);
464 
465  //3
466  std::vector<std::vector<l1t::L1Candidate> > iso_super_sorted_energies_matrix_sig_p = super_sort_matrix_rows(iso_row_presorted_energies_matrix_sig_p, N_EGAMMA_FIRST_GROUP_SIZE, N_KEEP_EGAMMA);
467  std::vector<std::vector<l1t::L1Candidate> > iso_super_sorted_energies_matrix_sig_m = super_sort_matrix_rows(iso_row_presorted_energies_matrix_sig_m, N_EGAMMA_FIRST_GROUP_SIZE, N_KEEP_EGAMMA);
468  std::vector<std::vector<l1t::L1Candidate> > non_iso_super_sorted_energies_matrix_sig_p = super_sort_matrix_rows(non_iso_row_presorted_energies_matrix_sig_p, N_EGAMMA_FIRST_GROUP_SIZE, N_KEEP_EGAMMA);
469  std::vector<std::vector<l1t::L1Candidate> > non_iso_super_sorted_energies_matrix_sig_m = super_sort_matrix_rows(non_iso_row_presorted_energies_matrix_sig_m, N_EGAMMA_FIRST_GROUP_SIZE, N_KEEP_EGAMMA);
470  //combine plus and minus
471  std::vector<std::vector<l1t::L1Candidate> > iso_super_sorted_energies_matrix_sig (N_EGAMMA_FIRST_GROUPS, std::vector<l1t::L1Candidate>(N_KEEP_EGAMMA) );
472  std::vector<std::vector<l1t::L1Candidate> > non_iso_super_sorted_energies_matrix_sig (N_EGAMMA_FIRST_GROUPS, std::vector<l1t::L1Candidate>(N_KEEP_EGAMMA) );
473  for(int r=0; r<N_EGAMMA_FIRST_GROUPS/2; r++){
474  iso_super_sorted_energies_matrix_sig[r] = iso_super_sorted_energies_matrix_sig_m[r];
475  iso_super_sorted_energies_matrix_sig[r+N_EGAMMA_FIRST_GROUPS/2] = iso_super_sorted_energies_matrix_sig_p[r];
476  non_iso_super_sorted_energies_matrix_sig[r] = non_iso_super_sorted_energies_matrix_sig_m[r];
477  non_iso_super_sorted_energies_matrix_sig[r+N_EGAMMA_FIRST_GROUPS/2] = non_iso_super_sorted_energies_matrix_sig_p[r];
478  }
479 
480  //4
481  std::vector<std::vector<l1t::L1Candidate> > iso_stage2_row_sorted_matrix_sig = sort_by_row_in_groups(iso_super_sorted_energies_matrix_sig, N_EGAMMA_SECOND_GROUP_SIZE);
482  std::vector<std::vector<l1t::L1Candidate> > non_iso_stage2_row_sorted_matrix_sig = sort_by_row_in_groups(non_iso_super_sorted_energies_matrix_sig, N_EGAMMA_SECOND_GROUP_SIZE);
483 
484  //5
485  std::vector<std::vector<l1t::L1Candidate> > iso_stage2_super_sorted_matrix_sig = super_sort_matrix_rows(iso_stage2_row_sorted_matrix_sig, N_EGAMMA_SECOND_GROUP_SIZE, N_KEEP_EGAMMA);
486  std::vector<std::vector<l1t::L1Candidate> > non_iso_stage2_super_sorted_matrix_sig = super_sort_matrix_rows(non_iso_stage2_row_sorted_matrix_sig, N_EGAMMA_SECOND_GROUP_SIZE, N_KEEP_EGAMMA);
487 
488  //Prepare output
489  std::vector<l1t::L1Candidate> sorted_iso_egammas = iso_stage2_super_sorted_matrix_sig[0];
490  std::vector<l1t::L1Candidate> sorted_noniso_egammas = non_iso_stage2_super_sorted_matrix_sig[0];
491 
492  //verbose = false;
493 
494  for(unsigned int i = 0; i < 4; ++i)
495  {
496  l1t::EGamma *ineg = static_cast<l1t::EGamma *>( &sorted_iso_egammas[i] );
497  ineg->setHwIso(1);
498  output->push_back(*ineg);
499  }
500  for(unsigned int i = 0; i < 4; ++i)
501  {
502  l1t::EGamma *ineg = static_cast<l1t::EGamma *>( &sorted_noniso_egammas[i] );
503  output->push_back(*ineg);
504  }
505  }
int i
Definition: DBlmapReader.cc:9
void setHwQual(int qual)
Definition: L1Candidate.cc:64
static std::string const input
Definition: EdmProvDump.cc:43
void setHwPhi(int phi)
Definition: L1Candidate.cc:54
void setHwIso(int iso)
Definition: L1Candidate.cc:59
int gt_to_fw_phi_map[]
std::vector< std::vector< l1t::L1Candidate > > presort_egamma(std::vector< l1t::L1Candidate > input_egamma, int rows, int cols)
std::vector< std::vector< l1t::L1Candidate > > super_sort_matrix_rows(std::vector< std::vector< l1t::L1Candidate > > input_matrix, unsigned int group_size, unsigned int n_keep)
void setHwPt(int pt)
Definition: L1Candidate.cc:44
void setHwEta(int eta)
Definition: L1Candidate.cc:49
std::vector< std::vector< l1t::L1Candidate > > sort_by_row_in_groups(std::vector< std::vector< l1t::L1Candidate > > input_matrix, int group_size)
void l1t::SortJets ( std::vector< l1t::Jet > *  input,
std::vector< l1t::Jet > *  output 
)

Definition at line 248 of file HardwareSortingMethods.cc.

References fw_to_gt_phi_map, gt_to_fw_phi_map, l1t::L1Candidate::hwQual(), i, j, presort(), l1t::L1Candidate::setHwQual(), sort_by_row_in_groups(), and super_sort_matrix_rows().

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

249  {
250  const int CENTRAL_ETA_SLICES = 14;
251  const int N_PHI_GROUPS = 5;
252  const int N_PRESORTED_ROWS_CENTRAL = CENTRAL_ETA_SLICES*N_PHI_GROUPS;
253  const int PRESORT_DEPTH = 4;
254  const int N_KEEP_CENTRAL = 4;
255  const int N_ETA_GROUP_SIZE_CENTRAL = 4;
256  const int N_ETA_GROUPS_CENTRAL = 4;
257 
258  const int HFM_ETA_SLICES = 4;
259  const int HFP_ETA_SLICES = 4;
260  const int N_PRESORTED_ROWS_HFM = HFM_ETA_SLICES*N_PHI_GROUPS;
261  const int N_PRESORTED_ROWS_HFP = HFP_ETA_SLICES*N_PHI_GROUPS;
262  const int N_KEEP_FORWARD = 4;
263 
264  const int cen_nrows = 18;
265  const int cen_ncols = 14;
266  const int hfm_nrows = 18, hfp_nrows = 18;
267  const int hfm_ncols = 4, hfp_ncols = 4;
268 
269  std::vector<std::vector<l1t::L1Candidate> > cen_input_energy (cen_nrows, std::vector<l1t::L1Candidate>(cen_ncols));
270  std::vector<std::vector<l1t::L1Candidate> > hfm_input_energy (hfm_nrows, std::vector<l1t::L1Candidate>(hfm_ncols));
271  std::vector<std::vector<l1t::L1Candidate> > hfp_input_energy (hfp_nrows, std::vector<l1t::L1Candidate>(hfp_ncols));
272 
273  for (std::vector<l1t::Jet>::const_iterator injet = input->begin();
274  injet != input->end(); ++injet){
275  if(injet->hwEta() >= 4 && injet->hwEta() <= 17 )
276  {
277  unsigned int myrow = gt_to_fw_phi_map[injet->hwPhi()];
278  unsigned int mycol = injet->hwEta()-4; //hardcoding is bad
279  cen_input_energy[myrow][mycol] = *injet;
280  }
281  else if(injet->hwEta() < 4)
282  {
283  unsigned int myrow = gt_to_fw_phi_map[injet->hwPhi()];
284  unsigned int mycol = injet->hwEta(); //hardcoding is bad
285  hfm_input_energy[myrow][mycol] = *injet;
286  }
287  else if(injet->hwEta() > 17)
288  {
289  unsigned int myrow = gt_to_fw_phi_map[injet->hwPhi()];
290  unsigned int mycol = injet->hwEta()-18; //hardcoding is bad
291  hfp_input_energy[myrow][mycol] = *injet;
292  }
293  else
294  edm::LogError("HardwareJetSort") << "Region out of bounds: " << injet->hwEta();
295  }
296 
297  for(int i = 0; i < cen_nrows; ++i)
298  for(int j = 0; j < cen_ncols; ++j)
299  {
300  if(cen_input_energy[i][j].hwPt() == 0)
301  {
302  cen_input_energy[i][j].setHwPhi(fw_to_gt_phi_map[i]);
303  cen_input_energy[i][j].setHwEta(4+j);
304  }
305  }
306 
307  for(int i = 0; i < hfm_nrows; ++i)
308  for(int j = 0; j < hfm_ncols; ++j)
309  {
310  if(hfm_input_energy[i][j].hwPt() == 0)
311  {
312  hfm_input_energy[i][j].setHwPhi(fw_to_gt_phi_map[i]);
313  hfm_input_energy[i][j].setHwEta(j);
314  hfm_input_energy[i][j].setHwQual(2);
315  }
316  }
317 
318  for(int i = 0; i < hfp_nrows; ++i)
319  for(int j = 0; j < hfp_ncols; ++j)
320  {
321  if(hfp_input_energy[i][j].hwPt() == 0)
322  {
323  hfp_input_energy[i][j].setHwPhi(fw_to_gt_phi_map[i]);
324  hfp_input_energy[i][j].setHwEta(j+18);
325  hfp_input_energy[i][j].setHwQual(2);
326  }
327  }
328 
329  //Each CLK is one clock
330 
331  //CLK 1
332  std::vector<std::vector<l1t::L1Candidate> > presorted_energies_matrix_sig = presort(cen_input_energy, N_PRESORTED_ROWS_CENTRAL, PRESORT_DEPTH);
333  std::vector<std::vector<l1t::L1Candidate> > hfm_presorted_energies_matrix_sig = presort(hfm_input_energy, N_PRESORTED_ROWS_HFM, PRESORT_DEPTH);
334  std::vector<std::vector<l1t::L1Candidate> > hfp_presorted_energies_matrix_sig = presort(hfp_input_energy, N_PRESORTED_ROWS_HFP, PRESORT_DEPTH);
335 
336  //CLK 2
337  std::vector<std::vector<l1t::L1Candidate> > row_presorted_energies_matrix_sig = sort_by_row_in_groups(presorted_energies_matrix_sig, N_PHI_GROUPS);
338  std::vector<std::vector<l1t::L1Candidate> > hfm_row_presorted_energies_matrix_sig = sort_by_row_in_groups(hfm_presorted_energies_matrix_sig, N_PHI_GROUPS);
339  std::vector<std::vector<l1t::L1Candidate> > hfp_row_presorted_energies_matrix_sig = sort_by_row_in_groups(hfp_presorted_energies_matrix_sig, N_PHI_GROUPS);
340 
341  //CLK 3
342  std::vector<std::vector<l1t::L1Candidate> > sorted_eta_slices_energies_matrix_sig = super_sort_matrix_rows(row_presorted_energies_matrix_sig, N_PHI_GROUPS, N_KEEP_CENTRAL);
343  std::vector<std::vector<l1t::L1Candidate> > hfm_sorted_eta_slices_energies_matrix_sig = super_sort_matrix_rows(hfm_row_presorted_energies_matrix_sig, N_PHI_GROUPS, N_KEEP_FORWARD);
344  std::vector<std::vector<l1t::L1Candidate> > hfp_sorted_eta_slices_energies_matrix_sig = super_sort_matrix_rows(hfp_row_presorted_energies_matrix_sig, N_PHI_GROUPS, N_KEEP_FORWARD);
345 
346  //CLK 4
347  std::vector<std::vector<l1t::L1Candidate> > row_presorted_eta_slices_energies_matrix_sig = sort_by_row_in_groups(sorted_eta_slices_energies_matrix_sig, N_ETA_GROUP_SIZE_CENTRAL);
348  std::vector<std::vector<l1t::L1Candidate> > hfm_row_presorted_eta_slices_energies_matrix_sig = sort_by_row_in_groups(hfm_sorted_eta_slices_energies_matrix_sig, HFM_ETA_SLICES);
349  std::vector<std::vector<l1t::L1Candidate> > hfp_row_presorted_eta_slices_energies_matrix_sig = sort_by_row_in_groups(hfp_sorted_eta_slices_energies_matrix_sig, HFP_ETA_SLICES);
350 
351  //CLK 5
352  std::vector<std::vector<l1t::L1Candidate> > 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);
353  std::vector<std::vector<l1t::L1Candidate> > hfm_sorted_final_energies_matrix_sig = super_sort_matrix_rows(hfm_row_presorted_eta_slices_energies_matrix_sig, HFM_ETA_SLICES, N_KEEP_FORWARD);
354  std::vector<std::vector<l1t::L1Candidate> > hfp_sorted_final_energies_matrix_sig = super_sort_matrix_rows(hfp_row_presorted_eta_slices_energies_matrix_sig, HFP_ETA_SLICES, N_KEEP_FORWARD);
355 
356  //CLK 6
357  std::vector<std::vector<l1t::L1Candidate> > row_presorted_eta_groups_energies_matrix_sig = sort_by_row_in_groups(sorted_eta_groups_energies_matrix_sig, N_ETA_GROUPS_CENTRAL);
358  std::vector<std::vector<l1t::L1Candidate> > hf_merged_plus_minus_forward_energies_matrix_sig(2, std::vector<l1t::L1Candidate>(N_KEEP_FORWARD));
359  hf_merged_plus_minus_forward_energies_matrix_sig[0] = hfm_sorted_final_energies_matrix_sig[0];
360  hf_merged_plus_minus_forward_energies_matrix_sig[1] = hfp_sorted_final_energies_matrix_sig[0];
361  std::vector<std::vector<l1t::L1Candidate> > hf_row_presorted_merged_plus_minus_forward_energies_matrix_sig = sort_by_row_in_groups(hf_merged_plus_minus_forward_energies_matrix_sig, 2);
362 
363  //CLK 7
364  std::vector<std::vector<l1t::L1Candidate> > sorted_final_energies_matrix_sig = super_sort_matrix_rows(row_presorted_eta_groups_energies_matrix_sig, N_ETA_GROUPS_CENTRAL, N_KEEP_CENTRAL);
365  std::vector<std::vector<l1t::L1Candidate> > 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);
366 
367  for(unsigned int i = 0; i < 4; ++i)
368  {
369  l1t::Jet *intjet = static_cast<l1t::Jet *>( &sorted_final_energies_matrix_sig[0][i] );
370  output->push_back(*intjet);
371  }
372  for(unsigned int i = 0; i < 4; ++i)
373  {
374  l1t::Jet *intjet = static_cast<l1t::Jet *>( &hf_sorted_final_merged_plus_minus_forward_energies_matrix_sig[0][i] );
375  intjet->setHwQual(intjet->hwQual() | 2);
376  output->push_back(*intjet);
377  }
378  }
int i
Definition: DBlmapReader.cc:9
void setHwQual(int qual)
Definition: L1Candidate.cc:64
static std::string const input
Definition: EdmProvDump.cc:43
Definition: Jet.h:13
int fw_to_gt_phi_map[]
int j
Definition: DBlmapReader.cc:9
int hwQual() const
Definition: L1Candidate.cc:89
int gt_to_fw_phi_map[]
std::vector< std::vector< l1t::L1Candidate > > super_sort_matrix_rows(std::vector< std::vector< l1t::L1Candidate > > input_matrix, unsigned int group_size, unsigned int n_keep)
std::vector< std::vector< l1t::L1Candidate > > presort(std::vector< std::vector< l1t::L1Candidate > > energies, int rows, int cols)
std::vector< std::vector< l1t::L1Candidate > > sort_by_row_in_groups(std::vector< std::vector< l1t::L1Candidate > > input_matrix, int group_size)
void l1t::SortTaus ( std::vector< l1t::Tau > *  input,
std::vector< l1t::Tau > *  output 
)

Definition at line 507 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::Stage1Layer2TauAlgorithmImpPP::processEvent(), and l1t::Stage1Layer2TauAlgorithmImpHW::processEvent().

508  {
509  const int CENTRAL_ETA_SLICES = 14;
510  const int N_PHI_GROUPS = 5;
511  const int N_PRESORTED_ROWS_CENTRAL = CENTRAL_ETA_SLICES*N_PHI_GROUPS;
512  const int PRESORT_DEPTH = 4;
513  const int N_KEEP_CENTRAL = 4;
514  const int N_ETA_GROUP_SIZE_CENTRAL = 4;
515  const int N_ETA_GROUPS_CENTRAL = 4;
516 
517  const int cen_nrows = 18;
518  const int cen_ncols = 14;
519 
520  std::vector<std::vector<l1t::L1Candidate> > cen_input_energy (cen_nrows, std::vector<l1t::L1Candidate>(cen_ncols));
521 
522  for (std::vector<l1t::Tau>::const_iterator injet = input->begin();
523  injet != input->end(); ++injet){
524  if(injet->hwEta() >= 4 && injet->hwEta() <= 17 )
525  {
526  unsigned int myrow = gt_to_fw_phi_map[injet->hwPhi()];
527  unsigned int mycol = injet->hwEta()-4; //hardcoding is bad
528  cen_input_energy[myrow][mycol] = *injet;
529  }
530  else
531  edm::LogError("HardwareTauSort") << "Region out of bounds: " << injet->hwEta();
532  }
533 
534  for(int i = 0; i < cen_nrows; ++i)
535  for(int j = 0; j < cen_ncols; ++j)
536  {
537  if(cen_input_energy[i][j].hwPt() == 0)
538  {
539  cen_input_energy[i][j].setHwPhi(fw_to_gt_phi_map[i]);
540  cen_input_energy[i][j].setHwEta(4+j);
541  }
542  }
543 
544  //Each CLK is one clock
545 
546  //CLK 1
547  std::vector<std::vector<l1t::L1Candidate> > presorted_energies_matrix_sig = presort(cen_input_energy, N_PRESORTED_ROWS_CENTRAL, PRESORT_DEPTH);
548  //CLK 2
549  std::vector<std::vector<l1t::L1Candidate> > row_presorted_energies_matrix_sig = sort_by_row_in_groups(presorted_energies_matrix_sig, N_PHI_GROUPS);
550  //CLK 3
551  std::vector<std::vector<l1t::L1Candidate> > sorted_eta_slices_energies_matrix_sig = super_sort_matrix_rows(row_presorted_energies_matrix_sig, N_PHI_GROUPS, N_KEEP_CENTRAL);
552  //CLK 4
553  std::vector<std::vector<l1t::L1Candidate> > row_presorted_eta_slices_energies_matrix_sig = sort_by_row_in_groups(sorted_eta_slices_energies_matrix_sig, N_ETA_GROUP_SIZE_CENTRAL);
554  //CLK 5
555  std::vector<std::vector<l1t::L1Candidate> > 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);
556  //CLK 6
557  std::vector<std::vector<l1t::L1Candidate> > row_presorted_eta_groups_energies_matrix_sig = sort_by_row_in_groups(sorted_eta_groups_energies_matrix_sig, N_ETA_GROUPS_CENTRAL);
558  //CLK 7
559  std::vector<std::vector<l1t::L1Candidate> > sorted_final_energies_matrix_sig = super_sort_matrix_rows(row_presorted_eta_groups_energies_matrix_sig, N_ETA_GROUPS_CENTRAL, N_KEEP_CENTRAL);
560 
561  for(unsigned int i = 0; i < 4; ++i)
562  {
563  l1t::Tau *intjet = static_cast<l1t::Tau *>( &sorted_final_energies_matrix_sig[0][i] );
564  output->push_back(*intjet);
565  }
566  }
int i
Definition: DBlmapReader.cc:9
Definition: Tau.h:13
static std::string const input
Definition: EdmProvDump.cc:43
int fw_to_gt_phi_map[]
int j
Definition: DBlmapReader.cc:9
int gt_to_fw_phi_map[]
std::vector< std::vector< l1t::L1Candidate > > super_sort_matrix_rows(std::vector< std::vector< l1t::L1Candidate > > input_matrix, unsigned int group_size, unsigned int n_keep)
std::vector< std::vector< l1t::L1Candidate > > presort(std::vector< std::vector< l1t::L1Candidate > > energies, int rows, int cols)
std::vector< std::vector< l1t::L1Candidate > > sort_by_row_in_groups(std::vector< std::vector< l1t::L1Candidate > > input_matrix, int group_size)
void l1t::TauToGtEtaScales ( CaloParamsStage1 *  params,
const std::vector< l1t::Tau > *  input,
std::vector< l1t::Tau > *  output 
)

Definition at line 124 of file legacyGtHelper.cc.

References gtEta().

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

126  {
127  for(std::vector<l1t::Tau>::const_iterator itTau = input->begin();
128  itTau != input->end(); ++itTau){
129  unsigned newPhi = itTau->hwPhi();
130  unsigned newEta = gtEta(itTau->hwEta());
131 
132  // taus with hwQual & 10 ==10 are "padding" jets from a sort, set their eta and phi
133  // to the max value
134  if((itTau->hwQual() & 0x10) == 0x10)
135  {
136  newEta = 0x0;
137  newPhi = 0x0;
138  }
139 
140 
141  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
142 
143  l1t::Tau gtTau(*&ldummy, itTau->hwPt(), newEta, newPhi, itTau->hwQual(), itTau->hwIso());
144  output->push_back(gtTau);
145  }
146  }
Definition: Tau.h:13
const unsigned int gtEta(const unsigned int iEta)
static std::string const input
Definition: EdmProvDump.cc:43
void l1t::TauToGtPtScales ( CaloParamsStage1 *  params,
const std::vector< l1t::Tau > *  input,
std::vector< l1t::Tau > *  output 
)

Definition at line 148 of file legacyGtHelper.cc.

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

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

150  {
151  for(std::vector<l1t::Tau>::const_iterator itTau = input->begin();
152  itTau != input->end(); ++itTau){
153  uint16_t linPt = (uint16_t)itTau->hwPt();
154  if(linPt > params->jetScale().linScaleMax() ) linPt = params->jetScale().linScaleMax();
155  const uint16_t rankPt = params->jetScale().rank(linPt);
156 
157  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > ldummy(0,0,0,0);
158 
159  l1t::Tau gtTau(*&ldummy, rankPt, itTau->hwEta(), itTau->hwPhi(), itTau->hwQual(), itTau->hwIso());
160  output->push_back(gtTau);
161  }
162  }
Definition: Tau.h:13
static std::string const input
Definition: EdmProvDump.cc:43
void l1t::TwelveByTwelveFinder ( const int  jetSeedThreshold,
const std::vector< l1t::CaloRegion > *  regions,
std::vector< l1t::Jet > *  uncalibjets 
)

Definition at line 169 of file JetFinderMethods.cc.

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

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

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

Definition at line 269 of file JetFinderMethods.cc.

References assert(), gather_cfg::cout, deltaGctPhi(), reco::btau::jetEta, reco::btau::jetPhi, bookConverter::max, and HLT_25ns14e33_v3_cff::region.

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

271  {
272  for(std::vector<CaloRegion>::const_iterator region = regions->begin(); region != regions->end(); region++) {
273  int regionET = region->hwPt();
274  int neighborN_et = 0;
275  int neighborS_et = 0;
276  int neighborE_et = 0;
277  int neighborW_et = 0;
278  int neighborNE_et = 0;
279  int neighborSW_et = 0;
280  int neighborNW_et = 0;
281  int neighborSE_et = 0;
282  unsigned int nNeighbors = 0;
283  for(std::vector<CaloRegion>::const_iterator neighbor = regions->begin(); neighbor != regions->end(); neighbor++) {
284  int neighborET = neighbor->hwPt();
285  if(deltaGctPhi(*region, *neighbor) == 1 &&
286  (region->hwEta() ) == neighbor->hwEta()) {
287  neighborN_et = neighborET;
288  nNeighbors++;
289  continue;
290  }
291  else if(deltaGctPhi(*region, *neighbor) == -1 &&
292  (region->hwEta() ) == neighbor->hwEta()) {
293  neighborS_et = neighborET;
294  nNeighbors++;
295  continue;
296  }
297  else if(deltaGctPhi(*region, *neighbor) == 0 &&
298  (region->hwEta() + 1) == neighbor->hwEta()) {
299  neighborE_et = neighborET;
300  nNeighbors++;
301  continue;
302  }
303  else if(deltaGctPhi(*region, *neighbor) == 0 &&
304  (region->hwEta() - 1) == neighbor->hwEta()) {
305  neighborW_et = neighborET;
306  nNeighbors++;
307  continue;
308  }
309  else if(deltaGctPhi(*region, *neighbor) == 1 &&
310  (region->hwEta() + 1) == neighbor->hwEta()) {
311  neighborNE_et = neighborET;
312  nNeighbors++;
313  continue;
314  }
315  else if(deltaGctPhi(*region, *neighbor) == -1 &&
316  (region->hwEta() - 1) == neighbor->hwEta()) {
317  neighborSW_et = neighborET;
318  nNeighbors++;
319  continue;
320  }
321  else if(deltaGctPhi(*region, *neighbor) == 1 &&
322  (region->hwEta() - 1) == neighbor->hwEta()) {
323  neighborNW_et = neighborET;
324  nNeighbors++;
325  continue;
326  }
327  else if(deltaGctPhi(*region, *neighbor) == -1 &&
328  (region->hwEta() + 1) == neighbor->hwEta()) {
329  neighborSE_et = neighborET;
330  nNeighbors++;
331  continue;
332  }
333 
334  }
335  if(regionET > neighborN_et &&
336  regionET > neighborNW_et &&
337  regionET > neighborW_et &&
338  regionET > neighborSW_et &&
339  regionET >= neighborNE_et &&
340  regionET >= neighborE_et &&
341  regionET >= neighborSE_et &&
342  regionET >= neighborS_et) {
343 
344  // use the highest-pT 2x2 jet inside this 3x3
345  unsigned int jetET_NW;
346  unsigned int jetET_NE;
347  unsigned int jetET_SW;
348  unsigned int jetET_SE;
349 
350  jetET_NW = regionET + neighborW_et + neighborNW_et + neighborN_et;
351  jetET_NE = regionET + neighborE_et + neighborNE_et + neighborN_et;
352  jetET_SW = regionET + neighborS_et + neighborSW_et + neighborW_et;
353  jetET_SE = regionET + neighborS_et + neighborSE_et + neighborE_et;
354 
355  unsigned int jetET = std::max(jetET_NW, jetET_NE);
356  jetET = std::max(jetET, jetET_SW);
357  jetET = std::max(jetET, jetET_SE);
358 
359  int jetPhi = region->hwPhi();
360  int jetEta = region->hwEta();
361 
362  bool neighborCheck = (nNeighbors == 8);
363  // On the eta edge we only expect 5 neighbor
364  if (!neighborCheck && (jetEta == 0 || jetEta == 21) && nNeighbors == 5)
365  neighborCheck = true;
366 
367  if (!neighborCheck) {
368  std::cout << "phi: " << jetPhi << " eta: " << jetEta << " n: " << nNeighbors << std::endl;
369  assert(false);
370  }
371 
372  //first iteration, eta cut defines forward
373  const bool forward = (jetEta < 4 || jetEta > 17);
374  int jetQual = 0;
375  if(forward)
376  jetQual |= 0x2;
377 
378  ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > jetLorentz(0,0,0,0);
379  l1t::Jet theJet(*&jetLorentz, jetET, jetEta, jetPhi, jetQual);
380  uncalibjets->push_back(theJet);
381  }
382  }
383  }
assert(m_qm.get())
Definition: Jet.h:13
int deltaGctPhi(const CaloRegion &region, const CaloRegion &neighbor)
tuple cout
Definition: gather_cfg.py:121