CMS 3D CMS Logo

SurveyInputTrackerFromDB Class Reference

Class to read ideal tracker from DB. More...

#include <Alignment/SurveyAnalysis/plugins/SurveyInputTrackerFromDB.h>

Inheritance diagram for SurveyInputTrackerFromDB:

SurveyInputBase edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void beginJob (const edm::EventSetup &)
 Read ideal tracker geometry from DB.
 SurveyInputTrackerFromDB (const edm::ParameterSet &)

Private Member Functions

void addSurveyInfo (Alignable *)
 Add survey info to an alignable.

Private Attributes

std::string textFileName
SurveyInputTextReader::MapType uIdMap


Detailed Description

Class to read ideal tracker from DB.

Date
2007/10/08 16:38:04
Revision
1.2
Author:
Chung Khim Lae

Definition at line 16 of file SurveyInputTrackerFromDB.h.


Constructor & Destructor Documentation

SurveyInputTrackerFromDB::SurveyInputTrackerFromDB ( const edm::ParameterSet cfg  ) 

Definition at line 11 of file SurveyInputTrackerFromDB.cc.

00011                                                                             :
00012   textFileName( cfg.getParameter<std::string>("textFileName") )
00013 {
00014 }


Member Function Documentation

void SurveyInputTrackerFromDB::addSurveyInfo ( Alignable ali  )  [private]

Add survey info to an alignable.

Definition at line 35 of file SurveyInputTrackerFromDB.cc.

References Alignable::alignableObjectId(), Alignable::components(), e, error, i, Alignable::id(), it, Basic3DVector< T >::mag(), Alignable::move(), python::trackProbabilityAnalysis_cff::parameters, Alignable::rotateInLocalFrame(), edm::second(), Alignable::setSurvey(), Alignable::surface(), AlignableSurface::toGlobal(), and uIdMap.

Referenced by beginJob().

00036 {
00037   const align::Alignables& comp = ali->components();
00038         //std::cout << "in addSurveyInfo" << std::endl;
00039   unsigned int nComp = comp.size();
00040         //std::cout << "alOjbId: " << ali->alignableObjectId();
00041         //std::cout << " , detId: " << ali->geomDetId().rawId() << std::endl;
00042         
00043   for (unsigned int i = 0; i < nComp; ++i) addSurveyInfo(comp[i]);
00044         
00045   align::ErrorMatrix error;
00046         
00047   //if (ali->alignableObjectId() != AlignableObjectId::AlignableDetUnit){
00048                 
00049   //    std::cout << "UniqueId: " << id.first << ", " << id.second << std::endl;
00050   SurveyInputTextReader::MapType::const_iterator it
00051     = uIdMap.find(std::make_pair(ali->id(), ali->alignableObjectId()));
00052   //    std::cout << "itID: " << it->first.first << ", " << it->first.second << std::endl;
00053   if (it != uIdMap.end()){
00054                 
00055     const align::Scalars& parameters = (it)->second;
00056                 
00057     //move the surface
00058     //displacement
00059     align::LocalVector lvector (parameters[0], parameters[1], parameters[2]);
00060     align::GlobalVector gvector = ali->surface().toGlobal(lvector);
00061     ali->move(gvector);
00062     //rotation
00063     Basic3DVector<align::Scalar> rot_aa(parameters[3], parameters[4], parameters[5]);
00064     align::RotationType rotation(rot_aa, rot_aa.mag());
00065     ali->rotateInLocalFrame(rotation);
00066                 
00067     //sets the errors for the hierarchy level
00068     double* errorData = error.Array();
00069     for (unsigned int i = 0; i < 21; ++i){errorData[i] = parameters[i+6];}
00070 
00071     ali->setSurvey( new SurveyDet(ali->surface(), error*(1e-6)) );
00072   }
00073   else {
00074     error = ROOT::Math::SMatrixIdentity();
00075     ali->setSurvey( new SurveyDet(ali->surface(), error * 1e-6) );
00076   }
00077                 
00078 }

void SurveyInputTrackerFromDB::beginJob ( const edm::EventSetup setup  )  [virtual]

Read ideal tracker geometry from DB.

Implements SurveyInputBase.

Definition at line 16 of file SurveyInputTrackerFromDB.cc.

References SurveyInputBase::addComponent(), addSurveyInfo(), SurveyInputBase::detector(), edm::EventSetup::get(), SurveyInputTextReader::readFile(), textFileName, uIdMap, and SurveyInputTextReader::UniqueIdMap().

00017 {
00018 
00019 //  std::cout << "***************ENTERING BEGIN JOB******************" << std::endl;
00020         
00021   //Get map from textreader
00022   SurveyInputTextReader dataReader;
00023   dataReader.readFile( textFileName );
00024   uIdMap = dataReader.UniqueIdMap();
00025 
00026   edm::ESHandle<GeometricDet>  geom;
00027   setup.get<IdealGeometryRecord>().get(geom);    
00028   TrackerGeometry* tracker = TrackerGeomBuilderFromGeometricDet().build(&*geom);
00029   
00030   addComponent( new AlignableTracker( tracker ) );
00031   addSurveyInfo( detector() );
00032 //  std::cout << "*************END BEGIN JOB***************" << std::endl;
00033 }


Member Data Documentation

std::string SurveyInputTrackerFromDB::textFileName [private]

Definition at line 34 of file SurveyInputTrackerFromDB.h.

Referenced by beginJob().

SurveyInputTextReader::MapType SurveyInputTrackerFromDB::uIdMap [private]

Definition at line 32 of file SurveyInputTrackerFromDB.h.

Referenced by addSurveyInfo(), and beginJob().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:33:01 2009 for CMSSW by  doxygen 1.5.4