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  double clusEnMin_;
72  double hitEnMin_;
73  double trackPtMin_;
74  double gsfPtMin_;
77 
78  bool drawHits_;
81  bool drawBrems_;
82  bool drawClus_;
87 
88 
89  //---------------------- new graphic Container ----------------
90  //container of all the graphic Objects of one event
91  std::multimap<int,GPFBase *> graphicMap_;
92  //container of idents/elementNb of objects within a PFBlock
93  std::multimap<int , std::pair <int,int> > blockIdentsMap_;
94 
95  //------------- graphic attributes ------------------------------------
96  std::vector<float> trackAttributes_;
97  std::vector<float> gsfAttributes_;
98  std::vector<float> bremAttributes_;
99  std::vector<float> clusterAttributes_;
100 
101 
102  TAttMarker *clusPattern_;
103  TAttMarker *clusPSPattern_;
104 
105  TAttMarker *trackPatternM_;
106  TAttLine *trackPatternL_;
107  TAttMarker *gsfPatternM_;
108  TAttLine *gsfPatternL_;
109  TAttMarker *bremPatternM_;
110  TAttLine *bremPatternL_;
111  TAttMarker *genPartPattern_;
112 
113  TAttLine *simPartPatternL_;
115  TAttMarker *simPartPatternElec_ ;
116  TAttMarker *simPartPatternMuon_;
117  TAttMarker *simPartPatternK_;
118  TAttMarker *simPartPatternPi_;
122 
123  std::vector<TAttMarker *> simPartPatternM_;
124 
125 
126  private:
127 
129 
132 
138  double zoomFactor_;
139 
143  int shiftId_;
144 
145  //-------------- draw Canvas --------------------------------------
147  std::vector<TCanvas*> displayView_;
148 
150  std::vector<int> viewSize_;
151 
153  std::vector<int> viewSizeEtaPhi_;
154 
156  std::vector<TH2F*> displayHist_;
157 
160 
163 
166 
167  //---------------- end Draw Canvas ------------------------------------
168 
170  //std::vector<std::vector<TLine> > vectGClusterLines_;
171  //number of clusterLines by cluster
172  //std::vector<std::vector<int> > vectClusLNb_;
173 
174  std::vector<int> selectedGObj_;
175  std::vector<int> badBremsId_;
176 
177 
178  // Display Options read from option file
179  void getDisplayOptions();
180 
181  //DisplayViews
182  void createCanvas();
183 
184  void displayCanvas();
185 
186 
187  //create graphicObjects
188  void createGRecHit(reco::PFRecHit& rh,int ident,
189  double maxe, double phi0=0. , int color=4);
190 
191  void createGCluster(const reco::PFCluster& cluster,
192  int ident, double phi0 = 0.);
193 
195  const std::vector<reco::PFTrajectoryPoint>& points,
196  int ident,double pt,double phi0, double sign,
197  bool displayInitial, int linestyle, int kfgsfbrem=0);
198 
199  void createGPart(const reco::PFSimParticle &ptc,
200  const std::vector<reco::PFTrajectoryPoint>& points,
201  int ident,double pt,double phi0, double sign,
202  bool displayInitial,int markerIndex);
203 
204  // void createGGenParticle(HepMC::GenEvent::particle_const_iterator p);
206 
207  //void createGClusterLines(const reco::PFCluster& cluster,int viewType);
208  void drawGObject(int ident,int color,bool toInitialColor);
209 
210  //fill vectors with graphic Objects
211  void loadGraphicObjects();
212 
213  void loadGRecHits();
214 
215  void loadGClusters();
216 
217  void loadGRecTracks();
218 
219  void loadGGsfRecTracks();
220 
221  void loadGSimParticles();
222 
223  void loadGPFBlocks();
224 
225  void loadGGenParticles();
226 
227  //void redraw();
228  void rubOutGPFBlock();
229 
230  //
231  void retrieveBadBrems();
232  bool findBadBremsId(int ident);
233 
234 
235 
236  // methods
237  double getMaxE(int layer) const;
238  double getMaxEEcal();
239  double getMaxEHcal();
240 
241 
242 
243 
244 };
245 #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:41
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.
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 * 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)
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_