From TSelector to PAR archive

Dear All,

I prepare files named MySelector.C, MySelector.h in order to process my rootfile using Proof.
MySelector is perfectly working except that I was stack at the step to load custom classes within MySelector since I call :


I managed to make it works adding (thanks this thread How to add an user class to TSelector::fOutput?):


But this do not satisfy me because I use a file and would prefere to directly load my library and include my headers to be used in my selector…

Since that I would like to create my PAR archive and put MySelector files inside.
I create a project using :

TFile *_file0 = TFile::Open("mytree.root"); _file0->MakeProject("packages/MySelectorPAR", "*", "par");

I played a little bit with the generated archive and implement MySelector files, thanks to Proof ARchive and undefined symbol: _ZTI4TH1F

So the status is that it is trying to generate a Dictionary and I added the location of my custom classes, library and headers. And I get an error… I think I made a mistake in my Makefile…

/usr/lib/../lib64/crt1.o: In function `_start': (.text+0x20): undefined reference to `main' MySelector.o: In function `MySelector::Begin(TTree*)': MySelector.C:(.text+0xb1): undefined reference to `TString::TString(char const*)' MySelector.C:(.text+0xfb): undefined reference to `TDatime::Set()' MySelector.C:(.text+0x11f): undefined reference to `TDatime::Print(char const*) const' MySelector.C:(.text+0x12b): undefined reference to `TString::~TString()' MySelector.C:(.text+0x138): undefined reference to `TObject::operator delete(void*)' MySelector.C:(.text+0x152): undefined reference to `TString::~TString()' MySelector.o: In function `MySelector::SlaveBegin(TTree*)': MySelector.C:(.text+0x1a4): undefined reference to `TString::TString(char const*)' MySelector.C:(.text+0x1d4): undefined reference to `TH1D::TH1D(char const*, char const*, int, double, double)' MySelector.C:(.text+0x1e4): undefined reference to `TDirectory::CurrentDirectory()' MySelector.C:(.text+0x229): undefined reference to `TDirectory::CurrentDirectory()' MySelector.C:(.text+0x25d): undefined reference to `TString::~TString()' MySelector.C:(.text+0x26a): undefined reference to `TObject::operator delete(void*)' MySelector.C:(.text+0x27e): undefined reference to `TString::~TString()' MySelector.o: In function `MySelector::SlaveTerminate()': MySelector.C:(.text+0x334): undefined reference to `TDatime::Set()' MySelector.C:(.text+0x349): undefined reference to `TDatime::Print(char const*) const' MySelector.C:(.text+0x39d): undefined reference to `TDatime::Convert(bool) const' MySelector.C:(.text+0x3b4): undefined reference to `TDatime::Convert(bool) const' MySelector.C:(.text+0x40d): undefined reference to `TDatime::Convert(bool) const' MySelector.C:(.text+0x424): undefined reference to `TDatime::Convert(bool) const'

So I attached a par file, just before having try to add my library… I just setup the .C and .h files and added the CXXFLAGS and LIBUIUC (path to my library named
Tree1.par (60 KB)

I should maybe try to setup a so called rootmap ? Is it the best to do in order to include my custom classes ? Since I have already a .so for my custom classes.

I think concretely my problem is how to add my custom classe since my .so is already generated and I have the headers… Hope someone could help me. That would be wonderful ! :slight_smile:

OK, I kept looking at my problem…
I understood that a PAR archive just load a .so library, so that’s not a big deal and then with the SETUP and BUILD you link the library. So I applied my own Makefile to generate my .so

Since I had to include my custom classes I added the necessary flags to use my and *.h associated with my I just have a dictionary problem, because of TSelector heritage… It was not the case with TObject… I don’t know why. Someone could give me his mind about that that would be great !

Ok I solved myself my problem. PAR archive is just an archive which is “untar” when you load it and then copy paste in the worker computer the files.

Then no need to compile and create a new library within, I can just store my MySelector.C and use the SETUP.C to load the file

Cheers !

Dear meyerma,

I was about to look in detail at your PAR file. Good that you found a solution for your problem.

A few remarks.

Yes, this is a part of what PAR files are. They are containers where you can put all what you need to run your code.

This depends where you run. If you run PROOF-Lite, therefore the same machine/architecture/os/compiler, yes, you pack everything there and that’s it. You may not even need to pack, but just to have in SETUP.C the rights paths and loadings.
But if you run in generic PROOF you may want to rebuild the package for the architecture/os/compiler. And that can be steered via

G Ganis

Hi ganis,

Actually I still have some trouble to process my par archive. I enabled the package, it’s loading the SETUP.C and, whatever is inside.
Then I try to use : proof->Process(“MySelector”);

But I did’nt manage to find a way to compile the MySelector.C as it’s doing without Par archive.
I expected the par archive to be uncompressed and then be able to get this selector and compile the MySelector.C file and run over it.

Do you maybe know how to be able to run something similar to : proof->Process(“myarchive/MySelector.C+”)
I get hard time to find a path though my par archive to compile this MySelector.C+

That would be very helpful! :slight_smile:

I feel like if PAR archive are used to compile library loaded, but not to use TSelector inside. Is it true ?