{

  gROOT->Reset();
  TStopwatch timer;
  timer.Start();
  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
  basiclibs();
  gROOT->LoadMacro("$VMCWORKDIR/gconfig/rootlogon.C");
  rootlogon();

  // MCpoints
  TFile filerun("test_3.full.mc.root");
  TTree *treepnt = (TTree*) filerun.Get("cbmsim");
  TClonesArray *pnt = new TClonesArray("PndSttPoint");
  treepnt->SetBranchAddress("STTPoint",&pnt);
  
  TH1F* hpoints = new TH1F("hpoints","# points per track",40,0,40);
  TH1F *hmass = new TH1F("hmass","mass",100,0,1);
  int counter = 0;
  int tmptrkid = 0;
  for(int evt = 0; evt < treepnt->GetEntriesFast(); evt++){
    treepnt->GetEntry(evt);
    counter = 0;
    // cout << "total nof hits " << pnt->GetEntriesFast() << endl;
    for(int i = 0; i < pnt->GetEntriesFast(); i++){
      PndSttPoint *point = (PndSttPoint*) pnt->At(i);
      if(i == 0) tmptrkid = point->GetTrackID();
      if(!point) continue;
      //  cout << i << " " << point->GetTrackID() << " " << counter << " " << tmptrkid << endl;
       counter++;  
       if(point->GetTrackID() != tmptrkid || i == pnt->GetEntriesFast()-1)
	{ 

	  hpoints->Fill(counter);
	  cout << "evt " << evt << " track " << tmptrkid << " hits " << counter << endl;
	  tmptrkid = point->GetTrackID();
	  counter = 0;
	}

      
      hmass->Fill(point->GetMass()* 1000);
      // cout << "point " << i 
      // 	   << " trackID " << point->GetTrackID() 
      // 	   << " mass " << point->GetMass() * 1000 << endl;
    }
    // cout << endl;
  }
}
