16 #include "include/gzstream.h"
22 inline HEP::P4 readvec(std::istringstream &ss)
25 if(! (ss >> x >> y >> z >> t))
27 return HEP::P4(0.0,0.0,0.0,0.0);
37 inline void ReadPileupFile(
const string & minbiasfile,std::vector<HEP::PileupEvent*> *pileups,
int max_events=-1)
40 ss.open(
"minbias.dat.gz");
42 bool FoundEvent=
false;
47 while (std::getline(ss, line)) {
54 std::istringstream data(line);
63 pileups->push_back(new_event);
70 if((max_events>0) && (nevents > max_events))
82 if(!FoundEvent)
continue;
88 if(! (data >> pid))
continue;
89 if(! (data >> chargeType))
continue;
96 new_particle->set_prod(prod);
97 new_particle->set_3Q(chargeType);
101 new_particle->set_decay(dec);
103 if(Ptype.compare(
"P") == 0)
105 new_event->add_particle(new_particle);
108 else if(Ptype.compare(
"CH") ==0)
110 new_event->add_charged_hadron(new_particle);
113 else if(Ptype.compare(
"NH")==0)
115 new_event->add_neutral_hadron(mom);
120 std::cout <<
"Could not read line starting " << Ptype <<std::endl;
132 pileups->push_back(new_event);
A 4-momentum class for vectors.
Definition: Vectors.h:45
double p2() const
Get E^2.
Definition: Vectors.h:441
Definition: Particle.h:24