CMS 3D CMS Logo

GPFTrack.cc

Go to the documentation of this file.
00001 #include "RecoParticleFlow/PFRootEvent/interface/GPFTrack.h"
00002 #include "TPad.h"
00003 #include "TObject.h"
00004 #include "TGraph.h"
00005 #include <string>
00006 
00007 
00008 //________________________________________________________________________
00009 GPFTrack::GPFTrack(DisplayManager * display,int view,int ident,
00010                    reco::PFRecTrack *tra, int size, double *x, double *y,
00011                    double pt,TAttMarker *attm,TAttLine * attl, std::string option)
00012   : GPFBase(display,view,ident,attm,attl ),
00013     TGraph(size,x,y), track_(tra),pt_(pt), option_(option)
00014 {
00015   ResetBit(kCanDelete);
00016   
00017   SetLineColor(lineAttr_->GetLineColor());
00018   SetLineStyle(lineAttr_->GetLineStyle());
00019   SetMarkerStyle(markerAttr_->GetMarkerStyle());
00020   SetMarkerSize(markerAttr_->GetMarkerSize());
00021   SetMarkerColor(markerAttr_->GetMarkerColor());
00022   
00023 }                    
00024 //____________________________________________________________________________________________________________
00025 void GPFTrack::Print()
00026 {
00027   std::cout<<*track_<<std::endl;
00028 }
00029 //_______________________________________________________________________________    
00030 void GPFTrack::ExecuteEvent(Int_t event, Int_t px, Int_t py)
00031 {
00032   // Execute action corresponding to a left mouse button click 
00033   //on a GPFTrack object in the window
00034 
00035   gPad->SetCursor(kHand);
00036   switch (event) {
00037   case kButton1Down:
00038     Print();
00039     display_->findBlock(origId_);
00040     display_->findAndDraw(origId_);
00041     break;
00042   default:break;
00043   }    
00044      
00045 }
00046 //______________________________________________________________________________
00047 void GPFTrack::draw()
00048 {
00049   TGraph::Draw(option_.data());
00050 }
00051 //______________________________________________________________________________
00052 void GPFTrack::setColor()
00053 {
00054   if (option_=="f") SetFillColor(lineAttr_->GetLineColor());
00055   else              SetLineColor(lineAttr_->GetLineColor());
00056   SetMarkerColor(markerAttr_->GetMarkerColor());
00057 }
00058 //______________________________________________________________________________
00059 void GPFTrack::setColor(int color)
00060 {
00061   if (option_=="f") SetFillColor(color);
00062   else              SetLineColor(color);
00063   SetMarkerColor(color);
00064 }
00065 
00066 //_____________________________________________________________________________
00067 void GPFTrack::setInitialColor()
00068   //redondant avec setColor ???? to check
00069 {
00070   if (option_=="f") SetFillColor(lineAttr_->GetLineColor());
00071   else              SetLineColor(lineAttr_->GetLineColor());
00072   SetMarkerColor(markerAttr_->GetMarkerColor());
00073 }
00074 //_____________________________________________________________________________
00075 void GPFTrack::setNewSize()
00076 {
00077   SetMarkerSize(markerAttr_->GetMarkerSize());
00078 }
00079 //____________________________________________________________________________
00080 void GPFTrack::setNewStyle()
00081 {
00082   SetMarkerStyle(markerAttr_->GetMarkerStyle());
00083 }
00084  

Generated on Tue Jun 9 17:44:46 2009 for CMSSW by  doxygen 1.5.4