CMS 3D CMS Logo

PHGCalParametersDBBuilder.cc
Go to the documentation of this file.
12 
13 class PHGCalParametersDBBuilder : public edm::one::EDAnalyzer<edm::one::WatchRuns> {
14 public:
16  m_name = iConfig.getUntrackedParameter<std::string>("Name");
17  m_namew = iConfig.getUntrackedParameter<std::string>("NameW");
18  m_namec = iConfig.getUntrackedParameter<std::string>("NameC");
19  m_namet = iConfig.getUntrackedParameter<std::string>("NameT");
20  }
21 
22  void beginRun(edm::Run const& iEvent, edm::EventSetup const&) override;
23  void analyze(edm::Event const& iEvent, edm::EventSetup const&) override {}
24  void endRun(edm::Run const& iEvent, edm::EventSetup const&) override {}
25 
26 private:
28 
33 };
34 
38  if (!mydbservice.isAvailable()) {
39  edm::LogError("PHGCalParametersDBBuilder") << "PoolDBOutputService unavailable";
40  return;
41  }
43  es.get<IdealGeometryRecord>().get(cpv);
44 
46  HGCalParametersFromDD builder;
47  builder.build(&(*cpv), *ptp, m_name, m_namew, m_namec, m_namet);
48  swapParameters(ptp, phgp);
49 
50  delete ptp;
51 
52  if (mydbservice->isNewTagRequest("PHGCalParametersRcd")) {
53  mydbservice->createNewIOV<PHGCalParameters>(
54  phgp, mydbservice->beginOfTime(), mydbservice->endOfTime(), "PHGCalParametersRcd");
55  } else {
56  edm::LogError("PHGCalParametersDBBuilder") << "PHGCalParameters and PHGCalParametersRcd Tag already present";
57  }
58 }
59 
61  phgp->name_ = ptp->name_;
62  phgp->cellSize_.swap(ptp->cellSize_);
63  phgp->moduleBlS_.swap(ptp->moduleBlS_);
64  phgp->moduleTlS_.swap(ptp->moduleTlS_);
65  phgp->moduleHS_.swap(ptp->moduleHS_);
66  phgp->moduleDzS_.swap(ptp->moduleDzS_);
67  phgp->moduleAlphaS_.swap(ptp->moduleAlphaS_);
68  phgp->moduleCellS_.swap(ptp->moduleCellS_);
69  phgp->moduleBlR_.swap(ptp->moduleBlR_);
70  phgp->moduleTlR_.swap(ptp->moduleTlR_);
71  phgp->moduleHR_.swap(ptp->moduleHR_);
72  phgp->moduleDzR_.swap(ptp->moduleDzR_);
73  phgp->moduleAlphaR_.swap(ptp->moduleAlphaR_);
74  phgp->moduleCellR_.swap(ptp->moduleCellR_);
75  phgp->trformTranX_.swap(ptp->trformTranX_);
76  phgp->trformTranY_.swap(ptp->trformTranY_);
77  phgp->trformTranZ_.swap(ptp->trformTranZ_);
78  phgp->trformRotXX_.swap(ptp->trformRotXX_);
79  phgp->trformRotYX_.swap(ptp->trformRotYX_);
80  phgp->trformRotZX_.swap(ptp->trformRotZX_);
81  phgp->trformRotXY_.swap(ptp->trformRotXY_);
82  phgp->trformRotYY_.swap(ptp->trformRotYY_);
83  phgp->trformRotZY_.swap(ptp->trformRotZY_);
84  phgp->trformRotXZ_.swap(ptp->trformRotXZ_);
85  phgp->trformRotYZ_.swap(ptp->trformRotYZ_);
86  phgp->trformRotZZ_.swap(ptp->trformRotZZ_);
87  phgp->zLayerHex_.swap(ptp->zLayerHex_);
88  phgp->rMinLayHex_.swap(ptp->rMinLayHex_);
89  phgp->rMaxLayHex_.swap(ptp->rMaxLayHex_);
90  phgp->waferPosX_.swap(ptp->waferPosX_);
91  phgp->waferPosY_.swap(ptp->waferPosY_);
92  phgp->cellFineX_.swap(ptp->cellFineX_);
93  phgp->cellFineY_.swap(ptp->cellFineY_);
94  phgp->cellCoarseX_.swap(ptp->cellCoarseX_);
95  phgp->cellCoarseY_.swap(ptp->cellCoarseY_);
96  phgp->boundR_.swap(ptp->boundR_);
97  phgp->moduleLayS_.swap(ptp->moduleLayS_);
98  phgp->moduleLayR_.swap(ptp->moduleLayR_);
99  phgp->layer_.swap(ptp->layer_);
100  phgp->layerIndex_.swap(ptp->layerIndex_);
101  phgp->layerGroup_.swap(ptp->layerGroup_);
102  phgp->cellFactor_.swap(ptp->cellFactor_);
103  phgp->depth_.swap(ptp->depth_);
104  phgp->depthIndex_.swap(ptp->depthIndex_);
105  phgp->depthLayerF_.swap(ptp->depthLayerF_);
106  phgp->waferCopy_.swap(ptp->waferCopy_);
107  phgp->waferTypeL_.swap(ptp->waferTypeL_);
108  phgp->waferTypeT_.swap(ptp->waferTypeT_);
109  phgp->layerGroupM_.swap(ptp->layerGroupM_);
110  phgp->layerGroupO_.swap(ptp->layerGroupO_);
111  phgp->trformIndex_.swap(ptp->trformIndex_);
112  phgp->slopeMin_.swap(ptp->slopeMin_);
113  phgp->waferR_ = ptp->waferR_;
114  phgp->nCells_ = ptp->nCells_;
115  phgp->nSectors_ = ptp->nSectors_;
116  phgp->mode_ = ptp->mode_;
117 }
118 
std::vector< double > waferPosY_
std::vector< int > layer_
T getUntrackedParameter(std::string const &, T const &) const
std::vector< double > moduleDzR_
std::vector< int > depthLayerF_
std::vector< uint32_t > trformIndex_
std::vector< int > depthLayerF_
std::vector< int > depth_
std::vector< double > moduleCellR_
std::vector< double > moduleHR_
std::vector< int > waferTypeT_
std::vector< double > trformRotXX_
std::vector< double > trformRotYY_
std::vector< double > trformRotXY_
std::vector< int > layerGroupO_
bool build(const DDCompactView *, HGCalParameters &, const std::string &, const std::string &, const std::string &, const std::string &)
std::vector< double > cellCoarseY_
std::vector< int > moduleLayS_
std::vector< int > moduleLayR_
std::vector< double > trformRotZZ_
std::vector< int > depth_
std::vector< double > trformRotYZ_
std::vector< double > moduleHS_
std::vector< double > moduleTlR_
std::vector< double > trformTranY_
std::vector< int > waferTypeL_
std::vector< double > slopeMin_
std::vector< double > cellFineY_
std::vector< double > cellFineX_
std::vector< double > trformRotZY_
std::vector< double > moduleAlphaS_
std::vector< uint32_t > trformIndex_
std::vector< int > layerGroupM_
HGCalGeometryMode::GeometryMode mode_
std::vector< double > waferPosY_
std::vector< int > cellFactor_
std::vector< double > trformRotXX_
std::vector< double > trformRotZX_
std::vector< double > trformRotYX_
std::vector< double > cellCoarseX_
std::vector< double > trformTranY_
std::vector< double > trformRotYZ_
int iEvent
Definition: GenABIO.cc:224
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
std::vector< double > trformRotZY_
std::vector< double > rMaxLayHex_
std::vector< double > boundR_
std::vector< int > layerGroup_
std::vector< double > cellSize_
std::vector< double > moduleAlphaR_
std::vector< double > moduleDzS_
bool isNewTagRequest(const std::string &recordName)
std::vector< int > layerIndex_
std::vector< double > moduleAlphaR_
std::vector< double > trformRotZX_
std::vector< double > waferPosX_
std::vector< int > layer_
std::vector< double > trformRotXY_
std::vector< double > trformRotYX_
bool isAvailable() const
Definition: Service.h:40
std::vector< int > waferCopy_
std::vector< double > moduleDzS_
std::vector< int > moduleLayR_
std::vector< int > depthIndex_
std::vector< double > moduleBlR_
PHGCalParametersDBBuilder(const edm::ParameterSet &iConfig)
std::vector< int > layerIndex_
void endRun(edm::Run const &iEvent, edm::EventSetup const &) override
std::vector< double > rMinLayHex_
std::vector< double > moduleHS_
std::vector< double > moduleTlS_
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
std::vector< double > zLayerHex_
std::vector< double > rMaxLayHex_
std::vector< double > trformTranX_
std::vector< double > slopeMin_
std::vector< double > boundR_
std::vector< double > cellFineY_
std::vector< double > trformRotXZ_
std::vector< int > layerGroup_
std::vector< double > moduleCellR_
std::vector< double > moduleCellS_
std::vector< double > moduleHR_
std::vector< double > trformRotYY_
std::vector< double > cellFineX_
std::vector< int > layerGroupM_
std::vector< double > trformRotZZ_
std::vector< double > moduleTlS_
std::vector< double > moduleBlS_
std::vector< double > moduleAlphaS_
std::vector< int > layerGroupO_
std::vector< double > rMinLayHex_
std::vector< double > trformTranX_
std::vector< double > moduleBlS_
std::vector< int > cellFactor_
T get() const
Definition: EventSetup.h:73
std::vector< int > waferCopy_
void swapParameters(HGCalParameters *, PHGCalParameters *)
std::vector< double > moduleCellS_
std::vector< int > depthIndex_
std::vector< int > waferTypeT_
std::vector< double > cellCoarseY_
std::vector< int > moduleLayS_
void beginRun(edm::Run const &iEvent, edm::EventSetup const &) override
void analyze(edm::Event const &iEvent, edm::EventSetup const &) override
std::vector< double > trformTranZ_
std::vector< double > moduleBlR_
std::vector< double > cellCoarseX_
std::vector< double > trformTranZ_
std::vector< double > waferPosX_
std::vector< double > trformRotXZ_
std::vector< double > moduleTlR_
std::vector< double > cellSize_
std::vector< int > waferTypeL_
std::vector< double > zLayerHex_
std::string name_
Definition: Run.h:45
std::vector< double > moduleDzR_