CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/RecoParticleFlow/PFRootEvent/src/GPFTrack.cc

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