Public Methods | |
CalRep (CalRecLogs **pp_crl, CsIClusterList **pp_cls, float logheight, float calZtop, float calZbottom) | |
void | update () |
Private Attributes | |
CalRecLogs ** | m_pp_crl |
CsIClusterList ** | m_pp_cls |
float | m_logheight |
float | m_calZtop |
float | m_calZbottom |
|
Definition at line 40 of file CalDisplay.cxx. References logheight, m_calZbottom, m_calZtop, and m_logheight.
00042 :m_pp_crl(pp_crl),m_pp_cls(pp_cls),m_logheight(logheight), 00043 m_calZtop(calZtop), m_calZbottom(calZbottom){} |
|
Definition at line 44 of file CalDisplay.cxx. References CsIClusterList::Cluster(), CalRecLog::energy(), CalRecLogs::Log(), m_calZbottom, m_calZtop, m_logheight, CalRecLogs::num(), and CalRecLog::position().
00044 { 00045 00046 const Point p0(0.,0.,0.); 00047 CalRecLogs* crl = *m_pp_crl; 00048 if(crl){ 00049 00050 // drawing red box for each log with a size proportional to energy deposition 00051 00052 setColor("red"); 00053 00054 int nLogs = crl->num(); 00055 double emax = 0.; 00056 for (int jlog = 0; jlog < nLogs ; jlog++) { 00057 CalRecLog* recLog = crl->Log(jlog); 00058 double eneLog = recLog->energy(); 00059 if(eneLog>emax)emax=eneLog; 00060 } 00061 if(emax>0){ 00062 for (jlog = 0; jlog < nLogs ; jlog++) { 00063 CalRecLog* recLog = crl->Log(jlog); 00064 double eneLog = recLog->energy(); 00065 if(eneLog>0.01*emax){ 00066 Vector pLog = recLog->position() - p0; 00067 double x = pLog.x(); 00068 double y = pLog.y(); 00069 double z = pLog.z(); 00070 double s = 0.45*m_logheight*eneLog/emax; 00071 moveTo(Point(x-s, y-s, z-s)); 00072 lineTo(Point(x+s, y-s, z-s)); 00073 lineTo(Point(x+s, y-s, z+s)); 00074 lineTo(Point(x-s, y-s, z+s)); 00075 lineTo(Point(x-s, y-s, z-s)); 00076 moveTo(Point(x-s, y+s, z-s)); 00077 lineTo(Point(x+s, y+s, z-s)); 00078 lineTo(Point(x+s, y+s, z+s)); 00079 lineTo(Point(x-s, y+s, z+s)); 00080 lineTo(Point(x-s, y+s, z-s)); 00081 moveTo(Point(x-s, y-s, z-s)); 00082 lineTo(Point(x-s, y+s, z-s)); 00083 moveTo(Point(x+s, y-s, z-s)); 00084 lineTo(Point(x+s, y+s, z-s)); 00085 moveTo(Point(x-s, y-s, z+s)); 00086 lineTo(Point(x-s, y+s, z+s)); 00087 moveTo(Point(x+s, y-s, z+s)); 00088 lineTo(Point(x+s, y+s, z+s)); 00089 } 00090 } 00091 } 00092 } 00093 00094 // drawing the cross in the average position for each layer 00095 CsIClusterList* cls = *m_pp_cls; 00096 if(cls){ 00097 double s=0.1*m_logheight; 00098 setColor("blue"); 00099 ICsICluster* cl = cls->Cluster(0); 00100 double energy_sum = cl->energySum(); 00101 const std::vector<double>& eneLayer = cl->getEneLayer(); 00102 const std::vector<Vector>& posLayer = cl->getPosLayer(); 00103 for( int l=0;l<8;l++){ 00104 double x=(posLayer[l]).x(); 00105 double y=(posLayer[l]).y(); 00106 double z=(posLayer[l]).z(); 00107 moveTo(Point(x-s, y, z)); 00108 lineTo(Point(x+s, y, z)); 00109 moveTo(Point(x, y-s, z)); 00110 lineTo(Point(x, y+s, z)); 00111 moveTo(Point(x, y, z-s)); 00112 lineTo(Point(x, y, z+s)); 00113 } 00114 00115 00116 // drawing the center of the cluster 00117 setColor("green"); 00118 double x = (cl->position()).x(); 00119 double y = (cl->position()).y(); 00120 double z = (cl->position()).z(); 00121 moveTo(Point(x-s, y, z)); 00122 lineTo(Point(x, y, z+s)); 00123 lineTo(Point(x+s, y, z)); 00124 lineTo(Point(x, y, z-s)); 00125 lineTo(Point(x-s, y, z)); 00126 lineTo(Point(x, y+s, z)); 00127 lineTo(Point(x+s, y, z)); 00128 lineTo(Point(x, y-s, z)); 00129 lineTo(Point(x-s, y, z)); 00130 moveTo(Point(x, y-s, z)); 00131 lineTo(Point(x, y, z+s)); 00132 lineTo(Point(x, y+s, z)); 00133 lineTo(Point(x, y, z-s)); 00134 lineTo(Point(x, y-s, z)); 00135 00136 double dirX = (cl->direction()).x(); 00137 double dirY = (cl->direction()).y(); 00138 double dirZ = (cl->direction()).z(); 00139 00140 if(dirZ >= -1. && dirZ != 0.){ 00141 00142 double xTop = x+dirX*(m_calZtop-z)/dirZ; 00143 double yTop = y+dirY*(m_calZtop-z)/dirZ; 00144 double xBottom = x+dirX*(m_calZbottom-z)/dirZ; 00145 double yBottom = y+dirY*(m_calZbottom-z)/dirZ; 00146 00147 moveTo(Point(xTop,yTop,m_calZtop)); 00148 lineTo(Point(xBottom,yBottom,m_calZbottom)); 00149 00150 00151 } 00152 00153 } 00154 } |
|
Definition at line 37 of file CalDisplay.cxx. |
|
Definition at line 36 of file CalDisplay.cxx. |
|
Definition at line 35 of file CalDisplay.cxx. |
|
Definition at line 34 of file CalDisplay.cxx. |
|
Definition at line 33 of file CalDisplay.cxx. |