CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Member Functions | Private Attributes
TrackerGeometryCompare Class Reference

#include <TrackerGeometryCompare.h>

Inheritance diagram for TrackerGeometryCompare:
edm::EDAnalyzer edm::EDConsumerBase

Public Types

typedef std::vector< Alignable * > Alignables
 
typedef AlignTransform SurveyValue
 
typedef Alignments SurveyValues
 
- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginJob ()
 Read from DB and print survey info. More...
 
virtual void endJob ()
 
 TrackerGeometryCompare (const edm::ParameterSet &)
 Do nothing. Required by framework. More...
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

void addSurveyInfo (Alignable *ali)
 
void compareGeometries (Alignable *refAli, Alignable *curAli, const TrackerTopology *tTopo)
 
void compareSurfaceDeformations (TTree *_inputTree11, TTree *_inputTree12)
 
void createROOTGeometry (const edm::EventSetup &iSetup)
 
void diffCommonTrackerSystem (Alignable *refAli, Alignable *curAli)
 
void fillIdentifiers (int subdetlevel, int rawid, const TrackerTopology *tTopo)
 
void fillTree (Alignable *refAli, const AlgebraicVector &diff, const TrackerTopology *tTopo)
 
bool passIdCut (uint32_t)
 
void setCommonTrackerSystem ()
 
void surveyToTracker (AlignableTracker *ali, Alignments *alignVals, AlignmentErrorsExtended *alignErrors)
 

Private Attributes

TTree * _alignTree
 
float _alphaVal
 
float _betaVal
 
align::StructureType _commonTrackerLevel
 
float _dalphaVal
 
float _daVal
 
float _dbetaVal
 
float _dbVal
 
int _detDim
 
bool _detIdFlag
 
std::string _detIdFlagFile
 
std::vector< uint32_t > _detIdFlagVector
 
float _dgammaVal
 
float _dgVal
 
float _dphiVal
 
float _drVal
 
float _duVal
 
float _dvVal
 
float _dwVal
 
float _dxVal
 
float _dyVal
 
float _dzVal
 
float _etaVal
 
std::string _filename
 
float _gammaVal
 
int _id
 
uint32_t _identifiers [6]
 
std::string _inputFilename1
 
std::string _inputFilename2
 
TFile * _inputRootFile1
 
TFile * _inputRootFile2
 
TTree * _inputTree01
 
TTree * _inputTree02
 
TTree * _inputTree11
 
TTree * _inputTree12
 
std::string _inputTreenameAlign
 
std::string _inputTreenameDeform
 
int _level
 
int _mid
 
int _mlevel
 
float _phiVal
 
float _rVal
 
std::string _setCommonTrackerSystem
 
int _sublevel
 
double _surfDeform [13]
 
float _surLength
 
double _surRot [9]
 
float _surWidth
 
TFile * _theFile
 
align::PositionType _TrackerCommonCM
 
align::GlobalVector _TrackerCommonR
 
align::GlobalVector _TrackerCommonT
 
int _type
 
int _useDetId
 
std::string _weightBy
 
bool _weightById
 
std::string _weightByIdFile
 
std::vector< unsigned int > _weightByIdVector
 
bool _writeToDB
 
float _xVal
 
float _yVal
 
float _zVal
 
AlignableTrackercurrentTracker
 
AlignableTrackerdummyTracker
 
bool firstEvent_
 
std::map< std::string, TH1D * > m_h1
 
int m_nBins
 
double m_rangeHigh
 
double m_rangeLow
 
std::vector< align::StructureTypem_theLevels
 
std::vector< TrackerMapm_vtkmap
 
AlignableTrackerreferenceTracker
 
const SurveyErrorstheSurveyErrors
 
unsigned int theSurveyIndex
 
const AlignmentstheSurveyValues
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Module that reads survey info from DB and prints them out.

Usage: module comparator = TrackerGeometryCompare {

lots of stuff

} path p = { comparator }

Date:
2012/12/02 22:13:12
Revision:
1.14
Author
Nhan Tran

******** Including surface deformations in the geometry comparison ********


Definition at line 50 of file TrackerGeometryCompare.h.

Member Typedef Documentation

Definition at line 54 of file TrackerGeometryCompare.h.

Definition at line 52 of file TrackerGeometryCompare.h.

Definition at line 53 of file TrackerGeometryCompare.h.

Constructor & Destructor Documentation

TrackerGeometryCompare::TrackerGeometryCompare ( const edm::ParameterSet cfg)

Do nothing. Required by framework.

Definition at line 56 of file TrackerGeometryCompare.cc.

References _alignTree, _alphaVal, _betaVal, _dalphaVal, _daVal, _dbetaVal, _dbVal, _detDim, _detIdFlag, _detIdFlagFile, _detIdFlagVector, _dgammaVal, _dgVal, _dphiVal, _drVal, _duVal, _dvVal, _dwVal, _dxVal, _dyVal, _dzVal, _etaVal, _filename, _gammaVal, _id, _identifiers, _inputFilename1, _inputFilename2, _inputTreenameAlign, _inputTreenameDeform, _level, _mid, _mlevel, _phiVal, _rVal, _setCommonTrackerSystem, _sublevel, _surfDeform, _surLength, _surRot, _surWidth, _theFile, _type, _useDetId, _weightBy, _weightById, _weightByIdFile, _weightByIdVector, _writeToDB, _xVal, _yVal, _zVal, groupFilesInBlocks::fin, edm::ParameterSet::getUntrackedParameter(), cuy::ii, prof2calltree::l, m_h1, m_nBins, m_rangeHigh, m_rangeLow, m_theLevels, m_vtkmap, TFileDirectory::make(), TFileService::mkdir(), AlCaHLTBitMon_QueryRunRegistry::string, and AlignableObjectId::stringToId().

56  :
58  dummyTracker(0),
59  currentTracker(0),
60  theSurveyIndex(0),
61  theSurveyValues(0),
62  theSurveyErrors(0),
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 }
T getUntrackedParameter(std::string const &, T const &) const
std::vector< align::StructureType > m_theLevels
const Alignments * theSurveyValues
std::vector< TrackerMap > m_vtkmap
int ii
Definition: cuy.py:588
AlignableTracker * dummyTracker
static align::StructureType stringToId(const char *)
std::map< std::string, TH1D * > m_h1
std::vector< uint32_t > _detIdFlagVector
T * make(const Args &...args) const
make new ROOT object
align::StructureType _commonTrackerLevel
AlignableTracker * currentTracker
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
Definition: TFileService.h:69
AlignableTracker * referenceTracker
const SurveyErrors * theSurveyErrors
std::vector< unsigned int > _weightByIdVector

Member Function Documentation

void TrackerGeometryCompare::addSurveyInfo ( Alignable ali)
private

Definition at line 893 of file TrackerGeometryCompare.cc.

References Alignable::alignableObjectId(), AlCaHLTBitMon_QueryRunRegistry::comp, Alignable::components(), relativeConstraints::error, Exception, Alignable::geomDetId(), i, AlignableSurface::length(), Alignments::m_align, SurveyErrors::m_surveyErrors, SurveyError::matrix(), SurveyError::rawId(), DetId::rawId(), makeMuonMisalignmentScenario::rot, AlignableSurface::setLength(), Alignable::setSurvey(), AlignableSurface::setWidth(), SurveyError::structureType(), Alignable::surface(), theSurveyErrors, theSurveyIndex, theSurveyValues, and AlignableSurface::width().

893  {
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 }
align::Scalar width() const
int i
Definition: DBlmapReader.cc:9
ErrorMatrix matrix() const
Definition: SurveyError.h:76
const Alignments * theSurveyValues
void addSurveyInfo(Alignable *ali)
uint8_t structureType() const
Definition: SurveyError.h:66
virtual Alignables components() const =0
Return vector of all direct components.
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
align::ID rawId() const
Definition: SurveyError.h:71
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
align::Scalar length() const
void setSurvey(const SurveyDet *)
Set survey info.
Definition: Alignable.cc:277
const SurveyErrors * theSurveyErrors
std::vector< SurveyError > m_surveyErrors
Definition: SurveyErrors.h:23
const DetId & geomDetId() const
Definition: Alignable.h:177
void TrackerGeometryCompare::analyze ( const edm::Event ,
const edm::EventSetup iSetup 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 228 of file TrackerGeometryCompare.cc.

References _inputTree11, _inputTree12, _setCommonTrackerSystem, _writeToDB, AlignableTracker::alignmentErrors(), AlignableTracker::alignments(), cond::service::PoolDBOutputService::beginOfTime(), compareGeometries(), compareSurfaceDeformations(), createROOTGeometry(), currentTracker, firstEvent_, edm::EventSetup::get(), edm::Service< T >::isAvailable(), edm::ESHandle< class >::product(), referenceTracker, setCommonTrackerSystem(), and cond::service::PoolDBOutputService::writeOne().

228  {
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 }
void compareGeometries(Alignable *refAli, Alignable *curAli, const TrackerTopology *tTopo)
AlignmentErrorsExtended * alignmentErrors() const
Return alignment errors, sorted by DetId.
bool isAvailable() const
Definition: Service.h:46
void writeOne(T *payload, Time_t time, const std::string &recordName, bool withlogging=false)
AlignableTracker * currentTracker
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
AlignableTracker * referenceTracker
void createROOTGeometry(const edm::EventSetup &iSetup)
Alignments * alignments() const
Return alignments, sorted by DetId.
void compareSurfaceDeformations(TTree *_inputTree11, TTree *_inputTree12)
void TrackerGeometryCompare::beginJob ( void  )
virtual

Read from DB and print survey info.

Reimplemented from edm::EDAnalyzer.

Definition at line 204 of file TrackerGeometryCompare.cc.

References firstEvent_.

204  {
205  firstEvent_ = true;
206 }
void TrackerGeometryCompare::compareGeometries ( Alignable refAli,
Alignable curAli,
const TrackerTopology tTopo 
)
private

Definition at line 589 of file TrackerGeometryCompare.cc.

References _weightBy, _weightById, _weightByIdVector, Alignable::alignableObjectId(), DDVectorGetter::check(), Alignable::components(), cond::rpcobgas::detid, diffTreeTool::diff, align::diffAlignables(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, alignCSCRings::e, Exception, fillTree(), Alignable::geomDetId(), i, Alignable::id(), m_theLevels, PV3DBase< T, PVType, FrameType >::mag(), align::moveAlignable(), DetId::rawId(), and makeMuonMisalignmentScenario::rot.

Referenced by analyze().

589  {
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 }
align::ID id() const
Return the ID of Alignable, i.e. DetId of &#39;first&#39; component GeomDet(Unit).
Definition: Alignable.h:180
int i
Definition: DBlmapReader.cc:9
void compareGeometries(Alignable *refAli, Alignable *curAli, const TrackerTopology *tTopo)
std::vector< align::StructureType > m_theLevels
AlgebraicVector diffAlignables(Alignable *refAli, Alignable *curAli, const std::string &weightBy, bool weightById, const std::vector< unsigned int > &weightByIdVector)
Definition: AlignTools.cc:10
virtual Alignables components() const =0
Return vector of all direct components.
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
bool check(const std::string &)
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
void fillTree(Alignable *refAli, const AlgebraicVector &diff, const TrackerTopology *tTopo)
Definition: DetId.h:18
CLHEP::HepVector AlgebraicVector
std::vector< unsigned int > _weightByIdVector
void moveAlignable(Alignable *ali, AlgebraicVector diff)
Moves the alignable by the AlgebraicVector.
Definition: AlignTools.cc:81
const DetId & geomDetId() const
Definition: Alignable.h:177
void TrackerGeometryCompare::compareSurfaceDeformations ( TTree *  _inputTree11,
TTree *  _inputTree12 
)
private

Definition at line 446 of file TrackerGeometryCompare.cc.

References _inputFilename1, _inputFilename2, _inputRootFile1, _inputRootFile2, _inputTreenameDeform, _surfDeform, Abs(), cuy::ii, m_h1, m_nBins, m_rangeHigh, m_rangeLow, m_vtkmap, and mathSSE::return().

Referenced by analyze().

446  {
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 }
std::vector< TrackerMap > m_vtkmap
int ii
Definition: cuy.py:588
return((rh^lh)&mask)
std::map< std::string, TH1D * > m_h1
T Abs(T a)
Definition: MathUtil.h:49
void TrackerGeometryCompare::createROOTGeometry ( const edm::EventSetup iSetup)
private

Definition at line 272 of file TrackerGeometryCompare.cc.

References _inputFilename1, _inputFilename2, _inputRootFile1, _inputRootFile2, _inputTree01, _inputTree02, _inputTree11, _inputTree12, _inputTreenameAlign, _inputTreenameDeform, GeometryAligner::applyAlignments(), TrackerGeomBuilderFromGeometricDet::build(), SurfaceDeformationFactory::create(), currentTracker, Alignable::deepComponents(), align::DetectorGlobalPosition(), edm::EventSetup::get(), edm::eventsetup::EventSetupRecord::get(), i, Alignments::m_align, AlignmentErrorsExtended::m_alignError, edm::ESHandle< class >::product(), referenceTracker, python.multivaluedict::sort(), and DetId::Tracker.

Referenced by analyze().

272  {
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 }
int i
Definition: DBlmapReader.cc:9
Class to update a given geometry with a set of alignments.
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
void get(HolderT &iHolder) const
Definition: DetId.h:18
void applyAlignments(C *geometry, const Alignments *alignments, const AlignmentErrorsExtended *alignmentErrors, const AlignTransform &globalCoordinates)
AlignableTracker * currentTracker
const Alignables & deepComponents() const
Definition: Alignable.h:71
std::vector< AlignTransformErrorExtended > m_alignError
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
TrackerGeometry * build(const GeometricDet *gd, const PTrackerParameters &ptp)
AlignableTracker * referenceTracker
const AlignTransform & DetectorGlobalPosition(const Alignments &allGlobals, const DetId &id)
SurfaceDeformation * create(int type, const std::vector< double > &params)
void TrackerGeometryCompare::diffCommonTrackerSystem ( Alignable refAli,
Alignable curAli 
)
private

Definition at line 700 of file TrackerGeometryCompare.cc.

References _commonTrackerLevel, _TrackerCommonCM, _TrackerCommonR, _TrackerCommonT, _weightBy, _weightById, _weightByIdVector, Alignable::alignableObjectId(), Alignable::components(), diffTreeTool::diff, align::diffAlignables(), PFRecoTauDiscriminationAgainstElectronDeadECAL_cfi::dR, Alignable::globalPosition(), i, and makeMuonMisalignmentScenario::rot.

Referenced by setCommonTrackerSystem().

700  {
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 }
int i
Definition: DBlmapReader.cc:9
align::GlobalVector _TrackerCommonR
Vector3DBase< Scalar, GlobalTag > GlobalVector
Definition: Definitions.h:33
align::GlobalVector _TrackerCommonT
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)
virtual Alignables components() const =0
Return vector of all direct components.
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
align::StructureType _commonTrackerLevel
align::PositionType _TrackerCommonCM
CLHEP::HepVector AlgebraicVector
std::vector< unsigned int > _weightByIdVector
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
void TrackerGeometryCompare::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 208 of file TrackerGeometryCompare.cc.

References _alignTree, _theFile, m_vtkmap, and AlCaHLTBitMon_QueryRunRegistry::string.

208  {
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 }
std::vector< TrackerMap > m_vtkmap
void TrackerGeometryCompare::fillIdentifiers ( int  subdetlevel,
int  rawid,
const TrackerTopology tTopo 
)
private

Definition at line 940 of file TrackerGeometryCompare.cc.

References _identifiers, gather_cfg::cout, TrackerTopology::pxbLadder(), TrackerTopology::pxbLayer(), TrackerTopology::pxbModule(), TrackerTopology::pxfBlade(), TrackerTopology::pxfDisk(), TrackerTopology::pxfModule(), TrackerTopology::pxfPanel(), TrackerTopology::pxfSide(), TrackerTopology::tecModule(), TrackerTopology::tecPetalInfo(), TrackerTopology::tecRing(), TrackerTopology::tecSide(), TrackerTopology::tecWheel(), TrackerTopology::tibLayer(), TrackerTopology::tibModule(), TrackerTopology::tibStringInfo(), TrackerTopology::tidModuleInfo(), TrackerTopology::tidRing(), TrackerTopology::tidSide(), TrackerTopology::tidWheel(), TrackerTopology::tobLayer(), TrackerTopology::tobModule(), and TrackerTopology::tobRodInfo().

Referenced by fillTree().

940  {
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 }
unsigned int tibLayer(const DetId &id) const
unsigned int tidRing(const DetId &id) const
std::vector< unsigned int > tidModuleInfo(const DetId &id) const
unsigned int pxfDisk(const DetId &id) const
unsigned int tecRing(const DetId &id) const
ring id
unsigned int pxbLadder(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
std::vector< unsigned int > tibStringInfo(const DetId &id) const
std::vector< unsigned int > tecPetalInfo(const DetId &id) const
unsigned int tidSide(const DetId &id) const
std::vector< unsigned int > tobRodInfo(const DetId &id) const
unsigned int tibModule(const DetId &id) const
unsigned int pxfModule(const DetId &id) const
unsigned int pxbLayer(const DetId &id) const
unsigned int tecModule(const DetId &id) const
unsigned int tobModule(const DetId &id) const
unsigned int pxfSide(const DetId &id) const
tuple cout
Definition: gather_cfg.py:121
unsigned int tecWheel(const DetId &id) const
unsigned int pxfPanel(const DetId &id) const
unsigned int pxfBlade(const DetId &id) const
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const
void TrackerGeometryCompare::fillTree ( Alignable refAli,
const AlgebraicVector diff,
const TrackerTopology tTopo 
)
private

Definition at line 759 of file TrackerGeometryCompare.cc.

References _alignTree, _alphaVal, _betaVal, _dalphaVal, _daVal, _dbetaVal, _dbVal, _detDim, _detIdFlag, _dgammaVal, _dgVal, _dphiVal, _drVal, _duVal, _dvVal, _dwVal, _dxVal, _dyVal, _dzVal, _etaVal, _gammaVal, _id, _level, _mid, _mlevel, _phiVal, _rVal, _sublevel, _surLength, _surRot, _surWidth, _useDetId, _xVal, _yVal, _zVal, align::AlignableDet, align::AlignableDetUnit, Alignable::alignableObjectId(), cond::rpcobgas::detid, PV3DBase< T, PVType, FrameType >::eta(), fillIdentifiers(), g, Alignable::geomDetId(), Alignable::globalPosition(), Alignable::globalRotation(), Alignable::id(), AlignableSurface::length(), Alignable::mother(), passIdCut(), PV3DBase< T, PVType, FrameType >::perp(), PV3DBase< T, PVType, FrameType >::phi(), DetId::rawId(), makeMuonMisalignmentScenario::rot, DetId::subdetId(), Alignable::surface(), align::toAngles(), AlignableSurface::width(), PV3DBase< T, PVType, FrameType >::x(), TkRotation< T >::xx(), TkRotation< T >::xy(), TkRotation< T >::xz(), PV3DBase< T, PVType, FrameType >::y(), TkRotation< T >::yx(), TkRotation< T >::yy(), TkRotation< T >::yz(), PV3DBase< T, PVType, FrameType >::z(), TkRotation< T >::zx(), TkRotation< T >::zy(), and TkRotation< T >::zz().

Referenced by compareGeometries(), and core.AutoFillTreeProducer.AutoFillTreeProducer::process().

759  {
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 }
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 y() const
Definition: PV3DBase.h:63
T yx() const
const RotationType & globalRotation() const
Return the global orientation of the object.
Definition: Alignable.h:132
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
uint32_t rawId() const
get the raw id
Definition: DetId.h:43
T zx() const
T xy() const
T zz() const
T z() const
Definition: PV3DBase.h:64
virtual StructureType alignableObjectId() const =0
Return the alignable type identifier.
T zy() const
EulerAngles toAngles(const RotationType &)
Convert rotation matrix to angles about x-, y-, z-axes (frame rotation).
Definition: Utilities.cc:7
T yy() const
const AlignableSurface & surface() const
Return the Surface (global position and orientation) of the object.
Definition: Alignable.h:126
Definition: DetId.h:18
AlgebraicVector EulerAngles
Definition: Definitions.h:36
align::Scalar length() const
void fillIdentifiers(int subdetlevel, int rawid, const TrackerTopology *tTopo)
T xz() const
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
T x() const
Definition: PV3DBase.h:62
Alignable * mother() const
Return pointer to container alignable (if any)
Definition: Alignable.h:85
T yz() const
const DetId & geomDetId() const
Definition: Alignable.h:177
bool TrackerGeometryCompare::passIdCut ( uint32_t  id)
private

Definition at line 927 of file TrackerGeometryCompare.cc.

References _detIdFlagVector, and i.

Referenced by fillTree().

927  {
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 }
int i
Definition: DBlmapReader.cc:9
std::vector< uint32_t > _detIdFlagVector
void TrackerGeometryCompare::setCommonTrackerSystem ( )
private

Definition at line 662 of file TrackerGeometryCompare.cc.

References _commonTrackerLevel, _setCommonTrackerSystem, _TrackerCommonCM, _TrackerCommonR, _TrackerCommonT, gather_cfg::cout, currentTracker, diffCommonTrackerSystem(), Alignable::globalPosition(), align::moveAlignable(), TkRotation< T >::multiplyInverse(), referenceTracker, makeMuonMisalignmentScenario::rot, AlignableObjectId::stringToId(), align::toMatrix(), PV3DBase< T, PVType, FrameType >::x(), PV3DBase< T, PVType, FrameType >::y(), and PV3DBase< T, PVType, FrameType >::z().

Referenced by analyze().

662  {
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 }
align::GlobalVector _TrackerCommonR
align::GlobalVector _TrackerCommonT
T y() const
Definition: PV3DBase.h:63
void diffCommonTrackerSystem(Alignable *refAli, Alignable *curAli)
static align::StructureType stringToId(const char *)
T z() const
Definition: PV3DBase.h:64
align::StructureType _commonTrackerLevel
align::PositionType _TrackerCommonCM
CLHEP::HepVector AlgebraicVector
AlgebraicVector EulerAngles
Definition: Definitions.h:36
AlignableTracker * currentTracker
AlignableTracker * referenceTracker
RotationType toMatrix(const EulerAngles &)
Convert rotation angles about x-, y-, z-axes to matrix.
Definition: Utilities.cc:40
tuple cout
Definition: gather_cfg.py:121
const PositionType & globalPosition() const
Return the global position of the object.
Definition: Alignable.h:129
Basic3DVector< T > multiplyInverse(const Basic3DVector< T > &v) const
T x() const
Definition: PV3DBase.h:62
void moveAlignable(Alignable *ali, AlgebraicVector diff)
Moves the alignable by the AlgebraicVector.
Definition: AlignTools.cc:81
void TrackerGeometryCompare::surveyToTracker ( AlignableTracker ali,
Alignments alignVals,
AlignmentErrorsExtended alignErrors 
)
private

Definition at line 841 of file TrackerGeometryCompare.cc.

References AlCaHLTBitMon_QueryRunRegistry::comp, filterCSVwithJSON::copy, AlignableTracker::endcapGeomDets(), i, AlignableTracker::innerBarrelGeomDets(), j, relval_steps::k, Alignments::m_align, AlignmentErrorsExtended::m_alignError, AlignableTracker::outerBarrelGeomDets(), AlignableTracker::pixelEndcapGeomDets(), AlignableTracker::pixelHalfBarrelGeomDets(), SurveyDet::position(), makeMuonMisalignmentScenario::rot, SurveyDet::rotation(), python.multivaluedict::sort(), AlignableTracker::TIDGeomDets(), and create_public_lumi_plots::transform.

841  {
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 }
int i
Definition: DBlmapReader.cc:9
Alignables & pixelHalfBarrelGeomDets()
Return pixel barrel GeomDets.
std::vector< AlignTransform > m_align
Definition: Alignments.h:19
const align::RotationType & rotation() const
Definition: SurveyDet.h:68
const align::PositionType & position() const
Definition: SurveyDet.h:63
Alignables & innerBarrelGeomDets()
Return inner barrel GeomDets.
Alignables & TIDGeomDets()
Return TID GeomDets.
int j
Definition: DBlmapReader.cc:9
Alignables & endcapGeomDets()
Return endcap GeomDets.
Alignables & pixelEndcapGeomDets()
Return pixel endcap GeomDets.
Alignables & outerBarrelGeomDets()
Return outer barrel GeomDets.
std::vector< AlignTransformErrorExtended > m_alignError

Member Data Documentation

TTree* TrackerGeometryCompare::_alignTree
private

Definition at line 130 of file TrackerGeometryCompare.h.

Referenced by endJob(), fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_alphaVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_betaVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

align::StructureType TrackerGeometryCompare::_commonTrackerLevel
private

Definition at line 122 of file TrackerGeometryCompare.h.

Referenced by diffCommonTrackerSystem(), and setCommonTrackerSystem().

float TrackerGeometryCompare::_dalphaVal
private

Definition at line 142 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_daVal
private

Definition at line 144 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dbetaVal
private

Definition at line 142 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dbVal
private

Definition at line 144 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

int TrackerGeometryCompare::_detDim
private

Definition at line 139 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

bool TrackerGeometryCompare::_detIdFlag
private

Definition at line 115 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

std::string TrackerGeometryCompare::_detIdFlagFile
private

Definition at line 116 of file TrackerGeometryCompare.h.

Referenced by TrackerGeometryCompare().

std::vector< uint32_t > TrackerGeometryCompare::_detIdFlagVector
private

Definition at line 121 of file TrackerGeometryCompare.h.

Referenced by passIdCut(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dgammaVal
private

Definition at line 142 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dgVal
private

Definition at line 144 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dphiVal
private

Definition at line 142 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_drVal
private

Definition at line 142 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_duVal
private

Definition at line 144 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dvVal
private

Definition at line 144 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dwVal
private

Definition at line 144 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dxVal
private

Definition at line 142 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dyVal
private

Definition at line 142 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_dzVal
private

Definition at line 142 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_etaVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

std::string TrackerGeometryCompare::_filename
private
float TrackerGeometryCompare::_gammaVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

int TrackerGeometryCompare::_id
private

\ Tree variables

Definition at line 139 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

uint32_t TrackerGeometryCompare::_identifiers[6]
private

Definition at line 146 of file TrackerGeometryCompare.h.

Referenced by fillIdentifiers(), and TrackerGeometryCompare().

std::string TrackerGeometryCompare::_inputFilename1
private
std::string TrackerGeometryCompare::_inputFilename2
private
TFile* TrackerGeometryCompare::_inputRootFile1
private

Definition at line 131 of file TrackerGeometryCompare.h.

Referenced by compareSurfaceDeformations(), and createROOTGeometry().

TFile* TrackerGeometryCompare::_inputRootFile2
private

Definition at line 132 of file TrackerGeometryCompare.h.

Referenced by compareSurfaceDeformations(), and createROOTGeometry().

TTree* TrackerGeometryCompare::_inputTree01
private

Definition at line 133 of file TrackerGeometryCompare.h.

Referenced by createROOTGeometry().

TTree* TrackerGeometryCompare::_inputTree02
private

Definition at line 134 of file TrackerGeometryCompare.h.

Referenced by createROOTGeometry().

TTree* TrackerGeometryCompare::_inputTree11
private

Definition at line 135 of file TrackerGeometryCompare.h.

Referenced by analyze(), and createROOTGeometry().

TTree* TrackerGeometryCompare::_inputTree12
private

Definition at line 136 of file TrackerGeometryCompare.h.

Referenced by analyze(), and createROOTGeometry().

std::string TrackerGeometryCompare::_inputTreenameAlign
private

Definition at line 110 of file TrackerGeometryCompare.h.

Referenced by createROOTGeometry(), and TrackerGeometryCompare().

std::string TrackerGeometryCompare::_inputTreenameDeform
private
int TrackerGeometryCompare::_level
private
int TrackerGeometryCompare::_mid
private

Definition at line 139 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

int TrackerGeometryCompare::_mlevel
private

Definition at line 139 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_phiVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_rVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

std::string TrackerGeometryCompare::_setCommonTrackerSystem
private
int TrackerGeometryCompare::_sublevel
private

Definition at line 139 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

double TrackerGeometryCompare::_surfDeform[13]
private

Definition at line 149 of file TrackerGeometryCompare.h.

Referenced by compareSurfaceDeformations(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_surLength
private

Definition at line 145 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

double TrackerGeometryCompare::_surRot[9]
private

Definition at line 147 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_surWidth
private

Definition at line 145 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

TFile* TrackerGeometryCompare::_theFile
private

Definition at line 129 of file TrackerGeometryCompare.h.

Referenced by endJob(), and TrackerGeometryCompare().

align::PositionType TrackerGeometryCompare::_TrackerCommonCM
private

Definition at line 125 of file TrackerGeometryCompare.h.

Referenced by diffCommonTrackerSystem(), and setCommonTrackerSystem().

align::GlobalVector TrackerGeometryCompare::_TrackerCommonR
private

Definition at line 124 of file TrackerGeometryCompare.h.

Referenced by diffCommonTrackerSystem(), and setCommonTrackerSystem().

align::GlobalVector TrackerGeometryCompare::_TrackerCommonT
private

Definition at line 123 of file TrackerGeometryCompare.h.

Referenced by diffCommonTrackerSystem(), and setCommonTrackerSystem().

int TrackerGeometryCompare::_type
private
int TrackerGeometryCompare::_useDetId
private

Definition at line 139 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

std::string TrackerGeometryCompare::_weightBy
private
bool TrackerGeometryCompare::_weightById
private
std::string TrackerGeometryCompare::_weightByIdFile
private

Definition at line 118 of file TrackerGeometryCompare.h.

Referenced by TrackerGeometryCompare().

std::vector< unsigned int > TrackerGeometryCompare::_weightByIdVector
private
bool TrackerGeometryCompare::_writeToDB
private

Definition at line 112 of file TrackerGeometryCompare.h.

Referenced by analyze(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_xVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_yVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

float TrackerGeometryCompare::_zVal
private

Definition at line 140 of file TrackerGeometryCompare.h.

Referenced by fillTree(), and TrackerGeometryCompare().

AlignableTracker* TrackerGeometryCompare::currentTracker
private

Definition at line 101 of file TrackerGeometryCompare.h.

Referenced by analyze(), createROOTGeometry(), and setCommonTrackerSystem().

AlignableTracker* TrackerGeometryCompare::dummyTracker
private

Definition at line 100 of file TrackerGeometryCompare.h.

bool TrackerGeometryCompare::firstEvent_
private

Definition at line 155 of file TrackerGeometryCompare.h.

Referenced by analyze(), and beginJob().

std::map<std::string,TH1D*> TrackerGeometryCompare::m_h1
private

Definition at line 159 of file TrackerGeometryCompare.h.

Referenced by compareSurfaceDeformations(), and TrackerGeometryCompare().

int TrackerGeometryCompare::m_nBins
private

Definition at line 151 of file TrackerGeometryCompare.h.

Referenced by compareSurfaceDeformations(), and TrackerGeometryCompare().

double TrackerGeometryCompare::m_rangeHigh
private

Definition at line 153 of file TrackerGeometryCompare.h.

Referenced by compareSurfaceDeformations(), and TrackerGeometryCompare().

double TrackerGeometryCompare::m_rangeLow
private

Definition at line 152 of file TrackerGeometryCompare.h.

Referenced by compareSurfaceDeformations(), and TrackerGeometryCompare().

std::vector<align::StructureType> TrackerGeometryCompare::m_theLevels
private

Definition at line 75 of file TrackerGeometryCompare.h.

Referenced by compareGeometries(), and TrackerGeometryCompare().

std::vector<TrackerMap> TrackerGeometryCompare::m_vtkmap
private
AlignableTracker* TrackerGeometryCompare::referenceTracker
private

Definition at line 99 of file TrackerGeometryCompare.h.

Referenced by analyze(), createROOTGeometry(), and setCommonTrackerSystem().

const SurveyErrors* TrackerGeometryCompare::theSurveyErrors
private

Definition at line 105 of file TrackerGeometryCompare.h.

Referenced by addSurveyInfo().

unsigned int TrackerGeometryCompare::theSurveyIndex
private

Definition at line 103 of file TrackerGeometryCompare.h.

Referenced by addSurveyInfo().

const Alignments* TrackerGeometryCompare::theSurveyValues
private

Definition at line 104 of file TrackerGeometryCompare.h.

Referenced by addSurveyInfo().