CMS 3D CMS Logo

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