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

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

Referenced by build().

463 {
464  std::vector<TVector3> pixelPoints;
465  fireworks::pushPixelHits( pixelPoints, *iItem, track );
466  TEveElementList* pixels = new TEveElementList( "Pixels" );
467  trkList->AddElement( pixels );
468  if( addNearbyHits )
469  {
470  // get the extra hits
471  std::vector<TVector3> pixelExtraPoints;
472  fireworks::pushNearbyPixelHits( pixelExtraPoints, *iItem, track );
473  // draw first the others
474  addTrackerHits3D( pixelExtraPoints, pixels, kRed, 1 );
475  // then the good ones, so they're on top
476  addTrackerHits3D( pixelPoints, pixels, kGreen, 1 );
477  }
478  else
479  {
480  // just add those points with the default color
481  addTrackerHits3D( pixelPoints, pixels, iItem->defaultDisplayProperties().color(), 1 );
482  }
483 
484  // strips
485  TEveElementList* strips = new TEveElementList( "Strips" );
486  trkList->AddElement( strips );
487  fireworks::addSiStripClusters( iItem, track, strips, addNearbyHits, false );
488 }
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 493 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, TrackingRecHit::missing_inner, TrackingRecHit::missing_outer, 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().

497 {
498  std::set<unsigned int> ids;
499  for( trackingRecHit_iterator recIt = track.recHitsBegin(), recItEnd = track.recHitsEnd();
500  recIt != recItEnd; ++recIt )
501  {
502  DetId detid = (*recIt)->geographicalId();
503  if( !addLostHits && !(*recIt)->isValid()) continue;
504  if( detid.rawId() != 0 )
505  {
506  TString name("");
507  switch( detid.det())
508  {
509  case DetId::Tracker:
510  switch( detid.subdetId())
511  {
512  case SiStripDetId::TIB:
513  name = "TIB ";
514  break;
515  case SiStripDetId::TOB:
516  name = "TOB ";
517  break;
518  case SiStripDetId::TID:
519  name = "TID ";
520  break;
521  case SiStripDetId::TEC:
522  name = "TEC ";
523  break;
525  name = "Pixel Barrel ";
526  break;
528  name = "Pixel Endcap ";
529  default:
530  break;
531  }
532  break;
533 
534  case DetId::Muon:
535  switch( detid.subdetId())
536  {
537  case MuonSubdetId::DT:
538  name = "DT";
539  detid = DetId( DTChamberId( detid )); // get rid of layer bits
540  break;
541  case MuonSubdetId::CSC:
542  name = "CSC";
543  break;
544  case MuonSubdetId::RPC:
545  name = "RPC";
546  break;
547  default:
548  break;
549  }
550  break;
551  default:
552  break;
553  }
554  if( ! ids.insert( detid.rawId()).second ) continue;
555  if( iItem->getGeom())
556  {
557  TEveGeoShape* shape = iItem->getGeom()->getEveShape( detid );
558  if( 0 != shape )
559  {
560  shape->SetMainTransparency( 65 );
561  shape->SetPickable( kTRUE );
562  switch(( *recIt )->type())
563  {
565  shape->SetMainColor( iItem->defaultDisplayProperties().color());
566  break;
570  name += "LOST ";
571  shape->SetMainColor( kRed );
572  break;
574  name += "INACTIVE ";
575  shape->SetMainColor( 28 );
576  break;
577  case TrackingRecHit::bad:
578  name += "BAD ";
579  shape->SetMainColor( 218 );
580  break;
581  }
582  shape->SetTitle( name + ULong_t( detid.rawId()));
583  trkList->AddElement( shape );
584  }
585  else
586  {
587  fwLog( fwlog::kInfo ) << "Failed to get shape extract for a tracking rec hit: "
588  << "\n" << fireworks::info( detid ) << std::endl;
589  }
590  }
591  }
592  }
593 }
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:253
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: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
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 440 of file FWConvTrackHitsDetailView.cc.

Referenced by addHits().

441 {
442  // !AMT this is detail view specific, should move to track hits
443  // detail view
444 
445  TEvePointSet* pointSet = new TEvePointSet();
446  pointSet->SetMarkerSize(size);
447  pointSet->SetMarkerStyle(4);
448  pointSet->SetPickable(kTRUE);
449  pointSet->SetTitle("Pixel Hits");
450  pointSet->SetMarkerColor(color);
451 
452  for( std::vector<TVector3>::const_iterator it = points.begin(), itEnd = points.end(); it != itEnd; ++it) {
453  pointSet->SetNextPoint(it->x(), it->y(), it->z());
454  }
455  tList->AddElement(pointSet);
456 }
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(), EnergyCorrector::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(), up, 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
Definition: BitonicSort.h:8
void addModules(const reco::Track &track, const FWEventItem *iItem, TEveElement *trkList, bool addLostHits)
bool isAvailable() const
Definition: Ref.h:614
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:189
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
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 636 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 645 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 655 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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

Definition at line 597 of file FWConvTrackHitsDetailView.cc.

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

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

Definition at line 629 of file FWConvTrackHitsDetailView.cc.

References m_hits.

Referenced by build().

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

Definition at line 615 of file FWConvTrackHitsDetailView.cc.

References m_moduleLabels.

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

Definition at line 622 of file FWConvTrackHitsDetailView.cc.

References m_modules.

Referenced by build().

623 {
624  m_modules->SetRnrChildren(!m_modules->GetRnrChildren());
625  gEve->Redraw3D();
626 }
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::MISSING_INNER_HITS, 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(), 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 &hp0 = track0->hitPattern();
381  int nvalid_tk0 = 0, ninvalid_tk0 = 0, npix_tk0 = 0, nstrip_tk0 = 0;
382  for(int i_tk0 = 0; i_tk0 < hp0.numberOfHits(reco::HitPattern::TRACK_HITS); i_tk0++) {
383  uint32_t hit = hp0.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk0);
385  nvalid_tk0++;
386  if (reco::HitPattern::pixelHitFilter(hit)) npix_tk0++;
387  else if (reco::HitPattern::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 
395  int npix_mhi_tk0 = 0, nstrip_mhi_tk0 = 0;
396  for(int i_mhi_tk0 = 0; i_mhi_tk0 < hp0.numberOfHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk0++) {
397  uint32_t hit = hp0.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk0);
398  if (reco::HitPattern::pixelHitFilter(hit)) npix_mhi_tk0++;
399  else if (reco::HitPattern::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 
412  const reco::HitPattern &hp1 = track1->hitPattern();
413  int nvalid_tk1 = 0, ninvalid_tk1 = 0, npix_tk1 = 0, nstrip_tk1 = 0;
414  for(int i_tk1 = 0; i_tk1 < hp1.numberOfHits(reco::HitPattern::TRACK_HITS); i_tk1++) {
415  uint32_t hit = hp1.getHitPattern(reco::HitPattern::TRACK_HITS, i_tk1);
417  nvalid_tk1++;
418  if (reco::HitPattern::pixelHitFilter(hit)) npix_tk1++;
419  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_tk1++;
420  } else ninvalid_tk1++;
421  }
422  latex->DrawLatex( x, y, Form( "valid hits: %i (pix. %i, str. %i)", nvalid_tk1, npix_tk1, nstrip_tk1) );
423  y -= lineH;
424  latex->DrawLatex( x, y, Form( "invalid: %i", ninvalid_tk1) );
425  y -= lineH;
426 
427  int npix_mhi_tk1 = 0, nstrip_mhi_tk1 = 0;
428  for(int i_mhi_tk1 = 0; i_mhi_tk1 < hp1.numberOfHits(reco::HitPattern::MISSING_INNER_HITS); i_mhi_tk1++) {
429  uint32_t hit = hp1.getHitPattern(reco::HitPattern::MISSING_INNER_HITS, i_mhi_tk1);
430  if (reco::HitPattern::pixelHitFilter(hit)) npix_mhi_tk1++;
431  else if (reco::HitPattern::stripHitFilter(hit)) nstrip_mhi_tk1++;
432  }
433  latex->DrawLatex( x, y, Form("miss. inner hits: pix. %i, str. %i", npix_mhi_tk1, nstrip_mhi_tk1) );
434  y -= lineH;
435  y -= lineH;
436 }
const reco::Vertex & conversionVertex() const
returns the reco conversion vertex
Definition: Conversion.h:97
static bool pixelHitFilter(uint16_t pattern)
Definition: HitPattern.h:505
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:693
const Point & position() const
position
Definition: Vertex.h:106
static bool validHitFilter(uint16_t pattern)
Definition: HitPattern.h:698
double eta() const
pseudorapidity of momentum vector
Definition: TrackBase.h:699
T sqrt(T t)
Definition: SSEVec.h:48
double pt() const
track transverse momentum
Definition: TrackBase.h:669
static bool stripHitFilter(uint16_t pattern)
Definition: HitPattern.h:536
double z() const
y coordinate
Definition: Vertex.h:112
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
const HitPattern & hitPattern() const
Access the hit pattern, indicating in which Tracker layers the track has hits.
Definition: TrackBase.h:384
int charge() const
track electric charge
Definition: TrackBase.h:615
Definition: DDAxes.h:10
uint16_t getHitPattern(HitCategory category, int position) const
Definition: HitPattern.h:456
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:718
void FWConvTrackHitsDetailView::switchProjection ( )

Definition at line 604 of file FWConvTrackHitsDetailView.cc.

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

Referenced by build().

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