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>
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 };
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: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)
static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
std::vector< FWBoxRecHit * > m_boxes
tuple size
Write out results.