CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
l1t::Stage1Layer2FlowAlgorithm Class Reference

#include <Stage1Layer2HFRingSumAlgorithmImp.h>

Inheritance diagram for l1t::Stage1Layer2FlowAlgorithm:
l1t::Stage1Layer2HFRingSumAlgorithm

Public Member Functions

void processEvent (const std::vector< l1t::CaloRegion > &regions, const std::vector< l1t::CaloEmCand > &EMCands, const std::vector< l1t::Tau > *taus, l1t::CaloSpare *spare) override
 
 Stage1Layer2FlowAlgorithm (CaloParamsHelper const *params)
 
 ~Stage1Layer2FlowAlgorithm () override=default
 
- Public Member Functions inherited from l1t::Stage1Layer2HFRingSumAlgorithm
virtual ~Stage1Layer2HFRingSumAlgorithm ()
 

Private Attributes

std::vector< double > cosPhi
 
std::vector< double > sinPhi
 

Detailed Description

Authors
: Maxime Guilbaud R. Alex Barbieri

Description: Flow Algorithm HI

Definition at line 27 of file Stage1Layer2HFRingSumAlgorithmImp.h.

Constructor & Destructor Documentation

l1t::Stage1Layer2FlowAlgorithm::Stage1Layer2FlowAlgorithm ( CaloParamsHelper const *  params)

Definition at line 14 of file Stage1Layer2FlowAlgorithm.cc.

References funct::cos(), cosPhi, mps_fire::i, L1CaloRegionDetId::N_PHI, funct::sin(), and sinPhi.

14  {
15  //now do what ever initialization is needed
16  //Converting phi to be as it is define at GCT (-pi to pi instead of 0 to 2*pi)
17  for(unsigned int i = 0; i < L1CaloRegionDetId::N_PHI; i++) {
18  if(i < 10){
19  sinPhi.push_back(sin(2. * 3.1415927 * i * 1.0 / L1CaloRegionDetId::N_PHI));
20  cosPhi.push_back(cos(2. * 3.1415927 * i * 1.0 / L1CaloRegionDetId::N_PHI));
21  }
22  else {
23  sinPhi.push_back(sin(-3.1415927 + 2. * 3.1415927 * (i-9) * 1.0 / L1CaloRegionDetId::N_PHI));
24  cosPhi.push_back(cos(-3.1415927 + 2. * 3.1415927 * (i-9) * 1.0 / L1CaloRegionDetId::N_PHI));
25  }
26  }
27 }
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
static const unsigned N_PHI
l1t::Stage1Layer2FlowAlgorithm::~Stage1Layer2FlowAlgorithm ( )
overridedefault

Member Function Documentation

void l1t::Stage1Layer2FlowAlgorithm::processEvent ( const std::vector< l1t::CaloRegion > &  regions,
const std::vector< l1t::CaloEmCand > &  EMCands,
const std::vector< l1t::Tau > *  taus,
l1t::CaloSpare spare 
)
overridevirtual

Implements l1t::Stage1Layer2HFRingSumAlgorithm.

Definition at line 30 of file Stage1Layer2FlowAlgorithm.cc.

References cosPhi, l1t::CaloSpare::SetRing(), and sinPhi.

33  {
34  double q2x = 0;
35  double q2y = 0;
36  double regionET=0.;
37 
38  for(std::vector<CaloRegion>::const_iterator region = regions.begin(); region != regions.end(); region++) {
39 
40  int ieta=region->hwEta();
41  if (ieta > 3 && ieta < 18) {
42  continue;
43  }
44 
45  int iphi=region->hwPhi();
46  regionET=region->hwPt();
47 
48  q2x+= regionET * cosPhi[iphi];
49  q2y+= regionET * sinPhi[iphi];
50  }
51  int HFq2 = q2x*q2x+q2y*q2y;
52  //double psi2 = 0.5 * atan(q2y/q2x);
53 
54  // ROOT::Math::LorentzVector<ROOT::Math::PxPyPzE4D<double> > dummy(0,0,0,0);
55 
56  // l1t::CaloSpare V2 (*&dummy,CaloSpare::CaloSpareType::V2,(int)HFq2,0,0,0);
57 
58  // spares->push_back(V2);
59  spare->SetRing(1, HFq2&0x7);
60 }
void SetRing(unsigned index, int value)
Definition: CaloSpare.cc:42

Member Data Documentation

std::vector<double> l1t::Stage1Layer2FlowAlgorithm::cosPhi
private

Definition at line 37 of file Stage1Layer2HFRingSumAlgorithmImp.h.

Referenced by processEvent(), and Stage1Layer2FlowAlgorithm().

std::vector<double> l1t::Stage1Layer2FlowAlgorithm::sinPhi
private

Definition at line 38 of file Stage1Layer2HFRingSumAlgorithmImp.h.

Referenced by processEvent(), and Stage1Layer2FlowAlgorithm().