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