SND@LHC Software
Loading...
Searching...
No Matches
TargetTracker Class Reference

#include <TargetTracker.h>

Inheritance diagram for TargetTracker:
Collaboration diagram for TargetTracker:

Public Member Functions

 TargetTracker (const char *name, Double_t TTX, Double_t TTY, Double_t TTZ, Bool_t Active, const char *Title="TargetTrackers")
 
 TargetTracker ()
 
virtual ~TargetTracker ()
 
void ConstructGeometry ()
 
void SetSciFiParam (Double_t scifimat_width_, Double_t scifimat_hor_, Double_t scifimat_vert_, Double_t scifimat_z_, Double_t support_z_, Double_t honeycomb_z_)
 
void SetNumberSciFi (Int_t n_hor_planes_, Int_t n_vert_planes_)
 
void SetTargetTrackerParam (Double_t TTX, Double_t TTY, Double_t TTZ)
 
void SetBrickParam (Double_t CellW)
 
void SetTotZDimension (Double_t Zdim)
 
void DecodeTTID (Int_t detID, Int_t &NTT, int &nplane, Bool_t &ishor)
 
void SetNumberTT (Int_t n)
 
void SetDesign (Int_t Design)
 
virtual void Initialize ()
 
virtual Bool_t ProcessHits (FairVolume *v=0)
 
virtual void Register ()
 
virtual TClonesArray * GetCollection (Int_t iColl) const
 
virtual void Reset ()
 
TTPointAddHit (Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)
 
virtual void CopyClones (TClonesArray *cl1, TClonesArray *cl2, Int_t offset)
 
virtual void SetSpecialPhysicsCuts ()
 
virtual void EndOfEvent ()
 
virtual void FinishPrimary ()
 
virtual void FinishRun ()
 
virtual void BeginPrimary ()
 
virtual void PostTrack ()
 
virtual void PreTrack ()
 
virtual void BeginEvent ()
 
 TargetTracker (const TargetTracker &)
 
TargetTrackeroperator= (const TargetTracker &)
 
 ClassDef (TargetTracker, 4)
 

Protected Member Functions

Int_t InitMedium (const char *name)
 

Protected Attributes

Double_t TTrackerX
 
Double_t TTrackerY
 
Double_t TTrackerZ
 
Double_t scifimat_width
 
Double_t scifimat_hor
 
Double_t scifimat_vert
 
Double_t scifimat_z
 
Double_t support_z
 
Double_t honeycomb_z
 
Int_t n_hor_planes
 
Int_t n_vert_planes
 
Double_t CellWidth
 
Double_t ZDimension
 
Int_t fNTT
 
Int_t fDesign
 

Private Attributes

Int_t fTrackID
 
Int_t fVolumeID
 track index
 
TLorentzVector fPos
 volume id
 
TLorentzVector fMom
 position at entrance
 
Double32_t fTime
 momentum at entrance
 
Double32_t fLength
 time
 
Double32_t fELoss
 length
 
TClonesArray * fTTPointCollection
 energy loss
 

Detailed Description

Definition at line 26 of file TargetTracker.h.

Constructor & Destructor Documentation

◆ TargetTracker() [1/3]

TargetTracker::TargetTracker ( const char *  name,
Double_t  TTX,
Double_t  TTY,
Double_t  TTZ,
Bool_t  Active,
const char *  Title = "TargetTrackers" 
)

Definition at line 78 of file TargetTracker.cxx.

79: FairDetector(name, true, ktauTT),
80 fTrackID(-1),
81fVolumeID(-1),
82fPos(),
83fMom(),
84fTime(-1.),
85fLength(-1.),
86fELoss(-1),
87fTTPointCollection(new TClonesArray("TTPoint"))
88{
89 TTrackerX = TTX;
90 TTrackerY = TTY;
91 TTrackerZ = TTZ;
92}
@ ktauTT
TClonesArray * fTTPointCollection
energy loss
TLorentzVector fMom
position at entrance
Double_t TTrackerX
Double_t TTrackerY
Int_t fVolumeID
track index
Double32_t fLength
time
Double32_t fTime
momentum at entrance
Double_t TTrackerZ
TLorentzVector fPos
volume id
Double32_t fELoss
length

◆ TargetTracker() [2/3]

TargetTracker::TargetTracker ( )

Definition at line 65 of file TargetTracker.cxx.

66: FairDetector("TargetTracker", "",kTRUE),
67 fTrackID(-1),
68fVolumeID(-1),
69fPos(),
70fMom(),
71fTime(-1.),
72fLength(-1.),
73fELoss(-1),
74fTTPointCollection(new TClonesArray("TTPoint"))
75{
76}

◆ ~TargetTracker()

TargetTracker::~TargetTracker ( )
virtual

Definition at line 94 of file TargetTracker.cxx.

95{
97 fTTPointCollection->Delete();
98 delete fTTPointCollection;
99 }
100}

◆ TargetTracker() [3/3]

TargetTracker::TargetTracker ( const TargetTracker )

Member Function Documentation

◆ AddHit()

TTPoint * TargetTracker::AddHit ( Int_t  trackID,
Int_t  detID,
TVector3  pos,
TVector3  mom,
Double_t  time,
Double_t  length,
Double_t  eLoss,
Int_t  pdgCode 
)

This method is an example of how to add your own point of type muonPoint to the clones array

Definition at line 348 of file TargetTracker.cxx.

352{
353 TClonesArray& clref = *fTTPointCollection;
354 Int_t size = clref.GetEntriesFast();
355 //cout << "brick hit called"<< pos.z()<<endl;
356 return new(clref[size]) TTPoint(trackID,detID, pos, mom,
357 time, length, eLoss, pdgCode);
358}

◆ BeginEvent()

virtual void TargetTracker::BeginEvent ( )
inlinevirtual

Definition at line 85 of file TargetTracker.h.

85{;}

◆ BeginPrimary()

virtual void TargetTracker::BeginPrimary ( )
inlinevirtual

Definition at line 82 of file TargetTracker.h.

82{;}

◆ ClassDef()

TargetTracker::ClassDef ( TargetTracker  ,
 
)

◆ ConstructGeometry()

void TargetTracker::ConstructGeometry ( )

Definition at line 172 of file TargetTracker.cxx.

173{
174 InitMedium("TTmedium");
175 TGeoMedium *TTmedium = gGeoManager->GetMedium("TTmedium");
176
177 InitMedium("vacuum");
178 TGeoMedium *vacuum = gGeoManager->GetMedium("vacuum");
179
180 InitMedium("CarbonComposite");
181 TGeoMedium *CarbonComposite = gGeoManager->GetMedium("CarbonComposite");
182
183 InitMedium("SciFiMat");
184 TGeoMedium *SciFiMat = gGeoManager->GetMedium("SciFiMat");
185
186 InitMedium("Airex");
187 TGeoMedium *Airex = gGeoManager->GetMedium("Airex");
188
189 //Target Tracker
190 TGeoVolume *volTarget = gGeoManager->GetVolume("volTarget");
191
192 TGeoBBox* TT_box = new TGeoBBox("TT_box", TTrackerX / 2, TTrackerY / 2, TTrackerZ / 2);
193 TGeoVolume* TT_volume = new TGeoVolume("TT", TT_box, vacuum);
194 TT_volume->SetLineColor(kBlue - 1);
195 //TT_volume->SetTransparency(1);
196 TT_volume->SetVisibility(1);
197 TT_volume->SetVisDaughters(1);
198
199 //Support Carbon Composite
200 TGeoBBox* TT_support_box = new TGeoBBox("TT_support_box", TTrackerX / 2, TTrackerY / 2, support_z / 2);
201 TGeoVolume* TT_support_volume = new TGeoVolume("TT_support", TT_support_box, CarbonComposite);
202 TT_support_volume->SetLineColor(kGray - 2);
203 TT_support_volume->SetVisibility(1);
204
205 //Honeycomb Airex (or Nomex)
206 TGeoBBox* TT_honeycomb_box = new TGeoBBox("TT_honeycomb_box", TTrackerX / 2, TTrackerY / 2, honeycomb_z / 2);
207 TGeoVolume* TT_honeycomb_volume = new TGeoVolume("TT_honeycomb", TT_honeycomb_box, Airex);
208 TT_honeycomb_volume->SetLineColor(kYellow);
209 TT_honeycomb_volume->SetVisibility(1);
210
211 //SciFi planes
212 TGeoBBox* TT_scifi_plane_hor_box = new TGeoBBox("TT_scifi_plane_hor_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
213 TGeoVolume* TT_scifi_plane_hor_volume = new TGeoVolume("TT_scifi_plane_hor", TT_scifi_plane_hor_box, SciFiMat);
214 TT_scifi_plane_hor_volume->SetVisibility(1);
215
216 TGeoBBox* TT_scifi_plane_vert_box = new TGeoBBox("TT_scifi_plane_vert_box", TTrackerX / 2, TTrackerY / 2, scifimat_z / 2);
217 TGeoVolume* TT_scifi_plane_vert_volume = new TGeoVolume("TT_scifi_plane_vert", TT_scifi_plane_vert_box, SciFiMat);
218 TT_scifi_plane_vert_volume->SetVisibility(1);
219
220 //SciFi mats for X and Y
221 TGeoBBox* TT_scifimat_hor_box = new TGeoBBox("TT_scifimat_hor_box", scifimat_hor / 2, scifimat_width / 2, scifimat_z / 2);
222 TGeoVolume* TT_scifimat_hor_volume = new TGeoVolume("TT_scifimat_hor", TT_scifimat_hor_box, SciFiMat);
223 TT_scifimat_hor_volume->SetLineColor(kCyan-9);
224
225 TGeoBBox* TT_scifimat_vert_box = new TGeoBBox("TT_scifimat_vert_box", scifimat_width / 2, scifimat_vert / 2, scifimat_z / 2);
226 TGeoVolume* TT_scifimat_vert_volume = new TGeoVolume("TT_scifimat_vert", TT_scifimat_vert_box, SciFiMat);
227 TT_scifimat_vert_volume->SetLineColor(kGreen-7);
228
229 //Add SciFi mat as sensitive unit
230 AddSensitiveVolume(TT_scifimat_hor_volume);
231 AddSensitiveVolume(TT_scifimat_vert_volume);
232
233 //Creating physical volumes and multiply
234 for (int i = 0; i < n_hor_planes; i++){
235 TT_scifi_plane_hor_volume->AddNode(TT_scifimat_hor_volume, i+1, new TGeoTranslation(0, (-(n_hor_planes-1)/2.0 + i)*scifimat_width, 0));
236 }
237 for (int i = 0; i < n_vert_planes; i++){
238 TT_scifi_plane_vert_volume->AddNode(TT_scifimat_vert_volume, 100+i+1, new TGeoTranslation((-(n_vert_planes-1)/2.0 + i)*scifimat_width, 0, 0));
239 }
240
241 TT_volume->AddNode(TT_support_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z/2));
242 TT_volume->AddNode(TT_scifi_plane_hor_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z/2));
243 TT_volume->AddNode(TT_scifi_plane_vert_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + scifimat_z + scifimat_z/2));
244 TT_volume->AddNode(TT_honeycomb_volume, 0, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z/2));
245 TT_volume->AddNode(TT_support_volume, 1, new TGeoTranslation(0, 0, -TTrackerZ/2 + support_z + 2*scifimat_z + honeycomb_z + support_z/2));
246
247 Double_t first_tt_position = -ZDimension / 2 + TTrackerZ / 2;
248
249 //fNTT - number of TT walls
250 for (int l = 0; l < fNTT; ++l){
251 volTarget->AddNode(TT_volume, 1000*(l+1), new TGeoTranslation(0, 0, first_tt_position + l * (TTrackerZ + CellWidth)));
252 }
253
254}
Double_t ZDimension
Double_t support_z
Double_t scifimat_z
Double_t scifimat_width
Int_t InitMedium(const char *name)
Double_t scifimat_vert
Double_t CellWidth
Double_t honeycomb_z
Double_t scifimat_hor
int i
Definition ShipAna.py:86

◆ CopyClones()

virtual void TargetTracker::CopyClones ( TClonesArray *  cl1,
TClonesArray *  cl2,
Int_t  offset 
)
inlinevirtual

The following methods can be implemented if you need to make any optional action in your detector during the transport.

Definition at line 76 of file TargetTracker.h.

77 {;}

◆ DecodeTTID()

void TargetTracker::DecodeTTID ( Int_t  detID,
Int_t &  NTT,
int &  nplane,
Bool_t &  ishor 
)

Definition at line 305 of file TargetTracker.cxx.

306{
307 NTT = detID/1000;
308 int idir = (detID - NTT*1000)/100;
309
310 if (idir == 1) ishor = kFALSE;
311 else if (idir == 0) ishor = kTRUE;
312
313 nplane = (detID - NTT*1000 - idir*100);
314}

◆ EndOfEvent()

void TargetTracker::EndOfEvent ( )
virtual

Definition at line 317 of file TargetTracker.cxx.

318{
319 fTTPointCollection->Clear();
320}

◆ FinishPrimary()

virtual void TargetTracker::FinishPrimary ( )
inlinevirtual

Definition at line 80 of file TargetTracker.h.

80{;}

◆ FinishRun()

virtual void TargetTracker::FinishRun ( )
inlinevirtual

Definition at line 81 of file TargetTracker.h.

81{;}

◆ GetCollection()

TClonesArray * TargetTracker::GetCollection ( Int_t  iColl) const
virtual

Gets the produced collections

Definition at line 336 of file TargetTracker.cxx.

337{
338 if (iColl == 0) { return fTTPointCollection; }
339 else { return NULL; }
340}

◆ Initialize()

void TargetTracker::Initialize ( )
virtual

Initialization of the detector is done here

Definition at line 102 of file TargetTracker.cxx.

103{
104 FairDetector::Initialize();
105}

◆ InitMedium()

Int_t TargetTracker::InitMedium ( const char *  name)
protected

Definition at line 108 of file TargetTracker.cxx.

109{
110 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
111 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
112 static FairGeoMedia *media=geoFace->getMedia();
113 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
114
115 FairGeoMedium *ShipMedium=media->getMedium(name);
116
117 if (!ShipMedium)
118 {
119 Fatal("InitMedium","Material %s not defined in media file.", name);
120 return -1111;
121 }
122 TGeoMedium* medium=gGeoManager->GetMedium(name);
123 if (medium!=NULL)
124 return ShipMedium->getMediumIndex();
125 return geoBuild->createMedium(ShipMedium);
126}

◆ operator=()

TargetTracker & TargetTracker::operator= ( const TargetTracker )

◆ PostTrack()

virtual void TargetTracker::PostTrack ( )
inlinevirtual

Definition at line 83 of file TargetTracker.h.

83{;}

◆ PreTrack()

virtual void TargetTracker::PreTrack ( )
inlinevirtual

Definition at line 84 of file TargetTracker.h.

84{;}

◆ ProcessHits()

Bool_t TargetTracker::ProcessHits ( FairVolume *  v = 0)
virtual

this method is called for each step during simulation (see FairMCApplication::Stepping())

This method is called from the MC stepping

Definition at line 257 of file TargetTracker.cxx.

258{
260 //Set parameters at entrance of volume. Reset ELoss.
261 if ( gMC->IsTrackEntering() ) {
262 fELoss = 0.;
263 fTime = gMC->TrackTime() * 1.0e09;
264 fLength = gMC->TrackLength();
265 gMC->TrackPosition(fPos);
266 gMC->TrackMomentum(fMom);
267 }
268 // Sum energy loss for all steps in the active volume
269 fELoss += gMC->Edep();
270
271 // Create muonPoint at exit of active volume
272 if (gMC->IsTrackExiting() ||
273 gMC->IsTrackStop() ||
274 gMC->IsTrackDisappeared() ){
275 if (fELoss == 0. ) { return kFALSE; }
276 TParticle* p=gMC->GetStack()->GetCurrentTrack();
277 Int_t pdgCode = p->GetPdgCode();
278 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
279
280 gMC->CurrentVolID(fVolumeID);
281 Int_t detID = fVolumeID;
282 Int_t TTstationID;
283 gMC->CurrentVolOffID(2, TTstationID);
284 fVolumeID = TTstationID + detID;
285
286 TLorentzVector Pos;
287 gMC->TrackPosition(Pos);
288 Double_t xmean = (fPos.X()+Pos.X())/2. ;
289 Double_t ymean = (fPos.Y()+Pos.Y())/2. ;
290 Double_t zmean = (fPos.Z()+Pos.Z())/2. ;
291
292 AddHit(fTrackID, fVolumeID, TVector3(xmean, ymean, zmean),
293 TVector3(fMom.Px(), fMom.Py(), fMom.Pz()),
294 fTime, fLength, fELoss, pdgCode);
295
296 // Increment number of muon det points in TParticle
297 ShipStack* stack = (ShipStack*) gMC->GetStack();
298 stack->AddPoint(ktauTT);
299 }
300
301 return kTRUE;
302}
TTPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgCode)

◆ Register()

void TargetTracker::Register ( )
virtual

Registers the produced collections in FAIRRootManager.

This will create a branch in the output tree called TargetPoint, setting the last parameter to kFALSE means: this collection will not be written to the file, it will exist only during the simulation.

Definition at line 323 of file TargetTracker.cxx.

324{
325
332 FairRootManager::Instance()->Register("TTPoint", "TargetTracker",
333 fTTPointCollection, kTRUE);
334}

◆ Reset()

void TargetTracker::Reset ( )
virtual

has to be called after each event to reset the containers

Definition at line 342 of file TargetTracker.cxx.

343{
344 fTTPointCollection->Clear();
345}

◆ SetBrickParam()

void TargetTracker::SetBrickParam ( Double_t  CellW)

Definition at line 152 of file TargetTracker.cxx.

◆ SetDesign()

void TargetTracker::SetDesign ( Int_t  Design)

Definition at line 167 of file TargetTracker.cxx.

◆ SetNumberSciFi()

void TargetTracker::SetNumberSciFi ( Int_t  n_hor_planes_,
Int_t  n_vert_planes_ 
)

Definition at line 139 of file TargetTracker.cxx.

140{
141 n_hor_planes = n_hor_planes_;
142 n_vert_planes = n_vert_planes_;
143}

◆ SetNumberTT()

void TargetTracker::SetNumberTT ( Int_t  n)

Definition at line 162 of file TargetTracker.cxx.

◆ SetSciFiParam()

void TargetTracker::SetSciFiParam ( Double_t  scifimat_width_,
Double_t  scifimat_hor_,
Double_t  scifimat_vert_,
Double_t  scifimat_z_,
Double_t  support_z_,
Double_t  honeycomb_z_ 
)

Definition at line 128 of file TargetTracker.cxx.

130{
131 scifimat_width = scifimat_width_;
132 scifimat_hor = scifimat_hor_;
133 scifimat_vert = scifimat_vert_;
134 scifimat_z = scifimat_z_;
135 support_z = support_z_;
136 honeycomb_z = honeycomb_z_;
137}

◆ SetSpecialPhysicsCuts()

virtual void TargetTracker::SetSpecialPhysicsCuts ( )
inlinevirtual

Definition at line 78 of file TargetTracker.h.

78{;}

◆ SetTargetTrackerParam()

void TargetTracker::SetTargetTrackerParam ( Double_t  TTX,
Double_t  TTY,
Double_t  TTZ 
)

Definition at line 145 of file TargetTracker.cxx.

146{
147 TTrackerX = TTX;
148 TTrackerY = TTY;
149 TTrackerZ = TTZ;
150}

◆ SetTotZDimension()

void TargetTracker::SetTotZDimension ( Double_t  Zdim)

Definition at line 157 of file TargetTracker.cxx.

158{
159 ZDimension = Zdim;
160}

Member Data Documentation

◆ CellWidth

Double_t TargetTracker::CellWidth
protected

Definition at line 124 of file TargetTracker.h.

◆ fDesign

Int_t TargetTracker::fDesign
protected

Definition at line 129 of file TargetTracker.h.

◆ fELoss

Double32_t TargetTracker::fELoss
private

length

Definition at line 104 of file TargetTracker.h.

◆ fLength

Double32_t TargetTracker::fLength
private

time

Definition at line 103 of file TargetTracker.h.

◆ fMom

TLorentzVector TargetTracker::fMom
private

position at entrance

Definition at line 101 of file TargetTracker.h.

◆ fNTT

Int_t TargetTracker::fNTT
protected

Definition at line 127 of file TargetTracker.h.

◆ fPos

TLorentzVector TargetTracker::fPos
private

volume id

Definition at line 100 of file TargetTracker.h.

◆ fTime

Double32_t TargetTracker::fTime
private

momentum at entrance

Definition at line 102 of file TargetTracker.h.

◆ fTrackID

Int_t TargetTracker::fTrackID
private

Track information to be stored until the track leaves the active volume.

Definition at line 98 of file TargetTracker.h.

◆ fTTPointCollection

TClonesArray* TargetTracker::fTTPointCollection
private

energy loss

container for data points

Definition at line 107 of file TargetTracker.h.

◆ fVolumeID

Int_t TargetTracker::fVolumeID
private

track index

Definition at line 99 of file TargetTracker.h.

◆ honeycomb_z

Double_t TargetTracker::honeycomb_z
protected

Definition at line 120 of file TargetTracker.h.

◆ n_hor_planes

Int_t TargetTracker::n_hor_planes
protected

Definition at line 121 of file TargetTracker.h.

◆ n_vert_planes

Int_t TargetTracker::n_vert_planes
protected

Definition at line 122 of file TargetTracker.h.

◆ scifimat_hor

Double_t TargetTracker::scifimat_hor
protected

Definition at line 116 of file TargetTracker.h.

◆ scifimat_vert

Double_t TargetTracker::scifimat_vert
protected

Definition at line 117 of file TargetTracker.h.

◆ scifimat_width

Double_t TargetTracker::scifimat_width
protected

Definition at line 115 of file TargetTracker.h.

◆ scifimat_z

Double_t TargetTracker::scifimat_z
protected

Definition at line 118 of file TargetTracker.h.

◆ support_z

Double_t TargetTracker::support_z
protected

Definition at line 119 of file TargetTracker.h.

◆ TTrackerX

Double_t TargetTracker::TTrackerX
protected

Definition at line 111 of file TargetTracker.h.

◆ TTrackerY

Double_t TargetTracker::TTrackerY
protected

Definition at line 112 of file TargetTracker.h.

◆ TTrackerZ

Double_t TargetTracker::TTrackerZ
protected

Definition at line 113 of file TargetTracker.h.

◆ ZDimension

Double_t TargetTracker::ZDimension
protected

Definition at line 125 of file TargetTracker.h.


The documentation for this class was generated from the following files: