CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/RecoParticleFlow/PFRootEvent/src/GPFRecHit.cc

Go to the documentation of this file.
00001 #include "DataFormats/ParticleFlowReco/interface/PFLayer.h"
00002 #include "RecoParticleFlow/PFRootEvent/interface/GPFRecHit.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 GPFRecHit::GPFRecHit(DisplayManager * display,int view,int ident,
00012                      reco::PFRecHit *rechit,int size,
00013                      double *x, double *y, int color, std::string option)
00014   : GPFBase(display,view,ident, color),
00015     TGraph(size,x,y),
00016     recHit_(rechit), option_(option)
00017 {
00018   ResetBit(kCanDelete);
00019   
00020   en_=recHit_->energy();  
00021     
00022   SetLineColor(color_);
00023   SetFillColor(color_);
00024   
00025 }                    
00026 //__________________________________________________________________________
00027 void GPFRecHit::Print()
00028 {
00029   std::cout<<*recHit_<<std::endl;
00030 }
00031 //___________________________________________________________________________
00032 void GPFRecHit::ExecuteEvent(Int_t event, Int_t px, Int_t py)
00033 {
00034   // Execute action corresponding to a mouse click 
00035   //on a GPFRecHit object in the window
00036 
00037   gPad->SetCursor(kHand);
00038   switch (event) {
00039   case kButton1Down:
00040     Print();
00041     display_->findAndDraw(origId_);
00042     break;
00043   default:break;
00044   }    
00045 }
00046 //__________________________________________________________________________
00047 void GPFRecHit::draw()
00048 {
00049   TGraph::Draw(option_.data());
00050 }
00051 //__________________________________________________________________________
00052 void GPFRecHit::setColor(int color)
00053 {
00054   if (option_=="f") SetFillColor(color);
00055   else              SetLineColor(color);
00056 }
00057 //_________________________________________________________________________
00058 void GPFRecHit::setInitialColor()
00059 {
00060   if (option_=="f") SetFillColor(color_);
00061   else              SetLineColor(color_);
00062 }
00063 //_________________________________________________________________________
00064 void GPFRecHit::setColor()
00065 {
00066   if (option_=="f") SetFillColor(color_);
00067   else              SetLineColor(color_);
00068 }
00069 
00070 //_________________________________________________________________________
00071 void GPFRecHit::setNewSize() 
00072 {
00073   //not implemented
00074 }
00075 //_________________________________________________________________________
00076 void GPFRecHit::setNewStyle()
00077 {
00078   //not implemented
00079 }