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