00001
00002
00003 #ifndef RECO_CSI_DATA_H
00004 #define RECO_CSI_DATA_H 1
00005
00006 #include "data/CsIData.h"
00007
00008 #include "idents/XtalId.h"
00009 #include "idents/ModuleId.h"
00010 #include "geometry/Point.h"
00011
00012 #include <iostream>
00013 #include <map>
00014 #include <vector>
00015
00016
00017 class CsIDetector;
00018
00019
00020
00025 class RecoCsIData : public CsIData
00026 {
00027 public:
00028 RecoCsIData (int numLayers);
00029 ~RecoCsIData ();
00030
00032 void printOn(std::ostream& out);
00033
00035 int nHits (unsigned int layer) const;
00036
00038 float energy (unsigned int layer, unsigned int n) const;
00039
00041 Point xtalPos (unsigned int layer, unsigned int n) const;
00042
00044 idents::ModuleId moduleId (unsigned int layer, unsigned int n) const;
00045
00046
00048 idents::XtalId xtalId (unsigned int layer, unsigned int n) const;
00049
00050 float Lresp (unsigned int layer, unsigned int n) const;
00051
00053 float Rresp (unsigned int layer, unsigned int n) const;
00054
00056 const std::vector<double>& Diodes_Energy(unsigned int layer, unsigned int n) const;
00057
00059 void load (const CsIDetector& xtal, idents::ModuleId tower);
00060
00062 void readData (std::istream& in);
00063
00065 void writeData (std::ostream& out) const;
00066
00067 void clear ();
00068
00069 void printOn(std::ostream & out)const;
00072 class Xtal
00073 {
00074 public:
00075
00076 Xtal (Point p, float e, idents::ModuleId m, int i, float Left, float Right, std::vector<double> diodes_energy)
00077 : pos(p), energy(e), id(i), Lresp(Left), Rresp(Right), module(m), Diodes_Energy(diodes_energy)
00078 {}
00079 Xtal (Point p, float e, idents::ModuleId m, int i, float Left, float Right)
00080 : pos(p), energy(e), id(i), Lresp(Left), Rresp(Right), module(m), Diodes_Energy(4,0.)
00081 {}
00082
00083 private:
00084 friend class RecoCsIData;
00085
00087 Point pos;
00088 float energy;
00089 int id;
00090 float Lresp;
00091 float Rresp;
00092 idents::ModuleId module;
00093 std::vector<double> Diodes_Energy;
00094 };
00095
00096
00097 private:
00098
00100 std::map< idents::XtalId, std::pair< int, int > > m_xtals;
00101
00103 std::vector< std::vector< class Xtal >* > calorList;
00104 };
00105
00106 #endif