Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2026-07-16 08:14:33

0001 /**
0002  * @file trackbase/TrkrClusterv6.cc
0003  * @author Ishan Goel
0004  * @date May 2026
0005  * @brief Implementation of TrkrClusterv6
0006  */
0007 #include "TrkrClusterv6.h"
0008 
0009 #include <cmath>
0010 #include <utility>  // for swap
0011 
0012 namespace
0013 {
0014   // square convenience function
0015   template <class T>
0016   constexpr T square(const T& x)
0017   {
0018     return x * x;
0019   }
0020 }  // namespace
0021 
0022 void TrkrClusterv6::identify(std::ostream& os) const
0023 {
0024   os << "---TrkrClusterv6--------------------" << std::endl;
0025 
0026   os << " (rphi,z) =  (" << getLocalX();
0027   os << ", " << getLocalY() << ") cm ";
0028 
0029   os << " valid = " << isValid() << std::endl;
0030 
0031   os << std::endl;
0032   os << "-----------------------------------------------" << std::endl;
0033 
0034   return;
0035 }
0036 
0037 int TrkrClusterv6::isValid() const
0038 {
0039   for (int i = 0; i < 2; ++i)
0040   {
0041     if (std::isnan(getPosition(i)))
0042     {
0043       return 0;
0044     }
0045   }
0046   if (m_adc == 0xFFFF)
0047   {
0048     return 0;
0049   }
0050 
0051   return 1;
0052 }
0053 
0054 void TrkrClusterv6::CopyFrom(const TrkrCluster& source)
0055 {
0056   // do nothing if copying onto oneself
0057   if (this == &source)
0058   {
0059     return;
0060   }
0061 
0062   // parent class method
0063   TrkrCluster::CopyFrom(source);
0064 
0065   setLocalX(source.getLocalX());
0066   setLocalY(source.getLocalY());
0067   setSubSurfKey(source.getSubSurfKey());
0068   setAdc(source.getAdc());
0069   setMaxAdc(source.getMaxAdc());
0070   setCenAdc(source.getCenAdc());
0071   setPadCen(source.getPadCen());
0072   setTBinCen(source.getTBinCen());
0073   setPadMax(source.getPadMax());
0074   setTBinMax(source.getTBinMax());
0075   setPhiError(source.getRPhiError());
0076   setZError(source.getZError());
0077   setRSize(source.getRSize());
0078   setPhiSize(source.getPhiSize());
0079   setZSize(source.getZSize());
0080   setOverlap(source.getOverlap());
0081   setEdge(source.getEdge());
0082   setSLEdge(source.getSLEdge());
0083   setSREdge(source.getSREdge());
0084   setTLEdge(source.getTLEdge());
0085   setTREdge(source.getTREdge());
0086   setDLEdge(source.getDLEdge());
0087   setDREdge(source.getDREdge());
0088   setHLEdge(source.getHLEdge());
0089   setHREdge(source.getHREdge());
0090   setSLMix(source.getSLMix());
0091   setSRMix(source.getSRMix());
0092   setTLMix(source.getTLMix());
0093   setTRMix(source.getTRMix());
0094   setPhiBinLo(source.getPhiBinLo());
0095   setPhiBinHi(source.getPhiBinHi());
0096   setTBinLo(source.getTBinLo());
0097   setTBinHi(source.getTBinHi());
0098   setPadPhase(source.getPadPhase());
0099   setTBinPhase(source.getTBinPhase());
0100 }