Rev 331 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 331 | Rev 333 | ||
---|---|---|---|
Line 56... | Line 56... | ||
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 ); |
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 ); |
59 | int combiner3(int id0 ,int id1 , int id2, int same, SIMPLEPID particlename, double min, double max, std::vector<int>hid, int id ); |
60 | int fix_mass(int id); |
60 | int fix_mass(int id); |
61 | int Fill(std::vector<int> hid, BParticle |
61 | int Fill(std::vector<int> hid, std::vector<BParticle *> p); |
62 | void plist(int i); |
62 | void plist(int i); |
63 | 63 | ||
64 | 64 | ||
65 | ClassDef ( Blab2, 1 ) |
65 | ClassDef ( Blab2, 1 ) |
66 | }; |
66 | }; |
Line 82... | Line 82... | ||
82 | "momentum (GeV/c)", |
82 | "momentum (GeV/c)", |
83 | "momentum (GeV/c)", |
83 | "momentum (GeV/c)", |
84 | "momentum (GeV/c)", |
84 | "momentum (GeV/c)", |
85 | "momentum (GeV/c)", |
85 | "momentum (GeV/c)", |
86 | "angle (deg.)", |
86 | "angle (deg.)", |
87 | "cos(theta)"}; |
87 | "cos(theta)", "#Deltamass_{1}(GeV/c2)", "#Deltamass_{2}(GeV/c2)", "#Delta mass_{3}(GeV/c2)"}; |
88 | fHtype[id] = 0; |
88 | fHtype[id] = 0; |
89 | if (svar.Contains("GetMass" )) fHtype[id]=0; |
89 | if (svar.Contains("GetMass" )) fHtype[id]=0; |
90 | if (svar.Contains("GetMomentum")) fHtype[id]=1; |
90 | if (svar.Contains("GetMomentum")) fHtype[id]=1; |
91 | if (svar.Contains("GetEnergy" )) fHtype[id]=2; |
91 | if (svar.Contains("GetEnergy" )) fHtype[id]=2; |
92 | if (svar.Contains("GetCharge" )) fHtype[id]=3; |
92 | if (svar.Contains("GetCharge" )) fHtype[id]=3; |
Line 95... | Line 95... | ||
95 | if (svar.Contains("GetYMomentum")) fHtype[id]=6; |
95 | if (svar.Contains("GetYMomentum")) fHtype[id]=6; |
96 | if (svar.Contains("GetZMomentum")) fHtype[id]=7; |
96 | if (svar.Contains("GetZMomentum")) fHtype[id]=7; |
97 | if (svar.Contains("GetTransverseMomentum")) fHtype[id]=8; |
97 | if (svar.Contains("GetTransverseMomentum")) fHtype[id]=8; |
98 | if (svar.Contains("GetTheta")) fHtype[id]=9; |
98 | if (svar.Contains("GetTheta")) fHtype[id]=9; |
99 | if (svar.Contains("GetCosTheta")) fHtype[id]=10; |
99 | if (svar.Contains("GetCosTheta")) fHtype[id]=10; |
- | 100 | if (svar.Contains("GetDeltaMass1" )) fHtype[id]=11; |
|
- | 101 | if (svar.Contains("GetDeltaMass2" )) fHtype[id]=12; |
|
- | 102 | if (svar.Contains("GetDeltaMass3" )) fHtype[id]=13; |
|
100 | 103 | ||
101 | //fH[id]= new TH1F(TString::Format("h%d",id), TString::Format("%s;%s;N",name,axis[fHtype[id]].Data()), nbins, min, max); |
104 | //fH[id]= new TH1F(TString::Format("h%d",id), TString::Format("%s;%s;N",name,axis[fHtype[id]].Data()), nbins, min, max); |
102 | if (fHtype[id]==4) { |
105 | if (fHtype[id]==4) { |
103 | fH[id]= new TH1F(TString::Format("h%d",id), TString::Format("%s;%s;N",name,axis[fHtype[id]].Data()), 11, 0, 11); |
106 | fH[id]= new TH1F(TString::Format("h%d",id), TString::Format("%s;%s;N",name,axis[fHtype[id]].Data()), 11, 0, 11); |
104 | for (int i=0;i<11;i++) fH[id]->GetXaxis()->SetBinLabel(i+1,names[i]); |
107 | for (int i=0;i<11;i++) fH[id]->GetXaxis()->SetBinLabel(i+1,names[i]); |
Line 109... | Line 112... | ||
109 | 112 | ||
110 | } |
113 | } |
111 | 114 | ||
112 | 115 | ||
113 | 116 | ||
114 | int Blab2::Fill(std::vector<int> id, BParticle |
117 | int Blab2::Fill(std::vector<int> id, std::vector<BParticle *> particle){ |
115 | for (int i=0; i< id.size(); i++){ |
118 | for (int i=0; i< id.size(); i++){ |
116 | int hid = id[i]; |
119 | int hid = id[i]; |
- | 120 | BParticle *p= particle[0]; |
|
117 | if (hid>=0 && fH[hid]) { |
121 | if (hid>=0 && fH[hid]) { |
118 | double val; |
122 | double val; |
119 | switch (fHtype[hid]){ |
123 | switch (fHtype[hid]){ |
120 | case 0 : val = p->GetMass(); break; |
124 | case 0 : val = p->GetMass(); break; |
121 | case 1 : val = p->GetMomentum(); break; |
125 | case 1 : val = p->GetMomentum(); break; |
Line 126... | Line 130... | ||
126 | case 6 : val = p->py(); break; |
130 | case 6 : val = p->py(); break; |
127 | case 7 : val = p->pz(); break; |
131 | case 7 : val = p->pz(); break; |
128 | case 8 : val = p->GetTransverseMomentum(); break; |
132 | case 8 : val = p->GetTransverseMomentum(); break; |
129 | case 9 : val = (p->GetMomentum()!=0) ? p->pz()/p->GetMomentum() : 0; val = 180.0*TMath::ACos(val)/TMath::Pi(); break; |
133 | case 9 : val = (p->GetMomentum()!=0) ? p->pz()/p->GetMomentum() : 0; val = 180.0*TMath::ACos(val)/TMath::Pi(); break; |
130 | case 10: val = (p->GetMomentum()!=0) ? p->pz()/p->GetMomentum() : 0; break; |
134 | case 10: val = (p->GetMomentum()!=0) ? p->pz()/p->GetMomentum() : 0; break; |
- | 135 | case 11 : |
|
- | 136 | case 12 : |
|
- | 137 | case 13 : { |
|
- | 138 | int idx = fHtype[hid]-10; |
|
- | 139 | val = (particle.size()>idx) ? p->GetMass() - particle[idx]->GetMass() : 0; break; |
|
- | 140 | } |
|
131 | default: val = 0 ; break; |
141 | default: val = 0 ; break; |
132 | } |
142 | } |
133 | fH[hid]->Fill(val); |
143 | fH[hid]->Fill(val); |
134 | } |
144 | } |
135 | 145 | ||
Line 152... | Line 162... | ||
152 | if (_p0 < 0 ) _p0 =0; |
162 | if (_p0 < 0 ) _p0 =0; |
153 | if (_p1 < 0 ) _p1 =0; |
163 | if (_p1 < 0 ) _p1 =0; |
154 | 164 | ||
155 | 165 | ||
156 | fList[_p2]->Clear(); |
166 | fList[_p2]->Clear(); |
- | 167 | std::vector<BParticle *> pall(3); |
|
157 | int nprt=0; |
168 | int nprt=0; |
158 | 169 | ||
159 | for(TIter next1(fList[_p0]);BParticle * p1 =(BParticle *) next1();) { |
170 | for(TIter next1(fList[_p0]);BParticle * p1 =(BParticle *) next1();) { |
160 | // the second loop |
171 | // the second loop |
161 | // in the case the second parti |
172 | // in the case the second parti |
162 | for(TIter next2 = (_p0!=_p1 && same==0) ? TIter(fList[_p1]): TIter(next1) ; BParticle * p2 =(BParticle *) next2();) { |
173 | for(TIter next2 = (_p0!=_p1 && same==0) ? TIter(fList[_p1]): TIter(next1) ; BParticle * p2 =(BParticle *) next2();) { |
163 | if (p1==p2) continue; // do not use the same particle in the combinations |
174 | if (p1==p2) continue; // do not use the same particle in the combinations |
164 | BParticle p = *p1 + *p2; // Combine two particles into a new particle |
175 | BParticle p = *p1 + *p2; // Combine two particles into a new particle |
- | 176 | pall[0] = &p; |
|
- | 177 | pall[1] = p1; |
|
- | 178 | pall[2] = p2; |
|
- | 179 | ||
165 | if (p.InMassRange(min, max)){ |
180 | if (p.InMassRange(min, max)){ |
166 | Fill(hid, |
181 | Fill(hid, pall); |
167 | p.SetPid(pid); // set PID to particlename to fix the particle mass |
182 | p.SetPid(pid); // set PID to particlename to fix the particle mass |
168 | p.SetEnergyFromPid(); |
183 | p.SetEnergyFromPid(); |
169 | TClonesArray& list = *fList[_p2]; |
184 | TClonesArray& list = *fList[_p2]; |
170 | new (list[nprt++]) BParticle ( p ); // create a new entry in kslist list of particles |
185 | new (list[nprt++]) BParticle ( p ); // create a new entry in kslist list of particles |
171 | 186 | ||
Line 184... | Line 199... | ||
184 | if (_p1 < 0 ) _p1 =0; |
199 | if (_p1 < 0 ) _p1 =0; |
185 | if (_p2 < 0 ) _p2 =0; |
200 | if (_p2 < 0 ) _p2 =0; |
186 | 201 | ||
187 | 202 | ||
188 | fList[_p3]->Clear(); |
203 | fList[_p3]->Clear(); |
- | 204 | std::vector<BParticle *> pall(4); |
|
- | 205 | ||
189 | int nprt=0; |
206 | int nprt=0; |
190 | 207 | ||
191 | for(TIter next1(fList[_p0]);BParticle * p1 =(BParticle *) next1();) { |
208 | for(TIter next1(fList[_p0]);BParticle * p1 =(BParticle *) next1();) { |
192 | // the second loop |
209 | // the second loop |
193 | // in the case the second parti |
210 | // in the case the second parti |
194 | for(TIter next2 = (_p0!=_p1 && same==0) ? TIter(fList[_p1]): TIter(next1) ; BParticle * p2 =(BParticle *) next2();) { |
211 | 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 |
212 | 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();) { |
213 | 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 |
214 | if (p2==p3) continue; // do not use the same particle in the combinations |
198 | BParticle p = |
215 | BParticle p = *p1 + *p2 + *p3 ; // Combine two particles into a new particle |
- | 216 | pall[0] = &p; |
|
- | 217 | pall[1] = p1; |
|
- | 218 | pall[2] = p2; |
|
- | 219 | pall[3] = p3; |
|
- | 220 | ||
- | 221 | ||
199 | if (p.InMassRange(min, max)){ |
222 | if (p.InMassRange(min, max)){ |
200 | Fill(hid, |
223 | Fill(hid, pall); |
201 | p.SetPid(pid); // set PID to particlename to fix the particle mass |
224 | p.SetPid(pid); // set PID to particlename to fix the particle mass |
202 | p.SetEnergyFromPid(); |
225 | p.SetEnergyFromPid(); |
203 | TClonesArray& list = *fList[_p3]; |
226 | TClonesArray& list = *fList[_p3]; |
204 | new (list[nprt++]) BParticle ( p ); // create a new entry in kslist list of particles |
227 | new (list[nprt++]) BParticle ( p ); // create a new entry in kslist list of particles |
205 | } |
228 | } |
Line 219... | Line 242... | ||
219 | int Blab2::selector(int pin, int charge, SIMPLEPID type , std::vector<int> hid, int pout ){ |
242 | int Blab2::selector(int pin, int charge, SIMPLEPID type , std::vector<int> hid, int pout ){ |
220 | if (pin < 0 ) pin =0; |
243 | if (pin < 0 ) pin =0; |
221 | 244 | ||
222 | fList[pout]->Clear(); |
245 | fList[pout]->Clear(); |
223 | int nprt=0; |
246 | int nprt=0; |
- | 247 | std::vector<BParticle *> pall(1); |
|
224 | 248 | ||
225 | for(TIter next(fList[pin]); BParticle * p =(BParticle *) next();) { |
249 | for(TIter next(fList[pin]); BParticle * p =(BParticle *) next();) { |
226 | if (p->charge()== charge || charge > 1){ |
250 | if (p->charge()== charge || charge > 1){ |
227 | if ( p->pid()== type || type == ALL ) { |
251 | if ( p->pid()== type || type == ALL ) { |
228 | TClonesArray& list = *fList[pout]; |
252 | TClonesArray& list = *fList[pout]; |
229 | new (list[nprt++]) BParticle ( *p ); |
253 | new (list[nprt++]) BParticle ( *p ); |
- | 254 | pall[0] = p ; |
|
230 | Fill(hid, |
255 | Fill(hid, pall); |
231 | } |
256 | } |
232 | } |
257 | } |
233 | } |
258 | } |
234 | return pout; |
259 | return pout; |
235 | } |
260 | } |