CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Member Functions | Private Attributes
MuonGeometryDBConverter Class Reference

#include <Alignment/MuonAlignment/plugins/MuonGeometryDBConverter.cc>

Inheritance diagram for MuonGeometryDBConverter:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 MuonGeometryDBConverter (const edm::ParameterSet &)
 
 ~MuonGeometryDBConverter ()
 
- 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
 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
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 

Private Attributes

double m_angleErr
 
std::string m_cscLabel
 
bool m_done
 
std::string m_dtLabel
 
std::string m_fileName
 
bool m_getAPEs
 
std::string m_input
 
edm::ParameterSet m_misalignmentScenario
 
std::string m_output
 
edm::ParameterSet m_outputXML
 
double m_shiftErr
 

Additional Inherited Members

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

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 43 of file MuonGeometryDBConverter.cc.

Constructor & Destructor Documentation

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

Definition at line 75 of file MuonGeometryDBConverter.cc.

References edm::hlt::Exception, edm::ParameterSet::getParameter(), m_angleErr, m_cscLabel, m_dtLabel, m_fileName, m_getAPEs, m_input, m_misalignmentScenario, m_output, m_outputXML, m_shiftErr, and AlCaHLTBitMon_QueryRunRegistry::string.

76  : m_done(false)
77  , m_input(iConfig.getParameter<std::string>("input"))
78  , m_output(iConfig.getParameter<std::string>("output"))
79  , m_shiftErr(0.)
80  , m_angleErr(0.)
81  , m_getAPEs(false)
82 {
84  // Version V02-03-02 and earlier of this module had support for //
85  // "cfg" as an input/output format. It turns out that reading //
86  // thousands of parameters from a configuration file takes a very //
87  // long time, so "cfg" wasn't very practical. When I reorganized //
88  // the code, I didn't bother to port it. //
90 
91  if (m_input == std::string("ideal")) {}
92 
93  else if (m_input == std::string("db")) {
94  m_dtLabel = iConfig.getParameter<std::string>("dtLabel");
95  m_cscLabel = iConfig.getParameter<std::string>("cscLabel");
96  m_shiftErr = iConfig.getParameter<double>("shiftErr");
97  m_angleErr = iConfig.getParameter<double>("angleErr");
98  m_getAPEs = iConfig.getParameter<bool>("getAPEs");
99  }
100 
101  else if (m_input == std::string("surveydb")) {
102  m_dtLabel = iConfig.getParameter<std::string>("dtLabel");
103  m_cscLabel = iConfig.getParameter<std::string>("cscLabel");
104  }
105 
106  else if (m_input == std::string("scenario")) {
107  m_misalignmentScenario = iConfig.getParameter<edm::ParameterSet>("MisalignmentScenario");
108  m_shiftErr = iConfig.getParameter<double>("shiftErr");
109  m_angleErr = iConfig.getParameter<double>("angleErr");
110  }
111 
112  else if (m_input == std::string("xml")) {
113  m_fileName = iConfig.getParameter<std::string>("fileName");
114  m_shiftErr = iConfig.getParameter<double>("shiftErr");
115  m_angleErr = iConfig.getParameter<double>("angleErr");
116  }
117 
118  else {
119  throw cms::Exception("BadConfig") << "input must be \"ideal\", \"db\", \"surveydb\", or \"xml\"." << std::endl;
120  }
121 
122  if (m_output == std::string("none")) {}
123 
124  else if (m_output == std::string("db")) {}
125 
126  else if (m_output == std::string("surveydb")) {}
127 
128  else if (m_output == std::string("xml")) {
129  m_outputXML = iConfig.getParameter<edm::ParameterSet>("outputXML");
130  }
131 
132  else {
133  throw cms::Exception("BadConfig") << "output must be \"none\", \"db\", or \"surveydb\"." << std::endl;
134  }
135 }
T getParameter(std::string const &) const
edm::ParameterSet m_misalignmentScenario
MuonGeometryDBConverter::~MuonGeometryDBConverter ( )

Definition at line 137 of file MuonGeometryDBConverter.cc.

137 { }

Member Function Documentation

void MuonGeometryDBConverter::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDAnalyzer.

Definition at line 141 of file MuonGeometryDBConverter.cc.

References MuonScenarioBuilder::applyScenario(), MuonAlignment::copyAlignmentToSurvey(), MuonAlignment::copySurveyToAlignment(), edm::hlt::Exception, MuonAlignment::fillGapsInSurvey(), MuonAlignment::getAlignableMuon(), m_angleErr, m_cscLabel, m_done, m_dtLabel, m_fileName, m_getAPEs, m_input, m_misalignmentScenario, m_output, m_outputXML, m_shiftErr, CSCOverlapsAlignmentAlgorithm_cff::muonAlignment, NULL, MuonAlignment::saveSurveyToDB(), MuonAlignment::saveToDB(), AlCaHLTBitMon_QueryRunRegistry::string, and MuonAlignment::writeXML().

141  {
142  if (!m_done) {
144 
145  if (m_input == std::string("ideal")) {
146  MuonAlignmentInputMethod inputMethod;
147  muonAlignment = new MuonAlignment(iSetup, inputMethod);
148  muonAlignment->fillGapsInSurvey(0., 0.);
149  }
150 
151  else if (m_input == std::string("db")) {
153  muonAlignment = new MuonAlignment(iSetup, inputMethod);
154  if (m_getAPEs) {
156  }
157  }
158 
159  else if (m_input == std::string("surveydb")) {
161  muonAlignment = new MuonAlignment(iSetup, inputMethod);
162  muonAlignment->copySurveyToAlignment();
163  }
164 
165  else if (m_input == std::string("scenario")) {
166  MuonAlignmentInputMethod inputMethod;
167  muonAlignment = new MuonAlignment(iSetup, inputMethod);
168 
169  MuonScenarioBuilder muonScenarioBuilder(muonAlignment->getAlignableMuon());
170  muonScenarioBuilder.applyScenario(m_misalignmentScenario);
172  }
173 
174  else if (m_input == std::string("xml")) {
175  MuonAlignmentInputXML inputMethod(m_fileName);
176  muonAlignment = new MuonAlignment(iSetup, inputMethod);
177  muonAlignment->fillGapsInSurvey(m_shiftErr, m_angleErr);
178  }
179 
181 
182  if (muonAlignment) {
183 
184  if (m_output == std::string("none")) {}
185 
186  else if (m_output == std::string("db")) {
187  muonAlignment->saveToDB();
188  }
189 
190  else if (m_output == std::string("surveydb")) {
191  muonAlignment->saveSurveyToDB();
192  }
193 
194  else if (m_output == std::string("xml")) {
195  muonAlignment->writeXML(m_outputXML, iSetup);
196  }
197 
198  delete muonAlignment;
199 
200  }
201 
202  m_done = true;
203  } // end if not done
204  else {
205  throw cms::Exception("BadConfig") << "Set maxEvents.input to 1. (Your output is okay.)" << std::endl;
206  }
207 }
Builds a scenario from configuration and applies it to the alignable Muon.
void copyAlignmentToSurvey(double shiftErr, double angleErr)
#define NULL
Definition: scimark2.h:8
void copySurveyToAlignment()
void saveSurveyToDB()
AlignableMuon * getAlignableMuon()
Definition: MuonAlignment.h:30
void fillGapsInSurvey(double shiftErr, double angleErr)
void writeXML(const edm::ParameterSet &iConfig, const edm::EventSetup &iSetup)
void applyScenario(const edm::ParameterSet &scenario)
Apply misalignment scenario to the Muon.
edm::ParameterSet m_misalignmentScenario

Member Data Documentation

double MuonGeometryDBConverter::m_angleErr
private

Definition at line 56 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

std::string MuonGeometryDBConverter::m_cscLabel
private

Definition at line 55 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

bool MuonGeometryDBConverter::m_done
private

Definition at line 52 of file MuonGeometryDBConverter.cc.

Referenced by analyze().

std::string MuonGeometryDBConverter::m_dtLabel
private

Definition at line 55 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

std::string MuonGeometryDBConverter::m_fileName
private

Definition at line 57 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

bool MuonGeometryDBConverter::m_getAPEs
private

Definition at line 58 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

std::string MuonGeometryDBConverter::m_input
private

Definition at line 53 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

edm::ParameterSet MuonGeometryDBConverter::m_misalignmentScenario
private

Definition at line 60 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

std::string MuonGeometryDBConverter::m_output
private

Definition at line 53 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

edm::ParameterSet MuonGeometryDBConverter::m_outputXML
private

Definition at line 61 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().

double MuonGeometryDBConverter::m_shiftErr
private

Definition at line 56 of file MuonGeometryDBConverter.cc.

Referenced by analyze(), and MuonGeometryDBConverter().