00001 #include "DataFormats/ParticleFlowReco/interface/PFLayer.h"
00002 #include "RecoParticleFlow/PFRootEvent/interface/GPFRecHit.h"
00003 #include "TPad.h"
00004 #include "TObject.h"
00005 #include "TGraph.h"
00006 #include <string>
00007
00008
00009
00010 GPFRecHit::GPFRecHit(DisplayManager * display,int view,int ident,
00011 reco::PFRecHit *rechit,int size,
00012 double *x, double *y, int color, std::string option)
00013 : GPFBase(display,view,ident, color),
00014 TGraph(size,x,y),
00015 recHit_(rechit), option_(option)
00016 {
00017 ResetBit(kCanDelete);
00018
00019 en_=recHit_->energy();
00020
00021 SetLineColor(color_);
00022 SetFillColor(color_);
00023
00024 }
00025
00026 void GPFRecHit::Print()
00027 {
00028 std::cout<<*recHit_<<std::endl;
00029 }
00030
00031 void GPFRecHit::ExecuteEvent(Int_t event, Int_t px, Int_t py)
00032 {
00033
00034
00035
00036 gPad->SetCursor(kHand);
00037 switch (event) {
00038 case kButton1Down:
00039 Print();
00040 display_->findAndDraw(origId_);
00041 break;
00042 default:break;
00043 }
00044 }
00045
00046 void GPFRecHit::draw()
00047 {
00048 TGraph::Draw(option_.data());
00049 }
00050
00051 void GPFRecHit::setColor(int color)
00052 {
00053 if (option_=="f") SetFillColor(color);
00054 else SetLineColor(color);
00055 }
00056
00057 void GPFRecHit::setInitialColor()
00058 {
00059 if (option_=="f") SetFillColor(color_);
00060 else SetLineColor(color_);
00061 }
00062
00063 void GPFRecHit::setColor()
00064 {
00065 if (option_=="f") SetFillColor(color_);
00066 else SetLineColor(color_);
00067 }
00068
00069
00070 void GPFRecHit::setNewSize()
00071 {
00072
00073 }
00074
00075 void GPFRecHit::setNewStyle()
00076 {
00077
00078 }