Commit 6687b66e authored by Jin Zhang's avatar Jin Zhang
Browse files

rename private function

parent a7fb323d
Pipeline #1532362 passed with stages
in 20 minutes and 53 seconds
......@@ -77,7 +77,7 @@ Detector::Detector(const Configuration& config) : m_role(DetectorRole::NONE) {
}
}
std::shared_ptr<Detector> corryvreckan::Detector::Factory(const Configuration& config) {
std::shared_ptr<Detector> corryvreckan::Detector::factory(const Configuration& config) {
// default coordinate is cartesian coordinate
std::string coordinates = config.get<std::string>("coordinates", "cartesian");
std::transform(coordinates.begin(), coordinates.end(), coordinates.begin(), ::tolower);
......@@ -117,7 +117,7 @@ bool Detector::isAuxiliary() const {
}
// Functions to set and check channel masking
void Detector::setMaskFile(std::string file) {
void Detector::set_mask_file(std::string file) {
m_maskfile = file;
}
......@@ -154,7 +154,7 @@ Configuration Detector::getConfiguration() const {
config.set("time_resolution", m_timeResolution, {"ns", "us", "ms", "s"});
// different for PixelDetector and StripDetector
this->configurePosAndOrientation(config);
this->configure_pos_and_orientation(config);
// material budget
if(m_materialBudget > std::numeric_limits<double>::epsilon()) {
......@@ -163,7 +163,7 @@ Configuration Detector::getConfiguration() const {
// only if detector is not auxiliary:
if(!this->isAuxiliary()) {
this->configureDetector(config);
this->configure_detector(config);
}
return config;
......
......@@ -85,7 +85,7 @@ namespace corryvreckan {
* @param config Configuration object describing the detector
* @return shared_ptr that contains the real detector
*/
static std::shared_ptr<Detector> Factory(const Configuration& config);
static std::shared_ptr<Detector> factory(const Configuration& config);
/**
* @brief Get type of the detector
......@@ -312,18 +312,18 @@ namespace corryvreckan {
// Build axis, for devices which are not auxiliary
// Different in Pixel/Strip Detector
virtual void buildAxes(const Configuration& config) = 0;
virtual void build_axes(const Configuration& config) = 0;
// Config detector, for devices which are not auxiliary
// Different in Pixel/Strip Detector
virtual void configureDetector(Configuration& config) const = 0;
virtual void configure_detector(Configuration& config) const = 0;
// Set position, orientation, mode of detector
// Different in Pixel/Strip Detector
virtual void configurePosAndOrientation(Configuration& config) const = 0;
virtual void configure_pos_and_orientation(Configuration& config) const = 0;
// Functions to set and check channel masking
void setMaskFile(std::string file);
virtual void processMaskFile() = 0;
void set_mask_file(std::string file);
virtual void process_mask_file() = 0;
// Detector information
std::string m_detectorType;
......
......@@ -32,11 +32,11 @@ PixelDetector::PixelDetector(const Configuration& config) : Detector(config) {
// Auxiliary devices don't have: number_of_pixels, pixel_pitch, spatial_resolution, mask_file, region-of-interest
if(!isAuxiliary()) {
buildAxes(config);
build_axes(config);
}
}
void PixelDetector::buildAxes(const Configuration& config) {
void PixelDetector::build_axes(const Configuration& config) {
m_nPixels = config.get<ROOT::Math::DisplacementVector2D<Cartesian2D<int>>>("number_of_pixels");
// Size of the pixels:
......@@ -65,8 +65,8 @@ void PixelDetector::buildAxes(const Configuration& config) {
m_maskfile_name = config.get<std::string>("mask_file");
std::string mask_file = config.getPath("mask_file");
LOG(DEBUG) << "Adding mask to detector \"" << config.getName() << "\", reading from " << mask_file;
setMaskFile(mask_file);
processMaskFile();
set_mask_file(mask_file);
process_mask_file();
}
}
......@@ -82,7 +82,7 @@ void PixelDetector::SetPostionAndOrientation(const Configuration& config) {
LOG(TRACE) << " Orientation: " << Units::display(m_orientation, {"deg"}) << " (" << m_orientation_mode << ")";
}
void PixelDetector::processMaskFile() {
void PixelDetector::process_mask_file() {
// Open the file with masked pixels
std::ifstream inputMaskFile(m_maskfile, std::ios::in);
if(!inputMaskFile.is_open()) {
......@@ -167,7 +167,7 @@ void PixelDetector::initialise() {
}
// Only if detector is not auxiliary
void PixelDetector::configureDetector(Configuration& config) const {
void PixelDetector::configure_detector(Configuration& config) const {
// Number of pixels
config.set("number_of_pixels", m_nPixels);
......@@ -187,7 +187,7 @@ void PixelDetector::configureDetector(Configuration& config) const {
config.setMatrix("roi", m_roi);
}
void PixelDetector::configurePosAndOrientation(Configuration& config) const {
void PixelDetector::configure_pos_and_orientation(Configuration& config) const {
config.set("position", m_displacement, {"um", "mm"});
config.set("orientation_mode", m_orientation_mode);
config.set("orientation", m_orientation, {"deg"});
......
......@@ -173,18 +173,18 @@ namespace corryvreckan {
// Build axis, for devices which are not auxiliary
// Different in Pixel/Strip Detector
void buildAxes(const Configuration& config) override;
void build_axes(const Configuration& config) override;
// Config detector, for devices which are not auxiliary
// Different in Pixel/Strip Detector
void configureDetector(Configuration& config) const override;
void configure_detector(Configuration& config) const override;
// Config position, orientation, mode of detector
// Different in Pixel/Strip Detector
void configurePosAndOrientation(Configuration& config) const override;
void configure_pos_and_orientation(Configuration& config) const override;
// Functions to set and check channel masking
void processMaskFile() override;
void process_mask_file() override;
// Seems to be used in other coordinate
inline static int isLeft(std::pair<int, int> pt0, std::pair<int, int> pt1, std::pair<int, int> pt2);
......
......@@ -63,7 +63,7 @@ void ModuleManager::load_detectors() {
LOG_PROGRESS(STATUS, "DET_LOAD_LOOP") << "Loading detector " << name;
// the default coordinates is cartesian, any other type is forbidden now
// @to do: other detector types, e.g., ATLAS endcap strip detector
auto detector = Detector::Factory(detector_section);
auto detector = Detector::factory(detector_section);
// Check if we already found a reference plane:
if(m_reference != nullptr && detector->isReference()) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment