00001 #ifndef FASTSHOWER_DEPOSITS_H 00002 #define FASTSHOWER_DEPOSITS_H 00003 00006 #ifndef STD_VECTOR_H 00007 #define STD_VECTOR_H 00008 #include <vector> 00009 #endif 00010 00011 #ifndef FASTSHOWER_IDEPOSITS_H 00012 #include "FastShowerUtils/IDeposits.h" 00013 #endif 00014 00015 #ifndef STD_ASSERT_H 00016 #define STD_ASSERT_H 00017 #include <assert.h> 00018 #endif 00019 00020 #ifndef STD_ALGORITHM_H 00021 #define STD_ALGORITHM_H 00022 #include <algorithm> 00023 #endif 00024 00025 namespace FastShower{ 00031 00032 class Scale{ 00033 public: 00034 Scale(double sf): m_scaleFactor(sf){} 00035 double operator()(double x){return x*m_scaleFactor;} 00036 private: 00037 double m_scaleFactor; 00038 }; 00041 template<class T, int hDimension> 00042 class Deposits: public IDeposits{ 00043 public: 00044 typedef typename std::vector<T>::iterator Iter; 00045 typedef typename std::vector<T>::const_iterator ConstIter; 00046 Deposits(); 00047 ~Deposits(){}; 00049 void normalise(double); 00051 void accept(int eta, int phi, double e); 00053 void reset(); 00056 ConstIter begin() const; 00057 ConstIter end() const; 00058 // 00059 std::size_t dimension() const; 00060 std::size_t nElements() const; 00061 private: 00063 static const int s_dimension; 00064 static const int s_center; 00065 static const int s_nElements; 00066 00067 std::vector<T> m_elements; 00069 int index(int eta, int phi); 00070 ; 00071 }; 00072 #ifndef FASTSHOWER_DEPOSITS_CXX 00073 #include "FastShowerUtils/TemplateImplementation/Deposits.cxx" 00074 #endif 00075 } 00076 #endif 00077 00078 00079 00080 00081 00082 00083 00084