Belle II Software development
ClusterQualityHelperFunctions.h
1/**************************************************************************
2 * basf2 (Belle II Analysis Software Framework) *
3 * Author: The Belle II Collaboration *
4 * *
5 * See git log for contributors and copyright holders. *
6 * This file is licensed under LGPL-3.0, see LICENSE.md. *
7 **************************************************************************/
8
9#pragma once
10
11#include <vxd/dataobjects/VxdID.h>
12
13namespace Belle2 {
24 inline void clusterPDFName(const VxdID& sensor, int size, int side, int maxClusterSize, std::string& PDFName,
25 std::string& errorPDFName, bool useLegacyNaming)
26 {
27 if (useLegacyNaming == true) {
28 std::string sensorSide;
29 if (side == 1) sensorSide = "u";
30 if (side == 0) sensorSide = "v";
31
32 if (size > maxClusterSize) size = maxClusterSize;
33 std::string sensorName;
34 if (sensor.getLayerNumber() == 3) sensorName = "l3";
35 if (sensor.getLayerNumber() > 3 && sensor.getSensorNumber() == 1) sensorName = "trap";
36 if (sensor.getLayerNumber() > 3 && sensor.getSensorNumber() > 1) sensorName = "large";
37
38 PDFName = sensorSide + sensorName + std::to_string(size);
39 errorPDFName = PDFName + "Error";
40 } else {
41
42 std::string sensorSide;
43 if (side == 1) sensorSide = "u";
44 if (side == 0) sensorSide = "v";
45 int layer = sensor.getLayerNumber();
46 int ladder = sensor.getLadderNumber();
47 int sens = sensor.getSensorNumber();
48
49 if (size > maxClusterSize) size = maxClusterSize;
50
51 PDFName = std::to_string(layer) + "." + std::to_string(ladder) + "." + std::to_string(sens) + "." + sensorSide + "." +
52 std::to_string(size);
53 errorPDFName = PDFName + "_Error";
54
55 }
56 }
58} //Belle2 namespace
Class to uniquely identify a any structure of the PXD and SVD.
Definition: VxdID.h:33
void clusterPDFName(const VxdID &sensor, int size, int side, int maxClusterSize, std::string &PDFName, std::string &errorPDFName, bool useLegacyNaming)
Function to set name of PDF for cluster quality estimation.
Abstract base class for different kinds of events.