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