|
7 | 7 | ********************************************************************************/ |
8 | 8 | #include "FairTutorialDet1.h" |
9 | 9 |
|
10 | | -#include "FairDetectorList.h" // for DetectorId::kTutDet |
| 10 | +#include "FairDetectorList.h" // for DetectorId::kTutDet |
11 | 11 | #include "FairLogger.h" |
12 | | -#include "FairRootManager.h" // for FairRootManager |
13 | | -#include "FairStack.h" // for FairStack |
14 | | -#include "FairTutorialDet1Geo.h" // for FairTutorialDet1Geo |
15 | | -#include "FairTutorialDet1GeoPar.h" // for FairTutorialDet1GeoPar |
16 | | -#include "FairTutorialDet1Point.h" // for FairTutorialDet1Point |
17 | | -#include "FairVolume.h" // for FairVolume |
| 12 | +#include "FairRootManager.h" // for FairRootManager |
| 13 | +#include "FairStack.h" // for FairStack |
| 14 | +#include "FairTutorialDet1Geo.h" // for FairTutorialDet1Geo |
| 15 | +#include "FairTutorialDet1GeoPar.h" // for FairTutorialDet1GeoPar |
| 16 | +#include "FairTutorialDet1Point.h" // for FairTutorialDet1Point |
| 17 | +#include "FairVolume.h" // for FairVolume |
18 | 18 |
|
19 | | -#include <TClonesArray.h> // for TClonesArray |
20 | | -#include <TVirtualMC.h> // for TVirtualMC |
21 | | -#include <TVirtualMCStack.h> // for TVirtualMCStack |
| 19 | +#include <TClonesArray.h> // for TClonesArray |
| 20 | +#include <TVirtualMC.h> // for TVirtualMC |
| 21 | +#include <TVirtualMCStack.h> // for TVirtualMCStack |
22 | 22 |
|
23 | 23 | FairTutorialDet1Geo* FairTutorialDet1::fgGeo = nullptr; |
24 | 24 |
|
@@ -75,49 +75,52 @@ void FairTutorialDet1::Initialize() |
75 | 75 | */ |
76 | 76 | } |
77 | 77 |
|
78 | | -void FairTutorialDet1::ProcessHits() |
| 78 | +void FairTutorialDet1::ProcessHits() |
79 | 79 | { |
80 | | - /** This method is called from the MC stepping */ |
81 | | - |
82 | | - LOG(debug) << "In FairTutorialDet1::ProcessHits"; |
83 | | - //Set parameters at entrance of volume. Reset ELoss. |
84 | | - if ( TVirtualMC::GetMC()->IsTrackEntering() ) { |
85 | | - fELoss = 0.; |
86 | | - fTime = TVirtualMC::GetMC()->TrackTime() * 1.0e09; |
87 | | - fLength = TVirtualMC::GetMC()->TrackLength(); |
88 | | - TVirtualMC::GetMC()->TrackPosition(fPos); |
89 | | - TVirtualMC::GetMC()->TrackMomentum(fMom); |
90 | | - } |
91 | | - |
92 | | - // Sum energy loss for all steps in the active volume |
93 | | - fELoss += TVirtualMC::GetMC()->Edep(); |
94 | | - |
95 | | - // Create FairTutorialDet1Point at exit of active volume |
96 | | - if ( TVirtualMC::GetMC()->IsTrackExiting() || |
97 | | - TVirtualMC::GetMC()->IsTrackStop() || |
98 | | - TVirtualMC::GetMC()->IsTrackDisappeared() ) { |
99 | | - fTrackID = TVirtualMC::GetMC()->GetStack()->GetCurrentTrackNumber(); |
100 | | - Int_t copyNo = 0; |
101 | | - fVolumeID = TVirtualMC::GetMC()->CurrentVolID(copyNo); |
102 | | - if (fELoss == 0. ) { return; } |
103 | | - AddHit(fTrackID, fVolumeID, TVector3(fPos.X(), fPos.Y(), fPos.Z()), |
104 | | - TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength, |
105 | | - fELoss); |
106 | | - |
107 | | - // Increment number of tutorial det points in TParticle |
108 | | - FairStack* stack = static_cast<FairStack*>(TVirtualMC::GetMC()->GetStack()); |
109 | | - stack->AddPoint(kTutDet); |
110 | | - } |
| 80 | + /** This method is called from the MC stepping */ |
| 81 | + |
| 82 | + LOG(debug) << "In FairTutorialDet1::ProcessHits"; |
| 83 | + // Set parameters at entrance of volume. Reset ELoss. |
| 84 | + if (TVirtualMC::GetMC()->IsTrackEntering()) { |
| 85 | + fELoss = 0.; |
| 86 | + fTime = TVirtualMC::GetMC()->TrackTime() * 1.0e09; |
| 87 | + fLength = TVirtualMC::GetMC()->TrackLength(); |
| 88 | + TVirtualMC::GetMC()->TrackPosition(fPos); |
| 89 | + TVirtualMC::GetMC()->TrackMomentum(fMom); |
| 90 | + } |
| 91 | + |
| 92 | + // Sum energy loss for all steps in the active volume |
| 93 | + fELoss += TVirtualMC::GetMC()->Edep(); |
| 94 | + |
| 95 | + // Create FairTutorialDet1Point at exit of active volume |
| 96 | + if (TVirtualMC::GetMC()->IsTrackExiting() || TVirtualMC::GetMC()->IsTrackStop() |
| 97 | + || TVirtualMC::GetMC()->IsTrackDisappeared()) { |
| 98 | + fTrackID = TVirtualMC::GetMC()->GetStack()->GetCurrentTrackNumber(); |
| 99 | + Int_t copyNo = 0; |
| 100 | + fVolumeID = TVirtualMC::GetMC()->CurrentVolID(copyNo); |
| 101 | + if (fELoss == 0.) { |
| 102 | + return; |
| 103 | + } |
| 104 | + AddHit(fTrackID, |
| 105 | + fVolumeID, |
| 106 | + TVector3(fPos.X(), fPos.Y(), fPos.Z()), |
| 107 | + TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), |
| 108 | + fTime, |
| 109 | + fLength, |
| 110 | + fELoss); |
| 111 | + |
| 112 | + // Increment number of tutorial det points in TParticle |
| 113 | + FairStack* stack = static_cast<FairStack*>(TVirtualMC::GetMC()->GetStack()); |
| 114 | + stack->AddPoint(kTutDet); |
| 115 | + } |
111 | 116 | } |
112 | 117 |
|
113 | 118 | void FairTutorialDet1::EndOfEvent() |
114 | 119 | { |
115 | | - |
116 | | - LOG(info) << "FairTutorialDet1 : " << fFairTutorialDet1PointCollection->GetEntriesFast() |
117 | | - << " points registered."; |
118 | 120 |
|
119 | | - fFairTutorialDet1PointCollection->Clear(); |
| 121 | + LOG(info) << "FairTutorialDet1 : " << fFairTutorialDet1PointCollection->GetEntriesFast() << " points registered."; |
120 | 122 |
|
| 123 | + fFairTutorialDet1PointCollection->Clear(); |
121 | 124 | } |
122 | 125 |
|
123 | 126 | void FairTutorialDet1::Register() |
|
0 commit comments