CMS 3D CMS Logo

Public Member Functions

CaloTowerTopology Class Reference

#include <CaloTowerTopology.h>

Inheritance diagram for CaloTowerTopology:
CaloSubdetectorTopology

List of all members.

Public Member Functions

 CaloTowerTopology ()
 standard constructor
virtual std::vector< DetIddown (const DetId &id) const
virtual std::vector< DetIdeast (const DetId &id) const
virtual std::vector< DetIdnorth (const DetId &id) const
virtual std::vector< DetIdsouth (const DetId &id) const
virtual std::vector< DetIdup (const DetId &id) const
virtual bool valid (const DetId &id) const
 is this detid present in the Topology?
virtual std::vector< DetIdwest (const DetId &id) const
virtual ~CaloTowerTopology ()
 virtual destructor

Detailed Description

Date:
2006/08/29 12:33:05
Revision:
1.4
Author:
J. Mans - Minnesota

Definition at line 12 of file CaloTowerTopology.h.


Constructor & Destructor Documentation

CaloTowerTopology::CaloTowerTopology ( ) [inline]

standard constructor

Definition at line 15 of file CaloTowerTopology.h.

{}
virtual CaloTowerTopology::~CaloTowerTopology ( ) [inline, virtual]

virtual destructor

Definition at line 17 of file CaloTowerTopology.h.

{ }

Member Function Documentation

std::vector< DetId > CaloTowerTopology::down ( const DetId id) const [virtual]

Get the neighbors of the given cell in down direction (inward)

Implements CaloSubdetectorTopology.

Definition at line 114 of file CaloTowerTopology.cc.

                                                              {
  return std::vector<DetId>();
}
std::vector< DetId > CaloTowerTopology::east ( const DetId id) const [virtual]

Get the neighbors of the given cell in east direction

Implements CaloSubdetectorTopology.

Definition at line 13 of file CaloTowerTopology.cc.

References createTree::dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

                                                              {
  std::vector<DetId> dd;
  CaloTowerDetId tid(id);
  int ieta=tid.ieta();
  int iphi=tid.iphi();

  if (ieta==1) {
    ieta=-1;
  } else if (ieta==DoubleHE) {
    ieta--;
    dd.push_back(CaloTowerDetId(ieta,iphi+1));    
  } else if (ieta-1==-DoubleHE) {
    if ((iphi%2)==0) iphi--;
    ieta--;
  } else if (ieta==QuadHF) {
    ieta--;
    dd.push_back(CaloTowerDetId(ieta,((iphi+1)%72)+1));    
  } else if (ieta-1==-QuadHF) {
    if (((iphi-1)%4)==0) {
      if (iphi==1) iphi=71;
      else         iphi-=2;
    }
    ieta--;
  } else {
    ieta--;
  }

  if (ieta>=-41) dd.push_back(CaloTowerDetId(ieta,iphi));
  return dd;
}
std::vector< DetId > CaloTowerTopology::north ( const DetId id) const [virtual]

Get the neighbors of the given cell in north direction

Implements CaloSubdetectorTopology.

Definition at line 77 of file CaloTowerTopology.cc.

References createTree::dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

                                                               {
  CaloTowerDetId tid(id);
  int iphi_n=tid.iphi()+1;
  if (iphi_n>72) iphi_n=1;
  if (tid.ietaAbs()>=QuadHF) {
    iphi_n+=3;
    if (iphi_n>72) iphi_n-=72;
  } else if (tid.ietaAbs()>=DoubleHE && (iphi_n%2)==0) {
    iphi_n++;
    if (iphi_n>72) iphi_n-=72;
  }

  std::vector<DetId> dd;
  dd.push_back(CaloTowerDetId(tid.ieta(),iphi_n));
  return dd;
}
std::vector< DetId > CaloTowerTopology::south ( const DetId id) const [virtual]

Get the neighbors of the given cell in south direction

Implements CaloSubdetectorTopology.

Definition at line 94 of file CaloTowerTopology.cc.

References createTree::dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::ietaAbs(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

                                                               {
  CaloTowerDetId tid(id);
  int iphi_s=tid.iphi()-1;
  if (iphi_s==0) iphi_s=72;
  if (tid.ietaAbs()>=QuadHF) {
    iphi_s-=3;
    if (iphi_s<=0) iphi_s+=72;
  } else if (tid.ietaAbs()>=DoubleHE && (iphi_s%2)==0) {
    iphi_s--;
  }

  std::vector<DetId> dd;
  dd.push_back(CaloTowerDetId(tid.ieta(),iphi_s));
  return dd;
}
std::vector< DetId > CaloTowerTopology::up ( const DetId id) const [virtual]

Get the neighbors of the given cell in up direction (outward)

Implements CaloSubdetectorTopology.

Definition at line 110 of file CaloTowerTopology.cc.

                                                            {
  return std::vector<DetId>();
}
bool CaloTowerTopology::valid ( const DetId id) const [virtual]

is this detid present in the Topology?

Reimplemented from CaloSubdetectorTopology.

Definition at line 7 of file CaloTowerTopology.cc.

References cond::ecalcond::bad(), CaloTowerDetId::ieta(), and CaloTowerDetId::iphi().

                                                   {
  CaloTowerDetId tid(id);
  bool bad=(tid.ieta()==0 || tid.iphi()<=0 || tid.iphi()>72 || tid.ieta()<-41 || tid.ieta()>41);
  return !bad;
}
std::vector< DetId > CaloTowerTopology::west ( const DetId id) const [virtual]

Get the neighbors of the given cell in west direction

Implements CaloSubdetectorTopology.

Definition at line 44 of file CaloTowerTopology.cc.

References createTree::dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

                                                              {
  std::vector<DetId> dd;
  CaloTowerDetId tid(id);

  int ieta=tid.ieta();
  int iphi=tid.iphi();

  if (ieta==-1) {
    ieta=1;
  } else if (ieta==-DoubleHE) {
    ieta++;
    dd.push_back(CaloTowerDetId(ieta,iphi+1));    
  } else if (ieta+1==DoubleHE) {
    if ((iphi%2)==0) iphi--;
    ieta++;
  } else if (ieta==-QuadHF) {
    ieta++;
    dd.push_back(CaloTowerDetId(ieta,((iphi+1)%72)+1));    
  } else if (ieta+1==QuadHF) {
    if (((iphi-1)%4)==0) {
      if (iphi==1) iphi=71;
      else         iphi-=2;
    }
    ieta++;
  } else {
    ieta++;
  }

  if (ieta<=41) dd.push_back(CaloTowerDetId(ieta,iphi));

  return dd;
}