CMS 3D CMS Logo

RotationForOnline Class Reference

Inheritance diagram for RotationForOnline:

edm::EDAnalyzer

List of all members.

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
virtual void beginJob (const edm::EventSetup &)
virtual void endJob ()
 RotationForOnline (const edm::ParameterSet &)
 ~RotationForOnline ()


Detailed Description

Definition at line 35 of file RotationForOnline.cc.


Constructor & Destructor Documentation

RotationForOnline::RotationForOnline ( const edm::ParameterSet iConfig  )  [explicit]

Definition at line 60 of file RotationForOnline.cc.

00061 {
00062    //now do what ever initialization is needed
00063 
00064 }

RotationForOnline::~RotationForOnline (  ) 

Definition at line 67 of file RotationForOnline.cc.

00068 {
00069  
00070    // do anything here that needs to be done at desctruction time
00071    // (e.g. close files, deallocate resources etc.)
00072 
00073 }


Member Function Documentation

void RotationForOnline::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
) [virtual]

Implements edm::EDAnalyzer.

Definition at line 82 of file RotationForOnline.cc.

References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().

00083 {
00084   std::cout << "analyze does nothing" << std::endl;
00085 }

void RotationForOnline::beginJob ( const edm::EventSetup iSetup  )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 90 of file RotationForOnline.cc.

References DDBase< N, C >::begin(), GenMuonPlsPt100GeV_cfg::cout, DDBase< N, C >::end(), lat::endl(), edm::EventSetup::get(), parsecf::pyparsing::ident, int, DDBase< N, C >::isDefined(), cmsRelvalreport::red(), x, y, and z.

00091 {
00092   // set tolerance for "near zero"
00093   double tolerance= 1.0e-3;
00094   std::string rotationFileName("ROTATIONS.dat");
00095   std::ofstream rotationOS(rotationFileName.c_str());
00096   std::cout << "RotationForOnline Analyzer..." << std::endl;
00097 
00098 
00099   edm::ESHandle<DDCompactView> pDD;
00100 
00101   iSetup.get<IdealGeometryRecord>().get( "", pDD );
00102   DDRotationMatrix ident;
00103 
00104   DDRotation::iterator<DDRotation> rit(DDRotation::begin()), red(DDRotation::end());
00105   for (; rit != red; ++rit) {
00106     if (! rit->isDefined().second) continue;
00107     //    if ( rit->matrix()->isIdentity() ) continue;
00108     if ( *(rit->matrix()) == ident ) continue;
00109     const DDRotation& rota = *rit;
00110     bool reflection = false;
00111 
00112     DD3Vector x, y, z;
00113     rit->matrix()->GetComponents(x, y, z);
00114     if ( (1.0 + (x.Cross(y)).Dot(z)) <= tolerance ) {
00115       reflection = true;
00116     }
00117  
00118     rotationOS<< *(rota.isDefined().first); //rota name
00119     double thetaX, phiX, thetaY, phiY, thetaZ, phiZ;
00120 
00121     thetaX = std::acos(x.z());
00122     phiX = ( x.y() == 0 && x.x() == 0.0) ? 0.0 : std::atan2(x.y(), x.x());
00123 
00124     thetaY = std::acos(y.z());
00125     phiY = ( y.y() == 0 && y.x() == 0.0) ? 0.0 : std::atan2(y.y(), y.x());
00126 
00127     thetaZ = std::acos(z.z());
00128     phiZ = ( z.y() == 0 && z.x() == 0.0) ? 0.0 : std::atan2(z.y(), z.x());
00129 
00130     rotationOS<< "," << thetaX
00131               << "," << phiX
00132               << "," << thetaY
00133               << "," << phiY
00134               << "," << thetaZ
00135               << "," << phiZ
00136               << "," << (int)reflection
00137               <<std::endl;
00138   } 
00139 
00140   rotationOS.close();
00141 
00142 }

void RotationForOnline::endJob ( void   )  [virtual]

Reimplemented from edm::EDAnalyzer.

Definition at line 146 of file RotationForOnline.cc.

00146                           {
00147 }


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:30:53 2009 for CMSSW by  doxygen 1.5.4