CMS 3D CMS Logo

GPFGenParticle.cc

Go to the documentation of this file.
00001 #include "RecoParticleFlow/PFRootEvent/interface/GPFGenParticle.h"
00002 #include "TObject.h"
00003 #include "TPad.h"
00004 
00005 //________________________________________________________________
00006 GPFGenParticle::GPFGenParticle(DisplayManager * display,
00007                                int view,int ident,
00008                                double x,double y,double e, double pt,int barcode,
00009                                TAttMarker *attm,std::string name, std::string latexName)
00010   :  GPFBase(display,view,ident, attm ),
00011      TMarker(x,y,1),
00012      TLatex(x,y,latexName.c_str()),
00013      en_(e),pt_(pt),name_(name),barcode_(barcode),
00014      barcodeMother_(0),
00015      line_(0) {
00016     
00017   //ResetBit(kCanDelete);
00018   SetMarkerColor(markerAttr_->GetMarkerColor());
00019   SetMarkerStyle(markerAttr_->GetMarkerStyle());
00020   SetMarkerSize(markerAttr_->GetMarkerSize());
00021 }   
00022 //________________________________________________________________
00023 GPFGenParticle::GPFGenParticle(DisplayManager * display,
00024                                int view,int ident,
00025                                double *x,double *y,
00026                                double e, double pt,int barcode,int barcodeMother,
00027                                TAttMarker *attm,std::string name, std::string latexName)
00028   :  GPFBase(display,view,ident, attm ),
00029      TMarker(x[1],y[1],1),
00030      TLatex(x[1],y[1],latexName.c_str()),
00031      en_(e),pt_(pt),name_(name),barcode_(barcode),
00032      barcodeMother_(barcodeMother),
00033      line_(0) {
00034     
00035   //ResetBit(kCanDelete);
00036   SetMarkerColor(markerAttr_->GetMarkerColor());
00037   SetMarkerStyle(markerAttr_->GetMarkerStyle());
00038   SetMarkerSize(markerAttr_->GetMarkerSize());
00039   line_ = new TLine(x[0],y[0],x[1],y[1]);
00040   line_->SetLineColor(markerAttr_->GetMarkerColor());
00041 }
00042    
00043 //_________________________________________________________________
00044 void GPFGenParticle::Print()
00045 {
00046   display_->printGenParticleInfo(name_,barcode_,barcodeMother_);
00047 }
00048 //_________________________________________________________________
00049 void GPFGenParticle::ExecuteEvent(Int_t event, Int_t px, Int_t py)
00050 {
00051   // Execute action corresponding to a mouse click 
00052 
00053   gPad->SetCursor(kHand);
00054   switch (event) {
00055   case kButton1Down:
00056     Print();
00057     break;
00058   default:break;
00059   }    
00060 }
00061 //_________________________________________________________________ 
00062 void GPFGenParticle::draw()
00063 {
00064   TMarker::Draw();
00065   SetTextFont(42);
00066   SetTextSize(0.05);
00067   TLatex::Draw();
00068   if(line_) line_->Draw();
00069 }  
00070 //_________________________________________________________________
00071 void GPFGenParticle::setColor()
00072 {
00073   SetMarkerColor(markerAttr_->GetMarkerColor());
00074 }
00075 //_________________________________________________________________
00076 void GPFGenParticle::setColor(int newcol)
00077 {
00078   SetMarkerColor(newcol);
00079 }
00080 //_________________________________________________________________
00081 void GPFGenParticle::setInitialColor()
00082 {
00083   SetMarkerColor(markerAttr_->GetMarkerColor());
00084 }
00085 //_________________________________________________________________
00086 void GPFGenParticle::setNewStyle()
00087 {
00088   SetMarkerStyle(markerAttr_->GetMarkerStyle());
00089 }
00090 //_________________________________________________________________
00091 void GPFGenParticle::setNewSize()
00092 {
00093   SetMarkerSize(markerAttr_->GetMarkerSize());
00094 }
00095 

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