159 |
|
b->Track_pz[1], |
160 |
|
MU_MASS ); |
161 |
|
vb.push_back(qb2); |
162 |
< |
ncounter++; |
163 |
< |
Compare(va,vb,histos); |
162 |
> |
if (a->momConverged || a->vtxConverged || a->fullConverged) |
163 |
> |
{ |
164 |
> |
if (b->momConverged || b->vtxConverged || b->fullConverged) |
165 |
> |
{ ncounter++; Compare(va,vb,histos);} |
166 |
> |
} |
167 |
|
} |
168 |
|
else if (a->RunNumber!=b->RunNumber) |
169 |
|
{ |
198 |
|
|
199 |
|
|
200 |
|
|
201 |
< |
|
202 |
< |
void EvtComparison::Compare(const std::vector<TLorentzVector>& spy, |
200 |
< |
const std::vector<TLorentzVector>& tree, |
201 |
> |
void EvtComparison::Compare(const std::vector<TLorentzVector>& a, |
202 |
> |
const std::vector<TLorentzVector>& b, |
203 |
|
histoEvt& histos) |
204 |
|
{ |
205 |
< |
// std::cout << "common" << std::endl; |
205 |
> |
|
206 |
> |
for (unsigned int i=0;i<2;i++) |
207 |
> |
{ |
208 |
> |
unsigned int j=0; |
209 |
> |
double theMax1 = histos.cos(a[i].Px(),a[i].Py(),a[i].Pz(),b[0].Px(),b[0].Py(),b[0].Pz()); |
210 |
> |
double theMax2 = histos.cos(a[i].Px(),a[i].Py(),a[i].Pz(),b[1].Px(),b[1].Py(),b[1].Pz()); |
211 |
> |
if (theMax1>theMax2) j=0; else j=1; |
212 |
> |
|
213 |
> |
histos.diffPT ->Fill( a[i].Pt()-b[j].Pt() ); |
214 |
> |
histos.diffP ->Fill( a[i].P()-b[j].P() ); |
215 |
> |
histos.diffPX ->Fill( a[i].Px()-b[j].Px() ); |
216 |
> |
histos.diffPY ->Fill( a[i].Py()-b[j].Py() ); |
217 |
> |
histos.diffPZ ->Fill( a[i].Pz()-b[j].Pz() ); |
218 |
> |
histos.diffE ->Fill( a[i].E()-b[j].E() ); |
219 |
> |
histos.diffEta->Fill( a[i].Eta()-b[j].Eta() ); |
220 |
> |
histos.diffPhi->Fill( a[i].Phi()-b[j].Phi() ); |
221 |
> |
} |
222 |
> |
|
223 |
> |
|
224 |
> |
double P2a = pow(a[0].Px()+a[1].Px(),2) + pow(a[0].Py()+a[1].Py(),2) + pow(a[0].Pz()+a[1].Pz(),2); |
225 |
> |
double E2a = pow(a[0].E()+a[1].E(),2); |
226 |
> |
|
227 |
> |
double P2b = pow(b[0].Px()+b[1].Px(),2) + pow(b[0].Py()+b[1].Py(),2) + pow(b[0].Pz()+b[1].Pz(),2); |
228 |
> |
double E2b = pow(b[0].E()+b[1].E(),2); |
229 |
> |
|
230 |
> |
|
231 |
> |
histos.diffMz ->Fill( sqrt(E2a-P2a) - sqrt(E2b-P2b) ); |
232 |
> |
|
233 |
|
} |