#include <vector>
Go to the source code of this file.
Functions | |
bool | MakeTrans (const std::vector< float > trapezBounds, float const station_id, float const layer_r, float const layer_phi, float const layer_z, float const OurPhi, float const OurZ, SoTranslation *trans, SoTranslation *trans_caption, SoTranslation *trans_s, SoTranslation *trans_w) |
bool | VisCaptions (float const layer_z, float const layer_phi, float &OurPhi, float &OurZ, SoSeparator *sep) |
bool | VisFrames (const std::vector< float > trapezBounds, SoLineSet *trapez, SoLineSet *rect_w, SoLineSet *rect_s) |
Variables | |
float const | Digis_stepX = 4.5 |
float const | Digis_X = -3.5 |
float const | Digis_Y = -5.5 |
float const | MEsFrames_X = -3 |
float const | MEsFrames_Xstep = 2. |
float const | MEsFrames_Y = -1. |
float const | MEsFrames_Ystep = 1. |
float const | MEsHorisontal_stepX = 2.0 |
float const | MEsHorisontal_X = -3.55 |
float const | MEsHorisontal_Y = 7.5 |
float const | MEsVertical_stepY = 1. |
float const | MEsVertical_X = -6. |
float const | MEsVertical_Y = -1.15 |
float const | PHI_X = -5.5 |
float const | PHI_Y = 0. |
char const | VisFont [10] = "Times" |
float const | VisFontSize = 0.5 |
bool MakeTrans | ( | const std::vector< float > | trapezBounds, | |
float const | station_id, | |||
float const | layer_r, | |||
float const | layer_phi, | |||
float const | layer_z, | |||
float const | OurPhi, | |||
float const | OurZ, | |||
SoTranslation * | trans, | |||
SoTranslation * | trans_caption, | |||
SoTranslation * | trans_s, | |||
SoTranslation * | trans_w | |||
) |
Definition at line 265 of file VisCSCDigiTools.cc.
References MEsFrames_X, MEsFrames_Xstep, MEsFrames_Y, and MEsFrames_Ystep.
00275 { 00276 // Translations 00277 float Xtrans = MEsFrames_X + 00278 MEsFrames_Xstep*(station_id-1); // put diff. Stations at diff. place 00279 float Xtrans_m = MEsFrames_X + 00280 MEsFrames_Xstep*(station_id-1) - MEsFrames_Xstep/10.; 00281 float Xtrans_p = MEsFrames_X + 00282 MEsFrames_Xstep*(station_id-1) + MEsFrames_Xstep/10.; 00283 // 00284 trans->translation = SbVec3f(Xtrans,layer_r,0.); 00285 trans_caption->translation.setValue(Xtrans-0.4,0.,0.); 00286 // 00287 float Ytrans = MEsFrames_Y - MEsFrames_Ystep*(station_id-1); 00288 float Ytrans_m = MEsFrames_Y - 00289 MEsFrames_Ystep*(station_id-1) - MEsFrames_Ystep/3.; 00290 float Ytrans_p = MEsFrames_Y - 00291 MEsFrames_Ystep*(station_id-1) + MEsFrames_Ystep/3.; 00292 trans_s->translation = SbVec3f(MEsFrames_X,Ytrans,0.); 00293 // 00294 float Xtrans_w = layer_r-MEsFrames_Xstep; 00295 trans_w->translation = SbVec3f(Xtrans_w,Ytrans,0.); 00296 // Colors, shifts 00297 if(OurPhi != layer_phi){ 00298 float Ytrans_strip; 00299 if(OurZ < layer_z){ // shift chambers 00300 Ytrans_strip=Ytrans_m; 00301 trans_w->translation = SbVec3f(Xtrans_w,Ytrans_m,0.); 00302 } 00303 else{ 00304 Ytrans_strip=Ytrans_p; 00305 trans_w->translation = SbVec3f(Xtrans_w,Ytrans_p,0.); 00306 } 00307 if (layer_phi<OurPhi){ // shift chambers a bit 00308 trans->translation = SbVec3f(Xtrans_m,layer_r,0.); 00309 trans_caption->translation.setValue(Xtrans_m-0.8,0.,0.); 00310 trans_s->translation = SbVec3f(MEsFrames_X-2.*0.8*trapezBounds[1]/100., 00311 Ytrans_strip,0.); 00312 } 00313 else{ 00314 trans->translation = SbVec3f(Xtrans_p,layer_r,0.); 00315 trans_caption->translation.setValue(Xtrans_p,0.,0.); 00316 trans_s->translation = SbVec3f(MEsFrames_X+2.*0.8*trapezBounds[1]/100., 00317 Ytrans_strip,0.); 00318 } 00319 } 00320 return true; 00321 }
bool VisCaptions | ( | float const | layer_z, | |
float const | layer_phi, | |||
float & | OurPhi, | |||
float & | OurZ, | |||
SoSeparator * | sep | |||
) |
Definition at line 35 of file VisCSCDigiTools.cc.
References Digis_stepX, Digis_X, Digis_Y, info, MEsHorisontal_stepX, MEsHorisontal_X, MEsHorisontal_Y, MEsVertical_stepY, MEsVertical_X, MEsVertical_Y, PHI_X, PHI_Y, VisFont, and VisFontSize.
Referenced by VisCSCStripDigiTwig::update(), and VisCSCWireDigiTwig::update().
00039 { 00040 OurPhi = layer_phi; // init 00041 OurZ = layer_z; // init 00042 // 00043 SoTranslation *trans_me1 = new SoTranslation; 00044 SoTranslation *trans_me2 = new SoTranslation; 00045 SoTranslation *trans_me3 = new SoTranslation; 00046 SoTranslation *trans_me4 = new SoTranslation; 00047 // 00048 trans_me1->translation.setValue(MEsHorisontal_X,MEsHorisontal_Y,0.); 00049 trans_me2->translation.setValue(MEsHorisontal_X+MEsHorisontal_stepX,MEsHorisontal_Y,0.); 00050 trans_me3->translation.setValue(MEsHorisontal_X+2.*MEsHorisontal_stepX,MEsHorisontal_Y,0.); 00051 trans_me4->translation.setValue(MEsHorisontal_X+3.*MEsHorisontal_stepX,MEsHorisontal_Y,0.); 00052 // 00053 SoTranslation *trans_me1_v = new SoTranslation; 00054 SoTranslation *trans_me2_v = new SoTranslation; 00055 SoTranslation *trans_me3_v = new SoTranslation; 00056 SoTranslation *trans_me4_v = new SoTranslation; 00057 // 00058 trans_me1_v->translation.setValue(MEsVertical_X, 00059 MEsVertical_Y,0.); 00060 trans_me2_v->translation.setValue(MEsVertical_X, 00061 MEsVertical_Y-MEsVertical_stepY,0.); 00062 trans_me3_v->translation.setValue(MEsVertical_X, 00063 MEsVertical_Y-2.*MEsVertical_stepY,0.); 00064 trans_me4_v->translation.setValue(MEsVertical_X, 00065 MEsVertical_Y-3.*MEsVertical_stepY,0.); 00066 // 00067 SoTranslation *trans_strips = new SoTranslation; 00068 SoTranslation *trans_wires = new SoTranslation; 00069 SoTranslation *trans_phi = new SoTranslation; 00070 SoTranslation *trans_format = new SoTranslation; 00071 // 00072 trans_strips->translation.setValue(Digis_X,Digis_Y,0.); 00073 trans_wires->translation.setValue(Digis_X+Digis_stepX,Digis_Y,0.); 00074 trans_phi->translation.setValue(PHI_X,PHI_Y,0.); 00075 trans_format->translation.setValue(PHI_X-0.5,PHI_Y-0.3,0.); 00076 // 00077 SoText3 *TextME1 = new SoText3; 00078 SoText3 *TextME2 = new SoText3; 00079 SoText3 *TextME3 = new SoText3; 00080 SoText3 *TextME4 = new SoText3; 00081 // 00082 TextME1->string = "ME1"; 00083 TextME2->string = "ME2"; 00084 TextME3->string = "ME3"; 00085 TextME4->string = "ME4"; 00086 // 00087 SoText3 *TextStrips = new SoText3; 00088 SoText3 *TextWires = new SoText3; 00089 SoText3 *TextPhi = new SoText3; 00090 SoText3 *TextFormat = new SoText3; 00091 // 00092 TextStrips->string = "Strips"; 00093 TextWires->string = "Wire groups"; 00094 TextPhi->string = "Phi:"; 00095 //TextFormat->string = "----------------------------------------------------------------------------"; 00096 // 00097 SoMaterial *mat = new SoMaterial; 00098 mat->diffuseColor.setValue (0.0, 0.0, 0.0); 00099 // 00100 SoMaterial *matInfo = new SoMaterial; 00101 matInfo->diffuseColor.setValue (0.0, 0.0, 1.0); 00102 // 00103 SoMaterial *matText = new SoMaterial; 00104 matText->diffuseColor.setValue (1.0, 0.0, 0.0); 00105 //root->addChild(africaSep); 00106 // 00107 SoSeparator *Station1_h = new SoSeparator; 00108 SoSeparator *Station2_h = new SoSeparator; 00109 SoSeparator *Station3_h = new SoSeparator; 00110 SoSeparator *Station4_h = new SoSeparator; 00111 // 00112 SoSeparator *Station1_v = new SoSeparator; 00113 SoSeparator *Station2_v = new SoSeparator; 00114 SoSeparator *Station3_v = new SoSeparator; 00115 SoSeparator *Station4_v = new SoSeparator; 00116 // 00117 SoSeparator *strips_txt = new SoSeparator; 00118 SoSeparator *wires_txt = new SoSeparator; 00119 SoSeparator *phi_txt = new SoSeparator; 00120 SoSeparator *format_txt = new SoSeparator; 00121 // 00122 00123 Station1_h->addChild(trans_me1); 00124 Station1_h->addChild(TextME1); 00125 // 00126 Station2_h->addChild(trans_me2); 00127 Station2_h->addChild(TextME2); 00128 // 00129 Station3_h->addChild(trans_me3); 00130 Station3_h->addChild(TextME3); 00131 // 00132 Station4_h->addChild(trans_me4); 00133 Station4_h->addChild(TextME4); 00134 // 00135 Station1_v->addChild(trans_me1_v); 00136 Station1_v->addChild(TextME1); 00137 // 00138 Station2_v->addChild(trans_me2_v); 00139 Station2_v->addChild(TextME2); 00140 // 00141 Station3_v->addChild(trans_me3_v); 00142 Station3_v->addChild(TextME3); 00143 // 00144 Station4_v->addChild(trans_me4_v); 00145 Station4_v->addChild(TextME4); 00146 // 00147 strips_txt->addChild(trans_strips); 00148 strips_txt->addChild(matInfo); 00149 strips_txt->addChild(TextStrips); 00150 // 00151 wires_txt->addChild(trans_wires); 00152 wires_txt->addChild(matInfo); 00153 wires_txt->addChild(TextWires); 00154 // 00155 phi_txt->addChild(trans_phi); 00156 phi_txt->addChild(mat); 00157 phi_txt->addChild(TextPhi); 00158 // 00159 format_txt->addChild(trans_format); 00160 format_txt->addChild(mat); 00161 format_txt->addChild(TextFormat); 00162 // 00163 SoFont *font = new SoFont; 00164 //font->name.setValue("Courier-BoldOblique"); 00165 font->name.setValue(VisFont); 00166 font->size.setValue(VisFontSize); 00167 // 00168 SoSeparator *TitleStations = new SoSeparator; 00169 SoSeparator *info = new SoSeparator; 00170 // 00171 TitleStations->addChild(font); 00172 TitleStations->addChild(matText); 00173 TitleStations->addChild(Station1_h); 00174 TitleStations->addChild(Station2_h); 00175 TitleStations->addChild(Station3_h); 00176 TitleStations->addChild(Station4_h); 00177 TitleStations->addChild(Station1_v); 00178 TitleStations->addChild(Station2_v); 00179 TitleStations->addChild(Station3_v); 00180 TitleStations->addChild(Station4_v); 00181 // 00182 info->addChild(font); 00183 info->addChild(strips_txt); 00184 info->addChild(wires_txt); 00185 info->addChild(phi_txt); 00186 info->addChild(format_txt); 00187 // 00188 sep->addChild (TitleStations); 00189 sep->addChild (info); 00190 // 00191 return true; 00192 }
bool VisFrames | ( | const std::vector< float > | trapezBounds, | |
SoLineSet * | trapez, | |||
SoLineSet * | rect_w, | |||
SoLineSet * | rect_s | |||
) |
Definition at line 194 of file VisCSCDigiTools.cc.
00197 { 00198 if(4!=trapezBounds.size()) return false; 00199 // Layer (chamber) bounds 00200 int nVrx = 0; 00201 float x, y, z; 00202 // 00203 std::vector<LocalPoint> CrossPoint; 00204 CrossPoint.push_back( LocalPoint(-trapezBounds[0], -trapezBounds[3], 0.)); 00205 CrossPoint.push_back( LocalPoint(trapezBounds[0], -trapezBounds[3], 0.)); 00206 CrossPoint.push_back( LocalPoint(trapezBounds[1], trapezBounds[3], 0.)); 00207 CrossPoint.push_back( LocalPoint(-trapezBounds[1], trapezBounds[3], 0.)); 00208 CrossPoint.push_back( LocalPoint(-trapezBounds[0], -trapezBounds[3], 0.)); 00209 // 00210 SoVertexProperty *vert = new SoVertexProperty; 00211 for (std::vector<LocalPoint>::iterator _crossP = 00212 CrossPoint.begin (); _crossP != CrossPoint.end (); ++_crossP){ 00213 x = _crossP->x()/100.0; // cm -> m 00214 y = _crossP->y()/100.0; // cm -> m 00215 z = _crossP->z()/100.0; // cm -> m 00216 vert->vertex.set1Value (nVrx++,SbVec3f (x, y, z) ); 00217 } 00218 vert->vertex.setNum (nVrx); 00219 trapez->vertexProperty.setValue (vert); 00220 trapez->numVertices[CrossPoint.size()]; 00221 // "Strip" bounds 00222 CrossPoint.clear(); 00223 CrossPoint.push_back( LocalPoint(-trapezBounds[1], -trapezBounds[2], 0.)); 00224 CrossPoint.push_back( LocalPoint(trapezBounds[1], -trapezBounds[2], 0.)); 00225 CrossPoint.push_back( LocalPoint(trapezBounds[1], trapezBounds[2], 0.)); 00226 CrossPoint.push_back( LocalPoint(-trapezBounds[1], trapezBounds[2], 0.)); 00227 CrossPoint.push_back( LocalPoint(-trapezBounds[1], -trapezBounds[2], 0.)); 00228 // 00229 vert = new SoVertexProperty; 00230 nVrx = 0; 00231 for (std::vector<LocalPoint>::iterator _crossP = 00232 CrossPoint.begin (); _crossP != CrossPoint.end (); ++_crossP){ 00233 x = _crossP->x()/100.0; // cm -> m 00234 y = _crossP->y()/4.; // cm -> m 00235 z = _crossP->z()/100.0; // cm -> m 00236 vert->vertex.set1Value (nVrx++,SbVec3f (x, y, z) ); 00237 } 00238 vert->vertex.setNum (nVrx); 00239 rect_s->vertexProperty.setValue (vert); 00240 rect_s->numVertices[CrossPoint.size()]; 00241 // "Wire" bounds 00242 CrossPoint.clear(); 00243 CrossPoint.push_back( LocalPoint(-trapezBounds[3], -trapezBounds[2], 0.)); 00244 CrossPoint.push_back( LocalPoint(trapezBounds[3], -trapezBounds[2], 0.)); 00245 CrossPoint.push_back( LocalPoint(trapezBounds[3], trapezBounds[2], 0.)); 00246 CrossPoint.push_back( LocalPoint(-trapezBounds[3], trapezBounds[2], 0.)); 00247 CrossPoint.push_back( LocalPoint(-trapezBounds[3], -trapezBounds[2], 0.)); 00248 // 00249 vert = new SoVertexProperty; 00250 nVrx = 0; 00251 for (std::vector<LocalPoint>::iterator _crossP = 00252 CrossPoint.begin (); _crossP != CrossPoint.end (); ++_crossP){ 00253 x = _crossP->x()/100.0; // cm -> m 00254 y = _crossP->y()/4.; // cm -> m 00255 z = _crossP->z()/100.0; // cm -> m 00256 vert->vertex.set1Value (nVrx++,SbVec3f (x, y, z) ); 00257 } 00258 vert->vertex.setNum (nVrx); 00259 rect_w->vertexProperty.setValue (vert); 00260 rect_w->numVertices[CrossPoint.size()]; 00261 // 00262 return true; 00263 }
float const Digis_stepX = 4.5 |
float const Digis_X = -3.5 |
float const Digis_Y = -5.5 |
float const MEsFrames_X = -3 |
float const MEsFrames_Xstep = 2. |
float const MEsFrames_Y = -1. |
float const MEsFrames_Ystep = 1. |
float const MEsHorisontal_stepX = 2.0 |
float const MEsHorisontal_X = -3.55 |
float const MEsHorisontal_Y = 7.5 |
float const MEsVertical_stepY = 1. |
float const MEsVertical_X = -6. |
float const MEsVertical_Y = -1.15 |
float const PHI_X = -5.5 |
float const PHI_Y = 0. |
char const VisFont[10] = "Times" |
Definition at line 40 of file VisCSCDigiTools.h.
Referenced by VisCSCStripDigiTwig::update(), VisCSCWireDigiTwig::update(), and VisCaptions().
float const VisFontSize = 0.5 |
Definition at line 41 of file VisCSCDigiTools.h.
Referenced by VisCSCStripDigiTwig::update(), VisCSCWireDigiTwig::update(), and VisCaptions().