Creating a new Detector out of 2 or more detectors [message #13129] |
Fri, 02 March 2012 19:53 |
Raghav Kunnawalkam
Messages: 63 Registered: February 2012 Location: Stony Brook, New York
|
continuous participant |
From: *physics.sunysb.edu
|
|
Hi All
My goal is to create the EIC detector and for it, i have individually created all the required detectors like (Hcal, Ecal, Tpc, etc..) and their geometries. and built them and got the respective libraries (libFairDircDet, etc..)
Now i am having the problem of linking them in the same macro.
My directory structure: ~/Fairroot/examples/ - has the following.
CMakeLists.txt HcalDet TrsDet geometry mcstack
DircDet HtckDet Tutorial1 geometry_eic passive
EmlfDet SitDet Tutorial2 geometry_old rutherford
FgtDet TpcDet gconfig geometry_v2 simpletracker
the macro that i am using is inside simpletracker/macros/run_simpletracker.C
I have also linked the libraries inside the cmakefile in simpletracker/src/CMakeLists.txt
...
set(INCLUDE_DIRECTORIES
${ROOT_INCLUDE_DIR}
#put here all directories where header files are located
${FAIRROOT_SOURCE_DIR}/fairtools
${FAIRROOT_SOURCE_DIR}/base
${FAIRROOT_SOURCE_DIR}/parbase
${FAIRROOT_SOURCE_DIR}/geobase
${FAIRROOT_SOURCE_DIR}/example/mcstack
${FAIRROOT_SOURCE_DIR}/example/simpletracker/src
${FAIRROOT_SOURCE_DIR}/example/DircDet/src
${FAIRROOT_SOURCE_DIR}/example/EmlfDet/src
${FAIRROOT_SOURCE_DIR}/example/FgtDet/src
${FAIRROOT_SOURCE_DIR}/example/HcalDet/src
${FAIRROOT_SOURCE_DIR}/example/HtckDet/src
${FAIRROOT_SOURCE_DIR}/example/SitDet/src
${FAIRROOT_SOURCE_DIR}/example/TpcDet/src
${FAIRROOT_SOURCE_DIR}/example/TrsDet/src
)
include_directories( ${INCLUDE_DIRECTORIES})
...
Even still inside my macro, when i do
FairDetector* Dirc = new FairDircDet("DIRC", kFALSE);
Dirc->SetGeometryFileName("dirc.geo");
run->AddModule(Dirc);
Root tells me that :
Error: Symbol FairDircDet is not defined in current scope run_simpletracker.C:118:
Error: type FairDircDet not defined FILE:/Users/raghav/fairroot/example/simpletracker/macros/./run_simpletra cker.C LINE:118
I cannot find a tutorial or a link on the website telling me how to link 2 detectors.
Any help will be greatly appreciated.
Thanks a lot
|
|
|
Re: Creating a new Detector out of 2 or more detectors [message #13134 is a reply to message #13129] |
Fri, 02 March 2012 20:40 |
Mohammad Al-Turany
Messages: 518 Registered: April 2004 Location: GSI, Germany
|
first-grade participant |
From: *dip.t-dialin.net
|
|
Hallo Raghav,
If you follow the instruction on the web you create for each detector (directory) a shared library (So it is linked already), now to use these libraries in macro you have to load them first, did you load your libFairDircDet, etc.. libraries in the macro? i.e: do you have something like : gSystem->Load("libFairDircDet") in your macro?
Mohammad
[Updated on: Fri, 02 March 2012 20:40] Report message to a moderator
|
|
|
Re: Creating a new Detector out of 2 or more detectors [message #13138 is a reply to message #13134] |
Sat, 03 March 2012 03:32 |
Raghav Kunnawalkam
Messages: 63 Registered: February 2012 Location: Stony Brook, New York
|
continuous participant |
From: *dyn.optonline.net
|
|
Hi Mohammad
I do have gSystem->Load("libFairDircDet") amongst all the other libraries in my macro.
Here is part of my CMakeLists.txt file inside the DircDet directory.
set(INCLUDE_DIRECTORIES
${ROOT_INCLUDE_DIR}
#put here all directories where header files are located
${FAIRROOT_SOURCE_DIR}/fairtools
${FAIRROOT_SOURCE_DIR}/base
${FAIRROOT_SOURCE_DIR}/parbase
${FAIRROOT_SOURCE_DIR}/geobase
${FAIRROOT_SOURCE_DIR}/example/mcstack
${FAIRROOT_SOURCE_DIR}/example/simpletracker/src
${FAIRROOT_SOURCE_DIR}/example/DircDet/src
)
include_directories( ${INCLUDE_DIRECTORIES})
set(LINK_DIRECTORIES
${ROOT_LIBRARY_DIR}
...
Rest of the file is built exactly like the instructions on the website.
I think that i did not do the linking properly but i dont understand why because i did it exactly like how the example rutherford was designed.
I have also built all the libraries for the detectors with no errors so they do exist properly.
Another problem that i have is with building the passive components like fairpipe.
I have it built exactly like the FairMagnet (with the appropriate changes for geometry and media, but on doing make, it gives me an error like
[ 61%] Built target FairRutherford
[ 61%] Generating FairPassiveDict.cxx, FairPassiveDict.h
[ 61%] Building CXX object example/passive/CMakeFiles/Passive.dir/FairGeoPipe.o
In file included from /usr/include/c++/4.2.1/typeinfo:39,
from /Users/raghav/fairsoft/tools/root/include/Rtypeinfo.h:32,
from /Users/raghav/fairsoft/tools/root/include/Rtypes.h:30,
from /Users/raghav/fairsoft/tools/root/include/TObject.h:31,
from /Users/raghav/fairroot/geobase/FairGeoVector.h:4,
from /Users/raghav/fairroot/geobase/FairGeoTransform.h:4,
from /Users/raghav/fairroot/geobase/FairGeoSet.h:5,
from /Users/raghav/fairroot/example/passive/FairGeoPipe.h:4,
from /Users/raghav/fairroot/example/passive/FairGeoPipe.cxx:11:
/usr/include/c++/4.2.1/exception:40: error: ‘#pragma’ is not allowed here
make[2]: *** [example/passive/CMakeFiles/Passive.dir/FairGeoPipe.o] Error 1
make[1]: *** [example/passive/CMakeFiles/Passive.dir/all] Error 2
make: *** [all] Error 2
Many thanks for all your help. (it has been awesome)
|
|
|
|
|
|
|
Re: Creating a new Detector out of 2 or more detectors [message #13143 is a reply to message #13142] |
Sat, 03 March 2012 22:41 |
Raghav Kunnawalkam
Messages: 63 Registered: February 2012 Location: Stony Brook, New York
|
continuous participant |
From: *dyn.optonline.net
|
|
Hi Mohammad
Thanks for your help, Now the eicpassive components work and i was able to build all the libraries without any problem.
But now when i run my macro, root still tells me that
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
*********************************************************
[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/pipe.geo
[INFO ] User path for detector geometry : /Users/raghav/fairroot/example/geometry/magnet.geo
[INFO ] User path for detector geometry : /Users/raghav/fairroot/example/geometry/dpm.geo
loading detectors
Error: Symbol FairDircDet is not defined in current scope run_simpletracker.C:101:
Error: type FairDircDet not defined FILE:/Users/raghav/fairroot/example/eicroot/simpletracker/macros/./run_s impletracker.C LINE:101
*** Interpreter error recovered ***
root [1]
I have also uploaded the geometry files if you would like to check them.
Cheers
Raghav
-
Attachment: geometry.zip
(Size: 85.32KB, Downloaded 230 times)
[Updated on: Sat, 03 March 2012 22:42] Report message to a moderator
|
|
|
|
|
|
|
Re: Creating a new Detector out of 2 or more detectors [message #13164 is a reply to message #13163] |
Thu, 08 March 2012 17:39 |
Raghav Kunnawalkam
Messages: 63 Registered: February 2012 Location: Stony Brook, New York
|
continuous participant |
From: *physics.sunysb.edu
|
|
Update:
Hi Mohammad
I just solved the problem. It was really simple, inside my FairDircDetGeo.cxx files, i have set the name of the module to be dircdet where as i was defining the module name inside the geometry file as dirc.
So it did not build it.
Now i can go ahead and build them all.
Thanks again for your help
Cheers
Raghav
|
|
|