Rev 329 | Rev 331 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 329 | Rev 330 | ||
|---|---|---|---|
| Line 53... | Line 53... | ||
| 53 | void h1d(const char *varname, const char *name, int nbins, double min, double max, int id ); |
53 | void h1d(const char *varname, const char *name, int nbins, double min, double max, int id ); |
| 54 | int selector(int pin, int charge, SIMPLEPID particlename, int hid, int pout ); |
54 | int selector(int pin, int charge, SIMPLEPID particlename, int hid, int pout ); |
| 55 | int selector(int pin, int charge, SIMPLEPID particlename, std::vector<int> hid, int pout ); |
55 | int selector(int pin, int charge, SIMPLEPID particlename, std::vector<int> hid, int pout ); |
| 56 | int combiner(int id0 ,int id1 , int same, SIMPLEPID particlename, double min, double max, int hid, int id ); |
56 | int combiner(int id0 ,int id1 , int same, SIMPLEPID particlename, double min, double max, int hid, int id ); |
| 57 | int combiner(int id0 ,int id1 , int same, SIMPLEPID particlename, double min, double max, std::vector<int>hid, int id ); |
57 | int combiner(int id0 ,int id1 , int same, SIMPLEPID particlename, double min, double max, std::vector<int>hid, int id ); |
| - | 58 | int combiner3(int id0 ,int id1 , int id2, int same, SIMPLEPID particlename, double min, double max, int hid, int id ); |
|
| - | 59 | int combiner3(int id0 ,int id1 , int id2, int same, SIMPLEPID particlename, double min, double max, std::vector<int>hid, int id ); |
|
| 58 | int fix_mass(int id); |
60 | int fix_mass(int id); |
| 59 | int Fill(std::vector<int> hid, BParticle *p); |
61 | int Fill(std::vector<int> hid, BParticle *p); |
| 60 | void plist(int i); |
62 | void plist(int i); |
| 61 | 63 | ||
| 62 | 64 | ||
| Line 136... | Line 138... | ||
| 136 | return 0; |
138 | return 0; |
| 137 | } |
139 | } |
| 138 | int Blab2::combiner(int _p0, int _p1,int same, SIMPLEPID pid, double min, double max, int hid, int _p2 ){ |
140 | int Blab2::combiner(int _p0, int _p1,int same, SIMPLEPID pid, double min, double max, int hid, int _p2 ){ |
| 139 | std::vector<int> a; |
141 | std::vector<int> a; |
| 140 | return combiner(_p0,_p1,same,pid,min,max,a,_p2); |
142 | return combiner(_p0,_p1,same,pid,min,max,a,_p2); |
| - | 143 | } |
|
| - | 144 | ||
| - | 145 | int Blab2::combiner3(int _p0, int _p1, int _p2, int same, SIMPLEPID pid, double min, double max, int hid, int _p3 ){ |
|
| - | 146 | std::vector<int> a; |
|
| - | 147 | return combiner3(_p0,_p1,_p2, same,pid,min,max,a,_p3); |
|
| 141 | } |
148 | } |
| 142 | 149 | ||
| 143 | int Blab2::combiner(int _p0, int _p1,int same, SIMPLEPID pid, double min, double max, std::vector<int> hid, int _p2 ){ |
150 | int Blab2::combiner(int _p0, int _p1,int same, SIMPLEPID pid, double min, double max, std::vector<int> hid, int _p2 ){ |
| 144 | // Loop over all the particles in both lists. |
151 | // Loop over all the particles in both lists. |
| 145 | if (_p0 < 0 ) _p0 =0; |
152 | if (_p0 < 0 ) _p0 =0; |
| Line 152... | Line 159... | ||
| 152 | for(TIter next1(fList[_p0]);BParticle * p1 =(BParticle *) next1();) { |
159 | for(TIter next1(fList[_p0]);BParticle * p1 =(BParticle *) next1();) { |
| 153 | // the second loop |
160 | // the second loop |
| 154 | // in the case the second parti |
161 | // in the case the second parti |
| 155 | for(TIter next2 = (_p0!=_p1 && same==0) ? TIter(fList[_p1]): TIter(next1) ; BParticle * p2 =(BParticle *) next2();) { |
162 | for(TIter next2 = (_p0!=_p1 && same==0) ? TIter(fList[_p1]): TIter(next1) ; BParticle * p2 =(BParticle *) next2();) { |
| 156 | if (p1==p2) continue; // do not use the same particle in the combinations |
163 | if (p1==p2) continue; // do not use the same particle in the combinations |
| 157 | BParticle p = *p1 + *p2; // Combine two particles into a new particle |
164 | BParticle p = *p1 + *p2; // Combine two particles into a new particle |
| 158 | if (p.InMassRange(min, max)){ |
165 | if (p.InMassRange(min, max)){ |
| - | 166 | Fill(hid, &p); |
|
| - | 167 | p.SetPid(pid); // set PID to particlename to fix the particle mass |
|
| - | 168 | p.SetEnergyFromPid(); |
|
| - | 169 | TClonesArray& list = *fList[_p2]; |
|
| - | 170 | new (list[nprt++]) BParticle ( p ); // create a new entry in kslist list of particles |
|
| - | 171 | ||
| - | 172 | } |
|
| - | 173 | ||
| - | 174 | } |
|
| - | 175 | ||
| - | 176 | } |
|
| - | 177 | return _p2; |
|
| - | 178 | } |
|
| - | 179 | ||
| - | 180 | ||
| - | 181 | int Blab2::combiner3(int _p0, int _p1,int _p2, int same, SIMPLEPID pid, double min, double max, std::vector<int> hid, int _p3 ){ |
|
| - | 182 | // Loop over all the particles in both lists. |
|
| - | 183 | if (_p0 < 0 ) _p0 =0; |
|
| - | 184 | if (_p1 < 0 ) _p1 =0; |
|
| - | 185 | if (_p2 < 0 ) _p2 =0; |
|
| - | 186 | ||
| - | 187 | ||
| - | 188 | fList[_p2]->Clear(); |
|
| - | 189 | int nprt=0; |
|
| - | 190 | ||
| - | 191 | for(TIter next1(fList[_p0]);BParticle * p1 =(BParticle *) next1();) { |
|
| - | 192 | // the second loop |
|
| - | 193 | // in the case the second parti |
|
| - | 194 | for(TIter next2 = (_p0!=_p1 && same==0) ? TIter(fList[_p1]): TIter(next1) ; BParticle * p2 =(BParticle *) next2();) { |
|
| - | 195 | if (p1==p2) continue; // do not use the same particle in the combinations |
|
| - | 196 | for(TIter next3 = (_p1!=_p2 && same==0) ? TIter(fList[_p2]): TIter(next2) ; BParticle * p3 =(BParticle *) next3();) { |
|
| - | 197 | if (p2==p3) continue; // do not use the same particle in the combinations |
|
| - | 198 | BParticle p = *p1 + *p2 + *p3; // Combine two particles into a new particle |
|
| - | 199 | if (p.InMassRange(min, max)){ |
|
| 159 | Fill(hid, &p); |
200 | Fill(hid, &p); |
| 160 | p.SetPid(pid); // set PID to particlename to fix the particle mass |
201 | p.SetPid(pid); // set PID to particlename to fix the particle mass |
| 161 | p.SetEnergyFromPid(); |
202 | p.SetEnergyFromPid(); |
| 162 | TClonesArray& list = *fList[ |
203 | TClonesArray& list = *fList[_p3]; |
| 163 | new (list[nprt++]) BParticle ( p ); // create a new entry in kslist list of particles |
204 | new (list[nprt++]) BParticle ( p ); // create a new entry in kslist list of particles |
| 164 | 205 | } |
|
| 165 | } |
206 | } |
| 166 | 207 | ||
| 167 | } |
208 | } |
| 168 | 209 | ||
| 169 | } |
210 | } |
| 170 | return |
211 | return _p3; |
| 171 | } |
212 | } |
| 172 | 213 | ||
| 173 | 214 | ||
| 174 | int Blab2::selector(int pin, int charge, SIMPLEPID type , int hid, int pout ){ |
215 | int Blab2::selector(int pin, int charge, SIMPLEPID type , int hid, int pout ){ |
| 175 | std::vector<int> a; |
216 | std::vector<int> a; |