Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:22:03

0001 /**
0002  * @file trackbase/TpcPrototypeCluster.h
0003  * @author D. McGlinchey
0004  * @date June 2018
0005  * @brief Version 1 of TrkrCluster
0006  */
0007 #ifndef TRACKBASE_TRKRCLUSTERV1_H
0008 #define TRACKBASE_TRKRCLUSTERV1_H
0009 
0010 #include <trackbase/TrkrCluster.h>
0011 #include <trackbase/TrkrDefs.h>
0012 
0013 #include <iostream>
0014 #include <map>
0015 #include <set>
0016 #include <vector>
0017 
0018 class PHObject;
0019 
0020 /**
0021  * @brief Version 1 of TrkrCluster
0022  *
0023  * Note - D. McGlinchey June 2018:
0024  *   CINT does not like "override", so ignore where CINT
0025  *   complains. Should be checked with ROOT 6 once
0026  *   migration occurs.
0027  */
0028 class TpcPrototypeCluster : public TrkrCluster
0029 {
0030  public:
0031   //! ctor
0032   TpcPrototypeCluster();
0033 
0034   //!dtor
0035   virtual ~TpcPrototypeCluster() {}
0036   // PHObject virtual overloads
0037   virtual void identify(std::ostream& os = std::cout) const;
0038   virtual void Reset() {}
0039   virtual int isValid() const;
0040   virtual PHObject* CloneMe() const { return new TpcPrototypeCluster(*this); }
0041   virtual void setClusKey(TrkrDefs::cluskey id) { m_cluskey = id; }
0042   virtual TrkrDefs::cluskey getClusKey() const { return m_cluskey; }
0043   //
0044   // cluster position
0045   //
0046   virtual float getX() const { return m_pos[0]; }
0047   virtual void setX(float x) { m_pos[0] = x; }
0048   virtual float getY() const { return m_pos[1]; }
0049   virtual void setY(float y) { m_pos[1] = y; }
0050   virtual float getZ() const { return m_pos[2]; }
0051   virtual void setZ(float z) { m_pos[2] = z; }
0052   virtual float getPosition(int coor) const { return m_pos[coor]; }
0053   virtual void setPosition(int coor, float xi) { m_pos[coor] = xi; }
0054   virtual void setGlobal() { m_isGlobal = true; }
0055   virtual void setLocal() { m_isGlobal = false; }
0056   virtual bool isGlobal() { return m_isGlobal; }
0057   //
0058   // cluster info
0059   //
0060   virtual unsigned int getAdc() const { return m_adc; }
0061   virtual void setAdc(unsigned int adc) { m_adc = adc; }
0062   virtual float getSize(unsigned int i, unsigned int j) const;        //< get cluster dimension covar
0063   virtual void setSize(unsigned int i, unsigned int j, float value);  //< set cluster dimension covar
0064 
0065   virtual float getError(unsigned int i, unsigned int j) const;        //< get cluster error covar
0066   virtual void setError(unsigned int i, unsigned int j, float value);  //< set cluster error covar
0067 
0068   //
0069   // convenience interface
0070   //
0071   virtual float getPhiSize() const;
0072   virtual float getZSize() const;
0073 
0074   virtual float getRPhiError() const;
0075   virtual float getPhiError() const;
0076   virtual float getZError() const;
0077 
0078   // prototype specific interface.
0079 
0080   double getAvgPadAzimuth() const
0081   {
0082     return avg_pad_azimuth;
0083   }
0084 
0085   void setAvgPadAzimuth(double avgPadAzimuth)
0086   {
0087     avg_pad_azimuth = avgPadAzimuth;
0088   }
0089 
0090   int getAvgPadRadial() const
0091   {
0092     return avg_pad_radial;
0093   }
0094 
0095   void setAvgPadRadial(int avgPadRadial)
0096   {
0097     avg_pad_radial = avgPadRadial;
0098   }
0099 
0100   double getDeltaAzimuthBin() const
0101   {
0102     return delta_azimuth_bin;
0103   }
0104 
0105   void setDeltaAzimuthBin(double deltaAzimuthBin)
0106   {
0107     delta_azimuth_bin = deltaAzimuthBin;
0108   }
0109 
0110   double getDeltaZ() const
0111   {
0112     return delta_z;
0113   }
0114 
0115   void setDeltaZ(double deltaZ)
0116   {
0117     delta_z = deltaZ;
0118   }
0119 
0120   int getMaxPadAzimuth() const
0121   {
0122     return max_pad_azimuth;
0123   }
0124 
0125   void setMaxPadAzimuth(int maxPadAzimuth)
0126   {
0127     max_pad_azimuth = maxPadAzimuth;
0128   }
0129 
0130   int getMaxSample() const
0131   {
0132     return max_sample;
0133   }
0134 
0135   void setMaxSample(int maxSample)
0136   {
0137     max_sample = maxSample;
0138   }
0139 
0140   int getMinPadAzimuth() const
0141   {
0142     return min_pad_azimuth;
0143   }
0144 
0145   void setMinPadAzimuth(int minPadAzimuth)
0146   {
0147     min_pad_azimuth = minPadAzimuth;
0148   }
0149 
0150   int getMinSample() const
0151   {
0152     return min_sample;
0153   }
0154 
0155   void setMinSample(int minSample)
0156   {
0157     min_sample = minSample;
0158   }
0159 
0160   const std::map<int, double>& getPadAzimuthPeaks() const
0161   {
0162     return pad_azimuth_peaks;
0163   }
0164 
0165   void setPadAzimuthPeaks(const std::map<int, double>& padAzimuthPeaks)
0166   {
0167     pad_azimuth_peaks = padAzimuthPeaks;
0168   }
0169 
0170   const std::map<int, std::vector<double>>& getPadAzimuthSamples() const
0171   {
0172     return pad_azimuth_samples;
0173   }
0174 
0175   void setPadAzimuthSamples(const std::map<int, std::vector<double>>& padAzimuthSamples)
0176   {
0177     pad_azimuth_samples = padAzimuthSamples;
0178   }
0179 
0180   const std::set<int>& getPadAzimuths() const
0181   {
0182     return pad_azimuths;
0183   }
0184 
0185   void setPadAzimuths(const std::set<int>& padAzimuths)
0186   {
0187     pad_azimuths = padAzimuths;
0188   }
0189 
0190   const std::map<int, std::vector<double>>& getPadRadialSamples() const
0191   {
0192     return pad_radial_samples;
0193   }
0194 
0195   void setPadRadialSamples(const std::map<int, std::vector<double>>& padRadialSamples)
0196   {
0197     pad_radial_samples = padRadialSamples;
0198   }
0199 
0200   const std::set<int>& getPadRadials() const
0201   {
0202     return pad_radials;
0203   }
0204 
0205   void setPadRadials(const std::set<int>& padRadials)
0206   {
0207     pad_radials = padRadials;
0208   }
0209 
0210   double getPeak() const
0211   {
0212     return peak;
0213   }
0214 
0215   void setPeak(double peak)
0216   {
0217     this->peak = peak;
0218   }
0219 
0220   double getPeakSample() const
0221   {
0222     return peak_sample;
0223   }
0224 
0225   void setPeakSample(double peakSample)
0226   {
0227     peak_sample = peakSample;
0228   }
0229 
0230   double getPedstal() const
0231   {
0232     return pedstal;
0233   }
0234 
0235   void setPedstal(double pedstal)
0236   {
0237     this->pedstal = pedstal;
0238   }
0239 
0240   const std::set<int>& getSamples() const
0241   {
0242     return samples;
0243   }
0244 
0245   void setSamples(const std::set<int>& samples)
0246   {
0247     this->samples = samples;
0248   }
0249 
0250   int getSizePadAzimuth() const
0251   {
0252     return size_pad_azimuth;
0253   }
0254 
0255   void setSizePadAzimuth(int sizePadAzimuth)
0256   {
0257     size_pad_azimuth = sizePadAzimuth;
0258   }
0259 
0260   int getSizePadRadial() const
0261   {
0262     return size_pad_radial;
0263   }
0264 
0265   void setSizePadRadial(int sizePadRadial)
0266   {
0267     size_pad_radial = sizePadRadial;
0268   }
0269 
0270   const std::vector<double>& getSumSamples() const
0271   {
0272     return sum_samples;
0273   }
0274 
0275   void setSumSamples(const std::vector<double>& sumSamples)
0276   {
0277     sum_samples = sumSamples;
0278   }
0279 
0280  protected:
0281   TrkrDefs::cluskey m_cluskey;  //< unique identifier within container
0282   float m_pos[3];               //< mean position x,y,z
0283   bool m_isGlobal;              //< flag for coord sys (true = global)
0284   unsigned int m_adc;           //< cluster sum adc (D. McGlinchey - Do we need this?)
0285   float m_size[6];              //< size covariance matrix (packed storage) (+/- cm^2)
0286   float m_err[6];               //< covariance matrix: rad, arc and z
0287 
0288   // prototype specifics
0289 
0290   std::set<int> pad_radials;
0291   std::set<int> pad_azimuths;
0292   std::set<int> samples;
0293 
0294   std::map<int, std::vector<double>> pad_radial_samples;
0295   std::map<int, std::vector<double>> pad_azimuth_samples;
0296   std::vector<double> sum_samples;
0297 
0298   int min_sample;
0299   int max_sample;
0300   int min_pad_azimuth;
0301   int max_pad_azimuth;
0302 
0303   double peak;
0304   double peak_sample;
0305   double pedstal;
0306 
0307   //    std::map<int, double> pad_radial_peaks; // radial always have size = 1 in this analysis
0308   std::map<int, double> pad_azimuth_peaks;
0309 
0310   //! pad coordinate
0311   int avg_pad_radial;
0312   double avg_pad_azimuth;
0313 
0314   //! cluster size in units of pad bins
0315   int size_pad_radial;
0316   int size_pad_azimuth;
0317 
0318   //! pad bin size
0319   //! phi size per pad in rad
0320   double delta_azimuth_bin;
0321   //! z size per ADC sample bin
0322   double delta_z;
0323 
0324   ClassDefOverride(TpcPrototypeCluster, 1)
0325 };
0326 
0327 #endif  //TRACKBASE_TRKRCLUSTERV1_H