Linear Collider Forum



Home » Software Tools » LCIO » Problems saving pointers to RawCalorimeterHits in LCRelation objects
Problems saving pointers to RawCalorimeterHits in LCRelation objects [message #190] Tue, 08 March 2005 09:39 Go to previous message
lima
Messages: 47
Registered: May 2004
Location: DeKalb, IL, USA
Dear LCIO developers,

I am using LCRelation objects to keep track of the SimCalHits used to produce any single RawCalHit. I basically followed Frank´s recipe provided in a private message. However, dumpevent shows the following dump of the LCCollection containing the LCRelation objects written to disk (I am using LCIO v01-03):

==========================================================

collection name : EMraw2simCollection
parameters:
parameter FromType [string]: RawCalorimeterHit,
parameter ToType [string]: SimCalorimeterHit,

-------- print out of LCRelation collection ---------

flag: 0x80000000
fromType : RawCalorimeterHit
toType : SimCalorimeterHit

| [from_id] | [to_id] | weight
| [00000000] | [d0d70bc9] | 1.000e+00
| [00000000] | [d1b6f3bf] | 1.000e+00
| [00000000] | [d1b6fbbf] | 1.000e+00
| [00000000] | [500cbc96] | 1.000e+00
| [00000000] | [500d1ca5] | 1.000e+00
| [00000000] | [502d1ca5] | 1.000e+00
| [00000000] | [504d1ca5] | 1.000e+00
| [00000000] | [506d1ca5] | 1.000e+00
| [00000000] | [508d1ca5] | 1.000e+00
(... truncated...)
==========================================================

So the first column shows null pointers instead of valid
pointers to RawCalHits.

To make sure I had the LCRelation objects correctly setup before writing them out to disk, I dumped the same collection from the
program writing out the LCIO file:

==========================================================

relVec params: [FromType] = [RawCalorimeterHit]
relVec params: [ToType] = [SimCalorimeterHit]

-------- print out of LCRelation collection ---------------

flag: 0x80000000
fromType : RawCalorimeterHit
toType : SimCalorimeterHit

| [from_id] | [to_id] | weight
| [d0d70bc9] | [d0d70bc9] | 1.000e+00
| [d1b6f3bf] | [d1b6f3bf] | 1.000e+00
| [d1b6fbbf] | [d1b6fbbf] | 1.000e+00
| [500cbc96] | [500cbc96] | 1.000e+00
| [500d1ca5] | [500d1ca5] | 1.000e+00
| [502d1ca5] | [502d1ca5] | 1.000e+00
| [504d1ca5] | [504d1ca5] | 1.000e+00
| [506d1ca5] | [506d1ca5] | 1.000e+00
| [508d1ca5] | [508d1ca5] | 1.000e+00
| [50ad1ca5] | [50ad1ca5] | 1.000e+00
(...truncated...)
==========================================================

So it looks like there is some bug in the streaming of
LCRelation objects. How can I fix this?

This is the code used for both the above printouts:

==========================================================
cout<<endl<<" | [from_id] | [to_id] | weight "<< endl;

for( int i=0; i < nRel ; i++ ) {

LCRelation* rel = dynamic_cast<LCRelation*>(
col->getElementAt(i) );
printf(" | [%8.8x] | [%8.8x] | %5.3e \n"
, rel->getFrom() == NULL ? 0 : ((RawCalorimeterHit*)rel->getFrom())->getCellID0()
, ((SimCalorimeterHit*)rel->getTo())->getCellID0()
, rel->getWeight()
);
}
======================================================

Thanks in advance for any help.

Guilherme
 
Read Message
Read Message
Read Message
Read Message
Previous Topic:LCIO Installation problems on Scientific Linux
Next Topic:LCIO v01-04 released
Goto Forum:
  


Current Time: Tue Nov 13 17:07:13 Pacific Standard Time 2018
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.1.
Copyright ©2001-2010 FUDforum Bulletin Board Software