Belle II Software development
VXDGlobalParamInterface Class Reference

Very tentative interface for VXD. More...

#include <GlobalParam.h>

Inheritance diagram for VXDGlobalParamInterface:
IGlobalParamInterface

Public Types

enum  E_VXDHierarchyType {
  c_None = 0 ,
  c_Flat = 1 ,
  c_HalfShells = 2 ,
  c_Full = 3
}
 Type of VXD hierarchy. More...
 

Public Member Functions

virtual void setupAlignmentHierarchy (GlobalDerivativesHierarchy &hierarchy) override final
 Very tentaive function: not yet used.
 
virtual void readFromResult (std::vector< std::tuple< unsigned short, unsigned short, unsigned short, double > > &, GlobalParamVector &)
 Implement this to be called after Millepede finishes and all global parameters are filled in DB objects (which allow this) in GlobalParam.
 

Static Public Attributes

static E_VXDHierarchyType s_hierarchyType
 What type of hierarchy to use for VXD?
 
static bool s_enablePXD = true
 Enable PXD in hierarchy?
 
static bool s_enableSVD = true
 Enable SVD in hierarchy?
 

Detailed Description

Very tentative interface for VXD.

Definition at line 73 of file GlobalParam.h.

Member Enumeration Documentation

◆ E_VXDHierarchyType

Type of VXD hierarchy.

Definition at line 76 of file GlobalParam.h.

76 {
77 c_None = 0,
78 c_Flat = 1,
79 c_HalfShells = 2,
80 c_Full = 3
81 };

Member Function Documentation

◆ readFromResult()

virtual void readFromResult ( std::vector< std::tuple< unsigned short, unsigned short, unsigned short, double > > &  ,
GlobalParamVector  
)
inlinevirtualinherited

Implement this to be called after Millepede finishes and all global parameters are filled in DB objects (which allow this) in GlobalParam.

The function takes two parameters, both of which are unused thus no name is given First parameter: Vector with a tuple representing <unique id, element, param, value> per result Second parameter: The GlobalParamVector which you have to update, extend or just read jsu after it is filled automatically (for DB objects which support it) and before its DBObjects are stored back into DB.

Definition at line 60 of file GlobalParam.h.

61 {};

◆ setupAlignmentHierarchy()

void setupAlignmentHierarchy ( GlobalDerivativesHierarchy hierarchy)
finaloverridevirtual

Very tentaive function: not yet used.

This simpler hierarchy is as follows: Belle 2 / | | \ Ying Yang Pat Mat ... other sub-detectors / / | / | | \ | \ \ ......... sensors ........

So the hierarchy is as follows: Belle 2 / | | \ Ying Yang Pat Mat ... other sub-detectors / | / | | \ | \ ...... ladders ...... / / | / | | \ | \ \ ......... sensors ........

Reimplemented from IGlobalParamInterface.

Definition at line 166 of file GlobalParam.cc.

167 {
168 try {
169 auto& rigidBodyHierarchy = dynamic_cast<RigidBodyHierarchy&>(hierarchy);
170 auto& geo = VXD::GeoCache::getInstance();
171 // Set-up hierarchy
172 DBObjPtr<VXDAlignment> vxdAlignments;
173 if (s_hierarchyType == c_None) {
174 // Nothing to be done
175 return;
176
177 } else if (s_hierarchyType == c_Flat) {
178 for (auto& sensor : geo.getListOfSensors()) {
179 //TODO: Don't we have better way to distinguish PXD and SVD?
180 // For PXD
181 if (sensor.getLayerNumber() <= 2 and !s_enablePXD)
182 continue;
183 // SVD layer > 2
184 if (sensor.getLayerNumber() > 2 and !s_enableSVD)
185 continue;
186
187 rigidBodyHierarchy.insertTGeoTransform<VXDAlignment, VXDAlignment>(sensor, VxdID(0, 0, 0, 1),
188 geo.getSensorInfo(sensor).getTransformation(true));
189 }
190 } else if (s_hierarchyType == c_HalfShells) {
200 for (auto& halfShellPlacement : geo.getHalfShellPlacements()) {
201 // For PXD
202 if (halfShellPlacement.first.getLayerNumber() <= 2 and !s_enablePXD)
203 continue;
204 // for SVD - layer > 2
205 if (halfShellPlacement.first.getLayerNumber() > 2 and !s_enableSVD)
206 continue;
207
208 TGeoHMatrix trafoHalfShell = halfShellPlacement.second;
209 trafoHalfShell *= geo.getTGeoFromRigidBodyParams(
210 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dU),
211 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dV),
212 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dW),
213 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dAlpha),
214 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dBeta),
215 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dGamma)
216 );
217 rigidBodyHierarchy.insertTGeoTransform<VXDAlignment, alignment::EmptyGlobalParamSet>(halfShellPlacement.first, 0, trafoHalfShell);
218
219 for (auto& ladderPlacement : geo.getLadderPlacements(halfShellPlacement.first)) {
220 // Updated trafo
221 TGeoHMatrix trafoLadder = ladderPlacement.second;
222 trafoLadder *= geo.getTGeoFromRigidBodyParams(
223 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dU),
224 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dV),
225 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dW),
226 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dAlpha),
227 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dBeta),
228 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dGamma)
229 );
230 // Do not insert ladder, but insert sensor directly into half-shells bellow, with the additional transformation from ladder
231 //rigidBodyHierarchy.insertTGeoTransform<VXDAlignment, VXDAlignment>(ladderPlacement.first, halfShellPlacement.first, trafoLadder);
232
233 for (auto& sensorPlacement : geo.getSensorPlacements(ladderPlacement.first)) {
234 // Updated trafo
235 TGeoHMatrix trafoSensor = sensorPlacement.second;
236 trafoSensor *= geo.getTGeoFromRigidBodyParams(
237 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dU),
238 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dV),
239 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dW),
240 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dAlpha),
241 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dBeta),
242 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dGamma)
243 );
244 rigidBodyHierarchy.insertTGeoTransform<VXDAlignment, VXDAlignment>(sensorPlacement.first, halfShellPlacement.first,
245 trafoLadder * trafoSensor);
246
247
248 }
249 }
250 }
251 } else if (s_hierarchyType == c_Full) {
263 for (auto& halfShellPlacement : geo.getHalfShellPlacements()) {
264 // For PXD
265 if (halfShellPlacement.first.getLayerNumber() <= 2 and !s_enablePXD)
266 continue;
267 // for SVD - layer > 2
268 if (halfShellPlacement.first.getLayerNumber() > 2 and !s_enableSVD)
269 continue;
270
271 TGeoHMatrix trafoHalfShell = halfShellPlacement.second;
272 trafoHalfShell *= geo.getTGeoFromRigidBodyParams(
273 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dU),
274 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dV),
275 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dW),
276 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dAlpha),
277 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dBeta),
278 vxdAlignments->get(halfShellPlacement.first, VXDAlignment::dGamma)
279 );
280 rigidBodyHierarchy.insertTGeoTransform<VXDAlignment, alignment::EmptyGlobalParamSet>(halfShellPlacement.first, 0, trafoHalfShell);
281
282 for (auto& ladderPlacement : geo.getLadderPlacements(halfShellPlacement.first)) {
283 // Updated trafo
284 TGeoHMatrix trafoLadder = ladderPlacement.second;
285 trafoLadder *= geo.getTGeoFromRigidBodyParams(
286 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dU),
287 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dV),
288 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dW),
289 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dAlpha),
290 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dBeta),
291 vxdAlignments->get(ladderPlacement.first, VXDAlignment::dGamma)
292 );
293 rigidBodyHierarchy.insertTGeoTransform<VXDAlignment, VXDAlignment>(ladderPlacement.first, halfShellPlacement.first, trafoLadder);
294
295 for (auto& sensorPlacement : geo.getSensorPlacements(ladderPlacement.first)) {
296 // Updated trafo
297 TGeoHMatrix trafoSensor = sensorPlacement.second;
298 trafoSensor *= geo.getTGeoFromRigidBodyParams(
299 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dU),
300 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dV),
301 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dW),
302 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dAlpha),
303 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dBeta),
304 vxdAlignments->get(sensorPlacement.first, VXDAlignment::dGamma)
305 );
306 rigidBodyHierarchy.insertTGeoTransform<VXDAlignment, VXDAlignment>(sensorPlacement.first, ladderPlacement.first, trafoSensor);
307
308
309 }
310 }
311 }
312 }
313 } catch (const std::bad_cast& e) {
314 // Bad cast
315 }
316 }
static const baseType dAlpha
Sensor/layer/ladder alignment in local alpha.
Definition: VXDAlignment.h:29
static const baseType dGamma
Sensor/layer/ladder alignment in local gamma.
Definition: VXDAlignment.h:33
static const baseType dW
Sensor/layer/ladder alignment in local w.
Definition: VXDAlignment.h:27
static const baseType dBeta
Sensor/layer/ladder alignment in local beta.
Definition: VXDAlignment.h:31
static const baseType dU
Sensor/layer/ladder alignment in local u.
Definition: VXDAlignment.h:23
static const baseType dV
Sensor/layer/ladder alignment in local v.
Definition: VXDAlignment.h:25
static GeoCache & getInstance()
Return a reference to the singleton instance.
Definition: GeoCache.cc:214
static bool s_enablePXD
Enable PXD in hierarchy?
Definition: GlobalParam.h:85
static bool s_enableSVD
Enable SVD in hierarchy?
Definition: GlobalParam.h:87
static E_VXDHierarchyType s_hierarchyType
What type of hierarchy to use for VXD?
Definition: GlobalParam.h:83

Member Data Documentation

◆ s_enablePXD

bool s_enablePXD = true
static

Enable PXD in hierarchy?

Definition at line 85 of file GlobalParam.h.

◆ s_enableSVD

bool s_enableSVD = true
static

Enable SVD in hierarchy?

Definition at line 87 of file GlobalParam.h.

◆ s_hierarchyType

Initial value:
=
VXDGlobalParamInterface::E_VXDHierarchyType::c_Full

What type of hierarchy to use for VXD?

Definition at line 83 of file GlobalParam.h.


The documentation for this class was generated from the following files: