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