Problem with derived class PROOF


I have problems accessing data from a custom class derived from TObject:

class Tmap : public TObject {
    std::map< int,std::vector<double> *> *fT;

public :
    virtual ~Tmap(){};
     void TAdd(int key, vector<double> *v, double number);
    virtual bool TExist(int key);
    virtual std::map< int,std::vector<double>* >* GetTmap(void) const{ return fT; }

    fT = new map<int, std::vector<double>*>();
void Tmap::TAdd(int key, std::vector<double> *v, double number){
    v->push_back(number); // fill with values
    // insert record into structure
    fT->insert(std::pair<int, std::vector<double>*>(key, v));
bool Tmap::TExist(int key){
    bool exist;
    if ( fT->find(key) == fT->end()){
        return false;
        return true;}

The class works fine without implementing it in the TSelector. Tmap class contains all the processed data from some TTree events and is analyzed in the Terminate() part of the TSelector derived class (TSelector is run in PROOF ). Simplified overview of the code:

class Selector : public TSelector {
public :
 	Tmap* LYZ_Q;
    	Tmap* LYZ_M;
    virtual void Init(TTree* tree);
    virtual void Begin(TTree *tree);
    virtual void SlaveBegin(TTree*);
    virtual bool Process(Long64_t entry);
    virtual void SlaveTerminate();
    virtual void Terminate(void);
    virtual TList  *GetOutputList() const { return fOutput; }
    virtual void    SetOption(const char *option) { fOption = option; }
    virtual void    SetObject(TObject *obj) { fObject = obj; }
    virtual void    SetInputList(TList *input) { fInput = input; }
    virtual int Version() const { return 2; }
    virtual Bool_t SetTree(TTree* tree);

void Selector::SlaveBegin(TTree* tree){
    v2_LYZ = new TH2F("v2_LYZ", "v_{2} Distribution", 100, 0, 150, 100, 0, 0.5);

    LYZ_Q = new Tmap();
    LYZ_M = new Tmap();

bool Selector::Process(Long64_t entry )
 Q_theta(particles_intersection_mcp,2, h->c, "c",   LYZ_Q,  LYZ_M);
 void Selector::Terminate()
	LYZ(LYZ_Q, LYZ_M, v2_LYZ );
	TFile* output = TFile::Open("output.root","RECREATE");

If I print some information of Tmap LYZ_Q in process() it works fine, but in the Terminate() it can’t be accessed and I get:

 *** Break *** segmentation violation
 Generating stack trace...
 0x000000010c9285ac in TProofPlayerLite::Finalize(bool, bool) (in + 732
 0x000000010c928114 in TProofPlayerLite::Process(TDSet*, char const*, char const*, long long, long long) (in + 3700
 0x000000010c92725f in TProofPlayerLite::Process(TDSet*, TSelector*, char const*, long long, long long) (in + 127
 0x000000010c0bcbc3 in TProofLite::Process(TDSet*, char const*, char const*, long long, long long) (in + 3555
 0x000000010c09528f in TProof::Process(TDSet*, TSelector*, char const*, long long, long long) (in + 63
 0x000000010c890238 in <unknown function>
 0x000000010c890051 in <unknown function>
 0x00000001015345fd in cling::Interpreter::RunFunction(clang::FunctionDecl const*, cling::Value*) (in + 317
 0x0000000101533a89 in cling::Interpreter::EvaluateInternal(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, cling::CompilationOptions, cling::Value*, cling::Transaction**) (in l
 0x0000000101572ca2 in cling::MetaSema::actOnxCommand(llvm::StringRef, llvm::StringRef, cling::Value*) (in + 434
 0x000000010156bea9 in cling::MetaParser::isXCommand(cling::MetaSema::ActionResult&, cling::Value*) (in + 745
 0x000000010156b617 in cling::MetaParser::isCommand(cling::MetaSema::ActionResult&, cling::Value*) (in + 135
 0x000000010156b3ea in cling::MetaParser::isMetaCommand(cling::MetaSema::ActionResult&, cling::Value*) (in + 42
 0x0000000101570a72 in cling::MetaProcessor::process(char const*, cling::Interpreter::CompilationResult&, cling::Value*) (in + 274
 0x00000001014293a7 in TCling::ProcessLine(char const*, TInterpreter::EErrorCode*) (in + 3111
 0x000000010142c5f9 in TCling::ProcessLineSynch(char const*, TInterpreter::EErrorCode*) (in + 121
 0x0000000101005de9 in TApplication::ExecuteFile(char const*, int*, bool) (in + 2329
 0x0000000101325b96 in TRint::ProcessLineNr(char const*, char const*, int*) (in + 118
 0x00000001013258ff in TRint::Run(bool) (in + 943
 0x0000000100f91e8f in main (in root.exe) + 79
 0x00007fff9252b5c9 in start (in libdyld.dylib) + 1
 0x0000000000000004 in <unknown function>
Root > 

I have been through most of the previous posts, but I couldn’t find any help there, and I hope some one can help me.


See : Problem with derived class