CMS 3D CMS Logo

SiPixelLorentzAngleDB Class Reference

#include <CalibTracker/SiPixelLorentzAngle/interface/SiPixelLorentzAngleDB.h>

Inheritance diagram for SiPixelLorentzAngleDB:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
virtual void beginJob (const edm::EventSetup &c)
virtual void endJob ()
 SiPixelLorentzAngleDB (const edm::ParameterSet &conf)
virtual ~SiPixelLorentzAngleDB ()

Private Attributes

edm::ParameterSet conf_
std::vector< std::pair
< uint32_t, float > > 
detid_la
double magneticField_


Detailed Description

Definition at line 23 of file SiPixelLorentzAngleDB.h.


Constructor & Destructor Documentation

SiPixelLorentzAngleDB::SiPixelLorentzAngleDB ( const edm::ParameterSet conf  )  [explicit]

Definition at line 22 of file SiPixelLorentzAngleDB.cc.

References conf_, edm::ParameterSet::getParameter(), and magneticField_.

00022                                                                         : 
00023   conf_(conf){
00024         magneticField_ = conf_.getParameter<double>("magneticField");
00025 //   if(conf_.getParameter<bool>("DoCalibration")) siStripLorentzAngleAlgorithm_=new SiStripLorentzAngleAlgorithm(conf);
00026 //   else siStripLorentzAngleAlgorithm_=0;
00027 }

SiPixelLorentzAngleDB::~SiPixelLorentzAngleDB (  )  [virtual]

Definition at line 86 of file SiPixelLorentzAngleDB.cc.

00086                                               {  
00087 
00088 }  


Member Function Documentation

void SiPixelLorentzAngleDB::analyze ( const edm::Event e,
const edm::EventSetup c 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 92 of file SiPixelLorentzAngleDB.cc.

00093 {
00094 
00095 
00096 }

void SiPixelLorentzAngleDB::beginJob ( const edm::EventSetup c  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 31 of file SiPixelLorentzAngleDB.cc.

References lat::endl(), exception, edm::EventSetup::get(), edm::Service< T >::isAvailable(), it, magneticField_, SiPixelLorentzAngle::putLorentzAngle(), and cms::Exception::what().

00031                                                           {
00032   
00033         SiPixelLorentzAngle* LorentzAngle = new SiPixelLorentzAngle();
00034            
00035         
00036         edm::ESHandle<TrackerGeometry> pDD;
00037         c.get<TrackerDigiGeometryRecord>().get( pDD );
00038         edm::LogInfo("SiPixelLorentzAngle") <<" There are "<<pDD->detUnits().size() <<" detectors"<<std::endl;
00039         
00040         float langle;
00041         
00042         if(magneticField_ != 0) langle = (0.106*4) / magneticField_;
00043         
00044         else langle = 0.;
00045         
00046         for(TrackerGeometry::DetUnitContainer::const_iterator it = pDD->detUnits().begin(); it != pDD->detUnits().end(); it++){
00047     
00048                 if( dynamic_cast<PixelGeomDetUnit*>((*it))!=0){
00049                         uint32_t detid=((*it)->geographicalId()).rawId();
00050                         if ( ! LorentzAngle->putLorentzAngle(detid,langle ) )
00051 //                      if ( ! LorentzAngle->putLorentzAngle(detid,langle) )
00052                                         edm::LogError("SiPixelLorentzAngleDB")<<"[SiPixelLorentzAngleDB::analyze] detid already exists"<<std::endl;
00053                 
00054                         }
00055                         
00056                 }      
00057         
00058 
00059         edm::Service<cond::service::PoolDBOutputService> mydbservice;
00060         if( mydbservice.isAvailable() ){
00061                 try{
00062                         if( mydbservice->isNewTagRequest("SiPixelLorentzAngleRcd") ){
00063                                 mydbservice->createNewIOV<SiPixelLorentzAngle>(LorentzAngle,
00064                                                                                mydbservice->beginOfTime(),
00065                                                                                mydbservice->endOfTime(),
00066                                                                                "SiPixelLorentzAngleRcd");
00067                         } else {
00068                                 mydbservice->appendSinceTime<SiPixelLorentzAngle>(LorentzAngle,
00069                                                                                   mydbservice->currentTime(),
00070                                                                                   "SiPixelLorentzAngleRcd");
00071                         }
00072                 }catch(const cond::Exception& er){
00073                         edm::LogError("SiPixelLorentzAngleDB")<<er.what()<<std::endl;
00074                 }catch(const std::exception& er){
00075                         edm::LogError("SiPixelLorentzAngleDB")<<"caught std::exception "<<er.what()<<std::endl;
00076                 }catch(...){
00077                         edm::LogError("SiPixelLorentzAngleDB")<<"Funny error"<<std::endl;
00078                 }
00079         }else{
00080                 edm::LogError("SiPixelLorentzAngleDB")<<"Service is unavailable"<<std::endl;
00081         }
00082    
00083 }

void SiPixelLorentzAngleDB::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 98 of file SiPixelLorentzAngleDB.cc.

00098                                   {
00099 
00100 
00101 }


Member Data Documentation

edm::ParameterSet SiPixelLorentzAngleDB::conf_ [private]

Definition at line 41 of file SiPixelLorentzAngleDB.h.

Referenced by SiPixelLorentzAngleDB().

std::vector< std::pair<uint32_t, float> > SiPixelLorentzAngleDB::detid_la [private]

Definition at line 40 of file SiPixelLorentzAngleDB.h.

double SiPixelLorentzAngleDB::magneticField_ [private]

Definition at line 42 of file SiPixelLorentzAngleDB.h.

Referenced by beginJob(), and SiPixelLorentzAngleDB().


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