CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
MultiMetricsUpdator.cc
Go to the documentation of this file.
1 //#include "Alignment/KalmanAlignmentAlgorithm/plugins/MultiMetricsUpdator.h"
2 #include "MultiMetricsUpdator.h"
3 
6 
8 
9 
10 
12 {
13  std::vector<std::string> strConfig = config.getParameter< std::vector<std::string> >( "Configurations" );
14  std::vector<std::string>::iterator itConfig;
15  for ( itConfig = strConfig.begin(); itConfig != strConfig.end(); ++itConfig )
16  {
17  edm::ParameterSet updatorConfig = config.getParameter<edm::ParameterSet>( *itConfig );
18  theMetricsUpdators.push_back( new SimpleMetricsUpdator( updatorConfig ) );
19  }
20 
21 
22  edm::LogInfo("Alignment") << "@SUB=MultiMetricsUpdator::MultiMetricsUpdator "
23  << "\nInstance of MultiMetricsUpdator created.";;
24 }
25 
26 
28 {
29  std::vector< SimpleMetricsUpdator* >::const_iterator it;
30 
31  for ( it = theMetricsUpdators.begin(); it != theMetricsUpdators.end(); ++it )
32  delete *it;
33 }
34 
35 
36 void MultiMetricsUpdator::update( const std::vector< Alignable* > & alignables )
37 {
38  std::vector< SimpleMetricsUpdator* >::const_iterator it;
39  for ( it = theMetricsUpdators.begin(); it != theMetricsUpdators.end(); ++it )
40  {
41  (*it)->update( alignables );
42  }
43 }
44 
45 
46 const std::vector< Alignable* >
47 MultiMetricsUpdator::additionalAlignables( const std::vector< Alignable* > & alignables )
48 {
49  std::set< Alignable* > alignableSet;
50 
51  std::vector< SimpleMetricsUpdator* >::const_iterator it;
52  for ( it = theMetricsUpdators.begin(); it != theMetricsUpdators.end(); ++it )
53  {
54  const std::vector< Alignable* > additional = (*it)->additionalAlignables( alignables );
55  alignableSet.insert( additional.begin(), additional.end() );
56  }
57 
58  std::vector< Alignable* > result;
59  result.insert( result.end(), alignableSet.begin(), alignableSet.end() );
60  return result;
61 }
62 
63 
64 const std::vector< Alignable* >
66 {
67  std::set< Alignable* > alignableSet;
68 
69  std::vector< SimpleMetricsUpdator* >::const_iterator it;
70  for ( it = theMetricsUpdators.begin(); it != theMetricsUpdators.end(); ++it )
71  {
72  const std::vector< Alignable* > alignables = (*it)->alignables();
73  alignableSet.insert( alignables.begin(), alignables.end() );
74  }
75 
76  std::vector< Alignable* > result;
77  result.insert( result.end(), alignableSet.begin(), alignableSet.end() );
78  return result;
79 }
80 
81 
T getParameter(std::string const &) const
MultiMetricsUpdator(const edm::ParameterSet &config)
virtual ~MultiMetricsUpdator(void)
virtual void update(const std::vector< Alignable * > &alignables)
virtual const std::vector< Alignable * > alignables(void) const
tuple result
Definition: query.py:137
#define DEFINE_EDM_PLUGIN(factory, type, name)
virtual const std::vector< Alignable * > additionalAlignables(const std::vector< Alignable * > &alignables)
std::vector< SimpleMetricsUpdator * > theMetricsUpdators