36 #include "CLHEP/Matrix/SymMatrix.h"
95 theAlignableNavigator(0)
97 edm::LogInfo(
"Alignment") <<
"@SUB=ApeSettingAlgorithm" <<
"Start.";
126 if (!apeReadFile.good())
127 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Problem opening APE file: skipping"
131 std::set<int> apeList;
132 while (!apeReadFile.eof())
133 {
int apeId=0;
double x11,x21,x22,x31,x32,x33;
135 { apeReadFile>>apeId>>x11>>x21>>x22>>x31>>x32>>x33>>std::ws;}
137 { apeReadFile>>apeId>>x11>>x22>>x33>>std::ws;}
140 {
if (apeList.find(apeId) == apeList.end())
149 { as[0][0]=x11; as[1][0]=x21; as[1][1]=x22;
150 as[2][0]=x31; as[2][1]=x32; as[2][2]=x33;
153 { as[0][0]=x11*x11; as[1][1]=x22*x22; as[2][2]=x33*x33;}
156 am[0][0]=rt.
xx(); am[0][1]=rt.
xy(); am[0][2]=rt.
xz();
157 am[1][0]=rt.
yx(); am[1][1]=rt.
yy(); am[1][2]=rt.
yz();
158 am[2][0]=rt.
zx(); am[2][1]=rt.
zy(); am[2][2]=rt.
zz();
164 globErr =
GlobalErrorExtended(x11,x21,x31,0,0,0,x22,x32,0,0,0,x33,0,0,0,0,0,0,0,0,0);
166 globErr =
GlobalErrorExtended(x11*x11,0,0,0,0,0,x22*x22,0,0,0,0,x33*x33,0,0,0,0,0,0,0,0,0);
169 alidet->setAlignmentPositionError(globErr,
false);
170 apeList.insert(apeId);
173 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Not Setting APE for Composite DetId "<<apeId;
178 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Skipping duplicate APE for DetId "<<apeId;
183 edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Set "<<apeList.size()<<
" APE values.";
196 for (
int i=0;
i < theSize; ++
i)
205 am[0][0]=rt.
xx(); am[0][1]=rt.
xy(); am[0][2]=rt.
xz();
206 am[1][0]=rt.
yx(); am[1][1]=rt.
yy(); am[1][2]=rt.
yz();
207 am[2][0]=rt.
zx(); am[2][1]=rt.
zy(); am[2][2]=rt.
zz();
208 sm=sm.similarity(am);
210 for (
int j=0;
j < theSize; ++
j)
211 for (
int k=0;
k <=
j; ++
k)
212 apeSaveFile<<
" "<<sm[
j][
k];
214 apeSaveFile<<std::endl;
GlobalErrorBaseExtended< double, ErrorMatrixTag > GlobalErrorExtended
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
AlignableTracker * theTracker
AlignmentErrorsExtended * alignmentErrors() const
Return alignment errors, sorted by DetId.
edm::ParameterSet theConfig
virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo) override
Run the algorithm.
Interface/Base class for alignment algorithms, each alignment algorithm has to be derived from this c...
define event information passed to algorithms
ApeSettingAlgorithm(const edm::ParameterSet &cfg)
Constructor.
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
CLHEP::HepMatrix AlgebraicMatrix
virtual ~ApeSettingAlgorithm()
Destructor.
AlignableNavigator * theAlignableNavigator
bool readFullLocalMatrix_
std::vector< AlignTransformErrorExtended > m_alignError
virtual void terminate()
Called at end of job (must be implemented in derived class)
#define DEFINE_EDM_PLUGIN(factory, type, name)
std::string fullPath() const
Constructor of the full muon geometry.
AlignableDetOrUnitPtr alignableFromDetId(const DetId &detid)
Returns AlignableDetOrUnitPtr corresponding to given DetId.
virtual void initialize(const edm::EventSetup &setup, AlignableTracker *tracker, AlignableMuon *muon, AlignableExtras *extras, AlignmentParameterStore *store) override
Call at beginning of job.
void setup(std::vector< TH2F > &depth, std::string name, std::string units="")
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33