CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
DummyMetricsUpdator.cc
Go to the documentation of this file.
1 //#include "Alignment/KalmanAlignmentAlgorithm/plugins/DummyMetricsUpdator.h"
2 #include "DummyMetricsUpdator.h"
3 
6 
7 
9 {
10  std::vector< unsigned int > dummy;
11  theFixedAlignableIds = config.getUntrackedParameter< std::vector<unsigned int> >( "FixedAlignableIds", dummy );
12 }
13 
14 
15 void DummyMetricsUpdator::update( const std::vector< Alignable* > & alignables )
16 {
17  std::vector< Alignable* >::const_iterator itAD = alignables.begin();
18  while ( itAD != alignables.end() )
19  {
20  unsigned int subdetId = static_cast< unsigned int >( (*itAD)->geomDetId().subdetId() );
21  if ( find( theFixedAlignableIds.begin(), theFixedAlignableIds.end(), subdetId ) == theFixedAlignableIds.end() )
22  {
23  theSetOfAllAlignables.insert( *itAD );
24  }
25  ++itAD;
26  }
27 }
28 
29 
30 const std::vector< Alignable* >
31 DummyMetricsUpdator::additionalAlignables( const std::vector< Alignable* > & alignables )
32 {
33  std::vector< Alignable* > result;
34  result.reserve( theSetOfAllAlignables.size() );
35 
36  std::set< Alignable* >::iterator itS = theSetOfAllAlignables.begin();
37  while ( itS != theSetOfAllAlignables.end() )
38  {
39  if ( find( alignables.begin(), alignables.end(), *itS ) == alignables.end() ) result.push_back( *itS );
40  ++itS;
41  }
42 
43  return result;
44 }
45 
46 
47 const std::map< Alignable*, short int >
48 DummyMetricsUpdator::additionalAlignablesWithDistances( const std::vector< Alignable* > & alignables )
49 {
50  std::map< Alignable*, short int > result;
51 
52  std::set< Alignable* >::iterator itS = theSetOfAllAlignables.begin();
53  while ( itS != theSetOfAllAlignables.end() )
54  {
55  if ( find( alignables.begin(), alignables.end(), *itS ) == alignables.end() ) result[*itS] = 0;
56  ++itS;
57  }
58 
59  return result;
60 }
61 
62 
63 const std::vector< Alignable* > DummyMetricsUpdator::alignables( void ) const
64 {
65  std::vector< Alignable* > alignables;
66  alignables.reserve( theSetOfAllAlignables.size() );
67  alignables.insert( alignables.begin(), theSetOfAllAlignables.begin(), theSetOfAllAlignables.end() );
68  return alignables;
69 }
70 
71 
T getUntrackedParameter(std::string const &, T const &) const
virtual void update(const std::vector< Alignable * > &alignables)
virtual const std::vector< Alignable * > alignables(void) const
virtual const std::vector< Alignable * > additionalAlignables(const std::vector< Alignable * > &alignables)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< unsigned int > theFixedAlignableIds
tuple result
Definition: query.py:137
std::set< Alignable * > theSetOfAllAlignables
virtual const std::map< Alignable *, short int > additionalAlignablesWithDistances(const std::vector< Alignable * > &alignables)
#define DEFINE_EDM_PLUGIN(factory, type, name)
DummyMetricsUpdator(const edm::ParameterSet &config)