12#include <vxd/dataobjects/VxdID.h>
24 const unsigned short maxLayer = 5;
25 const unsigned short minLayer = 2;
26 const unsigned short nLayer = maxLayer - minLayer + 1;
27 const unsigned short nLadder_L3 = 7;
28 const unsigned short nLadder_L4 = 10;
29 const unsigned short nLadder_L5 = 12;
30 const unsigned short nLadder_L6 = 16;
31 const unsigned short nLadder[nLayer] =
32 {nLadder_L3, nLadder_L4, nLadder_L5, nLadder_L6};
33 const unsigned short nSensor_L3 = 2;
34 const unsigned short nSensor_L4 = 3;
35 const unsigned short nSensor_L5 = 4;
36 const unsigned short nSensor_L6 = 5;
37 const unsigned short nSensor[nLayer] =
38 {nSensor_L3, nSensor_L4, nSensor_L5, nSensor_L6};
40 const unsigned short nPN = 2;
41 const unsigned short maxStrip = 768;
43 const unsigned short maxSample = 6;
45 const unsigned short NApvPerHybrid = 6;
47 const unsigned short nSensorID =
48 (
unsigned short)(nSensor_L3 * nLadder_L3 +
49 nSensor_L4 * nLadder_L4 +
50 nSensor_L5 * nLadder_L5 +
51 nSensor_L6* nLadder_L6) * nPN;
54 short getSVDSensorID(
const unsigned short layer,
55 const unsigned short ladder,
56 const unsigned short sensor,
57 const unsigned short pn)
60 if (layer < minLayer || maxLayer < layer || 2 <= pn) {
64 short sensor_id_base = 0;
67 if (nLadder[0] <= ladder || nSensor[0] <= sensor)
return -2;
68 return nPN * nSensor[0] * ladder + nPN * sensor + pn;
71 sensor_id_base += nPN * nSensor[0] * nLadder[0];
73 if (nLadder[1] <= ladder || nSensor[1] <= sensor)
return -3;
74 return sensor_id_base + nPN * nSensor[1] * ladder + nPN * sensor + pn;
77 sensor_id_base += nPN * nSensor[1] * nLadder[1];
79 if (nLadder[2] <= ladder || nSensor[2] <= sensor)
return -4;
80 return sensor_id_base + nPN * nSensor[2] * ladder + nPN * sensor + pn;
83 sensor_id_base += nPN * nSensor[2] * nLadder[2];
85 if (nLadder[3] <= ladder || nSensor[3] <= sensor)
return -5;
86 return sensor_id_base + nPN * nSensor[3] * ladder + nPN * sensor + pn;
92 short getSVDSensorID(VxdID
id,
bool is_u)
94 unsigned short layer =
id.getLayerNumber() - 1;
95 unsigned short ladder =
id.getLadderNumber();
97 unsigned short sensor = 0;
100 unsigned short pn = (is_u) ? 0 : 1;
104 return getSVDSensorID(layer, ladder, sensor, pn);
Abstract base class for different kinds of events.