////////////////////////////////////////////////////////////////////////// // // Component: PhysicsTowerParams.cc // Purpose: This is a simple class that holds // the parameters used to make a // PhysicsTowerData object // // Created: 08/11/99 Pierre Savard // History: 01/05/03 Dan MacQueen - changes made to allow three-vertex & // beam slope to be used as parameters. // ////////////////////////////////////////////////////////////////////////// #include #include "CalorObjects/PhysicsTowerParams.hh" using namespace std; // namespace calor { // // Memory management // // PhysicsTowerParams::PhysicsTowerParams(): _inputType(0), _calculatorType(0), // _calcThreshold(0.1), _vertex(0.0, 0.0, 0.0),_slope(0.0, 0.0), _inputID(0), // _jetSeedThreshold(0.0) {} PhysicsTowerParams::PhysicsTowerParams(): _inputType(0), _calculatorType(0), _calcThreshold(0.1), _vertex(),_slope(), _inputID(0), _jetSeedThreshold(0.0) { _vertex[0] = 0.0; _vertex[1] = 0.0; _vertex[2] = 0.0; _slope[0] = 0.0; _slope[1] = 0.0; //Others should be initialized already } PhysicsTowerParams::PhysicsTowerParams(int inputType , int calculatorType, float calcThreshold, float vertex){ _inputType = inputType; _inputID = 0; _calculatorType = calculatorType; _calcThreshold = calcThreshold; _vertex[0] = 0.0; _vertex[1] = 0.0; _vertex[2] = vertex; _slope[0] = 0.0; _slope[1] = 0.0; _jetSeedThreshold = 0; } PhysicsTowerParams::PhysicsTowerParams(int inputType , int calculatorType, float calcThreshold, float vertex, Id inputID){ _inputType = inputType; _inputID = inputID; _calculatorType = calculatorType; _calcThreshold = calcThreshold; _vertex[0] = 0.0; _vertex[1] = 0.0; _vertex[2] = vertex; _slope[0] = 0.0; _slope[1] = 0.0; _jetSeedThreshold = 0; } PhysicsTowerParams::PhysicsTowerParams(std::string inputType, std::string calculatorType, float calcThreshold, float vertex){ _inputID = 0; _inputType =0; if(inputType == "HEPG") _inputType = 1; _calculatorType = 0; if(calculatorType == "FourVector") _calculatorType = 1; if(calculatorType == "Met") _calculatorType = 2; _calcThreshold = calcThreshold; _vertex[0] = 0.0; _vertex[1] = 0.0; _vertex[2] = vertex; _slope[0] = 0.0; _slope[1] = 0.0; _jetSeedThreshold = 0; } PhysicsTowerParams::PhysicsTowerParams(int inputType , int calculatorType, float calcThreshold, float vertex[3], float slope[2]){ _inputType = inputType; _inputID = 0; _calculatorType = calculatorType; _calcThreshold = calcThreshold; _vertex[0] = vertex[0]; _vertex[1] = vertex[1]; _vertex[2] = vertex[2]; _slope[0] = slope[0]; _slope[1] = slope[1]; _jetSeedThreshold = 0; } PhysicsTowerParams::PhysicsTowerParams(int inputType , int calculatorType, float calcThreshold, float vertex[3], float slope[2], Id inputID){ _inputType = inputType; _inputID = inputID; _calculatorType = calculatorType; _calcThreshold = calcThreshold; _vertex[0] = vertex[0]; _vertex[1] = vertex[1]; _vertex[2] = vertex[2]; _slope[0] = slope[0]; _slope[1] = slope[1]; _jetSeedThreshold = 0; } PhysicsTowerParams::PhysicsTowerParams(std::string inputType, std::string calculatorType, float calcThreshold, float vertex[3], float slope[2]){ _inputID = 0; _inputType =0; if(inputType == "HEPG") _inputType = 1; _calculatorType = 0; if(calculatorType == "FourVector") _calculatorType = 1; if(calculatorType == "Met") _calculatorType = 2; _calcThreshold = calcThreshold; _vertex[0] = vertex[0]; _vertex[1] = vertex[1]; _vertex[2] = vertex[2]; _slope[0] = slope[0]; _slope[1] = slope[1]; _jetSeedThreshold = 0; } std::string PhysicsTowerParams::inputName() const { if(_inputType == 0) return std::string("CalData"); if(_inputType == 1) return std::string("HEPG"); return std::string("Undefined"); } std::string PhysicsTowerParams::calculatorName() const { if(_calculatorType == 0) return std::string("Standard"); if(_calculatorType == 1) return std::string("FourVector"); if(_calculatorType == 2) return std::string("Met"); return std::string("Undefined"); } // // Printing // ostream& operator<<(std::ostream& os, const PhysicsTowerParams& p) { os << " PhysicsTowerParms input type = " << p._inputType; os << " PhysicsTowerParms input ID = " << p._inputID; os << " PhysicsTowerParms calculator type = " << p._calculatorType; os << " PhysicsTowerParms calculator threshold = " << p._calcThreshold; os << " PhysicsTowerParms jet seed threshold = " << p._jetSeedThreshold; os << " PhysicsTowerParms X-vertex = " << p._vertex[0]; os << " PhysicsTowerParms Y-vertex = " << p._vertex[1]; os << " PhysicsTowerParms Z-vertex = " << p._vertex[2]; os << " PhysicsTowerParms X-slope = " << p._slope[0]; os << " PhysicsTowerParms Y-slope = " << p._slope[1]; return os; } // } // namespace calor