CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
RotationForOnline Class Reference
Inheritance diagram for RotationForOnline:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &)
 
virtual void endJob ()
 
 RotationForOnline (const edm::ParameterSet &)
 
 ~RotationForOnline ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- 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::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
CurrentProcessingContext const * currentContext () const
 
- 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

Definition at line 36 of file RotationForOnline.cc.

Constructor & Destructor Documentation

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

Definition at line 61 of file RotationForOnline.cc.

62 {
63  //now do what ever initialization is needed
64 
65 }
RotationForOnline::~RotationForOnline ( )

Definition at line 68 of file RotationForOnline.cc.

69 {
70 
71  // do anything here that needs to be done at desctruction time
72  // (e.g. close files, deallocate resources etc.)
73 
74 }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 83 of file RotationForOnline.cc.

References gather_cfg::cout.

84 {
85  std::cout << "analyze does nothing" << std::endl;
86 }
tuple cout
Definition: gather_cfg.py:121
void RotationForOnline::beginRun ( const edm::Run ,
const edm::EventSetup iSetup 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 91 of file RotationForOnline.cc.

References DDBase< DDName, DDRotationMatrix * >::begin(), gather_cfg::cout, DDBase< DDName, DDRotationMatrix * >::end(), edm::EventSetup::get(), DDBase< N, C >::isDefined(), cmsRelvalreport::red(), AlCaHLTBitMon_QueryRunRegistry::string, x, detailsBasic3DVector::y, and detailsBasic3DVector::z.

92 {
93  // set tolerance for "near zero"
94  double tolerance= 1.0e-3;
95  std::string rotationFileName("ROTATIONS.dat");
96  std::ofstream rotationOS(rotationFileName.c_str());
97  std::cout << "RotationForOnline Analyzer..." << std::endl;
98 
99 
101 
102  iSetup.get<IdealGeometryRecord>().get( "", pDD );
103  DDRotationMatrix ident;
104 
105  DDRotation::iterator<DDRotation> rit(DDRotation::begin()), red(DDRotation::end());
106  for (; rit != red; ++rit) {
107  if (! rit->isDefined().second) continue;
108  // if ( rit->matrix()->isIdentity() ) continue;
109  if ( *(rit->matrix()) == ident ) continue;
110  const DDRotation& rota = *rit;
111  bool reflection = false;
112 
113  DD3Vector x, y, z;
114  rit->matrix()->GetComponents(x, y, z);
115  if ( (1.0 + (x.Cross(y)).Dot(z)) <= tolerance ) {
116  reflection = true;
117  }
118 
119  rotationOS<< *(rota.isDefined().first); //rota name
120  double thetaX, phiX, thetaY, phiY, thetaZ, phiZ;
121 
122  thetaX = std::acos(x.z());
123  phiX = ( x.y() == 0 && x.x() == 0.0) ? 0.0 : std::atan2(x.y(), x.x());
124 
125  thetaY = std::acos(y.z());
126  phiY = ( y.y() == 0 && y.x() == 0.0) ? 0.0 : std::atan2(y.y(), y.x());
127 
128  thetaZ = std::acos(z.z());
129  phiZ = ( z.y() == 0 && z.x() == 0.0) ? 0.0 : std::atan2(z.y(), z.x());
130 
131  rotationOS<< "," << thetaX
132  << "," << phiX
133  << "," << thetaY
134  << "," << phiY
135  << "," << thetaZ
136  << "," << phiZ
137  << "," << (int)reflection
138  <<std::endl;
139  }
140 
141  rotationOS.close();
142 
143 }
def_type isDefined() const
Definition: DDBase.h:115
float float float z
Represents a uniquely identifyable rotation matrix.
Definition: DDTransform.h:66
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
const T & get() const
Definition: EventSetup.h:55
static DDI::Store< DDName, DDRotationMatrix * >::iterator begin()
Definition: DDBase.h:70
tuple cout
Definition: gather_cfg.py:121
static DDI::Store< DDName, DDRotationMatrix * >::iterator end()
Definition: DDBase.h:69
Definition: DDAxes.h:10
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
void RotationForOnline::endJob ( void  )
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 147 of file RotationForOnline.cc.

147  {
148 }