FairShip
Loading...
Searching...
No Matches
SiliconTargetHit.cxx
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5#include "SiliconTargetHit.h"
6
7#include <iostream>
8
9#include "FairLogger.h"
10#include "FairRunSim.h"
11#include "ShipUnit.h"
12#include "SiliconTarget.h"
13#include "TGeoBBox.h"
14#include "TGeoManager.h"
15#include "TGeoNavigator.h"
16#include "TROOT.h"
17
19
21 const std::vector<SiliconTargetPoint*>& V)
22 : SHiP::DetectorHit(detID, 0.f) {
23 if (V.empty()) {
24 LOG(error) << "SiliconTargetHit constructor called with empty point vector";
25 return;
26 }
27
28 double totalSig = 0;
29 for (auto* point : V) {
30 totalSig += point->GetEnergyLoss();
31 fX = point->GetX();
32 fY = point->GetY();
33 fZ = point->GetZ();
34 }
35
36 fSignal = totalSig;
37}
38// ----- Public method Print -------------------------------------------
40 std::cout << Form(
41 "SiliconTargetHit: Detector ID %d, Layer %d, Plane %d, Module %d, Strip "
42 "%d, Signal %.2f \n",
44 GetSignal());
45}
Int_t fDetectorID
Detector unique identifier.
Definition: DetectorHit.h:40
constexpr int GetModule() const
constexpr int GetLayer() const
Float_t GetSignal() const
constexpr int GetStrip() const
constexpr int GetPlane() const
Definition: Detector.h:18