test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Functions
L1TPhysicalEtAdder.cc File Reference
#include "L1Trigger/L1TCalorimeter/plugins/L1TPhysicalEtAdder.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "CondFormats/L1TObjects/interface/L1CaloEtScale.h"
#include "CondFormats/DataRecord/interface/L1JetEtScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1HtMissScaleRcd.h"
#include "CondFormats/DataRecord/interface/L1EmEtScaleRcd.h"
#include "DataFormats/L1CaloTrigger/interface/L1CaloEmCand.h"
#include "DataFormats/L1CaloTrigger/interface/L1CaloRegion.h"
#include "DataFormats/L1CaloTrigger/interface/L1CaloCollections.h"
#include "DataFormats/L1Trigger/interface/BXVector.h"
#include "DataFormats/L1Trigger/interface/EtSum.h"
#include "DataFormats/L1TCalorimeter/interface/CaloEmCand.h"
#include "DataFormats/L1TCalorimeter/interface/CaloRegion.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include <vector>
#include <stdio.h>

Go to the source code of this file.

Functions

double getPhysicalEta (int etaIndex, bool forward=false)
 
double getPhysicalPhi (int phiIndex)
 
int getRegionEta (int gtEta, bool forward)
 
static const
edm::ParameterSetDescriptionFillerPluginFactory::PMaker
< edm::ParameterSetDescriptionFiller
< L1TPhysicalEtAdder > > 
s_filler__LINE__ ("L1TPhysicalEtAdder")
 
static const
edm::MakerPluginFactory::PMaker
< edm::WorkerMaker
< L1TPhysicalEtAdder > > 
s_maker__LINE__ ("L1TPhysicalEtAdder")
 

Function Documentation

double getPhysicalEta ( int  etaIndex,
bool  forward = false 
)

Definition at line 365 of file L1TPhysicalEtAdder.cc.

References getRegionEta().

Referenced by L1TPhysicalEtAdder::produce().

366 {
367  int etaIndex = getRegionEta(gtEta, forward);
368 
369  const double rgnEtaValues[11] = {
370  0.174, // HB and inner HE bins are 0.348 wide
371  0.522,
372  0.870,
373  1.218,
374  1.566,
375  1.956, // Last two HE bins are 0.432 and 0.828 wide
376  2.586,
377  3.250, // HF bins are 0.5 wide
378  3.750,
379  4.250,
380  4.750
381  };
382  if(etaIndex < 11) {
383  return -rgnEtaValues[-(etaIndex - 10)]; // 0-10 are negative eta values
384  }
385  else if (etaIndex < 22) {
386  return rgnEtaValues[etaIndex - 11]; // 11-21 are positive eta values
387  }
388  return -9;
389 }
const unsigned int gtEta(const unsigned int iEta)
int getRegionEta(int gtEta, bool forward)
double getPhysicalPhi ( int  phiIndex)

Definition at line 391 of file L1TPhysicalEtAdder.cc.

References M_PI.

Referenced by L1TPhysicalEtAdder::produce().

392 {
393  if (phiIndex < 10)
394  return 2. * M_PI * phiIndex / 18.;
395  if (phiIndex < 18)
396  return -M_PI + 2. * M_PI * (phiIndex - 9) / 18.;
397  return -9;
398 }
#define M_PI
int getRegionEta ( int  gtEta,
bool  forward 
)

Definition at line 339 of file L1TPhysicalEtAdder.cc.

References l1t::gtEta().

Referenced by getPhysicalEta().

340 {
341  // backwards conversion is
342  // unsigned rctEta = (iEta<11 ? 10-iEta : iEta-11);
343  // return (((rctEta % 7) & 0x7) | (iEta<11 ? 0x8 : 0));
344  int centralGtEta[] = {11, 12, 13, 14, 15, 16, 17, -100, 10, 9, 8, 7, 6, 5, 4};
345  int forwardGtEta[] = {18, 19, 20, 21, -100, -100, -100, -100, 3, 2, 1, 0};
346 
347  //printf("%i, %i\n",gtEta,forward);
348 
349  int regionEta;
350 
351  if(!forward)
352  {
353  regionEta = centralGtEta[gtEta];
354  } else
355  regionEta = forwardGtEta[gtEta];
356 
357  if(regionEta == -100)
358  edm::LogError("EtaIndexError")
359  << "Bad eta index passed to L1TPhysicalEtAdder::getRegionEta, " << gtEta << std::endl;
360 
361  return regionEta;
362 }
const unsigned int gtEta(const unsigned int iEta)
static const edm::ParameterSetDescriptionFillerPluginFactory::PMaker<edm::ParameterSetDescriptionFiller< L1TPhysicalEtAdder > > s_filler__LINE__ ( "L1TPhysicalEtAdder"  )
static
static const edm::MakerPluginFactory ::PMaker< edm::WorkerMaker< L1TPhysicalEtAdder > > s_maker__LINE__ ( "L1TPhysicalEtAdder"  )
static