#include <VisReco/VisCustomTracker/interface/VisCuTrackerSimHit.h>
Public Member Functions | |
void | drawsimhit (VisCuTkModule *mod, int nlay, QPainter *p) |
void | setEvent (const edm::Event &event, const edm::EventSetup &eventSetup) |
void | setMap (VisCuTkMap2D *m) |
void | setTracker (VisCuCmsTracker *tr) |
SoSeparator * | update (VisTrackingGeometry::DetectorRep type) |
std::string | updatetext (VisCuTkModule *mod) |
VisCuTrackerSimHit () | |
Private Attributes | |
bool | firsteventloaded |
bool | horizontal_view |
edm::ESHandle< TrackerGeometry > | m_pDD |
VisCuTkMap2D * | map |
std::string | simhitProducerName |
std::vector< PSimHit > | theTrackerHits |
VisCuCmsTracker * | tracker |
Definition at line 24 of file VisCuTrackerSimHit.h.
VisCuTrackerSimHit::VisCuTrackerSimHit | ( | ) |
Definition at line 46 of file VisCuTrackerSimHit.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), firsteventloaded, edm::ParameterSet::getUntrackedParameter(), horizontal_view, p, VisConfigurationService::pSet(), python::EventAnalyzer_cfg::pset, simhitProducerName, and VisConfigurationService_cff::VisConfigurationService.
00047 { 00048 horizontal_view = true; 00049 firsteventloaded=false; 00050 const edm::ParameterSet *pset=VisConfigurationService::pSet(); 00051 if(!pset) 00052 { 00053 edm::ParameterSet p; 00054 VisConfigurationService *visService = new VisConfigurationService(p); 00055 pset = visService->pSet(); 00056 delete visService; 00057 } 00058 simhitProducerName = pset->getUntrackedParameter<std::string>("simhitProducer", "g4SimHits"); 00059 cout <<"simhitProducer="<< simhitProducerName << endl; 00060 00061 }
void VisCuTrackerSimHit::drawsimhit | ( | VisCuTkModule * | mod, | |
int | nlay, | |||
QPainter * | p | |||
) |
Definition at line 214 of file VisCuTrackerSimHit.cc.
References a, VisCuTkModule::bufvalue, funct::cos(), VisCuTkModule::detUnit, firsteventloaded, GeomDet::geographicalId(), VisCuTkSubLayer::getId(), VisCuTkModule::getId(), VisCuTkModule::getOwner(), cmsRelvalreport::green(), horizontal_view, VisCuTkSubLayer::isStereo(), j, VisCuTkModule::length, phi, VisCuTkMap2D::phival(), VisCuTkModule::posx, VisCuTkModule::posy, VisCuTkModule::posz, pv1, r, DetId::rawId(), funct::sin(), sl, funct::sqrt(), GeomDet::surface(), theTrackerHits, Surface::toGlobal(), VisCuTkModule::value, VisCuTkModule::width, VisCuTkModule::widthAtHalfLength, x, y, and z.
Referenced by VisCuTkMap2D::paintEvent(), and VisCuTkMap2D::print().
00215 { 00216 int x,y; 00217 double phi,r,dx,dy,dy1; 00218 double xp[4],yp[4],xp1,yp1; 00219 double vhbot,vhtop,vhapo; 00220 double rmedio[]={0.041,0.0701,0.0988,0.255,0.340,0.430,0.520,0.610,0.696,0.782,0.868,0.965,1.080}; 00221 double xt1,yt1,xs1=0.,ys1=0.,xt2,yt2,xs2,ys2,pv1,pv2; 00222 int numbersimhits=0; 00223 00224 if(firsteventloaded){ 00225 QPointArray a = QPointArray(4); 00226 phi = VisCuTkMap2D::phival(mod->posx,mod->posy); 00227 r = sqrt(mod->posx*mod->posx+mod->posy*mod->posy); 00228 vhbot = mod->width; 00229 vhtop=mod->width; 00230 vhapo=mod->length; 00231 00232 if(nlay < 31){//endcap 00233 vhbot = mod->widthAtHalfLength/2.-(mod->width/2.-mod->widthAtHalfLength/2.); 00234 vhtop=mod->width/2.; 00235 vhapo=mod->length/2.; 00236 if(nlay >12 && nlay <19){//pix endcap 00237 if(map->separated)r = r+r; 00238 xp[0]=r-vhtop;yp[0]=-vhapo; 00239 xp[1]=r+vhtop;yp[1]=-vhapo; 00240 xp[2]=r+vhtop;yp[2]=vhapo; 00241 xp[3]=r-vhtop;yp[3]=vhapo; 00242 }else{ 00243 if(map->separated)r = r + r/3.; 00244 xp[0]=r-vhapo;yp[0]=-vhbot; 00245 xp[1]=r+vhapo;yp[1]=-vhtop; 00246 xp[2]=r+vhapo;yp[2]=vhtop; 00247 xp[3]=r-vhapo;yp[3]=vhbot; 00248 } 00249 for(int j=0;j<4;j++){ 00250 xp1 = xp[j]*cos(phi)-yp[j]*sin(phi); 00251 yp1 = xp[j]*sin(phi)+yp[j]*cos(phi); 00252 xp[j] = xp1;yp[j]=yp1; 00253 } 00254 p->setPen(QColor(255,0,0)); 00255 p->setBrush(QColor(255,0,0)); 00256 00257 for (std::vector<PSimHit>::iterator isim = theTrackerHits.begin(); isim != theTrackerHits.end(); ++isim){ 00258 if(mod->detUnit->geographicalId().rawId()==isim->detUnitId()){ 00259 numbersimhits++; 00260 float x = mod->detUnit->surface().toGlobal((*isim).localPosition()).x()/100; 00261 float y = mod->detUnit->surface().toGlobal((*isim).localPosition()).y()/100; 00262 int xc = map->xpixel(x); 00263 int yc = map->ypixel(y); 00264 if(map->acc && !map->separated){ 00265 if(!horizontal_view){ 00266 if(xc > (map->ximg -1)) xc = (map->ximg -1); 00267 if(yc > (map->yimg -1)) yc =(map->yimg-1); 00268 } else { 00269 if(yc > (map->ximg -1)) yc = (map->ximg -1); 00270 if(xc > (map->yimg -1)) xc =(map->yimg-1); 00271 } 00272 QRgb pixel; 00273 if(!horizontal_view){ 00274 pixel = map->image->pixel(xc,yc); 00275 }else pixel = map->image->pixel(yc,map->x_win-xc); 00276 int green = qGreen(pixel); 00277 if(green > 1) green = green -20; 00278 if(green < 0) green = 0; 00279 if(!horizontal_view)map->image->setPixel(xc,yc,green);else map->image->setPixel(yc,map->x_win-xc,green); 00280 } 00281 if(!map->acc && !map->separated && !horizontal_view) p->drawRect(xc,yc,3,3); 00282 if(!map->acc && !map->separated && horizontal_view) p->drawRect(yc,map->x_win-xc,3,3); 00283 } 00284 } 00285 } else { //barrel 00286 int numod; 00287 numod=mod->getId();if(numod>100)numod=numod-100; 00288 int vane = mod->getOwner()->getId(); 00289 if(map->separated){ 00290 dx = vhapo; 00291 phi=M_PI; 00292 xt1=rmedio[nlay-31]; yt1=-vhtop/2.; 00293 xs1 = xt1*cos(phi)-yt1*sin(phi); 00294 ys1 = xt1*sin(phi)+yt1*cos(phi); 00295 xt2=rmedio[nlay-31]; yt2=vhtop/2.; 00296 xs2 = xt2*cos(phi)-yt2*sin(phi); 00297 ys2 = xt2*sin(phi)+yt2*cos(phi); 00298 dy=VisCuTkMap2D::phival(xs2,ys2)-VisCuTkMap2D::phival(xs1,ys1); 00299 dy1 = dy; 00300 if(nlay==31)dy1=0.39; 00301 if(nlay==32)dy1=0.23; 00302 if(nlay==33)dy1=0.16; 00303 xp[0]=vane*(dx+dx/8.);yp[0]=numod*(dy1); 00304 xp[1]=vane*(dx+dx/8.)+dx;yp[1]=numod*(dy1); 00305 xp[2]=vane*(dx+dx/8.)+dx;yp[2]=numod*(dy1)+dy; 00306 xp[3]=vane*(dx+dx/8.);yp[3]=numod*(dy1)+dy; 00307 }else{ 00308 xt1=r; yt1=-vhtop/2.; 00309 xs1 = xt1*cos(phi)-yt1*sin(phi); 00310 ys1 = xt1*sin(phi)+yt1*cos(phi); 00311 xt2=r; yt2=vhtop/2.; 00312 xs2 = xt2*cos(phi)-yt2*sin(phi); 00313 ys2 = xt2*sin(phi)+yt2*cos(phi); 00314 pv1=VisCuTkMap2D::phival(xs1,ys1); 00315 pv2=VisCuTkMap2D::phival(xs2,ys2); 00316 if(fabs(pv1-pv2)>M_PI && numod==1)pv1=pv1-2.*M_PI; 00317 if(fabs(pv1-pv2)>M_PI && numod!=1)pv2=pv2+2.*M_PI; 00318 xp[0]=mod->posz-vhapo/2.;yp[0]=4.2*pv1; 00319 xp[1]=mod->posz+vhapo/2.;yp[1]=4.2*pv1; 00320 xp[2]=mod->posz+vhapo/2. ;yp[2]=4.2*pv2; 00321 xp[3]=mod->posz-vhapo/2.;yp[3]=4.2*pv2; 00322 } 00323 p->setPen( QColor(255,0,255)); 00324 p->setBrush(QColor(255,0,255)); 00325 for (std::vector<PSimHit>::iterator isim = theTrackerHits.begin(); isim != theTrackerHits.end(); ++isim){ 00326 if(mod->detUnit->geographicalId().rawId()==isim->detUnitId()){ 00327 numbersimhits++; 00328 float x = mod->detUnit->surface().toGlobal((*isim).localPosition()).x()/100; 00329 float y = mod->detUnit->surface().toGlobal((*isim).localPosition()).y()/100; 00330 float z = mod->detUnit->surface().toGlobal((*isim).localPosition()).z()/100; 00331 int xc = map->xpixel(z); 00332 int yc = map->ypixel(4.2*VisCuTkMap2D::phival(x,y)); 00333 if(map->acc && !map->separated){ 00334 if(!horizontal_view){ 00335 if(xc > (map->ximg -1)) xc = (map->ximg -1); 00336 if(yc > (map->yimg -1)) yc =(map->yimg-1); 00337 } else { 00338 if(yc > (map->ximg -1)) yc = (map->ximg -1); 00339 if(xc > (map->yimg -1)) xc =(map->yimg-1); 00340 } 00341 QRgb pixel; 00342 if(!horizontal_view){ 00343 pixel = map->image->pixel(xc,yc); 00344 }else pixel = map->image->pixel(yc,map->x_win-xc); 00345 int green = qGreen(pixel); 00346 if(green > 1) green = green -20; 00347 if(green < 0) green = 0; 00348 if(!horizontal_view)map->image->setPixel(xc,yc,green);else map->image->setPixel(yc,map->x_win-xc,green); 00349 } 00350 if(!map->acc && !map->separated && !horizontal_view)p->drawRect(xc,yc,3,3); 00351 if(!map->acc && !map->separated && horizontal_view)p->drawRect(yc,map->x_win-xc,3,3); 00352 } 00353 } 00354 } 00355 VisCuTkSubLayer* sl = mod->getOwner(); 00356 if(sl->isStereo()&&map->separated){ 00357 if(mod->getId()>100 ){ 00358 for(int j=0;j<3;j++){ 00359 x=map->xpixel(xp[j]);y=map->ypixel(yp[j]); 00360 if(!horizontal_view)a.setPoint(j,x,y);else a.setPoint(j,y,map->x_win-x); 00361 } 00362 if(!horizontal_view)a.setPoint(3,x,y);else a.setPoint(3,y,map->x_win-x); 00363 }else { 00364 x=map->xpixel(xp[2]);y=map->ypixel(yp[2]); 00365 if(!horizontal_view)a.setPoint(0,x,y);else a.setPoint(0,y,map->x_win-x); 00366 x=map->xpixel(xp[3]);y=map->ypixel(yp[3]); 00367 if(!horizontal_view)a.setPoint(1,x,y);else a.setPoint(1,y,map->x_win-x); 00368 x=map->xpixel(xp[0]);y=map->ypixel(yp[0]); 00369 if(!horizontal_view)a.setPoint(2,x,y);else a.setPoint(2,y,map->x_win-x); 00370 if(!horizontal_view)a.setPoint(3,x,y);else a.setPoint(3,y,map->x_win-x); 00371 } 00372 } else { 00373 for(int j=0;j<4;j++){ 00374 x=map->xpixel(xp[j]);y=map->ypixel(yp[j]); 00375 if(!horizontal_view)a.setPoint(j,x,y);else a.setPoint(j,y,map->x_win-x); 00376 } 00377 } 00378 if(map->acc){mod->value = mod->value + numbersimhits;mod->bufvalue = mod->bufvalue + numbersimhits;} 00379 else mod->value = numbersimhits; 00380 if(map->separated){ 00381 p->setPen(QColor( 158, 185, 225)); 00382 int green = 255-mod->value; if (green < 0)green = 0;if(green > 255)green=255; 00383 p->setBrush(QColor(255,green,0)); 00384 if(mod->value==0)p->setBrush(QColor(255,255,255)); 00385 p->drawPolygon(a); 00386 } 00387 p->setPen(QColor(0,0,0)); 00388 p->setBrush(Qt::NoBrush); 00389 00390 }//firsteventloaded 00391 }
void VisCuTrackerSimHit::setEvent | ( | const edm::Event & | event, | |
const edm::EventSetup & | eventSetup | |||
) |
Definition at line 64 of file VisCuTrackerSimHit.cc.
References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), firsteventloaded, edm::EventSetup::get(), edm::ESHandle< T >::isValid(), m_pDD, mod(), VisCuTkModuleMap::moduleMap, EgammaValidation_Zee_cff::sel, VisCuTkModule::simhit_size, simhitProducerName, and theTrackerHits.
Referenced by VisCuTkGeometryTwig::onNewEvent().
00066 { 00067 eventSetup.get<TrackerDigiGeometryRecord> ().get (m_pDD); 00068 theTrackerHits.clear(); 00069 firsteventloaded=true; 00070 std::vector<PSimHit> tempTrackerHits; 00071 cout << "sono VisCuTrackerSimhit 0"<< endl; 00072 00073 edm::Handle<edm::PSimHitContainer> PixelBarrelHitsLowTof; 00074 edm::Handle<edm::PSimHitContainer> PixelBarrelHitsHighTof; 00075 edm::Handle<edm::PSimHitContainer> PixelEndcapHitsLowTof; 00076 edm::Handle<edm::PSimHitContainer> PixelEndcapHitsHighTof; 00077 edm::Handle<edm::PSimHitContainer> TIBHitsLowTof; 00078 edm::Handle<edm::PSimHitContainer> TIBHitsHighTof; 00079 edm::Handle<edm::PSimHitContainer> TIDHitsLowTof; 00080 edm::Handle<edm::PSimHitContainer> TIDHitsHighTof; 00081 edm::Handle<edm::PSimHitContainer> TOBHitsLowTof; 00082 edm::Handle<edm::PSimHitContainer> TOBHitsHighTof; 00083 edm::Handle<edm::PSimHitContainer> TECHitsLowTof; 00084 edm::Handle<edm::PSimHitContainer> TECHitsHighTof; 00085 bool nosimhits=true; 00086 if(simhitProducerName!="ignore"){ 00087 std::vector<edm::Handle<edm::PSimHitContainer> > hitCollections; 00088 ModuleLabelSelector sel(simhitProducerName); 00089 event.getMany (sel, hitCollections); 00090 if (! hitCollections.empty () )nosimhits=false; 00091 if(nosimhits) cout << "no simhits type "<<simhitProducerName<<"in event" << endl; 00092 if(!nosimhits){ 00093 event.getByLabel(simhitProducerName,"TrackerHitsPixelBarrelLowTof", PixelBarrelHitsLowTof); 00094 event.getByLabel(simhitProducerName,"TrackerHitsPixelBarrelHighTof", PixelBarrelHitsHighTof); 00095 event.getByLabel(simhitProducerName,"TrackerHitsPixelEndcapLowTof", PixelEndcapHitsLowTof); 00096 event.getByLabel(simhitProducerName,"TrackerHitsPixelEndcapHighTof", PixelEndcapHitsHighTof); 00097 event.getByLabel(simhitProducerName,"TrackerHitsTIBLowTof", TIBHitsLowTof); 00098 event.getByLabel(simhitProducerName,"TrackerHitsTIBHighTof", TIBHitsHighTof); 00099 event.getByLabel(simhitProducerName,"TrackerHitsTIDLowTof", TIDHitsLowTof); 00100 event.getByLabel(simhitProducerName,"TrackerHitsTIDHighTof", TIDHitsHighTof); 00101 event.getByLabel(simhitProducerName,"TrackerHitsTOBLowTof", TOBHitsLowTof); 00102 event.getByLabel(simhitProducerName,"TrackerHitsTOBHighTof", TOBHitsHighTof); 00103 event.getByLabel(simhitProducerName,"TrackerHitsTECLowTof", TECHitsLowTof); 00104 event.getByLabel(simhitProducerName,"TrackerHitsTECHighTof", TECHitsHighTof); 00105 tempTrackerHits.insert(tempTrackerHits.end(), PixelBarrelHitsLowTof->begin(), PixelBarrelHitsLowTof->end()); 00106 tempTrackerHits.insert(tempTrackerHits.end(), PixelBarrelHitsHighTof->begin(), PixelBarrelHitsHighTof->end()); 00107 tempTrackerHits.insert(tempTrackerHits.end(), PixelEndcapHitsLowTof->begin(), PixelEndcapHitsLowTof->end()); 00108 tempTrackerHits.insert(tempTrackerHits.end(), PixelEndcapHitsHighTof->begin(), PixelEndcapHitsHighTof->end()); 00109 tempTrackerHits.insert(tempTrackerHits.end(), TIBHitsLowTof->begin(), TIBHitsLowTof->end()); 00110 tempTrackerHits.insert(tempTrackerHits.end(), TIBHitsHighTof->begin(), TIBHitsHighTof->end()); 00111 tempTrackerHits.insert(tempTrackerHits.end(), TIDHitsLowTof->begin(), TIDHitsLowTof->end()); 00112 tempTrackerHits.insert(tempTrackerHits.end(), TIDHitsHighTof->begin(), TIDHitsHighTof->end()); 00113 tempTrackerHits.insert(tempTrackerHits.end(), TOBHitsLowTof->begin(), TOBHitsLowTof->end()); 00114 tempTrackerHits.insert(tempTrackerHits.end(), TOBHitsHighTof->begin(), TOBHitsHighTof->end()); 00115 tempTrackerHits.insert(tempTrackerHits.end(), TECHitsLowTof->begin(), TECHitsLowTof->end()); 00116 tempTrackerHits.insert(tempTrackerHits.end(), TECHitsHighTof->begin(), TECHitsHighTof->end()); 00117 cout << "sono VisCuTrackerSimhit 1"<< endl; 00118 for (std::vector<PSimHit>::iterator isim = tempTrackerHits.begin(); isim != tempTrackerHits.end(); ++isim) 00119 { 00120 theTrackerHits.push_back(*isim); 00121 } 00122 00123 // std::vector<std::pair<GeomDetUnit *,PSimHit > > rtemp; 00124 if (! tempTrackerHits.empty () && m_pDD.isValid ()){ 00125 int nsimhit=0; 00126 for (std::vector<PSimHit>::iterator isim = tempTrackerHits.begin(); isim != tempTrackerHits.end(); ++isim) 00127 { 00128 DetId detIdObject(isim->detUnitId()); 00129 const GeomDetUnit * geoUnit = m_pDD->idToDetUnit( detIdObject ); 00130 VisCuTkModule * mod = VisCuTkModuleMap::moduleMap[geoUnit]; 00131 nsimhit++; 00132 if(mod){ 00133 mod->simhit_size=mod->simhit_size+1; 00134 // std::pair<GeomDetUnit*, PSimHit> pxd; 00135 // pxd.first = mod->detUnit; 00136 // pxd.second = *isim; 00137 // rtemp.push_back(pxd); 00138 } else cout <<"simhit#"<< nsimhit<<" module not found " << endl; 00139 00140 }//for on isim 00141 }// if 00142 // int rd_pointer=0; 00143 // map<const GeomDetUnit * , VisCuTkModule *>::iterator imod; 00144 // for (imod=VisCuTkModuleMap::moduleMap.begin();imod != VisCuTkModuleMap::moduleMap.end(); imod++){ 00145 // VisCuTkModule* mod = imod->second; 00146 // if(mod->simhit_size>0){ 00147 // mod->simhit_start=rd_pointer; rd_pointer = rd_pointer + mod->simhit_size; 00148 // for(int i =0;i<rtemp.size();i++){ 00149 // std::pair<GeomDetUnit*, PSimHit> pxd = rtemp[i]; 00150 // GeomDetUnit * geomdet = pxd.first; 00151 // if (geomdet==mod->detUnit)theTrackerHits.push_back(pxd.second); 00152 // }//for on rtemp 00153 // }//if module has simhits 00154 // }//loop on modules 00155 // */ 00156 } 00157 } 00158 }
void VisCuTrackerSimHit::setMap | ( | VisCuTkMap2D * | m | ) | [inline] |
Definition at line 33 of file VisCuTrackerSimHit.h.
Referenced by VisCuTkMapWindow::VisCuTkMapWindow().
00033 {map=m;};
void VisCuTrackerSimHit::setTracker | ( | VisCuCmsTracker * | tr | ) | [inline] |
Definition at line 31 of file VisCuTrackerSimHit.h.
References tracker.
Referenced by VisCuTkGeometryTwig::onNewEvent().
00031 {tracker=tr;};
SoSeparator * VisCuTrackerSimHit::update | ( | VisTrackingGeometry::DetectorRep | type | ) |
Definition at line 160 of file VisCuTrackerSimHit.cc.
References begin, GenMuonPlsPt100GeV_cfg::cout, VisCuTkModule::detUnit, lat::endl(), GeomDet::geographicalId(), SurfaceOrientation::inner, edm::ESHandle< T >::isValid(), VisCuTkModule::isVisible(), m_pDD, mod(), VisCuTkModuleMap::moduleMap, DetId::rawId(), VisTrackingGeometry::RZDet, funct::sqrt(), GeomDet::surface(), theTrackerHits, Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), y, PV3DBase< T, PVType, FrameType >::z(), and z.
Referenced by VisCuTkGeometryTwig::update().
00161 { 00162 00163 SoSeparator *sep = new SoSeparator; // global 00164 if (! theTrackerHits.empty () && m_pDD.isValid ()) 00165 { 00166 SoMaterial *mat = new SoMaterial; 00167 mat->diffuseColor.setValue (1.0, 0.0, 1.0);//pink 00168 mat->emissiveColor.setValue(1.0, 0.0, 1.0); 00169 00170 SoDrawStyle *drawStyle = new SoDrawStyle; 00171 drawStyle->pointSize = 4.0; 00172 00173 sep->addChild (mat); 00174 sep->addChild (drawStyle); 00175 00176 try 00177 { 00178 SoVertexProperty *vertices = new SoVertexProperty; 00179 int nVrtx = 0; 00180 std::map<const GeomDetUnit * , VisCuTkModule *>::iterator imod; 00181 for (imod=VisCuTkModuleMap::moduleMap.begin();imod != VisCuTkModuleMap::moduleMap.end(); imod++){ 00182 VisCuTkModule* mod = imod->second; 00183 if(mod->isVisible()){ 00184 for (std::vector<PSimHit>::iterator isim = theTrackerHits.begin(); isim != theTrackerHits.end(); ++isim){ 00185 if(mod->detUnit->geographicalId().rawId()==isim->detUnitId()){ 00186 00187 GlobalPoint inner = mod->detUnit->surface().toGlobal((*isim).localPosition()); 00188 float x = inner.x()/100; 00189 float y; 00190 if(type==RZDet){ 00191 x=0.0; 00192 y = sqrt(inner.x()*inner.x()+inner.y()*inner.y()) / 100.0; if(inner.y()< 0. )y = - y;} else y = inner.y()/100; 00193 float z = inner.z()/100; 00194 vertices->vertex.set1Value (nVrtx++, SbVec3f (x, y, z)); 00195 } 00196 } 00197 } 00198 } 00199 vertices->vertex.setNum (nVrtx); 00200 SoPointSet *points = new SoPointSet; 00201 points->vertexProperty.setValue (vertices); 00202 points->numPoints.setValue (nVrtx); 00203 00204 sep->addChild (points); 00205 } 00206 catch (...) 00207 { 00208 std::cout << "No Simhits in tracker." << std::endl; 00209 } 00210 } 00211 return sep; 00212 }
std::string VisCuTrackerSimHit::updatetext | ( | VisCuTkModule * | mod | ) |
Definition at line 393 of file VisCuTrackerSimHit.cc.
References VisCuTkModule::detUnit, GeomDet::geographicalId(), SurfaceOrientation::inner, DetId::rawId(), GeomDet::surface(), theTrackerHits, Surface::toGlobal(), PV3DBase< T, PVType, FrameType >::x(), x, PV3DBase< T, PVType, FrameType >::y(), y, PV3DBase< T, PVType, FrameType >::z(), and z.
Referenced by VisCuTkGeometryTwig::update().
00394 { 00395 std::ostringstream text; 00396 int nsimhit=0; 00397 for (std::vector<PSimHit>::iterator isim = theTrackerHits.begin(); isim != theTrackerHits.end(); ++isim){ 00398 if(mod->detUnit->geographicalId().rawId()==isim->detUnitId()){ 00399 if(nsimhit==0)text << " simhits: --------------------------------------- <p>" ; 00400 GlobalPoint inner = mod->detUnit->surface().toGlobal((*isim).localPosition()); 00401 float x = inner.x()/100; 00402 float y = inner.y()/100; 00403 float z = inner.z()/100; 00404 text << " Number=" << nsimhit++ 00405 << " Position=" << x << ", " << y << ", " << z << "<p>"; 00406 } 00407 } 00408 if(nsimhit>0)text << " -----------------------------" ; 00409 return text.str(); 00410 }
bool VisCuTrackerSimHit::firsteventloaded [private] |
Definition at line 41 of file VisCuTrackerSimHit.h.
Referenced by drawsimhit(), setEvent(), and VisCuTrackerSimHit().
bool VisCuTrackerSimHit::horizontal_view [private] |
Definition at line 41 of file VisCuTrackerSimHit.h.
Referenced by drawsimhit(), and VisCuTrackerSimHit().
VisCuTkMap2D* VisCuTrackerSimHit::map [private] |
Definition at line 38 of file VisCuTrackerSimHit.h.
std::string VisCuTrackerSimHit::simhitProducerName [private] |
Definition at line 42 of file VisCuTrackerSimHit.h.
Referenced by setEvent(), and VisCuTrackerSimHit().
std::vector<PSimHit> VisCuTrackerSimHit::theTrackerHits [private] |
Definition at line 39 of file VisCuTrackerSimHit.h.
Referenced by drawsimhit(), setEvent(), update(), and updatetext().
VisCuCmsTracker* VisCuTrackerSimHit::tracker [private] |