38 #include "CLHEP/Matrix/SymMatrix.h"
97 theAlignableNavigator(0)
99 edm::LogInfo(
"Alignment") <<
"@SUB=ApeSettingAlgorithm" <<
"Start.";
128 if (!apeReadFile.good())
129 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Problem opening APE file: skipping"
133 std::set<int> apeList;
134 while (!apeReadFile.eof())
135 {
int apeId=0;
double x11,x21,x22,x31,x32,x33,
ignore;
137 { apeReadFile>>apeId>>x11>>x21>>x22>>x31>>x32>>x33>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>ignore>>std::ws;}
139 { apeReadFile>>apeId>>x11>>x22>>x33>>std::ws;}
142 {
if (apeList.find(apeId) == apeList.end())
151 { as[0][0]=x11; as[1][0]=x21; as[1][1]=x22;
152 as[2][0]=x31; as[2][1]=x32; as[2][2]=x33;
155 { as[0][0]=x11*x11; as[1][1]=x22*x22; as[2][2]=x33*x33;}
158 am[0][0]=rt.
xx(); am[0][1]=rt.
xy(); am[0][2]=rt.
xz();
159 am[1][0]=rt.
yx(); am[1][1]=rt.
yy(); am[1][2]=rt.
yz();
160 am[2][0]=rt.
zx(); am[2][1]=rt.
zy(); am[2][2]=rt.
zz();
166 globErr =
GlobalErrorExtended(x11,x21,x31,0,0,0,x22,x32,0,0,0,x33,0,0,0,0,0,0,0,0,0);
168 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);
171 alidet->setAlignmentPositionError(globErr,
false);
172 apeList.insert(apeId);
175 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Not Setting APE for Composite DetId "<<apeId;
180 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Skipping duplicate APE for DetId "<<apeId;
185 edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Set "<<apeList.size()<<
" APE values.";
198 for (
int i=0;
i < theSize; ++
i)
207 am[0][0]=rt.
xx(); am[0][1]=rt.
xy(); am[0][2]=rt.
xz();
208 am[1][0]=rt.
yx(); am[1][1]=rt.
yy(); am[1][2]=rt.
yz();
209 am[2][0]=rt.
zx(); am[2][1]=rt.
zy(); am[2][2]=rt.
zz();
210 sm=sm.similarity(am);
212 for (
int j=0;
j < sm.num_row(); ++
j)
213 for (
int k=0;
k <=
j; ++
k)
214 apeSaveFile<<
" "<<sm[
j][
k];
216 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