13 theMinDeltaPerp(0.), theMaxDeltaPerp(0.), theMinDeltaZ(0.), theMaxDeltaZ(0.),
14 theGeomDist(0.), theMetricalThreshold(0)
19 std::vector< unsigned int > dummy;
33 edm::LogInfo(
"Alignment") <<
"@SUB=SimpleMetricsUpdator::SimpleMetricsUpdator "
34 <<
"\nInstance of MetricsCalculator created (MaxMetricsDistance = " << maxDistance <<
").";
40 std::vector< Alignable* > alignablesForUpdate;
41 std::vector< Alignable* >::const_iterator it;
43 for ( it = alignables.begin(); it != alignables.end(); ++it )
45 unsigned int subdetId =
static_cast< unsigned int >( (*it)->geomDetId().subdetId() );
49 alignablesForUpdate.push_back( *it );
57 const std::vector< Alignable* >
60 std::vector< Alignable* >
result;
61 std::vector< Alignable* >::const_iterator itAD;
63 std::map< Alignable*, short int > updateList;
64 std::map< Alignable*, short int >::iterator itUL;
66 std::set< Alignable* > alignablesFromUpdateList;
67 std::set< Alignable* >::iterator itAUL;
70 for ( itAD = alignables.begin(); itAD != alignables.end(); itAD++ )
73 for ( itUL = updateList.begin(); itUL != updateList.end(); itUL++ )
78 alignablesFromUpdateList.insert( itUL->first );
84 for ( itAUL = alignablesFromUpdateList.begin(); itAUL != alignablesFromUpdateList.end(); itAUL++ )
86 if (
find( alignables.begin(), alignables.end(), *itAUL ) == alignables.end() )
88 result.push_back( *itAUL );
96 const std::map< Alignable*, short int >
99 std::map< Alignable*, short int >
result;
100 std::map< Alignable*, short int > updateList;
101 std::map< Alignable*, short int >::iterator itUL;
102 std::map< Alignable*, short int >::iterator itFind;
104 std::vector< Alignable* >::const_iterator itAD;
107 for ( itAD = alignables.begin(); itAD != alignables.end(); itAD++ )
110 for ( itUL = updateList.begin(); itUL != updateList.end(); itUL++ )
112 itFind = result.find( itUL->first );
113 if ( itFind == result.end() )
115 result[itUL->first] = itUL->second;
117 else if ( itFind->second < itUL->second )
119 itFind->second = itUL->second;
124 for ( itAD = alignables.begin(); itAD != alignables.end(); itAD++ )
126 itFind = result.find( *itAD );
127 if ( itFind != result.end() ) result.erase( itFind );
137 short int metricalDist )
const
146 bool barrelRegion = ( detId.subdetId()%2 != 0 );
150 double perp1 = pos1.
perp();
152 double deltaPerp = perp2 - perp1;
158 double z1 = pos1.z();
159 double z2 = pos2.
z();
160 double signZ = ( z1 > 0. ) ? 1. : -1;
161 double deltaZ = signZ*( z2 - z1 );
166 double r1 = pos1.mag();
167 double r2 = pos2.
mag();
168 double sp = pos1.x()*pos2.
x() + pos1.y()*pos2.
y() + pos1.z()*pos2.
z();
170 double dist =
sqrt( r2*r2 - sp*sp/r1/r1 );
virtual const std::map< Alignable *, short int > additionalAlignablesWithDistances(const std::vector< Alignable * > &alignables)
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
void setMaxDistance(short int maxDistance)
Set maximum distance to be stored.
virtual void update(const std::vector< Alignable * > &alignables)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
SimpleMetricsUpdator(const edm::ParameterSet &config)
virtual const std::vector< Alignable * > additionalAlignables(const std::vector< Alignable * > &alignables)
bool additionalSelectionCriterion(Alignable *const &referenceAli, Alignable *const &additionalAli, short int metricalDist) const
std::vector< unsigned int > theExcludedSubdetIds
T perp2() const
Squared magnitude of transverse component.
void updateDistances(const std::vector< Alignable * > &alignables)
Update list of distances with a set Alignables.
KalmanAlignmentMetricsCalculator theMetricsCalculator
const SingleDistancesList & getDistances(Alignable *i) const
#define DEFINE_EDM_PLUGIN(factory, type, name)
const PositionType & globalPosition() const
Return the global position of the object.
short int theMetricalThreshold
const DetId & geomDetId() const