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.
2019-12-17 15:05:27 +01:00
|
|
|
//CaloGrid.cc
|
|
|
|
#include <iostream>
|
|
|
|
#include "CaloGrid.hh"
|
|
|
|
|
2020-07-01 16:53:27 +02:00
|
|
|
CaloCell* CaloGrid::cell( int x, int y ) {
|
|
|
|
if ( x >= nx or x < 0 ) {
|
2019-12-17 15:05:27 +01:00
|
|
|
std::cout << "CaloGrid::cell() Error: out of grid (x)" << std::endl ;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2020-07-01 16:53:27 +02:00
|
|
|
if ( y >= ny or y < 0 ) {
|
2019-12-17 15:05:27 +01:00
|
|
|
std::cout << "CaloGrid::cell() Error: out of grid (y)" << std::endl ;
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
2020-06-30 14:00:21 +02:00
|
|
|
return &cells[ x*nx + y ] ;
|
2019-12-17 15:05:27 +01:00
|
|
|
}
|
|
|
|
|