CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
FWConvTrackHitsDetailView Class Reference

#include <FWConvTrackHitsDetailView.h>

Inheritance diagram for FWConvTrackHitsDetailView:
FWDetailViewGL< reco::Conversion > CSGActionSupervisor FWDetailView< reco::Conversion > FWDetailViewBase

Public Member Functions

void camera1Callback ()
 
void camera2Callback ()
 
void camera3Callback ()
 
 FWConvTrackHitsDetailView ()
 
void pickCameraCenter ()
 
void rnrHits ()
 
void rnrLabels ()
 
void rnrModules ()
 
void switchProjection ()
 
virtual ~FWConvTrackHitsDetailView ()
 
- Public Member Functions inherited from FWDetailViewGL< reco::Conversion >
 FWDetailViewGL ()
 
virtual void init (TEveWindowSlot *)
 
virtual void setBackgroundColor (Color_t)
 
TGLViewer * viewerGL () const
 
virtual ~FWDetailViewGL ()
 
- Public Member Functions inherited from FWDetailView< reco::Conversion >
virtual void build (const FWModelId &iID, const void *iData)
 
 FWDetailView ()
 
- Public Member Functions inherited from FWDetailViewBase
void build (const FWModelId &)
 
const fireworks::Contextcontext () const
 
const FWEventItemitem ()
 
void setItem (const FWEventItem *x)
 
virtual ~FWDetailViewBase ()
 
- Public Member Functions inherited from CSGActionSupervisor
Bool_t activateMenuEntry (int entry)
 
Bool_t activateToolBarEntry (int entry)
 
void addToActionMap (CSGAction *action)
 
 CSGActionSupervisor ()
 
virtual void defaultAction ()
 
virtual void enableActions (bool enable=true)
 
CSGActiongetAction (const std::string &name)
 
const std::vector< CSGAction * > & getListOfActions () const
 
Long_t getToolTipDelay () const
 
virtual void HandleMenu (Int_t id)
 
void resizeMenu (TGPopupMenu *menu)
 
virtual ~CSGActionSupervisor ()
 

Private Member Functions

void addHits (const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
 
void addModules (const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
 
void addTrackerHits3D (std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
 
void build (const FWModelId &id, const reco::Conversion *)
 
 FWConvTrackHitsDetailView (const FWConvTrackHitsDetailView &)
 
const FWConvTrackHitsDetailViewoperator= (const FWConvTrackHitsDetailView &)
 
void setTextInfo (const FWModelId &id, const reco::Conversion *)
 

Private Attributes

TEveElement * m_calo3D
 
CSGActionm_camTypeAction
 
TEveElementList * m_hits
 
TLegend * m_legend
 
TEveElementList * m_moduleLabels
 
TEveElementList * m_modules
 
bool m_orthographic
 

Additional Inherited Members

- Static Public Member Functions inherited from FWDetailView< reco::Conversion >
static std::string classRegisterTypeName ()
 
static std::string classTypeName ()
 
- Static Public Member Functions inherited from FWDetailViewBase
static void drawCanvasBox (Double_t *pos, Color_t fillCol, Int_t fillType=0, bool bg=kTRUE)
 
static void drawCanvasDot (Float_t x, Float_t y, Float_t r, Color_t)
 
- Protected Member Functions inherited from FWDetailViewBase
 FWDetailViewBase (const std::type_info &)
 
- Protected Attributes inherited from FWDetailViewGL< reco::Conversion >
TEveScene * m_eveScene
 
TEveViewer * m_eveViewer
 
TGCompositeFrame * m_guiFrame
 
TCanvas * m_infoCanvas
 
- Protected Attributes inherited from CSGActionSupervisor
std::vector< CSGAction * > m_actionList
 

Detailed Description

Definition at line 21 of file FWConvTrackHitsDetailView.h.

Constructor & Destructor Documentation

FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( )

Definition at line 49 of file FWConvTrackHitsDetailView.cc.

49  :
50  m_modules(0),
51  m_moduleLabels(0),
52  m_hits(0),
53  m_legend(0),
54  m_orthographic(false)
55 {
56 }
FWConvTrackHitsDetailView::~FWConvTrackHitsDetailView ( )
virtual

Definition at line 58 of file FWConvTrackHitsDetailView.cc.

59 {
60 }
FWConvTrackHitsDetailView::FWConvTrackHitsDetailView ( const FWConvTrackHitsDetailView )
private

Member Function Documentation

void FWConvTrackHitsDetailView::addHits ( const reco::Track track,
const FWEventItem iItem,
TEveElement *  trkList,
bool  addNearbyHits 
)
private

Definition at line 458 of file FWConvTrackHitsDetailView.cc.

References fireworks::addSiStripClusters(), addTrackerHits3D(), FWDisplayProperties::color(), FWEventItem::defaultDisplayProperties(), fireworks::pushNearbyPixelHits(), fireworks::pushPixelHits(), and RecoTauPiZeroBuilderPlugins_cfi::strips.

Referenced by build().

462 {
463  std::vector<TVector3> pixelPoints;
464  fireworks::pushPixelHits( pixelPoints, *iItem, track );
465  TEveElementList* pixels = new TEveElementList( "Pixels" );
466  trkList->AddElement( pixels );
467  if( addNearbyHits )
468  {
469  // get the extra hits
470  std::vector<TVector3> pixelExtraPoints;
471  fireworks::pushNearbyPixelHits( pixelExtraPoints, *iItem, track );
472  // draw first the others
473  addTrackerHits3D( pixelExtraPoints, pixels, kRed, 1 );
474  // then the good ones, so they're on top
475  addTrackerHits3D( pixelPoints, pixels, kGreen, 1 );
476  }
477  else
478  {
479  // just add those points with the default color
480  addTrackerHits3D( pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1 );
481  }
482 
483  // strips
484  TEveElementList* strips = new TEveElementList( "Strips" );
485  trkList->AddElement( strips );
486  fireworks::addSiStripClusters( iItem, track, strips, addNearbyHits, false );
487 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
Color_t color() const
void pushPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:599
void addSiStripClusters(const FWEventItem *iItem, const reco::Track &t, class TEveElement *tList, bool addNearbyClusters, bool master)
Definition: TrackUtils.cc:381
void addTrackerHits3D(std::vector< TVector3 > &points, class TEveElementList *tList, Color_t color, int size)
void pushNearbyPixelHits(std::vector< TVector3 > &pixelPoints, const FWEventItem &iItem, const reco::Track &t)
Definition: TrackUtils.cc:543
void FWConvTrackHitsDetailView::addModules ( const reco::Track track,
const FWEventItem iItem,
TEveElement *  trkList,
bool  addLostHits 
)
private

Definition at line 492 of file FWConvTrackHitsDetailView.cc.

References TrackingRecHit::bad, FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), cond::rpcobgas::detid, MuonSubdetId::DT, DTChamberId, fwLog, FWGeometry::getEveShape(), FWEventItem::getGeom(), TrackingRecHit::inactive, fireworks::info(), fwlog::kInfo, TrackingRecHit::missing, DetId::Muon, mergeVDriftHistosByStation::name, PixelSubdetector::PixelBarrel, PixelSubdetector::PixelEndcap, DetId::rawId(), reco::Track::recHitsBegin(), reco::Track::recHitsEnd(), MuonSubdetId::RPC, edm::second(), DetId::subdetId(), SiStripDetId::TEC, SiStripDetId::TIB, SiStripDetId::TID, SiStripDetId::TOB, DetId::Tracker, and TrackingRecHit::valid.

Referenced by build().

496 {
497  std::set<unsigned int> ids;
498  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
499  recIt != recItEnd; ++recIt )
500  {
501  DetId detid = (*recIt)->geographicalId();
502  if( !addLostHits && !(*recIt)->isValid()) continue;
503  if( detid.rawId() != 0 )
504  {
505  TString name("");
506  switch( detid.det())
507  {
508  case DetId::Tracker:
509  switch( detid.subdetId())
510  {
511  case SiStripDetId::TIB:
512  name = "TIB ";
513  break;
514  case SiStripDetId::TOB:
515  name = "TOB ";
516  break;
517  case SiStripDetId::TID:
518  name = "TID ";
519  break;
520  case SiStripDetId::TEC:
521  name = "TEC ";
522  break;
524  name = "Pixel Barrel ";
525  break;
527  name = "Pixel Endcap ";
528  default:
529  break;
530  }
531  break;
532 
533  case DetId::Muon:
534  switch( detid.subdetId())
535  {
536  case MuonSubdetId::DT:
537  name = "DT";
538  detid = DetId( DTChamberId( detid )); // get rid of layer bits
539  break;
540  case MuonSubdetId::CSC:
541  name = "CSC";
542  break;
543  case MuonSubdetId::RPC:
544  name = "RPC";
545  break;
546  default:
547  break;
548  }
549  break;
550  default:
551  break;
552  }
553  if( ! ids.insert( detid.rawId()).second ) continue;
554  if( iItem->getGeom())
555  {
556  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
557  if( 0 != shape )
558  {
559  shape->SetMainTransparency( 65 );
560  shape->SetPickable( kTRUE );
561  switch(( *recIt )->type())
562  {
564  shape->SetMainColor( iItem->defaultDisplayProperties().color());
565  break;
567  name += "LOST ";
568  shape->SetMainColor( kRed );
569  break;
571  name += "INACTIVE ";
572  shape->SetMainColor( 28 );
573  break;
574  case TrackingRecHit::bad:
575  name += "BAD ";
576  shape->SetMainColor( 218 );
577  break;
578  }
579  shape->SetTitle( name + ULong_t( detid.rawId()));
580  trkList->AddElement( shape );
581  }
582  else
583  {
584  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
585  << "\n" << fireworks::info( detid ) << std::endl;
586  }
587  }
588  }
589  }
590 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:451
Color_t color() const
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
U second(std::pair< T, U > const &p)
static const int CSC
Definition: MuonSubdetId.h:13
TEveGeoShape * getEveShape(unsigned int id) const
Definition: FWGeometry.cc:250
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:63
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:37
Definition: DetId.h:18
#define fwLog(_level_)
Definition: fwLog.h:50
static const int RPC
Definition: MuonSubdetId.h:14
std::string info(const DetId &)
Definition: TrackUtils.cc:680
static const int DT
Definition: MuonSubdetId.h:12
Detector det() const
get the detector field from this detid
Definition: DetId.h:35
const FWGeometry * getGeom() const
Definition: FWEventItem.cc:681
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:65
void FWConvTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 439 of file FWConvTrackHitsDetailView.cc.

Referenced by addHits().

440 {
441  // !AMT this is detail view specific, should move to track hits
442  // detail view
443 
444  TEvePointSet* pointSet = new TEvePointSet();
445  pointSet->SetMarkerSize(size);
446  pointSet->SetMarkerStyle(4);
447  pointSet->SetPickable(kTRUE);
448  pointSet->SetTitle("Pixel Hits");
449  pointSet->SetMarkerColor(color);
450 
451  for( std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
452  pointSet->SetNextPoint(it->x(), it->y(), it->z());
453  }
454  tList->AddElement(pointSet);
455 }
tuple size
Write out results.
void FWConvTrackHitsDetailView::build ( const FWModelId id,
const reco::Conversion conv 
)
privatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 94 of file FWConvTrackHitsDetailView.cc.

References Abs(), alignCSCRings::action, CSGAction::activated, addHits(), addModules(), b, FWECALDetailViewBuilder::buildCaloData(), trackerHits::c, camera1Callback(), camera2Callback(), camera3Callback(), dtNoiseDBValidation_cfg::cerr, create_public_lumi_plots::color, FWDetailViewBase::context(), CSGAction::createTextButton(), data, end, eta(), reco::Track::extra(), f, fireworks::Context::getBeamSpot(), CSGAction::getName(), trackerHitRTTI::gs, i, edm::Ref< C, T, F >::isAvailable(), FWDetailViewBase::item(), m_camTypeAction, FWDetailViewGL< reco::Conversion >::m_eveScene, FWDetailViewGL< reco::Conversion >::m_guiFrame, m_hits, m_moduleLabels, m_modules, mergeVDriftHistosByStation::name, reco::Conversion::nTracks(), AlCaHLTBitMon_ParallelJobs::p, reco::Conversion::pairMomentum(), phi, fireworks::prepareTrack(), alignCSCRings::r, rnrHits(), rnrModules(), setTextInfo(), Sign(), switchProjection(), runonSM::text, theta(), reco::Conversion::tracks(), FWDetailViewGL< reco::Conversion >::viewerGL(), x, FWBeamSpot::x0(), detailsBasic3DVector::y, FWBeamSpot::y0(), detailsBasic3DVector::z, and FWBeamSpot::z0().

95 {
96  if (conv->nTracks()<2) return;
97  const reco::Track* track0 = conv->tracks().at(0).get();
98  const reco::Track* track1 = conv->tracks().at(1).get();
99 
100  m_guiFrame->AddFrame(new TGLabel(m_guiFrame, "Camera Views:"), new TGLayoutHints(kLHintsLeft, 2, 2, 2, 2));
101 
102  {
103  TGHorizontalFrame* f = new TGHorizontalFrame(m_guiFrame);
104  m_guiFrame->AddFrame(f, new TGLayoutHints(kLHintsExpandX, 2, 0, 0, 0));
105 
106  {
107  CSGAction* action = new CSGAction(this, "Top");
108  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
109  f->AddFrame(b, new TGLayoutHints( kLHintsExpandX));
110  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
111  b->SetToolTipText("plane normal: track0 x track1");
112  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera1Callback));
113  }
114 
115  {
116  CSGAction* action = new CSGAction(this, "Side");
117  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
118  f->AddFrame(b, new TGLayoutHints( kLHintsExpandX));
119  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
120  b->SetToolTipText("left fir: track1");
121  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera2Callback));
122  }
123  {
124  CSGAction* action = new CSGAction(this, "Front");
125  TGTextButton* b = new TGTextButton(f, action->getName().c_str());
126  f->AddFrame(b, new TGLayoutHints( kLHintsExpandX));
127  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
128  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::camera3Callback));
129  b->SetToolTipText("plane normal: track1 ");
130 
131  }
132  }
133 
134  {
135  m_camTypeAction = new CSGAction(this, " Set Ortographic Projection ");
136  m_camTypeAction->createTextButton(m_guiFrame, new TGLayoutHints( kLHintsExpandX, 2, 0, 1, 4));
138  }
139 
140  {
141  CSGAction* action = new CSGAction(this, "Draw Module");
142  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str() );
143  b->SetState(kButtonDown, false);
144  m_guiFrame->AddFrame(b, new TGLayoutHints( kLHintsNormal, 2, 3, 1, 4));
145  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
146  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::rnrModules));
147  }
148  {
149  CSGAction* action = new CSGAction(this, "Draw Hits");
150  TGCheckButton* b = new TGCheckButton(m_guiFrame, action->getName().c_str() );
151  b->SetState(kButtonDown, false);
152  m_guiFrame->AddFrame(b, new TGLayoutHints( kLHintsNormal, 2, 3, 1, 4));
153  TQObject::Connect(b, "Clicked()", "CSGAction", action, "activate()");
154  action->activated.connect(sigc::mem_fun(this, &FWConvTrackHitsDetailView::rnrHits));
155  }
156 
157  TGCompositeFrame* p = (TGCompositeFrame*)m_guiFrame->GetParent();
158  p->MapSubwindows();
159  p->Layout();
160 
161  m_modules = new TEveElementList( "Modules" );
162  m_eveScene->AddElement( m_modules );
163  m_moduleLabels = new TEveElementList( "Modules" );
164  m_eveScene->AddElement( m_moduleLabels );
165  m_hits = new TEveElementList( "Hits" );
166  m_eveScene->AddElement( m_hits );
167  if( track1->extra().isAvailable())
168  {
169  addModules( *track1, id.item(), m_modules, true );
170  addHits( *track1, id.item(), m_hits, true );
171  }
172  if( track0->extra().isAvailable())
173  {
174  addModules( *track0, id.item(), m_modules, true );
175  addHits( *track0, id.item(), m_hits, true );
176  }
177  for( TEveElement::List_i i = m_modules->BeginChildren(), end = m_modules->EndChildren(); i != end; ++i )
178  {
179  TEveGeoShape* gs = dynamic_cast<TEveGeoShape*>(*i);
180  if (gs == 0 && (*i != 0)) {
181  std::cerr << "Got a " << typeid(**i).name() << ", expecting TEveGeoShape. ignoring (it must be the clusters)." << std::endl;
182  continue;
183  }
184  // gs->SetMainTransparency(75);
185  // gs->SetPickable(kFALSE);
186 
187  TString name = gs->GetElementTitle();
188  if (!name.Contains("BAD") && !name.Contains("INACTIVE") && !name.Contains("LOST")) {
189  gs->SetMainColor(kBlue);
190  }
191  TEveText* text = new TEveText(name.Data());
192  text->PtrMainTrans()->SetFrom(gs->RefMainTrans().Array());
193  text->SetFontMode(TGLFont::kPixmap);
194  text->SetFontSize(12);
195  m_moduleLabels->AddElement(text);
196  }
197  m_moduleLabels->SetRnrChildren(false);
198 
199  TEveTrackPropagator* prop = new TEveTrackPropagator();
200  prop->SetMagFieldObj(item()->context().getField(), false);
201  prop->SetStepper(TEveTrackPropagator::kRungeKutta);
202  prop->SetMaxR(123);
203  prop->SetMaxZ(300);
204  prop->SetMaxStep(1);
205  prop->SetRnrDaughters(kTRUE);
206  prop->SetRnrReferences(kTRUE);
207  prop->SetRnrDecay(kTRUE);
208 
209  // first-vertex style
210  prop->SetRnrFV(kTRUE);
211  prop->RefFVAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
212  prop->RefFVAtt().SetMarkerSize(0.8);
213 
214  // path-mark style
215  prop->RefPMAtt().SetMarkerSize(0.5);
216  prop->RefPMAtt().SetMarkerColor(id.item()->defaultDisplayProperties().color());
217 
218  TEveTrack* trk1 = fireworks::prepareTrack( *track1, prop );
219  trk1->MakeTrack();
220  trk1->SetLineWidth(2);
221  trk1->SetTitle( "Track 1 and its ref states" );
222  trk1->SetMainColor(id.item()->defaultDisplayProperties().color());
223  trk1->SetLineStyle(7);
224  m_eveScene->AddElement(trk1);
225 
226  TEveTrack* trk0 = fireworks::prepareTrack( *track0, prop );
227  trk0->MakeTrack();
228  trk0->SetLineWidth(2);
229  trk0->SetTitle( "Track 0 and its ref states" );
230  trk0->SetMainColor(id.item()->defaultDisplayProperties().color());
231  m_eveScene->AddElement(trk0);
232 
233  // create TEveCalo3D object, fix bounding box
234  {
235  float phi = conv->pairMomentum().phi();
236  float eta = conv->pairMomentum().eta();
237 
238  FWECALDetailViewBuilder caloBld( id.item()->getEvent(), id.item()->getGeom(), eta, phi, 30);
239  TEveCaloData* data = caloBld.buildCaloData(false);
240  // AMT!!! this is mempry leak, check why it needs to be added
241  TEveCalo3D* calo3d = new TEveCalo3D(data);
242  gEve->AddElement(data);
243  calo3d->SetBarrelRadius(129.00);
244  calo3d->SetEndCapPos(268.36);
245 
246  float theta = TEveCaloData::EtaToTheta(eta);
247  float eps = data->GetMaxVal(true) * calo3d->GetValToHeight();
248  if (TMath::Abs(eta) < calo3d->GetTransitionEta())
249  {
250  // printf("barrel\n");
251  float x = calo3d->GetBarrelRadius() * TMath::Cos(phi);
252  float y = calo3d->GetBarrelRadius() * TMath::Sin(phi);
253  float z = calo3d->GetBarrelRadius() / TMath::Tan(theta);
254 
255  calo3d->BBoxZero(eps, x, y, z);
256  }
257  else
258  {
259  // printf("endcap\n");
260  float z = TMath::Sign(calo3d->GetEndCapPos(), eta);
261  float r = z*TMath::Tan(theta);
262  calo3d->BBoxZero(eps, r* TMath::Cos(phi), r*TMath::Sin(phi), z);
263  }
264  m_eveScene->AddElement(calo3d);
265  }
266 
267  // base vectors
268  TEveVectorD fwd = trk1->GetMomentum().Cross(trk0->GetMomentum());
269  fwd.Normalize();
270  TEveVectorD lft =trk1->GetMomentum();
271  lft.Normalize();
272  TEveVectorD up = lft.Cross(fwd);
273 
274 
275  TEveVectorD c = ( trk1->GetVertex() + trk0->GetVertex()) *0.5;
276  if (1)
277  {
278  setCameraInit(viewerGL(),TGLViewer::kCameraPerspXOZ, fwd, up, c); //default
279  setCameraInit(viewerGL(),TGLViewer::kCameraPerspYOZ, up, lft,c);
280  setCameraInit(viewerGL(),TGLViewer::kCameraPerspXOY, lft, fwd,c);
281 
282  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoXOY, fwd, up,c);
283  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoXOZ, up, lft,c);
284  setCameraInit(viewerGL(),TGLViewer::kCameraOrthoZOY, lft, fwd,c);
285  }
286  {
287  Float_t sfac = 100;
288  fwd *= sfac;
289  lft *= sfac;
290  up *= sfac;
291  int transp = 90;
292  {
293  TEveStraightLineSet* bls = new TEveStraightLineSet("base1");
294  bls->AddLine(c, fwd + c);
295  bls->SetMainColor(kBlue);
296  bls->SetMainTransparency(transp);
297  bls->SetPickable(false);
298  m_eveScene->AddElement(bls);
299  }
300 
301  {
302  TEveStraightLineSet* bls = new TEveStraightLineSet("base2");
303  bls->AddLine(c, lft + c);
304  bls->SetMainColor(kBlue);
305  bls->SetMainTransparency(transp);
306  bls->SetPickable(false);
307  m_eveScene->AddElement(bls);
308  }
309 
310  {
311  TEveStraightLineSet* bls = new TEveStraightLineSet("base3");
312  bls->AddLine(c, up + c);
313  bls->SetMainColor(kBlue);
314  bls->SetMainTransparency(transp);
315  bls->SetPickable(false);
316  m_eveScene->AddElement(bls);
317  }
318  }
319  {
320  TEveStraightLineSet* bls = new TEveStraightLineSet("Photon", "Photon");
321  FWBeamSpot* bs = context().getBeamSpot();
322  bls->AddLine(c.fX, c.fY, c.fZ, bs->x0(), bs->y0(), bs->z0());
323  bls->SetMainColor(id.item()->defaultDisplayProperties().color());
324  bls->SetLineStyle(3);
325  m_eveScene->AddElement(bls);
326  }
327 
328  viewerGL()->SetStyle(TGLRnrCtx::kOutline);
329  viewerGL()->ResetCamerasAfterNextUpdate();
330  viewerGL()->UpdateScene(kFALSE);
331  gEve->Redraw3D();
332 
333  setTextInfo(id, conv);
335 }
const std::string & getName() const
Definition: CSGAction.cc:81
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
int i
Definition: DBlmapReader.cc:9
double x0() const
Definition: FWBeamSpot.cc:30
const TrackExtraRef & extra() const
reference to &quot;extra&quot; object
Definition: Track.h:97
T Sign(T A, T B)
Definition: MathUtil.h:54
TEveTrack * prepareTrack(const reco::Track &track, TEveTrackPropagator *propagator, const std::vector< TEveVector > &extraRefPoints=std::vector< TEveVector >())
Definition: TrackUtils.cc:69
double z0() const
Definition: FWBeamSpot.cc:40
double y0() const
Definition: FWBeamSpot.cc:35
const FWEventItem * item()
sigc::signal< void > activated
Definition: CSGAction.h:88
Geom::Theta< T > theta() const
bool isAvailable() const
Definition: Ref.h:276
T eta() const
float float float z
FWBeamSpot * getBeamSpot() const
Definition: Context.h:78
const fireworks::Context & context() const
T Abs(T a)
Definition: MathUtil.h:49
double f[11][100]
tuple text
Definition: runonSM.py:42
#define end
Definition: vmac.h:37
void addHits(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addNearbyHits)
unsigned int nTracks() const
Number of tracks= 0,1,2.
Definition: Conversion.h:101
void setTextInfo(const FWModelId &id, const reco::Conversion *)
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:223
double b
Definition: hdecay.h:120
void createTextButton(TGCompositeFrame *p, TGLayoutHints *l=0, Int_t id=-1, GContext_t norm=TGButton::GetDefaultGC()(), FontStruct_t font=TGTextButton::GetDefaultFontStruct(), UInt_t option=kRaisedFrame|kDoubleBorder)
Definition: CSGAction.cc:126
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
Definition: DDAxes.h:10
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:176
Definition: DDAxes.h:10
void FWConvTrackHitsDetailView::camera1Callback ( )

Definition at line 633 of file FWConvTrackHitsDetailView.cc.

References m_orthographic, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

634 {
636 
637  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoXOY : TGLViewer::kCameraPerspXOZ);
638  viewerGL()->ResetCurrentCamera();
639  viewerGL()->RequestDraw();
640 }
void FWConvTrackHitsDetailView::camera2Callback ( )

Definition at line 642 of file FWConvTrackHitsDetailView.cc.

References m_orthographic, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

643 {
645 
646  viewerGL()->SetCurrentCamera( m_orthographic ? TGLViewer::kCameraOrthoXOZ : TGLViewer::kCameraPerspYOZ);
647  viewerGL()->ResetCurrentCamera();
648  viewerGL()->RequestDraw();
649 
650 }
void FWConvTrackHitsDetailView::camera3Callback ( )

Definition at line 652 of file FWConvTrackHitsDetailView.cc.

References m_orthographic, and FWDetailViewGL< reco::Conversion >::viewerGL().

Referenced by build().

653 {
655 
656  viewerGL()->SetCurrentCamera(m_orthographic ? TGLViewer::kCameraOrthoZOY : TGLViewer::kCameraPerspXOY);
657  viewerGL()->ResetCurrentCamera();
658  viewerGL()->RequestDraw();
659 
660 }
const FWConvTrackHitsDetailView& FWConvTrackHitsDetailView::operator= ( const FWConvTrackHitsDetailView )
private
void FWConvTrackHitsDetailView::pickCameraCenter ( )

Definition at line 594 of file FWConvTrackHitsDetailView.cc.

References FWDetailViewGL< reco::Conversion >::viewerGL().

595 {
596  viewerGL()->PickCameraCenter();
597  viewerGL()->SetDrawCameraCenter(kTRUE);
598 }
void FWConvTrackHitsDetailView::rnrHits ( )

Definition at line 626 of file FWConvTrackHitsDetailView.cc.

References m_hits.

Referenced by build().

627 {
628  m_hits->SetRnrChildren(!m_hits->GetRnrChildren());
629  gEve->Redraw3D();
630 }
void FWConvTrackHitsDetailView::rnrLabels ( )

Definition at line 612 of file FWConvTrackHitsDetailView.cc.

References m_moduleLabels.

613 {
614  m_moduleLabels->SetRnrChildren(!m_moduleLabels->GetRnrChildren());
615  gEve->Redraw3D();
616 }
void FWConvTrackHitsDetailView::rnrModules ( )

Definition at line 619 of file FWConvTrackHitsDetailView.cc.

References m_modules.

Referenced by build().

620 {
621  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
622  gEve->Redraw3D();
623 }
void FWConvTrackHitsDetailView::setTextInfo ( const FWModelId id,
const reco::Conversion conv 
)
privatevirtual

Implements FWDetailView< reco::Conversion >.

Definition at line 338 of file FWConvTrackHitsDetailView.cc.

References reco::TrackBase::charge(), reco::Conversion::conversionVertex(), reco::Conversion::distOfMinimumApproach(), reco::Conversion::dPhiTracksAtVtx(), reco::TrackBase::eta(), reco::HitPattern::getHitPattern(), reco::TrackBase::hitPattern(), cmsHarvester::index, FWDetailViewBase::item(), FWDetailViewGL< reco::Conversion >::m_infoCanvas, reco::HitPattern::numberOfHits(), reco::Conversion::pairCotThetaSeparation(), reco::Conversion::pairMomentum(), reco::TrackBase::phi(), reco::HitPattern::pixelHitFilter(), reco::Vertex::position(), reco::TrackBase::pt(), mathSSE::sqrt(), reco::HitPattern::stripHitFilter(), reco::TrackBase::trackerExpectedHitsInner(), reco::Conversion::tracks(), reco::HitPattern::validHitFilter(), x, reco::Vertex::x(), detailsBasic3DVector::y, reco::Vertex::y(), and reco::Vertex::z().

Referenced by build().

339 {
340  m_infoCanvas->cd();
341 
342  float_t x = 0.02;
343  float y = 0.95;
344 
345  TLatex* latex = new TLatex( x, y, "" );
346  const double textsize( 0.07 );
347  latex->SetTextSize( 2*textsize );
348 
349  latex->DrawLatex( x, y, id.item()->modelName( id.index()).c_str());
350  y -= latex->GetTextSize()*0.6;
351 
352  latex->SetTextSize( textsize );
353  float lineH = latex->GetTextSize()*0.6;
354 
355  latex->DrawLatex( x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
356  sqrt(conv->pairMomentum().Perp2()), conv->pairMomentum().eta(), conv->pairMomentum().phi() ));
357  y -= lineH;
358  latex->DrawLatex( x, y, Form("vtx=(%.1f, %.1f, %.1f) r=%.1f [cm]",
359  conv->conversionVertex().x(), conv->conversionVertex().y(), conv->conversionVertex().z(),
360  conv->conversionVertex().position().rho() ));
361  y -= lineH;
362  latex->DrawLatex( x, y, Form("#Deltactg#theta=%.3f",
363  conv->pairCotThetaSeparation() ));
364  y -= lineH;
365  latex->DrawLatex( x, y, Form("#Delta#phi_{vtx}=%.3f",
366  conv->dPhiTracksAtVtx() ));
367  y -= lineH;
368  latex->DrawLatex( x, y, Form("dist. min. app.=%.3f cm",
369  conv->distOfMinimumApproach() ));
370  y -= lineH;
371  y -= lineH;
372 
373 
374  const reco::Track* track0 = conv->tracks().at(0).get();
375  latex->DrawLatex( x, y, Form("Trk0 q=%i",track0->charge()));
376  y -= lineH;
377  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
378  track0->pt(), track0->eta(), track0->phi()));
379  y -= lineH;
380  const reco::HitPattern& p_tk0 = track0->hitPattern();
381  int nvalid_tk0=0, ninvalid_tk0=0, npix_tk0=0, nstrip_tk0=0;
382  for(int i_tk0=0; i_tk0<p_tk0.numberOfHits(); i_tk0++) {
383  uint32_t hit = p_tk0.getHitPattern(i_tk0);
384  if(p_tk0.validHitFilter(hit)) {
385  nvalid_tk0++;
386  if (p_tk0.pixelHitFilter(hit)) npix_tk0++;
387  else if (p_tk0.stripHitFilter(hit)) nstrip_tk0++;
388  } else ninvalid_tk0++;
389  }
390  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk0, npix_tk0, nstrip_tk0) );
391  y -= lineH;
392  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk0) );
393  y -= lineH;
394  const reco::HitPattern& p_mhi_tk0 = track0->trackerExpectedHitsInner();
395  int npix_mhi_tk0=0, nstrip_mhi_tk0=0;
396  for(int i_mhi_tk0=0; i_mhi_tk0<p_mhi_tk0.numberOfHits(); i_mhi_tk0++) {
397  uint32_t hit = p_mhi_tk0.getHitPattern(i_mhi_tk0);
398  if (p_mhi_tk0.pixelHitFilter(hit)) npix_mhi_tk0++;
399  else if (p_mhi_tk0.stripHitFilter(hit)) nstrip_mhi_tk0++;
400  }
401  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk0, nstrip_mhi_tk0) );
402 
403  y -= lineH;
404  y -= lineH;
405  const reco::Track* track1 = conv->tracks().at(1).get();
406  latex->DrawLatex( x, y, Form("Trk1 q=%i",track1->charge()));
407  y -= lineH;
408  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
409  track1->pt(), track1->eta(), track1->phi()));
410  y -= lineH;
411  const reco::HitPattern& p_tk1 = track1->hitPattern();
412  int nvalid_tk1=0, ninvalid_tk1=0, npix_tk1=0, nstrip_tk1=0;
413  for(int i_tk1=0; i_tk1<p_tk1.numberOfHits(); i_tk1++) {
414  uint32_t hit = p_tk1.getHitPattern(i_tk1);
415  if(p_tk1.validHitFilter(hit)) {
416  nvalid_tk1++;
417  if (p_tk1.pixelHitFilter(hit)) npix_tk1++;
418  else if (p_tk1.stripHitFilter(hit)) nstrip_tk1++;
419  } else ninvalid_tk1++;
420  }
421  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk1, npix_tk1, nstrip_tk1) );
422  y -= lineH;
423  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk1) );
424  y -= lineH;
425  const reco::HitPattern& p_mhi_tk1 = track1->trackerExpectedHitsInner();
426  int npix_mhi_tk1=0, nstrip_mhi_tk1=0;
427  for(int i_mhi_tk1=0; i_mhi_tk1<p_mhi_tk1.numberOfHits(); i_mhi_tk1++) {
428  uint32_t hit = p_mhi_tk1.getHitPattern(i_mhi_tk1);
429  if (p_mhi_tk1.pixelHitFilter(hit)) npix_mhi_tk1++;
430  else if (p_mhi_tk1.stripHitFilter(hit)) nstrip_mhi_tk1++;
431  }
432  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk1, nstrip_mhi_tk1) );
433  y -= lineH;
434  y -= lineH;
435 }
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:97
double y() const
y coordinate
Definition: Vertex.h:110
const FWEventItem * item()
double distOfMinimumApproach() const
Definition: Conversion.h:125
double pairCotThetaSeparation() const
Delta cot(Theta) where Theta is the angle in the (y,z) plane between the two tracks. Original tracks are used.
Definition: Conversion.cc:209
double phi() const
azimuthal angle of momentum vector
Definition: TrackBase.h:137
const Point & position() const
position
Definition: Vertex.h:106
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:139
T sqrt(T t)
Definition: SSEVec.h:48
double pt() const
track transverse momentum
Definition: TrackBase.h:129
static bool pixelHitFilter(uint32_t pattern)
Definition: HitPattern.h:419
int numberOfHits() const
Definition: HitPattern.cc:211
double z() const
y coordinate
Definition: Vertex.h:112
const HitPattern & trackerExpectedHitsInner() const
Access the hit pattern counting (in the Tracker) the number of expected crossed layers before the fir...
Definition: TrackBase.h:223
static bool validHitFilter(uint32_t pattern)
Definition: HitPattern.h:564
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:221
double x() const
x coordinate
Definition: Vertex.h:108
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:223
static bool stripHitFilter(uint32_t pattern)
Definition: HitPattern.h:441
int charge() const
track electric charge
Definition: TrackBase.h:111
Definition: DDAxes.h:10
uint32_t getHitPattern(int position) const
Definition: HitPattern.cc:142
double dPhiTracksAtVtx() const
Definition: Conversion.cc:313
std::vector< edm::RefToBase< reco::Track > > const & tracks() const
vector of track to base references
Definition: Conversion.cc:176
void FWConvTrackHitsDetailView::switchProjection ( )

Definition at line 601 of file FWConvTrackHitsDetailView.cc.

References m_camTypeAction, m_orthographic, and CSGAction::setName().

Referenced by build().

602 {
604  m_camTypeAction->setName(m_orthographic ? "Set Perspective Projection" : "Set Orthographic Projection");
605 
606  (this->*foo) ();
607  //printf("current isOrthographic : %d \n", viewerGL()->CurrentCamera().IsOrthographic());
608 }
void setName(const std::string &name)
Definition: CSGAction.cc:93

Member Data Documentation

TEveElement* FWConvTrackHitsDetailView::m_calo3D
private

Definition at line 69 of file FWConvTrackHitsDetailView.h.

CSGAction* FWConvTrackHitsDetailView::m_camTypeAction
private

Definition at line 73 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and switchProjection().

TEveElementList* FWConvTrackHitsDetailView::m_hits
private

Definition at line 68 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrHits().

TLegend* FWConvTrackHitsDetailView::m_legend
private

Definition at line 71 of file FWConvTrackHitsDetailView.h.

TEveElementList* FWConvTrackHitsDetailView::m_moduleLabels
private

Definition at line 67 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrLabels().

TEveElementList* FWConvTrackHitsDetailView::m_modules
private

Definition at line 66 of file FWConvTrackHitsDetailView.h.

Referenced by build(), and rnrModules().

bool FWConvTrackHitsDetailView::m_orthographic
private