diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ba3842349..5d6e6806ba 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -173,6 +173,7 @@ it in future. * Use STL vectors for SBT digitisation * Use maximum splitting (99) for vector branches instead of no splitting (-1) * Make TTree branch split level configurable in BaseDetector, set splitLevel=1 for MTC +* Store channel coordinates in the digi containers to avoid reading geofile #### Geometry Configuration System diff --git a/SND/MTC/MTCDetHit.cxx b/SND/MTC/MTCDetHit.cxx index 617e9163bc..7714e778ed 100644 --- a/SND/MTC/MTCDetHit.cxx +++ b/SND/MTC/MTCDetHit.cxx @@ -4,8 +4,11 @@ #include "MTCDetHit.h" +#include #include +#include + #include "FairRunSim.h" #include "MTCDetPoint.h" #include "MTCDetector.h" @@ -45,29 +48,41 @@ MTCDetHit::MTCDetHit(int SiPMChan, const std::vector& points, Float_t total_light_yield = 0.0f; Float_t earliest_to_A = std::numeric_limits::max(); Float_t earliest_to_B = std::numeric_limits::max(); + const size_t n = points.size(); Float_t signal_sum = 0.0f; bool hit_flag = false; // Separate handling for scintillating mat (plane_type == 2) if (plane_type == 2) { + Float_t x_temp = 0.0, y_temp = 0.0, z_temp = 0.0; for (auto* pt : points) { signal_sum += pt->GetEnergyLoss(); // Track earliest arrival time Float_t arrival = pt->GetTime(); earliest_to_B = std::min(earliest_to_B, arrival); + x_temp += pt->GetX(); + y_temp += pt->GetY(); + z_temp += pt->GetZ(); } flag = true; time = gRandom->Gaus(earliest_to_B, time_res); + // for scintillating tiles set simulated coordinates so far as the realistic + // geometry is not yet done. + Xch = x_temp / n; + Ych = y_temp / n; + Zch = z_temp / n; signals = signal_sum; return; } // Fiber hit processing - const size_t n = points.size(); total_light_yield = 0.0f; TVector3 sipmA, sipmB; MTCDet->GetSiPMPosition(SiPMChan, sipmA, sipmB); + // Define only X and Z coordinates for Sci-Fi. + Xch = sipmB.X(); + Zch = sipmB.Z(); for (size_t i = 0; i < n; ++i) { auto* pt = points[i]; diff --git a/SND/MTC/MTCDetHit.h b/SND/MTC/MTCDetHit.h index 5ade135148..d3c1998953 100644 --- a/SND/MTC/MTCDetHit.h +++ b/SND/MTC/MTCDetHit.h @@ -57,23 +57,25 @@ class MTCDetHit : public ShipHit { } Int_t GetSiPM() const { return (static_cast(fDetectorID / 1000) % 10); } Int_t GetSiPMChan() const { return (fDetectorID % 1000); } + TVector3 GetChannelCoordinates() const { return TVector3(Xch, Ych, Zch); } Float_t GetEnergy() const; void setInvalid() { flag = false; } bool isValid() const { return flag; } /* - SND@LHC comment: from Guido (22.9.2021): A threshold of 3.5pe should - be used, which corresponds to 0.031MeV. 1 SiPM channel has 104 pixels, - pixel can only see 0 or >0 photons. + SND@LHC comment: from Guido (22.9.2021): A threshold of 3.5pe should + be used, which corresponds to 0.031MeV. 1 SiPM channel has 104 pixels, + pixel can only see 0 or >0 photons. */ private: Float_t signals = 0; Float_t time; + Float_t Xch = 0.0, Ych = 0.0, Zch = 0.0; Float_t light_attenuation(Float_t distance); Float_t sipm_saturation(Float_t ly); Float_t n_pixels_to_qdc(Float_t npix); Float_t flag; ///< flag - ClassDef(MTCDetHit, 4); + ClassDef(MTCDetHit, 5); }; #endif // SND_MTC_MTCDETHIT_H_