   
void createn() {
   
   struct ntuple_t {
      Int_t           Run;
      Int_t           Event;
      Int_t           LS;
      Int_t           Orbit;
      Int_t           BX;
      Int_t           DBX;
      Int_t           Ntrack;
      Int_t           Nmodcl;
      Int_t           Nmoddig;
    };

   ntuple_t ntuple;
   TString dir = gSystem->UnixPathName(TCint::GetCurrentMacroName());
   dir.ReplaceAll("createn.C","");
   dir.ReplaceAll("/./","/");
   FILE *fp = fopen(Form("%sennupla.txt",dir.Data()),"r");



   char line[80];

   TFile *f = new TFile("ntuple.root","RECREATE");
   TTree *tree = new TTree("T","event data from ascii file");
   tree->Branch("ntuple",&ntuple.Run,"Run/I:Event:LS:Orbit:BX:DBX:Ntrack:Nmodcl:Nmoddig");
   while (fgets(&line,80,fp)) {
      sscanf(&line[0],"%d %d %d %d %d %d %d %d %d %d",&ntuple.Run,&ntuple.Event,&ntuple.LS,&ntuple.Orbit,&ntuple.BX,&ntuple.DBX,&ntuple.Ntrack,&ntuple.Nmodcl,&ntuple.Nmoddig);
      tree->Fill();
   }
   tree->Print();
   tree->Write();

   fclose(fp);
   delete tree;
   delete f;
}
