Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
17 changes: 16 additions & 1 deletion SND/MTC/MTCDetHit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

#include "MTCDetHit.h"

#include <TMath.h>
#include <TRandom.h>

#include <vector>

#include "FairRunSim.h"
#include "MTCDetPoint.h"
#include "MTCDetector.h"
Expand Down Expand Up @@ -45,29 +48,41 @@ MTCDetHit::MTCDetHit(int SiPMChan, const std::vector<MTCDetPoint*>& points,
Float_t total_light_yield = 0.0f;
Float_t earliest_to_A = std::numeric_limits<Float_t>::max();
Float_t earliest_to_B = std::numeric_limits<Float_t>::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];
Expand Down
10 changes: 6 additions & 4 deletions SND/MTC/MTCDetHit.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,23 +57,25 @@ class MTCDetHit : public ShipHit {
}
Int_t GetSiPM() const { return (static_cast<int>(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_