Hi I have two functions and one unamed macro that generates an ntuple from an ascii file. It used to work without problem until I installed the new version. I tried to find out on the discussion list archive, but I could not find anything that could help me. Below it the output: ******************************************* * * * W E L C O M E to R O O T * * * * Version 3.03/05 1 May 2002 * * * * You are welcome to visit our Web site * * http://root.cern.ch * * * ******************************************* Compiled for linux with thread support. CINT/ROOT C/C++ Interpreter version 5.15.36, Apr 23 2002 Type ? for help. Commands must be C++ statements. Enclose multiple statements between { }. root [0] .L ../src/GetLuminosity.C root [1] .L ../src/GetScale.C root [2] .x ../src/mkmasstree.C *** Break *** segmentation violation Root > Function GetScale() busy flag cleared The GetScale.C and GetLuminosity.C. They need two configuration file I am not sending, I included them just if someone wants to take a look into. Thanks. Luiz Mundim Float_t GetLuminosity(Int_t energy) { Char_t *file = {"/home1/delphi/data/config/luminosity.config"}; Char_t line[200]; Float_t luminosity; Int_t cms; FILE *ff = fopen(file,"r"); while(fgets(line,199,ff)) { if (line[0] == '#') continue; sscanf(line,"%d %f",&cms,&luminosity); if (cms == energy) break; } if (cms != energy) { luminosity = 0.0; cout << "Energy " << energy << " not found on the luminosity "; cout << "configuration file." << endl; } fclose(ff); return luminosity; } Float_t GetScale(Char_t *channel,Int_t energy) { Char_t file[255] = {""}; Char_t line[200]; Char_t ch[5]; Float_t xsec,xserr,lumi; Int_t nevt; sprintf(file,"/home1/delphi/data/config/%d_llll.config\0",energy); ifstream ff; ff.open(file,ios::in); if (!ff) { cout << "Could not open file" << endl; return 0; } while(ff.getline(line,199)) { if (line[0] == '#') continue; if (!strstr(line,"i4lep")) continue; sscanf(line,"%s %*s %*s %*s %f %f %d",ch,&xsec,&xserr,&nevt); if (!strcmp(ch,channel)) break; xsec = 0.; nevt = 0; } ff.close(); lumi = GetLuminosity(energy); if (nevt > 0) { return lumi*xsec/nevt; } else { return 0; } } { FILE *fp = fopen("masses.out","r"); Char_t chsim[5],chrec[5]; Float_t mass1,mass2,zmass,tmael[19],scaling,ang12,ang23,ang13,pmass; Int_t cms,ifit; // // Create a tree named llll // gDirectory->Delete("llll"); TTree *llll = new TTree("llll","Masses from leptonfit"); // // Create a branch named masses // llll->Branch("cms",&cms,"Cms/I"); llll->Branch("chsim",chsim,"Chsim/C"); llll->Branch("chrec",chrec,"Chrec/C"); llll->Branch("mass1",&mass1,"Mass1/F"); llll->Branch("mass2",&mass2,"Mass2/F"); llll->Branch("tmael",tmael,"Tmael[19]/F"); llll->Branch("Pmass",&pmass,"Pmass/F"); llll->Branch("Ang12",&ang12,"Ang12/F"); llll->Branch("Ang13",&ang13,"Ang13/F"); llll->Branch("Ang23",&ang23,"Ang23/F"); llll->Branch("scaling",&scaling,"Scaling/F"); // while(feof(fp)==0) { fscanf(fp,"first %s %*f %s %f %d %d",chsim,chrec,&mass1,&cms,&ifit); for(Int_t i=0;i<19;i++) fscanf(fp,"%f",&tmael[i]); getc(fp); fscanf(fp,"second %*s %*f %*s %f %*d %*d %f %f %f %f\n",&mass2,&pmass,&ang12,&ang13,&ang23); // printf("%s %s %f %f %f %d\n",chsim,chrec,mass1,mass2,zmass,cms); scaling=GetScale(chsim,cms); llll->Fill(); } fclose(fp); }
This archive was generated by hypermail 2b29 : Sat Jan 04 2003 - 23:50:57 MET