43 cerr <<
"Bins evt data in mass bins" << endl;
44 cerr <<
"options:" << endl;
45 cerr <<
"-n number of bins" << endl;
46 cerr <<
"-s mass of start bin" << endl;
47 cerr <<
"-b bin width in mass" << endl;
48 cerr <<
"-o output path" << endl;
52 int main(
int argc,
char** argv) {
65 while ((c = getopt(argc, argv,
"n:s:b:o:h")) != -1)
71 mstart = atof(optarg);
86 unsigned int nselected=0;
89 vector<std::ofstream*> outfiles;
92 for(
int ibin=0;ibin<nbins;++ibin){
105 com.ReplaceAll(
" ",
"");
106 if(!gSystem->mkdir(com.Data()))
107 std::cout<<
"Directory "
109 <<
" could not be created. Already existent?"<<std::endl;
111 TString outfile=path;
116 outfile.ReplaceAll(
" ",
"");
117 outfiles.push_back(
new std::ofstream(outfile.Data()));
124 list<particle> f_mesons;
126 while(!(cin>>e).eof()) {
127 f_mesons=e.f_mesons();
130 list<particle>::iterator it = f_mesons.begin();
131 while (it != f_mesons.end() ) {
139 unsigned int bin=(
unsigned int)floor((m-mstart)/mbin);
140 if(bin<outfiles.size()){
141 std::ofstream* out=outfiles.at(bin);