CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
FWECALDetailViewBuilder.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 // Less than operator for sorting clusters according to eta
18 class superClsterEtaLess : public std::binary_function<const reco::CaloCluster&, const reco::CaloCluster&, bool>
19 {
20 public:
21  bool operator()(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
22  {
23  return ( lhs.eta() < rhs.eta()) ;
24  }
25 };
26 
27 // builder class for ecal detail view
29 
30 public:
31 
32  // construct an ecal detail view builder
33  // the arguments are the event, a pointer to geometry object,
34  // the eta and phi position to show,
35  // the half width of the region (in indices, e.g. iEta) and
36  // the default color for the hits.
38  float eta, float phi, int size = 50,
39  Color_t defaultColor = kMagenta+1)
40  : m_event(event), m_geom(geom),
41  m_eta(eta), m_phi(phi), m_size(size),
42  m_defaultColor(defaultColor){
43  }
44 
45  // draw the ecal information with the preset colors
46  // (if any colors have been preset)
47  TEveCaloLego* build();
48 
49  // set colors of some predefined detids
50  void setColor(Color_t color, const std::vector<DetId> &detIds);
51 
52  // show superclusters using two alternating colors
53  // to make adjacent clusters visible
54  void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal);
55 
56  // show a specific supercluster in a specific color
57  void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow);
58 
59  // add legends; returns final y
60  double makeLegend(double x0 = 0.02, double y0 = 0.95,
61  Color_t clustered1=kGreen+1, Color_t clustered2=kTeal,
62  Color_t supercluster=kYellow);
63 
64 private:
65 
66  // fill data
67  void fillData(const EcalRecHitCollection *hits,
68  TEveCaloDataVec *data);
69  const edm::EventBase *m_event; // the event
70  const FWGeometry *m_geom; // the geometry
71  float m_eta; // eta position view centred on
72  float m_phi; // phi position view centred on
73  int m_size; // view half width in number of crystals
74  Color_t m_defaultColor; // default color for crystals
75 
76  // for keeping track of what det id goes in what slice
77  std::map<DetId, int> m_detIdsToColor;
78 
79  // for keeping track of the colors to use for each slice
80  std::vector<Color_t> m_colors;
81 
82  // sorting function to sort super clusters by eta.
83  static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
84  {
85  return ( lhs.eta() < rhs.eta());
86  }
87 
88 };
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)
T eta() const
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:149
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)
How EventSelector::AcceptEvent() decides whether to accept an event for output otherwise it is excluding the probing of A single or multiple positive and the trigger will pass if any such matching triggers are PASS or EXCEPTION[A criterion thatmatches no triggers at all is detected and causes a throw.] A single negative with an expectation of appropriate bit checking in the decision and the trigger will pass if any such matching triggers are FAIL or EXCEPTION A wildcarded negative criterion that matches more than one trigger in the trigger but the state exists so we define the behavior If all triggers are the negative crieriion will lead to accepting the event(this again matches the behavior of"!*"before the partial wildcard feature was incorporated).The per-event"cost"of each negative criterion with multiple relevant triggers is about the same as!*was in the past
bool operator()(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
void fillData(const EcalRecHitCollection *hits, TEveCaloDataVec *data)
void setColor(Color_t color, const std::vector< DetId > &detIds)
static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
std::vector< Color_t > m_colors
tuple size
Write out results.
Definition: DDAxes.h:10