Re: "manual" schema evolution

From: Philippe Canal <pcanal_at_fnal.gov>
Date: Fri, 13 Nov 2009 05:24:25 -0600


Hi Chiara,

 > target="fITSindices:fnMaxITScluster"

This actually should a semi colon (;) delimited list.

In general you should only have one rule for each target. i.e. either fnMaxITScluster is listed in its own rule or it is listed in the combined rule but not both. In you case, I would just use the combined rule.

If you list a variable in the target, you should set it to some value in the code.

 > Moreover, I see no track of my rules inthe LinkDef file, so I guess there's something not working as it should...

I assume you mean the dictionary; The dictionary file should indeed contain a complete transcript (and more) of the code in your rules. I do not see anything obviously wrong in your code (except possibly the targetType which is not yet implemented/used). If your code does not appear in the dictionary, please send me a running example so that I can figure out whats wrong.

Cheers,
Philippe.

>
>
>
> ------------------------------------------------------------------------
>
> Subject:
> [ROOT] "manual" schema evolution
> From:
> Chiara Zampolli <Chiara.Zampolli_at_bo.infn.it>
> Date:
> Thu, 12 Nov 2009 11:16:28 +0100
> To:
> roottalk <roottalk_at_lxbuild091.cern.ch>
>
> To:
> roottalk <roottalk_at_lxbuild091.cern.ch>
>
>
> Hello all,
>
> Following the slides showed By Philippe at last CHEP
> (http://indicobeta.cern.ch/getFile.py/access?contribId=210&sessionId=59&resId=3&materialId=slides&confId=35523),
> I'm trying to define my own rules to allow some schema evolution. I'm
> attching the headers file of the old version of the class
> (AliESDfriendTrack.h.Orig), and of the new one (AliESDfriendTrack.h),
> and the LinkDef file (ESDLinkDef.h) where I define the rules. The
> changes in the class affects some arrays of integeres that now I would
> like to have as pointes. So:
>
> old header file: ----> new
> header file:
>
> ---------------------------------------------------------------------------------------------------------
>
> Int_t fITSindex[kMaxITScluster]; ----> Int_t fnMaxITScluster;
> Int_t* fITSindices; //fnMaxITScluster
> Int_t fTPCindex[kMaxTPCcluster]; ----> Int_t fnMaxITScluster;
> Int_t* fITSindices; //fnMaxITScluster
> Int_t fTRDindex[kMaxTRDcluster]; ----> Int_t fnMaxITScluster;
> Int_t* fITSindices; //fnMaxITScluster
>
>
> In total, I have defined six rules. In the first three:
>
> #pragma read sourceClass="AliESDfriendTrack"
> targetClass="AliESDfriendTrack" \
> source="" version="[-3]" target="fnMaxITScluster" targetType="Int_t"\
> code="{fnMaxITScluster = 12;}"
> #pragma read sourceClass="AliESDfriendTrack"
> targetClass="AliESDfriendTrack" \
> source="" version="[-3]" target="fnMaxTPCcluster" targetType="Int_t"\
> code="{fnMaxTPCcluster = 160;}"
> #pragma read sourceClass="AliESDfriendTrack"
> targetClass="AliESDfriendTrack" \
> source="" version="[-3]" target="fnMaxTRDcluster" targetType="Int_t"\
> code="{fnMaxTRDcluster = 180;}"
>
>
> I use hardwired numbers, but I think I could use the
> kMaxITS/TPC/TRDcluster variables, but I'm not sure...
> In the last three:
>
> #pragma read sourceClass="AliESDfriendTrack"
> targetClass="AliESDfriendTrack" \
> source="Int_t fITSindex" version="[-3]" target="fITSindices:
> fnMaxITScluster" targetType="Int_t*; Int_t"\
> code="{fITSindices = new Int_t[fnMaxITScluster]; for (Int_t i=0; i<
> fnMaxITScluster; i++){fITSindices[i] = onfile.fITSindex[i];}}"
> //memcpy(fITSindices,
> &(onfile.fITSindex),fnMaxITScluster*sizeof(Int_t); }"
> #pragma read sourceClass="AliESDfriendTrack"
> targetClass="AliESDfriendTrack" \
> source="Int_t fTPCindex" version="[-3]" target="fTPCindices;
> fnMaxTPCcluster" targetType="Int_t*; Int_t"\
> code="{fTPCindices = new Int_t[fnMaxTPCcluster]; memcpy(fTPCindices,
> &(onfile.fTPCindex),fnMaxTPCcluster*sizeof(Int_t); }"
> #pragma read sourceClass="AliESDfriendTrack"
> targetClass="AliESDfriendTrack" \
> source="Int_t fTRDindex" version="[-3]" target="fTRDindices;
> fnMaxTRDcluster" targetType="Int_t*; Int_t"\
> code="{fTRDindices = new Int_t[fnMaxTRDcluster]; memcpy(fTRDindices,
> &(onfile.fTRDindex),fnMaxTRDcluster*sizeof(Int_t); }"
>
>
> I've put two targets, since I use two variables of the new
> implementation of the class, but I'm not sure that the definition of
> their type is then done correctly in the way I do. And, anyway, when I
> try to read an old object, the old content is not copied in the new
> variables - just the inizialization values (-2, see .cxx files) are
> "read". Moreover, I see no track of my rules inthe LinkDef file, so I
> guess there's something not working as it should...
>
> Do you have any idea what I'm doing wrong?
>
> Thanks for your help, and cheers,
>
> Chiara
>
Received on Fri Nov 13 2009 - 12:24:30 CET

This archive was generated by hypermail 2.2.0 : Mon Nov 16 2009 - 23:50:02 CET