38 #include "CLHEP/Matrix/SymMatrix.h" 101 edm::LogInfo(
"Alignment") <<
"@SUB=ApeSettingAlgorithm" <<
"Start.";
130 if (!apeReadFile.good())
131 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Problem opening APE file: skipping" 135 std::set<int> apeList;
136 while (!apeReadFile.eof())
137 {
int apeId=0;
double x11,x21,x22,x31,x32,x33,
ignore;
139 { 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;}
141 { apeReadFile>>apeId>>x11>>x22>>x33>>std::ws;}
144 {
if (apeList.find(apeId) == apeList.end())
153 { as[0][0]=x11; as[1][0]=x21; as[1][1]=x22;
154 as[2][0]=x31; as[2][1]=x32; as[2][2]=x33;
157 { as[0][0]=x11*x11; as[1][1]=x22*x22; as[2][2]=x33*x33;}
160 am[0][0]=rt.
xx(); am[0][1]=rt.
xy(); am[0][2]=rt.
xz();
161 am[1][0]=rt.
yx(); am[1][1]=rt.
yy(); am[1][2]=rt.
yz();
162 am[2][0]=rt.
zx(); am[2][1]=rt.
zy(); am[2][2]=rt.
zz();
168 globErr =
GlobalErrorExtended(x11,x21,x31,0,0,0,x22,x32,0,0,0,x33,0,0,0,0,0,0,0,0,0);
170 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);
173 alidet->setAlignmentPositionError(globErr,
false);
174 apeList.insert(apeId);
177 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Not Setting APE for Composite DetId "<<apeId;
182 {
edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Skipping duplicate APE for DetId "<<apeId;
187 edm::LogInfo(
"Alignment") <<
"@SUB=initialize" <<
"Set "<<apeList.size()<<
" APE values.";
200 for (
int i=0;
i < theSize; ++
i)
209 am[0][0]=rt.
xx(); am[0][1]=rt.
xy(); am[0][2]=rt.
xz();
210 am[1][0]=rt.
yx(); am[1][1]=rt.
yy(); am[1][2]=rt.
yz();
211 am[2][0]=rt.
zx(); am[2][1]=rt.
zy(); am[2][2]=rt.
zz();
212 sm=sm.similarity(am);
214 for (
int j=0; j < sm.num_row(); ++j)
215 for (
int k=0;
k <= j; ++
k)
216 apeSaveFile<<
" "<<sm[j][
k];
218 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.
def setup(process, global_tag, zero_tesla=False)
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)
std::string fullPath() const
#define DEFINE_EDM_PLUGIN(factory, type, name)
eventInfo
add run, event number and lumi section
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.
ROOT::Math::SMatrix< double, 3, 3, ROOT::Math::MatRepStd< double, 3, 3 > > AlgebraicMatrix33