CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions
PTrackerParametersDBBuilder Class Reference

#include <PTrackerParametersDBBuilder.h>

Inheritance diagram for PTrackerParametersDBBuilder:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

virtual void analyze (const edm::Event &, const edm::EventSetup &)
 
virtual void beginRun (const edm::Run &, edm::EventSetup const &)
 
virtual void endJob ()
 
 PTrackerParametersDBBuilder (const edm::ParameterSet &)
 
 ~PTrackerParametersDBBuilder (void)
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
- 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 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

Definition at line 9 of file PTrackerParametersDBBuilder.h.

Constructor & Destructor Documentation

PTrackerParametersDBBuilder::PTrackerParametersDBBuilder ( const edm::ParameterSet )
inlineexplicit

Definition at line 12 of file PTrackerParametersDBBuilder.h.

12 {}
PTrackerParametersDBBuilder::~PTrackerParametersDBBuilder ( void  )
inline

Definition at line 13 of file PTrackerParametersDBBuilder.h.

13 {}

Member Function Documentation

virtual void PTrackerParametersDBBuilder::analyze ( const edm::Event ,
const edm::EventSetup  
)
inlinevirtual

Implements edm::EDAnalyzer.

Definition at line 15 of file PTrackerParametersDBBuilder.h.

15 {}
void PTrackerParametersDBBuilder::beginRun ( const edm::Run ,
edm::EventSetup const &  es 
)
virtual

Reimplemented from edm::EDAnalyzer.

Definition at line 15 of file PTrackerParametersDBBuilder.cc.

References assert(), cond::service::PoolDBOutputService::beginOfTime(), PTrackerParameters::PxfItem::bladeMask, PTrackerParameters::PxfItem::bladeStartBit, cond::service::PoolDBOutputService::createNewIOV(), dbl_to_int(), PTrackerParameters::PxfItem::diskMask, PTrackerParameters::PxfItem::diskStartBit, cond::service::PoolDBOutputService::endOfTime(), DDVectorGetter::get(), edm::EventSetup::get(), edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), PTrackerParameters::PxbItem::ladderMask, PTrackerParameters::PxbItem::ladderStartBit, PTrackerParameters::PxbItem::layerMask, PTrackerParameters::TIBItem::layerMask, PTrackerParameters::TOBItem::layerMask, PTrackerParameters::PxbItem::layerStartBit, PTrackerParameters::TIBItem::layerStartBit, PTrackerParameters::TOBItem::layerStartBit, PTrackerParameters::TIDItem::module_fw_bwMask, PTrackerParameters::TIDItem::module_fw_bwStartBit, PTrackerParameters::PxbItem::moduleMask, PTrackerParameters::PxfItem::moduleMask, PTrackerParameters::TECItem::moduleMask, PTrackerParameters::TIBItem::moduleMask, PTrackerParameters::TIDItem::moduleMask, PTrackerParameters::TOBItem::moduleMask, PTrackerParameters::PxbItem::moduleStartBit, PTrackerParameters::PxfItem::moduleStartBit, PTrackerParameters::TECItem::moduleStartBit, PTrackerParameters::TIBItem::moduleStartBit, PTrackerParameters::TIDItem::moduleStartBit, PTrackerParameters::TOBItem::moduleStartBit, PTrackerParameters::PxfItem::panelMask, PTrackerParameters::PxfItem::panelStartBit, PTrackerParameters::TECItem::petal_fw_bwMask, PTrackerParameters::TECItem::petal_fw_bwStartBit, PTrackerParameters::TECItem::petalMask, PTrackerParameters::TECItem::petalStartBit, PTrackerParameters::pxb, PTrackerParameters::pxf, PTrackerParameters::TECItem::ringMask, PTrackerParameters::TIDItem::ringMask, PTrackerParameters::TECItem::ringStartBit, PTrackerParameters::TIDItem::ringStartBit, PTrackerParameters::TOBItem::rod_fw_bwMask, PTrackerParameters::TOBItem::rod_fw_bwStartBit, PTrackerParameters::TOBItem::rodMask, PTrackerParameters::TOBItem::rodStartBit, PTrackerParameters::PxfItem::sideMask, PTrackerParameters::TECItem::sideMask, PTrackerParameters::TIDItem::sideMask, PTrackerParameters::PxfItem::sideStartBit, PTrackerParameters::TECItem::sideStartBit, PTrackerParameters::TIDItem::sideStartBit, PTrackerParameters::TECItem::sterMask, PTrackerParameters::TIBItem::sterMask, PTrackerParameters::TIDItem::sterMask, PTrackerParameters::TOBItem::sterMask, PTrackerParameters::TECItem::sterStartBit, PTrackerParameters::TIBItem::sterStartBit, PTrackerParameters::TIDItem::sterStartBit, PTrackerParameters::TOBItem::sterStartBit, PTrackerParameters::TIBItem::str_fw_bwMask, PTrackerParameters::TIBItem::str_fw_bwStartBit, PTrackerParameters::TIBItem::str_int_extMask, PTrackerParameters::TIBItem::str_int_extStartBit, PTrackerParameters::TIBItem::strMask, PTrackerParameters::TIBItem::strStartBit, PTrackerParameters::tec, PTrackerParameters::tib, PTrackerParameters::tid, PTrackerParameters::tob, PTrackerParameters::TECItem::wheelMask, PTrackerParameters::TIDItem::wheelMask, PTrackerParameters::TECItem::wheelStartBit, and PTrackerParameters::TIDItem::wheelStartBit.

16 {
19  if( !mydbservice.isAvailable())
20  {
21  edm::LogError( "PTrackerParametersDBBuilder" ) << "PoolDBOutputService unavailable";
22  return;
23  }
25  es.get<IdealGeometryRecord>().get( cpv );
26 
27  std::vector<int> pxbPars = dbl_to_int( DDVectorGetter::get( "pxbPars" ));
28  assert( pxbPars.size() == 6 );
29 
30  // FIXME: Populate pgde with data taken from cpv
31  ptp->pxb.layerStartBit = pxbPars.at(0); // 16
32  ptp->pxb.ladderStartBit = pxbPars.at(1); // 8
33  ptp->pxb.moduleStartBit = pxbPars.at(2); // 2
34  ptp->pxb.layerMask = pxbPars.at(3); // 0xF
35  ptp->pxb.ladderMask = pxbPars.at(4); // 0xFF
36  ptp->pxb.moduleMask = pxbPars.at(5); // 0x3F
37 
38  std::vector<int> pxfPars = dbl_to_int( DDVectorGetter::get( "pxfPars" ));
39  assert( pxfPars.size() == 10 );
40 
41  ptp->pxf.sideStartBit = pxfPars.at(0); // 23
42  ptp->pxf.diskStartBit = pxfPars.at(1); // 16
43  ptp->pxf.bladeStartBit = pxfPars.at(2); // 10
44  ptp->pxf.panelStartBit = pxfPars.at(3); // 8
45  ptp->pxf.moduleStartBit = pxfPars.at(4); // 2
46  ptp->pxf.sideMask = pxfPars.at(5); // 0x3
47  ptp->pxf.diskMask = pxfPars.at(6); // 0xF
48  ptp->pxf.bladeMask = pxfPars.at(7); // 0x3F
49  ptp->pxf.panelMask = pxfPars.at(8); // 0x3
50  ptp->pxf.moduleMask = pxfPars.at(9); // 0x3F
51 
52  std::vector<int> tecPars = dbl_to_int( DDVectorGetter::get( "tecPars" ));
53  assert( tecPars.size() == 14 );
54 
55  ptp->tec.sideStartBit = tecPars.at(0); // 18
56  ptp->tec.wheelStartBit = tecPars.at(1); // 14
57  ptp->tec.petal_fw_bwStartBit = tecPars.at(2); // 12
58  ptp->tec.petalStartBit = tecPars.at(3); // 8
59  ptp->tec.ringStartBit = tecPars.at(4); // 5
60  ptp->tec.moduleStartBit = tecPars.at(5); // 2
61  ptp->tec.sterStartBit = tecPars.at(6); // 0
62  ptp->tec.sideMask = tecPars.at(7); // 0x3
63  ptp->tec.wheelMask = tecPars.at(8); // 0xF
64  ptp->tec.petal_fw_bwMask = tecPars.at(9); // 0x3
65  ptp->tec.petalMask = tecPars.at(10); // 0xF
66  ptp->tec.ringMask = tecPars.at(11); // 0x7
67  ptp->tec.moduleMask = tecPars.at(12); // 0x7
68  ptp->tec.sterMask = tecPars.at(13); // 0x3
69 
70  std::vector<int> tibPars = dbl_to_int( DDVectorGetter::get( "tibPars" ));
71  assert( tibPars.size() == 12 );
72 
73  ptp->tib.layerStartBit = tibPars.at(0); // 14
74  ptp->tib.str_fw_bwStartBit = tibPars.at(1); // 12
75  ptp->tib.str_int_extStartBit = tibPars.at(2); // 10
76  ptp->tib.strStartBit = tibPars.at(3); // 4
77  ptp->tib.moduleStartBit = tibPars.at(4); // 2
78  ptp->tib.sterStartBit = tibPars.at(5); // 0
79  ptp->tib.layerMask = tibPars.at(6); // 0x7
80  ptp->tib.str_fw_bwMask = tibPars.at(7); // 0x3
81  ptp->tib.str_int_extMask = tibPars.at(8); // 0x3
82  ptp->tib.strMask = tibPars.at(9); // 0x3F
83  ptp->tib.moduleMask = tibPars.at(10); // 0x3
84  ptp->tib.sterMask = tibPars.at(11); // 0x3
85 
86  std::vector<int> tidPars = dbl_to_int( DDVectorGetter::get( "tidPars" ));
87  assert( tidPars.size() == 12 );
88 
89  ptp->tid.sideStartBit = tidPars.at(0); // 13
90  ptp->tid.wheelStartBit = tidPars.at(1); // 11
91  ptp->tid.ringStartBit = tidPars.at(2); // 9
92  ptp->tid.module_fw_bwStartBit = tidPars.at(3); // 7
93  ptp->tid.moduleStartBit = tidPars.at(4); // 2
94  ptp->tid.sterStartBit = tidPars.at(5); // 0
95  ptp->tid.sideMask = tidPars.at(6); // 0x3
96  ptp->tid.wheelMask = tidPars.at(7); // 0x3
97  ptp->tid.ringMask = tidPars.at(8); // 0x3
98  ptp->tid.module_fw_bwMask = tidPars.at(9); // 0x3
99  ptp->tid.moduleMask = tidPars.at(10); // 0x1F
100  ptp->tid.sterMask = tidPars.at(11); // 0x3
101 
102  std::vector<int> tobPars = dbl_to_int( DDVectorGetter::get( "tobPars" ));
103  assert( tobPars.size() == 10 );
104 
105  ptp->tob.layerStartBit = tobPars.at(0); // 14
106  ptp->tob.rod_fw_bwStartBit = tobPars.at(0); // 12
107  ptp->tob.rodStartBit = tobPars.at(0); // 5
108  ptp->tob.moduleStartBit = tobPars.at(0); // 2
109  ptp->tob.sterStartBit = tobPars.at(0); // 0
110  ptp->tob.layerMask = tobPars.at(0); // 0x7
111  ptp->tob.rod_fw_bwMask = tobPars.at(0); // 0x3
112  ptp->tob.rodMask = tobPars.at(0); // 0x7F
113  ptp->tob.moduleMask = tobPars.at(0); // 0x7
114  ptp->tob.sterMask = tobPars.at(0); // 0x3
115 
116  if( mydbservice->isNewTagRequest( "PTrackerParametersRcd" ))
117  {
118  mydbservice->createNewIOV<PTrackerParameters>( ptp, mydbservice->beginOfTime(), mydbservice->endOfTime(), "PTrackerParametersRcd" );
119  } else
120  {
121  edm::LogError( "PTrackerParametersDBBuilder" ) << "PTrackerParameters and PTrackerParametersRcd Tag already present";
122  }
123 }
assert(m_qm.get())
std::vector< int > dbl_to_int(const std::vector< double > &vecdbl)
Converts a std::vector of doubles to a std::vector of int.
Definition: DDutils.cc:4
bool isNewTagRequest(const std::string &recordName)
bool isAvailable() const
Definition: Service.h:46
void createNewIOV(T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t firstTillTime, const std::string &recordName, bool withlogging=false)
std::vector< double > get(const std::string &)
virtual void PTrackerParametersDBBuilder::endJob ( void  )
inlinevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 16 of file PTrackerParametersDBBuilder.h.

16 {}