test
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  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(const EcalRecHitCollection *hits,
70  TEveCaloDataVec *data, bool xyEE);
71  const edm::EventBase *m_event; // the event
72  const FWGeometry *m_geom; // the geometry
73  float m_eta; // eta position view centred on
74  float m_phi; // phi position view centred on
75  int m_size; // view half width in number of crystals
76  Color_t m_defaultColor; // default color for crystals
77 
78  // for keeping track of what det id goes in what slice
79  std::map<DetId, int> m_detIdsToColor;
80 
81  // for keeping track of the colors to use for each slice
82  std::vector<Color_t> m_colors;
83 
84  // sorting function to sort super clusters by eta.
85  static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
86  {
87  return ( lhs.eta() < rhs.eta());
88  }
89 
90 };
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(const EcalRecHitCollection *hits, TEveCaloDataVec *data, bool xyEE)
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:163
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)
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 setColor(Color_t color, const std::vector< DetId > &detIds)
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
std::vector< Color_t > m_colors
tuple size
Write out results.