CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
TrackerGeometryCompare.cc
Go to the documentation of this file.
5 #include "CLHEP/Vector/RotationInterfaces.h"
16 
32 
33 //#include "Alignment/OfflineValidation/interface/ComparisonUtilities.h"
34 //#include "Alignment/CommonAlignment/interface/AlignTools.h"
35 
36 //#include "Alignment/OfflineValidation/plugins/TrackerGeometryCompare.h"
37 #include "TrackerGeometryCompare.h"
38 #include "TFile.h"
39 #include "CLHEP/Vector/ThreeVector.h"
40 
41 // Database
45 //#include "Geometry/Records/interface/PGeometricDetRcd.h"
46 
53 
54 #include <iostream>
55 #include <fstream>
56 #include <sstream>
57 
59  referenceTracker(0),
60  dummyTracker(0),
61  currentTracker(0),
62  theSurveyIndex(0),
63  theSurveyValues(0),
64  theSurveyErrors(0),
65  _commonTrackerLevel(align::invalid),
66  _inputRootFile1(0),
67  _inputRootFile2(0),
68  _inputTree01(0),
69  _inputTree02(0),
70  _inputTree11(0),
71  _inputTree12(0),
72  m_nBins(10000),
73  m_rangeLow(-.1),
74  m_rangeHigh(.1),
75  firstEvent_(true),
76  m_vtkmap(13)
77 {
78 
79  //input is ROOT
80  _inputFilename1 = cfg.getUntrackedParameter< std::string > ("inputROOTFile1");
81  _inputFilename2 = cfg.getUntrackedParameter< std::string > ("inputROOTFile2");
82  _inputTreenameAlign = cfg.getUntrackedParameter< std::string > ("treeNameAlign");
83  _inputTreenameDeform = cfg.getUntrackedParameter< std::string > ("treeNameDeform");
84 
85  //output file
86  _filename = cfg.getUntrackedParameter< std::string > ("outputFile");
87 
88  _writeToDB = cfg.getUntrackedParameter< bool > ("writeToDB" );
89 
90  const std::vector<std::string>& levels = cfg.getUntrackedParameter< std::vector<std::string> > ("levels");
91 
92  _weightBy = cfg.getUntrackedParameter< std::string > ("weightBy");
93  _setCommonTrackerSystem = cfg.getUntrackedParameter< std::string > ("setCommonTrackerSystem");
94  _detIdFlag = cfg.getUntrackedParameter< bool > ("detIdFlag");
95  _detIdFlagFile = cfg.getUntrackedParameter< std::string > ("detIdFlagFile");
96  _weightById = cfg.getUntrackedParameter< bool > ("weightById");
97  _weightByIdFile = cfg.getUntrackedParameter< std::string > ("weightByIdFile");
98 
99  //setting the levels being used in the geometry comparator
100  AlignableObjectId dummy; //DM_534??
101  edm::LogInfo("TrackerGeometryCompare") << "levels: " << levels.size();
102  for (unsigned int l = 0; l < levels.size(); ++l){
103  //DM_61Xm_theLevels.push_back(AlignableObjectId::stringToId(levels[l])) ;
104  m_theLevels.push_back( dummy.nameToType(levels[l])); //DM_534??
105  edm::LogInfo("TrackerGeometryCompare") << "level: " << levels[l];
106  edm::LogInfo("TrackerGeometryCompare") << "structure type: " << dummy.typeToName(m_theLevels.at(l)); //DM_534??
107  }
108 
109 
110  // if want to use, make id cut list
111  if (_detIdFlag){
112  ifstream fin;
113  fin.open( _detIdFlagFile.c_str() );
114 
115  while (!fin.eof() && fin.good() ){
116 
117  uint32_t id;
118  fin >> id;
119  _detIdFlagVector.push_back(id);
120  }
121  fin.close();
122  }
123 
124  // turn weightByIdFile into weightByIdVector
125  if (_weightById){
126  std::ifstream inFile;
127  inFile.open( _weightByIdFile.c_str() );
128  int ctr = 0;
129  while ( !inFile.eof() ){
130  ctr++;
131  unsigned int listId;
132  inFile >> listId;
133  inFile.ignore(256, '\n');
134 
135  _weightByIdVector.push_back( listId );
136  }
137  inFile.close();
138  }
139 
140  //root configuration
141  _theFile = new TFile(_filename.c_str(),"RECREATE");
142  _alignTree = new TTree("alignTree","alignTree");//,"id:level:mid:mlevel:sublevel:x:y:z:r:phi:a:b:c:dx:dy:dz:dr:dphi:da:db:dc");
143  _alignTree->Branch("id", &_id, "id/I");
144  _alignTree->Branch("level", &_level, "level/I");
145  _alignTree->Branch("mid", &_mid, "mid/I");
146  _alignTree->Branch("mlevel", &_mlevel, "mlevel/I");
147  _alignTree->Branch("sublevel", &_sublevel, "sublevel/I");
148  _alignTree->Branch("x", &_xVal, "x/F");
149  _alignTree->Branch("y", &_yVal, "y/F");
150  _alignTree->Branch("z", &_zVal, "z/F");
151  _alignTree->Branch("r", &_rVal, "r/F");
152  _alignTree->Branch("phi", &_phiVal, "phi/F");
153  _alignTree->Branch("eta", &_etaVal, "eta/F");
154  _alignTree->Branch("alpha", &_alphaVal, "alpha/F");
155  _alignTree->Branch("beta", &_betaVal, "beta/F");
156  _alignTree->Branch("gamma", &_gammaVal, "gamma/F");
157  _alignTree->Branch("dx", &_dxVal, "dx/F");
158  _alignTree->Branch("dy", &_dyVal, "dy/F");
159  _alignTree->Branch("dz", &_dzVal, "dz/F");
160  _alignTree->Branch("dr", &_drVal, "dr/F");
161  _alignTree->Branch("dphi", &_dphiVal, "dphi/F");
162  _alignTree->Branch("dalpha", &_dalphaVal, "dalpha/F");
163  _alignTree->Branch("dbeta", &_dbetaVal, "dbeta/F");
164  _alignTree->Branch("dgamma", &_dgammaVal, "dgamma/F");
165  _alignTree->Branch("du", &_duVal, "du/F");
166  _alignTree->Branch("dv", &_dvVal, "dv/F");
167  _alignTree->Branch("dw", &_dwVal, "dw/F");
168  _alignTree->Branch("da", &_daVal, "da/F");
169  _alignTree->Branch("db", &_dbVal, "db/F");
170  _alignTree->Branch("dg", &_dgVal, "dg/F");
171  _alignTree->Branch("useDetId", &_useDetId, "useDetId/I");
172  _alignTree->Branch("detDim", &_detDim, "detDim/I");
173  _alignTree->Branch("surW", &_surWidth, "surW/F");
174  _alignTree->Branch("surL", &_surLength, "surL/F");
175  _alignTree->Branch("surRot", &_surRot, "surRot[9]/D");
176  _alignTree->Branch("identifiers", &_identifiers, "identifiers[6]/I");
177  _alignTree->Branch("type", &_type, "type/I");
178  _alignTree->Branch("surfDeform", &_surfDeform, "surfDeform[13]/D");
179 
180  for (std::vector<TrackerMap>::iterator it = m_vtkmap.begin(); it != m_vtkmap.end(); ++it) {
181  it->setPalette(1) ;
182  it->addPixel(true) ;
183  }
184 
186  TFileDirectory subDir_All = fs->mkdir( "AllSubdetectors" );
187  TFileDirectory subDir_PXB = fs->mkdir( "PixelBarrel" );
188  TFileDirectory subDir_PXF = fs->mkdir( "PixelEndcap" );
189  for (int ii = 0; ii < 13; ++ii) {
190  std::stringstream histname0 ;
191  histname0 << "SurfDeform_Par_" << ii ;
192  m_h1[histname0.str()] = subDir_All.make<TH1D>((histname0.str()).c_str(),(histname0.str()).c_str(),m_nBins,m_rangeLow,m_rangeHigh);
193 
194  std::stringstream histname1 ;
195  histname1 << "SurfDeform_PixelBarrel_Par_" << ii ;
196  m_h1[histname1.str()] = subDir_PXB.make<TH1D>((histname1.str()).c_str(),(histname1.str()).c_str(),m_nBins,m_rangeLow,m_rangeHigh);
197 
198  std::stringstream histname2 ;
199  histname2 << "SurfDeform_PixelEndcap_Par_" << ii ;
200  m_h1[histname2.str()] = subDir_PXF.make<TH1D>((histname2.str()).c_str(),(histname2.str()).c_str(),m_nBins,m_rangeLow,m_rangeHigh);
201  }
202 
203 }
204 
206  firstEvent_ = true;
207 }
208 
210 
211  int iname(0) ;
212  for (std::vector<TrackerMap>::iterator it = m_vtkmap.begin(); it != m_vtkmap.end(); ++it) {
213  std::stringstream mapname ;
214  mapname << "TkMap_SurfDeform" << iname << ".png" ;
215  it->save(true,0,0,mapname.str());
216  mapname.str( std::string() );
217  mapname.clear() ;
218  mapname << "TkMap_SurfDeform" << iname << ".pdf" ;
219  it->save(true,0,0,mapname.str());
220  ++iname ;
221  }
222 
223  _theFile->cd();
224  _alignTree->Write();
225  _theFile->Close();
226 
227 }
228 
230 
231  if (firstEvent_) {
232 
233  //upload the ROOT geometries
234  createROOTGeometry(iSetup);
235 
236  //set common tracker system first
237  // if setting the tracker common system
238  if (_setCommonTrackerSystem != "NONE"){
240  }
241 
242  //compare the goemetries
245 
246  //write out ntuple
247  //might be better to do within output module
248 
249  if (_writeToDB){
250  Alignments* myAlignments = currentTracker->alignments();
251  AlignmentErrors* myAlignmentErrors = currentTracker->alignmentErrors();
252 
253  // 2. Store alignment[Error]s to DB
255  // Call service
256  if( !poolDbService.isAvailable() ) // Die if not available
257  throw cms::Exception("NotAvailable") << "PoolDBOutputService not available";
258 
259  poolDbService->writeOne<Alignments>(&(*myAlignments), poolDbService->beginOfTime(), "TrackerAlignmentRcd");
260  poolDbService->writeOne<AlignmentErrors>(&(*myAlignmentErrors), poolDbService->beginOfTime(), "TrackerAlignmentErrorRcd");
261 
262  }
263 
264  firstEvent_ = false;
265  }
266 }
267 
269 
270  int inputRawId1, inputRawId2;
271  double inputX1, inputY1, inputZ1, inputX2, inputY2, inputZ2;
272  double inputAlpha1, inputBeta1, inputGamma1, inputAlpha2, inputBeta2, inputGamma2;
273 
274  //declare alignments
275  Alignments* alignments1 = new Alignments();
276  AlignmentErrors* alignmentErrors1 = new AlignmentErrors();
277  if (_inputFilename1 != "IDEAL"){
278  _inputRootFile1 = new TFile(_inputFilename1.c_str());
279  TTree* _inputTree01 = (TTree*) _inputRootFile1->Get(_inputTreenameAlign.c_str());
280  _inputTree01->SetBranchAddress("rawid", &inputRawId1);
281  _inputTree01->SetBranchAddress("x", &inputX1);
282  _inputTree01->SetBranchAddress("y", &inputY1);
283  _inputTree01->SetBranchAddress("z", &inputZ1);
284  _inputTree01->SetBranchAddress("alpha", &inputAlpha1);
285  _inputTree01->SetBranchAddress("beta", &inputBeta1);
286  _inputTree01->SetBranchAddress("gamma", &inputGamma1);
287 
288  int nEntries1 = _inputTree01->GetEntries();
289  //fill alignments
290  for (int i = 0; i < nEntries1; ++i){
291 
292  _inputTree01->GetEntry(i);
293  CLHEP::Hep3Vector translation1(inputX1, inputY1, inputZ1);
294  CLHEP::HepEulerAngles eulerangles1(inputAlpha1,inputBeta1,inputGamma1);
295  uint32_t detid1 = inputRawId1;
296  AlignTransform transform1(translation1, eulerangles1, detid1);
297  alignments1->m_align.push_back(transform1);
298 
299  //dummy errors
300  CLHEP::HepSymMatrix clhepSymMatrix(3,0);
301  AlignTransformError transformError(clhepSymMatrix, detid1);
302  alignmentErrors1->m_alignError.push_back(transformError);
303  }
304 
305  // to get the right order
306  std::sort( alignments1->m_align.begin(), alignments1->m_align.end(), lessAlignmentDetId<AlignTransform>() );
307  std::sort( alignmentErrors1->m_alignError.begin(), alignmentErrors1->m_alignError.end(), lessAlignmentDetId<AlignTransformError>() );
308  }
309  //------------------
310  Alignments* alignments2 = new Alignments();
311  AlignmentErrors* alignmentErrors2 = new AlignmentErrors();
312  if (_inputFilename2 != "IDEAL"){
313  _inputRootFile2 = new TFile(_inputFilename2.c_str());
314  TTree* _inputTree02 = (TTree*) _inputRootFile2->Get(_inputTreenameAlign.c_str());
315  _inputTree02->SetBranchAddress("rawid", &inputRawId2);
316  _inputTree02->SetBranchAddress("x", &inputX2);
317  _inputTree02->SetBranchAddress("y", &inputY2);
318  _inputTree02->SetBranchAddress("z", &inputZ2);
319  _inputTree02->SetBranchAddress("alpha", &inputAlpha2);
320  _inputTree02->SetBranchAddress("beta", &inputBeta2);
321  _inputTree02->SetBranchAddress("gamma", &inputGamma2);
322 
323  int nEntries2 = _inputTree02->GetEntries();
324  //fill alignments
325  for (int i = 0; i < nEntries2; ++i){
326 
327  _inputTree02->GetEntry(i);
328  CLHEP::Hep3Vector translation2(inputX2, inputY2, inputZ2);
329  CLHEP::HepEulerAngles eulerangles2(inputAlpha2,inputBeta2,inputGamma2);
330  uint32_t detid2 = inputRawId2;
331  AlignTransform transform2(translation2, eulerangles2, detid2);
332  alignments2->m_align.push_back(transform2);
333 
334  //dummy errors
335  CLHEP::HepSymMatrix clhepSymMatrix(3,0);
336  AlignTransformError transformError(clhepSymMatrix, detid2);
337  alignmentErrors2->m_alignError.push_back(transformError);
338  }
339 
340  //to get the right order
341  std::sort( alignments2->m_align.begin(), alignments2->m_align.end(), lessAlignmentDetId<AlignTransform>() );
342  std::sort( alignmentErrors2->m_alignError.begin(), alignmentErrors2->m_alignError.end(), lessAlignmentDetId<AlignTransformError>() );
343  }
344 
345  //accessing the initial geometry
347  iSetup.get<IdealGeometryRecord>().get(cpv);
348  edm::ESHandle<GeometricDet> theGeometricDet;
349  iSetup.get<IdealGeometryRecord>().get(theGeometricDet);
350  TrackerGeomBuilderFromGeometricDet trackerBuilder;
351 
352  edm::ESHandle<Alignments> globalPositionRcd;
353  iSetup.get<TrackerDigiGeometryRecord>().getRecord<GlobalPositionRcd>().get(globalPositionRcd);
354 
355  //reference tracker
356  TrackerGeometry* theRefTracker = trackerBuilder.build(&*theGeometricDet); //DM_534??
357  if (_inputFilename1 != "IDEAL"){
358  GeometryAligner aligner1;
359  aligner1.applyAlignments<TrackerGeometry>( &(*theRefTracker), &(*alignments1), &(*alignmentErrors1),
360  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Tracker)));
361  }
362  referenceTracker = new AlignableTracker(&(*theRefTracker));
363  //referenceTracker->setSurfaceDeformation(surfDef1, true) ;
364 
365  int inputRawid1;
366  int inputRawid2;
367  int inputDtype1, inputDtype2 ;
368  std::vector<double> inputDpar1;
369  std::vector<double> inputDpar2 ;
370  std::vector<double>* p_inputDpar1 = &inputDpar1;
371  std::vector<double>* p_inputDpar2 = &inputDpar2;
372 
373  const std::vector<Alignable*> comp1 = referenceTracker->deepComponents();
374 
375  SurfaceDeformation * surfDef1;
376  if (_inputFilename1 != "IDEAL"){
377  TTree* _inputTree11 = (TTree*) _inputRootFile1->Get(_inputTreenameDeform.c_str());
378  _inputTree11->SetBranchAddress("irawid", &inputRawid1);
379  _inputTree11->SetBranchAddress("dtype", &inputDtype1);
380  _inputTree11->SetBranchAddress("dpar", &p_inputDpar1);
381 
382  unsigned int nEntries11 = _inputTree11->GetEntries();
383  edm::LogInfo("TrackerGeometryCompare") << " nentries11 = " << nEntries11 << std::endl ;
384  for (unsigned int iEntry = 0; iEntry < nEntries11; ++iEntry) {
385  _inputTree11->GetEntry(iEntry) ;
386 
387  surfDef1 = SurfaceDeformationFactory::create( inputDtype1, inputDpar1);
388 
389  if (int(comp1[iEntry]->id()) == inputRawid1) {
390  comp1[iEntry]->setSurfaceDeformation(surfDef1, true) ;
391  }
392 
393  }
394  }
395 
396  //currernt tracker
397  TrackerGeometry* theCurTracker = trackerBuilder.build(&*theGeometricDet); //DM_534??
398  if (_inputFilename2 != "IDEAL"){
399  GeometryAligner aligner2;
400  aligner2.applyAlignments<TrackerGeometry>( &(*theCurTracker), &(*alignments2), &(*alignmentErrors2),
401  align::DetectorGlobalPosition(*globalPositionRcd, DetId(DetId::Tracker)));
402  }
403  currentTracker = new AlignableTracker(&(*theCurTracker));
404 
405  const std::vector<Alignable*> comp2 = currentTracker->deepComponents();
406 
407  SurfaceDeformation * surfDef2 ;
408  if (_inputFilename2 != "IDEAL"){
409  TTree* _inputTree12 = (TTree*) _inputRootFile2->Get(_inputTreenameDeform.c_str());
410  _inputTree12->SetBranchAddress("irawid", &inputRawid2);
411  _inputTree12->SetBranchAddress("dtype", &inputDtype2);
412  _inputTree12->SetBranchAddress("dpar", &p_inputDpar2);
413 
414  unsigned int nEntries12 = _inputTree12->GetEntries();
415  edm::LogInfo("TrackerGeometryCompare") << " nentries12 = " << nEntries12 << std::endl ;
416  for (unsigned int iEntry = 0; iEntry < nEntries12; ++iEntry) {
417  _inputTree12->GetEntry(iEntry) ;
418 
419  surfDef2 = SurfaceDeformationFactory::create( inputDtype2, inputDpar2);
420 
421  if (int(comp2[iEntry]->id()) == inputRawid2) {
422  comp2[iEntry]->setSurfaceDeformation(surfDef2, true) ;
423  }
424 
425  }
426  }
427 
428  delete alignments1;
429  delete alignmentErrors1;
430  delete alignments2;
431  delete alignmentErrors2;
432 
433 }
434 
435 void TrackerGeometryCompare::compareSurfaceDeformations(TTree* refTree, TTree* curTree) {
436 
437  if (_inputFilename1 != "IDEAL" && _inputFilename2 != "IDEAL") {
438 
439  int inputRawid1;
440  int inputRawid2;
441  int inputSubdetid1, inputSubdetid2 ;
442  int inputDtype1, inputDtype2 ;
443  std::vector<double> inputDpar1;
444  std::vector<double> inputDpar2 ;
445  std::vector<double>* p_inputDpar1 = &inputDpar1;
446  std::vector<double>* p_inputDpar2 = &inputDpar2;
447 
448  TTree* refTree = (TTree*) _inputRootFile1->Get(_inputTreenameDeform.c_str());
449  refTree->SetBranchAddress("irawid", &inputRawid1);
450  refTree->SetBranchAddress("subdetid", &inputSubdetid1);
451  refTree->SetBranchAddress("dtype", &inputDtype1);
452  refTree->SetBranchAddress("dpar", &p_inputDpar1);
453 
454  TTree* curTree = (TTree*) _inputRootFile2->Get(_inputTreenameDeform.c_str());
455  curTree->SetBranchAddress("irawid", &inputRawid2);
456  curTree->SetBranchAddress("subdetid", &inputSubdetid2);
457  curTree->SetBranchAddress("dtype", &inputDtype2);
458  curTree->SetBranchAddress("dpar", &p_inputDpar2);
459 
460  unsigned int nEntries11 = refTree->GetEntries();
461  unsigned int nEntries12 = curTree->GetEntries();
462 
463  if (nEntries11 != nEntries12) {
464  edm::LogError("TrackerGeometryCompare") << " Surface deformation parameters in two geometries differ!\n" ;
465  return ;
466  }
467 
468  for (unsigned int iEntry = 0; iEntry < nEntries12; ++iEntry) {
469  refTree->GetEntry(iEntry) ;
470  curTree->GetEntry(iEntry) ;
471  for (int ii = 0; ii < 13; ++ii) { _surfDeform[ii] = -1.0 ; }
472  for (int npar = 0; npar < int(inputDpar2.size()); ++npar ) {
473  if (inputRawid1 == inputRawid2) {
474  _surfDeform[npar] = inputDpar2.at(npar) - inputDpar1.at(npar) ;
475  std::stringstream histname0 ;
476  histname0 << "SurfDeform_Par_" << npar ;
477  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname0.str()]->Fill(_surfDeform[npar]) ;
478  if (inputSubdetid1 == 1 && inputSubdetid2 == 1) {
479  std::stringstream histname1 ;
480  histname1 << "SurfDeform_PixelBarrel_Par_" << npar ;
481  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname1.str()]->Fill(_surfDeform[npar]) ;
482  }
483  if (inputSubdetid1 == 2 && inputSubdetid2 == 2) {
484  std::stringstream histname2 ;
485  histname2 << "SurfDeform_PixelEndcap_Par_" << npar ;
486  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname2.str()]->Fill(_surfDeform[npar]) ;
487  }
488  (m_vtkmap.at(npar)).fill_current_val(inputRawid1,_surfDeform[npar]) ;
489  }
490  }
491  }
492 
493  } else if ( _inputFilename1 == "IDEAL" && _inputFilename2 != "IDEAL" ) {
494 
495  int inputRawid2;
496  int inputSubdetid2 ;
497  int inputDtype2 ;
498  std::vector<double> inputDpar2 ;
499  std::vector<double>* p_inputDpar2 = &inputDpar2;
500 
501  TTree* curTree = (TTree*) _inputRootFile2->Get(_inputTreenameDeform.c_str());
502  curTree->SetBranchAddress("irawid", &inputRawid2);
503  curTree->SetBranchAddress("subdetid", &inputSubdetid2);
504  curTree->SetBranchAddress("dtype", &inputDtype2);
505  curTree->SetBranchAddress("dpar", &p_inputDpar2);
506 
507  unsigned int nEntries12 = curTree->GetEntries();
508 
509  for (unsigned int iEntry = 0; iEntry < nEntries12; ++iEntry) {
510  curTree->GetEntry(iEntry) ;
511  for (int ii = 0; ii < 12; ++ii) { _surfDeform[ii] = -1.0 ; }
512  for (int npar = 0; npar < int(inputDpar2.size()); ++npar ) {
513  _surfDeform[npar] = inputDpar2.at(npar) ;
514  std::stringstream histname0 ;
515  histname0 << "SurfDeform_Par_" << npar ;
516  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname0.str()]->Fill(_surfDeform[npar]) ;
517  if (inputSubdetid2 == 1) {
518  std::stringstream histname1 ;
519  histname1 << "SurfDeform_PixelBarrel_Par_" << npar ;
520  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname1.str()]->Fill(_surfDeform[npar]) ;
521  }
522  if (inputSubdetid2 == 2) {
523  std::stringstream histname2 ;
524  histname2 << "SurfDeform_PixelEndcap_Par_" << npar ;
525  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname2.str()]->Fill(_surfDeform[npar]) ;
526  }
527  (m_vtkmap.at(npar)).fill_current_val(inputRawid2,_surfDeform[npar]) ;
528  }
529  }
530 
531  } else if ( _inputFilename1 != "IDEAL" && _inputFilename2 == "IDEAL" ) {
532 
533  int inputRawid1;
534  int inputSubdetid1 ;
535  int inputDtype1 ;
536  std::vector<double> inputDpar1;
537  std::vector<double>* p_inputDpar1 = &inputDpar1;
538 
539  TTree* refTree = (TTree*) _inputRootFile1->Get(_inputTreenameDeform.c_str());
540  refTree->SetBranchAddress("irawid", &inputRawid1);
541  refTree->SetBranchAddress("subdetid", &inputSubdetid1);
542  refTree->SetBranchAddress("dtype", &inputDtype1);
543  refTree->SetBranchAddress("dpar", &p_inputDpar1);
544 
545  unsigned int nEntries11 = refTree->GetEntries();
546 
547  for (unsigned int iEntry = 0; iEntry < nEntries11; ++iEntry) {
548  refTree->GetEntry(iEntry) ;
549  for (int ii = 0; ii < 12; ++ii) { _surfDeform[ii] = -1.0 ; }
550  for (int npar = 0; npar < int(inputDpar1.size()); ++npar ) {
551  _surfDeform[npar] = - inputDpar1.at(npar) ;
552  std::stringstream histname0 ;
553  histname0 << "SurfDeform_Par_" << npar ;
554  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname0.str()]->Fill(_surfDeform[npar]) ;
555  if (inputSubdetid1 == 1) {
556  std::stringstream histname1 ;
557  histname1 << "SurfDeform_PixelBarrel_Par_" << npar ;
558  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname1.str()]->Fill(_surfDeform[npar]) ;
559  }
560  if (inputSubdetid1 == 2) {
561  std::stringstream histname2 ;
562  histname2 << "SurfDeform_PixelEndcap_Par_" << npar ;
563  if ( TMath::Abs(_surfDeform[npar]) > (m_rangeHigh - m_rangeLow)/(10.*m_nBins) ) m_h1[histname2.str()]->Fill(_surfDeform[npar]) ;
564  }
565  (m_vtkmap.at(npar)).fill_current_val(inputRawid1,_surfDeform[npar]) ;
566  }
567  }
568 
569  } else if ( _inputFilename1 == "IDEAL" && _inputFilename2 == "IDEAL" ) {
570 
571  edm::LogInfo("TrackerGeometryCompare") << ">>>> Comparing IDEAL with IDEAL: nothing to do! <<<<\n" ;
572 
573  }
574 
575  return ;
576 }
577 
579 
580  using namespace align ;
581 
582  const std::vector<Alignable*>& refComp = refAli->components();
583  const std::vector<Alignable*>& curComp = curAli->components();
584 
585  unsigned int nComp = refComp.size();
586  //only perform for designate levels
587  bool useLevel = false;
588  for (unsigned int i = 0; i < m_theLevels.size(); ++i){
589  if (refAli->alignableObjectId() == m_theLevels[i]) useLevel = true;
590  }
591 
592  //another added level for difference between det and detunit
593  //if ((refAli->alignableObjectId()==2)&&(nComp == 1)) useLevel = false;
594 
595  //coordinate matching, etc etc
596  if (useLevel){
597  DetId detid(refAli->id());
598 
599  CLHEP::Hep3Vector Rtotal, Wtotal, lRtotal, lWtotal;
600  Rtotal.set(0.,0.,0.);
601  Wtotal.set(0.,0.,0.);
602  lRtotal.set(0.,0.,0.);
603  lWtotal.set(0.,0.,0.);
604 
605  for (int i = 0; i < 100; i++){
607  CLHEP::Hep3Vector dR(diff[0],diff[1],diff[2]);
608  Rtotal+=dR;
609  CLHEP::Hep3Vector dW(diff[3],diff[4],diff[5]);
610  CLHEP::HepRotation rot(Wtotal.unit(),Wtotal.mag());
611  CLHEP::HepRotation drot(dW.unit(),dW.mag());
612  rot*=drot;
613  Wtotal.set(rot.axis().x()*rot.delta(), rot.axis().y()*rot.delta(), rot.axis().z()*rot.delta());
614  // local coordinates
615  lRtotal.set(diff[6],diff[7],diff[8]);
616  lWtotal.set(diff[9],diff[10],diff[11]);
617  align::moveAlignable(curAli, diff);
618  float tolerance = 1e-7;
620  align::GlobalVector checkR(check[0],check[1],check[2]);
621  align::GlobalVector checkW(check[3],check[4],check[5]);
622  if ((checkR.mag() > tolerance)||(checkW.mag() > tolerance)){
623  edm::LogInfo("TrackerGeometryCompare") << "Tolerance Exceeded!(alObjId: " << refAli->alignableObjectId()
624  << ", rawId: " << refAli->geomDetId().rawId()
625  << ", subdetId: "<< detid.subdetId() << "): " << diff;
626  throw cms::Exception("Tolerance in TrackerGeometryCompare exceeded");
627  }
628  else{
629  break;
630  }
631  }
632 
633  AlgebraicVector TRtot(12);
634  // global
635  TRtot(1) = Rtotal.x(); TRtot(2) = Rtotal.y(); TRtot(3) = Rtotal.z();
636  TRtot(4) = Wtotal.x(); TRtot(5) = Wtotal.y(); TRtot(6) = Wtotal.z();
637  // local
638  TRtot(7) = lRtotal.x(); TRtot(8) = lRtotal.y(); TRtot(9) = lRtotal.z();
639  TRtot(10) = lWtotal.x(); TRtot(11) = lWtotal.y(); TRtot(12) = lWtotal.z();
640 
641  fillTree(refAli, TRtot);
642  }
643 
644  // another added level for difference between det and detunit
645  for (unsigned int i = 0; i < nComp; ++i)
646  compareGeometries(refComp[i],curComp[i]);
647 
648 }
649 
651 
652  edm::LogInfo("TrackerGeometryCompare") << "Setting Common Tracker System....";
653 
654  AlignableObjectId dummy; // DM_534??
656 
658 
659  align::EulerAngles dOmega(3); dOmega[0] = _TrackerCommonR.x() ; dOmega[1] = _TrackerCommonR.y(); dOmega[2] = _TrackerCommonR.z();
662 
663  std::cout << "what we get from overlaying the pixels..." << theR << ", " << rot << std::endl;
664 
665  //transform to the Tracker System
667  align::GlobalVector cmDiff( trackerCM.x()-_TrackerCommonCM.x(), trackerCM.y()-_TrackerCommonCM.y(), trackerCM.z()-_TrackerCommonCM.z() );
668 
669  std::cout << "Pixel CM: " << _TrackerCommonCM << ", tracker CM: " << trackerCM << std::endl;
670 
671  //adjust translational difference factoring in different rotational CM
672  //needed because rotateInGlobalFrame is about CM of alignable, not Tracker
673  align::GlobalVector::BasicVectorType lpvgf = cmDiff.basicVector();
674  align::GlobalVector moveV( rot.multiplyInverse(lpvgf) - lpvgf);
675  align::GlobalVector theRprime(theR + moveV);
676 
677  AlgebraicVector TrackerCommonTR(6);
678  TrackerCommonTR(1) = theRprime.x(); TrackerCommonTR(2) = theRprime.y(); TrackerCommonTR(3) = theRprime.z();
679  TrackerCommonTR(4) = _TrackerCommonR.x(); TrackerCommonTR(5) = _TrackerCommonR.y(); TrackerCommonTR(6) = _TrackerCommonR.z();
680 
681  std::cout << "and after the transformation: " << TrackerCommonTR << std::endl;
682 
683  align::moveAlignable(currentTracker, TrackerCommonTR );
684 
685 }
686 
688 
689  const std::vector<Alignable*>& refComp = refAli->components();
690  const std::vector<Alignable*>& curComp = curAli->components();
691 
692  unsigned int nComp = refComp.size();
693  //only perform for designate levels
694  bool useLevel = false;
695  if (refAli->alignableObjectId() == _commonTrackerLevel) useLevel = true;
696 
697  //useLevel = false;
698  if (useLevel){
699  CLHEP::Hep3Vector Rtotal, Wtotal;
700  Rtotal.set(0.,0.,0.); Wtotal.set(0.,0.,0.);
701 
703  CLHEP::Hep3Vector dR(diff[0],diff[1],diff[2]);
704  Rtotal+=dR;
705  CLHEP::Hep3Vector dW(diff[3],diff[4],diff[5]);
706  CLHEP::HepRotation rot(Wtotal.unit(),Wtotal.mag());
707  CLHEP::HepRotation drot(dW.unit(),dW.mag());
708  rot*=drot;
709  Wtotal.set(rot.axis().x()*rot.delta(), rot.axis().y()*rot.delta(), rot.axis().z()*rot.delta());
710  /*
711  //std::cout << "a";
712  //if (refAli->alignableObjectId() == 1) std::cout << "DIFF: " << diff << std::endl;
713  align::moveAlignable(curAli, diff);
714  float tolerance = 1e-7;
715  AlgebraicVector check = align::diffAlignables(refAli,curAli, _weightBy, _weightById, _weightByIdVector);
716  align::GlobalVector checkR(check[0],check[1],check[2]);
717  align::GlobalVector checkW(check[3],check[4],check[5]);
718  DetId detid(refAli->id());
719  if ((checkR.mag() > tolerance)||(checkW.mag() > tolerance)){
720  edm::LogInfo("TrackerGeometryCompare") << "Tolerance Exceeded!(alObjId: " << refAli->alignableObjectId()
721  << ", rawId: " << refAli->geomDetId().rawId()
722  << ", subdetId: "<< detid.subdetId() << "): " << diff;
723  }
724  else{
725  break;
726  }
727  }
728  */
729 
730  //_TrackerCommonT.set(Rtotal.x(), Rtotal.y(), Rtotal.z());
731  _TrackerCommonT = align::GlobalVector(Rtotal.x(), Rtotal.y(), Rtotal.z());
732  _TrackerCommonR = align::GlobalVector(Wtotal.x(), Wtotal.y(), Wtotal.z());
733  _TrackerCommonCM = curAli->globalPosition();
734  //_TrackerCommonTR(1) = Rtotal.x(); _TrackerCommonTR(2) = Rtotal.y(); _TrackerCommonTR(3) = Rtotal.z();
735  //_TrackerCommonTR(4) = Wtotal.x(); _TrackerCommonTR(5) = Wtotal.y(); _TrackerCommonTR(6) = Wtotal.z();
736 
737 
738  }
739  else{
740  for (unsigned int i = 0; i < nComp; ++i) diffCommonTrackerSystem(refComp[i],curComp[i]);
741  }
742 
743 
744 }
745 
747 
748  _id = refAli->id();
749  _level = refAli->alignableObjectId();
750  //need if ali has no mother
751  if (refAli->mother()){
752  _mid = refAli->mother()->geomDetId().rawId();
753  _mlevel = refAli->mother()->alignableObjectId();
754  }
755  else{
756  _mid = -1;
757  _mlevel = -1;
758  }
759  DetId detid(_id);
760  _sublevel = detid.subdetId();
762  _xVal = refAli->globalPosition().x();
763  _yVal = refAli->globalPosition().y();
764  _zVal = refAli->globalPosition().z();
766  _rVal = vec.perp();
767  _phiVal = vec.phi();
768  _etaVal = vec.eta();
770  align::EulerAngles eulerAngles = align::toAngles(rot);
771  _alphaVal = eulerAngles[0];
772  _betaVal = eulerAngles[1];
773  _gammaVal = eulerAngles[2];
774  // global
775  _dxVal = diff[0];
776  _dyVal = diff[1];
777  _dzVal = diff[2];
778  // local
779  _duVal = diff[6];
780  _dvVal = diff[7];
781  _dwVal = diff[8];
782  //...TODO...
784  //getting dR and dPhi
787  _drVal = vCur.perp() - vRef.perp();
788  _dphiVal = vCur.phi() - vRef.phi();
789  // global
790  _dalphaVal = diff[3];
791  _dbetaVal = diff[4];
792  _dgammaVal = diff[5];
793  // local
794  _daVal = diff[9];
795  _dbVal = diff[10];
796  _dgVal = diff[11];
797 
798  //detIdFlag
799  if (refAli->alignableObjectId() == align::AlignableDetUnit){
800  if (_detIdFlag){
801  if ((passIdCut(refAli->id()))||(passIdCut(refAli->mother()->id()))){
802  _useDetId = 1;
803  }
804  else{
805  _useDetId = 0;
806  }
807  }
808  }
809  // det module dimension
810  if (refAli->alignableObjectId() == align::AlignableDetUnit){
811  if (refAli->mother()->alignableObjectId() != align::AlignableDet) _detDim = 1;
812  else if (refAli->mother()->alignableObjectId() == align::AlignableDet) _detDim = 2;
813  }
814  else _detDim = 0;
815 
816  _surWidth = refAli->surface().width();
817  _surLength = refAli->surface().length();
818  align::RotationType rt = refAli->globalRotation();
819  _surRot[0] = rt.xx(); _surRot[1] = rt.xy(); _surRot[2] = rt.xz();
820  _surRot[3] = rt.yx(); _surRot[4] = rt.yy(); _surRot[5] = rt.yz();
821  _surRot[6] = rt.zx(); _surRot[7] = rt.zy(); _surRot[8] = rt.zz();
822 
823  //Fill
824  _alignTree->Fill();
825 
826 }
827 
829 
830  //getting the right alignables for the alignment record
831  std::vector<Alignable*> detPB = ali->pixelHalfBarrelGeomDets();
832  std::vector<Alignable*> detPEC = ali->pixelEndcapGeomDets();
833  std::vector<Alignable*> detTIB = ali->innerBarrelGeomDets();
834  std::vector<Alignable*> detTID = ali->TIDGeomDets();
835  std::vector<Alignable*> detTOB = ali->outerBarrelGeomDets();
836  std::vector<Alignable*> detTEC = ali->endcapGeomDets();
837 
838  std::vector<Alignable*> allGeomDets;
839  std::copy(detPB.begin(), detPB.end(), std::back_inserter(allGeomDets));
840  std::copy(detPEC.begin(), detPEC.end(), std::back_inserter(allGeomDets));
841  std::copy(detTIB.begin(), detTIB.end(), std::back_inserter(allGeomDets));
842  std::copy(detTID.begin(), detTID.end(), std::back_inserter(allGeomDets));
843  std::copy(detTOB.begin(), detTOB.end(), std::back_inserter(allGeomDets));
844  std::copy(detTEC.begin(), detTEC.end(), std::back_inserter(allGeomDets));
845 
846  std::vector<Alignable*> rcdAlis;
847  for (std::vector<Alignable*>::iterator i = allGeomDets.begin(); i!= allGeomDets.end(); i++){
848  if ((*i)->components().size() == 1){
849  rcdAlis.push_back((*i));
850  }
851  else if ((*i)->components().size() > 1){
852  rcdAlis.push_back((*i));
853  std::vector<Alignable*> comp = (*i)->components();
854  for (std::vector<Alignable*>::iterator j = comp.begin(); j != comp.end(); j++){
855  rcdAlis.push_back((*j));
856  }
857  }
858  }
859 
860  //turning them into alignments
861  for(std::vector<Alignable*>::iterator k = rcdAlis.begin(); k != rcdAlis.end(); k++){
862 
863  const SurveyDet* surveyInfo = (*k)->survey();
864  align::PositionType pos(surveyInfo->position());
865  align::RotationType rot(surveyInfo->rotation());
866  CLHEP::Hep3Vector clhepVector(pos.x(),pos.y(),pos.z());
867  CLHEP::HepRotation clhepRotation( CLHEP::HepRep3x3(rot.xx(),rot.xy(),rot.xz(),rot.yx(),rot.yy(),rot.yz(),rot.zx(),rot.zy(),rot.zz()));
868  AlignTransform transform(clhepVector, clhepRotation, (*k)->id());
869  AlignTransformError transformError(CLHEP::HepSymMatrix(3,1), (*k)->id());
870  alignVals->m_align.push_back(transform);
871  alignErrors->m_alignError.push_back(transformError);
872  }
873 
874  //to get the right order
875  std::sort( alignVals->m_align.begin(), alignVals->m_align.end(), lessAlignmentDetId<AlignTransform>() );
876  std::sort( alignErrors->m_alignError.begin(), alignErrors->m_alignError.end(), lessAlignmentDetId<AlignTransformError>() );
877 
878 }
879 
881 
882  const std::vector<Alignable*>& comp = ali->components();
883 
884  unsigned int nComp = comp.size();
885 
886  for (unsigned int i = 0; i < nComp; ++i) addSurveyInfo(comp[i]);
887 
889 
890  if ( ali->geomDetId().rawId() != error.rawId() ||
891  ali->alignableObjectId() != error.structureType() )
892  {
893  throw cms::Exception("DatabaseError")
894  << "Error reading survey info from DB. Mismatched id!";
895  }
896 
897  const CLHEP::Hep3Vector& pos = theSurveyValues->m_align[theSurveyIndex].translation();
898  const CLHEP::HepRotation& rot = theSurveyValues->m_align[theSurveyIndex].rotation();
899 
900  AlignableSurface surf( align::PositionType( pos.x(), pos.y(), pos.z() ),
901  align::RotationType( rot.xx(), rot.xy(), rot.xz(),
902  rot.yx(), rot.yy(), rot.yz(),
903  rot.zx(), rot.zy(), rot.zz() ) );
904 
905  surf.setWidth( ali->surface().width() );
906  surf.setLength( ali->surface().length() );
907 
908  ali->setSurvey( new SurveyDet( surf, error.matrix() ) );
909 
910  ++theSurveyIndex;
911 
912 }
913 
915 
916  bool pass = false;
917  int nEntries = _detIdFlagVector.size();
918 
919  for (int i = 0; i < nEntries; i++){
920  if (_detIdFlagVector[i] == id) pass = true;
921  }
922 
923  return pass;
924 
925 }
926 
927 void TrackerGeometryCompare::fillIdentifiers( int subdetlevel, int rawid ){
928 
929 
930  switch( subdetlevel ){
931 
932  case 1:
933  {
934  PXBDetId pxbid( rawid );
935  _identifiers[0] = pxbid.module();
936  _identifiers[1] = pxbid.ladder();
937  _identifiers[2] = pxbid.layer();
938  _identifiers[3] = 999;
939  _identifiers[4] = 999;
940  _identifiers[5] = 999;
941  break;
942  }
943  case 2:
944  {
945  PXFDetId pxfid( rawid );
946  _identifiers[0] = pxfid.module();
947  _identifiers[1] = pxfid.panel();
948  _identifiers[2] = pxfid.blade();
949  _identifiers[3] = pxfid.disk();
950  _identifiers[4] = pxfid.side();
951  _identifiers[5] = 999;
952  break;
953  }
954  case 3:
955  {
956  TIBDetId tibid( rawid );
957  _identifiers[0] = tibid.module();
958  _identifiers[1] = tibid.string()[0];
959  _identifiers[2] = tibid.string()[1];
960  _identifiers[3] = tibid.string()[2];
961  _identifiers[4] = tibid.layer();
962  _identifiers[5] = 999;
963  break;
964  }
965  case 4:
966  {
967  TIDDetId tidid( rawid );
968  _identifiers[0] = tidid.module()[0];
969  _identifiers[1] = tidid.module()[1];
970  _identifiers[2] = tidid.ring();
971  _identifiers[3] = tidid.wheel();
972  _identifiers[4] = tidid.side();
973  _identifiers[5] = 999;
974  break;
975  }
976  case 5:
977  {
978  TOBDetId tobid( rawid );
979  _identifiers[0] = tobid.module();
980  _identifiers[1] = tobid.rod()[0];
981  _identifiers[2] = tobid.rod()[1];
982  _identifiers[3] = tobid.layer();
983  _identifiers[4] = 999;
984  _identifiers[5] = 999;
985  break;
986  }
987  case 6:
988  {
989  TECDetId tecid( rawid );
990  _identifiers[0] = tecid.module();
991  _identifiers[1] = tecid.ring();
992  _identifiers[2] = tecid.petal()[0];
993  _identifiers[3] = tecid.petal()[1];
994  _identifiers[4] = tecid.wheel();
995  _identifiers[5] = tecid.side();
996  break;
997  }
998  default:
999  {
1000  std::cout << "Error: bad subdetid!!" << std::endl;
1001  break;
1002  }
1003 
1004  }
1005 }
1006 
1007 
T xx() const
align::Scalar width() const
void compareGeometries(Alignable *refAli, Alignable *curAli)
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
int i
Definition: DBlmapReader.cc:9
Alignables & pixelHalfBarrelGeomDets()
Return pixel barrel GeomDets.
unsigned int panel() const
panel id
Definition: PXFDetId.h:52
align::GlobalVector _TrackerCommonR
T perp() const
Definition: PV3DBase.h:71
unsigned int layer() const
layer id
Definition: TOBDetId.h:39
Vector3DBase< Scalar, GlobalTag > GlobalVector
Definition: Definitions.h:33
Class to update a given geometry with a set of alignments.
std::vector< align::StructureType > m_theLevels
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
ErrorMatrix matrix() const
Definition: SurveyError.h:72
const Alignments * theSurveyValues
void addSurveyInfo(Alignable *ali)
std::vector< AlignTransformError > m_alignError
Geom::Phi< T > phi() const
Definition: PV3DBase.h:68
align::GlobalVector _TrackerCommonT
T y() const
Definition: PV3DBase.h:62
T yx() const
AlgebraicVector diffAlignables(Alignable *refAli, Alignable *curAli, const std::string &weightBy, bool weightById, const std::vector< unsigned int > &weightByIdVector)
Definition: AlignTools.cc:10
void diffCommonTrackerSystem(Alignable *refAli, Alignable *curAli)
std::vector< TrackerMap > m_vtkmap
unsigned int ladder() const
ladder id
Definition: PXBDetId.h:39
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
void setWidth(align::Scalar width)
uint8_t structureType() const
Definition: SurveyError.h:62
virtual Alignables components() const =0
Return vector of all direct components.
std::vector< AlignTransform > m_align
Definition: Alignments.h:14
std::vector< unsigned int > string() const
string id
Definition: TIBDetId.h:53
unsigned int module() const
det id
Definition: TECDetId.h:75
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
unsigned int layer() const
layer id
Definition: PXBDetId.h:35
unsigned int side() const
positive or negative id
Definition: TECDetId.h:47
std::vector< unsigned int > rod() const
rod id
Definition: TOBDetId.h:49
unsigned int blade() const
blade id
Definition: PXFDetId.h:48
const align::RotationType & rotation() const
Definition: SurveyDet.h:68
uint32_t rawId() const
get the raw id
Definition: DetId.h:45
void setLength(align::Scalar length)
T zx() const
T xy() const
const align::PositionType & position() const
Definition: SurveyDet.h:63
std::map< std::string, TH1D * > m_h1
std::vector< unsigned int > petal() const
petal id
Definition: TECDetId.h:61
T zz() const
T mag() const
Definition: PV3DBase.h:66
virtual void beginJob()
Read from DB and print survey info.
Alignables & innerBarrelGeomDets()
Return inner barrel GeomDets.
bool check(const DataFrame &df, bool capcheck, bool dvercheck)
T z() const
Definition: PV3DBase.h:63
void fillTree(Alignable *refAli, AlgebraicVector diff)
Alignables & TIDGeomDets()
Return TID GeomDets.
std::vector< uint32_t > _detIdFlagVector
void get(HolderT &iHolder) const
unsigned int ring() const
ring id
Definition: TIDDetId.h:55
bool isAvailable() const
Definition: Service.h:47
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
AlignmentErrors * alignmentErrors() const
Return alignment errors, sorted by DetId.
unsigned int module() const
det id
Definition: PXBDetId.h:43
T zy() const
int j
Definition: DBlmapReader.cc:9
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrors *alignmentErrors, const AlignTransform &globalCoordinates)
Allows conversion between type and name, and vice-versa.
align::ID rawId() const
Definition: SurveyError.h:67
unsigned int module() const
det id
Definition: PXFDetId.h:56
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
std::vector< unsigned int > module() const
det id
Definition: TIDDetId.h:64
TrackerGeometryCompare(const edm::ParameterSet &)
Do nothing. Required by framework.
virtual void analyze(const edm::Event &, const edm::EventSetup &)
EulerAngles toAngles(const RotationType &)
Convert rotation matrix to angles about x-, y-, z-axes (frame rotation).
Definition: Utilities.cc:7
align::StructureType _commonTrackerLevel
T yy() const
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
unsigned int disk() const
disk id
Definition: PXFDetId.h:43
Alignables & endcapGeomDets()
Return endcap GeomDets.
align::PositionType _TrackerCommonCM
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
Alignables & pixelEndcapGeomDets()
Return pixel endcap GeomDets.
int k[5][pyjets_maxn]
Definition: DetId.h:20
CLHEP::HepVector AlgebraicVector
AlgebraicVector EulerAngles
Definition: Definitions.h:36
align::Scalar length() const
Alignables & outerBarrelGeomDets()
Return outer barrel GeomDets.
AlignableTracker * currentTracker
const Alignables & deepComponents() const
Definition: Alignable.h:71
unsigned int module() const
detector id
Definition: TIBDetId.h:61
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
unsigned int side() const
positive or negative id
Definition: TIDDetId.h:45
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:268
const T & get() const
Definition: EventSetup.h:55
TrackerGeometry * build(const GeometricDet *gd)
unsigned int wheel() const
wheel id
Definition: TECDetId.h:52
align::StructureType nameToType(const std::string &name) const
Convert name to type.
unsigned int layer() const
layer id
Definition: TIBDetId.h:41
T eta() const
Definition: PV3DBase.h:75
AlignableTracker * referenceTracker
void fillIdentifiers(int subdetlevel, int rawid)
void createROOTGeometry(const edm::EventSetup &iSetup)
T xz() const
unsigned int ring() const
ring id
Definition: TECDetId.h:71
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:40
T * make() const
make new ROOT object
unsigned int side() const
positive or negative id
Definition: PXFDetId.h:38
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
const SurveyErrors * theSurveyErrors
tuple cout
Definition: gather_cfg.py:121
unsigned int module() const
detector id
Definition: TOBDetId.h:58
std::vector< unsigned int > _weightByIdVector
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
Alignments * alignments() const
Return alignments, sorted by DetId.
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:21
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
T x() const
Definition: PV3DBase.h:61
void moveAlignable(Alignable *ali, AlgebraicVector diff)
Moves the alignable by the AlgebraicVector.
Definition: AlignTools.cc:81
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:85
SurfaceDeformation * create(int type, const std::vector< double > &params)
T yz() const
const DetId & geomDetId() const
Definition: Alignable.h:177
void surveyToTracker(AlignableTracker *ali, Alignments *alignVals, AlignmentErrors *alignErrors)
void compareSurfaceDeformations(TTree *_inputTree11, TTree *_inputTree12)
unsigned int wheel() const
wheel id
Definition: TIDDetId.h:50