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();
159 globErr =
GlobalError(ROOT::Math::SimilarityT(am,as));
165 alidet->setAlignmentPositionError(globErr,
false);
166 apeList.insert(apeId);
169 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Not Setting APE for Composite DetId "<<apeId;
174 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Skipping duplicate APE for DetId "<<apeId;
179 edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Set "<<apeList.size()<<
" APE values.";
192 for (
int i=0;
i < theSize; ++
i)
201 am[0][0]=rt.
xx(); am[0][1]=rt.
xy(); am[0][2]=rt.
xz();
202 am[1][0]=rt.
yx(); am[1][1]=rt.
yy(); am[1][2]=rt.
yz();
203 am[2][0]=rt.
zx(); am[2][1]=rt.
zy(); am[2][2]=rt.
zz();
204 sm=sm.similarity(am);
206 for (
int j=0;
j < 3; ++
j)
207 for (
int k=0;
k <=
j; ++
k)
208 apeSaveFile<<
" "<<sm[
j][
k];
210 apeSaveFile<<std::endl;
T getParameter(std::string const &) const
T getUntrackedParameter(std::string const &, T const &) const
AlignableTracker * theTracker
std::vector< AlignTransformError > m_alignError
edm::ParameterSet theConfig
virtual void run(const edm::EventSetup &setup, const EventInfo &eventInfo) override
Run the algorithm.
define event information passed to algorithms
ApeSettingAlgorithm(const edm::ParameterSet &cfg)
Constructor.
GlobalErrorBase< double, ErrorMatrixTag > GlobalError
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepSym< double, 3 > > AlgebraicSymMatrix33
CLHEP::HepMatrix AlgebraicMatrix
virtual ~ApeSettingAlgorithm()
Destructor.
AlignmentErrors * alignmentErrors() const
Return alignment errors, sorted by DetId.
AlignableNavigator * theAlignableNavigator
bool readFullLocalMatrix_
#define DEFINE_EDM_PLUGIN(factory, type, name)
virtual void terminate(const edm::EventSetup &iSetup) override
Call at end of job.
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