CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions
PGeometricDetBuilder Class Reference
Inheritance diagram for PGeometricDetBuilder:
edm::one::EDAnalyzer< edm::one::WatchRuns > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (edm::Event const &iEvent, edm::EventSetup const &) override
 
void beginRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
void endRun (edm::Run const &iEvent, edm::EventSetup const &) override
 
 PGeometricDetBuilder (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::WatchRuns >
 EDAnalyzer ()=default
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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 putOne (const GeometricDet *gd, PGeometricDet *pgd, int lev)
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 18 of file PGeometricDetBuilder.cc.

Constructor & Destructor Documentation

◆ PGeometricDetBuilder()

PGeometricDetBuilder::PGeometricDetBuilder ( const edm::ParameterSet )
inline

Definition at line 20 of file PGeometricDetBuilder.cc.

20 {}

Member Function Documentation

◆ analyze()

void PGeometricDetBuilder::analyze ( edm::Event const &  iEvent,
edm::EventSetup const &   
)
inlineoverridevirtual

Implements edm::one::EDAnalyzerBase.

Definition at line 23 of file PGeometricDetBuilder.cc.

23 {}

◆ beginRun()

void PGeometricDetBuilder::beginRun ( edm::Run const &  iEvent,
edm::EventSetup const &  es 
)
override

Definition at line 30 of file PGeometricDetBuilder.cc.

30  {
31  PGeometricDet* pgd = new PGeometricDet;
33  if (!mydbservice.isAvailable()) {
34  edm::LogError("PGeometricDetBuilder") << "PoolDBOutputService unavailable";
35  return;
36  }
39  es.get<IdealGeometryRecord>().get(pDD);
40  es.get<IdealGeometryRecord>().get(rDD);
41  const GeometricDet* tracker = &(*rDD);
42 
43  // so now I have the tracker itself. loop over all its components to store them.
44  putOne(tracker, pgd, 0);
45  std::vector<const GeometricDet*> tc = tracker->components();
46  std::vector<const GeometricDet*>::const_iterator git = tc.begin();
47  std::vector<const GeometricDet*>::const_iterator egit = tc.end();
48  int count = 0;
49  int lev = 1;
50  for (; git != egit; ++git) { // one level below "tracker"
51  putOne(*git, pgd, lev);
52  std::vector<const GeometricDet*> inone = (*git)->components();
53  if (inone.empty())
54  ++count;
55  std::vector<const GeometricDet*>::const_iterator git2 = inone.begin();
56  std::vector<const GeometricDet*>::const_iterator egit2 = inone.end();
57  ++lev;
58  for (; git2 != egit2; ++git2) { // level 2
59  putOne(*git2, pgd, lev);
60  std::vector<const GeometricDet*> intwo = (*git2)->components();
61  if (intwo.empty())
62  ++count;
63  std::vector<const GeometricDet*>::const_iterator git3 = intwo.begin();
64  std::vector<const GeometricDet*>::const_iterator egit3 = intwo.end();
65  ++lev;
66  for (; git3 != egit3; ++git3) { // level 3
67  putOne(*git3, pgd, lev);
68  std::vector<const GeometricDet*> inthree = (*git3)->components();
69  if (inthree.empty())
70  ++count;
71  std::vector<const GeometricDet*>::const_iterator git4 = inthree.begin();
72  std::vector<const GeometricDet*>::const_iterator egit4 = inthree.end();
73  ++lev;
74  for (; git4 != egit4; ++git4) { //level 4
75  putOne(*git4, pgd, lev);
76  std::vector<const GeometricDet*> infour = (*git4)->components();
77  if (infour.empty())
78  ++count;
79  std::vector<const GeometricDet*>::const_iterator git5 = infour.begin();
80  std::vector<const GeometricDet*>::const_iterator egit5 = infour.end();
81  ++lev;
82  for (; git5 != egit5; ++git5) { // level 5
83  putOne(*git5, pgd, lev);
84  std::vector<const GeometricDet*> infive = (*git5)->components();
85  if (infive.empty())
86  ++count;
87  std::vector<const GeometricDet*>::const_iterator git6 = infive.begin();
88  std::vector<const GeometricDet*>::const_iterator egit6 = infive.end();
89  ++lev;
90  for (; git6 != egit6; ++git6) { //level 6
91  putOne(*git6, pgd, lev);
92  std::vector<const GeometricDet*> insix = (*git6)->components();
93  if (insix.empty())
94  ++count;
95  } // level 6
96  --lev;
97  } // level 5
98  --lev;
99  } // level 4
100  --lev;
101  } //level 3
102  --lev;
103  } // level 2
104  --lev;
105  }
106  std::vector<const GeometricDet*> modules = tracker->deepComponents();
107  if (mydbservice->isNewTagRequest("IdealGeometryRecord")) {
108  mydbservice->createNewIOV<PGeometricDet>(
109  pgd, mydbservice->beginOfTime(), mydbservice->endOfTime(), "IdealGeometryRecord");
110  } else {
111  edm::LogError("PGeometricDetBuilder") << "PGeometricDetBuilder Tag already present";
112  }
113 }

References cond::service::PoolDBOutputService::beginOfTime(), KineDebug3::count(), cond::service::PoolDBOutputService::createNewIOV(), cond::service::PoolDBOutputService::endOfTime(), edm::EventSetup::get(), get, edm::Service< T >::isAvailable(), cond::service::PoolDBOutputService::isNewTagRequest(), putOne(), and PbPb_ZMuSkimMuonDPG_cff::tracker.

◆ endRun()

void PGeometricDetBuilder::endRun ( edm::Run const &  iEvent,
edm::EventSetup const &   
)
inlineoverride

Definition at line 24 of file PGeometricDetBuilder.cc.

24 {}

◆ putOne()

void PGeometricDetBuilder::putOne ( const GeometricDet gd,
PGeometricDet pgd,
int  lev 
)
private

Definition at line 115 of file PGeometricDetBuilder.cc.

115  {
117  const DDTranslation& tran = gd->translation();
118  const DDRotationMatrix& rot = gd->rotation();
119  DD3Vector x, y, z;
120  rot.GetComponents(x, y, z);
121  item._name = gd->name();
122  item._ns = std::string();
123  item._level = lev;
124  item._x = tran.X();
125  item._y = tran.Y();
126  item._z = tran.Z();
127  item._phi = gd->phi();
128  item._rho = gd->rho();
129  item._a11 = x.X();
130  item._a12 = y.X();
131  item._a13 = z.X();
132  item._a21 = x.Y();
133  item._a22 = y.Y();
134  item._a23 = z.Y();
135  item._a31 = x.Z();
136  item._a32 = y.Z();
137  item._a33 = z.Z();
138  item._shape = static_cast<int>(gd->shape());
139  item._type = gd->type();
140  if (gd->shape() == DDSolidShape::ddbox) {
141  item._params0 = gd->params()[0];
142  item._params1 = gd->params()[1];
143  item._params2 = gd->params()[2];
144  item._params3 = 0;
145  item._params4 = 0;
146  item._params5 = 0;
147  item._params6 = 0;
148  item._params7 = 0;
149  item._params8 = 0;
150  item._params9 = 0;
151  item._params10 = 0;
152  } else if (gd->shape() == DDSolidShape::ddtrap) {
153  item._params0 = gd->params()[0];
154  item._params1 = gd->params()[1];
155  item._params2 = gd->params()[2];
156  item._params3 = gd->params()[3];
157  item._params4 = gd->params()[4];
158  item._params5 = gd->params()[5];
159  item._params6 = gd->params()[6];
160  item._params7 = gd->params()[7];
161  item._params8 = gd->params()[8];
162  item._params9 = gd->params()[9];
163  item._params10 = gd->params()[10];
164  } else {
165  item._params0 = 0;
166  item._params1 = 0;
167  item._params2 = 0;
168  item._params3 = 0;
169  item._params4 = 0;
170  item._params5 = 0;
171  item._params6 = 0;
172  item._params7 = 0;
173  item._params8 = 0;
174  item._params9 = 0;
175  item._params10 = 0;
176  }
177  item._geographicalID = gd->geographicalID();
178  item._radLength = gd->radLength();
179  item._xi = gd->xi();
180  item._pixROCRows = gd->pixROCRows();
181  item._pixROCCols = gd->pixROCCols();
182  item._pixROCx = gd->pixROCx();
183  item._pixROCy = gd->pixROCy();
184  item._stereo = gd->stereo();
185  item._siliconAPVNum = gd->siliconAPVNum();
186 
187  GeometricDet::nav_type const& nt = gd->navType();
188  size_t nts = nt.size();
189  item._numnt = nts;
190  std::vector<int> tempnt(nt.begin(), nt.end());
191  for (size_t extrant = nt.size(); extrant < 11; ++extrant) {
192  tempnt.push_back(-1);
193  }
194  item._nt0 = tempnt[0];
195  item._nt1 = tempnt[1];
196  item._nt2 = tempnt[2];
197  item._nt3 = tempnt[3];
198  item._nt4 = tempnt[4];
199  item._nt5 = tempnt[5];
200  item._nt6 = tempnt[6];
201  item._nt7 = tempnt[7];
202  item._nt8 = tempnt[8];
203  item._nt9 = tempnt[9];
204  item._nt10 = tempnt[10];
205 
206  pgd->pgeomdets_.push_back(item);
207 }

References ddbox, ddtrap, GeometricDet::geographicalID(), B2GTnPMonitor_cfi::item, GeometricDet::name(), GeometricDet::navType(), nt, GeometricDet::params(), PGeometricDet::pgeomdets_, GeometricDet::phi(), GeometricDet::pixROCCols(), GeometricDet::pixROCRows(), GeometricDet::pixROCx(), GeometricDet::pixROCy(), GeometricDet::radLength(), GeometricDet::rho(), makeMuonMisalignmentScenario::rot, GeometricDet::rotation(), GeometricDet::shape(), GeometricDet::siliconAPVNum(), GeometricDet::stereo(), AlCaHLTBitMon_QueryRunRegistry::string, GeometricDet::translation(), GeometricDet::type(), x, GeometricDet::xi(), y, and z.

Referenced by beginRun().

GeometricDet::phi
double phi() const
Definition: GeometricDet.h:121
DDAxes::y
DDSolidShape::ddtrap
cond::service::PoolDBOutputService::beginOfTime
cond::Time_t beginOfTime() const
Definition: PoolDBOutputService.cc:187
GeometricDet::type
GeometricEnumType type() const
Definition: GeometricDet.h:125
nt
int nt
Definition: AMPTWrapper.h:42
modules
Definition: ZHLTMatchFilter.cc:17
GeometricDet::navType
nav_type const & navType() const
Definition: GeometricDet.h:129
PGeometricDetBuilder::putOne
void putOne(const GeometricDet *gd, PGeometricDet *pgd, int lev)
Definition: PGeometricDetBuilder.cc:115
DDAxes::x
edm::Service::isAvailable
bool isAvailable() const
Definition: Service.h:40
DDRotationMatrix
ROOT::Math::Rotation3D DDRotationMatrix
A DDRotationMatrix is currently implemented with a ROOT Rotation3D.
Definition: DDRotationMatrix.h:8
DD3Vector
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DD3Vector
A DD Translation is currently implemented with Root Vector3D.
Definition: DDTranslation.h:6
GeometricDet::rotation
RotationMatrix const & rotation() const
Definition: GeometricDet.h:119
GeometricDet::shape
DDSolidShape const & shape() const
Definition: GeometricDet.h:124
cond::service::PoolDBOutputService::createNewIOV
void createNewIOV(const T *firstPayloadObj, cond::Time_t firstSinceTime, cond::Time_t, const std::string &recordName)
Definition: PoolDBOutputService.h:110
DDTranslation
ROOT::Math::DisplacementVector3D< ROOT::Math::Cartesian3D< double > > DDTranslation
Definition: DDTranslation.h:7
DDAxes::z
edm::ESHandle< GeometricDet >
GeometricDet
Definition: GeometricDet.h:30
GeometricDet::radLength
double radLength() const
Definition: GeometricDet.h:171
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
PGeometricDet::Item
Definition: PGeometricDet.h:14
PbPb_ZMuSkimMuonDPG_cff.tracker
tracker
Definition: PbPb_ZMuSkimMuonDPG_cff.py:60
GeometricDet::stereo
bool stereo() const
Definition: GeometricDet.h:184
GeometricDet::nav_type
DDExpandedView::nav_type nav_type
Definition: GeometricDet.h:43
edm::LogError
Definition: MessageLogger.h:183
KineDebug3::count
void count()
Definition: KinematicConstrainedVertexUpdatorT.h:21
GeometricDet::pixROCRows
double pixROCRows() const
Definition: GeometricDet.h:176
GeometricDet::geographicalID
DetId geographicalID() const
Definition: GeometricDet.h:153
edm::Service< cond::service::PoolDBOutputService >
GeometricDet::pixROCx
double pixROCx() const
Definition: GeometricDet.h:178
B2GTnPMonitor_cfi.item
item
Definition: B2GTnPMonitor_cfi.py:147
get
#define get
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
GeometricDet::rho
double rho() const
Definition: GeometricDet.h:122
cond::service::PoolDBOutputService::endOfTime
cond::Time_t endOfTime() const
Definition: PoolDBOutputService.cc:185
DDSolidShape::ddbox
GeometricDet::params
std::vector< double > const & params() const
Definition: GeometricDet.h:131
GeometricDet::siliconAPVNum
double siliconAPVNum() const
Definition: GeometricDet.h:185
GeometricDet::pixROCCols
double pixROCCols() const
Definition: GeometricDet.h:177
makeMuonMisalignmentScenario.rot
rot
Definition: makeMuonMisalignmentScenario.py:322
GeometricDet::xi
double xi() const
Definition: GeometricDet.h:172
GeometricDet::pixROCy
double pixROCy() const
Definition: GeometricDet.h:179
cond::service::PoolDBOutputService::isNewTagRequest
bool isNewTagRequest(const std::string &recordName)
Definition: PoolDBOutputService.cc:100
GeometricDet::name
std::string const & name() const
Definition: GeometricDet.h:126
GeometricDet::translation
Translation const & translation() const
Definition: GeometricDet.h:120
PGeometricDet::pgeomdets_
std::vector< Item > pgeomdets_
Definition: PGeometricDet.h:50
PGeometricDet
Definition: PGeometricDet.h:9
IdealGeometryRecord
Definition: IdealGeometryRecord.h:27