CMS 3D CMS Logo

Classes | Functions

/data/doxygen/doxygen-1.7.3/gen/CMSSW_4_2_8/src/SimTracker/TrackerMaterialAnalysis/plugins/ListGroups.cc File Reference

#include <string>
#include <vector>
#include <iostream>
#include <iomanip>
#include "FWCore/Framework/interface/EDAnalyzer.h"
#include "FWCore/Framework/interface/Event.h"
#include "FWCore/Framework/interface/EventSetup.h"
#include "FWCore/Framework/interface/ESTransientHandle.h"
#include "FWCore/ParameterSet/interface/ParameterSet.h"
#include "FWCore/Utilities/interface/InputTag.h"
#include "FWCore/ParameterSet/interface/types.h"
#include "FWCore/MessageLogger/interface/MessageLogger.h"
#include "DataFormats/DetId/interface/DetId.h"
#include "DataFormats/Math/interface/Vector3D.h"
#include "DetectorDescription/Core/interface/DDFilteredView.h"
#include "DetectorDescription/Core/interface/DDCompactView.h"
#include "DetectorDescription/Core/interface/DDMaterial.h"
#include "Geometry/Records/interface/IdealGeometryRecord.h"
#include "FWCore/PluginManager/interface/ModuleDef.h"
#include "FWCore/Framework/interface/MakerMacros.h"

Go to the source code of this file.

Classes

class  ListGroups

Functions

static double dddGetDouble (const std::string &s, DDFilteredView const &view)
static std::string dddGetString (const std::string &s, DDFilteredView const &view)
static bool dddGetStringRaw (const DDFilteredView &view, const std::string &name, std::string &value)
 DEFINE_FWK_MODULE (ListGroups)
static std::ostream & operator<< (std::ostream &out, const math::XYZVector &v)

Function Documentation

static double dddGetDouble ( const std::string &  s,
DDFilteredView const &  view 
) [inline, static]

Definition at line 42 of file ListGroups.cc.

References dddGetStringRaw(), and relativeConstraints::value.

                                                                      {
  std::string value;
  if (dddGetStringRaw(view, s, value))
    return double(::atof(value.c_str()));
  else
    return NAN;
}
static std::string dddGetString ( const std::string &  s,
DDFilteredView const &  view 
) [inline, static]

Definition at line 51 of file ListGroups.cc.

References dddGetStringRaw(), and relativeConstraints::value.

Referenced by ListGroups::analyze().

                                                                         {
  std::string value;
  if (dddGetStringRaw(view, s, value))
    return value;
  else
    return std::string();
}
static bool dddGetStringRaw ( const DDFilteredView view,
const std::string &  name,
std::string &  value 
) [static]

Definition at line 23 of file ListGroups.cc.

References DDfetch(), Exception, query::result, DDFilteredView::specificsV(), and DDValue::strings().

Referenced by dddGetDouble(), and dddGetString().

                                                                                             {
  std::vector<const DDsvalues_type *> result;
  view.specificsV(result);
  for (std::vector<const DDsvalues_type *>::iterator it = result.begin(); it != result.end(); ++it)   {
    DDValue parameter(name);
    if (DDfetch(*it, parameter)) {
      if (parameter.strings().size() == 1) {
        value = parameter.strings().front();
        return true;
      } else {
        throw cms::Exception("Configuration")<< " ERROR: multiple " << name << " tags encountered";
        return false;
      }
    }
  }
  return false;
}
DEFINE_FWK_MODULE ( ListGroups  )
static std::ostream& operator<< ( std::ostream &  out,
const math::XYZVector v 
) [inline, static]

Definition at line 60 of file ListGroups.cc.

                                                                   {
  out << std::fixed << std::setprecision(3);
  return out << "(" << v.rho() << ", " << v.z() << ", " << v.phi() << ")";
}