#ifndef __PHUrCollisionHeader_h__
#define __PHUrCollisionHeader_h__


#include "TObject.h"

#include <fstream>
#include <iostream>
#include <iomanip>

using namespace std;

class PHUrCollisionHeader : public TObject {

public:
    Int_t    n_in;            //   1  Int_t n ingoing particles
    Int_t    n_out;           //   2  Int_t n outgoing particles
    Int_t    process_id;      //   3  Int_t process id
    Int_t    n_collision;     //   4  Int_t n collision
    Double_t t_collision;     //   5  Double_t collison time fm/c
    Double_t E_total_CM;      //   6  Double total CM energy GeV
    Double_t sig_total;       //   7  Double_t  total cross section mbarn
    Double_t sig_partial;     //   8  Double_t  partial cross section of exit channel mbarn
    Double_t baryon_density;  //   9  Double_t baryon density at collision point

    using TObject::Read;
    Bool_t Read(ifstream& in) {
	if(in.eof())   return kFALSE;
	if(!in.good()) return kFALSE;
	in >> n_in >> n_out >> process_id >> n_collision >> t_collision >> 
	    E_total_CM >> sig_total >> sig_partial >> baryon_density;
	if(n_in!=-2 && !in.eof() && !in.good()) return kFALSE;
        return kTRUE;
    }

    using TObject::Print;
    void Print(Option_t *) {
	cout<< setw(5)  << dec << n_in << " "
	    << setw(6)  << n_out       << " "
	    << setw(4)  << process_id  << " "
	    << setw(4)  << n_collision << " "
	    << setw(15) << scientific  << t_collision << " "
	    << setw(15) << E_total_CM  << " "
	    << setw(15) << sig_total   << " "
	    << setw(15) << sig_partial << " "
	    << setw(15) << baryon_density
	    << dec << endl;
    }

    using TObject::Clear;
    void Clear(Option_t *) {
	n_in           = -2;
	n_out          = -1;
	process_id     = -1;
	n_collision    = -1;
	t_collision    = -1;
	E_total_CM     = -1;
	sig_total      = -1;
	sig_partial    = -1;
	baryon_density = -1;
    }
    PHUrCollisionHeader(){ Clear(NULL);}
    ~PHUrCollisionHeader(){}
    Bool_t IsScattering()            { return (n_in==2 && n_out==2 ) ; }
    Bool_t IsDecay()                 { return (n_in==1 && n_out==2 ) ; }
    Bool_t IsAnnihilation()          { return (n_in==2 && n_out==1 ) ; }
    Bool_t IsPauliBlockedCollision() { return (n_in==2 && n_out==0 ) ; }
    Bool_t IsPauliBlockedDecay()     { return (n_in==1 && n_out==0 ) ; }
    Bool_t IsStringDecay5()          { return (n_in==2 && n_out==5 ) ; }

    ClassDef(PHUrCollisionHeader,0)

};


#endif
 PHUrCollisionHeader.h:1
 PHUrCollisionHeader.h:2
 PHUrCollisionHeader.h:3
 PHUrCollisionHeader.h:4
 PHUrCollisionHeader.h:5
 PHUrCollisionHeader.h:6
 PHUrCollisionHeader.h:7
 PHUrCollisionHeader.h:8
 PHUrCollisionHeader.h:9
 PHUrCollisionHeader.h:10
 PHUrCollisionHeader.h:11
 PHUrCollisionHeader.h:12
 PHUrCollisionHeader.h:13
 PHUrCollisionHeader.h:14
 PHUrCollisionHeader.h:15
 PHUrCollisionHeader.h:16
 PHUrCollisionHeader.h:17
 PHUrCollisionHeader.h:18
 PHUrCollisionHeader.h:19
 PHUrCollisionHeader.h:20
 PHUrCollisionHeader.h:21
 PHUrCollisionHeader.h:22
 PHUrCollisionHeader.h:23
 PHUrCollisionHeader.h:24
 PHUrCollisionHeader.h:25
 PHUrCollisionHeader.h:26
 PHUrCollisionHeader.h:27
 PHUrCollisionHeader.h:28
 PHUrCollisionHeader.h:29
 PHUrCollisionHeader.h:30
 PHUrCollisionHeader.h:31
 PHUrCollisionHeader.h:32
 PHUrCollisionHeader.h:33
 PHUrCollisionHeader.h:34
 PHUrCollisionHeader.h:35
 PHUrCollisionHeader.h:36
 PHUrCollisionHeader.h:37
 PHUrCollisionHeader.h:38
 PHUrCollisionHeader.h:39
 PHUrCollisionHeader.h:40
 PHUrCollisionHeader.h:41
 PHUrCollisionHeader.h:42
 PHUrCollisionHeader.h:43
 PHUrCollisionHeader.h:44
 PHUrCollisionHeader.h:45
 PHUrCollisionHeader.h:46
 PHUrCollisionHeader.h:47
 PHUrCollisionHeader.h:48
 PHUrCollisionHeader.h:49
 PHUrCollisionHeader.h:50
 PHUrCollisionHeader.h:51
 PHUrCollisionHeader.h:52
 PHUrCollisionHeader.h:53
 PHUrCollisionHeader.h:54
 PHUrCollisionHeader.h:55
 PHUrCollisionHeader.h:56
 PHUrCollisionHeader.h:57
 PHUrCollisionHeader.h:58
 PHUrCollisionHeader.h:59
 PHUrCollisionHeader.h:60
 PHUrCollisionHeader.h:61
 PHUrCollisionHeader.h:62
 PHUrCollisionHeader.h:63
 PHUrCollisionHeader.h:64
 PHUrCollisionHeader.h:65
 PHUrCollisionHeader.h:66
 PHUrCollisionHeader.h:67
 PHUrCollisionHeader.h:68
 PHUrCollisionHeader.h:69
 PHUrCollisionHeader.h:70
 PHUrCollisionHeader.h:71
 PHUrCollisionHeader.h:72
 PHUrCollisionHeader.h:73
 PHUrCollisionHeader.h:74
 PHUrCollisionHeader.h:75
 PHUrCollisionHeader.h:76