#include "example/test1.hpp" #include "example/test2.hpp" #include #include #include #include using namespace edm; using std::cout; test2::test2() { _Cells.clear(); RCPManager* rcpman=RCPManager::instance(); RCP rcpFile=rcpman->extract("example","test2"); if (rcpFile.getString("rcpName")!="test2") { cout << "Couldn't find rcp file for example-test2!"; _Threshold=0.; } else { _Threshold=rcpFile.getFloat("Threshold"); } } void test2::addCell(test1* cell) { _Cells.push_back(*cell); } float test2::CalcET() { float ET=0.; for (std::vector::iterator i=_Cells.begin(); i!=_Cells.end();i++) { if (i->getE()>_Threshold) { ET+=i->getET(); } } return (ET); } int test2::NCells() { int n=0; for (std::vector::iterator i=_Cells.begin(); i!=_Cells.end();i++) { if (i->getE()>_Threshold) n++; } return (n); }