00001 #ifndef __CALRECLOGS_H
00002 #define __CALRECLOGS_H 1
00003
00004 #include <iostream>
00005 #include <vector>
00006 #include "CalRecon/CalDetGeo.h"
00007 #include "CalRecon/CalADCLogs.h"
00008 #include "CalRecon/CalBase.h"
00009 #include "GaudiKernel/DataObject.h"
00010 #include "gui/DisplayRep.h"
00011
00012 #include "CalRecon/CalDisplay.h"
00013
00014 extern const CLID& CLID_CalRecLogs;
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 class CalRecLog : public CalADCLog
00034
00035 {
00036 public:
00037
00038
00039 CalRecLog(int ilayer, CalDetGeo::axis iview, int ilog);
00040 CalRecLog(int ilayer, CalDetGeo::axis iview, int ilog, idents::ModuleId mod);
00041 void setNegEnergy(CalBase::RANGE r, double e) {m_negEnergy[r] = e;}
00042 void setPosEnergy(CalBase::RANGE r, double e) {m_posEnergy[r] = e;}
00043 void setNegEnergy(double e) {m_nEnergy = e;}
00044 void setPosEnergy(double e) {m_pEnergy = e;}
00045 void setPosition(Point p) {m_position = p;}
00046 void setBestRange(CalBase::RANGE r) {m_bestRange = r;}
00047 ~CalRecLog() {};
00048
00049 double negEnergy(CalBase::RANGE r) const {return m_negEnergy[r];}
00050 double posEnergy(CalBase::RANGE r) const {return m_posEnergy[r];}
00051 double negEnergy() const {return m_nEnergy;}
00052 double posEnergy() const {return m_pEnergy;}
00053 double energy() const {return 0.5*(posEnergy()+negEnergy());}
00054 double energy(CalBase::RANGE r) const {return 0.5*(negEnergy(r)+posEnergy(r));}
00055 double asymmetry() const;
00056 Point position() const {return m_position;}
00057 CalBase::RANGE bestRange() const {return m_bestRange;}
00058
00059
00060 void clear();
00061 void writeOut() const;
00062 void draw(gui::DisplayRep& v) const;
00063
00064 private:
00065
00066 double m_negEnergy[CALNRANGES];
00067 double m_posEnergy[CALNRANGES];
00068 double m_nEnergy;
00069 double m_pEnergy;
00070 Point m_position;
00071 CalBase::RANGE m_bestRange;
00072
00073 };
00074
00075
00076 class CalRecLogs : public DataObject
00077
00078 {
00079 public:
00080
00081
00082 CalRecLogs(int nmodX=1, int nmodY=1, int nlogs=10, int nlayers=4, int iviews=2)
00083 {ini(nmodX,nmodY,nlogs,nlayers,iviews); m_calDisp=0;}
00084 ~CalRecLogs();
00085
00086
00087
00088 static const CLID& classID() {return CLID_CalRecLogs;}
00089 virtual const CLID& clID() const {return classID();}
00090
00091
00092
00093
00094 void add(CalRecLog* log) {m_List.push_back(log);}
00095
00096
00097 int num() const {return m_List.size();}
00098 CalRecLog* Log(int i) const {return m_List[i];}
00099 CalRecLog* getLogID(int logID) const;
00100
00101
00102 virtual void clear();
00103 virtual void make() {};
00104
00105 void writeOut() const;
00106 void update(gui::DisplayRep& v) {draw(v);}
00107
00108 void setCalDisplay(CalDisplay* calDisp){m_calDisp=calDisp;}
00109
00110 private:
00111
00112 virtual void ini(int nmodX, int nmodY, int nlogs, int nlayers, int iviews);
00113
00114 void draw(gui::DisplayRep& v) const;
00115
00116 private:
00117
00118 std::vector<CalRecLog*> m_List;
00119
00120 CalDisplay* m_calDisp;
00121 };
00122
00123 #endif