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 {
15 public:
16 
18  {
19  m_name = iConfig.getUntrackedParameter<std::string>( "Name" );
20  m_namew = iConfig.getUntrackedParameter<std::string>( "NameW" );
21  m_namec = iConfig.getUntrackedParameter<std::string>( "NameC" );
22  m_namet = iConfig.getUntrackedParameter<std::string>( "NameT" );
23  }
24 
25  void beginRun( edm::Run const& iEvent, edm::EventSetup const& ) override;
26  void analyze( edm::Event const& iEvent, edm::EventSetup const& ) override {}
27  void endRun( edm::Run const& iEvent, edm::EventSetup const& ) override {}
28 
29 private:
31 
36 };
37 
38 void
40 {
43  if( !mydbservice.isAvailable())
44  {
45  edm::LogError( "PHGCalParametersDBBuilder" ) << "PoolDBOutputService unavailable";
46  return;
47  }
49  es.get<IdealGeometryRecord>().get( cpv );
50 
52  HGCalParametersFromDD builder;
53  builder.build( &(*cpv), *ptp, m_name, m_namew, m_namec, m_namet );
54  swapParameters( ptp, phgp );
55 
56  delete ptp;
57 
58  if( mydbservice->isNewTagRequest( "PHGCalParametersRcd" ))
59  {
60  mydbservice->createNewIOV<PHGCalParameters>( phgp, mydbservice->beginOfTime(), mydbservice->endOfTime(), "PHGCalParametersRcd" );
61  } else
62  {
63  edm::LogError( "PHGCalParametersDBBuilder" ) << "PHGCalParameters and PHGCalParametersRcd Tag already present";
64  }
65 }
66 
67 void
69 {
70  phgp->name_ = ptp->name_;
71  phgp->cellSize_.swap( ptp->cellSize_ );
72  phgp->moduleBlS_.swap( ptp->moduleBlS_ );
73  phgp->moduleTlS_.swap( ptp->moduleTlS_ );
74  phgp->moduleHS_.swap( ptp->moduleHS_ );
75  phgp->moduleDzS_.swap( ptp->moduleDzS_ );
76  phgp->moduleAlphaS_.swap( ptp->moduleAlphaS_ );
77  phgp->moduleCellS_.swap( ptp->moduleCellS_ );
78  phgp->moduleBlR_.swap( ptp->moduleBlR_ );
79  phgp->moduleTlR_.swap( ptp->moduleTlR_ );
80  phgp->moduleHR_.swap( ptp->moduleHR_ );
81  phgp->moduleDzR_.swap( ptp->moduleDzR_ );
82  phgp->moduleAlphaR_.swap( ptp->moduleAlphaR_ );
83  phgp->moduleCellR_.swap( ptp->moduleCellR_ );
84  phgp->trformTranX_.swap( ptp->trformTranX_ );
85  phgp->trformTranY_.swap( ptp->trformTranY_ );
86  phgp->trformTranZ_.swap( ptp->trformTranZ_ );
87  phgp->trformRotXX_.swap( ptp->trformRotXX_ );
88  phgp->trformRotYX_.swap( ptp->trformRotYX_ );
89  phgp->trformRotZX_.swap( ptp->trformRotZX_ );
90  phgp->trformRotXY_.swap( ptp->trformRotXY_ );
91  phgp->trformRotYY_.swap( ptp->trformRotYY_ );
92  phgp->trformRotZY_.swap( ptp->trformRotZY_ );
93  phgp->trformRotXZ_.swap( ptp->trformRotXZ_ );
94  phgp->trformRotYZ_.swap( ptp->trformRotYZ_ );
95  phgp->trformRotZZ_.swap( ptp->trformRotZZ_ );
96  phgp->zLayerHex_.swap( ptp->zLayerHex_ );
97  phgp->rMinLayHex_.swap( ptp->rMinLayHex_ );
98  phgp->rMaxLayHex_.swap( ptp->rMaxLayHex_ );
99  phgp->waferPosX_.swap( ptp->waferPosX_ );
100  phgp->waferPosY_.swap( ptp->waferPosY_ );
101  phgp->cellFineX_.swap( ptp->cellFineX_ );
102  phgp->cellFineY_.swap( ptp->cellFineY_ );
103  phgp->cellCoarseX_.swap( ptp->cellCoarseX_ );
104  phgp->cellCoarseY_.swap( ptp->cellCoarseY_ );
105  phgp->boundR_.swap( ptp->boundR_ );
106  phgp->moduleLayS_.swap( ptp->moduleLayS_ );
107  phgp->moduleLayR_.swap( ptp->moduleLayR_ );
108  phgp->layer_.swap( ptp->layer_ );
109  phgp->layerIndex_.swap( ptp->layerIndex_ );
110  phgp->layerGroup_.swap( ptp->layerGroup_ );
111  phgp->cellFactor_.swap( ptp->cellFactor_ );
112  phgp->depth_.swap( ptp->depth_ );
113  phgp->depthIndex_.swap( ptp->depthIndex_ );
114  phgp->depthLayerF_.swap( ptp->depthLayerF_ );
115  phgp->waferCopy_.swap( ptp->waferCopy_ );
116  phgp->waferTypeL_.swap( ptp->waferTypeL_ );
117  phgp->waferTypeT_.swap( ptp->waferTypeT_ );
118  phgp->layerGroupM_.swap( ptp->layerGroupM_ );
119  phgp->layerGroupO_.swap( ptp->layerGroupO_ );
120  phgp->trformIndex_.swap( ptp->trformIndex_ );
121  phgp->slopeMin_.swap( ptp->slopeMin_ );
122  phgp->waferR_ = ptp->waferR_;
123  phgp->nCells_ = ptp->nCells_;
124  phgp->nSectors_ = ptp->nSectors_;
125  phgp->mode_ = ptp->mode_;
126 }
127 
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:71
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_