void anaVert() {

  // -----  Load libraries   ------------------------------------------------
  gROOT->Macro("$VMCWORKDIR/gconfig/rootlogon.C");
  gROOT->LoadMacro("$VMCWORKDIR/macro/mvd/Tools.C");
  LoadPandaStyle();
  // -----   Timer   --------------------------------------------------------
  TStopwatch timer;
  timer.Start();
  // ------------------------------------------------------------------------

  ifstream in;
  TH1D *hisSin, *hisCos, *hisTan;

  in.open("pp_Pi+Pi-_15.evt", ios_base::in);
  hisSin = new TH1D("hisSin","Lumi-Events at 15GeV Beam",60,2.5,8.5);
  hisCos = new TH1D("hisCos","Lumi-Events at 15GeV Beam",60,2.5,8.5);
  hisTan = new TH1D("hisTan","Lumi-Event-Theta at 15GeV",60,2.5,8.5);
  hisPz = new TH1D("hisPz","Lumi-Event-z-Momentum at 15GeV",50,15.464,15.474);

  // Check for input file
  if (!in) {
    // if ( ! fInputFile->is_open() ) {
    cout << "-E FairEvtGenGenerator: Input file not open!" << endl;
    return;
  }
  
    for(int i=0; i<1000000; i++) //event loop
    {
      // Define event variable to be read from file
      Int_t ntracks = 0, eventID = 0;
 
      // Define track variables to be read from file
      Int_t nLine = 0, pdgID = 0, nDecay = 0, nM1 = -1, nM2 = -1, nDF = -1, nDL = -1;
      double fPx = 0., fPy = 0., fPz = 0., fE = 0.;
      double fVx = 0., fVy = 0., fVz = 0., fT = 0.;
  
      // Read event header line from input file

  
      Text_t buffer[2048];
      //ncols = fscanf(in,"%d\t%d", &eventID, &ntracks);
      in >> eventID >> ntracks;

      if (ntracks>0) {
//        for (Int_t ii=0; ii<15; ii++) {//read header
//          ncols = fscanf(in,"%s",buffer);
            in.getline(buffer,2048);
            in.getline(buffer,2048);
//        }

        for (Int_t ll=0; ll<ntracks; ll++)//read tracks 
        {
//          ncols = fscanf(in,"%d %d %d %d %d %d %d ", &nLine, &pdgID, &nDecay, &nM1, &nM2, &nDF, &nDL);
//          ncols += fscanf(in,"%lf %lf %lf %lf %lf %lf %lf %lf\n", &fPx, &fPy, &fPz, &fE, &fT, &fVx, &fVy, &fVz);
            in >> nLine>>pdgID>>nDecay>>nM1>>nM2>>nDF>>nDL>>fPx>>fPy>>fPz>>fE>>fT>>fVx>>fVy>>fVz;

          double theta1=1000*fabs(acos( sqrt(fPz*fPz/(fPx*fPx+fPy*fPy+fPz*fPz)) ));
          double theta2=1000*fabs(asin( sqrt((fPx*fPx+fPy*fPy)/(fPx*fPx+fPy*fPy+fPz*fPz)) ));
          double theta3=1000*fabs(atan2( sqrt(fPx*fPx+fPy*fPy), fabs(fPz) ));

         // cout << theta1 << "\t" << theta2 << "\t" << theta3;

          if(theta1>2.5 && theta1<8.5){
            hisSin->Fill(theta1);
            hisCos->Fill(theta2);
            hisTan->Fill(theta3);
            hisPz->Fill(fPz);
          }

          
        }//end tracks
      }
    }//end events

  hisPz->SetXTitle("Pz / (GeV/c)");
  hisPz->SetYTitle("#");
  hisPz->GetXaxis()->CenterTitle();
  hisPz->GetYaxis()->CenterTitle();

  hisTan->SetXTitle("Theta / mrad");
  hisTan->SetYTitle("#");
  hisTan->GetXaxis()->CenterTitle();
  hisTan->GetYaxis()->CenterTitle();

  TCanvas* can1 = new TCanvas("can1","Verteilungs-Vergleich Sin Cos Tan",0,0,1200,600);
  can1->Divide(2,1);

/*  can1->cd(1);
  if(hisSin)
    hisSin->DrawCopy();
  can1->cd(2);
  if(hisCos)  
    hisCos->DrawCopy();*/
  can1->cd(1);
  if(hisTan)  
    hisTan->DrawCopy();
  can1->cd(2);
  if(hisPz)  
    hisPz->DrawCopy();

  can1->Print("vert.pdf");

  // -----   Finish   -------------------------------------------------------
  timer.Stop();
  Double_t rtime = timer.RealTime();
  Double_t ctime = timer.CpuTime();
  cout << endl << endl;
  cout << "Macro finished succesfully." << endl;
  //cout << "Output file is "    << outFile << endl;
  //cout << "Parameter file is " << parFile << endl;
  cout << "Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
  cout << endl;
  // ------------------------------------------------------------------------

}

