Skip to content
Snippets Groups Projects
Commit 4733d7a0 authored by Scott Snyder's avatar Scott Snyder Committed by Graeme Stewart
Browse files

Const fixes: use typedefs for map types. (TrigT1CaloUtils-00-02-13)

	* Tagging TrigT1CaloUtils-00-02-13.
	* Const fixes: use typedefs for map types.

2016-10-27  scott snyder  <snyder@bnl.gov>

	* Tagging TrigT1CaloUtils-00-02-12.
	* Accessor methods should be const.
	* Tagging TrigT1CaloUtils-00-02-11.
	* Do not put "using namespace std" in a header.
	* Tagging TrigT1CaloUtils-00-02-10.
	* clang warnings: Extra parentheses.
	* Tagging TrigT1CaloUtils-00-02-09.
	* clang warnings: Unused members.
	* Tagging TrigT1CaloUtils-00-02-08.
	* Comply with ATLAS naming conventions.
parent 224ab5af
1 merge request!20779WIP: Migrate DataQualityTools to ToolHandles
Showing
with 121 additions and 122 deletions
......@@ -51,25 +51,25 @@ The CPAlgorithm:<br>
class CPAlgorithm {
public:
CPAlgorithm( double eta, double phi, const std::map<int, CPMTower *>* ttContainer, ServiceHandle<TrigConf::ITrigConfigSvc> config, int slice = -1);
CPAlgorithm( double eta, double phi, const CPMTowerMap_t* ttContainer, ServiceHandle<TrigConf::ITrigConfigSvc> config, int slice = -1);
~CPAlgorithm();
/** Accessors */
double eta();
double phi();
int Core();
int EMClus();
int TauClus();
int EMIsol();
int HadIsol();
int HadVeto();
bool isEtMax();
unsigned int Hits();
unsigned int RoIWord();
double eta() const;
double phi() const;
int Core() const;
int EMClus() const;
int TauClus() const;
int EMIsol() const;
int HadIsol() const;
int HadVeto() const;
bool isEtMax() const;
unsigned int Hits() const;
unsigned int RoIWord() const;
/** Put a new EmTauROI object (corresponding to this window) on the heap, and return a pointer to it*/
EmTauROI* produceExternal();
EmTauROI* produceExternal() const;
private: //atribs
double m_refEta;
......@@ -88,7 +88,7 @@ private: //atribs
bool m_EtMax;
unsigned int m_Hits;
bool m_debug;
//bool m_debug;
/** Algorithm parameters */
static const int m_maxClus;
......
......@@ -51,7 +51,7 @@ The CPMTobAlgorithm:<br>
class CPMTobAlgorithm {
public:
CPMTobAlgorithm(double eta, double phi, const std::map<int, xAOD::CPMTower *>* ttContainer, ServiceHandle<TrigConf::ITrigConfigSvc> config, int slice = -1);
CPMTobAlgorithm(double eta, double phi, const xAOD::CPMTowerMap_t* ttContainer, ServiceHandle<TrigConf::ITrigConfigSvc> config, int slice = -1);
~CPMTobAlgorithm();
......@@ -108,7 +108,7 @@ private: //atribs
bool m_EMThresh;
bool m_TauThresh;
bool m_debug;
//bool m_debug;
/** Algorithm parameters */
static const unsigned int m_maxClus;
......
......@@ -36,7 +36,6 @@ This belongs to the TrigT1Calo simulation.
namespace LVL1 {
using namespace std;
/**returns the trigger hardware components associated with a given Coordinate
*@author E.Moyse
\todo this should probably be a static class.
......@@ -119,7 +118,7 @@ private: //attribs
/** contains the maximum permissable eta for CP system. Expected to be 2.5 */
double m_cpEtaMax;
/** width of JEMs*/
double m_jemEtaWidth ;
//double m_jemEtaWidth ;
/** contains RoI local coordinate mapping (phi,eta)*/
unsigned int m_roiLocalMap[2][4];
/** returned value in the case of an invalid Coordinate error */
......
......@@ -43,20 +43,20 @@ public:
~CrateEnergy();
public:
unsigned int crate();
unsigned int crate() const;
/** return et, ex, ey sums */
int et();
int ex();
int ey();
int et() const;
int ex() const;
int ey() const;
/** 15 bit twos-complement format */
unsigned int exTC();
unsigned int eyTC();
unsigned int exTC() const;
unsigned int eyTC() const;
/** Overflow bits */
unsigned int exOverflow();
unsigned int eyOverflow();
unsigned int etOverflow();
unsigned int exOverflow() const;
unsigned int eyOverflow() const;
unsigned int etOverflow() const;
/** Full or restricted eta range? */
bool restricted();
bool restricted() const;
private:
unsigned int m_crate;
unsigned int m_crateEt;
......@@ -72,8 +72,8 @@ private:
static const unsigned int m_jemEtSaturation=4032;
private:
unsigned int encodeTC(int input);
int decodeTC(unsigned int input);
unsigned int encodeTC(int input) const;
int decodeTC(unsigned int input) const;
};
......
......@@ -81,7 +81,7 @@ private: //atribs
int m_ETSmall;
bool m_EtMax;
bool m_debug;
//bool m_debug;
/** Algorithm parameters */
static const int m_satLarge;
......
......@@ -56,18 +56,18 @@ public:
~JetAlgorithm();
/** Accessors */
double eta();
double phi();
int Core();
int ET4x4();
int ET6x6();
int ET8x8();
bool isEtMax();
unsigned int Hits();
unsigned int RoIWord();
double eta() const;
double phi() const;
int Core() const;
int ET4x4() const;
int ET6x6() const;
int ET8x8() const;
bool isEtMax() const;
unsigned int Hits() const;
unsigned int RoIWord() const;
/** Put a new EmTauROI object (corresponding to this window) on the heap, and return a pointer to it*/
JetROI* produceExternal();
JetROI* produceExternal() const;
private: //atribs
double m_refEta;
......@@ -93,7 +93,7 @@ private: // methods
void testEtMax(const std::vector<int>& cores);
void passesTrigger();
void getThresholds(TrigConf::TriggerThreshold* thresh, int& size, int& value);
bool isForwardJet();
bool isForwardJet() const;
};
......
......@@ -46,7 +46,7 @@ The ModuleEnergy:<br>
class ModuleEnergy {
public:
ModuleEnergy(const std::map<int, xAOD::JetElement *>* JEContainer, unsigned int crate, unsigned int module,
ModuleEnergy(const xAOD::JetElementMap_t* JEContainer, unsigned int crate, unsigned int module,
int JEThresholdEtSum, int JEThresholdEtMiss, const std::map<int, int>* TEMasks = 0, int slice = -1);
ModuleEnergy(unsigned int crate, unsigned int module, unsigned int et,
......@@ -55,15 +55,15 @@ public:
~ModuleEnergy();
/** which module is this? */
unsigned int crate();
unsigned int module();
unsigned int crate() const;
unsigned int module() const;
/** return the scalar & vector sums of all JE ETs (i.e sums the energies of up to 32 contained JEs) */
/** module sums are unsigned. As a convenience, add methods to return signs for this module */
unsigned int et();
unsigned int ex();
unsigned int ey();
int signX();
int signY();
unsigned int et() const;
unsigned int ex() const;
unsigned int ey() const;
int signX() const;
int signY() const;
private: //atribs
int m_jetElementThresholdEtSum;
......
......@@ -38,7 +38,7 @@ const int CPAlgorithm::m_maxIsol = 0x3F;
const double CPAlgorithm::m_maxEta = 2.5;
LVL1::CPAlgorithm::CPAlgorithm( double eta, double phi, const std::map<int, CPMTower *>* ttContainer,
LVL1::CPAlgorithm::CPAlgorithm( double eta, double phi, const CPMTowerMap_t* ttContainer,
ServiceHandle<TrigConf::ITrigConfigSvc> config, int slice):
m_configSvc(config),
m_Core(0),
......@@ -48,8 +48,8 @@ LVL1::CPAlgorithm::CPAlgorithm( double eta, double phi, const std::map<int, CPMT
m_HadCore(0),
m_HadIsol(0),
m_EtMax(false),
m_Hits(0),
m_debug(false)
m_Hits(0)
//m_debug(false)
{
/** RoI coordinates are centre of window, while key classes are designed
for TT coordinates - differ by 0.5* TT_size. Using wrong coordinate
......@@ -94,7 +94,7 @@ LVL1::CPAlgorithm::CPAlgorithm( double eta, double phi, const std::map<int, CPMT
for (int phiOffset = -1; phiOffset <= 2; phiOffset++) {
double tempPhi = m_refPhi + phiOffset*M_PI/32;
int key = get.ttKey(tempPhi, tempEta);
std::map<int, CPMTower*>::const_iterator tt = ttContainer->find(key);
CPMTowerMap_t::const_iterator tt = ttContainer->find(key);
if (tt != ttContainer->end() && fabs(tempEta) < m_maxEta) {
// Get the TT ET values once here, rather than repeat function calls
int emTT = 0;
......@@ -294,58 +294,58 @@ bool LVL1::CPAlgorithm::tauAlgorithm(){
// Public accessor methods follow
/** Returns RoI Core ET */
int LVL1::CPAlgorithm::Core() {
int LVL1::CPAlgorithm::Core() const {
return m_Core;
}
/** Returns EM cluster ET, limited to 8 bits */
int LVL1::CPAlgorithm::EMClus() {
int LVL1::CPAlgorithm::EMClus() const {
return ( (m_EMClus < m_maxClus) ? m_EMClus : m_maxClus );
}
/** Returns Tau cluster ET, limited to 8 bits */
int LVL1::CPAlgorithm::TauClus() {
int LVL1::CPAlgorithm::TauClus() const {
return ( (m_TauClus < m_maxClus) ? m_TauClus : m_maxClus );
}
/** Returns EM isolation ET, limited to 6 bits */
int LVL1::CPAlgorithm::EMIsol() {
int LVL1::CPAlgorithm::EMIsol() const {
return ( (m_EMIsol < m_maxIsol) ? m_EMIsol : m_maxIsol );
}
/** Returns Had isolation ET, limited to 6 bits */
int LVL1::CPAlgorithm::HadIsol() {
int LVL1::CPAlgorithm::HadIsol() const {
return ( (m_HadIsol < m_maxIsol) ? m_HadIsol : m_maxIsol );
}
/** Returns Had veto ET (inner isolation sum), limited to 6 bits */
int LVL1::CPAlgorithm::HadVeto() {
int LVL1::CPAlgorithm::HadVeto() const {
return ( (m_HadCore < m_maxIsol) ? m_HadCore : m_maxIsol );
}
/** Does this window pass the local ET maximum condition */
bool LVL1::CPAlgorithm::isEtMax() {
bool LVL1::CPAlgorithm::isEtMax() const {
return m_EtMax;
}
/** Returns eta coordinate of RoI */
double LVL1::CPAlgorithm::eta() {
double LVL1::CPAlgorithm::eta() const {
return m_eta;
}
/** Returns phi coordinate of RoI, using standard ATLAS convention */
double LVL1::CPAlgorithm::phi() {
double LVL1::CPAlgorithm::phi() const {
return ( (m_phi <= M_PI) ? m_phi : m_phi - 2.*M_PI);
}
/** Returns hitword for this window */
unsigned int LVL1::CPAlgorithm::Hits() {
unsigned int LVL1::CPAlgorithm::Hits() const {
return m_Hits;
}
/** Returns RoI word for this window */
unsigned int LVL1::CPAlgorithm::RoIWord() {
unsigned int LVL1::CPAlgorithm::RoIWord() const {
unsigned int roiWord = (TrigT1CaloDefs::cpRoIType<<30);
CoordToHardware convertor;
......@@ -357,7 +357,7 @@ unsigned int LVL1::CPAlgorithm::RoIWord() {
return roiWord;
}
EmTauROI* LVL1::CPAlgorithm::produceExternal(){
EmTauROI* LVL1::CPAlgorithm::produceExternal() const {
L1DataDef def;
std::vector<unsigned int> algorithmType(TrigT1CaloDefs::numOfCPThresholds);
......
......@@ -51,7 +51,7 @@ const unsigned int CPMTobAlgorithm::m_tauLUT_EMIsolNBits = 6;
const unsigned int CPMTobAlgorithm::m_noIsol = 999;
LVL1::CPMTobAlgorithm::CPMTobAlgorithm( double eta, double phi, const std::map<int, xAOD::CPMTower *>* ttContainer,
LVL1::CPMTobAlgorithm::CPMTobAlgorithm( double eta, double phi, const xAOD::CPMTowerMap_t* ttContainer,
ServiceHandle<TrigConf::ITrigConfigSvc> config, int slice ):
m_configSvc(config),
m_Core(0),
......@@ -65,8 +65,8 @@ LVL1::CPMTobAlgorithm::CPMTobAlgorithm( double eta, double phi, const std::map<i
m_HadIsol(0),
m_EtMax(false),
m_EMThresh(false),
m_TauThresh(false),
m_debug(false)
m_TauThresh(false)
//m_debug(false)
{
/** RoI coordinates are centre of window, while key classes are designed
for TT coordinates - differ by 0.5* TT_size. Using wrong coordinate
......@@ -110,7 +110,7 @@ LVL1::CPMTobAlgorithm::CPMTobAlgorithm( double eta, double phi, const std::map<i
for (int phiOffset = -1; phiOffset <= 2; phiOffset++) {
double tempPhi = m_refPhi + phiOffset*M_PI/32;
int key = get.ttKey(tempPhi, tempEta);
std::map<int, xAOD::CPMTower*>::const_iterator tt = ttContainer->find(key);
xAOD::CPMTowerMap_t::const_iterator tt = ttContainer->find(key);
if (tt != ttContainer->end() && fabs(tempEta) < m_maxEta) {
// Get the TT ET values once here, rather than repeat function calls
int emTT = 0;
......
......@@ -25,7 +25,7 @@
LVL1::CoordToHardware::CoordToHardware():
m_cpmEtaWidth(0.4), m_cpmEtaMax(2.8),
m_cpFPGAPhiWidth(M_PI/16.0), m_cpEtaMax(2.5), m_jemEtaWidth(0.8),m_debug(false)
m_cpFPGAPhiWidth(M_PI/16.0), m_cpEtaMax(2.5), m_debug(false)
{
fillRoILocalMap();
}
......
......@@ -236,57 +236,57 @@ CrateEnergy::~CrateEnergy(){
}
/** return crate number */
unsigned int CrateEnergy::crate(){
unsigned int CrateEnergy::crate() const {
return m_crate;
}
/** return crate Et */
int CrateEnergy::et() {
int CrateEnergy::et() const {
return m_crateEt;
}
/** return crate Ex */
int CrateEnergy::ex() {
int CrateEnergy::ex() const {
return m_crateEx;
}
/** return crate Ey */
int CrateEnergy::ey() {
int CrateEnergy::ey() const {
return m_crateEy;
}
/** return Et overflow bit */
unsigned int CrateEnergy::etOverflow() {
unsigned int CrateEnergy::etOverflow() const {
return m_overflowT;
}
/** return Ex overflow bit */
unsigned int CrateEnergy::exOverflow() {
unsigned int CrateEnergy::exOverflow() const {
return m_overflowX;
}
/** return Ey overflow bit */
unsigned int CrateEnergy::eyOverflow() {
unsigned int CrateEnergy::eyOverflow() const {
return m_overflowY;
}
/** Full or Restricted eta range */
bool CrateEnergy::restricted() {
bool CrateEnergy::restricted() const {
return m_restricted;
}
/** return crate Ex in 15-bit twos-complement format (hardware format) */
unsigned int CrateEnergy::exTC() {
unsigned int CrateEnergy::exTC() const {
return encodeTC(m_crateEx);
}
/** return crate Ey in 15-bit twos-complement format (hardware format) */
unsigned int CrateEnergy::eyTC() {
unsigned int CrateEnergy::eyTC() const {
return encodeTC(m_crateEy);
}
/** encode int as 15-bit twos-complement format (hardware Ex/Ey format) */
unsigned int CrateEnergy::encodeTC(int input) {
unsigned int CrateEnergy::encodeTC(int input) const {
unsigned int value;
if (input > 0) {
......@@ -301,13 +301,13 @@ unsigned int CrateEnergy::encodeTC(int input) {
}
/** decode 15-bit twos-complement format (hardware Ex/Ey format) as int */
int CrateEnergy::decodeTC(unsigned int input) {
int CrateEnergy::decodeTC(unsigned int input) const {
int mask = (1<<m_sumBitsTC) - 1;
int value = input&mask;
if ((value >> (m_sumBitsTC - 1))) {
value += (-1) << m_sumBitsTC;
value += (~0U) << m_sumBitsTC;
}
return value;
......
......@@ -39,8 +39,8 @@ LVL1::JEMJetAlgorithm::JEMJetAlgorithm( double eta, double phi, const std::map<i
m_ET8x8(0),
m_ETLarge(0),
m_ETSmall(0),
m_EtMax(false),
m_debug(false)
m_EtMax(false)
//m_debug(false)
{
/** This could potentially be called with the coordinate being the centre <br>
of an RoI _or_ the centre of a JetElement. We want to ensure that we <br>
......
......@@ -262,47 +262,47 @@ void LVL1::JetAlgorithm::passesTrigger() {
// Public accessor methods follow
/** Returns RoI Core ET */
int LVL1::JetAlgorithm::Core() {
int LVL1::JetAlgorithm::Core() const {
return m_ET4x4;
}
/** Returns 4x4 TT cluster ET */
int LVL1::JetAlgorithm::ET4x4() {
int LVL1::JetAlgorithm::ET4x4() const {
return ( (m_ET4x4 < m_sat) ? m_ET4x4 : m_sat );
}
/** Returns 6x6 TT cluster ET */
int LVL1::JetAlgorithm::ET6x6() {
int LVL1::JetAlgorithm::ET6x6() const {
return ( (m_ET6x6 < m_sat) ? m_ET6x6 : m_sat );
}
/** Returns 8x8 TT cluster ET */
int LVL1::JetAlgorithm::ET8x8() {
int LVL1::JetAlgorithm::ET8x8() const {
return ( (m_ET8x8 < m_sat) ? m_ET8x8 : m_sat );
}
/** Does this window pass the local ET maximum condition */
bool LVL1::JetAlgorithm::isEtMax() {
bool LVL1::JetAlgorithm::isEtMax() const {
return m_EtMax;
}
/** Returns eta coordinate of RoI */
double LVL1::JetAlgorithm::eta() {
double LVL1::JetAlgorithm::eta() const {
return m_eta;
}
/** Returns phi coordinate of RoI, using standard ATLAS convention */
double LVL1::JetAlgorithm::phi() {
double LVL1::JetAlgorithm::phi() const {
return ( (m_phi <= M_PI) ? m_phi : m_phi - 2.*M_PI);
}
/** Returns hitword for this window */
unsigned int LVL1::JetAlgorithm::Hits() {
unsigned int LVL1::JetAlgorithm::Hits() const {
return m_Hits;
}
/** Returns RoI word for this window */
unsigned int LVL1::JetAlgorithm::RoIWord() {
unsigned int LVL1::JetAlgorithm::RoIWord() const {
unsigned int roiWord = (TrigT1CaloDefs::jetRoIType<<30) + (TrigT1CaloDefs::jetRoI<<29);
CoordToHardware convertor;
......@@ -317,7 +317,7 @@ unsigned int LVL1::JetAlgorithm::RoIWord() {
/** Returns a JetROI object summarising the results for this location */
JetROI* LVL1::JetAlgorithm::produceExternal(){
JetROI* LVL1::JetAlgorithm::produceExternal() const {
JetROI* temp=new JetROI(phi(), eta(), Core(), RoIWord(),
ET4x4(), ET6x6(), ET8x8(), 0);
......@@ -327,7 +327,7 @@ JetROI* LVL1::JetAlgorithm::produceExternal(){
}
/** returns true if this jet is a forward jet - i.e. has passed fwd jet thresholds */
bool LVL1::JetAlgorithm::isForwardJet() {
bool LVL1::JetAlgorithm::isForwardJet() const {
return ( (m_Hits & 0xf00) > 0 );
}
......
......@@ -190,7 +190,7 @@ Coordinate JetElementKeyBase::leftEta(const double phi, const double eta){
unsigned int reg=region(temp_eta);
// suppress leftEta in -ve region 5
unsigned int maxRegion=5+((temp_eta>0.0)? 0:-1);
if ( (reg==0) ){
if ( reg==0 ){
temp_eta-=m_regionWidth[0];
}else{
if ((reg==TrigT1CaloDefs::RegionError)||(reg>maxRegion)) {
......@@ -233,7 +233,7 @@ Coordinate JetElementKeyBase::rightEta(const double phi,const double eta){
unsigned int reg=region(temp_eta);
// supress rightEta in +ve region 5
unsigned int maxRegion=5+((temp_eta>0.0)? -1:0);
if ( (reg==0) ){
if ( reg==0 ){
temp_eta+=m_regionWidth[0];
}else{
if ((reg==TrigT1CaloDefs::RegionError)||(reg>maxRegion)) {
......@@ -263,7 +263,7 @@ Coordinate JetElementKeyBase::upPhi(const double phi, const double eta){
Coordinate centre=getCentre(phi,eta);
double temp_phi=centre.phi();
unsigned int reg=region(centre.eta());
if ((reg==TrigT1CaloDefs::RegionError)) {
if (reg==TrigT1CaloDefs::RegionError) {
// std::cout << "Out of bounds error in JetElementKeyBase::upPhi"<<std::endl;
temp_phi=0.0;
}else{
......@@ -290,7 +290,7 @@ Coordinate JetElementKeyBase::downPhi(const double phi, const double eta){
Coordinate centre=getCentre(phi,eta);
double temp_phi=centre.phi();
unsigned int reg=region(centre.eta());
if ((reg==TrigT1CaloDefs::RegionError)) {
if (reg==TrigT1CaloDefs::RegionError) {
// std::cout << "Out of bounds error in JetElementKeyBase::downPhi"<<std::endl;
temp_phi=0.0;
}else{
......@@ -361,7 +361,7 @@ Coordinate JetElementKeyBase::lowerRight(const Coordinate coord){
double JetElementKeyBase::dPhi(const double /*phi*/, const double eta) const {
unsigned int reg=region(eta);
if ((reg==TrigT1CaloDefs::RegionError)) return 0.0;
if (reg==TrigT1CaloDefs::RegionError) return 0.0;
return m_regionHeight[reg];
}
......@@ -378,7 +378,7 @@ double JetElementKeyBase::dPhi(const Coordinate& coord) const{
/**return width of JE at (phi,eta)*/
double JetElementKeyBase::dEta(const double /*phi*/, const double eta) const{
unsigned int reg=region(eta);
if ((reg==TrigT1CaloDefs::RegionError)) return 0.0;
if (reg==TrigT1CaloDefs::RegionError) return 0.0;
return m_regionWidth[reg];
}
......
......@@ -22,7 +22,7 @@
namespace LVL1 {
ModuleEnergy::ModuleEnergy(const std::map<int, xAOD::JetElement *>* JEContainer, unsigned int crate,
ModuleEnergy::ModuleEnergy(const xAOD::JetElementMap_t* JEContainer, unsigned int crate,
unsigned int module, int JEThresholdEtSum, int JEThresholdEtMiss, const std::map<int, int>* TEMasks, int slice):
m_jetElementThresholdEtSum(JEThresholdEtSum),
m_jetElementThresholdEtMiss(JEThresholdEtMiss),
......@@ -48,7 +48,7 @@ ModuleEnergy::ModuleEnergy(const std::map<int, xAOD::JetElement *>* JEContainer,
std::vector<unsigned int> keys = get.jeKeys(crate, module);
std::vector<unsigned int>::const_iterator it = keys.begin();
for (; it != keys.end(); it++) {
std::map<int, xAOD::JetElement*>::const_iterator test=JEContainer->find(*it);
xAOD::JetElementMap_t::const_iterator test=JEContainer->find(*it);
if (test != JEContainer->end()) {
/** Check JE not masked in TE trigger */
double eta = test->second->eta();
......@@ -148,30 +148,30 @@ ModuleEnergy::~ModuleEnergy(){
}
/** return crate number */
unsigned int ModuleEnergy::crate(){
unsigned int ModuleEnergy::crate() const {
return m_crate;
}
/** return module number */
unsigned int ModuleEnergy::module(){
unsigned int ModuleEnergy::module() const {
return m_module;
}
/** return Et, Ex, Ey sums of contained JEs (up to 32 JEs) */
unsigned int ModuleEnergy::et(){
unsigned int ModuleEnergy::et() const {
return m_Et;
}
unsigned int ModuleEnergy::ex(){
unsigned int ModuleEnergy::ex() const {
return m_Ex;
}
unsigned int ModuleEnergy::ey(){
unsigned int ModuleEnergy::ey() const {
return m_Ey;
}
/** return signs of Ex and Ey for this module */
int ModuleEnergy::signX() {
int ModuleEnergy::signX() const {
return m_signX;
}
int ModuleEnergy::signY() {
int ModuleEnergy::signY() const {
return m_signY;
}
......@@ -179,8 +179,8 @@ int ModuleEnergy::signY() {
void ModuleEnergy::getSinCos(double eta, double phi, int& cosPhi, int& sinPhi) {
/** Different phi granularities in central and forward calorimeters */
unsigned int m_SinCos[8] = {401,1187,1928,2594,3161,3607,3913,4070};
unsigned int m_fwdSinCos[4] = {794,2261,3384,3992};
unsigned int SinCos[8] = {401,1187,1928,2594,3161,3607,3913,4070};
unsigned int fwdSinCos[4] = {794,2261,3384,3992};
/** Each module spans 1 quadrant in phi. Hence want phi position relative to module edge */
float modPhi = fmod(phi, M_PI/2.);
......@@ -189,24 +189,24 @@ void ModuleEnergy::getSinCos(double eta, double phi, int& cosPhi, int& sinPhi) {
if (fabs(eta) < 3.2) {
int phiBin = (int)(modPhi*16/M_PI);
if (m_crate > 0) { /// Even quadrants, modPhi measured from horizontal
cosPhi = m_SinCos[phiBin];
sinPhi = m_SinCos[7-phiBin];
cosPhi = SinCos[phiBin];
sinPhi = SinCos[7-phiBin];
}
else { /// Odd quadrants, modPhi measured from vertical
cosPhi = m_SinCos[7-phiBin];
sinPhi = m_SinCos[phiBin];
cosPhi = SinCos[7-phiBin];
sinPhi = SinCos[phiBin];
}
}
/// Forward calorimeters
else {
int phiBin = (int)(modPhi*8/M_PI);
if (m_crate > 0) {
cosPhi = m_fwdSinCos[phiBin];
sinPhi = m_fwdSinCos[3-phiBin];
cosPhi = fwdSinCos[phiBin];
sinPhi = fwdSinCos[3-phiBin];
}
else {
cosPhi = m_fwdSinCos[3-phiBin];
sinPhi = m_fwdSinCos[phiBin];
cosPhi = fwdSinCos[3-phiBin];
sinPhi = fwdSinCos[phiBin];
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment