Rosetta 3.5
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
JScoreEvaluator.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 protocols/simple_filters/JScoreEvaluator.cc
11 /// @brief
12 /// @author James Thompson
13 
14 #include <core/types.hh>
15 #include <core/pose/Pose.hh>
16 
21 
22 #include <string>
23 
24 #include <utility/vector1.hh>
25 
26 
27 namespace protocols {
28 namespace simple_filters {
29 
31  std::string const & weights,
32  std::string const & type_set_name
33 ) :
34  evaluation::SingleValuePoseEvaluator< core::Real >( weights + "_" + type_set_name ),
35  scorefxn_(core::scoring::ScoreFunctionFactory::create_score_function(weights)),
36  type_set_name_(type_set_name),
37  col_name_(weights)
38 {}
39 
41 
43  core::pose::Pose & pose_in,
44  std::string /*tag*/,
46 ) const {
47  // make a copy of the Pose to prevent nuking side-chains when switching
48  // ResidueTypes
49  core::pose::Pose pose(pose_in);
50 
51  // switch residue types
53 
54  // score with ScoreFunction
55  core::Real const score( (*scorefxn_)(pose) );
56 
57  // put score into SilentStruct
58  ss.add_energy( col_name_, score );
59 }
60 
61 } // simple_filter
62 } // protocols