CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 // builder class for ecal detail view
23 public:
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  const FWGeometry *geom,
31  float eta,
32  float phi,
33  int size = 50,
34  Color_t defaultColor = kMagenta + 1);
35 
36  // draw the ecal information with the preset colors
37  // (if any colors have been preset)
38  TEveCaloLego *build();
39 
40  TEveCaloData *buildCaloData(bool xyEE);
41 
42  // set colors of some predefined detids
43  void setColor(Color_t color, const std::vector<DetId> &detIds);
44 
45  // show superclusters using two alternating colors
46  // to make adjacent clusters visible
47  void showSuperClusters(Color_t color1 = kGreen + 2, Color_t color2 = kTeal);
48 
49  // show a specific supercluster in a specific color
50  void showSuperCluster(const reco::SuperCluster &cluster, Color_t color = kYellow);
51 
52  // add legends; returns final y
53  double makeLegend(double x0 = 0.02,
54  double y0 = 0.95,
55  Color_t clustered1 = kGreen + 1,
56  Color_t clustered2 = kTeal,
57  Color_t supercluster = kYellow);
58 
59 private:
60  // fill data
61  void fillData(TEveCaloDataVec *data);
62 
63  void fillEtaPhi(const EcalRecHitCollection *hits, TEveCaloDataVec *data);
64 
65  const edm::EventBase *m_event; // the event
66  const FWGeometry *m_geom; // the geometry
67  float m_eta; // eta position view centred on
68  float m_phi; // phi position view centred on
69  int m_size; // view half width in number of crystals
70  Color_t m_defaultColor; // default color for crystals
71 
72  std::vector<FWBoxRecHit *> m_boxes;
73 
74  // for keeping track of what det id goes in what slice
75  std::map<DetId, int> m_detIdsToColor;
76 
77  TEveElement *m_towerList;
78 
79  // sorting function to sort super clusters by eta.
80  static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs) {
81  return (lhs.eta() < rhs.eta());
82  }
83 
84  float sizeRad() const;
85 };
86 
87 #endif // Fireworks_Calo_FWECALDetailViewBuilder_h
void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow)
double makeLegend(double x0=0.02, double y0=0.95, Color_t clustered1=kGreen+1, Color_t clustered2=kTeal, Color_t supercluster=kYellow)
void fillData(TEveCaloDataVec *data)
void fillEtaPhi(const EcalRecHitCollection *hits, TEveCaloDataVec *data)
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
const edm::EventBase * m_event
std::map< DetId, int > m_detIdsToColor
FWECALDetailViewBuilder(const edm::EventBase *event, const FWGeometry *geom, float eta, float phi, int size=50, Color_t defaultColor=kMagenta+1)
TEveCaloData * buildCaloData(bool xyEE)
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
void setColor(Color_t color, const std::vector< DetId > &detIds)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
std::vector< FWBoxRecHit * > m_boxes
tuple size
Write out results.