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
00033
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
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