CMS 3D CMS Logo

CaloTowerTopology Class Reference

Date
2006/08/29 12:33:05
Revision
1.4
More...

#include <Geometry/CaloTopology/interface/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
 Get the neighbors of the given cell in down direction (inward).
virtual std::vector< DetIdeast (const DetId &id) const
 Get the neighbors of the given cell in east direction.
virtual std::vector< DetIdnorth (const DetId &id) const
 Get the neighbors of the given cell in north direction.
virtual std::vector< DetIdsouth (const DetId &id) const
 Get the neighbors of the given cell in south direction.
virtual std::vector< DetIdup (const DetId &id) const
 Get the neighbors of the given cell in up direction (outward).
virtual bool valid (const DetId &id) const
 is this detid present in the Topology?
virtual std::vector< DetIdwest (const DetId &id) const
 Get the neighbors of the given cell in west direction.
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.

00015 {}

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

virtual destructor

Definition at line 17 of file CaloTowerTopology.h.

00017 { }


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 108 of file CaloTowerTopology.cc.

00108                                                               {
00109   return std::vector<DetId>();
00110 }

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 dd, DoubleHE, CaloTowerDetId::ieta(), CaloTowerDetId::iphi(), and QuadHF.

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

00013                                                               {
00014   std::vector<DetId> dd;
00015   CaloTowerDetId tid(id);
00016   int ieta=tid.ieta();
00017   int iphi=tid.iphi();
00018 
00019   if (ieta==1) ieta=-1;
00020   else if (ieta==DoubleHE) {
00021     ieta--;
00022     dd.push_back(CaloTowerDetId(ieta,iphi+1));    
00023   } else if (ieta-1==-DoubleHE) {
00024     if ((iphi%2)==0) iphi--;
00025     ieta--;
00026   } else if (ieta==QuadHF) {
00027     ieta--;
00028     dd.push_back(CaloTowerDetId(ieta,((iphi+1)%72)+1));    
00029   } else if (ieta-1==-QuadHF) {
00030     if (((iphi-1)%4)==0) 
00031       if (iphi==1) iphi=71;
00032       else iphi-=2;
00033     ieta--;
00034   } else ieta--;
00035 
00036   if (ieta>=-41) 
00037     dd.push_back(CaloTowerDetId(ieta,iphi));
00038   return dd;
00039 }

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 71 of file CaloTowerTopology.cc.

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

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

00071                                                                {
00072   CaloTowerDetId tid(id);
00073   int iphi_n=tid.iphi()+1;
00074   if (iphi_n>72) iphi_n=1;
00075   if (tid.ietaAbs()>=DoubleHE && (iphi_n%2)==0) {
00076     iphi_n++;
00077     if (iphi_n>72) iphi_n-=72;
00078   }
00079   if (tid.ietaAbs()>=QuadHF) {
00080     iphi_n+=3;
00081     if (iphi_n>72) iphi_n-=72;
00082   }
00083 
00084   std::vector<DetId> dd;
00085   dd.push_back(CaloTowerDetId(tid.ieta(),iphi_n));
00086   return dd;
00087 }

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 89 of file CaloTowerTopology.cc.

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

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

00089                                                                {
00090   CaloTowerDetId tid(id);
00091   int iphi_s=tid.iphi()-1;
00092   if (iphi_s==0) iphi_s=72;
00093   if (tid.ietaAbs()>=DoubleHE && (iphi_s%2)==0) iphi_s--;
00094   if (tid.ietaAbs()>=QuadHF) {
00095     iphi_s-=3;
00096     if (iphi_s<=0) iphi_s+=72;
00097   }
00098 
00099   std::vector<DetId> dd;
00100   dd.push_back(CaloTowerDetId(tid.ieta(),iphi_s));
00101   return dd;
00102 }

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 104 of file CaloTowerTopology.cc.

00104                                                             {
00105   return std::vector<DetId>();
00106 }

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 CaloTowerDetId::ieta(), and CaloTowerDetId::iphi().

00007                                                    {
00008   CaloTowerDetId tid(id);
00009   bool bad=(tid.ieta()==0 || tid.iphi()<=0 || tid.iphi()>72 || tid.ieta()<-41 || tid.ieta()>41);
00010   return !bad;
00011 }

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 41 of file CaloTowerTopology.cc.

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

Referenced by CaloRecoTauAlgorithm::getCaloTowerneighbourDetIds().

00041                                                               {
00042   std::vector<DetId> dd;
00043   CaloTowerDetId tid(id);
00044 
00045   int ieta=tid.ieta();
00046   int iphi=tid.iphi();
00047 
00048   if (ieta==-1) ieta=1;
00049   else if (ieta==-DoubleHE) {
00050     ieta++;
00051     dd.push_back(CaloTowerDetId(ieta,iphi+1));    
00052   } else if (ieta+1==DoubleHE) {
00053     if ((iphi%2)==0) iphi--;
00054     ieta++;
00055   } else if (ieta==-QuadHF) {
00056     ieta++;
00057     dd.push_back(CaloTowerDetId(ieta,((iphi+1)%72)+1));    
00058   } else if (ieta+1==QuadHF) {
00059     if (((iphi-1)%4)==0) 
00060       if (iphi==1) iphi=71;
00061       else iphi-=2;
00062     ieta++;
00063   } else ieta++;
00064 
00065   if (ieta<=41) 
00066     dd.push_back(CaloTowerDetId(ieta,iphi));
00067 
00068   return dd;
00069 }


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:16:02 2009 for CMSSW by  doxygen 1.5.4