CMS 3D CMS Logo

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
FWECALDetailViewBuilder::build
TEveCaloLego * build()
Definition: FWECALDetailViewBuilder.cc:99
FWECALDetailViewBuilder::fillData
void fillData(TEveCaloDataVec *data)
Definition: FWECALDetailViewBuilder.cc:279
FWECALDetailViewBuilder::sizeRad
float sizeRad() const
Definition: FWECALDetailViewBuilder.cc:461
FWGeometry
Definition: FWGeometry.h:27
FWECALDetailViewBuilder::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: FWECALDetailViewBuilder.cc:410
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
FWECALDetailViewBuilder::fillEtaPhi
void fillEtaPhi(const EcalRecHitCollection *hits, TEveCaloDataVec *data)
Definition: FWECALDetailViewBuilder.cc:205
reco::SuperCluster
Definition: SuperCluster.h:18
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::SortedCollection< EcalRecHit >
EcalRecHitCollections.h
FWECALDetailViewBuilder::m_event
const edm::EventBase * m_event
Definition: FWECALDetailViewBuilder.h:65
FWBoxRecHit.h
FWECALDetailViewBuilder::buildCaloData
TEveCaloData * buildCaloData(bool xyEE)
Definition: FWECALDetailViewBuilder.cc:43
FWECALDetailViewBuilder::m_geom
const FWGeometry * m_geom
Definition: FWECALDetailViewBuilder.h:66
PVValHelper::eta
Definition: PVValidationHelpers.h:70
FWECALDetailViewBuilder::m_eta
float m_eta
Definition: FWECALDetailViewBuilder.h:67
reco::CaloCluster
Definition: CaloCluster.h:31
FWECALDetailViewBuilder::m_towerList
TEveElement * m_towerList
Definition: FWECALDetailViewBuilder.h:77
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
FWECALDetailViewBuilder::m_size
int m_size
Definition: FWECALDetailViewBuilder.h:69
FWECALDetailViewBuilder::m_defaultColor
Color_t m_defaultColor
Definition: FWECALDetailViewBuilder.h:70
CaloClusterFwd.h
FWECALDetailViewBuilder::FWECALDetailViewBuilder
FWECALDetailViewBuilder(const edm::EventBase *event, const FWGeometry *geom, float eta, float phi, int size=50, Color_t defaultColor=kMagenta+1)
Definition: FWECALDetailViewBuilder.cc:32
FWECALDetailViewBuilder::showSuperClusters
void showSuperClusters(Color_t color1=kGreen+2, Color_t color2=kTeal)
Definition: FWECALDetailViewBuilder.cc:156
FWECALDetailViewBuilder::m_detIdsToColor
std::map< DetId, int > m_detIdsToColor
Definition: FWECALDetailViewBuilder.h:75
reco::CaloCluster::eta
double eta() const
pseudorapidity of cluster centroid
Definition: CaloCluster.h:181
FWECALDetailViewBuilder
Definition: FWECALDetailViewBuilder.h:22
FWECALDetailViewBuilder::m_phi
float m_phi
Definition: FWECALDetailViewBuilder.h:68
FWECALDetailViewBuilder::setColor
void setColor(Color_t color, const std::vector< DetId > &detIds)
Definition: FWECALDetailViewBuilder.cc:141
DDAxes::phi
SuperClusterFwd.h
DetId.h
edm::EventBase
Definition: EventBase.h:46
EventBase
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
FWECALDetailViewBuilder::showSuperCluster
void showSuperCluster(const reco::SuperCluster &cluster, Color_t color=kYellow)
Definition: FWECALDetailViewBuilder.cc:146
FWECALDetailViewBuilder::m_boxes
std::vector< FWBoxRecHit * > m_boxes
Definition: FWECALDetailViewBuilder.h:72
event
Definition: event.py:1
FWECALDetailViewBuilder::superClusterEtaLess
static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs)
Definition: FWECALDetailViewBuilder.h:80
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443