GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Fairroot » General Discussion » Units for geometry in .geo files and in root. And FairDetectorPoint questions
Units for geometry in .geo files and in root. And FairDetectorPoint questions [message #13743] Wed, 11 July 2012 22:12
Raghav Kunnawalkam is currently offline  Raghav Kunnawalkam
Messages: 63
Registered: February 2012
Location: Stony Brook, New York
continuous participant
From: *
Hi All

I am having some weird issues (no that it is a problem just a inconvenience) with the units for geometry in the .geo files and in my root macros and event display.
I am finding that they are not the same units in both places. It looks like the geometry file needs 10 times scaled values.

for example, say that i create a box with the dimentions 10,10,10. in the .geo file and place it in the middle of my space. Now i create an electron with random angle and momentum but i give the starting vertex as 0,0,0. So when i get the FairDetectorPoint.GetPosition() of that object, it is off by a factor of 10. I have no idea why this is happening. I wanted to ask about this earlier actually.

Now for the questions on the FairDetectorPoint. I want to both the position_in (position the track enters the detector volume) and the position_out (position the track leaves or dies or exits the volume) to do digitization for that particular track.

So i changed my processes hit function and all the constructors of my detector so that they look like this:

Bool_t FairEmca::ProcessHits(FairVolume* vol)
/** This method is called from the MC stepping */

//Set parameters at entrance of volume. Reset ELoss.
if ( gMC->IsTrackEntering() ) {
fELoss = 0.;
fTime = gMC->TrackTime() * 1.0e09;
fLength = gMC->TrackLength();
//checking to see if it will record my end positin at exit as position

// if (gMC->IsTrackExiting()) {
// gMC->TrackPosition(fPosOut);
// }

// Sum energy loss for all steps in the active volume
fELoss += gMC->Edep();

// Create FairEmcaPoint at exit of active volume
if ( gMC->IsTrackExiting() ||
gMC->IsTrackStop() ||
gMC->IsTrackDisappeared() ) {
fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
fVolumeID = vol->getMCid();
//if (fELoss == 0. ) { return kFALSE; }
AddHit(fTrackID, fVolumeID, TVector3(fPos.X (), fPos.Y(), fPos.Z()),
TVector3(fMom.Px(), fMom.Py(), fMom.Pz()), fTime, fLength,
fELoss, TVector3(fPosOut.X (),fPosOut.Y(),fPosOut.Z()));

// Increment number of FairEmca points in TParticle
FairStack* stack = (FairStack*) gMC->GetStack();

return kTRUE;

FairEmcaPoint* FairEmca::AddHit(Int_t trackID, Int_t detID,
TVector3 pos, TVector3 mom,
Double_t time, Double_t length,
Double_t eLoss, TVector3 posOut)
TClonesArray& clref = *fFairEmcaPointCollection;
Int_t size = clref.GetEntriesFast();
return new(clref[size]) FairEmcaPoint(trackID, detID, pos, mom,
time, length, eLoss, posOut, pos.Mag(), pos.Phi(), pos.Theta());

// ----- Standard constructor
FairEmcaPoint::FairEmcaPoint(Int_t trackID, Int_t detID,
TVector3 pos, TVector3 mom,
Double_t tof, Double_t length, Double_t eLoss, TVector3 posOut, Double_t radius,
Double_t phi, Double_t theta)
: FairMCPoint(trackID, detID, pos, mom, tof, length, eLoss), fRadius(radius), fPhi(phi),fTheta(theta)
{ fXfOut = posOut.X ();
fYfOut = posOut.Y();
fZfOut = posOut.Z();
SetLink(FairLink("MCTrack", trackID));

Even after doing these changes, i am still getting 0,0,0 for the position_out which means that it is not taking any value. Is there something that i am missing to change or update in one of the classes.

I also have another question regarding


i had it initially as 1 and root asked me to change it when i included position_out. Can anyone please tell me what does it mean, why is it 5 for some detectors in panda etc..

As always i appreciate the help a lot.

Read Message
Previous Topic: step length for VMC
Next Topic: Running Pythia input on Geant4 not working
Goto Forum:

Current Time: Mon Jun 17 07:01:03 CEST 2024

Total time taken to generate the page: 0.01072 seconds