Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
CombinedConstraintEvaluator.cc
Go to the documentation of this file.
1 // -*- mode:c++;tab-width:2;indent-tabs-mode:t;show-trailing-whitespace:t;rm-trailing-spaces:t -*-
2 // vi: set ts=2 noet:
3 //
4 // (c) Copyright Rosetta Commons Member Institutions.
5 // (c) This file is part of the Rosetta software suite and is made available under license.
6 // (c) The Rosetta software is developed by the contributing members of the Rosetta Commons.
7 // (c) For more information, see http://www.rosettacommons.org. Questions about this can be
8 // (c) addressed to University of Washington UW TechTransfer, email: license@u.washington.edu.
9 
10 /// @file PoseEvaluator
11 /// @brief PoseEvaluator
12 /// @detailed
13 ///
14 ///
15 /// @author Oliver Lange
16 
17 
18 
19 // Unit Headers
22 
23 // Package Headers
25 
26 // Project Headers
28 // AUTO-REMOVED #include <core/pose/Pose.hh>
30 // AUTO-REMOVED #include <core/scoring/constraints/ConstraintIO.hh>
32 // AUTO-REMOVED #include <core/scoring/constraints/NamedAtomPairConstraint.hh>
33 // AUTO-REMOVED #include <core/id/Exceptions.hh>
34 
35 // AUTO-REMOVED #include <core/scoring/ScoreFunction.hh>
37 
38 
39 // AUTO-REMOVED #include <core/chemical/VariantType.hh>
40 // AUTO-REMOVED #include <core/kinematics/FoldTree.hh>
41 // AUTO-REMOVED #include <protocols/jumping/JumpSample.hh>
42 // ObjexxFCL Headers
43 // AUTO-REMOVED #include <ObjexxFCL/string.functions.hh>
44 
45 // Utility headers
46 #include <basic/Tracer.hh>
47 // AUTO-REMOVED #include <core/scoring/rms_util.hh>
48 // AUTO-REMOVED #include <utility/file/file_sys_util.hh>
49 
50 #include <utility/vector1.hh>
51 
52 
53 // C++ headers
54 
55 static basic::Tracer tr("protocols.constraints_additional.ConstraintEvaluator");
56 
57 namespace protocols {
58 namespace constraints_additional {
59 
60 using namespace core;
61 using namespace scoring;
62 using namespace constraints;
63 
64 
66  : name_( tag )
67 {
68  for ( Size i = 1; i <= repeat; ++i ) {
69  cst_lib_.push_back( ConstraintEvaluator( tag, file_name ) );
70  cst_lib_.back().set_combine_ratio( combine_ratio );
71  }
72 }
73 
75  Real sum( 0.0 );
76  Size N( cst_lib_.size() );
77  for ( Size i = 1; i <= N; ++i ) {
78  sum += cst_lib_[ i ].apply(pose_in);
79  }
80  return sum / N;
81 }
82 
84  if ( i == 1 ) { return name_; }
85  if ( i == 2 ) { return name_ + "_std"; }
86  runtime_assert( i <= 2 && i > 0 );
87  return ""; //make compiler happy
88 }
89 
91  Real sum( 0.0 );
92  Real std( 0.0 );
93  Size N( cst_lib_.size() );
94  for ( Size i = 1; i <= N; ++i ) {
95  Real val= cst_lib_[ i ].apply(pose_in);
96  sum+=val;
97  std+=val*val;
98  }
99  Real mean( sum / N );
100  pss.add_energy( name( 1 ), mean );
101  if ( size() == 2 ) pss.add_energy( name( 2 ), std/N-mean*mean);
102 }
103 
104 }
105 }