GSI Forum
GSI Helmholtzzentrum für Schwerionenforschung

Home » Fairroot » General Discussion » Detector materials with radiation length not equal to zero
Detector materials with radiation length not equal to zero [message #13170] Sun, 11 March 2012 19:04 Go to next message
Raghav Kunnawalkam is currently offline  Raghav Kunnawalkam
Messages: 63
Registered: February 2012
Location: Stony Brook, New York
continuous participant
From: *dyn.optonline.net
Hi All

this may be a very simple or silly question but for the fairrutherford example given in fairroot, all the materials described in the media.geo file have radiation length set to 0. But when i try to give it a non zero value for example

gold 1 196.97 79. 19.3
0.3344 1 20. .0001
0

and try to just build the target (the gold foil), the program just eats up my memory and crashes my computer. (2010 MacBook Pro, 4GB ram, Intel i7 2.66GHz)

Processing run_rutherford.C...
*********************************************************
* The Pluto event generator
* Developed by HADES and all contributing AUTHORS
* www-hades.gsi.de/computing/pluto/html/PlutoIndex.html
* Version: 5.37
* Compiled on 26 January 2012
*********************************************************
[INFO ] Media file used : /Users/raghav/fairroot/example/geometry/media.geo
[INFO ] User path for detector geometry : /Users/raghav/fairroot/example/geometry/cave.geo
[INFO ] User path for detector geometry : /Users/raghav/fairroot/example/geometry/target.geo
-I- FairIon: New ion FairIon1, z = 2, a = 4, charge = 2, mass = 3.75309 GeV
[INFO ] ============== FairRunSim: Initialising simulation run ==============
Info in <TGeoManager::TGeoManager>: Geometry FAIRGeom, FAIR geometry created
-I- FairGeoMedia Read media
(this is where it stops, and i gave it more than 3 hours)


But i can build it (and my EIC detector) fine when i say
gold 1 196.97 79. 19.3
0 1 20. .0001
0
Is this some issue with the memory or speed of my computer.

Also i want to look at the radiation length budget of my detector (plot of radiation length budget vs \eta at const z=0 or z at constant \eta = 0) once i build it with a nonzero radiation length and i understand that i can do it directly from fairroot itself. I tried to look for it but could not find out how to do it.

Any help will be much appreciated

Thanks
Raghav

Thanks
Re: Detector materials with radiation length not equal to zero [message #13171 is a reply to message #13170] Sun, 11 March 2012 23:03 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *dip.t-dialin.net
Hi Raghav,

The radiation length cannot be set from the media file! sorry this is a mistake in the documentation which I just corrected, this has changed since very long time. The radiation length for media is simply calculated.

To calculate the radiation length for your detector, take a look to:

https://subversion.gsi.de/trac/fairroot/browser/pandaroot/trunk/macro/ru n/rad_complete_stt.C

it is a simulation macro but you have to activate the radiation length manager, i.e:

fRun->SetRadLenRegister(kTRUE);

and to make it run faster, set all your detectors to inactive, .i.e:

FairDetector *Mvd = new PndMvdDetector("MVD", kFALSE);

Which means the detector will not register any hits.

In the generator part you need to use Geantino in the box generator and you can set theta and phi to the values you went to scan.

The output of this macro, is a tree with "RadLen" branch which contain the info about the radiation length along the path you choose for simulation, the Radiation length manager register a point each time it exit a volume in the geometry.

regards

Mohammad

Re: Detector materials with radiation length not equal to zero [message #13172 is a reply to message #13171] Mon, 12 March 2012 01:24 Go to previous messageGo to next message
Raghav Kunnawalkam is currently offline  Raghav Kunnawalkam
Messages: 63
Registered: February 2012
Location: Stony Brook, New York
continuous participant
From: *dyn.optonline.net
Hi Mohammad

Thanks for your reply and it does work and i have a bunch of leaves inside my RadLen branch (although i do not know which data to take so that i can plot radiation length as a function theta)

1) I do not understand what you mean by geantino in the box generator. I have it looking at the whole space right now (\theta = 0 to 180 and \phi =0 to 360).

2 ) And also when you say that
"RadLen" branch which contain the info about the radiation length along the path you choose for simulation
i dont know where i specified the path of simulation.

3 ) Another thing is that root tells me when i open my output file that
root [0]
Attaching file eic.mc.root as _file0...
Warning in <TClass::TClass>: no dictionary for class FairMCTrack is available
Warning in <TClass::TClass>: no dictionary for class FairMCEventHeader is available
Warning in <TClass::TClass>: no dictionary for class FairRadLenPoint is available
Warning in <TClass::TClass>: no dictionary for class FairMCPoint is available
Warning in <TClass::TClass>: no dictionary for class FairBasePoint is available
Warning in <TClass::TClass>: no dictionary for class FairTimeStamp is available
Warning in <TClass::TClass>: no dictionary for class FairMultiLinkedData is available
Warning in <TClass::TClass>: no dictionary for class FairLinkedData is available
Warning in <TClass::TClass>: no dictionary for class FairFileHeader is available
root [1] TBrowser b
Does this mean that i am actually not calculating the radiation length.

Thanks a lot (sorry for a lot of questions, but this is very confusing)
Raghav

[Updated on: Mon, 12 March 2012 01:26]

Report message to a moderator

Re: Detector materials with radiation length not equal to zero [message #13175 is a reply to message #13172] Mon, 12 March 2012 13:43 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hi Raghav,

Quote:

1) I do not understand what you mean by geantino in the box generator. I have it looking at the whole space right now (\theta = 0 to 180 and \phi =0 to 360).


Geantino: virtual particles for simulation which do not interact with materials and undertake transportation processes only.

Choose the angels in the box generator to go in the direction you went to study, i.e: you went to register the radiation length going along this path.

Quote:


3 ) Another thing is that root tells me when i open my output file that
root [0]
Attaching file eic.mc.root as _file0...
Warning in <TClass::TClass>: no dictionary for class FairMCTrack is available
......
Warning in <TClass::TClass>: no dictionary for class FairFileHeader is available
root [1] TBrowser b
Does this mean that i am actually not calculating the radiation length.


No, it means you read a tree with objects, but you do not have load the libraries for these object! in case you only access standard types of the objects it is okay.

If you look at the class FairRadLenPoint you will see what things are saved in each point (The member variables of the class) these values are collected and saved for each volume you enter in the geometry. From these values you can generate your radiation length maps as you need.


Hope this will help you!

Mohammad
Re: Detector materials with radiation length not equal to zero [message #13216 is a reply to message #13175] Thu, 15 March 2012 22:34 Go to previous messageGo to next message
Raghav Kunnawalkam is currently offline  Raghav Kunnawalkam
Messages: 63
Registered: February 2012
Location: Stony Brook, New York
continuous participant
From: *dyn.optonline.net
Hi Mohammad

I followed it the way it was described in the panda detector case and when i run my macro, i am generating the branch RadLen and its corresponding leaves, but there is nothing inside them. They are all blank.
I tried to see what i am doing different from the panda example and i just cant make out the problem.


rad_complete_stt(Int_t nEvents = 1, TString SimEngine ="TGeant3", Float_t mom = 7.24)
{

//set the name of output file and etc...

//load libraries


Double_t BeamMomentum =15.0;

// ----- Create simulation run ----------------------------------------
FairRunSim* run = new FairRunSim();
run->SetName("TGeant3"); // Transport engine
// fRun->SetBeamMom(BeamMomentum);

// here it does not let me set the beam momentum even though it is defined in the class FairRunSim. Maybe thats the issue here. i am running a beam whit no momentum.

run->SetOutputFile(outFile); // Output file
FairRuntimeDb* rtdb = run->GetRuntimeDb();
// ------------------------------------------------------------------------


// ----- Create media -----------------------------------------------------

run->SetMaterials("media.geo");//materials
//---------------------------------------------------------------------- -

// ----- Tell the detector to calculate the radiation length -------------

run->SetRadLenRegister(kTRUE);

// ------------------------------------------------------------------------

// ----- Runtime database ---------------------------------------------


Bool_t kParameterMerged = kTRUE;
FairParRootFileIo* parOut = new FairParRootFileIo(kParameterMerged);
// FairParAsciiFileIo* parOut = new FairParAsciiFileIo();
parOut->open(parFile.Data());
rtdb->setOutput(parOut);
rtdb->saveOutput();
rtdb->print();


//create geometry, modules and detectors.


// ----- Create PrimaryGenerator --------------------------------------
FairPrimaryGenerator* primGen = new FairPrimaryGenerator();
run->SetGenerator(primGen);

FairBoxGenerator* boxGen = new FairBoxGenerator(0, 10); // 13 = muon; 1 = multipl.
// the 0 here represents geantino.
boxGen->SetPtRange(mom,mom); // GeV/c
boxGen->SetPhiRange(0., 360.); // Azimuth angle range [degree]
boxGen->SetThetaRange(0., 0.); // Polar angle in lab system range [degree]
boxGen->SetXYZ(0., 0., 0.); // mm o cm ??
primGen->AddGenerator(boxGen);

// ----- Run initialisation -------------------------------------------

run->Init();

// ----- Start run ----------------------------------------------------

run->Run(nEvents);
// ------------------------------------------------------------------------
run->CreateGeometryFile("data/geofile_rad_length.root");

// ----- Finish -------------------------------------------------------
timer.Stop();
Double_t rtime = timer.RealTime();
Double_t ctime = timer.CpuTime();
cout << endl << endl;
cout << "Macro finished succesfully." << endl;
cout << "Output file is " << outFile << endl;
cout << "Parameter file is " << parFile << endl;
cout << "Real time " << rtime << " s, CPU time " << ctime
<< "s" << endl << endl;
// ------------------------------------------------------------------------ end of file
}


The panda example is pretty much the same except geometry definitions, but there is something inside its RadLen folder. I just dont understand the mistake i am making here.
I have attached a picture of what my root file looks like and on the canvas you can see that there is nothing inside the leaf fradlen.

thanks a lot for all you help
Cheers
Raghav

[Updated on: Thu, 15 March 2012 22:35]

Report message to a moderator

Re: Detector materials with radiation length not equal to zero [message #13217 is a reply to message #13216] Thu, 15 March 2012 23:05 Go to previous messageGo to next message
Raghav Kunnawalkam is currently offline  Raghav Kunnawalkam
Messages: 63
Registered: February 2012
Location: Stony Brook, New York
continuous participant
From: *dyn.optonline.net
Update:

I looked inside parbase and looks like you guys have added something else and are including it in the CMakeLists.txt file. So i went ahead and did that change for all my detectors and built fairroot, but i am still stuck with the same error.

Update:

I thought that it was some problem with the library involving FairRunSim, so i did an update and built fairroot again and tried to run my macro again.

Now it is having problems reading libparbase ( my eic, rutherford, none of them can read it)


Processing run_rutherford.C...
*********************************************************
* The Pluto event generator
* Developed by HADES and all contributing AUTHORS
* www-hades.gsi.de/computing/pluto/html/PlutoIndex.html
* Version: 5.37
* Compiled on 26 January 2012
*********************************************************
dlopen error: dlopen(/Users/raghav/fairroot/build/lib/libParBase.so, 9): Symbol not found: __ZN10ValContext11ShowMembersER16TMemberInspector
Referenced from: /Users/raghav/fairroot/build/lib/libParBase.so
Expected in: flat namespace
in /Users/raghav/fairroot/build/lib/libParBase.so
Load Error: Failed to load Dynamic link library /Users/raghav/fairroot/build/lib/libParBase.so
Warning: Return value of void run_rutherford() ignored run_rutherford.C:37:
root [1] .q



Processing run_simpletracker.C...
*********************************************************
* The Pluto event generator
* Developed by HADES and all contributing AUTHORS
* www-hades.gsi.de/computing/pluto/html/PlutoIndex.html
* Version: 5.37
* Compiled on 26 January 2012
*********************************************************
dlopen error: dlopen(/Users/raghav/fairroot/build/lib/libParBase.so, 9): Symbol not found: __ZN10ValContext11ShowMembersER16TMemberInspector
Referenced from: /Users/raghav/fairroot/build/lib/libParBase.so
Expected in: flat namespace
in /Users/raghav/fairroot/build/lib/libParBase.so
Load Error: Failed to load Dynamic link library /Users/raghav/fairroot/build/lib/libParBase.so
Warning: Return value of void run_simpletracker() ignored run_simpletracker.C:45:
root [1] .q


It is the same error for both which is very weird. I will keep working on this (i just saw this and thought that i should let you know)

Thanks
Raghav

[Updated on: Thu, 15 March 2012 23:39]

Report message to a moderator

Re: Detector materials with radiation length not equal to zero [message #13218 is a reply to message #13217] Fri, 16 March 2012 08:58 Go to previous messageGo to next message
Florian Uhlig is currently offline  Florian Uhlig
Messages: 424
Registered: May 2007
first-grade participant
From: *gsi.de
Hi Raghav,

the problem comes due to the fact that we introduced some new classes for data base handling. This classes are compiled in a new Library libFairDB. We did the changes in the main CMakeLists.txt for all our projects, but forgot to change it in fairbase. I correct now the file and changed also the macros. If you have your own macros please
add also a line loading the new library. As an example you can check one of the macros which are in the examples directory.

Please do a "svn update" in your source directory and then it should work again.

Sorry for the inconvenience.

Ciao

Florian
Re: Detector materials with radiation length not equal to zero [message #13224 is a reply to message #13216] Fri, 16 March 2012 12:36 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hallo Raghav,

There was a change in the base classes for the stack in the last few months which we forget to propagate to the examples! Sorry for that. Due to this your stack was empty all the time and Geant did not have anything to propagate, So Geant3 was producing an empty tree as you seen, and Geant4 was telling at least that he has nothing to transport! This change was done for all experiments but not in the tutorials. Now it is corrected andy should work. Just update the fairbase.

Cheers,
Mohammad
Re: Detector materials with radiation length not equal to zero [message #13238 is a reply to message #13224] Wed, 21 March 2012 03:57 Go to previous messageGo to next message
Raghav Kunnawalkam is currently offline  Raghav Kunnawalkam
Messages: 63
Registered: February 2012
Location: Stony Brook, New York
continuous participant
From: *dyn.optonline.net
Hi Mohammad and Florian

Thanks a lot for your info. I was away and sick for the past few days so i could not get to work on this till now.

I did the update as you suggested and it looks like the example is working but my eic is not quite running properly.

root does not give me any errors actually but it is also not producing anything in the root files. I am puzzled by this information given to me by root.

...
MZLINK. Initialize Link Area /GCSLNK/ for Store 0 NL/NS= 100 100
-I- G3Config: Geant3 with TGeo has been created.
SetCuts Macro: Setting Processes..
SetCuts Macro: Setting cuts..
Info in <TGeoManager::SetTopVolume>: Top volume is cave. Master volume is cave
Info in <TGeoNavigator::BuildCache>: --- Maximum geometry depth set to 100
Error in <TString::AssertElement>: out of bounds: i = 10, Length = 8
Info in <TGeoManager::CheckGeometry>: Fixing runtime shapes...
Info in <TGeoManager::CheckGeometry>: ...Nothing to fix
Info in <TGeoManager::CloseGeometry>: Counting nodes...
Info in <TGeoManager::Voxelize>: Voxelizing...
Info in <TGeoManager::CloseGeometry>: Building cache...
Info in <TGeoManager::CloseGeometry>: 6 nodes/ 6 volume UID's in FAIR geometry
Info in <TGeoManager::CloseGeometry>: ----------------modeler ready----------------
[INFO ] [20.03.2012 21:19:13] [FairMCApplication.cxx::InitGeometry:716] Simulation RunID: 832549119

Calculating cross section tables, see gphysi.dat for more information

Cross section calculation concluded successfully
[INFO ] [20.03.2012 21:19:13] [FairMCApplication.cxx::InitMC:226] Monte carlo Engine Initialisation with : TGeant3TGeo
**** GTRIGI: IEVENT= 1 IDEVT= 1 Random Seeds = 4357 0
[INFO ] [20.03.2012 21:19:13] [FairPrimaryGenerator.cxx::GenerateEvent:170] FairPrimaryGenerator: (Event 1) 1 primary tracks from vertex (0.000000, 0.000000, 0.000000 ) Event Time = 0.000000 (ns)

*** GTRACK *** More than 10000 steps, tracking abandoned!
=====> TRACK 1 STACK NR 0 NTMULT= 1 GEANTINO TOFG =********** NS
X Y Z R NAME NUMBER SLENG STEP DESTEP GEKIN MECHANISMS
0.0000 0.0000 NaN 0.0000 cave 1 ******************** 0.0 eV Infinity TeV SMAX STOP
IEVENT 1 IDEVT 1 Random Seeds 4357 0 Time of flight ********** ns

-I- FairStack: Filling MCTrack array...
-I- FairStack: Number of primaries = 1
Total number of particles = 1
Number of tracks in output = 1
Track 0, mother : -1, Type 0, momentum (7.23999, -0.0117479, inf) GeV
Ref 0, TutDet 0, Rutherford 0
-I- FairStack: Updating track indizes......stack and 1 collections updated.


Macro finished succesfully.
Output file is /Users/raghav/fairroot/example/eicroot/simpletracker/macros/data/eic.mc. root
Parameter file is /Users/raghav/fairroot/example/eicroot/simpletracker/macros/data/params_ eic.root
Real time 1.4036 s, CPU time 0.95s

(int)1997311856



I do not understand what does it mean when it says that the geantino has more than 1000 steps.

Also, just another point on the example rutherford, i am still not able to see any tracks on the event display. Is it something to do with initializing tracks in the eventDisplay.C macro?

Regarding the tracks, it does like when i try to set any cuts. (this i am very doubtful on because sometimes it takes it and other times it does not take it)

Another question i have is, does the matter of initializing the box generator, set tracks etc.. in the macro count? (it may be a very stupid question in that it obviously counts, but i would like a general solution like first i define this, then that etc...)


Thanks a lot for all your help

Raghav
Re: Detector materials with radiation length not equal to zero [message #13248 is a reply to message #13238] Thu, 22 March 2012 14:09 Go to previous messageGo to next message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *gsi.de
Hallo Raghav,

There is an error somewhere in your code:

Quote:

Error in <TString::AssertElement>: out of bounds: i = 10, Length = 8


So it is not clear if everything was initialized properly!

Quote:

I do not understand what does it mean when it says that the geantino has more than 1000 steps.



Normally this you get when a particle loops without loosing energy, getting this for a Rootino (Geantino) is very strange for me, so I guess it is a side effect of the error above.


Quote:

Also, just another point on the example rutherford, i am still not able to see any tracks on the event display. Is it something to do with initializing tracks in the eventDisplay.C macro?




If you use the run_rad.C or run_rutherfod.C followed by the event display.C you should see:

index.php?t=getfile&id=6880&private=0


in the GUI, (which is an example and each experiment should do there own) you should first select the FairEventManager, then an info tab will show up where you can select the event you went to draw, not really straight forward but as example it should be ok!


Quote:

Another question i have is, does the matter of initializing the box generator, set tracks etc.. in the macro count? (it may be a very stupid question in that it obviously counts, but i would like a general solution like first i define this, then that etc...)


You do not need to call it yourself, the primary generator will do that for you, it was there for historical reasons, I remove it now.


For a full detailed example for the radiation length Ralf Kliemt did it for the MVD in Panda here is the examples:

Quote:

https://subversion.gsi.de/trac/fairroot/browser/pandaroot/trunk/macro/mv d/Ralf/materialsim.C
https://subversion.gsi.de/trac/fairroot/browser/pandaroot/trunk/macro/mv d/Ralf/materialana.C



Cheers,

Mohammad
Re: Detector materials with radiation length not equal to zero [message #13368 is a reply to message #13248] Wed, 18 April 2012 03:28 Go to previous messageGo to next message
Raghav Kunnawalkam is currently offline  Raghav Kunnawalkam
Messages: 63
Registered: February 2012
Location: Stony Brook, New York
continuous participant
From: *dyn.optonline.net
Hi Mohammad

I got rid of all the errors that you mentioned previously, but now i am faced with another problem.

My output from eicroot, looks exactly the same as the rutherford example. the radiation length plots all look the same.

This is what root tells me when running the radiation length calculator for eicroot:

...
first input: none
second input: none
output:
OBJ: FairParRootFile /Users/raghav/fairroot/example/eicroot/simpletracker/macros/data/params_ eic.root : 0 at: 0x7fd3504c2900
Root file I/O /Users/raghav/fairroot/example/eicroot/simpletracker/macros/data/params_ eic.root is open
detector I/Os: FairGenericParIo
**** GTRIGI: IEVENT= 1 IDEVT= 1 Random Seeds = 4357 0
[INFO ] [17.04.2012 21:25:27] [FairPrimaryGenerator.cxx::GenerateEvent:170] FairPrimaryGenerator: (Event 1) 1 primary tracks from vertex (0.000000, 0.000000, 0.000000 ) Event Time = 0.000000 (ns)
-I- FairStack: Filling MCTrack array...
-I- FairStack: Number of primaries = 1
Total number of particles = 1
Number of tracks in output = 1
Track 0, mother : -1, Type 0, momentum (0, -0, 0) GeV
Ref 0, TutDet 0, Rutherford 0
-I- FairStack: Updating track indizes......stack and 9 collections updated.


Macro finished succesfully.

Even though i have not mentioned the word rutherford anywhere in my eicroot directory, the output still is counting something like it. It is very puzzling to me.
And the log files for both look exactly the same (ofcourse the geometry part is different).

Last time you referred me to examples in panda, which either do not have the data files or the config files in them. So it is very hard to follow them.

Any ideas why it is still showing me rutherford?

Thanks a lot
Raghav
Re: Detector materials with radiation length not equal to zero [message #13376 is a reply to message #13368] Thu, 19 April 2012 22:26 Go to previous message
Mohammad Al-Turany is currently offline  Mohammad Al-Turany
Messages: 518
Registered: April 2004
Location: GSI, Germany
first-grade participant
From: *dip.t-dialin.net
Hi,

This comes from the FairMCTrack in example/mcstack directory. This is an example of filtering the stack and it is experiment specific, you use it as its and that is why you get the print outs with the rutherford.

regards,
Mohammad
Previous Topic: New update of fairroot not building properly
Next Topic: Doing collisions and input information.
Goto Forum:
  


Current Time: Tue Mar 19 12:33:12 CET 2024

Total time taken to generate the page: 0.00993 seconds