18 #include "MyProjDetectorList.h"
19 #include "MyProjStack.h"
25 #include <TGeoCompositeShape.h>
26 #include <TGeoManager.h>
27 #include <TGeoMaterial.h>
28 #include <TGeoMedium.h>
30 #include <TVirtualMC.h>
70 if (fVectorPoints->size()) {
71 for (
auto const& x : (*fVectorPoints)) {
74 fVectorPoints->clear();
86 DefineSensitiveVolumes();
98 if (TVirtualMC::GetMC()->IsTrackEntering()) {
100 fTime = TVirtualMC::GetMC()->TrackTime() * 1.0e09;
101 fLength = TVirtualMC::GetMC()->TrackLength();
102 TVirtualMC::GetMC()->TrackPosition(fPos);
103 TVirtualMC::GetMC()->TrackMomentum(fMom);
107 fELoss += TVirtualMC::GetMC()->Edep();
110 if (TVirtualMC::GetMC()->IsTrackExiting() || TVirtualMC::GetMC()->IsTrackStop()
111 || TVirtualMC::GetMC()->IsTrackDisappeared()) {
112 fTrackID = TVirtualMC::GetMC()->GetStack()->GetCurrentTrackNumber();
119 TVector3(fPos.X(), fPos.Y(), fPos.Z()),
120 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
135 LOG(info) <<
"NewDetector: " << fVectorPoints->size() <<
" points registered in this event";
137 for (
auto const& x : (*fVectorPoints)) {
140 fVectorPoints->clear();
155 for (
auto const& x : (*fVectorPoints)) {
158 fVectorPoints->clear();
163 TGeoVolume* top = gGeoManager->GetTopVolume();
164 TGeoMedium* Si = gGeoManager->GetMedium(
"Si");
165 TGeoMedium* Carbon = gGeoManager->GetMedium(
"C");
168 TGeoMaterial* matSi =
new TGeoMaterial(
"Si", 28.0855, 14, 2.33);
169 Si =
new TGeoMedium(
"Si", 2, matSi);
172 TGeoMaterial* matCarbon =
new TGeoMaterial(
"C", 12.011, 6.0, 2.265);
173 Carbon =
new TGeoMedium(
"C", 3, matCarbon);
176 TGeoVolume* det1 = gGeoManager->MakeTubs(
"Det1", Si, 5, 80, 0.1, 0, 360);
178 r1.SetAngles(0, 0, 0);
179 TGeoTranslation t1(0, 0, 0);
180 TGeoCombiTrans c1(t1, r1);
181 TGeoHMatrix* h1 =
new TGeoHMatrix(c1);
182 top->AddNode(det1, 1, h1);
183 det1->SetLineColor(kGreen);
186 TGeoVolume* passive1 = gGeoManager->MakeTubs(
"Pass1", Si, 5, 120, 10, 0, 360);
188 rp1.SetAngles(0, 0, 0);
189 TGeoTranslation tp1(0, 0, 20);
190 TGeoCombiTrans cp1(tp1, rp1);
191 TGeoHMatrix* hp1 =
new TGeoHMatrix(cp1);
192 top->AddNode(passive1, 1, hp1);
193 passive1->SetLineColor(kRed);
195 TGeoVolume* det2 = gGeoManager->MakeTubs(
"Det2", Si, 5, 150, 0.1, 0, 360);
197 r2.SetAngles(0, 0, 0);
198 TGeoTranslation t2(0, 0, 70);
199 TGeoCombiTrans c2(t2, r2);
200 TGeoHMatrix* h2 =
new TGeoHMatrix(c2);
201 top->AddNode(det2, 1, h2);
202 det2->SetLineColor(kGreen);
205 TGeoVolume* det3 = gGeoManager->MakeTubs(
"Det3", Si, 5, 150, 0.1, 0, 360);
207 r3.SetAngles(0, 0, 0);
208 TGeoTranslation t3(0, 0, 150);
209 TGeoCombiTrans c3(t3, r3);
210 TGeoHMatrix* h3 =
new TGeoHMatrix(c3);
211 top->AddNode(det3, 1, h3);
212 det3->SetLineColor(kGreen);
225 fVectorPoints->push_back(point);
231 void NewDetector::DefineSensitiveVolumes()
233 TObjArray* volumes = gGeoManager->GetListOfVolumes();
236 while ((volume = static_cast<TGeoVolume*>(next()))) {
238 LOG(debug2) <<
"Sensitive Volume " << volume->GetName();
246 if (name.find(
"Det") != std::string::npos) {
void AddSensitiveVolume(TGeoVolume *v)
virtual void see Tutorial4 for examples LOG(warn)<< "This function is deprecated. Use FairAlignmentHandler instead
list of container factories
static FairRun * Instance()
virtual FairModule * CloneModule() const
static FairRootManager * Instance()
ClassImp(FairEventBuilder)
virtual Bool_t ProcessHits(FairVolume *v=0)
virtual void EndOfEvent()
FairParSet * getContainer(const Text_t *)
virtual void Initialize()
virtual void Initialize()
FairMQExParamsParOne * par
FairRuntimeDb * GetRuntimeDb(void)
virtual Bool_t IsSensitive(const std::string &name)
void AddPoint(DetectorId iDet)
NewDetectorPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss)
void RegisterAny(const char *name, T *&obj, Bool_t toFile)