Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-06 08:17:58

0001 // $Id: $
0002 
0003 /*!
0004  * \file PHFieldConfigv2.cc
0005  * \brief
0006  * \author Jin Huang <jhuang@bnl.gov>
0007  * \version $Revision:   $
0008  * \date $Date: $
0009  */
0010 
0011 #include "PHFieldConfigv2.h"
0012 
0013 #include <iostream>
0014 #include <string>
0015 
0016 PHFieldConfigv2::PHFieldConfigv2(
0017     double field_mag_x,
0018     double field_mag_y,
0019     double field_mag_z)
0020   : field_mag_x_(field_mag_x)
0021   , field_mag_y_(field_mag_y)
0022   , field_mag_z_(field_mag_z)
0023 {
0024 }
0025 
0026 /** identify Function from PHObject
0027  @param os Output Stream
0028  */
0029 void PHFieldConfigv2::identify(std::ostream& os) const
0030 {
0031   os << "PHFieldConfigv2::identify -";
0032   if (isValid())
0033   {
0034     os << " Field type of [" << get_field_config_description();
0035     os << "] with field vector of ";
0036     os << "[" << get_field_mag_x();
0037     os << ", " << get_field_mag_y();
0038     os << ", " << get_field_mag_z();
0039     os << "] tesla";
0040   }
0041   else
0042   {
0043     os << "Empty";
0044   }
0045   os << std::endl;
0046 }
0047 
0048 
0049 bool PHFieldConfigv2::operator == (const PHFieldConfig& other ) const
0050 {
0051   return
0052     get_field_config() == other.get_field_config() &&
0053     get_field_mag_x() == other.get_field_mag_x() &&
0054     get_field_mag_y() == other.get_field_mag_y() &&
0055     get_field_mag_z() == other.get_field_mag_z();
0056 }