Re: TDSet::Process(TSelector * selector) missing

From: Constantin Loizides <loizides_at_mit.edu>
Date: Mon, 15 Jan 2007 15:00:44 +0100


Hi Antonio,

if you look into the TAM manual and code you will see how we solved this for TAM. I think you could do the same in your selector class.

You would just need to do the following: Instantiate your configuration object and pass it to the proof input list:

TConfiguration *conf = new TConfiguration(); conf->LoadFromConfFile(confFileName);
fProof->AddInput(conf); //assuming fProof is already a ptr to an instance of a PROOF session

In your TAnalisysSelector you would have to read the input list (fInput) and search for the configuration object. You should do that in Begin (for the client) and in SlaveBegin for the slaves. See TAMSelector::Begin and TAMSelector::SlaveBegin for an example.

Constantin

Leandro Franco wrote:

> Hi,
> 
> I think Antonio wants to pass a specific (instantiated) object of his 
> class. 
> While this doesn't present big problems in a normal ROOT session, I 
> suppose it's trickier in PROOF. 
> As Maarten said the slaves need to be aware of the new class and after 
> that we would have to be able to pass 
> the object instead of the file.
> 
> I know this is a bit disappointing since you (Antonio) are probably 
> using PROOF in just one machine, but if 
> you think in a normal session where the client, the master and the 
> slaves are in different machines it makes sense.
> 
> I don't know how difficult the modification is but I will take a look.
> 
> For the moment the only way out is to configure the selector inside 
> itself, it could for example open the conf file you mention in
> the constructor (hard coding it or with the global you suggest).
> 
> Good Luck,
> Leo
> 
> 
> 
> On Jan 15, 2007, at 11:17 AM, Antonio Bulgheroni wrote:
> 

>> Thanks Maarten and Constantin for your answers.
>>
>> For Maarten,
>> This is actually what I'm doing. TAnalysisSelector is the name
>> of my TSelector class (not a macro). Of course I've uploaded a PAR
>> file with a library containing TAnalysisSelector definition on each
>> slave of the proof cluster.
>>
>> The point is the following: the tree analysis is steered by many
>> parameters that are stored in a TConfiguration object (another
>> user-defined object inheriting from a TObject) and one of the data
>> members of the TAnalsysSelector is a pointer to such TConfiguration
>> object. In the normal way of operation w/o PROOF, I do the following:
>>
>> TConfiguration * conf = new TConfiguration();
>> conf->LoadFromConfFile(confFileName);
>> TAnalysisSelector * selector = new TAnalysisSelector();
>> selector->SetConfiguration(conf);
>> tree->Process(selector); // note I'm passing a reference to
>> TAnalysisSelector
>> ...
>>
>> This can be done because TTree has a method Process(TSelector *). But
>> when running on PROOF, this is not available and PROOF wants to create
>> an instance of TAnalysisSelector and processes it immediately without
>> giving the user the chance to call any other method of the newly
>> created TAnalysisSelector.
>>
>> The only (maybe not elegant) way out is to make declare a global
>> TConfiguration * gConf and use it inside the TAnalysisSelector. Do you
>> think is it going to work?
>>
>> For Constantin,
>> I've read on the PROOF Twiki
>> (http://root.cern.ch/twiki/bin/view/ROOT/PROOF) that developing your
>> own TSelector derived class (using MakeSelector) is the first step.
>> That's why I did it!
>>
>> Thanks again for your help,
>>
>> Antonio
>>
>> --
>> Antonio Bulgheroni, PhD
>> INFN - Sez. Rome III
>>
>>
>>
>> On 1/12/07, *Maarten Ballintijn * <maartenb_at_mit.edu
>> <mailto:maartenb_at_mit.edu>> wrote:
>>
>> Hello Antonio,
>>
>> You can pass the name of your class, rather then a the name of a
>> macro, e.g.
>>
>> dset->Process("TAnalsysSelector")
>>
>> This requires that the class is know in the client and on the
>> slaves. This is normally achieved using a PAR file which provides
>> a library with your class(es) and their dictionary.
>>
>> Cheers,
>>
>> Maarten.
>>
>> Antonio Bulgheroni wrote:
>> > Dear ROOTers,
>> > apologies for bothering you with another question about
>> PROOF, but
>> > the more I (try to) use it, the more I like.
>> >
>> > So far, I have prepare a brand new custom selector inheriting from
>> > TSelector and I've filled in all the automatically generated
>> methods and
>> > I've added my personal methods and data members. To work
>> properly, this
>> > TAnalsysSelector needs to be set up before executed. I mean, I
>> have to
>> > set few variables before calling tree->Process(mySelector).
>> While this
>> > is possible when working w/o PROOF, I can't find a way when
>> working w/
>> > PROOF because TDSet::Process(TSelector*) is missing and the only
>> > available method is TDSet::Process(const char*). In my case this is
>> > going to fail, because I have no more chance to set up the
>> > TAnalysisSelector.
>> >
>> > What's wrong? Is there another way out? Is it possible to have
>> > TDSet::Process(TSelector*)?
>> >
>> > Thanks a lot,
>> >
>> > Antonio
>> >
>> > --
>> > Antonio Bulgheroni, PhD
>> >
>> > Win98 error 001: Unexpected condition: booted without crashing.
>>
>>
>> --
>> Maarten Ballintijn < maartenb_at_mit.edu <mailto:maartenb_at_mit.edu>>
>> Massachusetts Institute of Technology
>>
>>

>
-- 
Tel: +1-617-8301823 (SkypeIn)
Skype: loizides
AOL: ConLoi / ICQ: 114824520
Received on Mon Jan 15 2007 - 15:01:43 CET

This archive was generated by hypermail 2.2.0 : Mon Jan 15 2007 - 17:50:00 CET