Reading vector<vector<string> > *Variable

Hi Rooters
I am trying to read a variable vector<vector > *trig_L1_jet_thrNames which is defined in header file when I use MakeClass() for an ntuple.

I assume that there are as many rows as there are jets in an event. And then for each jet, there is a vector of strings stored.
Here is the piece of code:

                for ( int i = 0; i < trig_L1_jet_n; i++ )
                {
                        for ( int j = 0; j < (int) trig_L1_jet_thrNames[1].size(); j++ )
                        {
                        cout<<"i="<<i<<"   j="<<j<<"   STRING="<< trig_L1_jet_thrNames->at(i).at(j)<<"      ";
                        }
                        cout<<endl;
                }

The problem is that it doesn’t print anything at all though the screen keeps on scrolling down as if it is writing something invisible.

No errors reported as well.
Cheers
Aatif

Try: if (trig_L1_jet_thrNames) { for (unsigned i = 0; i < trig_L1_jet_thrNames->size(); i++) { for (unsigned j = 0; j < (trig_L1_jet_thrNames->at(i)).size(); j++) { std::cout << "i=" << i <<" j=" << j <<" STRING=" << (trig_L1_jet_thrNames->at(i)).at(j) << std::endl; } } } else { std::cout << "Warning: trig_L1_jet_thrNames is NULL." << std::endl; }
For “std::vector<std::vector >” see [url]Storing 2D vector [--> vector<vector<...> >] into a TTree
For “std::vector<std::vectorstd::string >” see [url]Problem in getting the vector < vector <string> > branch