CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Static Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Static Private Attributes
l1t::CaloTools Class Reference

#include <CaloTools.h>

Public Types

enum  SubDet { ECAL =0x1, HCAL =0x2, CALO =0x3 }
 

Static Public Member Functions

static int calHwEtSum (int iEta, int iPhi, const std::vector< l1t::CaloTower > &towers, int localEtaMin, int localEtaMax, int localPhiMin, int localPhiMax, SubDet etMode=CALO)
 
static int calHwEtSum (int iEta, int iPhi, const std::vector< l1t::CaloTower > &towers, int localEtaMin, int localEtaMax, int localPhiMin, int localPhiMax, int iEtaAbsMax, SubDet etMode=CALO)
 
static size_t calNrTowers (int iEtaMin, int iEtaMax, int iPhiMin, int iPhiMax, const std::vector< l1t::CaloTower > &towers, int minHwEt, int maxHwEt, SubDet etMode=CALO)
 
static size_t caloTowerHash (int iEta, int iPhi)
 
static size_t caloTowerHashMax ()
 
static l1t::EGamma egP4Demux (l1t::EGamma &)
 
static l1t::EGamma egP4MP (l1t::EGamma &)
 
static l1t::EtSum etSumP4Demux (l1t::EtSum &)
 
static l1t::EtSum etSumP4MP (l1t::EtSum &)
 
static const l1t::CaloClustergetCluster (const std::vector< l1t::CaloCluster > &clusters, int iEta, int iPhi)
 
static const l1t::CaloTowergetTower (const std::vector< l1t::CaloTower > &towers, int iEta, int iPhi)
 
static bool insertTower (std::vector< l1t::CaloTower > &towers, const l1t::CaloTower &tower)
 
static bool isValidIEtaIPhi (int iEta, int iPhi)
 
static l1t::Jet jetP4Demux (l1t::Jet &)
 
static l1t::Jet jetP4MP (l1t::Jet &)
 
static math::PtEtaPhiMLorentzVector p4Demux (l1t::L1Candidate *)
 
static math::PtEtaPhiMLorentzVector p4MP (l1t::L1Candidate *)
 
static l1t::Tau tauP4Demux (l1t::Tau &)
 
static l1t::Tau tauP4MP (l1t::Tau &)
 
static float towerEta (int ieta)
 
static float towerEtaSize (int ieta)
 
static float towerPhi (int ieta, int iphi)
 
static float towerPhiSize (int ieta)
 

Static Public Attributes

static const int kHBHEEnd =28
 
static const int kHBHENrPhi =72
 
static const int kHFBegin =29
 
static const int kHFEnd =40
 
static const int kHFNrPhi =72/kHFPhiSeg
 
static const int kHFPhiSeg =1
 
static const int kNrHBHETowers = kHBHEEnd*kHBHENrPhi*2
 
static const int kNrTowers = ((kHFEnd-kHFBegin+1)*kHFNrPhi + kHBHEEnd*kHBHENrPhi )*2
 

Private Member Functions

 CaloTools ()
 
 ~CaloTools ()
 

Static Private Member Functions

static std::pair< float, float > towerEtaBounds (int ieta)
 

Static Private Attributes

static const l1t::CaloCluster nullCluster_
 
static const l1t::CaloTower nullTower_
 

Detailed Description

Description: A collection of useful functions for the Calorimeter that are of generic interest

Implementation: currently implimented as a static class rather than a namespace, open to re-writing it as namespace

Author
: Sam Harper - RAL

Definition at line 29 of file CaloTools.h.

Member Enumeration Documentation

Enumerator
ECAL 
HCAL 
CALO 

Definition at line 49 of file CaloTools.h.

49 {ECAL=0x1,HCAL=0x2,CALO=0x3}; //CALO is a short cut for ECAL|HCAL

Constructor & Destructor Documentation

l1t::CaloTools::CaloTools ( )
inlineprivate

Definition at line 33 of file CaloTools.h.

33 {}
l1t::CaloTools::~CaloTools ( )
inlineprivate

Definition at line 34 of file CaloTools.h.

34 {}

Member Function Documentation

int l1t::CaloTools::calHwEtSum ( int  iEta,
int  iPhi,
const std::vector< l1t::CaloTower > &  towers,
int  localEtaMin,
int  localEtaMax,
int  localPhiMin,
int  localPhiMax,
SubDet  etMode = CALO 
)
static

Definition at line 91 of file CaloTools.cc.

Referenced by l1t::Stage2Layer2EGammaAlgorithmFirmwareImp1::isoCalEgHwFootPrint(), l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), and l1t::Stage2Layer2EGammaAlgorithmFirmwareImp1::processEvent().

94 {
95 
96  return calHwEtSum(iEta,iPhi,towers,localEtaMin,localEtaMax,localPhiMin,localPhiMax,kHFEnd,etMode);
97 }
static int calHwEtSum(int iEta, int iPhi, const std::vector< l1t::CaloTower > &towers, int localEtaMin, int localEtaMax, int localPhiMin, int localPhiMax, SubDet etMode=CALO)
Definition: CaloTools.cc:91
static const int kHFEnd
Definition: CaloTools.h:41
int l1t::CaloTools::calHwEtSum ( int  iEta,
int  iPhi,
const std::vector< l1t::CaloTower > &  towers,
int  localEtaMin,
int  localEtaMax,
int  localPhiMin,
int  localPhiMax,
int  iEtaAbsMax,
SubDet  etMode = CALO 
)
static

Definition at line 99 of file CaloTools.cc.

References funct::abs(), ECAL, HCAL, l1t::CaloTower::hwEtEm(), l1t::CaloTower::hwEtHad(), l1t::L1Candidate::hwPt(), l1t::CaloStage2Nav::offsetIEta(), and l1t::CaloStage2Nav::offsetIPhi().

102 {
103  int hwEtSum=0;
104  for(int etaNr=localEtaMin;etaNr<=localEtaMax;etaNr++){
105  for(int phiNr=localPhiMin;phiNr<=localPhiMax;phiNr++){
106 
107  int towerIEta = l1t::CaloStage2Nav::offsetIEta(iEta,etaNr);
108  int towerIPhi = l1t::CaloStage2Nav::offsetIPhi(iPhi,phiNr);
109  if(abs(towerIEta)<=iEtaAbsMax){
110  const l1t::CaloTower& tower = getTower(towers,towerIEta,towerIPhi);
111  if(etMode==ECAL) hwEtSum+=tower.hwEtEm();
112  else if(etMode==HCAL) hwEtSum+=tower.hwEtHad();
113  else if(etMode==CALO) hwEtSum+=tower.hwPt();
114  }
115  }
116  }
117  return hwEtSum;
118 }
static int offsetIEta(int iEta, int offset)
Definition: CaloStage2Nav.h:43
int hwEtEm() const
Definition: CaloTower.cc:64
static int offsetIPhi(int iPhi, int offset)
Definition: CaloStage2Nav.h:32
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int hwPt() const
Definition: L1Candidate.cc:69
static const l1t::CaloTower & getTower(const std::vector< l1t::CaloTower > &towers, int iEta, int iPhi)
Definition: CaloTools.cc:21
int hwEtHad() const
Definition: CaloTower.cc:69
size_t l1t::CaloTools::calNrTowers ( int  iEtaMin,
int  iEtaMax,
int  iPhiMin,
int  iPhiMax,
const std::vector< l1t::CaloTower > &  towers,
int  minHwEt,
int  maxHwEt,
SubDet  etMode = CALO 
)
static

Definition at line 121 of file CaloTools.cc.

References l1t::CaloStage2Nav::currIEta(), l1t::CaloStage2Nav::currIPhi(), l1t::CaloStage2Nav::east(), ECAL, getTower(), HCAL, l1t::CaloTower::hwEtEm(), l1t::CaloTower::hwEtHad(), l1t::L1Candidate::hwPt(), l1t::CaloStage2Nav::north(), and l1t::CaloStage2Nav::resetIPhi().

Referenced by l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), and l1t::Stage2Layer2EGammaAlgorithmFirmwareImp1::processEvent().

122 {
123  size_t nrTowers=0;
124  l1t::CaloStage2Nav nav(iEtaMin,iPhiMin);
125  while(nav.currIEta()<=iEtaMax){
126  bool finishPhi = false;
127  while(!finishPhi){
128  const l1t::CaloTower& tower = l1t::CaloTools::getTower(towers,nav.currIEta(),nav.currIPhi());
129  int towerHwEt =0;
130  if(etMode==ECAL) towerHwEt+=tower.hwEtEm();
131  else if(etMode==HCAL) towerHwEt+=tower.hwEtHad();
132  else if(etMode==CALO) towerHwEt+=tower.hwPt();
133  if(towerHwEt>=minHwEt && towerHwEt<=maxHwEt) nrTowers++;
134  finishPhi = (nav.currIPhi() == iPhiMax);
135  nav.north();
136  }
137  nav.east();
138  nav.resetIPhi();
139  }
140  return nrTowers;
141 }
int hwEtEm() const
Definition: CaloTower.cc:64
int hwPt() const
Definition: L1Candidate.cc:69
static const l1t::CaloTower & getTower(const std::vector< l1t::CaloTower > &towers, int iEta, int iPhi)
Definition: CaloTools.cc:21
int hwEtHad() const
Definition: CaloTower.cc:69
size_t l1t::CaloTools::caloTowerHash ( int  iEta,
int  iPhi 
)
static

Definition at line 55 of file CaloTools.cc.

References funct::abs().

Referenced by getTower(), insertTower(), and l1t::stage2::CaloTowerPacker::pack().

56 {
57 
58  if(!isValidIEtaIPhi(iEta,iPhi)) return caloTowerHashMax();
59  else{
60  const int absIEta = abs(iEta);
61  if(absIEta>kHFEnd) return kNrTowers;
62  else if(absIEta<=kHBHEEnd){ //HBHE
63  int iEtaNoZero=iEta;
64  if(iEta>0) iEtaNoZero--;
65  return (iEtaNoZero+kHBHEEnd)*kHBHENrPhi+iPhi-1;
66  }else{ //HF
67  int iEtaIndex = iEta+kHFEnd; //iEta=-32 is 0
68  if(iEta>0) iEtaIndex= iEta-kHBHEEnd+(kHFEnd-kHBHEEnd)-1; //but iEta=29 is 4
69  return iEtaIndex*kHFNrPhi+iPhi/kHFPhiSeg + kNrHBHETowers;
70  }
71  }
72 }
static const int kHFPhiSeg
Definition: CaloTools.h:42
static bool isValidIEtaIPhi(int iEta, int iPhi)
Definition: CaloTools.cc:81
static const int kHBHEEnd
Definition: CaloTools.h:39
static const int kNrHBHETowers
Definition: CaloTools.h:46
static const int kHFNrPhi
Definition: CaloTools.h:43
static const int kHFEnd
Definition: CaloTools.h:41
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kNrTowers
Definition: CaloTools.h:45
static const int kHBHENrPhi
Definition: CaloTools.h:44
static size_t caloTowerHashMax()
Definition: CaloTools.cc:75
size_t l1t::CaloTools::caloTowerHashMax ( )
static

Definition at line 75 of file CaloTools.cc.

76 {
77  return kNrTowers;
78 }
static const int kNrTowers
Definition: CaloTools.h:45
l1t::EGamma l1t::CaloTools::egP4Demux ( l1t::EGamma eg)
static

Definition at line 193 of file CaloTools.cc.

References l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), and l1t::L1Candidate::hwQual().

Referenced by L1TStage2Layer2Producer::produce().

193  {
194 
195  return l1t::EGamma( p4Demux(&eg),
196  eg.hwPt(),
197  eg.hwEta(),
198  eg.hwPhi(),
199  eg.hwQual(),
200  eg.hwIso() );
201 
202 }
int hwPhi() const
Definition: L1Candidate.cc:79
int hwIso() const
Definition: L1Candidate.cc:84
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
int hwPt() const
Definition: L1Candidate.cc:69
static math::PtEtaPhiMLorentzVector p4Demux(l1t::L1Candidate *)
Definition: CaloTools.cc:183
l1t::EGamma l1t::CaloTools::egP4MP ( l1t::EGamma eg)
static

Definition at line 251 of file CaloTools.cc.

References l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), and l1t::L1Candidate::hwQual().

Referenced by L1TStage2Layer2Producer::produce().

251  {
252 
253  return l1t::EGamma( p4MP(&eg),
254  eg.hwPt(),
255  eg.hwEta(),
256  eg.hwPhi(),
257  eg.hwQual(),
258  eg.hwIso() );
259 }
static math::PtEtaPhiMLorentzVector p4MP(l1t::L1Candidate *)
Definition: CaloTools.cc:242
int hwPhi() const
Definition: L1Candidate.cc:79
int hwIso() const
Definition: L1Candidate.cc:84
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
int hwPt() const
Definition: L1Candidate.cc:69
l1t::EtSum l1t::CaloTools::etSumP4Demux ( l1t::EtSum etsum)
static

Definition at line 228 of file CaloTools.cc.

References l1t::EtSum::getType(), l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), and l1t::L1Candidate::hwQual().

Referenced by L1TStage2Layer2Producer::produce().

228  {
229 
230  return l1t::EtSum( p4Demux(&etsum),
231  etsum.getType(),
232  etsum.hwPt(),
233  etsum.hwEta(),
234  etsum.hwPhi(),
235  etsum.hwQual() );
236 
237 }
int hwPhi() const
Definition: L1Candidate.cc:79
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
int hwPt() const
Definition: L1Candidate.cc:69
static math::PtEtaPhiMLorentzVector p4Demux(l1t::L1Candidate *)
Definition: CaloTools.cc:183
EtSumType getType() const
Definition: EtSum.cc:37
l1t::EtSum l1t::CaloTools::etSumP4MP ( l1t::EtSum etsum)
static

Definition at line 283 of file CaloTools.cc.

References l1t::EtSum::getType(), l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), and l1t::L1Candidate::hwQual().

Referenced by L1TStage2Layer2Producer::produce().

283  {
284 
285  return l1t::EtSum( p4MP(&etsum),
286  etsum.getType(),
287  etsum.hwPt(),
288  etsum.hwEta(),
289  etsum.hwPhi(),
290  etsum.hwQual() );
291 
292 }
static math::PtEtaPhiMLorentzVector p4MP(l1t::L1Candidate *)
Definition: CaloTools.cc:242
int hwPhi() const
Definition: L1Candidate.cc:79
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
int hwPt() const
Definition: L1Candidate.cc:69
EtSumType getType() const
Definition: EtSum.cc:37
const l1t::CaloCluster & l1t::CaloTools::getCluster ( const std::vector< l1t::CaloCluster > &  clusters,
int  iEta,
int  iPhi 
)
static

Definition at line 42 of file CaloTools.cc.

Referenced by l1t::Stage2Layer2ClusterAlgorithmFirmwareImp1::filtering(), and l1t::Stage2Layer2ClusterAlgorithmFirmwareImp1::sharing().

43 {
44  for(size_t clusterNr=0;clusterNr<clusters.size();clusterNr++){
45  if(clusters[clusterNr].hwEta()==iEta && clusters[clusterNr].hwPhi()==iPhi) return clusters[clusterNr];
46  }
47  return nullCluster_;
48 }
static const l1t::CaloCluster nullCluster_
Definition: CaloTools.h:103
const l1t::CaloTower & l1t::CaloTools::getTower ( const std::vector< l1t::CaloTower > &  towers,
int  iEta,
int  iPhi 
)
static

Definition at line 21 of file CaloTools.cc.

References caloTowerHash().

Referenced by L1TStage2InputPatternWriter::analyze(), calNrTowers(), l1t::Stage2Layer2JetAlgorithmFirmwareImp1::chunkyDonutPUEstimate(), l1t::Stage2Layer2ClusterAlgorithmFirmwareImp1::clustering(), l1t::Stage2Layer2JetAlgorithmFirmwareImp1::create(), l1t::Stage2Layer2JetAlgorithmFirmwareImp1::donutPUEstimate(), l1t::Stage2Layer2TauAlgorithmFirmwareImp1::is3x3Maximum(), l1t::Stage2Layer2TauAlgorithmFirmwareImp1::makeSecClusters(), l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), l1t::Stage2Layer2EtSumAlgorithmFirmwareImp1::processEvent(), l1t::Stage2Layer2EGammaAlgorithmFirmwareImp1::processEvent(), l1t::Stage2Layer2ClusterAlgorithmFirmwareImp1::refining(), and l1t::Stage2Layer2ClusterAlgorithmFirmwareImp1::sharing().

22 {
23  size_t towerIndex = CaloTools::caloTowerHash(iEta, iPhi);
24  if(towerIndex<towers.size()){
25  if(towers[towerIndex].hwEta()!=iEta || towers[towerIndex].hwPhi()!=iPhi){ //it failed, this is bad, but we will not log the error due to policy and silently attempt to do a brute force search instead
26  // std::cout <<"error, tower "<<towers[towerIndex].hwEta()<<" "<<towers[towerIndex].hwPhi()<<" does not match "<<iEta<<" "<<iPhi<<" index "<<towerIndex<<" nr towrs "<<towers.size()<<std::endl;
27  for(size_t towerNr=0;towerNr<towers.size();towerNr++){
28  if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi) return towers[towerNr];
29  }
30  }else return towers[towerIndex];
31 
32  }
33  else{// in case the vector of towers do not contain all the towers (towerIndex can be > towers.size())
34  for(size_t towerNr=0;towerNr<towers.size();towerNr++){
35  if(towers[towerNr].hwEta()==iEta && towers[towerNr].hwPhi()==iPhi) return towers[towerNr];
36  }
37  }
38 
39  return nullTower_;
40 }
static size_t caloTowerHash(int iEta, int iPhi)
Definition: CaloTools.cc:55
static const l1t::CaloTower nullTower_
Definition: CaloTools.h:102
bool l1t::CaloTools::insertTower ( std::vector< l1t::CaloTower > &  towers,
const l1t::CaloTower tower 
)
static

Definition at line 10 of file CaloTools.cc.

References caloTowerHash(), l1t::L1Candidate::hwEta(), and l1t::L1Candidate::hwPhi().

10  {
11  size_t towerIndex = CaloTools::caloTowerHash(tower.hwEta(), tower.hwPhi());
12  if (towers.size() > towerIndex) {
13  towers.at(towerIndex) = tower;
14  return true;
15  }
16  else return false;
17 }
int hwPhi() const
Definition: L1Candidate.cc:79
static size_t caloTowerHash(int iEta, int iPhi)
Definition: CaloTools.cc:55
int hwEta() const
Definition: L1Candidate.cc:74
bool l1t::CaloTools::isValidIEtaIPhi ( int  iEta,
int  iPhi 
)
static

Definition at line 81 of file CaloTools.cc.

References funct::abs().

82 {
83  size_t absIEta = abs(iEta);
84  if(iPhi<=0 || iPhi>kHBHENrPhi) return false;
85  if(absIEta==0 || absIEta>kHFEnd) return false;
86  //if(absIEta>kHBHEEnd && iPhi%kHFPhiSeg!=1) return false;
87  return true;
88 
89 }
static const int kHFEnd
Definition: CaloTools.h:41
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
static const int kHBHENrPhi
Definition: CaloTools.h:44
l1t::Jet l1t::CaloTools::jetP4Demux ( l1t::Jet jet)
static

Definition at line 217 of file CaloTools.cc.

References l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), and configurableAnalysis::Jet.

Referenced by L1TStage2Layer2Producer::produce().

217  {
218 
219  return l1t::Jet( p4Demux(&jet),
220  jet.hwPt(),
221  jet.hwEta(),
222  jet.hwPhi(),
223  jet.hwQual() );
224 
225 }
int hwPhi() const
Definition: L1Candidate.cc:79
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
int hwPt() const
Definition: L1Candidate.cc:69
static math::PtEtaPhiMLorentzVector p4Demux(l1t::L1Candidate *)
Definition: CaloTools.cc:183
l1t::Jet l1t::CaloTools::jetP4MP ( l1t::Jet jet)
static

Definition at line 273 of file CaloTools.cc.

References l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), l1t::L1Candidate::hwQual(), and configurableAnalysis::Jet.

Referenced by L1TStage2Layer2Producer::produce().

273  {
274 
275  return l1t::Jet( p4MP(&jet),
276  jet.hwPt(),
277  jet.hwEta(),
278  jet.hwPhi(),
279  jet.hwQual() );
280 
281 }
static math::PtEtaPhiMLorentzVector p4MP(l1t::L1Candidate *)
Definition: CaloTools.cc:242
int hwPhi() const
Definition: L1Candidate.cc:79
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
int hwPt() const
Definition: L1Candidate.cc:69
math::PtEtaPhiMLorentzVector l1t::CaloTools::p4Demux ( l1t::L1Candidate cand)
static

Definition at line 183 of file CaloTools.cc.

References l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPhi(), and l1t::L1Candidate::hwPt().

Referenced by l1t::stage2::EtSumUnpacker::unpack(), l1t::stage2::TauUnpacker::unpack(), l1t::stage2::JetUnpacker::unpack(), and l1t::stage2::EGammaUnpacker::unpack().

183  {
184 
185  return math::PtEtaPhiMLorentzVector( cand->hwPt() * 0.5 + 1.E-6,
186  cand->hwEta() * 0.0435,
187  cand->hwPhi() * 0.0435,
188  0. ) ;
189 
190 }
int hwPhi() const
Definition: L1Candidate.cc:79
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
int hwEta() const
Definition: L1Candidate.cc:74
int hwPt() const
Definition: L1Candidate.cc:69
math::PtEtaPhiMLorentzVector l1t::CaloTools::p4MP ( l1t::L1Candidate cand)
static

Definition at line 242 of file CaloTools.cc.

References l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwPhi(), and l1t::L1Candidate::hwPt().

Referenced by l1t::stage2::MPUnpacker::unpack().

242  {
243 
244  return math::PtEtaPhiMLorentzVector( cand->hwPt() * 0.5 + 1.E-6,
245  towerEta(cand->hwEta()),
246  towerPhi(cand->hwEta(), cand->hwPhi()),
247  0. ) ;
248 
249 }
static float towerEta(int ieta)
Definition: CaloTools.cc:153
static float towerPhi(int ieta, int iphi)
Definition: CaloTools.cc:161
int hwPhi() const
Definition: L1Candidate.cc:79
PtEtaPhiMLorentzVectorD PtEtaPhiMLorentzVector
Lorentz vector with cartesian internal representation.
Definition: LorentzVector.h:25
int hwEta() const
Definition: L1Candidate.cc:74
int hwPt() const
Definition: L1Candidate.cc:69
l1t::Tau l1t::CaloTools::tauP4Demux ( l1t::Tau tau)
static

Definition at line 205 of file CaloTools.cc.

References l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), and l1t::L1Candidate::hwQual().

Referenced by L1TStage2Layer2Producer::produce().

205  {
206 
207  return l1t::Tau( p4Demux(&tau),
208  tau.hwPt(),
209  tau.hwEta(),
210  tau.hwPhi(),
211  tau.hwQual(),
212  tau.hwIso() );
213 
214 }
int hwPhi() const
Definition: L1Candidate.cc:79
int hwIso() const
Definition: L1Candidate.cc:84
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
int hwPt() const
Definition: L1Candidate.cc:69
static math::PtEtaPhiMLorentzVector p4Demux(l1t::L1Candidate *)
Definition: CaloTools.cc:183
l1t::Tau l1t::CaloTools::tauP4MP ( l1t::Tau tau)
static

Definition at line 262 of file CaloTools.cc.

References l1t::L1Candidate::hwEta(), l1t::L1Candidate::hwIso(), l1t::L1Candidate::hwPhi(), l1t::L1Candidate::hwPt(), and l1t::L1Candidate::hwQual().

Referenced by L1TStage2Layer2Producer::produce().

262  {
263 
264  return l1t::Tau( p4MP(&tau),
265  tau.hwPt(),
266  tau.hwEta(),
267  tau.hwPhi(),
268  tau.hwQual(),
269  tau.hwIso() );
270 }
static math::PtEtaPhiMLorentzVector p4MP(l1t::L1Candidate *)
Definition: CaloTools.cc:242
int hwPhi() const
Definition: L1Candidate.cc:79
int hwIso() const
Definition: L1Candidate.cc:84
int hwEta() const
Definition: L1Candidate.cc:74
int hwQual() const
Definition: L1Candidate.cc:89
int hwPt() const
Definition: L1Candidate.cc:69
float l1t::CaloTools::towerEta ( int  ieta)
static

Definition at line 153 of file CaloTools.cc.

References eta, and jetcorrextractor::sign().

Referenced by l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), and l1t::Stage2Layer2EGammaAlgorithmFirmwareImp1::processEvent().

154 {
155  std::pair<float,float> bounds = towerEtaBounds(ieta);
156  float eta = (bounds.second+bounds.first)/2.;
157  float sign = ieta>0 ? 1. : -1.;
158  return sign*eta;
159 }
double sign(double x)
static std::pair< float, float > towerEtaBounds(int ieta)
Definition: CaloTools.cc:143
std::pair< float, float > l1t::CaloTools::towerEtaBounds ( int  ieta)
staticprivate

Definition at line 143 of file CaloTools.cc.

References funct::abs().

144 {
145  if(ieta==0) ieta = 1;
146  if(ieta>32) ieta = 32;
147  if(ieta<-32) ieta = -32;
148  //const float towerEtas[33] = {0,0.087,0.174,0.261,0.348,0.435,0.522,0.609,0.696,0.783,0.870,0.957,1.044,1.131,1.218,1.305,1.392,1.479,1.566,1.653,1.740,1.830,1.930,2.043,2.172,2.322,2.5,2.650,3.000,3.5,4.0,4.5,5.0};
149  const float towerEtas[41] = {0,0.087,0.174,0.261,0.348,0.435,0.522,0.609,0.696,0.783,0.870,0.957,1.044,1.131,1.218,1.305,1.392,1.479,1.566,1.653,1.740,1.830,1.930,2.043,2.172,2.322,2.5,2.650,2.853,3.139,3.314,3.489,3.664,3.839,4.013,4.191,4.363,4.538,4.716,4.889,5.191};
150  return std::make_pair( towerEtas[abs(ieta)-1],towerEtas[abs(ieta)] );
151 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
float l1t::CaloTools::towerEtaSize ( int  ieta)
static

Definition at line 166 of file CaloTools.cc.

References findQualityFiles::size.

Referenced by l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), and l1t::Stage2Layer2EGammaAlgorithmFirmwareImp1::processEvent().

167 {
168  std::pair<float,float> bounds = towerEtaBounds(ieta);
169  float size = (bounds.second-bounds.first);
170  return size;
171 }
static std::pair< float, float > towerEtaBounds(int ieta)
Definition: CaloTools.cc:143
tuple size
Write out results.
float l1t::CaloTools::towerPhi ( int  ieta,
int  iphi 
)
static

Definition at line 161 of file CaloTools.cc.

Referenced by l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), and l1t::Stage2Layer2EGammaAlgorithmFirmwareImp1::processEvent().

162 {
163  return (float(iphi)-0.5)*towerPhiSize(ieta);
164 }
static float towerPhiSize(int ieta)
Definition: CaloTools.cc:173
float l1t::CaloTools::towerPhiSize ( int  ieta)
static

Definition at line 173 of file CaloTools.cc.

References funct::abs(), and M_PI.

Referenced by l1t::Stage2Layer2TauAlgorithmFirmwareImp1::merging(), and l1t::Stage2Layer2EGammaAlgorithmFirmwareImp1::processEvent().

174 {
175  if(abs(ieta)<=28) return 2.*M_PI/72.;
176  else return 2.*M_PI/18.;
177 }
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
#define M_PI

Member Data Documentation

const int l1t::CaloTools::kHBHEEnd =28
static

Definition at line 39 of file CaloTools.h.

const int l1t::CaloTools::kHBHENrPhi =72
static

Definition at line 44 of file CaloTools.h.

const int l1t::CaloTools::kHFBegin =29
static

Definition at line 40 of file CaloTools.h.

const int l1t::CaloTools::kHFEnd =40
static

Definition at line 41 of file CaloTools.h.

const int l1t::CaloTools::kHFNrPhi =72/kHFPhiSeg
static

Definition at line 43 of file CaloTools.h.

const int l1t::CaloTools::kHFPhiSeg =1
static

Definition at line 42 of file CaloTools.h.

const int l1t::CaloTools::kNrHBHETowers = kHBHEEnd*kHBHENrPhi*2
static

Definition at line 46 of file CaloTools.h.

const int l1t::CaloTools::kNrTowers = ((kHFEnd-kHFBegin+1)*kHFNrPhi + kHBHEEnd*kHBHENrPhi )*2
static

Definition at line 45 of file CaloTools.h.

const l1t::CaloCluster l1t::CaloTools::nullCluster_
staticprivate

Definition at line 103 of file CaloTools.h.

const l1t::CaloTower l1t::CaloTools::nullTower_
staticprivate

Definition at line 102 of file CaloTools.h.