#include <VisReco/VisCustomTracker/interface/VisCuTracker.h>
Public Member Functions | |
SoSeparator * | buildDet (VisTrackingGeometry::DetectorRep type, TrackerGeometry *pDD, int subDetector) |
int | subDetector (const std::string &key) |
VisCuTracker (void) | |
Static Public Member Functions | |
static std::string | getModuleName (DetId detid1) |
static int | nlayer (int det, int part, int lay) |
Private Member Functions | |
bool | visible (const GlobalPoint &point, VisTrackingGeometry::DetectorRep type, int subDetector) |
Definition at line 38 of file VisCuTracker.h.
VisCuTracker::VisCuTracker | ( | void | ) |
SoSeparator * VisCuTracker::buildDet | ( | VisTrackingGeometry::DetectorRep | type, | |
TrackerGeometry * | pDD, | |||
int | subDetector | |||
) |
Definition at line 40 of file VisCuTracker.cc.
References VisTrackingGeometry::addWafer(), TrackerGeometry::detUnits(), VisCuTkModule::isVisible(), mod(), VisCuTkModuleMap::moduleMap, and visible().
Referenced by VisCuTkGeometryTwig::update().
00041 { 00042 SoSeparator *sep = new SoSeparator; 00043 00044 SoMaterial *mat = new SoMaterial; 00045 mat->ambientColor.setValue (0.88445997, 0.840042, 0.53582799); 00046 mat->diffuseColor.setValue (0.66334498, 0.630032, 0.401871); 00047 mat->specularColor.setValue (0.49999201, 0.49999201, 0.49999201); 00048 mat->emissiveColor.setValue (0, 0, 0); 00049 mat->shininess = 0.1; 00050 mat->transparency = 0; 00051 sep->addChild (mat); 00052 00053 for (TrackingGeometry::DetUnitContainer::const_iterator idet = pDD->detUnits().begin(); 00054 idet != pDD->detUnits().end(); idet++) 00055 { 00056 VisCuTkModule * mod = VisCuTkModuleMap::moduleMap[(*idet)]; 00057 if(mod->isVisible()) 00058 { 00059 00060 if (visible ((*idet)->surface ().position (), type, subDetector)) 00061 { 00062 00063 SoSeparator* separator = new SoSeparator; 00064 VisTrackingGeometry::addWafer (separator, *idet,type); 00065 sep->addChild (separator); 00066 } 00067 } 00068 } 00069 return sep; 00070 }
static std::string VisCuTracker::getModuleName | ( | DetId | detid1 | ) | [inline, static] |
Definition at line 62 of file VisCuTracker.h.
References PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), DetId::subdetId(), StripSubdetector::TEC, StripSubdetector::TIB, StripSubdetector::TID, and StripSubdetector::TOB.
Referenced by VisCuTkBuilder::fill().
00062 { 00063 std::ostringstream outs; 00064 std::string name0,name1,name2; 00065 switch( detid1.subdetId()) 00066 { 00067 case PixelSubdetector::PixelBarrel: 00068 { 00069 PXBDetId detid(detid1); 00070 outs <<detid<<" "<<detid1.rawId(); 00071 break; 00072 } 00073 00074 case PixelSubdetector::PixelEndcap: 00075 { 00076 PXFDetId detid(detid1); 00077 outs <<detid<<" "<<detid1.rawId(); 00078 break; 00079 } 00080 00081 case StripSubdetector::TIB: 00082 { 00083 TIBDetId detid(detid1); 00084 outs <<detid; 00085 break; 00086 } 00087 00088 case StripSubdetector::TID: 00089 { 00090 TIDDetId detid(detid1); 00091 outs <<detid; 00092 break; 00093 } 00094 00095 case StripSubdetector::TOB: 00096 { 00097 TOBDetId detid(detid1); 00098 outs <<detid; 00099 break; 00100 } 00101 00102 case StripSubdetector::TEC: 00103 { 00104 TECDetId detid(detid1); 00105 outs <<detid; 00106 break; 00107 } 00108 00109 } 00110 return outs.str(); 00111 00112 }
Definition at line 50 of file VisCuTracker.h.
Referenced by VisCuTkSelectionBar::drawSelectionBars(), VisCuTkMap2D::paintEvent(), VisCuTkMap2D::pan(), VisCuTkMap2D::print(), VisCuTkSlWindow::pxbp(), VisCuTkSlWindow::pxep(), VisCuTkSlWindow::tecp(), VisCuTkSlWindow::tibp(), VisCuTkSlWindow::tidp(), VisCuTkSlWindow::tobp(), and VisCuTkLayerSelection::VisCuTkLayerSelection().
00050 { 00051 if(det==3 && part==1) return lay; 00052 if(det==2 && part==1) return lay+9; 00053 if(det==1 && part==1) return lay+12; 00054 if(det==1 && part==3) return lay+15; 00055 if(det==2 && part==3) return lay+18; 00056 if(det==3 && part==3) return lay+21; 00057 if(det==1 && part==2) return lay+30; 00058 if(det==2 && part==2) return lay+33; 00059 if(det==3 && part==2) return lay+37; 00060 return -1; 00061 }
int VisCuTracker::subDetector | ( | const std::string & | key | ) |
Definition at line 104 of file VisCuTracker.cc.
References GeomDetEnumerators::PixelBarrel, GeomDetEnumerators::PixelEndcap, GeomDetEnumerators::TEC, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, and GeomDetEnumerators::TOB.
Referenced by VisCuTkGeometryTwig::onNewEvent(), and VisCuTkGeometryTwig::update().
00105 { 00106 std::map<std::string, GeomDetEnumerators::SubDetector> type; 00107 00108 type ["PixelBarrel"] = GeomDetEnumerators::PixelBarrel; 00109 type ["TIB"] = GeomDetEnumerators::TIB; 00110 type ["TOB"] = GeomDetEnumerators::TOB; 00111 type ["PixelEndcap"] = GeomDetEnumerators::PixelEndcap; 00112 type ["TID"] = GeomDetEnumerators::TID; 00113 type ["TEC"] = GeomDetEnumerators::TEC; 00114 00115 return type [key]; 00116 }
bool VisCuTracker::visible | ( | const GlobalPoint & | point, | |
VisTrackingGeometry::DetectorRep | type, | |||
int | subDetector | |||
) | [private] |
Definition at line 73 of file VisCuTracker.cc.
References GeomDetEnumerators::CSC, VisTrackingGeometry::FullDet, VisTrackingGeometry::RPhiDet, VisTrackingGeometry::RZDet, GeomDetEnumerators::TEC, GeomDetEnumerators::TIB, GeomDetEnumerators::TID, GeomDetEnumerators::TOB, width, and PV3DBase< T, PVType, FrameType >::z().
Referenced by buildDet().
00074 { 00075 bool visible = false; 00076 double width = 1.0; 00077 double length = 10.0; 00078 if (subDetector == GeomDetEnumerators::TOB) width = 10.0; 00079 if (subDetector == GeomDetEnumerators::TIB) width = 5.5; 00080 if (subDetector == GeomDetEnumerators::TID) width = 5.0; 00081 if (subDetector == GeomDetEnumerators::TEC) width = 10.0; 00082 if (subDetector == GeomDetEnumerators::CSC) width = 55.0; 00083 00084 switch (type) 00085 { 00086 case VisTrackingGeometry::FullDet: 00087 visible = true; 00088 break; 00089 case VisTrackingGeometry::RZDet: 00090 visible = true; 00091 //fabs (point.x ()) < width ? visible = true : visible = false; 00092 break; 00093 case VisTrackingGeometry::RPhiDet: 00094 fabs (point.z ()) < length ? visible = true : visible = false; 00095 break; 00096 default: 00097 break; 00098 } 00099 00100 return visible; 00101 }