CMS 3D CMS Logo

FWECALCaloDataDetailViewBuilder.h
Go to the documentation of this file.
1 #include "Rtypes.h"
6 
7 #include <map>
8 #include <vector>
9 
10 namespace edm {
11  class EventBase;
12 }
13 
14 class FWGeometry;
15 class TEveCaloData;
16 class TEveCaloDataVec;
17 class TEveCaloLego;
18 
19 // builder class for ecal detail view
21 public:
22  // construct an ecal detail view builder
23  // the arguments are the event, a pointer to geometry object,
24  // the eta and phi position to show,
25  // the half width of the region (in indices, e.g. iEta) and
26  // the default color for the hits.
28  const FWGeometry *geom,
29  float eta,
30  float phi,
31  int size = 50,
32  Color_t defaultColor = kMagenta + 1)
33  : m_event(event), m_geom(geom), m_eta(eta), m_phi(phi), m_size(size), m_defaultColor(defaultColor) {}
34 
35  // draw the ecal information with the preset colors
36  // (if any colors have been preset)
37  TEveCaloLego *build();
38 
39  TEveCaloData *buildCaloData(bool xyEE);
40 
41  // set colors of some predefined detids
42  void setColor(Color_t color, const std::vector<DetId> &detIds);
43 
44  // show superclusters using two alternating colors
45  // to make adjacent clusters visible
46  void showSuperClusters(Color_t color1 = kGreen + 2, Color_t color2 = kTeal);
47 
48  // show a specific supercluster in a specific color
49  void showSuperCluster(const reco::SuperCluster &cluster, Color_t color = kYellow);
50 
51  // add legends; returns final y
52  double makeLegend(double x0 = 0.02,
53  double y0 = 0.95,
54  Color_t clustered1 = kGreen + 1,
55  Color_t clustered2 = kTeal,
56  Color_t supercluster = kYellow);
57 
58 private:
59  // fill data
60  void fillData(const EcalRecHitCollection *hits, TEveCaloDataVec *data, bool xyEE);
61  const edm::EventBase *m_event; // the event
62  const FWGeometry *m_geom; // the geometry
63  float m_eta; // eta position view centred on
64  float m_phi; // phi position view centred on
65  int m_size; // view half width in number of crystals
66  Color_t m_defaultColor; // default color for crystals
67 
68  // for keeping track of what det id goes in what slice
69  std::map<DetId, int> m_detIdsToColor;
70 
71  // for keeping track of the colors to use for each slice
72  std::vector<Color_t> m_colors;
73 
74  // sorting function to sort super clusters by eta.
75  static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs) {
76  return (lhs.eta() < rhs.eta());
77  }
78 };
FWECALCaloDataDetailViewBuilder::setColor
void setColor(Color_t color, const std::vector< DetId > &detIds)
Definition: FWECALCaloDataDetailViewBuilder.cc:198
FWGeometry
Definition: FWGeometry.h:27
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
reco::SuperCluster
Definition: SuperCluster.h:18
FWECALCaloDataDetailViewBuilder
Definition: FWECALCaloDataDetailViewBuilder.h:20
FWECALCaloDataDetailViewBuilder::makeLegend
double makeLegend(double x0=0.02, double y0=0.95, Color_t clustered1=kGreen+1, Color_t clustered2=kTeal, Color_t supercluster=kYellow)
Definition: FWECALCaloDataDetailViewBuilder.cc:379
FWECALCaloDataDetailViewBuilder::showSuperCluster
void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow)
Definition: FWECALCaloDataDetailViewBuilder.cc:209
edm
HLT enums.
Definition: AlignableModifier.h:19
FWECALCaloDataDetailViewBuilder::m_defaultColor
Color_t m_defaultColor
Definition: FWECALCaloDataDetailViewBuilder.h:66
FWECALCaloDataDetailViewBuilder::m_detIdsToColor
std::map< DetId, int > m_detIdsToColor
Definition: FWECALCaloDataDetailViewBuilder.h:69
edm::SortedCollection< EcalRecHit >
FWECALCaloDataDetailViewBuilder::m_geom
const FWGeometry * m_geom
Definition: FWECALCaloDataDetailViewBuilder.h:62
FWECALCaloDataDetailViewBuilder::m_size
int m_size
Definition: FWECALCaloDataDetailViewBuilder.h:65
EcalRecHitCollections.h
FWECALCaloDataDetailViewBuilder::m_colors
std::vector< Color_t > m_colors
Definition: FWECALCaloDataDetailViewBuilder.h:72
PVValHelper::eta
Definition: PVValidationHelpers.h:70
reco::CaloCluster
Definition: CaloCluster.h:31
FWECALCaloDataDetailViewBuilder::fillData
void fillData(const EcalRecHitCollection *hits, TEveCaloDataVec *data, bool xyEE)
Definition: FWECALCaloDataDetailViewBuilder.cc:254
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
CaloClusterFwd.h
FWECALCaloDataDetailViewBuilder::m_event
const edm::EventBase * m_event
Definition: FWECALCaloDataDetailViewBuilder.h:61
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
FWECALCaloDataDetailViewBuilder::superClusterEtaLess
static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
Definition: FWECALCaloDataDetailViewBuilder.h:75
FWECALCaloDataDetailViewBuilder::m_eta
float m_eta
Definition: FWECALCaloDataDetailViewBuilder.h:63
FWECALCaloDataDetailViewBuilder::FWECALCaloDataDetailViewBuilder
FWECALCaloDataDetailViewBuilder(const edm::EventBase *event, const FWGeometry *geom, float eta, float phi, int size=50, Color_t defaultColor=kMagenta+1)
Definition: FWECALCaloDataDetailViewBuilder.h:27
DDAxes::phi
SuperClusterFwd.h
DetId.h
edm::EventBase
Definition: EventBase.h:46
FWECALCaloDataDetailViewBuilder::m_phi
float m_phi
Definition: FWECALCaloDataDetailViewBuilder.h:64
EventBase
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
event
Definition: event.py:1
FWECALCaloDataDetailViewBuilder::buildCaloData
TEveCaloData * buildCaloData(bool xyEE)
Definition: FWECALCaloDataDetailViewBuilder.cc:28
FWECALCaloDataDetailViewBuilder::showSuperClusters
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
Definition: FWECALCaloDataDetailViewBuilder.cc:219
FWECALCaloDataDetailViewBuilder::build
TEveCaloLego * build()
Definition: FWECALCaloDataDetailViewBuilder.cc:175
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443