Vector of User defined class

Hello everyone,
i’m trying to write a little macro that exports data to ASCII from certain histogramms of a rootfile. Therefore i browse through all the directories of the rootfile and as soon as the histname matches an entry in my list the histogram is saved. Since i like to do some operations on the data and essentially can do that only after all histograms are found i’d like to store the data in class. And since i have several datasets i want to use a vector of this class. Something like this:

class Particle
	Particle()	{}
	Particle(std::string fiName,std::vector<double> counts):path(fiName),raw_counts(counts)		{}

	double get_RawCounts(int index)		{return (index<raw_counts.size())?raw_counts[index]:0.;}
	int get_Size()					{return raw_counts.size();}
	const std::string get_Path()				{return path;}
	std::vector<double> raw_counts;
	std::string path;

void SaveCounts(TH1D *hist,std::string name)
	std::vector<double> vec;
	for(int i=1;i <= hist->GetNbinsX();i++)

	Particle p(name,vec);
	for(int i=0;i<p.get_Size();i++)
		std::cout << p.get_RawCounts(i) << std::endl;
	vector<Particle> counts;
       counts.push_back(p); // leads to crash

The CINT crashes as soon as it invokes the last line.
The strange thing is: if i do basically the same steps by hand it doesn’t crash. So if i enter for example:

string name = "test";
vector<double> dvec;
Particle p(name,dvec);
vector<Particle> pvec;

it will work without any problems.
Any idea what i’m missing

Cheers Moritz


You need to either generate a dictionary for vector or simply load your script via ACLiC (.L myscript.C+)