Forum: Persistency Not Logged In (login)
Show subscribers

Topics covering object persistency, persistency management, and databases are discussed here.

The email gateway for this forum is: persistency-g4hn@slac.stanford.edu


Inline Depth:
 0 0
 1 1
Add message: (add)

None test persistency HN, please ignore.  by Terry Hung <Terry Hung>,   Aug 04, 18:52
test persistency HN, please ignore.

-- 
Terry Hung - Stanford Linear Accelerator Center

None Test HyperNews, please ignore  by Terry Hung <Terry Hung>,   Aug 04, 18:50
test, please ignore.

Question Root file creation  by Kliakhandler Kosta <Kliakhandler Kosta>,   Jul 20, 16:41
Hello,

I have not found many examples of creating a root file with data, and the one I found (Persistency 01) does not compile for some reason (can't find the Txxx.h headers).

Despite this, I have managed to create something which compiles and creates a file. However, The file is always 314 bytes long, no matter what I try to write out to it.

I use something very similar to the RootIO class from the Persistency 01 example. I would like to write out hits, but I tried writing almost anything, including just a bunch of integers. Nothing works.

I can provide the code if it would help diagnosis. Any ideas?

Thanks.

Question STEP file import formats under Geant4 9.2?  by Mark Looper <Mark Looper>,   26 Mar, 2009
I have been trying to figure out how to use the new CAD file import capability in version 9.2, but the MEs I've talked to here don't recognize the file formats supported. Geant4 9.2 is supposed to be able to read STEP files, but the example given ($G4INSTALL/examples/extended/persistency/gdml/G02) doesn't use *.step or *.stp as the input file, but rather a pair of files with names of the form *.tree and *.geom. As I said, our SolidWorks users have never seen these; the README file calls them "STEP Tool files," so does that mean they are a (proprietary?) format put out by the commercial "STEP Tools" software (www.steptools.com)? Is there a way to translate a *.step file into such a file pair, preferably with some freeware app or SolidWorks add-on?

Also, in DetectorConstruction.cc of that example I see that parser.ParseST returns a G4LogicalVolume that encloses the "hardware" and is assigned one material, with the "hardware" assigned another material as a daughter volume. In the example input files, there is a single daughter volume; can the input file contain more than one? If so, do I understand correctly that all daughter volumes will be assigned a single material (Aluminum in the example), so that I will have to specify other materials by hand? Thanks.

Feedback Re: STEP file import formats under Geant4 9.2?  by John Watts <John Watts>,   27 Mar, 2009
Re: Question STEP file import formats under Geant4 9.2? (Mark Looper)
St-Viewer creates to tjhe proprietary format *.tree and *.geom files needed. The material is always aluminum. You will have to modify your geometry volume by volume.

FASTRAD is an alternative that claims to convert STEP to GDML. THey offer a free license but I don't seem to be able to get one that is current.

You should get the current patch which corrects some bugs with the GDML routines.

More Re: STEP file import formats under Geant4 9.2?  by Mark Looper <Mark Looper>,   06 May, 2009
Re: Feedback Re: STEP file import formats under Geant4 9.2? (John Watts)
Hello again--

I had previously played with FASTRAD a little, successfully converting a 111-element STEP file to GDML which I was able to import into Geant4 about a year ago. My free license expired, but I was able to obtain a new one (it appears that you need to reinstall the entire package, not just copy the new license file over the old one). However, it now appears that the GDML export is limited to 20 elements in the free (technically "trial") version of FASTRAD, which isn't enough to be of much use.

So it looks like my choices are to purchase the full version of FASTRAD, or to buy the ST-Developer package (http://www.steptools.com/products/stdev/) since ST-Viewer is no longer available separately. This all sounds awfully expensive -- does anybody have an idea of _how_ expensive (these kinds of companies never seem to include a simple, honest price list on their websites)? Or is there another free-or-cheap tool out there somewhere?

Thanks again--

--Mark Looper

On Fri, 27 Mar 2009 13:42:11 GMT, John Watts wrote:

> St-Viewer creates to tjhe proprietary format *.tree and *.geom files
> needed. The material is always aluminum. You will have to modify your
> geometry volume by volume.
> 
> FASTRAD is an alternative that claims to convert STEP to GDML. THey
> offer a free license but I don't seem to be able to get one that is
> current.
> 
> You should get the current patch which corrects some bugs with the GDML
> routines.
> 

More Re: STEP file import formats under Geant4 9.2?  by Mark Looper <Mark Looper>,   06 May, 2009
Re: More Re: STEP file import formats under Geant4 9.2? (Mark Looper)
I forgot to ask -- in Googling around I found some references to an "Open Frontier" project, which would (among other things) provide STEP-to-GDML translation capabilities using the "Open CASCADE" framework. Did anything come of this?

--Mark Looper

Feedback Problems with GDML in Geant4.9.2  by John Watts <John Watts>,   11 Feb, 2009
I have been attempting to modify my code to use the GDML routines in geant4.9.2. Previously I used the interface in GDML_2_10_0. I have found a couple of problems. 1. The VolumeAuxiliaryinformation map if owned by the G4GDMLReadStructure routine rather then the G4GDMLParser. Each time you read a new module file it is reset. 2. Matrix don't seem to work. I tried the matirx example, matricesandloop.gdml in the load_gdml of examples/extended/persistancy/gdml/G01. I got syntax errors.

Question Re: Problems with GDML in Geant4.9.2  by Gabriele Cosmo <Gabriele Cosmo>,   17 Feb, 2009
Re: Feedback Problems with GDML in Geant4.9.2 (John Watts)
> I have been attempting to modify my code to use the GDML routines in
> geant4.9.2. Previously I used the interface in GDML_2_10_0. I have found
> a couple of problems. 1. The VolumeAuxiliaryinformation map if owned by
> the G4GDMLReadStructure routine rather then the G4GDMLParser. Each time
> you read a new module file it is reset.

Sorry, it's not clear to me what you mean by this.
Can you please show how you associate the auxiliary information in your program
and how you load your modules ?

>2. Matrix don't seem to work. I
> tried the matirx example, matricesandloop.gdml in the load_gdml of
> examples/extended/persistancy/gdml/G01. I got syntax errors.

Can you please show what kind of errors you get ?
G01 with loops works just fine for me and I don't see any syntax error.

btw, if you believe there is a problem it would be faster and more effective for
everybody if you open a problem report in the Bugzilla system and provide with
all the information necessary for reproducing the problem. Thanks.
More Re: Problems with GDML in Geant4.9.2  by Gabriele Cosmo <Gabriele Cosmo>,   18 Feb, 2009
Re: Question Re: Problems with GDML in Geant4.9.2 (Gabriele Cosmo)
> I am using CLHEP.2.0.4.2 and xerces-c-3.0.0 on an Operron running
> Scientific Linux 5.1.
> 
> Attached is matricesandloops.gdml taken from
> GDML_2.1.10.0/CPPGDML/Examples/g4g0gdml. It was modified to point the
> the geant4.9.2 gdml schema.

ok, thanks for pointing out the setup to test. Indeed there seems to be
a problem with the interpretation of matrices.
Please, open a problem report in the Bugzilla system, so we can further
investigate and track it.

> Each gdml file consist five pieces: define, material, solids, structure,
> and setup. G4GDMLParser uses a G4GDMLReadStucture object to read the
> structure section. The GDML schema allows a geometry to be broken into
> separate modules. A lower level module is read in the structure section
> by defining a physvol with a tag <file name="child.gdm;"/>.
> G4GDMLReadStructure memeber, ReadFile, recursively call G4GDMLStructure
> to process this tag. This created object has it's own auxMap. This
> auxMap data should be inserted in the high level auxMap before the
> object goes out of scope otherwise G4GDMParser will not have access to
> it.

Can you please provide the use-case you refer to for reproducing the
problem, indicating how you associate the auxiliary information in your
code ?  I'd suggest you specify all this directly in the problem report
in Bugzilla. Thanks.
Feedback Re: Problems with GDML in Geant4.9.2 VolumeAuxilaryInformation issue  by John Watts <John Watts>,   17 Feb, 2009
Re: Question Re: Problems with GDML in Geant4.9.2 (Gabriele Cosmo)
On Tue, 17 Feb 2009 08:54:29 GMT, Gabriele Cosmo wrote:
> > I have been attempting to modify my code to use the GDML routines in
> > geant4.9.2. Previously I used the interface in GDML_2_10_0. I have found
> > a couple of problems. 1. The VolumeAuxiliaryinformation map if owned by
> > the G4GDMLReadStructure routine rather then the G4GDMLParser. Each time
> > you read a new module file it is reset.
> 
> Sorry, it's not clear to me what you mean by this.
> Can you please show how you associate the auxiliary information in your program
> and how you load your modules ?
> 
> >2. Matrix don't seem to work. I
> > tried the matirx example, matricesandloop.gdml in the load_gdml of
> > examples/extended/persistancy/gdml/G01. I got syntax errors.
> 
> Can you please show what kind of errors you get ?
> G01 with loops works just fine for me and I don't see any syntax error.
> 
> btw, if you believe there is a problem it would be faster and more effective for
> everybody if you open a problem report in the Bugzilla system and provide with
> all the information necessary for reproducing the problem. Thanks.
> 

Each gdml file consist five pieces: define, material, solids, structure, and setup. G4GDMLParser uses a G4GDMLReadStucture object to read the structure section. The GDML schema allows a geometry to be broken into separate modules. A lower level module is read in the structure section by defining a physvol with a tag <file name="child.gdm;"/>. G4GDMLReadStructure memeber, ReadFile, recursively call G4GDMLStructure to process this tag. This created object has it's own auxMap. This auxMap data should be inserted in the high level auxMap before the object goes out of scope otherwise G4GDMParser will not have access to it.

Feedback Re: Problems with GDML in Geant4.9.2 Matrix issue  by John Watts <John Watts>,   17 Feb, 2009
Re: Question Re: Problems with GDML in Geant4.9.2 (Gabriele Cosmo)
On Tue, 17 Feb 2009 08:54:29 GMT, Gabriele Cosmo wrote:
> > I have been attempting to modify my code to use the GDML routines in
> > geant4.9.2. Previously I used the interface in GDML_2_10_0. I have found
> > a couple of problems. 1. The VolumeAuxiliaryinformation map if owned by
> > the G4GDMLReadStructure routine rather then the G4GDMLParser. Each time
> > you read a new module file it is reset.
> 
> Sorry, it's not clear to me what you mean by this.
> Can you please show how you associate the auxiliary information in your program
> and how you load your modules ?
> 
> >2. Matrix don't seem to work. I
> > tried the matirx example, matricesandloop.gdml in the load_gdml of
> > examples/extended/persistancy/gdml/G01. I got syntax errors.
> 
> Can you please show what kind of errors you get ?
> G01 with loops works just fine for me and I don't see any syntax error.
> 
> btw, if you believe there is a problem it would be faster and more effective for
> everybody if you open a problem report in the Bugzilla system and provide with
> all the information necessary for reproducing the problem. Thanks.
> 

Here is my output from load_gdml

[wattsjw@watts G01]$ load_gdml matricesandloops.gdml

Usage: load_gdml <intput_gdml_file:mandatory> <output_gdml_file:optional>

G4GDML: Reading 'matricesandloops.gdml'...
G4GDML: Reading definitions...
G4GDML: Reading materials...
G4GDML: Reading solids...

*** ExceptionHandler is not defined ***

*** G4Exception : InvalidExpression
      issued by : G4GDMLEvaluator::SolveBrackets()
Bracket mismatch: j]+m[j

Severity : *** Fatal Exception ***

*** G4Exception: Aborting execution *** Aborted [wattsjw@watts G01]$

I am using CLHEP.2.0.4.2 and xerces-c-3.0.0 on an Operron running Scientific Linux 5.1.

Attached is matricesandloops.gdml taken from GDML_2.1.10.0/CPPGDML/Examples/g4g0gdml. It was modified to point the the geant4.9.2 gdml schema.

None problems adding TH1F histogram to the persistency example  by <marco.serra@roma1.infn.it>,   27 Feb, 2007
Hello,
I am trying to create a 1D histogram in the persistency example
(Geant-4.8.2 / root_v5.14.00b / clhep-2.0.3.1) adding a simple line

TH1F* h1 = new TH1F("hist1","CalHit",100,0,100.);

to the "readHits.cc" class.

But when I try to create an executable I have the error
 
: undefined reference to `TH1F::TH1F(char const*, char const*, int, double, double)'
collect2: ld returned 1 exit status
make: *** [dictionary] Error 1

I have added #include TH1F.h in readHits.cc but it does not help. 

Note that for example the creation of a new file via:
TFile* hf = new TFile("Histo.root", "RECREATE");
works fine. 

With older versions of the persistency example (up to Geant 4.8.0.p01) 
it was always possible to add histrograms, but now the example was 
rewritten (and the makefile changed a lot) and I am not able anymore 
to obtain plots.

Could someone help me?
thanks, regards Marco Serra 
Ok Re: problems adding TH1F histogram to the persistency example  by <marco.serra@roma1.infn.it>,   27 Feb, 2007
Re: None problems adding TH1F histogram to the persistency example

Hi, I solved the problem changing the GNUMakefile adding more root "extralibs" :

EXTRALIBS := -L$(ROOTSYS)/lib -lCore -lTree -lCint -lReflex -lCintex -ldl \
             -lHist -lGraf -lGraf3d -lGpad  -lRint -lPostscript -lMatrix -lPhysics

regards Marco

Question How to store the fluence distribution and the energy spectra?  Keywords: save, energy fluence ,particle fluence ,momentum distribution
by Shahrokh <Shahrokh>,   21 Dec, 2005

Hi,

What can I store and save the information of energy fluence, particle fluence and the momentum distribution of particles on a plane? for example, the particle is electron produced by interaction of photon source with material.)

please help me.

Thanks a lot.

Shahrokh

Question Writing digis with rootio  by Emanuele Leonardi <Emanuele Leonardi>,   14 Oct, 2005
I am adapting the structure which in examples/extended/perisitency writes
hits to a root file so that I can also write digis.

I modified the Pers01CalorHit.rootio file in this way:

@------------------------------------------------------------------@
set class_name TileCalDigi
set collection_class TileCalDigitsCollection
set collection_base_class G4VDigiCollection
set array_io_base G4VPDigitsCollectionIO
set catalog G4DCIOentryT
#set sdet_name TileCalScintSD
set add_header
  @class_name@.hh
..
set member
  @int@ PMTNumber;
  @float@ Photoel;
  @int@ ROValue;
  @int@ Overflow;
..

set constructor
  @class_root@(@class_name@* digi)
  {
    PMTNumber = digi->GetPMTNumber();
    Photoel = digi->GetPhotoel();
    ROValue = digi->GetROValue();
    Overflow = digi->GetOverflow();
  }
..

set method
  @class_name@* @make_transient@()
  {
    @class_name@* digi = new @class_name@();
    digi->SetPMTNumber(PMTNumber);
    digi->SetPhotoel(Photoel);
    digi->SetROValue(ROValue);
    if (Overflow == 0) { digi->ResetOverflow(); } else { digi->SetOverflow(); }
    return digi;
  }
..
@------------------------------------------------------------------@

The problem is that I have no idea of what to use as sdet_name and the
g4rootio script complains that it is not defined:

g4rootio: Error - sensitive detctor name is not specified.  Stop.

What should I use as "sensitive detector" for digis?

Thanks

             Emanuele Leonardi
None structure of g4root files  Keywords: structure of g4root files
by Tomasz Wachala <twachala@wp.pl>,   17 Jan, 2005

I need some information about g4root files generated by G4Glacier.How can I find it? How can I read these files under Root?Do I need to install any additional libraries for Root?

None Executable module of G4PersEx01  Keywords: persistency
by Ed Tatar <tatar@physics.isu.edu>,   15 Mar, 2004

Dear Colleagues,

I am trying to build PersEx01 from geant4_6.0.p01. Making libG4ROOTIO.so is successfull, however I get warnings like:
-------------------------------------------------
...
src/G4RootTransManager.cc: In member function `virtual bool
   G4RootTransManager::SelectWriteFile(std::basic_string<char,
   std::char_traits<char>, std::allocator<char> >, std::basic_string<char,
   std::char_traits<char>, std::allocator<char> >)':
src/G4RootTransManager.cc:69: warning: unused parameter `std::string obj'
...
-------------------------------------------------
The problem I have is in making the executable module.  The compiler gives an error after a long list of warnings:
-------------------------------------------------
...
/home/etatar/bin/root_v3.10.02/root/cint/include/float.h:18:1: warning: "FLT_MIN
" redefined
In file included from /home/etatar/g4/geant4.6.0.p01/include/globals.hh:95,
                 from /home/etatar/g4/geant4.6.0.p01/include/G4VHit.hh:31,
                 from /home/etatar/g4/geant4.6.0.p01/examples/extended/persisten
cy/PersEx01/include/Pers01CalorHit.hh:35,
                 from Pers01CalorHitRoot.hh:10,
                 from /tmp/fileOj4byr_rootcint.h:1,
                 from /tmp/Ga3A8n_cint.cxx:1:
/home/etatar/g4/geant4.6.0.p01/include/templates.hh:86:1: warning: this is the l
ocation of the previous definition
gmake: *** [/home/etatar/g4/geant4.6.0.p01/examples/extended/persistency/rootio/
tmp/Linux-g++/G4PersEx01/G4PersEx01Dict.cc] Error 134
-------------------------------------------------
If I execute the GNUmakefilefile again, the errors are ignored and 
          libG4PersEx01.so   and    G4PersEx01
are created.  Here is the end of the message I get when I run the ./run script:
-------------------------------------------------

---> End of event: 18
   Absorber: total energy: 30.9549 MeV       total track length: 2.00985 cm
        Gap: total energy: 67.0609 keV       total track length: 75.2977 mum

5 hits are stored in Pers01CalorHitsCollection. Hit Collection I/O manager "CalorSD" not found! G4HitRootIO::Store(): Hit Collection I/O manager is not registered for detector: 'CalorSD', collection name: 'CalCollection'. G4PersistencyManager::Store(G4Event) - Transaction aborted.

---> Begin of event: 19

--------- Ranecu engine status ---------
 Initial seed (index) = 0
 Current couple of seeds = 1379718041, 189997860
----------------------------------------
---> End of event: 19
   Absorber: total energy: 30.8041 MeV       total track length: 2.13951 cm
        Gap: total energy: 217.855 keV       total track length: 370.671 mum

5 hits are stored in Pers01CalorHitsCollection. Hit Collection I/O manager "CalorSD" not found! G4HitRootIO::Store(): Hit Collection I/O manager is not registered for detector: 'CalorSD', collection name: 'CalCollection'. G4PersistencyManager::Store(G4Event) - Transaction aborted. Graphics systems deleted. Visualization Manager deleting...

 *** Break *** segmentation violation
 Generating stack trace...
 0x41435217 in G4ParticleDefinition::~G4ParticleDefinition [not-in-charge]() + 0x3b from /home/etatar/g4/geant4.6.0.p01/lib/Linux-g++/libG4particles.so
 0x4144b5a7 in <unknown> from /home/etatar/g4/geant4.6.0.p01/lib/Linux-g++/libG4particles.so
 0x4144b606 in <unknown> from /home/etatar/g4/geant4.6.0.p01/lib/Linux-g++/libG4particles.so
 0x41421f6b in <unknown> from /home/etatar/g4/geant4.6.0.p01/lib/Linux-g++/libG4particles.so
 0x414d8066 in <unknown> from /home/etatar/g4/geant4.6.0.p01/lib/Linux-g++/libG4particles.so
 0x4000ce94 in <unknown> from /lib/ld-linux.so.2
 0x43dc3e10 in exit + 0x70 from /lib/tls/libc.so.6
 0x43daf768 in <unknown> from /lib/tls/libc.so.6
 0x0804ecb1 in G4VUserPhysicsList::RetrievePhysicsTable(G4ParticleDefinition*, G4String const&, bool) + 0x65 from ../rootio/bin/Linux-g++/G4PersEx01
./run: line 3:   889 Aborted                 ../rootio/bin/Linux-g++/G4PersEx01 run.mac
-------------------------------------------------

I am using gcc3.2 on Linux 9. The enviromental variables seem to be correctly defined. Could somebody help us?

With best regards, Eddie Tatar Idaho State University

Feedback Re: Executable module of G4PersEx01  Keywords: persistency
by Gabriele Cosmo <Gabriele Cosmo>,   24 Mar, 2004
Re: None Executable module of G4PersEx01 (Ed Tatar)
Hi Eddie,

I'm not sure your error-log is complete and showing what's the real
compilation problem. Anyhow, the following:

> /home/etatar/bin/root_v3.10.02/root/cint/include/float.h:18:1:
> warning: "FLT_MIN" redefined

is a problem in ROOT and should be reported to ROOT. They should
protect the definition of such constants as it is done in Geant4
templates.hh file.

Cheers, Gabriele
Question Novice user question  by ptr <ptr@msu.dubna.ru>,   26 Jun, 2003

making executable PersEx01]$ make i've got such errors:

/*********************

Generating dictionary /home/vlasov/CHARME/GEANT/examples/extended/persistency/rootio/tmp/Linux-g++/G4PersEx01/G4PersEx01Dict.cc ...

Error: assignment to 101325*hep_pascalstaticconst HepDoubleampere FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:218
Error: assignment to 100000*hep_pascalstaticconst HepDoubleatmosphere FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:218
Error: Symbol ampere is not defined in current scope  FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:219
Error: Symbol ampere is not defined in current scope  FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:220
Error: Symbol ampere is not defined in current scope  FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:221
Error: Symbol ampere is not defined in current scope  FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:233
Error: operator '/' divided by zero FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:233
Error: Symbol ampere is not defined in current scope  FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:260
Error: operator '/' divided by zero FILE:/home/vlasov/CHARME/GEANT/include/SystemOfUnits.h LINE:260

*********************/ What does'em means?

by the way i've sucsessfuly built a libG4ROOTIO.so library

None ROOT/IO in Geant4.5.0  Keywords: ROOT IO in Geant4
by Huaimin Liu <Huaimin Liu>,   26 Feb, 2003

Hi,

I am trying to use root/io in Geant4.5.0, so I just start with an example provided by G4. I followed steps in README. The first step is ok, libG4ROOTIO.so was successfully built. When I am making my executable, libG4PersEx01.so was created without any problem, but some error messages (sse below) came out at the linking stage

  /rootio/lib/Linux-g++/libG4ROOIO.so:   
     undefined reference to `TObject::Browse(TBrowser*)'
             ......
     undefined reference to `TFile::TFile[in-charge]

so the executable could not be created. Can anyone help? I am using RedHat7.2 with gcc3.2 and a new G4 patch, I think my ROOT environment was correctly set. Thank you.

--Huaimin Liu

None Re: ROOT/IO in Geant4.5.0  Keywords: ROOT IO in Geant4
by Youhei Morita <youhei.morita@kek.jp>,   12 Mar, 2003
Re: None ROOT/IO in Geant4.5.0 (Huaimin Liu)
Hi.

Recent exchanges of e-mail with Dr. Liu in person have fixed
the problem.  It appears that the persistency example source
tree has been corrupted while in his effort to locate the
problem.

If user encounters some problems in the compilation or in the
linking stage, it would be useful to look at the following
information.

 % env | grep G4

  --> to see what kind of G4_BUILD_xxxx variables are set.

Usually ROOT libraries are built with shared library option
and the GNUmakefiles for PersEx01 is tested with:

 G4LIB_BUILD_SHARED=1

It also would be useful to see the output of "tmp" and "lib"
directories:

 % ls -ltr geant4/tmp/Linux-g++/G4ROOTIO
 % ls -ltr geant4/tmp/Linux-g++/G4PersEx01

For more detail investigation, turn on CPPVERBOSE and take
a look at the compiler and the linker options.

Cheers,
- Youhei Morita
 Add Message Add Message
to: "Persistency"

This site runs SLAC HyperNews version 1.11-slac-98, derived from the original HyperNews


[ Geant 4 Home | Geant 4 HyperNews | Search | Request New Forum | Feedback ]