CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DisplayManager.h
Go to the documentation of this file.
1 #ifndef PF_DisplayManager_h
2 #define PF_DisplayManager_h
3 
12 
14 
15 #include <TCanvas.h>
16 #include <TObject.h>
17 #include <TLine.h>
18 #include <TBox.h>
19 #include <TEllipse.h>
20 #include <string>
21 #include <map>
22 
23 class IO;
24 
25 class GPFRecHit;
26 class GPFCluster;
27 class GPFTrack;
28 class GPFSimParticle;
29 class GPFBase;
30 class GPFGenParticle;
31 class PFRootEventManager;
32 class TH2F;
33 
35 
36  public:
38  const char* optfile );
39  virtual ~DisplayManager();
40 
41  void readOptions( const char* file );
42 
43  void display(int ientry);
44  void displayEvent( int run, int lumi, int event);
45  void displayAll(bool noRedraw = true);
46  void displayNext();
47  void displayNextInteresting(int ientry);
48  void displayPrevious();
49  void displayPFBlock(int blockNb) ;
50  void enableDrawPFBlock(bool state);
51  void enableDrawBrem(bool state);
52  void findAndDraw(int ident);
53  //void findAndDrawbis(const int ident);
54  void findBlock(int ident) ;
56  void lookForGenParticle(unsigned barcode);
58  void lookForMaxRecHit(bool ecal);
59  void reset();
60  void updateDisplay();
61  void unZoom();
62  void printDisplay(const char* directory="" ) const;
63  void printGenParticleInfo(std::string name, int barcode, int barcodeMother);
66 
67  //bool getGLoaded() {return isGraphicLoaded_;} //util to DialogFrame ?
68 
69  //variables
70  //----------------------graphic options variable ---------------------
71 
72  double clusEnMin_;
73  double hitEnMin_;
74  double trackPtMin_;
75  double gsfPtMin_;
78 
79  bool drawHits_;
82  bool drawBrems_;
83  bool drawClus_;
88  bool drawHO_;
89 
90 
91  //---------------------- new graphic Container ----------------
92  //container of all the graphic Objects of one event
93  std::multimap<int,GPFBase *> graphicMap_;
94  //container of idents/elementNb of objects within a PFBlock
95  std::multimap<int , std::pair <int,int> > blockIdentsMap_;
96 
97  //------------- graphic attributes ------------------------------------
98  std::vector<float> trackAttributes_;
99  std::vector<float> gsfAttributes_;
100  std::vector<float> bremAttributes_;
101  std::vector<float> clusterAttributes_;
102 
103 
104  TAttMarker *clusPattern_;
105  TAttMarker *clusPSPattern_;
106 
107  TAttMarker *clusPatternecal_;
108  TAttMarker *clusPatternho_;
109  TAttMarker *clusPatternhfem_;
110 
111  TAttMarker *trackPatternM_;
112  TAttLine *trackPatternL_;
113  TAttMarker *gsfPatternM_;
114  TAttLine *gsfPatternL_;
115  TAttMarker *bremPatternM_;
116  TAttLine *bremPatternL_;
117  TAttMarker *genPartPattern_;
118 
119  TAttLine *simPartPatternL_;
121  TAttMarker *simPartPatternElec_ ;
122  TAttMarker *simPartPatternMuon_;
123  TAttMarker *simPartPatternK_;
124  TAttMarker *simPartPatternPi_;
128 
129  std::vector<TAttMarker *> simPartPatternM_;
130 
131 
132  private:
133 
135 
138 
145  double zoomFactor_;
146 
150  int shiftId_;
151 
152  //-------------- draw Canvas --------------------------------------
154  std::vector<TCanvas*> displayView_;
155 
157  std::vector<int> viewSize_;
158 
160  std::vector<int> viewSizeEtaPhi_;
161 
163  std::vector<TH2F*> displayHist_;
164 
167 
170 
173 
175  TEllipse frontFaceHOXY_;
176 
177  //---------------- end Draw Canvas ------------------------------------
178 
180  //std::vector<std::vector<TLine> > vectGClusterLines_;
181  //number of clusterLines by cluster
182  //std::vector<std::vector<int> > vectClusLNb_;
183 
184  std::vector<int> selectedGObj_;
185  std::vector<int> badBremsId_;
186 
187 
188  // Display Options read from option file
189  void getDisplayOptions();
190 
191  //DisplayViews
192  void createCanvas();
193 
194  void displayCanvas();
195 
196 
197  //create graphicObjects
198  void createGRecHit(reco::PFRecHit& rh,int ident,
199  double maxe, double phi0=0. , int color=4);
200 
201  void createGCluster(const reco::PFCluster& cluster,
202  int ident, double phi0 = 0.);
203 
205  const std::vector<reco::PFTrajectoryPoint>& points,
206  int ident,double pt,double phi0, double sign,
207  bool displayInitial, int linestyle, int kfgsfbrem=0);
208 
209  void createGPart(const reco::PFSimParticle &ptc,
210  const std::vector<reco::PFTrajectoryPoint>& points,
211  int ident,double pt,double phi0, double sign,
212  bool displayInitial,int markerIndex);
213 
214  // void createGGenParticle(HepMC::GenEvent::particle_const_iterator p);
216 
217  //void createGClusterLines(const reco::PFCluster& cluster,int viewType);
218  void drawGObject(int ident,int color,bool toInitialColor);
219 
220  //fill vectors with graphic Objects
221  void loadGraphicObjects();
222 
223  void loadGRecHits();
224 
225  void loadGClusters();
226 
227  void loadGRecTracks();
228 
229  void loadGGsfRecTracks();
230 
231  void loadGSimParticles();
232 
233  void loadGPFBlocks();
234 
235  void loadGGenParticles();
236 
237  //void redraw();
238  void rubOutGPFBlock();
239 
240  //
241  void retrieveBadBrems();
242  bool findBadBremsId(int ident);
243 
244 
245 
246  // methods
247  double getMaxE(int layer) const;
248  double getMaxEEcal();
249  double getMaxEHcal();
250  double getMaxEHo();
251 
252 
253 
254 };
255 #endif
void printGenParticleInfo(std::string name, int barcode, int barcodeMother)
void drawGObject(int ident, int color, bool toInitialColor)
void displayAll(bool noRedraw=true)
reconstructed track used as an input to particle flow
Definition: PFRecTrack.h:22
bool findBadBremsId(int ident)
std::multimap< int, GPFBase * > graphicMap_
General option file parser.
Definition: IO.h:28
std::vector< TCanvas * > displayView_
vector of canvas for x/y or r/z display
void setNewAttrToSimParticles()
Particle flow cluster, see clustering algorithm in PFClusterAlgo.
Definition: PFCluster.h:42
void getDisplayOptions()
std::vector< float > gsfAttributes_
TAttMarker * genPartPattern_
void createGCluster(const reco::PFCluster &cluster, int ident, double phi0=0.)
tuple lumi
Definition: fjr2json.py:35
TAttMarker * gsfPatternM_
TAttLine * trackPatternL_
void drawWithNewGraphicAttributes()
void findBlock(int ident)
void lookForMaxRecHit(bool ecal)
look for rechit with max energy in ecal or hcal.
std::vector< TAttMarker * > simPartPatternM_
void lookForGenParticle(unsigned barcode)
look for particle with index i in MC truth.
TAttMarker * clusPatternhfem_
std::vector< float > trackAttributes_
TAttMarker * trackPatternM_
void createGPart(const reco::PFSimParticle &ptc, const std::vector< reco::PFTrajectoryPoint > &points, int ident, double pt, double phi0, double sign, bool displayInitial, int markerIndex)
TAttMarker * clusPSPattern_
void display(int ientry)
TAttMarker * simPartPatternPi_
void displayPFBlock(int blockNb)
PFRootEventManager * em_
TAttMarker * clusPatternecal_
TAttMarker * bremPatternM_
double particlePtMin_
TBox frontFaceECALRZ_
ECAL in RZ view.
Particle flow rechit (rechit + geometry and topology information). See clustering algorithm in PFClus...
Definition: PFRecHit.h:31
std::vector< int > selectedGObj_
graphic object containers
void enableDrawBrem(bool state)
TAttMarker * simPartPatternProton_
DisplayManager(PFRootEventManager *em, const char *optfile)
void printDisplay(const char *directory="") const
std::vector< int > badBremsId_
std::vector< float > bremAttributes_
void displayEvent(int run, int lumi, int event)
TEllipse frontFaceHOXY_
HO in XY view.
TAttMarker * simPartPatternPhoton_
TAttMarker * simPartPatternElec_
std::vector< float > clusterAttributes_
TAttMarker * clusPattern_
double maxERecHitEcal_
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
void createGTrack(reco::PFRecTrack &tr, const std::vector< reco::PFTrajectoryPoint > &points, int ident, double pt, double phi0, double sign, bool displayInitial, int linestyle, int kfgsfbrem=0)
void createGRecHit(reco::PFRecHit &rh, int ident, double maxe, double phi0=0., int color=4)
true particle for particle flow
Definition: PFSimParticle.h:19
TAttMarker * simPartPatternMuon_
void displayNextInteresting(int ientry)
std::multimap< int, std::pair< int, int > > blockIdentsMap_
TEllipse frontFaceECALXY_
ECAL in XY view.
void enableDrawPFBlock(bool state)
double getMaxE(int layer) const
TAttLine * gsfPatternL_
TEllipse frontFaceHCALXY_
HCAL in XY view.
TAttLine * bremPatternL_
IO * options_
options file parser
char state
Definition: procUtils.cc:75
void readOptions(const char *file)
void findAndDraw(int ident)
TAttLine * simPartPatternL_
void createGGenParticle(HepMC::GenParticle *p)
virtual ~DisplayManager()
ROOT interface to particle flow package.
TAttMarker * simPartPatternNeutron_
double genParticlePtMin_
std::vector< TH2F * > displayHist_
support histogram for x/y or r/z display.
TAttMarker * simPartPatternK_
TAttMarker * simPartPatternDefault_
std::vector< int > viewSize_
display pad xy size for (x,y) or (r,z) display
std::vector< int > viewSizeEtaPhi_
display pad xy size for eta/phi view
double maxERecHitHcal_
TAttMarker * clusPatternho_