Subversion Repositories f9daq

Compare Revisions

Ignore whitespace Rev 329 → Rev 330

/belle2/masterclass/src/Blab2.cc
55,6 → 55,8
int selector(int pin, int charge, SIMPLEPID particlename, std::vector<int> hid, int pout );
int combiner(int id0 ,int id1 , int same, SIMPLEPID particlename, double min, double max, int hid, int id );
int combiner(int id0 ,int id1 , int same, SIMPLEPID particlename, double min, double max, std::vector<int>hid, int id );
int combiner3(int id0 ,int id1 , int id2, int same, SIMPLEPID particlename, double min, double max, int hid, int id );
int combiner3(int id0 ,int id1 , int id2, int same, SIMPLEPID particlename, double min, double max, std::vector<int>hid, int id );
int fix_mass(int id);
int Fill(std::vector<int> hid, BParticle *p);
void plist(int i);
140,6 → 142,11
return combiner(_p0,_p1,same,pid,min,max,a,_p2);
}
 
int Blab2::combiner3(int _p0, int _p1, int _p2, int same, SIMPLEPID pid, double min, double max, int hid, int _p3 ){
std::vector<int> a;
return combiner3(_p0,_p1,_p2, same,pid,min,max,a,_p3);
}
 
int Blab2::combiner(int _p0, int _p1,int same, SIMPLEPID pid, double min, double max, std::vector<int> hid, int _p2 ){
// Loop over all the particles in both lists.
if (_p0 < 0 ) _p0 =0;
171,6 → 178,40
}
 
 
int Blab2::combiner3(int _p0, int _p1,int _p2, int same, SIMPLEPID pid, double min, double max, std::vector<int> hid, int _p3 ){
// Loop over all the particles in both lists.
if (_p0 < 0 ) _p0 =0;
if (_p1 < 0 ) _p1 =0;
if (_p2 < 0 ) _p2 =0;
 
fList[_p2]->Clear();
int nprt=0;
for(TIter next1(fList[_p0]);BParticle * p1 =(BParticle *) next1();) {
// the second loop
// in the case the second parti
for(TIter next2 = (_p0!=_p1 && same==0) ? TIter(fList[_p1]): TIter(next1) ; BParticle * p2 =(BParticle *) next2();) {
if (p1==p2) continue; // do not use the same particle in the combinations
for(TIter next3 = (_p1!=_p2 && same==0) ? TIter(fList[_p2]): TIter(next2) ; BParticle * p3 =(BParticle *) next3();) {
if (p2==p3) continue; // do not use the same particle in the combinations
BParticle p = *p1 + *p2 + *p3; // Combine two particles into a new particle
if (p.InMassRange(min, max)){
Fill(hid, &p);
p.SetPid(pid); // set PID to particlename to fix the particle mass
p.SetEnergyFromPid();
TClonesArray& list = *fList[_p3];
new (list[nprt++]) BParticle ( p ); // create a new entry in kslist list of particles
}
}
}
}
return _p3;
}
 
 
int Blab2::selector(int pin, int charge, SIMPLEPID type , int hid, int pout ){
std::vector<int> a;
return selector(pin,charge,type,a,pout);