AmpTools
ComplexParameter.h
Go to the documentation of this file.
1 #if !defined(COMPLEXPARAMETER)
2 #define COMPLEXPARAMETER
3 
4 //******************************************************************************
5 // This file is part of AmpTools, a package for performing Amplitude Analysis
6 //
7 // Copyright Trustees of Indiana University 2010, all rights reserved
8 //
9 // This software written by Matthew Shepherd, Ryan Mitchell, and
10 // Hrayr Matevosyan at Indiana University, Bloomington
11 //
12 // Redistribution and use in source and binary forms, with or without
13 // modification, are permitted provided that the following conditions
14 // are met:
15 // 1. Redistributions of source code must retain the above copyright
16 // notice and author attribution, this list of conditions and the
17 // following disclaimer.
18 // 2. Redistributions in binary form must reproduce the above copyright
19 // notice and author attribution, this list of conditions and the
20 // following disclaimer in the documentation and/or other materials
21 // provided with the distribution.
22 // 3. Neither the name of the University nor the names of its contributors
23 // may be used to endorse or promote products derived from this software
24 // without specific prior written permission.
25 //
26 // Creation of derivative forms of this software for commercial
27 // utilization may be subject to restriction; written permission may be
28 // obtained from the Trustees of Indiana University.
29 //
30 // INDIANA UNIVERSITY AND THE AUTHORS MAKE NO REPRESENTATIONS OR WARRANTIES,
31 // EXPRESS OR IMPLIED. By way of example, but not limitation, INDIANA
32 // UNIVERSITY MAKES NO REPRESENTATIONS OR WARRANTIES OF MERCANTABILITY OR
33 // FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THIS SOFTWARE OR
34 // DOCUMENTATION WILL NOT INFRINGE ANY PATENTS, COPYRIGHTS, TRADEMARKS,
35 // OR OTHER RIGHTS. Neither Indiana University nor the authors shall be
36 // held liable for any liability with respect to any claim by the user or
37 // any other party arising from use of the program.
38 //******************************************************************************
39 
40 #include <string>
41 #include <complex>
42 
45 
47 class MISubject;
48 
49 using namespace std;
50 
69 {
70 
71 public:
72 
89  ComplexParameter( const string& name,
90  MinuitMinimizationManager& aManager,
91  complex< double > initialValue = complex< double >( 1, 0 ),
92  bool purelyReal = false );
93 
98 
106  void update( const MISubject* callingSubject );
107 
113  void setValue( complex< double > value );
114 
119  void fix();
120 
125  void free();
126 
130  const string& name() const { return m_name; }
131 
136  string realName() const { return m_name + "_re"; }
137 
142  string imagName() const { return m_name + "_im"; }
143 
148  bool isPurelyReal() const { return m_purelyReal == true; }
149 
153  bool isFixed() const;
154 
158  complex< double > value() const { return m_value; }
159 
167  const complex< double >* constValuePtr() const { return &m_value; }
168 
173  complex< double >* valuePtr() { return &m_value; }
174 
175 private:
176 
177  // prevent default construction or copying
180 
181  string m_name;
182  complex< double > m_value;
183  bool m_purelyReal;
184 
185  // parameters to hold the two numbers that represent this complex parameter
186  MinuitParameter* m_realPar;
187  MinuitParameter* m_imPar;
188 };
189 
190 #endif
string imagName() const
complex< double > * valuePtr()
const string & name() const
bool isPurelyReal() const
const complex< double > * constValuePtr() const
complex< double > value() const
string realName() const