diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Diamond.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Diamond.h index 5e65cde045ee6db715f10d4d9849bfdf7682c481..b836afd2a8b4e45f23e556e33d91d895961f533a 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Diamond.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Diamond.h @@ -64,7 +64,6 @@ class MMT_Diamond : public AthMessaging { std::vector<slope_t> getSlopeVector(const unsigned int iterator) const { return m_diamonds.at(iterator).slopes; } unsigned int getDiamondSize() const { return m_diamonds.size(); } int getUVfactor() const { return m_uvfactor; } - void printHits(const unsigned int iterator); void resetSlopes(); void setTrapezoidalShape(bool flag) { m_trapflag = flag; } void setUVfactor(int factor) { m_uvfactor = factor; } diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Hit.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Hit.h index 504a733fa030ecd9b72fe6fde617fe191951ca55..4ce43e8ca9feb096cfc61d41bb374342523f7864 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Hit.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Hit.h @@ -1,22 +1,20 @@ -/* - * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - */ +/* + * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + */ -#ifndef MMT_HIT_H +#ifndef MMT_HIT_H #define MMT_HIT_H -#include "AthenaBaseComps/AthMessaging.h" #include "MMT_struct.h" namespace MuonGM { class MuonDetectorManager; } -class MMT_Hit : public AthMessaging { +class MMT_Hit { public: MMT_Hit(char wedge, hitData_entry entry, const MuonGM::MuonDetectorManager* detManager, const std::shared_ptr<MMT_Parameters> par); - MMT_Hit(const MMT_Hit &hit); - MMT_Hit& operator=(const MMT_Hit&); + MMT_Hit(const MMT_Hit* hit); int getART() const { return m_ART_ASIC; } int getAge() const { return m_age; } @@ -47,7 +45,6 @@ class MMT_Hit : public AthMessaging { void setAge(int age) { m_age = age; } void setAsNoise() { m_isNoise = true; } void setBC(int bc) { m_BC_time = bc; } - void setHitProperties(const Hit &hit); void setRZSlope(double slope) { m_RZslope = slope; } void setYZSlope(double slope) { m_YZslope = slope; } void setY(double y) { m_Y = y; } @@ -71,8 +68,5 @@ class MMT_Hit : public AthMessaging { int m_BC_time, m_age; double m_Y, m_Z, m_R, m_Ri; bool m_isNoise; - - const MuonGM::MuonDetectorManager* m_detManager{}; //!< MuonDetectorManager - const MuonGM::MuonDetectorManager* getDetManager() { return m_detManager; } }; #endif diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Road.h b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Road.h index e38f8cc9de9084a242759c1e18dbf99943bb2f3d..a813496ca0df812992cd7de6f196126c3b0e7c83 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Road.h +++ b/Trigger/TrigT1/TrigT1NSWSimTools/TrigT1NSWSimTools/MMT_Road.h @@ -1,8 +1,8 @@ -/* - * Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration - */ +/* + * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + */ -#ifndef MMT_ROAD_H +#ifndef MMT_ROAD_H #define MMT_ROAD_H #include "MMT_Hit.h" @@ -47,7 +47,7 @@ class MMT_Road { double avgSofUV(const int uv1, const int uv2) const; double avgZofUV(const int uv1, const int uv2) const; bool checkCoincidences(const int &bcwind) const; - bool containsNeighbors(const MMT_Hit &hit) const; + bool containsNeighbors(const MMT_Hit* hit) const; unsigned int countHits() const { return m_road_hits.size(); } unsigned int countRealHits() const; unsigned int countUVHits(bool flag) const; @@ -63,7 +63,6 @@ class MMT_Road { int getRoadSizeDownX() const { return m_roadSizeDownX; } int getRoadSizeUpUV() const { return m_roadSizeUpUV; } int getRoadSizeDownUV() const { return m_roadSizeDownUV; } - std::vector<MMT_Hit> getHitVector() const { return m_road_hits; } char getSector() const { return m_sector; } int getXthreshold() const { return m_xthr; } int getUVthreshold() const { return m_uvthr; } @@ -90,7 +89,6 @@ class MMT_Road { double m_pitch, m_innerRadiusEta1, m_innerRadiusEta2; bool m_trig; std::vector<ROOT::Math::XYZVector> m_planeCoordinates; - - std::vector<MMT_Hit> m_road_hits; + std::vector<std::unique_ptr<MMT_Hit> > m_road_hits; }; #endif diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Diamond.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Diamond.cxx index 896bad4d6667f0c9a5cee4a9b973d22b0bc693c1..68b52e4f1cf968bb951e3e0db15ff4defd9b2606 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Diamond.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Diamond.cxx @@ -1,5 +1,4 @@ #include "TrigT1NSWSimTools/MMT_Diamond.h" -#include "AthenaKernel/getMessageSvc.h" #include "MuonAGDDDescription/MMDetectorDescription.h" #include "MuonAGDDDescription/MMDetectorHelper.h" #include <cmath> @@ -128,14 +127,6 @@ void MMT_Diamond::createRoads_fillHits(const unsigned int iterator, std::vector< ATH_MSG_DEBUG("CreateRoadsAndFillHits: Feeding hitDatas Ended"); } -void MMT_Diamond::printHits(const unsigned int iterator) { - if (iterator < m_diamonds.size() && !m_diamonds[iterator].ev_hits.empty()) { - for (const auto &hit : m_diamonds[iterator].ev_hits) hit->printHit(); - } else { - ATH_MSG_DEBUG("Hit vector is empty!"); - } -} - void MMT_Diamond::findDiamonds(const unsigned int iterator, const double &sm_bc, const int &event) { auto t0 = std::chrono::high_resolution_clock::now(); int ntrig = 0; @@ -227,9 +218,6 @@ void MMT_Diamond::findDiamonds(const unsigned int iterator, const double &sm_bc, ATH_MSG_DEBUG("Coincidence FOUND @BC: " << bc); ATH_MSG_DEBUG("Road (i, u, v, count): (" << road->iRoad() << ", " << road->iRoadu() << ", " << road->iRoadv() << ", " << road->countHits() << ")"); ATH_MSG_DEBUG("------------------------------------------------------------------"); - for (const auto &hit: road->getHitVector()) { - ATH_MSG_DEBUG("Hit (board, BC, strip, eta): (" << hit.getPlane() << ", " << hit.getBC() << ", " << hit.getChannel() << ", " << hit.getStationEta() << ")"); - } slope_t slope; slope.event = event; diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx index 11cddae945455f878a50da88467e0d812a750863..e9d0f336f64f9ba844285ac55ba2e97964a4fe94 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Hit.cxx @@ -1,5 +1,8 @@ +/* + * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + */ + #include "TrigT1NSWSimTools/MMT_Hit.h" -#include "AthenaKernel/getMessageSvc.h" #include "MuonAGDDDescription/MMDetectorDescription.h" #include "MuonAGDDDescription/MMDetectorHelper.h" #include "MuonReadoutGeometry/MuonChannelDesign.h" @@ -7,7 +10,7 @@ #include "MuonReadoutGeometry/MMReadoutElement.h" #include <cmath> -MMT_Hit::MMT_Hit(char wedge, hitData_entry entry, const MuonGM::MuonDetectorManager* detManager, const std::shared_ptr<MMT_Parameters> par) : AthMessaging(Athena::getMessageSvc(), "MMT_Hit") { +MMT_Hit::MMT_Hit(char wedge, hitData_entry entry, const MuonGM::MuonDetectorManager* detManager, const std::shared_ptr<MMT_Parameters> par) { m_sector = wedge; std::string module(1, wedge); @@ -33,10 +36,9 @@ MMT_Hit::MMT_Hit(char wedge, hitData_entry entry, const MuonGM::MuonDetectorMana m_R = -1.; m_Ri = -1.; m_isNoise = false; - m_detManager = detManager; - Identifier strip_id = m_detManager->mmIdHelper()->channelID(m_station_name, m_station_eta, m_station_phi, m_multiplet, m_gasgap, m_strip); - const MuonGM::MMReadoutElement* readout = m_detManager->getMMReadoutElement(strip_id); + Identifier strip_id = detManager->mmIdHelper()->channelID(m_station_name, m_station_eta, m_station_phi, m_multiplet, m_gasgap, m_strip); + const MuonGM::MMReadoutElement* readout = detManager->getMMReadoutElement(strip_id); Amg::Vector3D globalPos(0.0, 0.0, 0.0); readout->stripGlobalPosition(strip_id, globalPos); @@ -49,9 +51,6 @@ MMT_Hit::MMT_Hit(char wedge, hitData_entry entry, const MuonGM::MuonDetectorMana m_Z = globalPos.z(); m_Ri = m_strip*roP.stripPitch; m_RZslope = m_R / m_Z; - ATH_MSG_DEBUG("Module: " << m_module << - " HIT --> R_0: " << roP.distanceFromZAxis << " + Ri " << m_Ri << " corresponding to channel " << m_strip << - " ----- Z: " << m_Z << ", Plane: " << m_plane << ", eta " << m_station_eta << " -- BC: " << m_BC_time << " RZslope: " << m_RZslope); int eta = std::abs(m_station_eta)-1; double base = par->ybases[m_plane][eta]; @@ -59,58 +58,29 @@ MMT_Hit::MMT_Hit(char wedge, hitData_entry entry, const MuonGM::MuonDetectorMana m_YZslope = m_Y / m_Z; } -MMT_Hit::MMT_Hit(const MMT_Hit &hit) : AthMessaging(Athena::getMessageSvc(), "MMT_Hit") { - m_sector = hit.m_sector; - m_module = hit.m_module; - m_station_name = hit.m_station_name; - m_VMM_chip = hit.m_VMM_chip; - m_MMFE_VMM = hit.m_MMFE_VMM; - m_ART_ASIC = hit.m_ART_ASIC; - m_station_eta = hit.m_station_eta; - m_station_phi = hit.m_station_phi; - m_multiplet = hit.m_multiplet; - m_gasgap = hit.m_gasgap; - m_plane = hit.m_plane; - m_strip = hit.m_strip; - m_localX = hit.m_localX; - m_BC_time = hit.m_BC_time; - m_age = hit.m_age; - m_Y = hit.m_Y; - m_Z = hit.m_Z; - m_R = hit.m_R; - m_Ri = hit.m_Ri; - m_RZslope = hit.m_RZslope; - m_YZslope = hit.m_YZslope; - m_isNoise = hit.m_isNoise; - m_detManager = nullptr; -} - -MMT_Hit& MMT_Hit::operator=(const MMT_Hit& hit) { - m_sector = hit.m_sector; - m_module = hit.m_module; - m_station_name = hit.m_station_name; - m_VMM_chip = hit.m_VMM_chip; - m_MMFE_VMM = hit.m_MMFE_VMM; - m_ART_ASIC = hit.m_ART_ASIC; - m_station_eta = hit.m_station_eta; - m_station_phi = hit.m_station_phi; - m_multiplet = hit.m_multiplet; - m_gasgap = hit.m_gasgap; - m_plane = hit.m_plane; - m_strip = hit.m_strip; - m_localX = hit.m_localX; - m_BC_time = hit.m_BC_time; - m_age = hit.m_age; - m_Y = hit.m_Y; - m_Z = hit.m_Z; - m_R = hit.m_R; - m_Ri = hit.m_Ri; - m_RZslope = hit.m_RZslope; - m_YZslope = hit.m_YZslope; - m_isNoise = hit.m_isNoise; - m_detManager = nullptr; - - return *this; +MMT_Hit::MMT_Hit(const MMT_Hit* hit) { + m_sector = hit->m_sector; + m_module = hit->m_module; + m_station_name = hit->m_station_name; + m_VMM_chip = hit->m_VMM_chip; + m_MMFE_VMM = hit->m_MMFE_VMM; + m_ART_ASIC = hit->m_ART_ASIC; + m_station_eta = hit->m_station_eta; + m_station_phi = hit->m_station_phi; + m_multiplet = hit->m_multiplet; + m_gasgap = hit->m_gasgap; + m_plane = hit->m_plane; + m_strip = hit->m_strip; + m_localX = hit->m_localX; + m_BC_time = hit->m_BC_time; + m_age = hit->m_age; + m_Y = hit->m_Y; + m_Z = hit->m_Z; + m_R = hit->m_R; + m_Ri = hit->m_Ri; + m_RZslope = hit->m_RZslope; + m_YZslope = hit->m_YZslope; + m_isNoise = hit->m_isNoise; } bool MMT_Hit::isX() const { @@ -128,32 +98,6 @@ bool MMT_Hit::isV() const { return (id == 3 || id == 5) ? true : false; } -void MMT_Hit::printHit() const { - ATH_MSG_DEBUG("****************** HIT PROPERTIES ******************\n"<< - "\t\t\t\t *** wedge: " << this->getStationName() << "\n"<< - "\t\t\t\t *** VMM: " << this->getVMM() << "\n"<< - "\t\t\t\t *** MMFE: " << this->getMMFE8() << "\n"<< - "\t\t\t\t *** ART_ASIC: " << this->getART() << "\n"<< - "\t\t\t\t *** plane: " << this->getPlane() << "\n"<< - "\t\t\t\t *** st. Eta: " << this->getStationEta() << "\n"<< - "\t\t\t\t *** st. Phi: " << this->getStationPhi() << "\n"<< - "\t\t\t\t *** Multip.: " << this->getMultiplet() << "\n"<< - "\t\t\t\t *** Gas Gap: " << this->getGasGap() << "\n"<< - "\t\t\t\t *** strip: " << this->getChannel() << "\n"<< - "\t\t\t\t *** slopeRZ: " << this->getRZSlope() << "\n"<< - "\t\t\t\t *** BC: " << this->getBC() << "\n"<< - "\t\t\t\t *** X: " << this->getX() << "\n"<< - "\t\t\t\t *** Y: " << this->getY() << "\n"<< - "\t\t\t\t *** Z: " << this->getZ() << "\n"<< - "\t\t\t\t *** R: " << this->getR() << "\n"<< - "\t\t\t\t ****************************************************"); -} - -void MMT_Hit::setHitProperties(const Hit &hit) { - m_Y = hit.info.y; - m_Z = hit.info.z; -} - bool MMT_Hit::verifyHit() const { /* * Put here all Hit checks, probably redundant if digitization is ok @@ -163,4 +107,3 @@ bool MMT_Hit::verifyHit() const { else if (this->getChannel() < 1 || this->getChannel() > 8192) return false; else return true; } - diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx index abb85615ae3db1968c57eaaa288576e71095baef..9cf2d021a7ca2d8b0c302673247129305022cefa 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMT_Road.cxx @@ -1,3 +1,7 @@ +/* + * Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration + */ + #include "TrigT1NSWSimTools/MMT_Road.h" MMT_Road::MMT_Road(const char sector, const MuonGM::MuonDetectorManager* detManager, const micromegas_t &mm, int xthr, int uvthr, int iroadx, int iroadu, int iroadv) { @@ -27,9 +31,9 @@ void MMT_Road::addHits(std::vector<std::shared_ptr<MMT_Hit> > &hits) { for (const auto &hit_i : hits) { int bo = hit_i->getPlane(); bool has_hit = false; - if( this->containsNeighbors(*hit_i) ) { + if( this->containsNeighbors(hit_i.get()) ) { for (const auto &hit_j : m_road_hits) { - if (hit_j.getPlane() == bo) { + if (hit_j->getPlane() == bo) { has_hit = true; break; } @@ -37,7 +41,7 @@ void MMT_Road::addHits(std::vector<std::shared_ptr<MMT_Hit> > &hits) { if (hit_i->isNoise() == false) { int erase_me = -1; for (unsigned int j = 0; j < m_road_hits.size(); j++) { - if (m_road_hits[j].getPlane() == bo && m_road_hits[j].isNoise()) { + if (m_road_hits[j]->getPlane() == bo && m_road_hits[j]->isNoise()) { erase_me = j; has_hit = false; break; @@ -47,31 +51,29 @@ void MMT_Road::addHits(std::vector<std::shared_ptr<MMT_Hit> > &hits) { } if (has_hit) continue; - m_road_hits.push_back(*hit_i); - m_road_hits.back().setAge(0); + auto hit = std::make_unique<MMT_Hit>(hit_i.get()); + m_road_hits.push_back(std::move(hit)); + m_road_hits.back()->setAge(0); } } } -bool MMT_Road::containsNeighbors(const MMT_Hit &hit) const { +bool MMT_Road::containsNeighbors(const MMT_Hit* hit) const { int iroad = 0; - if (hit.isX()) iroad = this->iRoadx(); - else if (hit.isU()) iroad = this->iRoadu(); - else if (hit.isV()) iroad = this->iRoadv(); - else { - std::cerr << "ERROR! Unknown hit type: " << hit.getPlane() << std::endl; - return false; - } + if (hit->isX()) iroad = this->iRoadx(); + else if (hit->isU()) iroad = this->iRoadu(); + else if (hit->isV()) iroad = this->iRoadv(); + else return false; - double R = (std::abs(hit.getStationEta()) == 1) ? m_innerRadiusEta1 : m_innerRadiusEta2; - double Z = hit.getZ(); + double R = (std::abs(hit->getStationEta()) == 1) ? m_innerRadiusEta1 : m_innerRadiusEta2; + double Z = hit->getZ(); - double index = std::round((std::abs(hit.getRZSlope())-0.1)/5e-04); // 0.0005 is approx. the step in slope achievable with a road size of 8 strips + double index = std::round((std::abs(hit->getRZSlope())-0.1)/5e-04); // 0.0005 is approx. the step in slope achievable with a road size of 8 strips double roundedSlope = 0.1 + index*((0.6 - 0.1)/1000.); - double shift = roundedSlope*(this->getPlaneCoordinate(hit.getPlane()).Z() - this->getPlaneCoordinate(0).Z()); + double shift = roundedSlope*(this->getPlaneCoordinate(hit->getPlane()).Z() - this->getPlaneCoordinate(0).Z()); double olow = 0., ohigh = 0.; - if (hit.isX()) { + if (hit->isX()) { olow = this->getRoadSizeDownX()*this->getPitch(); ohigh = this->getRoadSizeUpX()*this->getPitch(); } else { @@ -82,8 +84,8 @@ bool MMT_Road::containsNeighbors(const MMT_Hit &hit) const { double slow = (R + (this->getRoadSize()*iroad )*this->getPitch() + shift + this->getPitch()/2. - olow)/Z; double shigh = (R + (this->getRoadSize()*(iroad+1))*this->getPitch() + shift + this->getPitch()/2. + ohigh)/Z; - double slope = hit.getRZSlope(); - if (this->getSector() != hit.getSector()) return false; + double slope = hit->getRZSlope(); + if (this->getSector() != hit->getSector()) return false; if (slope > 0.) return (slope >= slow && slope < shigh); else return (slope >= shigh && slope < slow); @@ -92,8 +94,8 @@ bool MMT_Road::containsNeighbors(const MMT_Hit &hit) const { double MMT_Road::avgSofX() const { std::vector<double> sl; for (const auto &hit : m_road_hits) { - int bo = hit.getPlane(); - if (bo < 2 || bo > 5) sl.push_back(hit.getRZSlope()); + int bo = hit->getPlane(); + if (bo < 2 || bo > 5) sl.push_back(hit->getRZSlope()); } double avg_x = std::accumulate(sl.begin(), sl.end(), 0.0)/(double)sl.size(); return avg_x; @@ -102,8 +104,8 @@ double MMT_Road::avgSofX() const { double MMT_Road::avgSofUV(const int uv1, const int uv2) const { std::vector<double> sl; for (const auto &hit : m_road_hits) { - int bo = hit.getPlane(); - if (bo == uv1 || bo == uv2) sl.push_back(hit.getRZSlope()); + int bo = hit->getPlane(); + if (bo == uv1 || bo == uv2) sl.push_back(hit->getRZSlope()); } double avg_uv = std::accumulate(sl.begin(), sl.end(), 0.0)/(double)sl.size(); return avg_uv; @@ -112,8 +114,8 @@ double MMT_Road::avgSofUV(const int uv1, const int uv2) const { double MMT_Road::avgZofUV(const int uv1, const int uv2) const { std::vector<double> zs; for (const auto &hit : m_road_hits) { - int bo = hit.getPlane(); - if (bo == uv1 || bo == uv2) zs.push_back(hit.getZ()); + int bo = hit->getPlane(); + if (bo == uv1 || bo == uv2) zs.push_back(hit->getZ()); } double avg_z = std::accumulate(zs.begin(), zs.end(), 0.0)/(double)zs.size(); return avg_z; @@ -129,7 +131,7 @@ bool MMT_Road::checkCoincidences(const int &bcwind) const { unsigned int MMT_Road::countRealHits() const { int nreal = 0; for (const auto &hit : m_road_hits) { - if (hit.isNoise() == false) nreal++; + if (hit->isNoise() == false) nreal++; } return nreal; } @@ -137,11 +139,11 @@ unsigned int MMT_Road::countRealHits() const { unsigned int MMT_Road::countUVHits(bool flag) const { unsigned int nuv = 0; for (const auto &hit : m_road_hits) { - if (hit.getPlane() == 2 || hit.getPlane() == 4) { - if (hit.isNoise() == flag) nuv++; + if (hit->getPlane() == 2 || hit->getPlane() == 4) { + if (hit->isNoise() == flag) nuv++; } - if (hit.getPlane() == 3 || hit.getPlane() == 5) { - if (hit.isNoise() == flag) nuv++; + if (hit->getPlane() == 3 || hit->getPlane() == 5) { + if (hit->isNoise() == flag) nuv++; } } return nuv; @@ -150,8 +152,8 @@ unsigned int MMT_Road::countUVHits(bool flag) const { unsigned int MMT_Road::countXHits(bool flag) const { unsigned int nx = 0; for (const auto &hit : m_road_hits) { - if (hit.getPlane() < 2 || hit.getPlane() > 5) { - if (hit.isNoise() == flag) nx++; + if (hit->getPlane() < 2 || hit->getPlane() > 5) { + if (hit->isNoise() == flag) nx++; } } return nx; @@ -160,8 +162,8 @@ unsigned int MMT_Road::countXHits(bool flag) const { bool MMT_Road::evaluateLowRes() const { unsigned int nhits1 = 0, nhits2 = 0; for (const auto &hit : m_road_hits) { - if (hit.getPlane() < 4 && !hit.isNoise()) nhits1++; - else if (hit.getPlane() > 3 && !hit.isNoise()) nhits2++; + if (hit->getPlane() < 4 && !hit->isNoise()) nhits1++; + else if (hit->getPlane() > 3 && !hit->isNoise()) nhits2++; } return (nhits1 < 4 || nhits2 < 4) ? true : false; } @@ -169,8 +171,8 @@ bool MMT_Road::evaluateLowRes() const { bool MMT_Road::horizontalCheck() const { int nx1 = 0, nx2 = 0; for (const auto &hit : m_road_hits) { - if (hit.getPlane() >-1 && hit.getPlane() < 2) nx1++; - if (hit.getPlane() > 5 && hit.getPlane() < 8) nx2++; + if (hit->getPlane() >-1 && hit->getPlane() < 2) nx1++; + if (hit->getPlane() > 5 && hit->getPlane() < 8) nx2++; } if (nx1 > 0 && nx2 > 0 && (nx1+nx2) >= this->getXthreshold()) return true; return false; @@ -179,15 +181,15 @@ bool MMT_Road::horizontalCheck() const { void MMT_Road::incrementAge(const int &bcwind) { std::vector<unsigned int> old_ihits; for (unsigned int j = 0; j < m_road_hits.size(); j++) { - m_road_hits[j].setAge(m_road_hits[j].getAge() +1); - if (m_road_hits[j].getAge() > (bcwind-1)) old_ihits.push_back(j); + m_road_hits[j]->setAge(m_road_hits[j]->getAge() +1); + if (m_road_hits[j]->getAge() > (bcwind-1)) old_ihits.push_back(j); } for (int j = old_ihits.size()-1; j > -1; j--) m_road_hits.erase(m_road_hits.begin()+j); } bool MMT_Road::matureCheck(const int &bcwind) const { for (const auto &hit : m_road_hits) { - if (hit.getAge() == (bcwind - 1)) return true; + if (hit->getAge() == (bcwind - 1)) return true; } return false; } @@ -195,10 +197,10 @@ bool MMT_Road::matureCheck(const int &bcwind) const { double MMT_Road::mxl() const { std::vector<double> ys, zs; for (const auto &hit : m_road_hits) { - int bo = hit.getPlane(); + int bo = hit->getPlane(); if (bo < 2 || bo > 5) { - ys.push_back(hit.getR()); - zs.push_back(hit.getZ()); + ys.push_back(hit->getR()); + zs.push_back(hit->getZ()); } } double mxl = 0; @@ -216,8 +218,8 @@ void MMT_Road::reset() { bool MMT_Road::stereoCheck() const { int nu = 0, nv = 0; for (const auto &hit : m_road_hits) { - if (hit.getPlane() == 2 || hit.getPlane() == 4) nu++; - if (hit.getPlane() == 3 || hit.getPlane() == 5) nv++; + if (hit->getPlane() == 2 || hit->getPlane() == 4) nu++; + if (hit->getPlane() == 3 || hit->getPlane() == 5) nv++; } if (this->getUVthreshold() == 0) return true; if (nu > 0 && nv > 0 && (nu+nv) >= this->getUVthreshold()) return true; diff --git a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx index 2f017739a6f643b0e7897e0d32e55aebeeb46884..43a1d9fbb92807e8af8aa58fd232c51e85c5bb3e 100644 --- a/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx +++ b/Trigger/TrigT1/TrigT1NSWSimTools/src/MMTriggerTool.cxx @@ -188,7 +188,6 @@ namespace NSWL1 { if (hitDatas[ihds].BC_time < 0.) continue; else if (hitDatas[ihds].BC_time < smallest_bc) smallest_bc = hitDatas[ihds].BC_time; - // The PrintHits function below gives identical results to the following one: hitDatas[ihds].print(); if (m_doNtuple) { m_trigger_VMM->push_back(hitDatas[ihds].VMM_chip); m_trigger_plane->push_back(hitDatas[ihds].plane); @@ -196,7 +195,6 @@ namespace NSWL1 { m_trigger_strip->push_back(hitDatas[ihds].strip); } } - diamond->printHits(i-nskip); std::vector<double> slopes = diamond->getHitSlopes(); for (const auto &s : slopes) if (m_doNtuple) m_trigger_RZslopes->push_back(s); diamond->resetSlopes();