1
0
Fork 0
This repository has been archived on 2021-11-03. You can view files and clone it, but cannot push or open issues or pull requests.
uni-m.cds-adv-prog/ex4.2/CaloCell.hh

32 lines
580 B
C++
Raw Normal View History

2019-12-17 15:05:27 +01:00
//CaloCell.hh
#ifndef CALOCELL_HH
#define CALOCELL_HH
class CaloCell
{
public:
CaloCell() { init( 0, 0 ); }
CaloCell( double energy, int ID ) {
init( energy, ID );
}
// No need for Constructor or Destructor
double getEnergy() const { return energy; }
bool setEnergy( double new_energy ) { return (energy = new_energy) ; }
int getId() const { return ID ; }
bool setId( int new_id ) { return ( ID = new_id ) ; }
private:
void init( double init_energy, int ID )
{
setEnergy( init_energy );
setId( ID );
}
int ID ;
double energy ;
};
#endif