CMS 3D CMS Logo

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