CMS 3D CMS Logo

GPFSimParticle.cc

Go to the documentation of this file.
00001 #include "RecoParticleFlow/PFRootEvent/interface/GPFSimParticle.h"
00002 #include "TPad.h"
00003 #include "TObject.h"
00004 #include "TGraph.h"
00005 #include <string>
00006 
00007 
00008 
00009 //________________________________________________________________________
00010 GPFSimParticle::GPFSimParticle(DisplayManager *display,int view, int ident, 
00011                                const reco::PFSimParticle *ptc, 
00012                                int size, double *x, double *y,
00013                                double pt,TAttMarker *attm, TAttLine *attl,
00014                                std::string option)
00015   : GPFBase(display,view,ident,attm,attl),
00016     TGraph(size,x,y), part_(ptc), pt_(pt), option_(option) 
00017 {
00018     
00019   ResetBit(kCanDelete);
00020   SetLineColor(lineAttr_->GetLineColor());
00021   SetLineStyle(lineAttr_->GetLineStyle());
00022   SetMarkerStyle(markerAttr_->GetMarkerStyle());
00023   SetMarkerSize(markerAttr_->GetMarkerSize());
00024   SetMarkerColor(markerAttr_->GetMarkerColor());
00025 }                    
00026 //____________________________________________________________________________________________________________
00027 void GPFSimParticle::Print()
00028 {
00029   std::cout<<*part_<<std::endl;
00030 }
00031 //_______________________________________________________________________________    
00032 void GPFSimParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py)
00033 {
00034   // Execute action corresponding to a left mouse button click 
00035   //on a GPFSimParticle 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 GPFSimParticle::draw()
00048 {
00049   TGraph::Draw(option_.data());
00050 }
00051 //_______________________________________________________________________________
00052 void GPFSimParticle::setColor()
00053 {
00054   if (option_=="f") SetFillColor(lineAttr_->GetLineColor());
00055   else              SetLineColor(lineAttr_->GetLineColor());
00056   SetMarkerColor(markerAttr_->GetMarkerColor());
00057 }
00058 //_______________________________________________________________________________
00059 void GPFSimParticle::setColor(int newcol)
00060 {
00061   if (option_=="f") SetFillColor(newcol);
00062   else              SetLineColor(newcol);
00063   SetMarkerColor(newcol);
00064 }
00065 //_____________________________________________________________________________
00066 void GPFSimParticle::setInitialColor()
00067 {
00068   if (option_=="f") SetFillColor(lineAttr_->GetLineColor());
00069   else              SetLineColor(lineAttr_->GetLineColor());
00070   SetMarkerColor(markerAttr_->GetMarkerColor());
00071 }
00072 //_____________________________________________________________________________
00073 void GPFSimParticle::setNewSize()
00074 {
00075   SetMarkerSize(markerAttr_->GetMarkerSize());
00076 }
00077 //____________________________________________________________________________
00078 void GPFSimParticle::setNewStyle()
00079 {
00080   SetMarkerStyle(markerAttr_->GetMarkerStyle());
00081 }
00082 

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