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::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 DTSurveyConvert (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () 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
 
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::vector< ModuleDescription const * > &modules, 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
 
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

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::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 &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- 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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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: Reads survey information, process it and outputs a text file with results

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

Definition at line 26 of file DTSurveyConvert.h.

Constructor & Destructor Documentation

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

Definition at line 14 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  {
15  //now do what ever initialization is needed
16  nameWheel_m2 = iConfig.getUntrackedParameter<std::string>("nameWheel_m2");
17  nameWheel_m1 = iConfig.getUntrackedParameter<std::string>("nameWheel_m1");
18  nameWheel_0 = iConfig.getUntrackedParameter<std::string>("nameWheel_0");
19  nameWheel_p1 = iConfig.getUntrackedParameter<std::string>("nameWheel_p1");
20  nameWheel_p2 = iConfig.getUntrackedParameter<std::string>("nameWheel_p2");
21 
22  nameChambers_m2 = iConfig.getUntrackedParameter<std::string>("nameChambers_m2");
23  nameChambers_m1 = iConfig.getUntrackedParameter<std::string>("nameChambers_m1");
24  nameChambers_0 = iConfig.getUntrackedParameter<std::string>("nameChambers_0");
25  nameChambers_p1 = iConfig.getUntrackedParameter<std::string>("nameChambers_p1");
26  nameChambers_p2 = iConfig.getUntrackedParameter<std::string>("nameChambers_p2");
27 
28  wheel_m2 = iConfig.getUntrackedParameter<bool>("wheel_m2");
29  wheel_m1 = iConfig.getUntrackedParameter<bool>("wheel_m1");
30  wheel_0 = iConfig.getUntrackedParameter<bool>("wheel_0");
31  wheel_p1 = iConfig.getUntrackedParameter<bool>("wheel_p1");
32  wheel_p2 = iConfig.getUntrackedParameter<bool>("wheel_p2");
33 
34  outputFileName = iConfig.getUntrackedParameter<std::string>("OutputTextFile");
35  WriteToDB = iConfig.getUntrackedParameter<bool>("writeToDB");
36 }
T getUntrackedParameter(std::string const &, T const &) const
std::string nameWheel_p2
std::string nameChambers_0
std::string nameChambers_p2
std::string nameChambers_p1
std::string nameWheel_m2
std::string nameWheel_p1
std::string outputFileName
std::string nameChambers_m2
std::string nameWheel_0
std::string nameWheel_m1
std::string nameChambers_m1

Member Function Documentation

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

Definition at line 39 of file DTSurveyConvert.cc.

References alpha, pfBoostedDoubleSVAK8TagInfos_cfi::beta, DTSurvey::CalculateChambers(), DEFINE_FWK_MODULE, PVValHelper::dx, PVValHelper::dy, PVValHelper::dz, CustomPhysics_cfi::gamma, edm::EventSetup::get(), nameChambers_0, nameChambers_m1, nameChambers_m2, nameChambers_p1, nameChambers_p2, nameWheel_0, nameWheel_m1, nameWheel_m2, nameWheel_p1, nameWheel_p2, GetRecoTauVFromDQM_MC_cff::outFile, outputFileName, DTSurvey::ReadChambers(), MuonAlignment::saveToDB(), makeMuonMisalignmentScenario::wheel, wheel_0, wheel_m1, wheel_m2, wheel_p1, wheel_p2, wheelList, and WriteToDB.

39  {
41  iSetup.get<MuonGeometryRecord>().get(pDD);
42 
43  std::ofstream outFile(outputFileName.c_str());
44 
45  if (wheel_m2 == true) {
47  wheel->ReadChambers(pDD);
48  wheel->CalculateChambers();
49  outFile << *wheel;
50  wheelList.push_back(wheel);
51  }
52  if (wheel_m1 == true) {
53  DTSurvey *wheel = new DTSurvey(nameWheel_m1, nameChambers_m1, -1);
54  wheel->ReadChambers(pDD);
55  wheel->CalculateChambers();
56  outFile << *wheel;
57  wheelList.push_back(wheel);
58  }
59  if (wheel_0 == true) {
60  DTSurvey *wheel = new DTSurvey(nameWheel_0, nameChambers_0, 0);
61  wheel->ReadChambers(pDD);
62  wheel->CalculateChambers();
63  outFile << *wheel;
64  wheelList.push_back(wheel);
65  }
66  if (wheel_p1 == true) {
68  wheel->ReadChambers(pDD);
69  wheel->CalculateChambers();
70  outFile << *wheel;
71  wheelList.push_back(wheel);
72  }
73  if (wheel_p2 == true) {
75  wheel->ReadChambers(pDD);
76  wheel->CalculateChambers();
77  outFile << *wheel;
78  wheelList.push_back(wheel);
79  }
80  outFile.close();
81 
82  if (WriteToDB == true) {
83  // Instantiate the helper class
84  MuonAlignment align(iSetup);
85  std::ifstream inFile(outputFileName.c_str());
86  while (!inFile.eof()) {
87  float dx, dy, dz, sigma_dx, sigma_dy, sigma_dz;
88  float alpha, beta, gamma, sigma_alpha, sigma_beta, sigma_gamma;
89  inFile >> dx >> sigma_dx >> dy >> sigma_dy >> dz >> sigma_dz >> alpha >> sigma_alpha >> beta >> sigma_beta >>
90  gamma >> sigma_gamma;
91  if (inFile.eof())
92  break;
93  std::vector<float> displacement;
94  displacement.push_back(dx);
95  displacement.push_back(dy);
96  displacement.push_back(dz);
97  displacement.push_back(-alpha);
98  displacement.push_back(-beta);
99  displacement.push_back(-gamma);
100  }
101  inFile.close();
102  align.saveToDB();
103  }
104 }
std::string nameWheel_p2
float alpha
Definition: AMPTWrapper.h:95
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
std::string nameChambers_m2
std::vector< DTSurvey * > wheelList
std::string nameWheel_0
T get() const
Definition: EventSetup.h:71
std::string nameWheel_m1
std::string nameChambers_m1

Member Data Documentation

std::string DTSurveyConvert::nameChambers_0
private

Definition at line 40 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameChambers_m1
private

Definition at line 39 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameChambers_m2
private

Definition at line 38 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameChambers_p1
private

Definition at line 41 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameChambers_p2
private

Definition at line 42 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_0
private

Definition at line 35 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_m1
private

Definition at line 34 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_m2
private

Definition at line 33 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_p1
private

Definition at line 36 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

std::string DTSurveyConvert::nameWheel_p2
private

Definition at line 37 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

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

Definition at line 46 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

bool DTSurveyConvert::wheel_m1
private

Definition at line 45 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

bool DTSurveyConvert::wheel_m2
private

Definition at line 44 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

bool DTSurveyConvert::wheel_p1
private

Definition at line 47 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

bool DTSurveyConvert::wheel_p2
private

Definition at line 48 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().

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

Definition at line 32 of file DTSurveyConvert.h.

Referenced by analyze().

bool DTSurveyConvert::WriteToDB
private

Definition at line 49 of file DTSurveyConvert.h.

Referenced by analyze(), and DTSurveyConvert().