CMS 3D CMS Logo

MuonGeometryArrange.cc
Go to the documentation of this file.
3 #include "CLHEP/Vector/RotationInterfaces.h"
4 
9 
11 
15 // The following looks generic enough to use
23 
26 
27 #include "MuonGeometryArrange.h"
28 #include "TFile.h"
29 #include "TLatex.h"
30 #include "TArrow.h"
31 #include "TGraph.h"
32 #include "TH1F.h"
33 #include "TH2F.h"
34 #include "CLHEP/Vector/ThreeVector.h"
35 
36 // Database
38 
39 #include <iostream>
40 #include <fstream>
41 
43  : theSurveyIndex(0),
44  _levelStrings(cfg.getUntrackedParameter<std::vector<std::string> >("levels")),
45  _writeToDB(false),
46  _commonMuonLevel(align::invalid),
47  firstEvent_(true),
48  idealInputLabel1("MuonGeometryArrangeLabel1"),
49  idealInputLabel2("MuonGeometryArrangeLabel2"),
50  idealInputLabel2a("MuonGeometryArrangeLabel2a"),
51  geomIdeal("MuonGeometryArrangeGeomIdeal"),
52  dtGeomToken1_(esConsumes(edm::ESInputTag("", idealInputLabel1))),
53  cscGeomToken1_(esConsumes(edm::ESInputTag("", idealInputLabel1))),
54  gemGeomToken1_(esConsumes(edm::ESInputTag("", idealInputLabel1))),
55  dtGeomToken2_(esConsumes(edm::ESInputTag("", idealInputLabel2))),
56  cscGeomToken2_(esConsumes(edm::ESInputTag("", idealInputLabel2))),
57  gemGeomToken2_(esConsumes(edm::ESInputTag("", idealInputLabel2))),
58  dtGeomToken3_(esConsumes(edm::ESInputTag("", idealInputLabel2a))),
59  cscGeomToken3_(esConsumes(edm::ESInputTag("", idealInputLabel2a))),
60  gemGeomToken3_(esConsumes(edm::ESInputTag("", idealInputLabel2a))),
61  dtGeomIdealToken_(esConsumes(edm::ESInputTag("", geomIdeal))),
62  cscGeomIdealToken_(esConsumes(edm::ESInputTag("", geomIdeal))),
63  gemGeomIdealToken_(esConsumes(edm::ESInputTag("", geomIdeal))) {
64  referenceMuon = nullptr;
65  currentMuon = nullptr;
66  // Input is XML
67  _inputXMLCurrent = cfg.getUntrackedParameter<std::string>("inputXMLCurrent");
68  _inputXMLReference = cfg.getUntrackedParameter<std::string>("inputXMLReference");
69 
70  //input is ROOT
71  _inputFilename1 = cfg.getUntrackedParameter<std::string>("inputROOTFile1");
72  _inputFilename2 = cfg.getUntrackedParameter<std::string>("inputROOTFile2");
73  _inputTreename = cfg.getUntrackedParameter<std::string>("treeName");
74 
75  //output file
76  _filename = cfg.getUntrackedParameter<std::string>("outputFile");
77 
78  _weightBy = cfg.getUntrackedParameter<std::string>("weightBy");
79  _detIdFlag = cfg.getUntrackedParameter<bool>("detIdFlag");
80  _detIdFlagFile = cfg.getUntrackedParameter<std::string>("detIdFlagFile");
81  _weightById = cfg.getUntrackedParameter<bool>("weightById");
82  _weightByIdFile = cfg.getUntrackedParameter<std::string>("weightByIdFile");
83  _endcap = cfg.getUntrackedParameter<int>("endcapNumber");
84  _station = cfg.getUntrackedParameter<int>("stationNumber");
85  _ring = cfg.getUntrackedParameter<int>("ringNumber");
86 
87  // if want to use, make id cut list
88  if (_detIdFlag) {
89  std::ifstream fin;
90  fin.open(_detIdFlagFile.c_str());
91 
92  while (!fin.eof() && fin.good()) {
93  uint32_t id;
94  fin >> id;
95  _detIdFlagVector.push_back(id);
96  }
97  fin.close();
98  }
99 
100  // turn weightByIdFile into weightByIdVector
101  unsigned int lastID = 999999999;
102  if (_weightById) {
103  std::ifstream inFile;
104  inFile.open(_weightByIdFile.c_str());
105  while (!inFile.eof()) {
106  unsigned int listId;
107  inFile >> listId;
108  inFile.ignore(256, '\n');
109  if (listId != lastID) {
110  _weightByIdVector.push_back(listId);
111  }
112  lastID = listId;
113  }
114  inFile.close();
115  }
116 
117  //root configuration
118  _theFile = new TFile(_filename.c_str(), "RECREATE");
119  _alignTree = new TTree("alignTree", "alignTree");
120  _alignTree->Branch("id", &_id, "id/I");
121  _alignTree->Branch("level", &_level, "level/I");
122  _alignTree->Branch("mid", &_mid, "mid/I");
123  _alignTree->Branch("mlevel", &_mlevel, "mlevel/I");
124  _alignTree->Branch("sublevel", &_sublevel, "sublevel/I");
125  _alignTree->Branch("x", &_xVal, "x/F");
126  _alignTree->Branch("y", &_yVal, "y/F");
127  _alignTree->Branch("z", &_zVal, "z/F");
128  _alignTree->Branch("r", &_rVal, "r/F");
129  _alignTree->Branch("phi", &_phiVal, "phi/F");
130  _alignTree->Branch("eta", &_etaVal, "eta/F");
131  _alignTree->Branch("alpha", &_alphaVal, "alpha/F");
132  _alignTree->Branch("beta", &_betaVal, "beta/F");
133  _alignTree->Branch("gamma", &_gammaVal, "gamma/F");
134  _alignTree->Branch("dx", &_dxVal, "dx/F");
135  _alignTree->Branch("dy", &_dyVal, "dy/F");
136  _alignTree->Branch("dz", &_dzVal, "dz/F");
137  _alignTree->Branch("dr", &_drVal, "dr/F");
138  _alignTree->Branch("dphi", &_dphiVal, "dphi/F");
139  _alignTree->Branch("dalpha", &_dalphaVal, "dalpha/F");
140  _alignTree->Branch("dbeta", &_dbetaVal, "dbeta/F");
141  _alignTree->Branch("dgamma", &_dgammaVal, "dgamma/F");
142  _alignTree->Branch("ldx", &_ldxVal, "ldx/F");
143  _alignTree->Branch("ldy", &_ldyVal, "ldy/F");
144  _alignTree->Branch("ldz", &_ldzVal, "ldz/F");
145  _alignTree->Branch("ldr", &_ldrVal, "ldr/F");
146  _alignTree->Branch("ldphi", &_ldphiVal, "ldphi/F");
147  _alignTree->Branch("useDetId", &_useDetId, "useDetId/I");
148  _alignTree->Branch("detDim", &_detDim, "detDim/I");
149  _alignTree->Branch("rotx", &_rotxVal, "rotx/F");
150  _alignTree->Branch("roty", &_rotyVal, "roty/F");
151  _alignTree->Branch("rotz", &_rotzVal, "rotz/F");
152  _alignTree->Branch("drotx", &_drotxVal, "drotx/F");
153  _alignTree->Branch("droty", &_drotyVal, "droty/F");
154  _alignTree->Branch("drotz", &_drotzVal, "drotz/F");
155  _alignTree->Branch("surW", &_surWidth, "surW/F");
156  _alignTree->Branch("surL", &_surLength, "surL/F");
157  _alignTree->Branch("surRot", &_surRot, "surRot[9]/D");
158 
159  _mgacollection.clear();
160 }
163  // Unpack the list and create ntuples here.
164 
165  int size = _mgacollection.size();
166  if (size <= 0)
167  return; // nothing to do here.
168  std::vector<float> xp(size + 1);
169  std::vector<float> yp(size + 1);
170  int i;
171  float minV, maxV;
172  int minI, maxI;
173 
174  minV = 99999999.;
175  maxV = -minV;
176  minI = 9999999;
177  maxI = -minI;
178  TGraph* grx = nullptr;
179  TH2F* dxh = nullptr;
180 
181  // for position plots:
182  for (i = 0; i < size; i++) {
183  if (_mgacollection[i].phipos < minI)
184  minI = _mgacollection[i].phipos;
185  if (_mgacollection[i].phipos > maxI)
186  maxI = _mgacollection[i].phipos;
187  xp[i] = _mgacollection[i].phipos;
188  }
189  if (minI >= maxI)
190  return; // can't do anything?
191  xp[size] = xp[size - 1] + 1; // wraparound point
192 
193  if (1 < minI)
194  minI = 1;
195  if (size > maxI)
196  maxI = size;
197  maxI++; // allow for wraparound to show neighbors
198  int sizeI = maxI + 1 - minI;
199  float smi = minI - 1;
200  float sma = maxI + 1;
201 
202  // Dx plot
203 
204  for (i = 0; i < size; i++) {
205  if (_mgacollection[i].ldx < minV)
206  minV = _mgacollection[i].ldx;
207  if (_mgacollection[i].ldx > maxV)
208  maxV = _mgacollection[i].ldx;
209  yp[i] = _mgacollection[i].ldx;
210  }
211  yp[size] = yp[0]; // wraparound point
212 
213  makeGraph(sizeI,
214  smi,
215  sma,
216  minV,
217  maxV,
218  dxh,
219  grx,
220  "delX_vs_position",
221  "Local #delta X vs position",
222  "GdelX_vs_position",
223  "#delta x in cm",
224  xp.data(),
225  yp.data(),
226  size);
227  // Dy plot
228  minV = 99999999.;
229  maxV = -minV;
230  for (i = 0; i < size; i++) {
231  if (_mgacollection[i].ldy < minV)
232  minV = _mgacollection[i].ldy;
233  if (_mgacollection[i].ldy > maxV)
234  maxV = _mgacollection[i].ldy;
235  yp[i] = _mgacollection[i].ldy;
236  }
237  yp[size] = yp[0]; // wraparound point
238 
239  makeGraph(sizeI,
240  smi,
241  sma,
242  minV,
243  maxV,
244  dxh,
245  grx,
246  "delY_vs_position",
247  "Local #delta Y vs position",
248  "GdelY_vs_position",
249  "#delta y in cm",
250  xp.data(),
251  yp.data(),
252  size);
253 
254  // Dz plot
255  minV = 99999999.;
256  maxV = -minV;
257  for (i = 0; i < size; i++) {
258  if (_mgacollection[i].dz < minV)
259  minV = _mgacollection[i].dz;
260  if (_mgacollection[i].dz > maxV)
261  maxV = _mgacollection[i].dz;
262  yp[i] = _mgacollection[i].dz;
263  }
264  yp[size] = yp[0]; // wraparound point
265 
266  makeGraph(sizeI,
267  smi,
268  sma,
269  minV,
270  maxV,
271  dxh,
272  grx,
273  "delZ_vs_position",
274  "Local #delta Z vs position",
275  "GdelZ_vs_position",
276  "#delta z in cm",
277  xp.data(),
278  yp.data(),
279  size);
280 
281  // Dphi plot
282  minV = 99999999.;
283  maxV = -minV;
284  for (i = 0; i < size; i++) {
285  if (_mgacollection[i].dphi < minV)
286  minV = _mgacollection[i].dphi;
287  if (_mgacollection[i].dphi > maxV)
288  maxV = _mgacollection[i].dphi;
289  yp[i] = _mgacollection[i].dphi;
290  }
291  yp[size] = yp[0]; // wraparound point
292 
293  makeGraph(sizeI,
294  smi,
295  sma,
296  minV,
297  maxV,
298  dxh,
299  grx,
300  "delphi_vs_position",
301  "#delta #phi vs position",
302  "Gdelphi_vs_position",
303  "#delta #phi in radians",
304  xp.data(),
305  yp.data(),
306  size);
307 
308  // Dr plot
309  minV = 99999999.;
310  maxV = -minV;
311  for (i = 0; i < size; i++) {
312  if (_mgacollection[i].dr < minV)
313  minV = _mgacollection[i].dr;
314  if (_mgacollection[i].dr > maxV)
315  maxV = _mgacollection[i].dr;
316  yp[i] = _mgacollection[i].dr;
317  }
318  yp[size] = yp[0]; // wraparound point
319 
320  makeGraph(sizeI,
321  smi,
322  sma,
323  minV,
324  maxV,
325  dxh,
326  grx,
327  "delR_vs_position",
328  "#delta R vs position",
329  "GdelR_vs_position",
330  "#delta R in cm",
331  xp.data(),
332  yp.data(),
333  size);
334 
335  // Drphi plot
336  minV = 99999999.;
337  maxV = -minV;
338  for (i = 0; i < size; i++) {
339  float ttemp = _mgacollection[i].r * _mgacollection[i].dphi;
340  if (ttemp < minV)
341  minV = ttemp;
342  if (ttemp > maxV)
343  maxV = ttemp;
344  yp[i] = ttemp;
345  }
346  yp[size] = yp[0]; // wraparound point
347 
348  makeGraph(sizeI,
349  smi,
350  sma,
351  minV,
352  maxV,
353  dxh,
354  grx,
355  "delRphi_vs_position",
356  "R #delta #phi vs position",
357  "GdelRphi_vs_position",
358  "R #delta #phi in cm",
359  xp.data(),
360  yp.data(),
361  size);
362 
363  // Dalpha plot
364  minV = 99999999.;
365  maxV = -minV;
366  for (i = 0; i < size; i++) {
367  if (_mgacollection[i].dalpha < minV)
368  minV = _mgacollection[i].dalpha;
369  if (_mgacollection[i].dalpha > maxV)
370  maxV = _mgacollection[i].dalpha;
371  yp[i] = _mgacollection[i].dalpha;
372  }
373  yp[size] = yp[0]; // wraparound point
374 
375  makeGraph(sizeI,
376  smi,
377  sma,
378  minV,
379  maxV,
380  dxh,
381  grx,
382  "delalpha_vs_position",
383  "#delta #alpha vs position",
384  "Gdelalpha_vs_position",
385  "#delta #alpha in rad",
386  xp.data(),
387  yp.data(),
388  size);
389 
390  // Dbeta plot
391  minV = 99999999.;
392  maxV = -minV;
393  for (i = 0; i < size; i++) {
394  if (_mgacollection[i].dbeta < minV)
395  minV = _mgacollection[i].dbeta;
396  if (_mgacollection[i].dbeta > maxV)
397  maxV = _mgacollection[i].dbeta;
398  yp[i] = _mgacollection[i].dbeta;
399  }
400  yp[size] = yp[0]; // wraparound point
401 
402  makeGraph(sizeI,
403  smi,
404  sma,
405  minV,
406  maxV,
407  dxh,
408  grx,
409  "delbeta_vs_position",
410  "#delta #beta vs position",
411  "Gdelbeta_vs_position",
412  "#delta #beta in rad",
413  xp.data(),
414  yp.data(),
415  size);
416 
417  // Dgamma plot
418  minV = 99999999.;
419  maxV = -minV;
420  for (i = 0; i < size; i++) {
421  if (_mgacollection[i].dgamma < minV)
422  minV = _mgacollection[i].dgamma;
423  if (_mgacollection[i].dgamma > maxV)
424  maxV = _mgacollection[i].dgamma;
425  yp[i] = _mgacollection[i].dgamma;
426  }
427  yp[size] = yp[0]; // wraparound point
428 
429  makeGraph(sizeI,
430  smi,
431  sma,
432  minV,
433  maxV,
434  dxh,
435  grx,
436  "delgamma_vs_position",
437  "#delta #gamma vs position",
438  "Gdelgamma_vs_position",
439  "#delta #gamma in rad",
440  xp.data(),
441  yp.data(),
442  size);
443 
444  // Drotx plot
445  minV = 99999999.;
446  maxV = -minV;
447  for (i = 0; i < size; i++) {
448  if (_mgacollection[i].drotx < minV)
449  minV = _mgacollection[i].drotx;
450  if (_mgacollection[i].drotx > maxV)
451  maxV = _mgacollection[i].drotx;
452  yp[i] = _mgacollection[i].drotx;
453  }
454  yp[size] = yp[0]; // wraparound point
455 
456  makeGraph(sizeI,
457  smi,
458  sma,
459  minV,
460  maxV,
461  dxh,
462  grx,
463  "delrotX_vs_position",
464  "#delta rotX vs position",
465  "GdelrotX_vs_position",
466  "#delta rotX in rad",
467  xp.data(),
468  yp.data(),
469  size);
470 
471  // Droty plot
472  minV = 99999999.;
473  maxV = -minV;
474  for (i = 0; i < size; i++) {
475  if (_mgacollection[i].droty < minV)
476  minV = _mgacollection[i].droty;
477  if (_mgacollection[i].droty > maxV)
478  maxV = _mgacollection[i].droty;
479  yp[i] = _mgacollection[i].droty;
480  }
481  yp[size] = yp[0]; // wraparound point
482 
483  makeGraph(sizeI,
484  smi,
485  sma,
486  minV,
487  maxV,
488  dxh,
489  grx,
490  "delrotY_vs_position",
491  "#delta rotY vs position",
492  "GdelrotY_vs_position",
493  "#delta rotY in rad",
494  xp.data(),
495  yp.data(),
496  size);
497 
498  // Drotz plot
499  minV = 99999999.;
500  maxV = -minV;
501  for (i = 0; i < size; i++) {
502  if (_mgacollection[i].drotz < minV)
503  minV = _mgacollection[i].drotz;
504  if (_mgacollection[i].drotz > maxV)
505  maxV = _mgacollection[i].drotz;
506  yp[i] = _mgacollection[i].drotz;
507  }
508  yp[size] = yp[0]; // wraparound point
509 
510  makeGraph(sizeI,
511  smi,
512  sma,
513  minV,
514  maxV,
515  dxh,
516  grx,
517  "delrotZ_vs_position",
518  "#delta rotZ vs position",
519  "GdelrotZ_vs_position",
520  "#delta rotZ in rad",
521  xp.data(),
522  yp.data(),
523  size);
524 
525  // Vector plots
526  // First find the maximum length of sqrt(dx*dx+dy*dy): we'll have to
527  // scale these for visibility
528  maxV = -99999999.;
529  float ttemp, rtemp;
530  float maxR = -9999999.;
531  for (i = 0; i < size; i++) {
534  if (ttemp > maxV)
535  maxV = ttemp;
536  if (rtemp > maxR)
537  maxR = rtemp;
538  }
539 
540  // Don't try to scale rediculously small values
541  float smallestVcm = .001; // 10 microns
542  if (maxV < smallestVcm)
543  maxV = smallestVcm;
544  float scale = 0.;
545  float lside = 1.1 * maxR;
546  if (lside <= 0)
547  lside = 100.;
548  if (maxV > 0) {
549  scale = .09 * lside / maxV;
550  } // units of pad length!
551  char scalename[50];
552  int ret = snprintf(scalename, 50, "#delta #bar{x} length =%f cm", maxV);
553  // If ret<=0 we don't want to print the scale!
554 
555  if (ret > 0) {
556  dxh = new TH2F("vecdrplot", scalename, 80, -lside, lside, 80, -lside, lside);
557  } else {
558  dxh = new TH2F("vecdrplot", "delta #bar{x} Bad scale", 80, -lside, lside, 80, -lside, lside);
559  }
560  dxh->GetXaxis()->SetTitle("x in cm");
561  dxh->GetYaxis()->SetTitle("y in cm");
562  dxh->SetStats(kFALSE);
563  dxh->Draw();
564  TArrow* arrow;
565  for (i = 0; i < size; i++) {
567  // ttemp=ttemp*scale;
568  float nx = _mgacollection[i].x + scale * _mgacollection[i].dx;
569  float ny = _mgacollection[i].y + scale * _mgacollection[i].dy;
570  arrow = new TArrow(_mgacollection[i].x, _mgacollection[i].y, nx, ny); // ttemp*.3*.05, "->");
571  arrow->SetLineWidth(2);
572  arrow->SetArrowSize(ttemp * .2 * .05 / maxV);
573  arrow->SetLineColor(1);
574  arrow->SetLineStyle(1);
575  arrow->Paint();
576  dxh->GetListOfFunctions()->Add(static_cast<TObject*>(arrow));
577  // arrow->Draw();
578  // arrow->Write();
579  }
580  dxh->Write();
581 
582  _theFile->Write();
583  _theFile->Close();
584 }
587  float smi,
588  float sma,
589  float minV,
590  float maxV,
591  TH2F* dxh,
592  TGraph* grx,
593  const char* name,
594  const char* title,
595  const char* titleg,
596  const char* axis,
597  const float* xp,
598  const float* yp,
599  int size) {
600  if (minV >= maxV || smi >= sma || sizeI <= 1 || xp == nullptr || yp == nullptr)
601  return;
602  // out of bounds, bail
603  float diff = maxV - minV;
604  float over = .05 * diff;
605  double ylo = minV - over;
606  double yhi = maxV + over;
607  double dsmi, dsma;
608  dsmi = smi;
609  dsma = sma;
610  dxh = new TH2F(name, title, sizeI + 2, dsmi, dsma, 50, ylo, yhi);
611  dxh->GetXaxis()->SetTitle("Position around ring");
612  dxh->GetYaxis()->SetTitle(axis);
613  dxh->SetStats(kFALSE);
614  dxh->Draw();
615  grx = new TGraph(size, xp, yp);
616  grx->SetName(titleg);
617  grx->SetTitle(title);
618  grx->SetMarkerColor(2);
619  grx->SetMarkerStyle(3);
620  grx->GetXaxis()->SetLimits(dsmi, dsma);
621  grx->GetXaxis()->SetTitle("position number");
622  grx->GetYaxis()->SetLimits(ylo, yhi);
623  grx->GetYaxis()->SetTitle(axis);
624  grx->Draw("A*");
625  grx->Write();
626  return;
627 }
630 
635  if (firstEvent_) {
637  &iSetup.getData(dtGeomToken1_),
638  &iSetup.getData(cscGeomToken1_),
639  &iSetup.getData(gemGeomToken1_),
640  &iSetup.getData(dtGeomToken1_),
641  &iSetup.getData(cscGeomToken1_),
642  &iSetup.getData(gemGeomToken1_));
643  inputAlign1 = new MuonAlignment(iSetup, inputMethod1);
646  &iSetup.getData(dtGeomToken2_),
647  &iSetup.getData(cscGeomToken2_),
648  &iSetup.getData(gemGeomToken2_),
649  &iSetup.getData(dtGeomToken1_),
650  &iSetup.getData(cscGeomToken1_),
651  &iSetup.getData(gemGeomToken1_));
652  inputAlign2 = new MuonAlignment(iSetup, inputMethod2);
655  &iSetup.getData(dtGeomToken3_),
656  &iSetup.getData(cscGeomToken3_),
657  &iSetup.getData(gemGeomToken3_),
658  &iSetup.getData(dtGeomToken1_),
659  &iSetup.getData(cscGeomToken1_),
660  &iSetup.getData(gemGeomToken1_));
661  inputAlign2a = new MuonAlignment(iSetup, inputMethod2a);
663 
666  auto inputGeometry2Copy2 = inputAlign2a->getAlignableMuon();
667 
668  //setting the levels being used in the geometry comparator
669  edm::LogInfo("MuonGeometryArrange") << "levels: " << _levelStrings.size();
670  for (const auto& level : _levelStrings) {
671  theLevels.push_back(inputGeometry2Copy2->objectIdProvider().stringToId(level));
672  edm::LogInfo("MuonGeometryArrange") << "level: " << level;
673  }
674 
675  //compare the goemetries
676  compare(inputGeometry1, inputGeometry2, inputGeometry2Copy2);
677 
678  //write out ntuple
679  //might be better to do within output module
680  _theFile->cd();
681  _alignTree->Write();
682  endHist();
683  // _theFile->Close();
684 
685  firstEvent_ = false;
686  }
687 }
688 
690 void MuonGeometryArrange::compare(Alignable* refAli, Alignable* curAli, Alignable* curAliCopy2) {
691  // First sanity
692  if (refAli == nullptr) {
693  return;
694  }
695  if (curAli == nullptr) {
696  return;
697  }
698 
699  const auto& refComp = refAli->components();
700  const auto& curComp = curAli->components();
701  const auto& curComp2 = curAliCopy2->components();
702  compareGeometries(refAli, curAli, curAliCopy2);
703 
704  int nComp = refComp.size();
705  for (int i = 0; i < nComp; i++) {
706  compare(refComp[i], curComp[i], curComp2[i]);
707  }
708  return;
709 }
710 
713  // First sanity
714  if (refAli == nullptr) {
715  return;
716  }
717  if (curAli == nullptr) {
718  return;
719  }
720  // Is this the Ring we want to align? If so it will contain the
721  // chambers specified in the configuration file
722  if (!isMother(refAli))
723  return; // Not the desired alignable object
724  // But... There are granddaughters involved--and I don't want to monkey with
725  // the layers of the chambers. So, if the mother of this is also an approved
726  // mother, bail.
727  if (isMother(refAli->mother()))
728  return;
729  const auto& refComp = refAli->components();
730  const auto& curComp = curCopy->components();
731  if (refComp.size() != curComp.size()) {
732  return;
733  }
734  // GlobalVectors is a vector of GlobalVector which is a 3D vector
735  align::GlobalVectors originalVectors;
736  align::GlobalVectors currentVectors;
737  align::GlobalVectors originalRelativeVectors;
738  align::GlobalVectors currentRelativeVectors;
739 
740  int nComp = refComp.size();
741  int nUsed = 0;
742  // Use the total displacements here:
743  CLHEP::Hep3Vector TotalX, TotalL;
744  TotalX.set(0., 0., 0.);
745  TotalL.set(0., 0., 0.);
746  // CLHEP::Hep3Vector* Rsubtotal, Wsubtotal, DRsubtotal, DWsubtotal;
747  std::vector<CLHEP::Hep3Vector> Positions;
748  std::vector<CLHEP::Hep3Vector> DelPositions;
749 
750  double xrcenter = 0.;
751  double yrcenter = 0.;
752  double zrcenter = 0.;
753  double xccenter = 0.;
754  double yccenter = 0.;
755  double zccenter = 0.;
756 
757  bool useIt;
758  // Create the "center" for the reference alignment chambers, and
759  // load a vector of their centers
760  for (int ich = 0; ich < nComp; ich++) {
761  useIt = true;
762  if (_weightById) {
763  if (!align::readModuleList(curComp[ich]->id(), curComp[ich]->id(), _weightByIdVector))
764  useIt = false;
765  }
766  if (!useIt)
767  continue;
768  align::GlobalVectors curVs;
770  align::GlobalVector pointsCM = align::centerOfMass(curVs);
771  originalVectors.push_back(pointsCM);
772  nUsed++;
773  xrcenter += pointsCM.x();
774  yrcenter += pointsCM.y();
775  zrcenter += pointsCM.z();
776  }
777  xrcenter = xrcenter / nUsed;
778  yrcenter = yrcenter / nUsed;
779  zrcenter = zrcenter / nUsed;
780 
781  // Create the "center" for the current alignment chambers, and
782  // load a vector of their centers
783  for (int ich = 0; ich < nComp; ich++) {
784  useIt = true;
785  if (_weightById) {
786  if (!align::readModuleList(curComp[ich]->id(), curComp[ich]->id(), _weightByIdVector))
787  useIt = false;
788  }
789  if (!useIt)
790  continue;
791  align::GlobalVectors curVs;
793  align::GlobalVector pointsCM = align::centerOfMass(curVs);
794  currentVectors.push_back(pointsCM);
795 
796  xccenter += pointsCM.x();
797  yccenter += pointsCM.y();
798  zccenter += pointsCM.z();
799  }
800  xccenter = xccenter / nUsed;
801  yccenter = yccenter / nUsed;
802  zccenter = zccenter / nUsed;
803 
804  // OK, now load the <very approximate> vectors from the ring "centers"
805  align::GlobalVector CCur(xccenter, yccenter, zccenter);
806  align::GlobalVector CRef(xrcenter, yrcenter, zrcenter);
807  int nCompR = currentVectors.size();
808  for (int ich = 0; ich < nCompR; ich++) {
809  originalRelativeVectors.push_back(originalVectors[ich] - CRef);
810  currentRelativeVectors.push_back(currentVectors[ich] - CCur);
811  }
812 
813  // All right. Now let the hacking begin.
814  // First out of the gate let's try using the raw values and see what
815  // diffRot does for us.
816 
817  align::RotationType rtype3 = align::diffRot(currentRelativeVectors, originalRelativeVectors);
818 
820  angles = align::toAngles(rtype3);
821 
822  for (int ich = 0; ich < nComp; ich++) {
823  if (_weightById) {
824  if (!align::readModuleList(curComp[ich]->id(), curComp[ich]->id(), _weightByIdVector))
825  continue;
826  }
827  CLHEP::Hep3Vector Rtotal, Wtotal;
828  Rtotal.set(0., 0., 0.);
829  Wtotal.set(0., 0., 0.);
830  for (int i = 0; i < 100; i++) {
832  align::diffAlignables(refComp[ich], curComp[ich], _weightBy, _weightById, _weightByIdVector);
833  CLHEP::Hep3Vector dR(diff[0], diff[1], diff[2]);
834  Rtotal += dR;
835  CLHEP::Hep3Vector dW(diff[3], diff[4], diff[5]);
836  CLHEP::HepRotation rot(Wtotal.unit(), Wtotal.mag());
837  CLHEP::HepRotation drot(dW.unit(), dW.mag());
838  rot *= drot;
839  Wtotal.set(rot.axis().x() * rot.delta(), rot.axis().y() * rot.delta(), rot.axis().z() * rot.delta());
840  align::moveAlignable(curComp[ich], diff);
841  float tolerance = 1e-7;
843  align::diffAlignables(refComp[ich], curComp[ich], _weightBy, _weightById, _weightByIdVector);
844  align::GlobalVector checkR(check[0], check[1], check[2]);
845  align::GlobalVector checkW(check[3], check[4], check[5]);
846  DetId detid(refComp[ich]->id());
847  if ((checkR.mag() > tolerance) || (checkW.mag() > tolerance)) {
848  // edm::LogInfo("CompareGeoms") << "Tolerance Exceeded!(alObjId: "
849  // << refAli->alignableObjectId()
850  // << ", rawId: " << refComp[ich]->geomDetId().rawId()
851  // << ", subdetId: "<< detid.subdetId() << "): " << diff;
852  } else {
853  TotalX += Rtotal;
854  break;
855  } // end of else
856  } // end of for on int i
857  } // end of for on ich
858 
859  // At this point we should have a total displacement and total L
860  TotalX = TotalX / nUsed;
861 
862  // Now start again!
863  AlgebraicVector change(6);
864  change(1) = TotalX.x();
865  change(2) = TotalX.y();
866  change(3) = TotalX.z();
867 
868  change(4) = angles[0];
869  change(5) = angles[1];
870  change(6) = angles[2];
871  align::moveAlignable(curAli, change); // move as a chunk
872 
873  // Now get the components again. They should be in new locations
874  const auto& curComp2 = curAli->components();
875 
876  for (int ich = 0; ich < nComp; ich++) {
877  CLHEP::Hep3Vector Rtotal, Wtotal;
878  Rtotal.set(0., 0., 0.);
879  Wtotal.set(0., 0., 0.);
880  if (_weightById) {
881  if (!align::readModuleList(curComp[ich]->id(), curComp[ich]->id(), _weightByIdVector))
882  continue;
883  }
884 
885  for (int i = 0; i < 100; i++) {
887  align::diffAlignables(refComp[ich], curComp2[ich], _weightBy, _weightById, _weightByIdVector);
888  CLHEP::Hep3Vector dR(diff[0], diff[1], diff[2]);
889  Rtotal += dR;
890  CLHEP::Hep3Vector dW(diff[3], diff[4], diff[5]);
891  CLHEP::HepRotation rot(Wtotal.unit(), Wtotal.mag());
892  CLHEP::HepRotation drot(dW.unit(), dW.mag());
893  rot *= drot;
894  Wtotal.set(rot.axis().x() * rot.delta(), rot.axis().y() * rot.delta(), rot.axis().z() * rot.delta());
895  align::moveAlignable(curComp2[ich], diff);
896  float tolerance = 1e-7;
898  align::diffAlignables(refComp[ich], curComp2[ich], _weightBy, _weightById, _weightByIdVector);
899  align::GlobalVector checkR(check[0], check[1], check[2]);
900  align::GlobalVector checkW(check[3], check[4], check[5]);
901  if ((checkR.mag() > tolerance) || (checkW.mag() > tolerance)) {
902  } else {
903  break;
904  }
905  } // end of for on int i
906  AlgebraicVector TRtot(6);
907  TRtot(1) = Rtotal.x();
908  TRtot(2) = Rtotal.y();
909  TRtot(3) = Rtotal.z();
910  TRtot(4) = Wtotal.x();
911  TRtot(5) = Wtotal.y();
912  TRtot(6) = Wtotal.z();
913  fillTree(refComp[ich], TRtot);
914  } // end of for on ich
915 }
916 
918 
920  _id = refAli->id();
921  _level = refAli->alignableObjectId();
922  //need if ali has no mother
923  if (refAli->mother()) {
924  _mid = refAli->mother()->geomDetId().rawId();
925  _mlevel = refAli->mother()->alignableObjectId();
926  } else {
927  _mid = -1;
928  _mlevel = -1;
929  }
930  DetId detid(_id);
931  _sublevel = detid.subdetId();
932  int ringPhiPos = -99;
933  if (detid.det() == DetId::Muon && detid.subdetId() == MuonSubdetId::CSC) {
934  CSCDetId cscId(refAli->geomDetId());
935  ringPhiPos = cscId.chamber();
936  }
937  _xVal = refAli->globalPosition().x();
938  _yVal = refAli->globalPosition().y();
939  _zVal = refAli->globalPosition().z();
941  _rVal = vec.perp();
942  _phiVal = vec.phi();
943  _etaVal = vec.eta();
945  align::EulerAngles eulerAngles = align::toAngles(rot);
946  _rotxVal = atan2(rot.yz(), rot.zz());
947  float ttt = -rot.xz();
948  if (ttt > 1.)
949  ttt = 1.;
950  if (ttt < -1.)
951  ttt = -1.;
952  _rotyVal = asin(ttt);
953  _rotzVal = atan2(rot.xy(), rot.xx());
954  _alphaVal = eulerAngles[0];
955  _betaVal = eulerAngles[1];
956  _gammaVal = eulerAngles[2];
957  _dxVal = diff[0];
958  _dyVal = diff[1];
959  _dzVal = diff[2];
960  //getting dR and dPhi
963  _drVal = vCur.perp() - vRef.perp();
964  _dphiVal = vCur.phi() - vRef.phi();
965 
966  _dalphaVal = diff[3];
967  _dbetaVal = diff[4];
968  _dgammaVal = diff[5];
969  _drotxVal = -999.;
970  _drotyVal = -999.;
971  _drotzVal = -999.;
972 
973  align::EulerAngles deuler(3);
974  deuler(1) = _dalphaVal;
975  deuler(2) = _dbetaVal;
976  deuler(3) = _dgammaVal;
977  align::RotationType drot = align::toMatrix(deuler);
978  double xx = rot.xx();
979  double xy = rot.xy();
980  double xz = rot.xz();
981  double yx = rot.yx();
982  double yy = rot.yy();
983  double yz = rot.yz();
984  double zx = rot.zx();
985  double zy = rot.zy();
986  double zz = rot.zz();
987  double detrot = (zz * yy - zy * yz) * xx + (-zz * yx + zx * yz) * xy + (zy * yx - zx * yy) * xz;
988  detrot = 1 / detrot;
989  double ixx = (zz * yy - zy * yz) * detrot;
990  double ixy = (-zz * xy + zy * xz) * detrot;
991  double ixz = (yz * xy - yy * xz) * detrot;
992  double iyx = (-zz * yx + zx * yz) * detrot;
993  double iyy = (zz * xx - zx * xz) * detrot;
994  double iyz = (-yz * xx + yx * xz) * detrot;
995  double izx = (zy * yx - zx * yy) * detrot;
996  double izy = (-zy * xx + zx * xy) * detrot;
997  double izz = (yy * xx - yx * xy) * detrot;
998  align::RotationType invrot(ixx, ixy, ixz, iyx, iyy, iyz, izx, izy, izz);
999  align::RotationType prot = rot * drot * invrot;
1000  // align::RotationType prot = rot*drot;
1001  float protx; //, proty, protz;
1002  protx = atan2(prot.yz(), prot.zz());
1003  _drotxVal = protx; //_rotxVal-protx; //atan2(drot.yz(), drot.zz());
1004  ttt = -prot.xz();
1005  if (ttt > 1.)
1006  ttt = 1.;
1007  if (ttt < -1.)
1008  ttt = -1.;
1009  _drotyVal = asin(ttt); // -_rotyVal;
1010  _drotzVal = atan2(prot.xy(), prot.xx()); // - _rotzVal;
1011  // Above does not account for 2Pi wraparounds!
1012  // Prior knowledge: these are supposed to be small rotations. Therefore:
1013  if (_drotxVal > 3.141592656)
1014  _drotxVal = -6.2831853072 + _drotxVal;
1015  if (_drotxVal < -3.141592656)
1016  _drotxVal = 6.2831853072 + _drotxVal;
1017  if (_drotyVal > 3.141592656)
1018  _drotyVal = -6.2831853072 + _drotyVal;
1019  if (_drotyVal < -3.141592656)
1020  _drotyVal = 6.2831853072 + _drotyVal;
1021  if (_drotzVal > 3.141592656)
1022  _drotzVal = -6.2831853072 + _drotzVal;
1023  if (_drotzVal < -3.141592656)
1024  _drotzVal = 6.2831853072 + _drotzVal;
1025 
1026  _ldxVal = -999.;
1027  _ldyVal = -999.;
1028  _ldxVal = -999.;
1029  _ldrVal = -999.;
1030  _ldphiVal = -999; // set fake
1031 
1032  // if(refAli->alignableObjectId() == align::AlignableDetUnit){
1034  align::LocalVector pointL = refAli->surface().toLocal(dV);
1035  //align::LocalVector pointL = (refAli->mother())->surface().toLocal(dV);
1036  _ldxVal = pointL.x();
1037  _ldyVal = pointL.y();
1038  _ldzVal = pointL.z();
1039  _ldphiVal = pointL.phi();
1040  _ldrVal = pointL.perp();
1041  // }
1042  //detIdFlag
1043  if (refAli->alignableObjectId() == align::AlignableDetUnit) {
1044  if (_detIdFlag) {
1045  if ((passIdCut(refAli->id())) || (passIdCut(refAli->mother()->id()))) {
1046  _useDetId = 1;
1047  } else {
1048  _useDetId = 0;
1049  }
1050  }
1051  }
1052  // det module dimension
1053  if (refAli->alignableObjectId() == align::AlignableDetUnit) {
1054  if (refAli->mother()->alignableObjectId() != align::AlignableDet) {
1055  _detDim = 1;
1056  } else if (refAli->mother()->alignableObjectId() == align::AlignableDet) {
1057  _detDim = 2;
1058  }
1059  } else
1060  _detDim = 0;
1061 
1062  _surWidth = refAli->surface().width();
1063  _surLength = refAli->surface().length();
1065  _surRot[0] = rt.xx();
1066  _surRot[1] = rt.xy();
1067  _surRot[2] = rt.xz();
1068  _surRot[3] = rt.yx();
1069  _surRot[4] = rt.yy();
1070  _surRot[5] = rt.yz();
1071  _surRot[6] = rt.zx();
1072  _surRot[7] = rt.zy();
1073  _surRot[8] = rt.zz();
1074 
1075  MGACollection holdit;
1076  holdit.id = _id;
1077  holdit.level = _level;
1078  holdit.mid = _mid;
1079  holdit.mlevel = _mlevel;
1080  holdit.sublevel = _sublevel;
1081  holdit.x = _xVal;
1082  holdit.y = _yVal;
1083  holdit.z = _zVal;
1084  holdit.r = _rVal;
1085  holdit.phi = _phiVal;
1086  holdit.eta = _etaVal;
1087  holdit.alpha = _alphaVal;
1088  holdit.beta = _betaVal;
1089  holdit.gamma = _gammaVal;
1090  holdit.dx = _dxVal;
1091  holdit.dy = _dyVal;
1092  holdit.dz = _dzVal;
1093  holdit.dr = _drVal;
1094  holdit.dphi = _dphiVal;
1095  holdit.dalpha = _dalphaVal;
1096  holdit.dbeta = _dbetaVal;
1097  holdit.dgamma = _dgammaVal;
1098  holdit.useDetId = _useDetId;
1099  holdit.detDim = _detDim;
1100  holdit.surW = _surWidth;
1101  holdit.surL = _surLength;
1102  holdit.ldx = _ldxVal;
1103  holdit.ldy = _ldyVal;
1104  holdit.ldz = _ldzVal;
1105  holdit.ldr = _ldrVal;
1106  holdit.ldphi = _ldphiVal;
1107  holdit.rotx = _rotxVal;
1108  holdit.roty = _rotyVal;
1109  holdit.rotz = _rotzVal;
1110  holdit.drotx = _drotxVal;
1111  holdit.droty = _drotyVal;
1112  holdit.drotz = _drotzVal;
1113  for (int i = 0; i < 9; i++) {
1114  holdit.surRot[i] = _surRot[i];
1115  }
1116  holdit.phipos = ringPhiPos;
1117  _mgacollection.push_back(holdit);
1118 
1119  //Fill
1120  _alignTree->Fill();
1121 }
1122 
1125  // Is this the mother ring?
1126  if (ali == nullptr)
1127  return false; // elementary sanity
1128  const auto& aliComp = ali->components();
1129 
1130  int size = aliComp.size();
1131  if (size <= 0)
1132  return false; // no subcomponents
1133 
1134  for (int i = 0; i < size; i++) {
1135  if (checkChosen(aliComp[i]))
1136  return true; // A ring has CSC chambers
1137  } // as subcomponents
1138  return false; // 1'st layer of subcomponents weren't CSC chambers
1139 }
1141 
1143  // Check whether the item passed satisfies the criteria given.
1144  if (ali == nullptr)
1145  return false; // elementary sanity
1146  // Is this in the CSC section? If not, bail. Later may extend.
1147  if (ali->geomDetId().det() != DetId::Muon || ali->geomDetId().subdetId() != MuonSubdetId::CSC)
1148  return false;
1149  // If it is a CSC alignable, then check that the station, etc are
1150  // those requested.
1151  // One might think of aligning more than a single ring at a time,
1152  // by using a vector of ring numbers. I don't see the sense in
1153  // trying to align more than one station at a time for comparison.
1154  CSCDetId cscId(ali->geomDetId());
1155 #ifdef jnbdebug
1156  std::cout << "JNB " << ali->id() << " " << cscId.endcap() << " " << cscId.station() << " " << cscId.ring() << " "
1157  << cscId.chamber() << " " << _endcap << " " << _station << " " << _ring << "\n"
1158  << std::flush;
1159 #endif
1160  if (cscId.endcap() == _endcap && cscId.station() == _station && cscId.ring() == _ring) {
1161  return true;
1162  }
1163  return false;
1164 }
1166 
1168  // Check to see if this contains CSC components of the appropriate ring
1169  // Ring will contain N Alignables which represent chambers, each of which
1170  // in turn contains M planes. For our purposes we don't care about the
1171  // planes.
1172  // Hmm. Interesting question: Do I want to try to fit the chamber as
1173  // such, or use the geometry?
1174  // I want to fit the chamber, so I'll try to use its presence as the marker.
1175  // What specifically identifies a chamber as a chamber, and not as a layer?
1176  // The fact that it has layers as sub components, or the fact that it is
1177  // the first item with a non-zero ID breakdown? Pick the latter.
1178  //
1179  if (ali == nullptr)
1180  return false;
1181  if (checkChosen(ali))
1182  return true; // If this is one of the desired
1183  // CSC chambers, accept it
1184  const auto& aliComp = ali->components();
1185 
1186  int size = aliComp.size();
1187  if (size <= 0)
1188  return false; // no subcomponents
1189 
1190  for (int i = 0; i < size; i++) {
1191  if (checkChosen(aliComp[i]))
1192  return true; // A ring has CSC chambers
1193  } // as subcomponents
1194  return false; // 1'st layer of subcomponents weren't CSC chambers
1195 }
1198  bool pass = false;
1199  DetId detid(id);
1200  // if(detid.det()==DetId::Muon && detid.subdetId()== MuonSubdetId::CSC){
1201  // CSCDetId cscId(refAli->geomDetId());
1202  // if(cscId.layer()!=1) return false; // ONLY FIRST LAYER!
1203  // }
1204  int nEntries = _detIdFlagVector.size();
1205 
1206  for (int i = 0; i < nEntries; i++) {
1207  if (_detIdFlagVector[i] == id)
1208  pass = true;
1209  }
1210 
1211  return pass;
1212 }
1213 
size
Write out results.
ESGetTokenH3DDVariant esConsumes(std::string const &Record, edm::ConsumesCollector &)
Definition: DeDxTools.cc:283
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:91
bool passChosen(Alignable *ali)
T perp() const
Definition: PV3DBase.h:69
std::vector< align::StructureType > theLevels
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
Definition: EventSetup.h:119
T xx() const
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:132
void compareGeometries(Alignable *refAli, Alignable *curAli, Alignable *curAliCopy2)
bool isMother(Alignable *ali)
T z() const
Definition: PV3DBase.h:61
ret
prodAgent to be discontinued
const double tolerance
Geom::Phi< T > phi() const
Definition: PV3DBase.h:66
T xy() const
T eta() const
Definition: PV3DBase.h:73
MuonGeometryArrange(const edm::ParameterSet &)
Do nothing. Required by framework.
T zz() const
bool checkChosen(Alignable *ali)
AlgebraicVector diffAlignables(Alignable *refAli, Alignable *curAli, const std::string &weightBy, bool weightById, const std::vector< unsigned int > &weightByIdVector)
Definition: AlignTools.cc:10
align::Scalar width() const
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken3_
T yz() const
void analyze(const edm::Event &, const edm::EventSetup &) override
void createPoints(GlobalVectors *Vs, Alignable *ali, const std::string &weightBy, bool weightById, const std::vector< unsigned int > &weightByIdVector)
Definition: AlignTools.cc:96
MuonAlignment * inputAlign2a
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
MuonAlignment * inputAlign2
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken3_
RotationType diffRot(const GlobalVectors &current, const GlobalVectors &nominal)
Definition: Utilities.cc:68
std::vector< unsigned int > _weightByIdVector
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken2_
const int iyy[18][41][3]
const int ixx[18][41][3]
void createROOTGeometry(const edm::EventSetup &iSetup)
T x() const
Definition: PV3DBase.h:59
T y() const
Definition: PV3DBase.h:60
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:135
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken1_
AlignableMuon * getAlignableMuon()
Definition: MuonAlignment.h:32
void makeGraph(int sizeI, float smi, float sma, float minV, float maxV, TH2F *dxh, TGraph *grx, const char *name, const char *title, const char *titleg, const char *axis, const float *xp, const float *yp, int numEntries)
T sqrt(T t)
Definition: SSEVec.h:19
void compare(Alignable *refAli, Alignable *curAli, Alignable *curAliCopy2)
bool readModuleList(unsigned int, unsigned int, const std::vector< unsigned int > &)
Definition: AlignTools.cc:152
T mag() const
Definition: PV3DBase.h:64
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken2_
int chamber() const
Definition: CSCDetId.h:62
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
EulerAngles toAngles(const RotationType &)
Convert rotation matrix to angles about x-, y-, z-axes (frame rotation).
Definition: Utilities.cc:8
virtual const Alignables & components() const =0
Return vector of all direct components.
MuonAlignment * inputAlign1
GlobalVector centerOfMass(const GlobalVectors &theVs)
Find the CM of a set of points.
Definition: Utilities.cc:174
void fillTree(Alignable *refAli, const AlgebraicVector &diff)
Log< level::Info, false > LogInfo
Definition: DetId.h:17
CLHEP::HepVector AlgebraicVector
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:180
AlgebraicVector EulerAngles
Definition: Definitions.h:34
void fillGapsInSurvey(double shiftErr, double angleErr)
const DetId & geomDetId() const
Definition: Alignable.h:177
constexpr uint32_t rawId() const
get the raw id
Definition: DetId.h:57
const std::vector< std::string > _levelStrings
AlignableMuon * referenceMuon
align::Scalar length() const
std::vector< GlobalVector > GlobalVectors
Definition: Utilities.h:28
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken1_
AlignableMuon * currentMuon
HLT enums.
align::RotationType toLocal(const align::RotationType &) const
Return in local frame a rotation given in global frame.
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:34
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:138
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken2_
static constexpr int CSC
Definition: MuonSubdetId.h:12
void moveAlignable(Alignable *ali, AlgebraicVector diff)
Moves the alignable by the AlgebraicVector.
Definition: AlignTools.cc:84
T xz() const
void beginJob() override
Read from DB and print survey info.
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken1_
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken3_
std::vector< uint32_t > _detIdFlagVector
std::vector< MGACollection > _mgacollection