CMS 3D CMS Logo

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