CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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  }
23 
24  void beginRun( edm::Run const& iEvent, edm::EventSetup const& ) override;
25  void analyze( edm::Event const& iEvent, edm::EventSetup const& ) override {}
26  void endRun( edm::Run const& iEvent, edm::EventSetup const& ) override {}
27 
28 private:
30 
34 };
35 
36 void
38 {
41  if( !mydbservice.isAvailable())
42  {
43  edm::LogError( "PHGCalParametersDBBuilder" ) << "PoolDBOutputService unavailable";
44  return;
45  }
47  es.get<IdealGeometryRecord>().get( cpv );
48 
50  HGCalParametersFromDD builder;
51  builder.build( &(*cpv), *ptp, m_name, m_namew, m_namec );
52  swapParameters( ptp, phgp );
53 
54  delete ptp;
55 
56  if( mydbservice->isNewTagRequest( "PHGCalParametersRcd" ))
57  {
58  mydbservice->createNewIOV<PHGCalParameters>( phgp, mydbservice->beginOfTime(), mydbservice->endOfTime(), "PHGCalParametersRcd" );
59  } else
60  {
61  edm::LogError( "PHGCalParametersDBBuilder" ) << "PHGCalParameters and PHGCalParametersRcd Tag already present";
62  }
63 }
64 
65 void
67 {
68  phgp->name_ = ptp->name_;
69  phgp->cellSize_.swap( ptp->cellSize_ );
70  phgp->moduleBlS_.swap( ptp->moduleBlS_ );
71  phgp->moduleTlS_.swap( ptp->moduleTlS_ );
72  phgp->moduleHS_.swap( ptp->moduleHS_ );
73  phgp->moduleDzS_.swap( ptp->moduleDzS_ );
74  phgp->moduleAlphaS_.swap( ptp->moduleAlphaS_ );
75  phgp->moduleCellS_.swap( ptp->moduleCellS_ );
76  phgp->moduleBlR_.swap( ptp->moduleBlR_ );
77  phgp->moduleTlR_.swap( ptp->moduleTlR_ );
78  phgp->moduleHR_.swap( ptp->moduleHR_ );
79  phgp->moduleDzR_.swap( ptp->moduleDzR_ );
80  phgp->moduleAlphaR_.swap( ptp->moduleAlphaR_ );
81  phgp->moduleCellR_.swap( ptp->moduleCellR_ );
82  phgp->trformTranX_.swap( ptp->trformTranX_ );
83  phgp->trformTranY_.swap( ptp->trformTranY_ );
84  phgp->trformTranZ_.swap( ptp->trformTranZ_ );
85  phgp->trformRotXX_.swap( ptp->trformRotXX_ );
86  phgp->trformRotYX_.swap( ptp->trformRotYX_ );
87  phgp->trformRotZX_.swap( ptp->trformRotZX_ );
88  phgp->trformRotXY_.swap( ptp->trformRotXY_ );
89  phgp->trformRotYY_.swap( ptp->trformRotYY_ );
90  phgp->trformRotZY_.swap( ptp->trformRotZY_ );
91  phgp->trformRotXZ_.swap( ptp->trformRotXZ_ );
92  phgp->trformRotYZ_.swap( ptp->trformRotYZ_ );
93  phgp->trformRotZZ_.swap( ptp->trformRotZZ_ );
94  phgp->zLayerHex_.swap( ptp->zLayerHex_ );
95  phgp->rMinLayHex_.swap( ptp->rMinLayHex_ );
96  phgp->rMaxLayHex_.swap( ptp->rMaxLayHex_ );
97  phgp->waferPosX_.swap( ptp->waferPosX_ );
98  phgp->waferPosY_.swap( ptp->waferPosY_ );
99  phgp->cellFineX_.swap( ptp->cellFineX_ );
100  phgp->cellFineY_.swap( ptp->cellFineY_ );
101  phgp->cellCoarseX_.swap( ptp->cellCoarseX_ );
102  phgp->cellCoarseY_.swap( ptp->cellCoarseY_ );
103  phgp->boundR_.swap( ptp->boundR_ );
104  phgp->moduleLayS_.swap( ptp->moduleLayS_ );
105  phgp->moduleLayR_.swap( ptp->moduleLayR_ );
106  phgp->layer_.swap( ptp->layer_ );
107  phgp->layerIndex_.swap( ptp->layerIndex_ );
108  phgp->layerGroup_.swap( ptp->layerGroup_ );
109  phgp->cellFactor_.swap( ptp->cellFactor_ );
110  phgp->depth_.swap( ptp->depth_ );
111  phgp->depthIndex_.swap( ptp->depthIndex_ );
112  phgp->depthLayerF_.swap( ptp->depthLayerF_ );
113  phgp->waferCopy_.swap( ptp->waferCopy_ );
114  phgp->waferTypeL_.swap( ptp->waferTypeL_ );
115  phgp->waferTypeT_.swap( ptp->waferTypeT_ );
116  phgp->layerGroupM_.swap( ptp->layerGroupM_ );
117  phgp->layerGroupO_.swap( ptp->layerGroupO_ );
118  phgp->trformIndex_.swap( ptp->trformIndex_ );
119  phgp->waferR_ = ptp->waferR_;
120  phgp->nCells_ = ptp->nCells_;
121  phgp->nSectors_ = ptp->nSectors_;
122  phgp->mode_ = ptp->mode_;
123 }
124 
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_
std::vector< double > cellCoarseY_
std::vector< int > moduleLayS_
std::vector< int > moduleLayR_
std::vector< double > trformRotZZ_
std::vector< int > depth_
std::vector< double > trformRotYZ_
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:17
std::vector< double > moduleHS_
std::vector< double > moduleTlR_
std::vector< double > trformTranY_
std::vector< int > waferTypeL_
std::vector< double > cellFineY_
std::vector< double > cellFineX_
bool build(const DDCompactView *, HGCalParameters &, const std::string &, const std::string &, const std::string &)
std::vector< double > trformRotZY_
std::vector< double > moduleAlphaS_
std::vector< uint32_t > trformIndex_
std::vector< int > layerGroupM_
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:230
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:46
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 > boundR_
std::vector< double > cellFineY_
std::vector< double > trformRotXZ_
std::vector< int > layerGroup_
std::vector< double > moduleCellR_
std::vector< double > moduleCellS_
const T & get() const
Definition: EventSetup.h:56
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_
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:43
std::vector< double > moduleDzR_