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 &) override
 
virtual void beginRun (const edm::Run &, const edm::EventSetup &) override
 
virtual void endJob () override
 
 RotationForOnline (const edm::ParameterSet &)
 
 ~RotationForOnline ()
 
- 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 ()
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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

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.

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

Definition at line 67 of file RotationForOnline.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 82 of file RotationForOnline.cc.

References gather_cfg::cout.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 90 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, y, and z.

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

Reimplemented from edm::EDAnalyzer.

Definition at line 146 of file RotationForOnline.cc.

146  {
147 }