Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

EmcStructure Class Reference

#include <EmcStructure.h>

List of all members.

Public Member Functions

unsigned int crystalsInRing (unsigned int theta) const
unsigned int crystalsInRing (unsigned int theta) const
 EmcStructure ()
 EmcStructure ()
int getGeomIndex (unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const
int getGeomIndex (unsigned int PartId, unsigned int ThetaIndex, unsigned int PhiIndex) const
long getIndex (unsigned int thetaIndex, unsigned int phiIndex) const
long getIndex (unsigned int thetaIndex, unsigned int phiIndex) const
unsigned int getNumberOfTheRings ()
unsigned int getNumberOfTheRings ()
unsigned int getNumberOfXtals ()
unsigned int getNumberOfXtals ()
unsigned int getPartId (long Index) const
unsigned int getPartId (long Index) const
unsigned int getPhi (long Index) const
unsigned int getPhi (long Index) const
unsigned int getTheta (long Index) const
unsigned int getTheta (long Index) const
long getThisThetaMaxIndex (int Theta) const
long getThisThetaMaxIndex (int Theta) const
bool isOutofAccep (unsigned int thetaIndex, unsigned int phiIndex) const
bool isOutofAccep (unsigned int thetaIndex, unsigned int phiIndex) const
void setEmcStruc ()
void setEmcStruc ()
unsigned int startingTheta ()
unsigned int startingTheta ()
 ~EmcStructure ()
 ~EmcStructure ()

Private Attributes

EmcIDaEmcId
EmcIDaEmcId
unsigned int m_partID [6240]
unsigned int m_phiIndex [6240]
unsigned int m_thetaIndex [6240]
long m_ThetaMaxIndex [56]

Static Private Attributes

const unsigned int numberOfOneEndcapRings = 2
const unsigned int numberOfThreeEndcapRings = 2
const unsigned int numberOfTwoEndcapRings = 2


Constructor & Destructor Documentation

EmcStructure::EmcStructure  ) 
 

00012 {
00013 
00014 }

EmcStructure::~EmcStructure  ) 
 

00020 {
00021 }

EmcStructure::EmcStructure  ) 
 

EmcStructure::~EmcStructure  ) 
 


Member Function Documentation

unsigned int EmcStructure::crystalsInRing unsigned int  theta  )  const
 

unsigned int EmcStructure::crystalsInRing unsigned int  theta  )  const
 

00152 {
00153   //The theta index is defined by Endcap_east(0-5),Barrel(6-49),Endcap_west(50-55)
00154   //in Emc Bhabha Calibration
00155   unsigned int theXtalInRing;
00156 
00157   if (theta==0 || theta==1 || theta==55 || theta==54) 
00158     {
00159       theXtalInRing= aEmcId->getPHI_ENDCAP_MAX(0)+1;
00160     }
00161 
00162   if (theta==2 || theta==3 || theta==53 || theta==52) 
00163     {
00164       theXtalInRing=aEmcId->getPHI_ENDCAP_MAX(2)+1;
00165     }
00166 
00167   if (theta==4 || theta==5 || theta==51 || theta==50) 
00168     {
00169       theXtalInRing=aEmcId->getPHI_ENDCAP_MAX(4)+1;
00170     }
00171 
00172   if (theta>=6 && theta<=49) 
00173     {
00174       theXtalInRing=aEmcId->getPHI_BARREL_MAX()+1;
00175     }
00176 
00177   //  if (theta<0 || theta>55) theXtalInRing= 0;
00178   if (theta>55) 
00179     {
00180       theXtalInRing= 0;
00181     }
00182 
00183   return theXtalInRing;
00184 }

int EmcStructure::getGeomIndex unsigned int  PartId,
unsigned int  ThetaIndex,
unsigned int  PhiIndex
const
 

int EmcStructure::getGeomIndex unsigned int  PartId,
unsigned int  ThetaIndex,
unsigned int  PhiIndex
const
 

00056 {
00057   if (PartId>2){
00058     cout<<"PartId is out of EMC"<<endl;
00059     return -1;
00060   } else {
00061     unsigned int newThetaIndex;
00062     //The newThetaIndex is defined by Endcap_east(0-5),Barrel(6-49),Endcap_west(50-55)
00063     if (PartId==0) newThetaIndex = ThetaIndex;
00064     if (PartId==1) newThetaIndex = ThetaIndex + 6;
00065     if (PartId==2) newThetaIndex = 55 - ThetaIndex;
00066     
00067     if ( isOutofAccep(newThetaIndex, PhiIndex) ) 
00068       {
00069         return -1;
00070       } else {
00071       
00072         int index;   
00073         index = getIndex(newThetaIndex,PhiIndex);
00074       
00075         return index;
00076       }
00077   }
00078 }

long EmcStructure::getIndex unsigned int  thetaIndex,
unsigned int  phiIndex
const
 

long EmcStructure::getIndex unsigned int  thetaIndex,
unsigned int  phiIndex
const
 

00082 {
00083   long index = -1;
00084   if(thetaIndex==0){
00085     index=phiIndex;
00086   } else {
00087     index = getThisThetaMaxIndex( thetaIndex-1 ) +1 + phiIndex;
00088   }
00089   return index;
00090 }

unsigned int EmcStructure::getNumberOfTheRings  ) 
 

unsigned int EmcStructure::getNumberOfTheRings  ) 
 

00125 {  
00126   unsigned int numberOfTheRings=0;
00127   numberOfTheRings  = (aEmcId->getTHETA_BARREL_MAX() + 1) 
00128     + (aEmcId->getTHETA_ENDCAP_MAX() + 1 ) * 2;
00129   
00130   return  numberOfTheRings;
00131   
00132 }

unsigned int EmcStructure::getNumberOfXtals  ) 
 

unsigned int EmcStructure::getNumberOfXtals  ) 
 

00135 {
00136   unsigned int numberOfXtals=0;
00137   unsigned int numberOfBarrelXtals, numberOfEndcapXtals;
00138 
00139   numberOfEndcapXtals = numberOfOneEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(0)+1)
00140     + numberOfTwoEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(2)+1)
00141     + numberOfThreeEndcapRings * (aEmcId->getPHI_ENDCAP_MAX(4)+1);
00142 
00143   numberOfBarrelXtals = (aEmcId->getTHETA_BARREL_MAX()+1)*(aEmcId->getPHI_BARREL_MAX()+1);
00144   
00145   numberOfXtals = numberOfBarrelXtals + numberOfEndcapXtals * 2;
00146   
00147   return numberOfXtals;
00148 }

unsigned int EmcStructure::getPartId long  Index  )  const [inline]
 

00035 {return m_partID[Index];}

unsigned int EmcStructure::getPartId long  Index  )  const [inline]
 

00035 {return m_partID[Index];}

unsigned int EmcStructure::getPhi long  Index  )  const [inline]
 

00037 {return m_phiIndex[Index];}

unsigned int EmcStructure::getPhi long  Index  )  const [inline]
 

00037 {return m_phiIndex[Index];}

unsigned int EmcStructure::getTheta long  Index  )  const [inline]
 

00036 {return m_thetaIndex[Index];}

unsigned int EmcStructure::getTheta long  Index  )  const [inline]
 

00036 {return m_thetaIndex[Index];}

long EmcStructure::getThisThetaMaxIndex int  Theta  )  const [inline]
 

00034 {return m_ThetaMaxIndex[Theta];}

long EmcStructure::getThisThetaMaxIndex int  Theta  )  const [inline]
 

00034 {return m_ThetaMaxIndex[Theta];}

bool EmcStructure::isOutofAccep unsigned int  thetaIndex,
unsigned int  phiIndex
const
 

bool EmcStructure::isOutofAccep unsigned int  thetaIndex,
unsigned int  phiIndex
const
 

00095 {
00096   if ( thetaIndex > 55 ) 
00097     {
00098       cout<<"warning " << " theta out of acceptance !"
00099           << endl;
00100       return true;  
00101       
00102     } 
00103   else 
00104     {
00105       if ( ((thetaIndex==0 || thetaIndex==1 || thetaIndex==55 || thetaIndex==54)
00106             && (phiIndex > 63))
00107            || ((thetaIndex==2 || thetaIndex==3 || thetaIndex==53 || thetaIndex==52)
00108                && (phiIndex > 79))
00109            || ((thetaIndex==4 || thetaIndex==5 || thetaIndex==51 || thetaIndex==50)
00110                && ( phiIndex > 95))
00111            || ((thetaIndex>=6 && thetaIndex<=49) && ( phiIndex > 119)) ) 
00112         {      
00113           cout<<"warning "<< " phi out of acceptance !" << endl;
00114           return true;    
00115         }  
00116       else 
00117         {
00118           return false;
00119         } 
00120     }
00121 }

void EmcStructure::setEmcStruc  ) 
 

void EmcStructure::setEmcStruc  ) 
 

00024 {
00025   int index;
00026   int nrOfTheRings = getNumberOfTheRings();
00027   for ( int the = startingTheta(); the< nrOfTheRings; the++) {
00028        
00029     for ( int phi=0; phi < crystalsInRing((unsigned int) the ); phi++) {
00030       
00031       index = getIndex( (unsigned int)the , (unsigned int)phi);
00032 
00033       m_phiIndex[index]=phi;
00034       if (the>=0 && the<=5) {
00035         m_partID[index]=0;
00036         m_thetaIndex[index]=the;
00037       }
00038       if (the>=6 && the<=49) {
00039         m_partID[index]=1;
00040         m_thetaIndex[index]=the-6;
00041       }
00042       if (the>=50 && the<=55){ 
00043         m_partID[index]=2;
00044         m_thetaIndex[index]=55 - the;
00045       }
00046 
00047     }
00048     m_ThetaMaxIndex[the]=index;
00049   }
00050 
00051 }

unsigned int EmcStructure::startingTheta  )  [inline]
 

00026 {return 0;}

unsigned int EmcStructure::startingTheta  )  [inline]
 

00026 {return 0;}


Member Data Documentation

EmcID* EmcStructure::aEmcId [private]
 

EmcID* EmcStructure::aEmcId [private]
 

unsigned int EmcStructure::m_partID [private]
 

unsigned int EmcStructure::m_phiIndex [private]
 

unsigned int EmcStructure::m_thetaIndex [private]
 

long EmcStructure::m_ThetaMaxIndex [private]
 

const unsigned int EmcStructure::numberOfOneEndcapRings = 2 [static, private]
 

const unsigned int EmcStructure::numberOfThreeEndcapRings = 2 [static, private]
 

const unsigned int EmcStructure::numberOfTwoEndcapRings = 2 [static, private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:02:18 2011 for BOSS6.5.5 by  doxygen 1.3.9.1