CMS 3D CMS Logo

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