Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PHFieldConfig_v3.cc
Go to the documentation of this file.
1 // $Id: $
2 
11 #include "PHFieldConfig_v3.h"
12 
13 #include <TGeoManager.h>
14 #include <TGeoVolume.h>
15 #include <TMemFile.h>
16 
17 #include <cassert>
18 #include <iostream>
19 #include <sstream>
20 
21 using namespace std;
22 
24  const std::string& filename1,
25  const std::string& filename2,
26  const double scale1,
27  const double scale2,
28  const double targetmag_y) :
29  field_config_(kFieldSeaQuest),
30  filename1_(filename1),
31  filename2_(filename2),
32  scale1_(scale1),
33  scale2_(scale2),
34  _taregetmag_y(targetmag_y)
35 {
36  if(filename1_.find("INVALID") == string::npos) //suppress output when default ctor is called
37  {
38  cout << "PHFieldConfig_v3::PHFieldConfig_v3:" << endl;
39  cout << " from file1 [" << filename1 << "]" << endl;
40  cout << " and file2 [" << filename2 << "]" << endl;
41  cout << "scale1: " << setprecision(5) << scale1_ << ", scale2: " << setprecision(5) << scale2_ << ", targetmag_y: " << _taregetmag_y << endl;
42  }
43 }
44 
46 {
47 }
48 
50 PHObject*
52 {
53  return new PHFieldConfig_v3(*this);
54 }
55 
59 void PHFieldConfig_v3::identify(std::ostream& os) const
60 {
61  os << "PHFieldConfig_v3::identify -";
62  if (isValid())
63  {
64  os << " Field type of [" << "Sea Quest: " << get_field_config_description().c_str() << "]" << endl;
65  os << " from file1 [" << get_filename1() << "]" << endl;
66  os << " and file2 [" << get_filename2() << "]" << endl;
67  os << "scale1: " << scale1_ << ", scale2: " << scale2_ << ", targetmag_y: " << _taregetmag_y << endl;
68  os << "scale1: " << get_magfield_rescale1() << ", scale2: " << get_magfield_rescale2() << ", targetmag_y: " << get_taregetmag_y() << endl;
69  }
70  else
71  os << "Empty";
72  os << endl;
73 }
76 {
77 }
78 
81 {
82  return (filename1_.length()>0 && filename2_.length()>0 );
83 }
std::string filename1_
virtual PHObject * clone() const
Virtual copy constructor.
std::string get_field_config_description() const
const std::string & get_filename1() const
field value in Tesla for target field model ONLY for PHFieldConfig_v3
virtual ~PHFieldConfig_v3()
double get_taregetmag_y() const
field value in Tesla for target field model ONLY for PHFieldConfig_v3
const std::string & get_filename2() const
double get_magfield_rescale2() const
field value in Tesla for uniform field model ONLY for PHFieldConfig_v3
PHFieldConfig_v3()
default constructor for ROOT file IO
virtual void identify(std::ostream &os=std::cout) const
virtual int isValid() const
isValid returns non zero if object contains vailid data
std::string filename2_
double get_magfield_rescale1() const
field value in Tesla for uniform field model ONLY for PHFieldConfig_v3
virtual void Reset()
Clear Event.