Belle II Software  release-05-01-25
read_svd_online_map.cc
1 #include <stdio.h>
2 #include <svd/online/SVDOnlineToOfflineMap.h>
3 #include <svd/dataobjects/SVDShaperDigit.h>
4 #include <vxd/dataobjects/VxdID.h>
5 #include <svd/dataobjects/SVDModeByte.h>
6 
7 int
8 main(int argc, char** argv)
9 {
10  if (argc != 2) {
11  printf("Hello! Hello!\n");
12  printf("Usage: %s filename.xml\n read filename.xml\n", argv[0]);
13  return 0;
14  }
15 
16  Belle2::SVDOnlineToOfflineMap test(argv[1]);
17  short sample[6] = {0, 0, 0, 10000, 0, 0};
18  Belle2::SVDModeByte svdModeByte = Belle2::SVDModeByte(2, 0, 2, 0);
19  Belle2::SVDShaperDigit* digit = test.NewShaperDigit(129, 6, 119, sample, 100, svdModeByte);
20  printf("Layer/Ladder/Sensor: %i/%i/%i ",
21  digit->getSensorID().getLayerNumber(),
22  digit->getSensorID().getLadderNumber(),
23  digit->getSensorID().getSensorNumber());
24  printf("%s", digit->isUStrip() ? "u" : "v");
25  printf("-strip: %i ", digit->getCellID());
26  printf("MaxCharge: %f ", double(digit->getMaxADCCounts()));
27  //printf("Time: %i ", digit->getIndex());
28  printf("\n");
29 
30  printf("Find (layer, ladder, sensor, side, strip) for (FADC, APV, channel)\n");
31  auto info = test.getSensorInfo(129, 6);
32  short strip = test.getStripNumber(119, info);
33  printf("Layer/Ladder/Sensor: %i/%i/%i ",
34  info.m_sensorID.getLayerNumber(),
35  info.m_sensorID.getLadderNumber(),
36  info.m_sensorID.getSensorNumber()
37  );
38  printf("%s", info.m_uSide ? "u" : "v");
39  printf("-strip: %i ", strip);
40  printf("\n");
41 
42 }
Belle2::SVDShaperDigit::getSensorID
VxdID getSensorID() const
Get the sensor ID.
Definition: SVDShaperDigit.h:116
Belle2::VxdID::getLadderNumber
baseType getLadderNumber() const
Get the ladder id.
Definition: VxdID.h:108
Belle2::SVDModeByte
Class to store SVD mode information.
Definition: SVDModeByte.h:79
Belle2::SVDShaperDigit
The SVD ShaperDigit class.
Definition: SVDShaperDigit.h:46
Belle2::SVDShaperDigit::getMaxADCCounts
int getMaxADCCounts() const
Get the ADC counts corresponding to the higher sample amplitude.
Definition: SVDShaperDigit.h:162
main
int main(int argc, char **argv)
Run all tests.
Definition: test_main.cc:77
Belle2::VxdID::getSensorNumber
baseType getSensorNumber() const
Get the sensor id.
Definition: VxdID.h:110
Belle2::SVDOnlineToOfflineMap
This class implements the methods to map raw SVD hits to BASF2 SVD hits.
Definition: SVDOnlineToOfflineMap.h:47
Belle2::SVDShaperDigit::getCellID
short int getCellID() const
Get strip ID.
Definition: SVDShaperDigit.h:132
Belle2::VxdID::getLayerNumber
baseType getLayerNumber() const
Get the layer id.
Definition: VxdID.h:106
Belle2::SVDShaperDigit::isUStrip
bool isUStrip() const
Get strip direction.
Definition: SVDShaperDigit.h:127