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