CMS 3D CMS Logo

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 47 of file FWConvTrackHitsDetailView.cc.

FWConvTrackHitsDetailView::~FWConvTrackHitsDetailView ( )
virtual

Definition at line 56 of file FWConvTrackHitsDetailView.cc.

References findQualityFiles::v.

57 {
58 }
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 457 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 491 of file FWConvTrackHitsDetailView.cc.

References TrackingRecHit::bad, FWDisplayProperties::color(), MuonSubdetId::CSC, FWEventItem::defaultDisplayProperties(), DetId::det(), MuonSubdetId::DT, fwLog, FWGeometry::getEveShape(), FWEventItem::getGeom(), TrackingRecHit::inactive, fireworks::info(), fwlog::kInfo, TrackingRecHit::missing, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, DetId::Muon, dataset::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().

495 {
496  std::set<unsigned int> ids;
497  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
498  recIt != recItEnd; ++recIt )
499  {
500  DetId detid = (*recIt)->geographicalId();
501  if( !addLostHits && !(*recIt)->isValid()) continue;
502  if( detid.rawId() != 0 )
503  {
504  TString name("");
505  switch( detid.det())
506  {
507  case DetId::Tracker:
508  switch( detid.subdetId())
509  {
510  case SiStripDetId::TIB:
511  name = "TIB ";
512  break;
513  case SiStripDetId::TOB:
514  name = "TOB ";
515  break;
516  case SiStripDetId::TID:
517  name = "TID ";
518  break;
519  case SiStripDetId::TEC:
520  name = "TEC ";
521  break;
523  name = "Pixel Barrel ";
524  break;
526  name = "Pixel Endcap ";
527  default:
528  break;
529  }
530  break;
531 
532  case DetId::Muon:
533  switch( detid.subdetId())
534  {
535  case MuonSubdetId::DT:
536  name = "DT";
537  detid = DetId( DTChamberId( detid )); // get rid of layer bits
538  break;
539  case MuonSubdetId::CSC:
540  name = "CSC";
541  break;
542  case MuonSubdetId::RPC:
543  name = "RPC";
544  break;
545  default:
546  break;
547  }
548  break;
549  default:
550  break;
551  }
552  if( ! ids.insert( detid.rawId()).second ) continue;
553  if( iItem->getGeom())
554  {
555  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
556  if( 0 != shape )
557  {
558  shape->SetMainTransparency( 65 );
559  shape->SetPickable( kTRUE );
560  switch(( *recIt )->type())
561  {
563  shape->SetMainColor( iItem->defaultDisplayProperties().color());
564  break;
568  name += "LOST ";
569  shape->SetMainColor( kRed );
570  break;
572  name += "INACTIVE ";
573  shape->SetMainColor( 28 );
574  break;
575  case TrackingRecHit::bad:
576  name += "BAD ";
577  shape->SetMainColor( 218 );
578  break;
579  }
580  shape->SetTitle( name + ULong_t( detid.rawId()));
581  trkList->AddElement( shape );
582  }
583  else
584  {
585  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
586  << "\n" << fireworks::info( detid ) << std::endl;
587  }
588  }
589  }
590  }
591 }
const FWDisplayProperties & defaultDisplayProperties() const
Definition: FWEventItem.cc:453
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:259
trackingRecHit_iterator recHitsBegin() const
Iterator to first hit on the track.
Definition: Track.h:104
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:663
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:683
TrackingRecHitCollection::base::const_iterator trackingRecHit_iterator
iterator over a vector of reference to TrackingRecHit in the same collection
trackingRecHit_iterator recHitsEnd() const
Iterator to last hit on the track.
Definition: Track.h:109
void FWConvTrackHitsDetailView::addTrackerHits3D ( std::vector< TVector3 > &  points,
class TEveElementList *  tList,
Color_t  color,
int  size 
)
private

Definition at line 438 of file FWConvTrackHitsDetailView.cc.

Referenced by addHits().

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

Implements FWDetailView< reco::Conversion >.

Definition at line 92 of file FWConvTrackHitsDetailView.cc.

References Abs(), mps_alisetup::action, CSGAction::activated, addHits(), addModules(), b, FWECALCaloDataDetailViewBuilder::buildCaloData(), EnergyCorrector::c, camera1Callback(), camera2Callback(), camera3Callback(), MessageLogger_cfi::cerr, create_public_lumi_plots::color, FWDetailViewBase::context(), CSGAction::createTextButton(), data, end, stringResolutionProvider_cfi::eta, reco::Track::extra(), f, fireworks::Context::getBeamSpot(), CaloRecHitAuxSetter::getField(), CSGAction::getName(), mps_fire::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, dataset::name, reco::Conversion::nTracks(), AlCaHLTBitMon_ParallelJobs::p, reco::Conversion::pairMomentum(), phi, fireworks::prepareTrack(), alignCSCRings::r, rnrHits(), rnrModules(), setTextInfo(), Sign(), switchProjection(), RecoTauValidation_cfi::text, theta(), reco::Conversion::tracks(), up, FWDetailViewGL< reco::Conversion >::viewerGL(), x, FWBeamSpot::x0(), y, FWBeamSpot::y0(), z, and FWBeamSpot::z0().

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

Definition at line 634 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 643 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 653 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 595 of file FWConvTrackHitsDetailView.cc.

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

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

Definition at line 627 of file FWConvTrackHitsDetailView.cc.

References m_hits.

Referenced by build().

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

Definition at line 613 of file FWConvTrackHitsDetailView.cc.

References m_moduleLabels.

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

Definition at line 620 of file FWConvTrackHitsDetailView.cc.

References m_modules.

Referenced by build().

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

Implements FWDetailView< reco::Conversion >.

Definition at line 336 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(), diffTreeTool::index, FWDetailViewBase::item(), FWDetailViewGL< reco::Conversion >::m_infoCanvas, reco::HitPattern::MISSING_INNER_HITS, ecalBarrelClusterFastTimer_cfi::modelName, 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::HitPattern::TRACK_HITS, reco::Conversion::tracks(), reco::HitPattern::validHitFilter(), x, reco::Vertex::x(), y, reco::Vertex::y(), and reco::Vertex::z().

Referenced by build().

337 {
338  m_infoCanvas->cd();
339 
340  float_t x = 0.02;
341  float y = 0.95;
342 
343  TLatex* latex = new TLatex( x, y, "" );
344  const double textsize( 0.07 );
345  latex->SetTextSize( 2*textsize );
346 
347  latex->DrawLatex( x, y, id.item()->modelName( id.index()).c_str());
348  y -= latex->GetTextSize()*0.6;
349 
350  latex->SetTextSize( textsize );
351  float lineH = latex->GetTextSize()*0.6;
352 
353  latex->DrawLatex( x, y, Form("p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
354  sqrt(conv->pairMomentum().Perp2()), conv->pairMomentum().eta(), conv->pairMomentum().phi() ));
355  y -= lineH;
356  latex->DrawLatex( x, y, Form("vtx=(%.1f, %.1f, %.1f) r=%.1f [cm]",
357  conv->conversionVertex().x(), conv->conversionVertex().y(), conv->conversionVertex().z(),
358  conv->conversionVertex().position().rho() ));
359  y -= lineH;
360  latex->DrawLatex( x, y, Form("#Deltactg#theta=%.3f",
361  conv->pairCotThetaSeparation() ));
362  y -= lineH;
363  latex->DrawLatex( x, y, Form("#Delta#phi_{vtx}=%.3f",
364  conv->dPhiTracksAtVtx() ));
365  y -= lineH;
366  latex->DrawLatex( x, y, Form("dist. min. app.=%.3f cm",
367  conv->distOfMinimumApproach() ));
368  y -= lineH;
369  y -= lineH;
370 
371 
372  const reco::Track* track0 = conv->tracks().at(0).get();
373  latex->DrawLatex( x, y, Form("Trk0 q=%i",track0->charge()));
374  y -= lineH;
375  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
376  track0->pt(), track0->eta(), track0->phi()));
377  y -= lineH;
378  const reco::HitPattern &hp0 = track0->hitPattern();
379  int nvalid_tk0 = 0, ninvalid_tk0 = 0, npix_tk0 = 0, nstrip_tk0 = 0;
380  for(int i_tk0 = 0; i_tk0 < hp0.numberOfHits(reco::HitPattern::TRACK_HITS); i_tk0++) {
381  uint32_t hit = hp0.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk0);
383  nvalid_tk0++;
384  if (reco::HitPattern::pixelHitFilter(hit)) npix_tk0++;
385  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_tk0++;
386  } else ninvalid_tk0++;
387  }
388  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk0, npix_tk0, nstrip_tk0) );
389  y -= lineH;
390  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk0) );
391  y -= lineH;
392 
393  int npix_mhi_tk0 = 0, nstrip_mhi_tk0 = 0;
394  for(int i_mhi_tk0 = 0; i_mhi_tk0 < hp0.numberOfHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk0++) {
395  uint32_t hit = hp0.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk0);
396  if (reco::HitPattern::pixelHitFilter(hit)) npix_mhi_tk0++;
397  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_mhi_tk0++;
398  }
399  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk0, nstrip_mhi_tk0) );
400 
401  y -= lineH;
402  y -= lineH;
403  const reco::Track* track1 = conv->tracks().at(1).get();
404  latex->DrawLatex( x, y, Form("Trk1 q=%i",track1->charge()));
405  y -= lineH;
406  latex->DrawLatex( x, y, Form( "p_{T}=%.1f GeV, #eta=%0.2f, #varphi=%0.2f",
407  track1->pt(), track1->eta(), track1->phi()));
408  y -= lineH;
409 
410  const reco::HitPattern &hp1 = track1->hitPattern();
411  int nvalid_tk1 = 0, ninvalid_tk1 = 0, npix_tk1 = 0, nstrip_tk1 = 0;
412  for(int i_tk1 = 0; i_tk1 < hp1.numberOfHits(reco::HitPattern::TRACK_HITS); i_tk1++) {
413  uint32_t hit = hp1.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk1);
415  nvalid_tk1++;
416  if (reco::HitPattern::pixelHitFilter(hit)) npix_tk1++;
417  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_tk1++;
418  } else ninvalid_tk1++;
419  }
420  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk1, npix_tk1, nstrip_tk1) );
421  y -= lineH;
422  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk1) );
423  y -= lineH;
424 
425  int npix_mhi_tk1 = 0, nstrip_mhi_tk1 = 0;
426  for(int i_mhi_tk1 = 0; i_mhi_tk1 < hp1.numberOfHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk1++) {
427  uint32_t hit = hp1.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk1);
428  if (reco::HitPattern::pixelHitFilter(hit)) npix_mhi_tk1++;
429  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_mhi_tk1++;
430  }
431  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk1, nstrip_mhi_tk1) );
432  y -= lineH;
433  y -= lineH;
434 }
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:97
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:564
double y() const
y coordinate
Definition: Vertex.h:113
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:640
const Point & position() const
position
Definition: Vertex.h:109
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:787
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:646
T sqrt(T t)
Definition: SSEVec.h:18
double pt() const
track transverse momentum
Definition: TrackBase.h:616
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:595
double z() const
z coordinate
Definition: Vertex.h:115
double x() const
x coordinate
Definition: Vertex.h:111
math::XYZVectorF pairMomentum() const
Conversion tracks momentum from the tracks inner momentum.
Definition: Conversion.cc:223
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:445
int charge() const
track electric charge
Definition: TrackBase.h:562
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:515
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
int numberOfHits(HitCategory category) const
Definition: HitPattern.h:807
void FWConvTrackHitsDetailView::switchProjection ( )

Definition at line 602 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

603 {
605  m_camTypeAction->setName(m_orthographic ? "Set Perspective Projection" : "Set Orthographic Projection");
606 
607  (this->*foo) ();
608  //printf("current isOrthographic : %d \n", viewerGL()->CurrentCamera().IsOrthographic());
609 }
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