CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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
< CSCGeometry,
MuonGeometryRecord
cscGeomToken_
 
const edm::ESGetToken
< DTGeometry,
MuonGeometryRecord
dtGeomToken_
 
const edm::ESGetToken
< GEMGeometry,
MuonGeometryRecord
gemGeomToken_
 
const edm::ESGetToken
< DTGeometry,
MuonGeometryRecord
muonGeoToken_
 
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
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
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...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 9 of file DTSurveyConvert.cc.

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.

14  //now do what ever initialization is needed
15  nameWheel_m2 = iConfig.getUntrackedParameter<std::string>("nameWheel_m2");
16  nameWheel_m1 = iConfig.getUntrackedParameter<std::string>("nameWheel_m1");
17  nameWheel_0 = iConfig.getUntrackedParameter<std::string>("nameWheel_0");
18  nameWheel_p1 = iConfig.getUntrackedParameter<std::string>("nameWheel_p1");
19  nameWheel_p2 = iConfig.getUntrackedParameter<std::string>("nameWheel_p2");
20 
21  nameChambers_m2 = iConfig.getUntrackedParameter<std::string>("nameChambers_m2");
22  nameChambers_m1 = iConfig.getUntrackedParameter<std::string>("nameChambers_m1");
23  nameChambers_0 = iConfig.getUntrackedParameter<std::string>("nameChambers_0");
24  nameChambers_p1 = iConfig.getUntrackedParameter<std::string>("nameChambers_p1");
25  nameChambers_p2 = iConfig.getUntrackedParameter<std::string>("nameChambers_p2");
26 
27  wheel_m2 = iConfig.getUntrackedParameter<bool>("wheel_m2");
28  wheel_m1 = iConfig.getUntrackedParameter<bool>("wheel_m1");
29  wheel_0 = iConfig.getUntrackedParameter<bool>("wheel_0");
30  wheel_p1 = iConfig.getUntrackedParameter<bool>("wheel_p1");
31  wheel_p2 = iConfig.getUntrackedParameter<bool>("wheel_p2");
32 
33  outputFileName = iConfig.getUntrackedParameter<std::string>("OutputTextFile");
34  WriteToDB = iConfig.getUntrackedParameter<bool>("writeToDB");
35 }
T getUntrackedParameter(std::string const &, T const &) const
std::string nameWheel_p2
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
std::string nameChambers_0
std::string nameChambers_p2
std::string nameChambers_p1
std::string nameWheel_m2
std::string nameWheel_p1
std::string outputFileName
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeoToken_
std::string nameChambers_m2
std::string nameWheel_0
std::string nameWheel_m1
std::string nameChambers_m1
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_

Member Function Documentation

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

Implements edm::one::EDAnalyzerBase.

Definition at line 38 of file DTSurveyConvert.cc.

References alpha, HLT_FULL_cff::beta, DTSurvey::CalculateChambers(), cscGeomToken_, dtGeomToken_, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, gemGeomToken_, edm::EventSetup::getData(), muonGeoToken_, nameChambers_0, nameChambers_m1, nameChambers_m2, nameChambers_p1, nameChambers_p2, nameWheel_0, nameWheel_m1, nameWheel_m2, nameWheel_p1, nameWheel_p2, produceTPGParameters_beamv6_transparency_spikekill_2016_script::outFile, outputFileName, DTSurvey::ReadChambers(), MuonAlignment::saveToDB(), wheel_0, wheel_m1, wheel_m2, wheel_p1, wheel_p2, wheelList, and WriteToDB.

38  {
39  const DTGeometry *pDD = &iSetup.getData(muonGeoToken_);
40 
41  std::ofstream outFile(outputFileName.c_str());
42 
43  if (wheel_m2 == true) {
44  DTSurvey *wheel = new DTSurvey(nameWheel_m2, nameChambers_m2, -2);
45  wheel->ReadChambers(pDD);
46  wheel->CalculateChambers();
47  outFile << *wheel;
48  wheelList.push_back(wheel);
49  }
50  if (wheel_m1 == true) {
51  DTSurvey *wheel = new DTSurvey(nameWheel_m1, nameChambers_m1, -1);
52  wheel->ReadChambers(pDD);
53  wheel->CalculateChambers();
54  outFile << *wheel;
55  wheelList.push_back(wheel);
56  }
57  if (wheel_0 == true) {
58  DTSurvey *wheel = new DTSurvey(nameWheel_0, nameChambers_0, 0);
59  wheel->ReadChambers(pDD);
60  wheel->CalculateChambers();
61  outFile << *wheel;
62  wheelList.push_back(wheel);
63  }
64  if (wheel_p1 == true) {
66  wheel->ReadChambers(pDD);
67  wheel->CalculateChambers();
68  outFile << *wheel;
69  wheelList.push_back(wheel);
70  }
71  if (wheel_p2 == true) {
73  wheel->ReadChambers(pDD);
74  wheel->CalculateChambers();
75  outFile << *wheel;
76  wheelList.push_back(wheel);
77  }
78  outFile.close();
79 
80  if (WriteToDB == true) {
81  // Instantiate the helper class
82  const DTGeometry *dtGeometry = &iSetup.getData(dtGeomToken_);
83  const CSCGeometry *cscGeometry = &iSetup.getData(cscGeomToken_);
84  const GEMGeometry *gemGeometry = &iSetup.getData(gemGeomToken_);
85 
86  MuonAlignment align(&*dtGeometry, &*cscGeometry, &*gemGeometry);
87  std::ifstream inFile(outputFileName.c_str());
88  while (!inFile.eof()) {
89  float dx, dy, dz, sigma_dx, sigma_dy, sigma_dz;
90  float alpha, beta, gamma, sigma_alpha, sigma_beta, sigma_gamma;
91  inFile >> dx >> sigma_dx >> dy >> sigma_dy >> dz >> sigma_dz >> alpha >> sigma_alpha >> beta >> sigma_beta >>
92  gamma >> sigma_gamma;
93  if (inFile.eof())
94  break;
95  std::vector<float> displacement;
96  displacement.push_back(dx);
97  displacement.push_back(dy);
98  displacement.push_back(dz);
99  displacement.push_back(-alpha);
100  displacement.push_back(-beta);
101  displacement.push_back(-gamma);
102  }
103  inFile.close();
104  align.saveToDB();
105  }
106 }
std::string nameWheel_p2
float alpha
Definition: AMPTWrapper.h:105
const edm::ESGetToken< CSCGeometry, MuonGeometryRecord > cscGeomToken_
std::string nameChambers_0
void ReadChambers(edm::ESHandle< DTGeometry >)
Definition: DTSurvey.cc:34
std::string nameChambers_p2
std::string nameChambers_p1
std::string nameWheel_m2
std::string nameWheel_p1
std::string outputFileName
void CalculateChambers()
Definition: DTSurvey.cc:22
const edm::ESGetToken< GEMGeometry, MuonGeometryRecord > gemGeomToken_
bool getData(T &iHolder) const
Definition: EventSetup.h:128
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > muonGeoToken_
std::string nameChambers_m2
std::vector< DTSurvey * > wheelList
std::string nameWheel_0
std::string nameWheel_m1
std::string nameChambers_m1
const edm::ESGetToken< DTGeometry, MuonGeometryRecord > dtGeomToken_

Member Data Documentation

const edm::ESGetToken<CSCGeometry, MuonGeometryRecord> DTSurveyConvert::cscGeomToken_
private

Definition at line 57 of file DTSurveyConvert.h.

Referenced by analyze().

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

Definition at line 56 of file DTSurveyConvert.h.

Referenced by analyze().

const edm::ESGetToken<GEMGeometry, MuonGeometryRecord> DTSurveyConvert::gemGeomToken_
private

Definition at line 58 of file DTSurveyConvert.h.

Referenced by analyze().

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

Definition at line 35 of file DTSurveyConvert.h.

Referenced by analyze().

std::string DTSurveyConvert::nameChambers_0
private

Definition at line 45 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameChambers_m1
private

Definition at line 44 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameChambers_m2
private

Definition at line 43 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameChambers_p1
private

Definition at line 46 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameChambers_p2
private

Definition at line 47 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_0
private

Definition at line 40 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_m1
private

Definition at line 39 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_m2
private

Definition at line 38 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_p1
private

Definition at line 41 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_p2
private

Definition at line 42 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::outputFileName
private
bool DTSurveyConvert::wheel_0
private

Definition at line 51 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

bool DTSurveyConvert::wheel_m1
private

Definition at line 50 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

bool DTSurveyConvert::wheel_m2
private

Definition at line 49 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

bool DTSurveyConvert::wheel_p1
private

Definition at line 52 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

bool DTSurveyConvert::wheel_p2
private

Definition at line 53 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

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

Definition at line 37 of file DTSurveyConvert.h.

Referenced by analyze().

bool DTSurveyConvert::WriteToDB
private

Definition at line 54 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().