CMS 3D CMS Logo

DisplayManager.h

Go to the documentation of this file.
00001 #ifndef PF_DisplayManager_h
00002 #define PF_DisplayManager_h
00003 
00004 #include "RecoParticleFlow/PFRootEvent/interface/PFRootEventManager.h"
00005 #include "RecoParticleFlow/PFRootEvent/interface/DisplayCommon.h"
00006 
00007 #include <TCanvas.h>
00008 #include <TObject.h>
00009 #include <TLine.h>
00010 #include <TBox.h>
00011 #include <string>
00012 #include <map>
00013 
00014 class IO;
00015 
00016 class GPFRecHit;
00017 class GPFCluster;
00018 class GPFTrack;
00019 class GPFSimParticle;
00020 class GPFBase;
00021 class GPFGenParticle;
00022 
00023 class DisplayManager {
00024   
00025  public:
00026   DisplayManager( PFRootEventManager *em, 
00027                   const char* optfile );
00028   virtual ~DisplayManager();
00029      
00030   void readOptions( const char* file );
00031 
00032   void display(int ientry);
00033   void displayAll(bool noRedraw = true);
00034   void displayNext();
00035   void displayNextInteresting(int ientry);
00036   void displayPrevious();
00037   void displayPFBlock(int blockNb) ;
00038   void enableDrawPFBlock(bool state);
00039   void findAndDraw(int ident);
00040   //void findAndDrawbis(const int ident);
00041   void findBlock(int ident) ;
00043   void lookForGenParticle(unsigned barcode);
00045   void lookForMaxRecHit(bool ecal);
00046   void reset();
00047   void updateDisplay();
00048   void unZoom();
00049   void printDisplay(const char* directory="" ) const;
00050   void printGenParticleInfo(std::string name, int barcode, int barcodeMother);
00051   void drawWithNewGraphicAttributes();
00052   void setNewAttrToSimParticles();
00053      
00054   //bool getGLoaded() {return isGraphicLoaded_;}  //util to DialogFrame ?
00055      
00056   //variables
00057   //----------------------graphic options variable ---------------------
00058   double clusEnMin_;
00059   double hitEnMin_;
00060   double trackPtMin_;
00061   double particlePtMin_;
00062   double genParticlePtMin_;
00063      
00064   bool drawHits_;
00065   bool drawTracks_;
00066   bool drawClus_;
00067   bool drawClusterL_;
00068   bool drawParticles_;
00069   bool drawGenParticles_;
00070   bool drawPFBlocks_;
00071      
00072      
00073   //---------------------- new graphic Container ----------------
00074   //container of all the graphic Objects of one event 
00075   std::multimap<int,GPFBase *>  graphicMap_;
00076   //container of idents/elementNb  of objects within a PFBlock
00077   std::multimap<int , std::pair <int,int> >   blockIdentsMap_;
00078   
00079   //------------- graphic attributes ------------------------------------
00080   std::vector<int>      trackAttributes_;
00081   std::vector<int>      clusterAttributes_;
00082   
00083   
00084   TAttMarker *clusPattern_;
00085   TAttMarker *clusPSPattern_;
00086   
00087   TAttMarker *trackPatternM_;
00088   TAttLine   *trackPatternL_;
00089   
00090   TAttMarker *genPartPattern_;
00091   
00092   TAttLine   *simPartPatternL_;
00093   TAttMarker *simPartPatternPhoton_;
00094   TAttMarker *simPartPatternElec_ ;
00095   TAttMarker *simPartPatternMuon_;
00096   TAttMarker *simPartPatternK_;
00097   TAttMarker *simPartPatternPi_;
00098   TAttMarker *simPartPatternProton_;
00099   TAttMarker *simPartPatternNeutron_;
00100   TAttMarker *simPartPatternDefault_;
00101   
00102   std::vector<TAttMarker *> simPartPatternM_;
00103   
00104   
00105  private:
00106 
00107   PFRootEventManager *em_;
00108    
00110   IO*         options_;      
00111 
00112   double maxERecHitEcal_;
00113   double maxERecHitHcal_;
00114   bool   isGraphicLoaded_;
00115   int    eventNumber_;
00116   int    maxEvents_;
00117   double zoomFactor_;
00118   //number of low bits indicating the object type in the map key
00119   int    shiftId_;
00120 
00121   //-------------- draw Canvas --------------------------------------
00123   std::vector<TCanvas*> displayView_;
00124 
00126   std::vector<int>      viewSize_; 
00127         
00129   std::vector<int>         viewSizeEtaPhi_; 
00130 
00132   std::vector<TH2F*>    displayHist_;
00133 
00135   TEllipse frontFaceECALXY_;
00136 
00138   TBox     frontFaceECALRZ_;
00139 
00141   TEllipse frontFaceHCALXY_;
00142   
00143   //----------------  end Draw Canvas ------------------------------------
00144     
00146   //std::vector<std::vector<TLine> >            vectGClusterLines_;
00147   //number of clusterLines by cluster 
00148   //std::vector<std::vector<int> >              vectClusLNb_;
00149     
00150   std::vector<int>                            selectedGObj_;
00151      
00152     
00153   // Display Options read from option file
00154   void  getDisplayOptions();
00155      
00156   //DisplayViews
00157   void createCanvas();
00158 
00159   void displayCanvas();
00160      
00161      
00162   //create graphicObjects
00163   void createGRecHit(reco::PFRecHit& rh,int ident, 
00164                      double maxe, double phi0=0. , int color=4);
00165 
00166   void createGCluster(const reco::PFCluster& cluster,
00167                       int ident, double phi0 = 0.);
00168 
00169   void createGTrack(reco::PFRecTrack &tr,
00170                     const std::vector<reco::PFTrajectoryPoint>& points,
00171                     int ident,double pt,double phi0, double sign, 
00172                     bool displayInitial, int linestyle);
00173 
00174   void createGPart(const reco::PFSimParticle &ptc, 
00175                    const std::vector<reco::PFTrajectoryPoint>& points, 
00176                    int ident,double pt,double phi0, double sign, 
00177                    bool displayInitial,int markerIndex);
00178                    
00179   //  void createGGenParticle(HepMC::GenEvent::particle_const_iterator p);                 
00180   void createGGenParticle(HepMC::GenParticle* p);                  
00181 
00182   //void createGClusterLines(const reco::PFCluster& cluster,int viewType);                      
00183   void drawGObject(int ident,int color,bool toInitialColor);
00184 
00185   //fill vectors with graphic Objects
00186   void loadGraphicObjects();
00187 
00188   void loadGRecHits();
00189 
00190   void loadGClusters();
00191 
00192   void loadGRecTracks();
00193 
00194   void loadGSimParticles();
00195 
00196   void loadGPFBlocks();
00197   
00198   void loadGGenParticles();
00199      
00200   //void redraw();
00201   void rubOutGPFBlock();
00202 
00203  
00204   // methods
00205   double getMaxE(int layer) const;
00206   double getMaxEEcal();
00207   double getMaxEHcal();
00208                
00209      
00210      
00211      
00212 };
00213 #endif 

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