CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
DTSurveyConvert Class Reference

#include <Alignment/DTSurveyConvert/src/DTSurveyConvert.cc>

Inheritance diagram for DTSurveyConvert:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 DTSurveyConvert (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer<>
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex > const & esGetTokenRecordIndicesVector (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

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

Private Attributes

const edm::ESGetToken< DTGeometry, MuonGeometryRecordmuonGeoToken_
 
std::string nameChambers_0
 
std::string nameChambers_m1
 
std::string nameChambers_m2
 
std::string nameChambers_p1
 
std::string nameChambers_p2
 
std::string nameWheel_0
 
std::string nameWheel_m1
 
std::string nameWheel_m2
 
std::string nameWheel_p1
 
std::string nameWheel_p2
 
std::string outputFileName
 
bool wheel_0
 
bool wheel_m1
 
bool wheel_m2
 
bool wheel_p1
 
bool wheel_p2
 
std::vector< DTSurvey * > wheelList
 
bool WriteToDB
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Description: Reads survey information, process it and outputs a text file with results

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

Definition at line 28 of file DTSurveyConvert.h.

Constructor & Destructor Documentation

◆ DTSurveyConvert()

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

Definition at line 9 of file DTSurveyConvert.cc.

10  //now do what ever initialization is needed
11  nameWheel_m2 = iConfig.getUntrackedParameter<std::string>("nameWheel_m2");
12  nameWheel_m1 = iConfig.getUntrackedParameter<std::string>("nameWheel_m1");
13  nameWheel_0 = iConfig.getUntrackedParameter<std::string>("nameWheel_0");
14  nameWheel_p1 = iConfig.getUntrackedParameter<std::string>("nameWheel_p1");
15  nameWheel_p2 = iConfig.getUntrackedParameter<std::string>("nameWheel_p2");
16 
17  nameChambers_m2 = iConfig.getUntrackedParameter<std::string>("nameChambers_m2");
18  nameChambers_m1 = iConfig.getUntrackedParameter<std::string>("nameChambers_m1");
19  nameChambers_0 = iConfig.getUntrackedParameter<std::string>("nameChambers_0");
20  nameChambers_p1 = iConfig.getUntrackedParameter<std::string>("nameChambers_p1");
21  nameChambers_p2 = iConfig.getUntrackedParameter<std::string>("nameChambers_p2");
22 
23  wheel_m2 = iConfig.getUntrackedParameter<bool>("wheel_m2");
24  wheel_m1 = iConfig.getUntrackedParameter<bool>("wheel_m1");
25  wheel_0 = iConfig.getUntrackedParameter<bool>("wheel_0");
26  wheel_p1 = iConfig.getUntrackedParameter<bool>("wheel_p1");
27  wheel_p2 = iConfig.getUntrackedParameter<bool>("wheel_p2");
28 
29  outputFileName = iConfig.getUntrackedParameter<std::string>("OutputTextFile");
30  WriteToDB = iConfig.getUntrackedParameter<bool>("writeToDB");
31 }

References edm::ParameterSet::getUntrackedParameter(), nameChambers_0, nameChambers_m1, nameChambers_m2, nameChambers_p1, nameChambers_p2, nameWheel_0, nameWheel_m1, nameWheel_m2, nameWheel_p1, nameWheel_p2, outputFileName, AlCaHLTBitMon_QueryRunRegistry::string, wheel_0, wheel_m1, wheel_m2, wheel_p1, wheel_p2, and WriteToDB.

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 34 of file DTSurveyConvert.cc.

34  {
35  const DTGeometry *pDD = &iSetup.getData(muonGeoToken_);
36 
37  std::ofstream outFile(outputFileName.c_str());
38 
39  if (wheel_m2 == true) {
41  wheel->ReadChambers(pDD);
42  wheel->CalculateChambers();
43  outFile << *wheel;
44  wheelList.push_back(wheel);
45  }
46  if (wheel_m1 == true) {
48  wheel->ReadChambers(pDD);
49  wheel->CalculateChambers();
50  outFile << *wheel;
51  wheelList.push_back(wheel);
52  }
53  if (wheel_0 == true) {
55  wheel->ReadChambers(pDD);
56  wheel->CalculateChambers();
57  outFile << *wheel;
58  wheelList.push_back(wheel);
59  }
60  if (wheel_p1 == true) {
62  wheel->ReadChambers(pDD);
63  wheel->CalculateChambers();
64  outFile << *wheel;
65  wheelList.push_back(wheel);
66  }
67  if (wheel_p2 == true) {
69  wheel->ReadChambers(pDD);
70  wheel->CalculateChambers();
71  outFile << *wheel;
72  wheelList.push_back(wheel);
73  }
74  outFile.close();
75 
76  if (WriteToDB == true) {
77  // Instantiate the helper class
78  MuonAlignment align(iSetup);
79  std::ifstream inFile(outputFileName.c_str());
80  while (!inFile.eof()) {
81  float dx, dy, dz, sigma_dx, sigma_dy, sigma_dz;
82  float alpha, beta, gamma, sigma_alpha, sigma_beta, sigma_gamma;
83  inFile >> dx >> sigma_dx >> dy >> sigma_dy >> dz >> sigma_dz >> alpha >> sigma_alpha >> beta >> sigma_beta >>
84  gamma >> sigma_gamma;
85  if (inFile.eof())
86  break;
87  std::vector<float> displacement;
88  displacement.push_back(dx);
89  displacement.push_back(dy);
90  displacement.push_back(dz);
91  displacement.push_back(-alpha);
92  displacement.push_back(-beta);
93  displacement.push_back(-gamma);
94  }
95  inFile.close();
96  align.saveToDB();
97  }
98 }

References alpha, HLT_FULL_cff::beta, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, CustomPhysics_cfi::gamma, edm::EventSetup::getData(), muonGeoToken_, nameChambers_0, nameChambers_m1, nameChambers_m2, nameChambers_p1, nameChambers_p2, nameWheel_0, nameWheel_m1, nameWheel_m2, nameWheel_p1, nameWheel_p2, L1TdeCSCTF_cfi::outFile, outputFileName, makeMuonMisalignmentScenario::wheel, wheel_0, wheel_m1, wheel_m2, wheel_p1, wheel_p2, wheelList, and WriteToDB.

Member Data Documentation

◆ muonGeoToken_

const edm::ESGetToken<DTGeometry, MuonGeometryRecord> DTSurveyConvert::muonGeoToken_
private

Definition at line 35 of file DTSurveyConvert.h.

Referenced by analyze().

◆ nameChambers_0

std::string DTSurveyConvert::nameChambers_0
private

Definition at line 45 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameChambers_m1

std::string DTSurveyConvert::nameChambers_m1
private

Definition at line 44 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameChambers_m2

std::string DTSurveyConvert::nameChambers_m2
private

Definition at line 43 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameChambers_p1

std::string DTSurveyConvert::nameChambers_p1
private

Definition at line 46 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameChambers_p2

std::string DTSurveyConvert::nameChambers_p2
private

Definition at line 47 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameWheel_0

std::string DTSurveyConvert::nameWheel_0
private

Definition at line 40 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameWheel_m1

std::string DTSurveyConvert::nameWheel_m1
private

Definition at line 39 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameWheel_m2

std::string DTSurveyConvert::nameWheel_m2
private

Definition at line 38 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameWheel_p1

std::string DTSurveyConvert::nameWheel_p1
private

Definition at line 41 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ nameWheel_p2

std::string DTSurveyConvert::nameWheel_p2
private

Definition at line 42 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ outputFileName

std::string DTSurveyConvert::outputFileName
private

◆ wheel_0

bool DTSurveyConvert::wheel_0
private

Definition at line 51 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ wheel_m1

bool DTSurveyConvert::wheel_m1
private

Definition at line 50 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ wheel_m2

bool DTSurveyConvert::wheel_m2
private

Definition at line 49 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ wheel_p1

bool DTSurveyConvert::wheel_p1
private

Definition at line 52 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ wheel_p2

bool DTSurveyConvert::wheel_p2
private

Definition at line 53 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

◆ wheelList

std::vector<DTSurvey *> DTSurveyConvert::wheelList
private

Definition at line 37 of file DTSurveyConvert.h.

Referenced by analyze().

◆ WriteToDB

bool DTSurveyConvert::WriteToDB
private

Definition at line 54 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

DTGeometry
Definition: DTGeometry.h:28
DTSurveyConvert::wheel_p1
bool wheel_p1
Definition: DTSurveyConvert.h:52
align
Definition: AlignableIndexer.h:30
HLT_FULL_cff.beta
beta
Definition: HLT_FULL_cff.py:8651
DTSurveyConvert::nameWheel_m1
std::string nameWheel_m1
Definition: DTSurveyConvert.h:39
CustomPhysics_cfi.gamma
gamma
Definition: CustomPhysics_cfi.py:17
alpha
float alpha
Definition: AMPTWrapper.h:105
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
DTSurveyConvert::nameChambers_p2
std::string nameChambers_p2
Definition: DTSurveyConvert.h:47
DTSurveyConvert::nameWheel_p2
std::string nameWheel_p2
Definition: DTSurveyConvert.h:42
MuonAlignment
Definition: MuonAlignment.h:21
DTSurveyConvert::nameWheel_p1
std::string nameWheel_p1
Definition: DTSurveyConvert.h:41
DTSurveyConvert::wheel_m2
bool wheel_m2
Definition: DTSurveyConvert.h:49
DTSurveyConvert::nameWheel_0
std::string nameWheel_0
Definition: DTSurveyConvert.h:40
L1TdeCSCTF_cfi.outFile
outFile
Definition: L1TdeCSCTF_cfi.py:5
DTSurveyConvert::wheel_m1
bool wheel_m1
Definition: DTSurveyConvert.h:50
makeMuonMisalignmentScenario.wheel
wheel
Definition: makeMuonMisalignmentScenario.py:319
DTSurveyConvert::outputFileName
std::string outputFileName
Definition: DTSurveyConvert.h:48
PVValHelper::dy
Definition: PVValidationHelpers.h:50
DTSurveyConvert::wheel_0
bool wheel_0
Definition: DTSurveyConvert.h:51
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
DTSurveyConvert::wheel_p2
bool wheel_p2
Definition: DTSurveyConvert.h:53
DTSurveyConvert::nameChambers_p1
std::string nameChambers_p1
Definition: DTSurveyConvert.h:46
DTSurveyConvert::muonGeoToken_
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeoToken_
Definition: DTSurveyConvert.h:35
PVValHelper::dz
Definition: PVValidationHelpers.h:51
DTSurveyConvert::nameChambers_m1
std::string nameChambers_m1
Definition: DTSurveyConvert.h:44
DTSurveyConvert::nameChambers_0
std::string nameChambers_0
Definition: DTSurveyConvert.h:45
DTSurveyConvert::wheelList
std::vector< DTSurvey * > wheelList
Definition: DTSurveyConvert.h:37
edm::EDConsumerBase::esConsumes
auto esConsumes()
Definition: EDConsumerBase.h:206
DTSurveyConvert::nameWheel_m2
std::string nameWheel_m2
Definition: DTSurveyConvert.h:38
DTSurveyConvert::WriteToDB
bool WriteToDB
Definition: DTSurveyConvert.h:54
PVValHelper::dx
Definition: PVValidationHelpers.h:49
DTSurveyConvert::nameChambers_m2
std::string nameChambers_m2
Definition: DTSurveyConvert.h:43
DTSurvey
Definition: DTSurvey.h:25