File indexing completed on 2024-04-06 12:11:26
0001 #include "Rtypes.h"
0002 #include "DataFormats/DetId/interface/DetId.h"
0003 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0004 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
0005 #include "DataFormats/CaloRecHit/interface/CaloClusterFwd.h"
0006
0007 #include <map>
0008 #include <vector>
0009
0010 namespace edm {
0011 class EventBase;
0012 }
0013
0014 class FWGeometry;
0015 class TEveCaloData;
0016 class TEveCaloDataVec;
0017 class TEveCaloLego;
0018
0019
0020 class FWECALCaloDataDetailViewBuilder {
0021 public:
0022
0023
0024
0025
0026
0027 FWECALCaloDataDetailViewBuilder(const edm::EventBase *event,
0028 const FWGeometry *geom,
0029 float eta,
0030 float phi,
0031 int size = 50,
0032 Color_t defaultColor = kMagenta + 1)
0033 : m_event(event), m_geom(geom), m_eta(eta), m_phi(phi), m_size(size), m_defaultColor(defaultColor) {}
0034
0035
0036
0037 TEveCaloLego *build();
0038
0039 TEveCaloData *buildCaloData(bool xyEE);
0040
0041
0042 void setColor(Color_t color, const std::vector<DetId> &detIds);
0043
0044
0045
0046 void showSuperClusters(Color_t color1 = kGreen + 2, Color_t color2 = kTeal);
0047
0048
0049 void showSuperCluster(const reco::SuperCluster &cluster, Color_t color = kYellow);
0050
0051
0052 double makeLegend(double x0 = 0.02,
0053 double y0 = 0.95,
0054 Color_t clustered1 = kGreen + 1,
0055 Color_t clustered2 = kTeal,
0056 Color_t supercluster = kYellow);
0057
0058 private:
0059
0060 void fillData(const EcalRecHitCollection *hits, TEveCaloDataVec *data, bool xyEE);
0061 const edm::EventBase *m_event;
0062 const FWGeometry *m_geom;
0063 float m_eta;
0064 float m_phi;
0065 int m_size;
0066 Color_t m_defaultColor;
0067
0068
0069 std::map<DetId, int> m_detIdsToColor;
0070
0071
0072 std::vector<Color_t> m_colors;
0073
0074
0075 static bool superClusterEtaLess(const reco::CaloCluster &lhs, const reco::CaloCluster &rhs) {
0076 return (lhs.eta() < rhs.eta());
0077 }
0078 };