Commit 61c6c874 authored by Jin Zhang's avatar Jin Zhang
Browse files

3 is function rename

parent 88cb935b
......@@ -136,15 +136,15 @@ XYVector Detector::size() const {
return XYVector(m_pitch.X() * m_nPixels.X(), m_pitch.Y() * m_nPixels.Y());
}
bool Detector::isReference() const {
bool Detector::IsReference() const {
return static_cast<bool>(m_role & DetectorRole::REFERENCE);
}
bool Detector::isDUT() const {
bool Detector::IsDUT() const {
return static_cast<bool>(m_role & DetectorRole::DUT);
}
bool Detector::isAuxiliary() const {
bool Detector::IsAuxiliary() const {
return static_cast<bool>(m_role & DetectorRole::AUXILIARY);
}
......@@ -165,13 +165,13 @@ Configuration Detector::getConfiguration() const {
// Store the role of the detector
std::vector<std::string> roles;
if(this->isDUT()) {
if(this->IsDUT()) {
roles.push_back("dut");
}
if(this->isReference()) {
if(this->IsReference()) {
roles.push_back("reference");
}
if(this->isAuxiliary()) {
if(this->IsAuxiliary()) {
roles.push_back("auxiliary");
}
......@@ -194,7 +194,7 @@ Configuration Detector::getConfiguration() const {
config.set("material_budget", m_materialBudget);
}
// only if detector is not auxiliary:
if(!this->isAuxiliary()) {
if(!this->IsAuxiliary()) {
this->configureDetector(config);
}
......
......@@ -96,19 +96,19 @@ namespace corryvreckan {
* @brief Check whether detector is registered as reference
* @return Reference status
*/
bool isReference() const;
bool IsReference() const;
/**
* @brief Check whether detector is registered as DUT
* @return DUT status
*/
bool isDUT() const;
bool IsDUT() const;
/**
* @brief Check whether detector is registered as auxiliary device and should not parttake in the reconstruction
* @return Auxiliary status
*/
bool isAuxiliary() const;
bool IsAuxiliary() const;
/**
* @brief Retrieve configuration object from detector, containing all (potentially updated) parameters
......
......@@ -36,7 +36,7 @@ PlanarDetector::PlanarDetector(const Configuration& config) : Detector(config) {
LOG(TRACE) << " Time resolution: " << Units::display(m_timeResolution, {"ms", "us"});
}
// Auxiliary devices don't have: number_of_pixels, pixel_pitch, spatial_resolution, mask_file, region-of-interest
if(!isAuxiliary()) {
if(!IsAuxiliary()) {
buildAxes(config);
}
}
......
......@@ -64,12 +64,12 @@ void ModuleManager::load_detectors() {
std::shared_ptr<Detector> detector = std::make_shared<PlanarDetector>(detector_section);
// Check if we already found a reference plane:
if(m_reference != nullptr && detector->isReference()) {
if(m_reference != nullptr && detector->IsReference()) {
throw InvalidValueError(global_config, "detectors_file", "Found more than one reference detector");
}
// Switch flag if we found the reference plane:
if(detector->isReference()) {
if(detector->IsReference()) {
m_reference = detector;
}
......@@ -457,7 +457,7 @@ ModuleManager::create_detector_modules(void* library, Configuration config, bool
auto identifier = instance.second;
// If this should only be instantiated for DUTs, skip otherwise:
if(dut_only && !detector->isDUT()) {
if(dut_only && !detector->IsDUT()) {
LOG(TRACE) << "Skipping instantiation \"" << identifier.getUniqueName() << "\", detector is no DUT";
continue;
}
......
......@@ -52,7 +52,7 @@ void AlignmentMillepede::initialise() {
// Renumber the planes in Millepede, ignoring masked planes.
unsigned int index = 0;
for(const auto& det : get_detectors()) {
if(det->isDUT() && m_excludeDUT) {
if(det->IsDUT() && m_excludeDUT) {
continue;
}
m_millePlanes[det->Name()] = index;
......@@ -101,10 +101,10 @@ void AlignmentMillepede::finalise() {
size_t nPlanes = num_detectors();
for(const auto& det : get_detectors()) {
if(det->isDUT() && m_excludeDUT) {
if(det->IsDUT() && m_excludeDUT) {
nPlanes--;
}
if(det->isAuxiliary()) {
if(det->IsAuxiliary()) {
LOG(INFO) << "Excluding auxiliary detector " << det->Name();
nPlanes--;
}
......@@ -176,7 +176,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
// Calculate the mean z-position.
double avgz = 0.;
for(const auto& det : get_detectors()) {
if(det->isDUT() && m_excludeDUT) {
if(det->IsDUT() && m_excludeDUT) {
continue;
}
avgz += det->displacement().Z();
......@@ -185,7 +185,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
// Calculate the variance.
double varz = 0.0;
for(const auto& det : get_detectors()) {
if(det->isDUT() && m_excludeDUT) {
if(det->IsDUT() && m_excludeDUT) {
continue;
}
const double dz = det->displacement().Z() - avgz;
......@@ -207,7 +207,7 @@ void AlignmentMillepede::setConstraints(const size_t nPlanes) {
m_constraints.clear();
for(const auto& det : get_detectors()) {
if(det->isDUT() && m_excludeDUT) {
if(det->IsDUT() && m_excludeDUT) {
continue;
}
const unsigned int i = m_millePlanes[det->Name()];
......@@ -584,13 +584,13 @@ bool AlignmentMillepede::fitTrack(const std::vector<Equation>& equations,
void AlignmentMillepede::updateGeometry() {
auto nPlanes = num_detectors();
for(const auto& det : get_detectors()) {
if(det->isDUT() && m_excludeDUT) {
if(det->IsDUT() && m_excludeDUT) {
nPlanes--;
}
}
for(const auto& det : get_detectors()) {
if(det->isDUT() && m_excludeDUT) {
if(det->IsDUT() && m_excludeDUT) {
continue;
}
auto plane = m_millePlanes[det->Name()];
......
......@@ -168,7 +168,7 @@ void AlignmentTrackChi2::finalise() {
string detectorID = detector->Name();
// Do not align the reference plane
if(detector->isReference() || detector->isDUT() || detector->isAuxiliary()) {
if(detector->IsReference() || detector->IsDUT() || detector->IsAuxiliary()) {
continue;
}
......@@ -260,7 +260,7 @@ void AlignmentTrackChi2::finalise() {
// Now list the new alignment parameters
for(auto& detector : get_detectors()) {
// Do not align the reference plane
if(detector->isReference() || detector->isDUT() || detector->isAuxiliary()) {
if(detector->IsReference() || detector->IsDUT() || detector->IsAuxiliary()) {
continue;
}
......
......@@ -35,7 +35,7 @@ void AnalysisTelescope::initialise() {
}
local_directory->cd();
if(detector->isDUT()) {
if(detector->IsDUT()) {
std::string title = detector->Name() + " Telescope resolution X;x_{track}-x_{MC} [mm];events";
telescopeResolutionX[detector->Name()] = new TH1F("telescopeResolutionX", title.c_str(), 600, -0.2, 0.2);
title = detector->Name() + " Telescope resolution Y;y_{track}-y_{MC} [mm];events";
......@@ -101,7 +101,7 @@ StatusCode AnalysisTelescope::run(std::shared_ptr<Clipboard> clipboard) {
// Loop over clusters of the track:
for(auto& cluster : track->clusters()) {
auto detector = get_detector(cluster->detectorID());
if(detector == nullptr || detector->isDUT()) {
if(detector == nullptr || detector->IsDUT()) {
continue;
}
......@@ -128,7 +128,7 @@ StatusCode AnalysisTelescope::run(std::shared_ptr<Clipboard> clipboard) {
// Calculate telescope resolution at DUT
for(auto& detector : get_detectors()) {
if(!detector->isDUT()) {
if(!detector->IsDUT()) {
continue;
}
......
......@@ -36,7 +36,7 @@ Correlations::Correlations(Configuration config, std::shared_ptr<Detector> detec
void Correlations::initialise() {
// Do not produce correlations plots for auxiliary devices
if(m_detector->isAuxiliary()) {
if(m_detector->IsAuxiliary()) {
return;
}
......@@ -170,7 +170,7 @@ void Correlations::initialise() {
StatusCode Correlations::run(std::shared_ptr<Clipboard> clipboard) {
// Do not attempt plotting for aux devices
if(m_detector->isAuxiliary()) {
if(m_detector->IsAuxiliary()) {
return StatusCode::Success;
}
......
......@@ -75,7 +75,7 @@ void EventLoaderEUDAQ2::initialise() {
hTriggersPerEvent = new TH1D("hTriggersPerEvent", "hTriggersPerEvent;triggers per event;entries", 20, 0, 20);
// Create the following histograms only when detector is not auxiliary:
if(!m_detector->isAuxiliary()) {
if(!m_detector->IsAuxiliary()) {
title = "hitmap;column;row;# events";
hitmap = new TH2F("hitmap",
title.c_str(),
......
......@@ -158,7 +158,7 @@ void EventLoaderTimepix3::initialise() {
// Calibration
pixelToT_beforecalibration = new TH1F("pixelToT_beforecalibration", "pixelToT_beforecalibration", 100, 0, 200);
if(m_detector->isDUT() && m_config.has("calibration_path") && m_config.has("threshold")) {
if(m_detector->IsDUT() && m_config.has("calibration_path") && m_config.has("threshold")) {
LOG(INFO) << "Applying calibration from " << calibrationPath;
applyCalibration = true;
......@@ -415,7 +415,7 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard,
// These packets should only come from the DUT. Otherwise ignore and throw warning.
// (We observed these packets a few times per run in various telescope planes in the
// November 2018 test beam.)
if(!m_detector->isDUT()) {
if(!m_detector->IsDUT()) {
LOG(WARNING) << "Current time: " << Units::display(event->start(), {"s", "ms", "us", "ns"}) << " detector "
<< detectorID << " "
<< "header == 0x0! (indicates power pulsing.) Ignoring this.";
......@@ -591,7 +591,7 @@ bool EventLoaderTimepix3::loadData(std::shared_ptr<Clipboard> clipboard,
pixelToT_beforecalibration->Fill(static_cast<int>(tot));
// Apply calibration if applyCalibration is true
if(applyCalibration && m_detector->isDUT()) {
if(applyCalibration && m_detector->IsDUT()) {
LOG(DEBUG) << "Applying calibration to DUT";
size_t scol = static_cast<size_t>(col);
size_t srow = static_cast<size_t>(row);
......
......@@ -96,7 +96,7 @@ void OnlineMonitor::initialise() {
AddCanvasGroup("DUTs");
for(auto& detector : get_detectors()) {
if(detector->isDUT()) {
if(detector->IsDUT()) {
AddCanvas(detector->Name(), "DUTs", canvas_dutplots, detector->Name());
}
}
......@@ -208,7 +208,7 @@ void OnlineMonitor::AddPlots(std::string canvas_name, Matrix<std::string> canvas
} else {
LOG(DEBUG) << "Adding plot " << name << " for all DUTs.";
for(auto& detector : get_detectors()) {
if(!detector->isDUT()) {
if(!detector->IsDUT()) {
continue;
}
AddHisto(canvas_name,
......@@ -230,7 +230,7 @@ void OnlineMonitor::AddPlots(std::string canvas_name, Matrix<std::string> canvas
LOG(DEBUG) << "Adding plot " << name << " for all detectors.";
for(auto& detector : get_detectors()) {
// Ignore AUX detectors
if(ignoreAux && detector->isAuxiliary()) {
if(ignoreAux && detector->IsAuxiliary()) {
continue;
}
......
......@@ -92,7 +92,7 @@ void Tracking4D::initialise() {
auto detectorID = detector->Name();
// Do not created plots for auxiliary detectors:
if(detector->isAuxiliary()) {
if(detector->IsAuxiliary()) {
continue;
}
......@@ -110,7 +110,7 @@ void Tracking4D::initialise() {
kinkY[detectorID] = new TH1F("kinkY", title.c_str(), 500, -0.01, -0.01);
// Do not create plots for detectors not participating in the tracking:
if(excludeDUT && detector->isDUT()) {
if(excludeDUT && detector->IsDUT()) {
continue;
}
......@@ -160,7 +160,7 @@ StatusCode Tracking4D::run(std::shared_ptr<Clipboard> clipboard) {
} else {
// Store them
LOG(DEBUG) << "Picked up " << tempClusters->size() << " clusters from " << detectorID;
if(firstDetector && !detector->isDUT()) {
if(firstDetector && !detector->IsDUT()) {
referenceClusters = tempClusters;
time_cut_reference_ = time_cuts_[detector];
seedPlane = detector->Name();
......@@ -173,7 +173,7 @@ StatusCode Tracking4D::run(std::shared_ptr<Clipboard> clipboard) {
trees[detectorID] = clusterTree;
}
// the detector always needs to be listed as we would like to add the material budget information
if(!detector->isAuxiliary()) {
if(!detector->IsAuxiliary()) {
detectors.push_back(detectorID);
}
}
......@@ -229,7 +229,7 @@ StatusCode Tracking4D::run(std::shared_ptr<Clipboard> clipboard) {
}
// Check if the DUT should be excluded and obey:
if(excludeDUT && det->isDUT()) {
if(excludeDUT && det->IsDUT()) {
LOG(DEBUG) << "Skipping DUT plane.";
continue;
}
......
......@@ -73,12 +73,12 @@ void TrackingSpatial::initialise() {
auto detectorID = detector->Name();
// Do not create plots for detectors not participating in the tracking:
if(excludeDUT && detector->isDUT()) {
if(excludeDUT && detector->IsDUT()) {
continue;
}
// Do not created plots for auxiliary detectors:
if(detector->isAuxiliary()) {
if(detector->IsAuxiliary()) {
continue;
}
......@@ -178,7 +178,7 @@ StatusCode TrackingSpatial::run(std::shared_ptr<Clipboard> clipboard) {
}
// Check if the DUT should be excluded and obey:
if(excludeDUT && detector->isDUT()) {
if(excludeDUT && detector->IsDUT()) {
LOG(TRACE) << "Exclude DUT.";
continue;
}
......
Supports Markdown
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