CMS 3D CMS Logo

FWECALDetailViewBuilder.h
Go to the documentation of this file.
1 #ifndef Fireworks_Calo_FWECALDetailViewBuilder_h
2 #define Fireworks_Calo_FWECALDetailViewBuilder_h
3 
4 #include "Rtypes.h"
5 #include <map>
6 #include <vector>
12 
13 namespace edm {
14  class EventBase;
15 }
16 
17 class FWGeometry;
18 class TEveCaloDataVec;
19 class TEveCaloLego;
20 
21 // builder class for ecal detail view
23 
24 public:
25 
26  // construct an ecal detail view builder
27  // the arguments are the event, a pointer to geometry object,
28  // the eta and phi position to show,
29  // the half width of the region (in indices, e.g. iEta) and
30  // the default color for the hits.
32  float eta, float phi, int size = 50 , Color_t defaultColor = kMagenta+1);
33 
34 
35  // draw the ecal information with the preset colors
36  // (if any colors have been preset)
37  TEveCaloLego* build();
38 
39  TEveCaloData* buildCaloData(bool xyEE);
40 
41  // set colors of some predefined detids
42  void setColor(Color_t color, const std::vector<DetId> &detIds);
43 
44  // show superclusters using two alternating colors
45  // to make adjacent clusters visible
46  void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal);
47 
48  // show a specific supercluster in a specific color
49  void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow);
50 
51  // add legends; returns final y
52  double makeLegend(double x0 = 0.02, double y0 = 0.95,
53  Color_t clustered1=kGreen+1, Color_t clustered2=kTeal,
54  Color_t supercluster=kYellow);
55 
56 private:
57 
58  // fill data
59  void fillData(TEveCaloDataVec *data);
60 
61  void fillEtaPhi(const EcalRecHitCollection *hits, TEveCaloDataVec *data);
62 
63  const edm::EventBase *m_event; // the event
64  const FWGeometry *m_geom; // the geometry
65  float m_eta; // eta position view centred on
66  float m_phi; // phi position view centred on
67  int m_size; // view half width in number of crystals
68  Color_t m_defaultColor; // default color for crystals
69 
70 
71  std::vector<FWBoxRecHit*> m_boxes;
72 
73  // for keeping track of what det id goes in what slice
74  std::map<DetId, int> m_detIdsToColor;
75 
76  TEveElement* m_towerList;
77 
78  // sorting function to sort super clusters by eta.
79  static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
80  {
81  return ( lhs.eta() < rhs.eta());
82  }
83 
84  float sizeRad() const;
85 
86 };
87 
88 #endif // Fireworks_Calo_FWECALDetailViewBuilder_h
size
Write out results.
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:168
const edm::EventBase * m_event
std::map< DetId, int > m_detIdsToColor
HLT enums.
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
std::vector< FWBoxRecHit * > m_boxes
Definition: event.py:1