#include "CalHit.h"


///////////////////////////////////////////////////////////////////////////
//                                                                       
// CalHit                                                                
// The CalHit class contains the information about a single calorimeter  
// tower. This includes the towerID tag, the total energy in the tower,  
// and the list of particles which deposited energy in the tower and how 
// much energy they deposited.                                           
//                                                                       
///////////////////////////////////////////////////////////////////////////

ClassImp(CalHit)

Float_t* CalHit::energyScale = 0;
Float_t* CalHit::phiSeg = 0;
Float_t* CalHit::cosThetaSeg = 0;

///________________________________________________________________________
 CalHit::CalHit(){
  // Default constructor
  m_Etot = 0;
  m_tower = 0;
}
///________________________________________________________________________
 CalHit::CalHit(towerID* tower){
  // Create a CalHit object with towerID of tower
  m_Etot = 0;
  m_tower = tower;
}
//_________________________________________________________________________
 CalHit::~CalHit(){
  // Destructor, calls Clean to remove TObjArrays.
  Clean();
}
//_________________________________________________________________________
 void CalHit::Clean(){
  // Make sure there are no memory leaks
  m_MCE.Delete();
  delete m_tower;
}
//_________________________________________________________________________
 Float_t CalHit::AddE(Float_t hit){
  // Function to increment the total energy in the tower 
  // and return the new total
  m_Etot += hit;
  return m_Etot;
}
//_________________________________________________________________________
 void CalHit::AddHit(EDeposit* EDep){
  // Add a hit to the list
  //  AddE(EDep->GetEDeposit());
  m_Etot += EDep->GetEDeposit();
  m_MCE.Add(EDep);
}
//_________________________________________________________________________
 Float_t CalHit::GetEscale(){
  // get energy scale factor
 
	return energyScale[m_tower->system()];
};
//_________________________________________________________________________
 Float_t CalHit::GetcosThetaSeg(){
  // get segementation in cos(theta)

	return cosThetaSeg[m_tower->system()];
};
//_________________________________________________________________________
 Float_t CalHit::GetphiSeg(){
  // get segementation in phi

	return phiSeg[m_tower->system()];
};
//_________________________________________________________________________
 Float_t CalHit::GetEtot(){
  // get total energy in GeV         

	return GetEscale()*m_Etot;
};
//_________________________________________________________________________
 Float_t CalHit::GetcosTheta(){
  // convert bin to polar angle

	return 1.-GetcosThetaSeg()*(0.5+m_tower->theta());
};
//_________________________________________________________________________
 Float_t CalHit::Getphi(){
  // convert bin to azimuthal angle

	return GetphiSeg()*(0.5+m_tower->phi());
};


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.