File indexing completed on 2024-05-10 02:20:50
0001
0002
0003
0004
0005 #ifndef HcalCellType_h
0006 #define HcalCellType_h
0007
0008 #include <vector>
0009 #include <iostream>
0010 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0011 #include <CLHEP/Units/SystemOfUnits.h>
0012
0013 class HcalCellType {
0014 public:
0015 struct HcalCell {
0016 bool ok;
0017 double eta, deta, phi, dphi, rz, drz;
0018 bool flagrz;
0019 HcalCell(bool fl = false,
0020 double et = 0,
0021 double det = 0,
0022 double fi = 0,
0023 double dfi = 0,
0024 double rzv = 0,
0025 double drzv = 0,
0026 bool frz = true)
0027 : ok(fl), eta(et), deta(det), phi(fi), dphi(dfi), rz(rzv), drz(drzv), flagrz(frz) {}
0028 };
0029
0030 HcalCellType(HcalSubdetector detType,
0031 int etaBin,
0032 int zside,
0033 int depthSegment,
0034 const HcalCell& cell,
0035 int readoutDirection = 0,
0036 double samplingFactor = 0,
0037 double halfSize = 0);
0038 HcalCellType(const HcalCellType& right);
0039 const HcalCellType& operator=(const HcalCellType& right);
0040 ~HcalCellType();
0041
0042
0043
0044 HcalSubdetector detType() const { return theDetType; }
0045
0046
0047 int etaBin() const { return theEtaBin; }
0048 int zside() const { return theSide; }
0049 void setEta(int bin, double etamin, double etamax);
0050
0051
0052
0053
0054 int depthSegment() const { return theDepthSegment; }
0055 void setDepth(int bin, double dmin, double dmax);
0056
0057
0058 int nPhiBins() const { return (int)(thePhis.size()); }
0059 int nPhiModule() const { return static_cast<int>(20. * CLHEP::deg / thePhiBinWidth); }
0060
0061
0062 double phiBinWidth() const { return thePhiBinWidth; }
0063 double phiOffset() const { return thePhiOffset; }
0064 int unitPhi() const { return theUnitPhi; }
0065 void setPhi(const std::vector<std::pair<int, double>>& phis,
0066 const std::vector<int>& iphiMiss,
0067 double foff,
0068 double dphi,
0069 int unit);
0070 void setPhi(const std::vector<std::pair<int, double>>& phis) { thePhis = phis; }
0071
0072
0073
0074
0075 int actualReadoutDirection() const { return theActualReadoutDirection; }
0076
0077
0078 double etaMin() const { return theEtaMin; }
0079
0080
0081 double etaMax() const { return theEtaMax; }
0082
0083
0084 std::vector<std::pair<int, double>> phis() const { return thePhis; }
0085
0086
0087 double depth() const { return (theDepthMin + theDepthMax) / 2; }
0088 double depthMin() const { return theDepthMin; }
0089 double depthMax() const { return theDepthMax; }
0090 bool depthType() const { return theRzFlag; }
0091 double halfSize() const { return theHalfSize; }
0092
0093
0094 double samplingFactor() const { return theSamplingFactor; }
0095
0096 protected:
0097 HcalCellType();
0098
0099 private:
0100 HcalSubdetector theDetType;
0101 int theEtaBin;
0102 int theSide;
0103 int theDepthSegment;
0104 int theUnitPhi;
0105 int theActualReadoutDirection;
0106
0107 bool theRzFlag;
0108
0109 double theEtaMin;
0110 double theEtaMax;
0111 double theDepthMin;
0112 double theDepthMax;
0113 double thePhiOffset;
0114 double thePhiBinWidth;
0115 double theHalfSize;
0116 double theSamplingFactor;
0117
0118 std::vector<std::pair<int, double>> thePhis;
0119 };
0120
0121 std::ostream& operator<<(std::ostream&, const HcalCellType&);
0122 #endif