00001
00002
00003 #ifndef GLOBAL_CONTROLS
00004 #define GLOBAL_CONTROLS
00005
00006 #include "Output.hh"
00007
00008 using phaser_io::LOGFILE;
00009
00010
00011 namespace scala
00012 {
00013
00014
00015
00016 static float ToleranceDefault = 2.0;
00017
00018 class GlobalControls
00019 {
00020 public:
00021
00022 GlobalControls() : chiral(CHIRAL), ReindexSet(false),
00023 LatTol(ToleranceDefault), assumesameindexing(false) {}
00024 GlobalControls(const Chirality chiral_in)
00025 : ReindexSet(false),
00026 LatTol(ToleranceDefault), assumesameindexing(false)
00027 {chiral = chiral_in;}
00028
00029 void set_Chiral(const Chirality& ChiralFlag);
00030 void set_MinIsig(const double& MinIsig);
00031
00032 void set_OriginalLattice(const bool& OrigLat) {OriginalLat = OrigLat;}
00033 void set_Lauegroup(const std::string& LG) {LaueGroup = LG;}
00034 void set_Spacegroup(const std::string& SG) {SpaceGroup = SG;}
00035 void set_Reindex(const ReindexOp& H) {Reindx = H; ReindexSet=true;}
00036 void set_LatticeTolerance(const double& Tol) {LatTol = Tol;}
00037 void set_SysAbsCheck(const bool& abscheck) {CheckSysAbs = abscheck;}
00038 void set_TestFirstFile(const bool& TestFirst) {testfirstfile = TestFirst;}
00039 void set_AssumeSameIndexing(const bool& Assumesameindexing)
00040 {assumesameindexing = Assumesameindexing;}
00041 void set_AllowI2(const int& lI2) {allowI2 = lI2;}
00042 void set_MaxMult(const int& Maxmult) {maxmult = Maxmult;}
00043
00044
00045 Chirality GetChiral() const {return chiral;}
00046 double GetMinIsig() const {return MinIsigRatio;}
00047
00048 bool OriginalLattice() const {return OriginalLat;}
00049 std::string Lauegroup() const {return LaueGroup;}
00050 std::string Spacegroup() const {return SpaceGroup;}
00051 ReindexOp Reindex() const {return Reindx;}
00052 bool IsReindexSet() const {return ReindexSet;}
00053 double LatticeTolerance() const {return LatTol;}
00054 bool SysAbsCheck() const {return CheckSysAbs;}
00055 bool TestFirstFile() const {return testfirstfile;}
00056 bool AssumeSameIndexing() const {return assumesameindexing;}
00057 int AllowI2() const {return allowI2;}
00058 int MaxMult() const {return maxmult;}
00059
00060 private:
00061 Chirality chiral;
00062 double MinIsigRatio;
00063 bool OriginalLat;
00064 double LatTol;
00065 std::string LaueGroup;
00066 std::string SpaceGroup;
00067 ReindexOp Reindx;
00068 bool ReindexSet;
00069 bool CheckSysAbs;
00070 bool testfirstfile;
00071 bool assumesameindexing;
00072 int allowI2;
00073 int maxmult;
00074 };
00075
00076 class ScoreAccept
00077 {
00078 public:
00079 ScoreAccept() : threshold(-1.0) {};
00080
00081 ScoreAccept(const double& AcceptanceFraction,
00082 const double& MaximumScore);
00083
00084 bool Accept(const double& score) const;
00085
00086 bool IfSet() const {return (threshold >= 0.0);}
00087
00088 double Threshold() const {return threshold*scoremax;}
00089
00090 private:
00091 double threshold;
00092 double scoremax;
00093 };
00094
00095
00096 }
00097 #endif