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