CMS 3D CMS Logo

SuperCluster.h
Go to the documentation of this file.
1 #ifndef EgammaReco_SuperCluster_h
2 #define EgammaReco_SuperCluster_h
3 
18 
19 namespace reco {
20  class SuperCluster : public CaloCluster {
21  public:
23 
26  : CaloCluster(0., Point(0., 0., 0.)),
28  rawEnergy_(-1.),
29  phiWidth_(0),
30  etaWidth_(0),
32  preshowerEnergy2_(0) {}
33 
35  SuperCluster(double energy, const Point& position);
36 
37  SuperCluster(double energy,
38  const Point& position,
39  const CaloClusterPtr& seed,
41  double Epreshower = 0.,
42  double phiWidth = 0.,
43  double etaWidth = 0.,
44  double Epreshower1 = 0.,
45  double Epreshower2 = 0.);
46 
47  // to be merged in the previous one? -- FIXME
48  SuperCluster(double energy,
49  const Point& position,
50  const CaloClusterPtr& seed,
53  double Epreshower = 0.,
54  double phiWidth = 0.,
55  double etaWidth = 0.,
56  double Epreshower1 = 0.,
57  double Epreshower2 = 0.);
58 
60  double rawEnergy() const { return rawEnergy_; }
61 
63  double preshowerEnergy() const { return preshowerEnergy_; }
64  double preshowerEnergyPlane1() const { return preshowerEnergy1_; }
65  double preshowerEnergyPlane2() const { return preshowerEnergy2_; }
66 
68  double phiWidth() const { return phiWidth_; }
69  double etaWidth() const { return etaWidth_; }
70 
71  //Assign new variables to supercluster
73  void setPreshowerEnergyPlane1(double preshowerEnergy1) { preshowerEnergy1_ = preshowerEnergy1; };
74  void setPreshowerEnergyPlane2(double preshowerEnergy2) { preshowerEnergy2_ = preshowerEnergy2; };
75  void setPhiWidth(double pw) { phiWidth_ = pw; }
76  void setEtaWidth(double ew) { etaWidth_ = ew; }
77 
79  const CaloClusterPtr& seed() const { return seed_; }
80 
82  const CaloClusterPtrVector& clusters() const { return clusters_; }
83 
86 
89 
92 
95 
98 
100  size_t clustersSize() const { return clusters_.size(); }
101 
103  size_t preshowerClustersSize() const { return preshowerClusters_.size(); }
104 
106  //std::vector<DetId> getHitsByDetId() const { return usedHits_; }
107 
109  void setSeed(const CaloClusterPtr& r) { seed_ = r; }
110 
111  //(re)-set clusters
115  }
116 
117  //(re)-set preshower clusters
119 
120  //clear hits and fractions vector (for slimming)
122 
124  void addCluster(const CaloClusterPtr& r) {
125  clusters_.push_back(r);
127  }
128 
131 
138  void setPreshowerPlanesStatus(const uint32_t& status) {
139  uint32_t flags = flags_ & flagsMask_;
140  flags_ = flags | (status << flagsOffset_);
141  }
142 
148  const int getPreshowerPlanesStatus() const { return (flags_ >> flagsOffset_); }
149 
150  const int seedCrysIEtaOrIx() const {
151  auto detid = seed_->seed();
152  int ietaorix = 0;
153  if (detid.subdetId() == EcalBarrel) {
154  EBDetId ebdetid(detid);
155  ietaorix = ebdetid.ieta();
156  } else if (detid.subdetId() == EcalEndcap) {
157  EEDetId eedetid(detid);
158  ietaorix = eedetid.ix();
159  }
160  return ietaorix;
161  }
162 
163  const int seedCrysIPhiOrIy() const {
164  auto detid = seed_->seed();
165  int iphioriy = 0;
166  if (detid.subdetId() == EcalBarrel) {
167  EBDetId ebdetid(detid);
168  iphioriy = ebdetid.iphi();
169  } else if (detid.subdetId() == EcalEndcap) {
170  EEDetId eedetid(detid);
171  iphioriy = eedetid.iy();
172  }
173  return iphioriy;
174  }
175 
176  private:
177  void computeRawEnergy();
178 
181 
184 
187 
189  //std::vector<DetId> usedHits_;
190 
192 
193  double rawEnergy_;
194 
195  double phiWidth_;
196  double etaWidth_;
197 
200  };
201 
202 } // namespace reco
203 #endif
const math::XYZPoint & position() const
cluster centroid position
Definition: CaloCluster.h:154
void setPreshowerClusters(const CaloClusterPtrVector &clusters)
Definition: SuperCluster.h:118
uint32_t flags() const
Definition: CaloCluster.h:193
size_type size() const
Size of the RefVector.
Definition: PtrVectorBase.h:75
CaloClusterPtrVector clusters_
references to BasicCluster constitunets
Definition: SuperCluster.h:183
static const uint32_t flagsOffset_
Definition: CaloCluster.h:248
void setPreshowerEnergyPlane2(double preshowerEnergy2)
Definition: SuperCluster.h:74
void push_back(Ptr< T > const &iPtr)
Definition: PtrVector.h:152
int iphi() const
get the crystal iphi
Definition: EBDetId.h:51
double rawEnergy() const
raw uncorrected energy (sum of energies of component BasicClusters)
Definition: SuperCluster.h:60
CaloCluster_iterator clustersBegin() const
fist iterator over BasicCluster constituents
Definition: SuperCluster.h:88
size_t preshowerClustersSize() const
number of BasicCluster PreShower constituents
Definition: SuperCluster.h:103
int ix() const
Definition: EEDetId.h:77
CaloClusterPtrVector preshowerClusters_
references to BasicCluster constitunets
Definition: SuperCluster.h:186
double preshowerEnergyPlane1() const
Definition: SuperCluster.h:64
CaloCluster_iterator preshowerClustersBegin() const
fist iterator over PreshowerCluster constituents
Definition: SuperCluster.h:94
const int seedCrysIPhiOrIy() const
Definition: SuperCluster.h:163
void setSeed(const CaloClusterPtr &r)
list of used xtals by DetId // now inherited by CaloCluster
Definition: SuperCluster.h:109
const_iterator end() const
Definition: PtrVector.h:149
void setPhiWidth(double pw)
Definition: SuperCluster.h:75
void setClusters(const CaloClusterPtrVector &clusters)
Definition: SuperCluster.h:112
double phiWidth() const
obtain phi and eta width of the Super Cluster
Definition: SuperCluster.h:68
CaloCluster_iterator clustersEnd() const
last iterator over BasicCluster constituents
Definition: SuperCluster.h:91
int ieta() const
get the crystal ieta
Definition: EBDetId.h:49
double preshowerEnergy_
used hits by detId - retrieved from BC constituents – now inherited from CaloCluster ...
Definition: SuperCluster.h:191
CaloClusterPtr seed_
reference to BasicCluster seed
Definition: SuperCluster.h:180
void setEtaWidth(double ew)
Definition: SuperCluster.h:76
const int seedCrysIEtaOrIx() const
Definition: SuperCluster.h:150
const CaloClusterPtrVector & preshowerClusters() const
const access to the preshower cluster list itself
Definition: SuperCluster.h:85
const_iterator begin() const
Definition: PtrVector.h:147
CaloCluster_iterator preshowerClustersEnd() const
last iterator over PreshowerCluster constituents
Definition: SuperCluster.h:97
std::vector< std::pair< DetId, float > > hitsAndFractions_
Definition: CaloCluster.h:234
double energy() const
cluster energy
Definition: CaloCluster.h:149
double etaWidth() const
Definition: SuperCluster.h:69
void setPreshowerPlanesStatus(const uint32_t &status)
Definition: SuperCluster.h:138
void clearHitsAndFractions()
Definition: SuperCluster.h:121
SuperCluster()
default constructor
Definition: SuperCluster.h:25
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
void addPreshowerCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
Definition: SuperCluster.h:130
const CaloClusterPtrVector & clusters() const
const access to the cluster list itself
Definition: SuperCluster.h:82
void addCluster(const CaloClusterPtr &r)
add reference to constituent BasicCluster
Definition: SuperCluster.h:124
math::XYZPoint Point
Definition: SuperCluster.h:22
const CaloClusterPtr & seed() const
seed BasicCluster
Definition: SuperCluster.h:79
fixed size matrix
Structure Point Contains parameters of Gaussian fits to DMRs.
const int getPreshowerPlanesStatus() const
Definition: SuperCluster.h:148
static const uint32_t flagsMask_
Definition: CaloCluster.h:247
size_t clustersSize() const
number of BasicCluster constituents
Definition: SuperCluster.h:100
double preshowerEnergy() const
energy deposited in preshower
Definition: SuperCluster.h:63
void setPreshowerEnergyPlane1(double preshowerEnergy1)
Definition: SuperCluster.h:73
int iy() const
Definition: EEDetId.h:83
void setPreshowerEnergy(double preshowerEnergy)
Definition: SuperCluster.h:72
double preshowerEnergyPlane2() const
Definition: SuperCluster.h:65