1 | #include <iostream>
|
---|
2 |
|
---|
3 | #include "TApplication.h"
|
---|
4 | #include "TLorentzVector.h"
|
---|
5 |
|
---|
6 | #include "TFile.h"
|
---|
7 |
|
---|
8 | #include "ExRootAnalysis/ExRootClasses.h"
|
---|
9 | #include "ExRootAnalysis/ExRootTreeBranch.h"
|
---|
10 | #include "ExRootAnalysis/ExRootTreeWriter.h"
|
---|
11 |
|
---|
12 | using namespace std;
|
---|
13 |
|
---|
14 | // generated particle list
|
---|
15 |
|
---|
16 | const int nmxhep = 4000;
|
---|
17 |
|
---|
18 | typedef struct
|
---|
19 | {
|
---|
20 | int nevhep; // event number
|
---|
21 | int nhep; // number of entries in record
|
---|
22 | int isthep[nmxhep]; // status code
|
---|
23 | int idhep[nmxhep]; // particle ID (PDG standard)
|
---|
24 | int jmohep[nmxhep][2]; // index to first and second particle mothers
|
---|
25 | int jdahep[nmxhep][2]; // index to first and last daughter particles
|
---|
26 | double phep[nmxhep][5]; // 4-vector and mass
|
---|
27 | double vhep[nmxhep][4]; // (x,y,z) of production, and production time (mm/c)
|
---|
28 | } hepevtF77;
|
---|
29 |
|
---|
30 | extern hepevtF77 hepevt_;
|
---|
31 |
|
---|
32 | // PGS track list
|
---|
33 |
|
---|
34 | const int ntrkmx = 500;
|
---|
35 |
|
---|
36 | typedef struct
|
---|
37 | {
|
---|
38 | int numtrk; // number of tracks
|
---|
39 | int dumtrk; // number of tracks
|
---|
40 | int indtrk[ntrkmx]; // index to HEPEVT particle
|
---|
41 | double ptrk[ntrkmx][3]; // track 3-vector
|
---|
42 | double qtrk[ntrkmx]; // track charge
|
---|
43 | } pgstrkF77;
|
---|
44 |
|
---|
45 | extern pgstrkF77 pgstrk_;
|
---|
46 |
|
---|
47 | // PGS calorimeter tower arrays
|
---|
48 |
|
---|
49 | const int nphimax = 600;
|
---|
50 | const int netamax = 600;
|
---|
51 |
|
---|
52 | typedef struct
|
---|
53 | {
|
---|
54 | double ecal[nphimax][netamax]; // electromagnetic energy in each tower
|
---|
55 | double hcal[nphimax][netamax]; // hadronic energy in each tower
|
---|
56 | double met_cal; // calorimeter missing ET
|
---|
57 | double phi_met_cal; // calorimeter missing ET phi
|
---|
58 | } pgscalF77;
|
---|
59 |
|
---|
60 | extern pgscalF77 pgscal_;
|
---|
61 |
|
---|
62 |
|
---|
63 | // PGS calorimeter cluster list
|
---|
64 |
|
---|
65 | const int nclumx = 50;
|
---|
66 |
|
---|
67 | typedef struct
|
---|
68 | {
|
---|
69 | int cclu[nphimax][netamax]; // map of cluster indices
|
---|
70 | int numclu; // number of clusters in list
|
---|
71 | int dumclu; // number of clusters in list
|
---|
72 | double pclu[nclumx][5]; // cluster 4 vector and mass
|
---|
73 | int etaclu[nclumx]; // cluster seed tower eta
|
---|
74 | int phiclu[nclumx]; // cluster seed tower phi
|
---|
75 | double emclu[nclumx]; // cluster electromagnetic energy
|
---|
76 | double ehclu[nclumx]; // cluster hadronic energy
|
---|
77 | double efclu[nclumx]; // cluster electromagnetic fraction
|
---|
78 | double widclu[nclumx]; // cluster width sqrt(deta**2+dphi**2)
|
---|
79 | int mulclu[nclumx]; // cluster tower multiplicity
|
---|
80 | } pgscluF77;
|
---|
81 |
|
---|
82 | extern pgscluF77 pgsclu_;
|
---|
83 |
|
---|
84 | // PGS trigger object list
|
---|
85 |
|
---|
86 | const int ntrgmx = 500;
|
---|
87 |
|
---|
88 | typedef struct
|
---|
89 | {
|
---|
90 | int numtrg; // number of trigger objects
|
---|
91 | int dumtrg; // number of trigger objects
|
---|
92 | int indtrg[ntrgmx]; // index to HEPEVT particle (where relevant)
|
---|
93 | int typtrg[ntrgmx]; // reconstructed type: 0=photon
|
---|
94 | // 1=electron
|
---|
95 | // 2=muon
|
---|
96 | // 3=tau (hadronic)
|
---|
97 | // 4=jet
|
---|
98 | // 5=detached vertex
|
---|
99 | // 6=MET
|
---|
100 | double vectrg[ntrgmx][10]; // trigger object vector: 1 = eta
|
---|
101 | // 2 = phi
|
---|
102 | // 3 = ET of cluster
|
---|
103 | // 4 = cluster #
|
---|
104 | // 5 = pt of track (if any)
|
---|
105 | // 6 = track #
|
---|
106 | } pgstrgF77;
|
---|
107 |
|
---|
108 | extern pgstrgF77 pgstrg_;
|
---|
109 |
|
---|
110 | // PGS reconstructed object list
|
---|
111 |
|
---|
112 | const int nobjmx = 500;
|
---|
113 |
|
---|
114 | typedef struct
|
---|
115 | {
|
---|
116 | int numobj; // number of reconstructed objects
|
---|
117 | int dumobj; // number of reconstructed objects
|
---|
118 | int indobj[nobjmx]; // index to HEPEVT particle (where relevant)
|
---|
119 | int typobj[nobjmx]; // reconstructed type: 0 = photon
|
---|
120 | // 1 = electron
|
---|
121 | // 2 = muon
|
---|
122 | // 3 = tau (hadronic)
|
---|
123 | // 4 = jet
|
---|
124 | // 5 = heavy charged
|
---|
125 | double pobj[nobjmx][4]; // four vector of reconstructed object
|
---|
126 | double qobj[nobjmx]; // charge of reconstructed object
|
---|
127 | double vecobj[nobjmx][10]; // interesting object quantities
|
---|
128 | } pgsrecF77;
|
---|
129 |
|
---|
130 | extern pgsrecF77 pgsrec_;
|
---|
131 |
|
---|
132 | // --------------------------
|
---|
133 | // table of vecobj quantities
|
---|
134 | // --------------------------
|
---|
135 | //
|
---|
136 | // -------------------------------------------------------------------------------------
|
---|
137 | // type 1 2 3 4 5 6 7
|
---|
138 | // -------------------------------------------------------------------------------------
|
---|
139 | // 0 photon EM energy HAD energy track E N(trk) width - -
|
---|
140 | // 1 electron " " " " " " - - -
|
---|
141 | // 2 muon " " " " " " trk iso E - -
|
---|
142 | // 3 tau " " " " " " width mtau ptmax
|
---|
143 | // 4 jet " " " " " " " flavor c,b tags ->
|
---|
144 | // -------------------------------------------------------------------------------------
|
---|
145 | //
|
---|
146 | // b, c tagging: vecobj(7,iobj) non-zero if charm tag (jet prob. alg.)
|
---|
147 | // vecobj(8,iobj) non-zero if b tag ( " " " )
|
---|
148 | // vecobj(9,iobj) non-zero if b tag (impact method)
|
---|
149 | //
|
---|
150 | // --> all algorithms include rates for gluon, uds, c and b jets
|
---|
151 | //
|
---|
152 |
|
---|
153 | static TFile *outputFile;
|
---|
154 | static ExRootTreeWriter *treeWriter;
|
---|
155 |
|
---|
156 | static ExRootTreeBranch *branchGenParticle;
|
---|
157 | static ExRootTreeBranch *branchTrack;
|
---|
158 | static ExRootTreeBranch *branchCalTower;
|
---|
159 | static ExRootTreeBranch *branchMissingET;
|
---|
160 | static ExRootTreeBranch *branchCalCluster;
|
---|
161 | static ExRootTreeBranch *branchPhoton;
|
---|
162 | static ExRootTreeBranch *branchElectron;
|
---|
163 | static ExRootTreeBranch *branchMuon;
|
---|
164 | static ExRootTreeBranch *branchTau;
|
---|
165 | static ExRootTreeBranch *branchJet;
|
---|
166 | static ExRootTreeBranch *branchHeavy;
|
---|
167 |
|
---|
168 | static void analyse_particle(Int_t number, ExRootTreeBranch *branch);
|
---|
169 | static void analyse_track(Int_t number, ExRootTreeBranch *branch);
|
---|
170 | static void analyse_tower(Int_t eta, Int_t phi, ExRootTreeBranch *branch);
|
---|
171 | static void analyse_met(ExRootTreeBranch *branch);
|
---|
172 | static void analyse_cluster(Int_t number, ExRootTreeBranch *branch);
|
---|
173 | static void analyse_photon(Int_t number, ExRootTreeBranch *branch);
|
---|
174 | static void analyse_electron(Int_t number, ExRootTreeBranch *branch);
|
---|
175 | static void analyse_muon(Int_t number, ExRootTreeBranch *branch);
|
---|
176 | static void analyse_tau(Int_t number, ExRootTreeBranch *branch);
|
---|
177 | static void analyse_jet(Int_t number, ExRootTreeBranch *branch);
|
---|
178 | static void analyse_heavy(Int_t number, ExRootTreeBranch *branch);
|
---|
179 |
|
---|
180 | extern "C"
|
---|
181 | {
|
---|
182 | void test_cpp__(int *int_var)
|
---|
183 | {
|
---|
184 | cout << "int_var = " << *int_var << endl;
|
---|
185 |
|
---|
186 | cout << "nevhep = " << hepevt_.nevhep << endl;
|
---|
187 | cout << "jmohep(1,2) = " << hepevt_.jmohep[1][0] << endl;
|
---|
188 | cout << "phep(1,1) = " << hepevt_.phep[0][0] << endl;
|
---|
189 |
|
---|
190 | cout << "numtrk = " << pgstrk_.numtrk << endl;
|
---|
191 | cout << "ptrk(2,1) = " << pgstrk_.ptrk[0][1] << endl;
|
---|
192 |
|
---|
193 | cout << "hcal(2,1) = " << pgscal_.hcal[0][1] << endl;
|
---|
194 | cout << "met_cal = " << pgscal_.met_cal << endl;
|
---|
195 |
|
---|
196 | cout << "pclu(2,1) = " << pgsclu_.pclu[0][1] << endl;
|
---|
197 | cout << "mulclu(2) = " << pgsclu_.mulclu[1] << endl;
|
---|
198 |
|
---|
199 | cout << "vectrg(9,2) = " << pgstrg_.vectrg[1][8] << endl;
|
---|
200 | cout << "indtrg(2) = " << pgstrg_.indtrg[1] << endl;
|
---|
201 |
|
---|
202 | cout << "vecobj(10,3) = " << pgsrec_.vecobj[2][9] << endl;
|
---|
203 | cout << "indobj(3) = " << pgsrec_.indobj[2] << endl;
|
---|
204 | }
|
---|
205 |
|
---|
206 | //------------------------------------------------------------------------------
|
---|
207 |
|
---|
208 | void pgs2root_ini__()
|
---|
209 | {
|
---|
210 | int appargc = 2;
|
---|
211 | char *appargv[] = {"pgs2root", "-b"};
|
---|
212 | TApplication app("pgs2root", &appargc, appargv);
|
---|
213 |
|
---|
214 | TString outputFileName("pgs.root");
|
---|
215 | TString treeName("PGS");
|
---|
216 |
|
---|
217 | outputFile = TFile::Open(outputFileName, "RECREATE");
|
---|
218 | treeWriter = new ExRootTreeWriter(outputFile, treeName);
|
---|
219 |
|
---|
220 | // generated particles from HEPEVT
|
---|
221 | branchGenParticle = treeWriter->NewBranch("GenParticle", TRootGenParticle::Class());
|
---|
222 | // reconstructed tracks
|
---|
223 | branchTrack = treeWriter->NewBranch("Track", TRootTrack::Class());
|
---|
224 | // reconstructed calorimeter towers
|
---|
225 | branchCalTower = treeWriter->NewBranch("CalTower", TRootCalTower::Class());
|
---|
226 | // missing transverse energy
|
---|
227 | branchMissingET = treeWriter->NewBranch("MissingET", TRootMissingET::Class());
|
---|
228 | // reconstructed calorimeter clusters for jets and tau leptons
|
---|
229 | branchCalCluster = treeWriter->NewBranch("CalCluster", TRootCalCluster::Class());
|
---|
230 | // reconstructed photons
|
---|
231 | branchPhoton = treeWriter->NewBranch("Photon", TRootPhoton::Class());
|
---|
232 | // reconstructed electrons
|
---|
233 | branchElectron = treeWriter->NewBranch("Electron", TRootElectron::Class());
|
---|
234 | // reconstructed muons
|
---|
235 | branchMuon = treeWriter->NewBranch("Muon", TRootMuon::Class());
|
---|
236 | // reconstructed tau leptons
|
---|
237 | branchTau = treeWriter->NewBranch("Tau", TRootTau::Class());
|
---|
238 | // reconstructed jets
|
---|
239 | branchJet = treeWriter->NewBranch("Jet", TRootJet::Class());
|
---|
240 | // reconstructed heavy particles
|
---|
241 | branchHeavy = treeWriter->NewBranch("Heavy", TRootHeavy::Class());
|
---|
242 | }
|
---|
243 |
|
---|
244 | //---------------------------------------------------------------------------
|
---|
245 |
|
---|
246 | void pgs2root_evt__()
|
---|
247 | {
|
---|
248 | Int_t particle, track, eta, phi, cluster, object;
|
---|
249 |
|
---|
250 | treeWriter->Clear();
|
---|
251 |
|
---|
252 | for(particle = 0; particle < hepevt_.nhep; ++particle)
|
---|
253 | {
|
---|
254 | analyse_particle(particle, branchGenParticle);
|
---|
255 | }
|
---|
256 |
|
---|
257 | for(track = 0; track < pgstrk_.numtrk; ++track)
|
---|
258 | {
|
---|
259 | analyse_track(track, branchTrack);
|
---|
260 | }
|
---|
261 |
|
---|
262 | for(eta = 0; eta < netamax; ++eta)
|
---|
263 | {
|
---|
264 | for(phi = 0; phi < nphimax; ++phi)
|
---|
265 | {
|
---|
266 | if(pgscal_.ecal[phi][eta] == 0.0 &&
|
---|
267 | pgscal_.hcal[phi][eta] == 0.0) continue;
|
---|
268 |
|
---|
269 | analyse_tower(eta, phi, branchCalTower);
|
---|
270 | }
|
---|
271 | }
|
---|
272 |
|
---|
273 | analyse_met(branchMissingET);
|
---|
274 |
|
---|
275 | for(cluster = 0; cluster < pgsclu_.numclu; ++ cluster)
|
---|
276 | {
|
---|
277 | analyse_cluster(cluster, branchCalCluster);
|
---|
278 | }
|
---|
279 |
|
---|
280 | for(object = 0; object < pgsrec_.numobj; ++object)
|
---|
281 | {
|
---|
282 | switch(pgsrec_.typobj[object])
|
---|
283 | {
|
---|
284 | case 0: analyse_photon(object, branchPhoton); break;
|
---|
285 | case 1: analyse_electron(object, branchElectron); break;
|
---|
286 | case 2: analyse_muon(object, branchMuon); break;
|
---|
287 | case 3: analyse_tau(object, branchTau); break;
|
---|
288 | case 4: analyse_jet(object, branchJet); break;
|
---|
289 | case 5: analyse_heavy(object, branchHeavy); break;
|
---|
290 | }
|
---|
291 | }
|
---|
292 |
|
---|
293 | treeWriter->Fill();
|
---|
294 | }
|
---|
295 |
|
---|
296 | //---------------------------------------------------------------------------
|
---|
297 |
|
---|
298 | void pgs2root_end__()
|
---|
299 | {
|
---|
300 | treeWriter->Write();
|
---|
301 |
|
---|
302 | delete treeWriter;
|
---|
303 | delete outputFile;
|
---|
304 | }
|
---|
305 |
|
---|
306 | } // extern "C"
|
---|
307 |
|
---|
308 | //---------------------------------------------------------------------------
|
---|
309 |
|
---|
310 | static void analyse_particle(Int_t number, ExRootTreeBranch *branch)
|
---|
311 | {
|
---|
312 | TRootGenParticle *entry;
|
---|
313 |
|
---|
314 | Double_t signEta;
|
---|
315 |
|
---|
316 | entry = static_cast<TRootGenParticle*>(branch->NewEntry());
|
---|
317 |
|
---|
318 | entry->PID = hepevt_.idhep[number];
|
---|
319 | entry->Status = hepevt_.isthep[number];
|
---|
320 | entry->M1 = hepevt_.jmohep[number][0] - 1;
|
---|
321 | entry->M2 = hepevt_.jmohep[number][1] - 1;
|
---|
322 | entry->D1 = hepevt_.jdahep[number][0] - 1;
|
---|
323 | entry->D2 = hepevt_.jdahep[number][1] - 1;
|
---|
324 |
|
---|
325 | entry->E = hepevt_.phep[number][3];
|
---|
326 | entry->Px = hepevt_.phep[number][0];
|
---|
327 | entry->Py = hepevt_.phep[number][1];
|
---|
328 | entry->Pz = hepevt_.phep[number][2];
|
---|
329 |
|
---|
330 | TVector3 vector(entry->Px, entry->Py, entry->Pz);
|
---|
331 |
|
---|
332 | entry->PT = vector.Perp();
|
---|
333 | signEta = (entry->Pz >= 0.0) ? 1.0 : -1.0;
|
---|
334 | entry->Eta = vector.CosTheta()*vector.CosTheta() == 1.0 ? signEta*999.9 : vector.Eta();
|
---|
335 | entry->Phi = vector.Phi();
|
---|
336 |
|
---|
337 | entry->T = hepevt_.vhep[number][3];
|
---|
338 | entry->X = hepevt_.vhep[number][0];
|
---|
339 | entry->Y = hepevt_.vhep[number][1];
|
---|
340 | entry->Z = hepevt_.vhep[number][2];
|
---|
341 | }
|
---|
342 |
|
---|
343 | //---------------------------------------------------------------------------
|
---|
344 |
|
---|
345 | static void analyse_track(Int_t number, ExRootTreeBranch *branch)
|
---|
346 | {
|
---|
347 | TRootTrack *entry;
|
---|
348 |
|
---|
349 | Double_t signEta;
|
---|
350 |
|
---|
351 | entry = static_cast<TRootTrack*>(branch->NewEntry());
|
---|
352 |
|
---|
353 | entry->Px = pgstrk_.ptrk[number][0];
|
---|
354 | entry->Py = pgstrk_.ptrk[number][1];
|
---|
355 | entry->Pz = pgstrk_.ptrk[number][2];
|
---|
356 |
|
---|
357 | TVector3 vector(entry->Px, entry->Py, entry->Pz);
|
---|
358 |
|
---|
359 | entry->PT = vector.Perp();
|
---|
360 | signEta = (entry->Pz >= 0.0) ? 1.0 : -1.0;
|
---|
361 | entry->Eta = vector.CosTheta()*vector.CosTheta() == 1.0 ? signEta*999.9 : vector.Eta();
|
---|
362 | entry->Phi = vector.Phi();
|
---|
363 |
|
---|
364 | entry->Charge = pgstrk_.qtrk[number];
|
---|
365 |
|
---|
366 | entry->ParticleIndex = pgstrk_.indtrk[number] - 1;
|
---|
367 | }
|
---|
368 |
|
---|
369 | //---------------------------------------------------------------------------
|
---|
370 |
|
---|
371 | static void analyse_tower(Int_t eta, Int_t phi, ExRootTreeBranch *branch)
|
---|
372 | {
|
---|
373 | TRootCalTower *entry;
|
---|
374 |
|
---|
375 | entry = static_cast<TRootCalTower*>(branch->NewEntry());
|
---|
376 |
|
---|
377 | entry->Eem = pgscal_.ecal[phi][eta];
|
---|
378 | entry->Ehad = pgscal_.hcal[phi][eta];
|
---|
379 | entry->E = entry->Eem + entry->Ehad;
|
---|
380 | }
|
---|
381 |
|
---|
382 | //---------------------------------------------------------------------------
|
---|
383 |
|
---|
384 | static void analyse_met(ExRootTreeBranch *branch)
|
---|
385 | {
|
---|
386 | TRootMissingET *entry;
|
---|
387 |
|
---|
388 | entry = static_cast<TRootMissingET*>(branch->NewEntry());
|
---|
389 |
|
---|
390 | entry->MET = pgscal_.met_cal;
|
---|
391 | entry->Phi = pgscal_.phi_met_cal;
|
---|
392 | }
|
---|
393 |
|
---|
394 | //---------------------------------------------------------------------------
|
---|
395 |
|
---|
396 | static void analyse_cluster(Int_t number, ExRootTreeBranch *branch)
|
---|
397 | {
|
---|
398 | TRootCalCluster *entry;
|
---|
399 |
|
---|
400 | entry = static_cast<TRootCalCluster*>(branch->NewEntry());
|
---|
401 |
|
---|
402 | entry->E = pgsclu_.pclu[number][3];
|
---|
403 | entry->Px = pgsclu_.pclu[number][0];
|
---|
404 | entry->Py = pgsclu_.pclu[number][1];
|
---|
405 | entry->Pz = pgsclu_.pclu[number][2];
|
---|
406 |
|
---|
407 | entry->Eta = pgsclu_.etaclu[number];
|
---|
408 | entry->Phi = pgsclu_.phiclu[number];
|
---|
409 |
|
---|
410 | entry->Eem = pgsclu_.emclu[number];
|
---|
411 | entry->Ehad = pgsclu_.ehclu[number];
|
---|
412 | entry->EemOverEtot = pgsclu_.efclu[number];
|
---|
413 |
|
---|
414 | entry->Ntwr = pgsclu_.mulclu[number];
|
---|
415 | }
|
---|
416 |
|
---|
417 | //---------------------------------------------------------------------------
|
---|
418 |
|
---|
419 | static void analyse_photon(Int_t number, ExRootTreeBranch *branch)
|
---|
420 | {
|
---|
421 | TRootPhoton *entry;
|
---|
422 |
|
---|
423 | Double_t signEta;
|
---|
424 |
|
---|
425 | entry = static_cast<TRootPhoton*>(branch->NewEntry());
|
---|
426 |
|
---|
427 | entry->E = pgsrec_.pobj[number][3];
|
---|
428 | entry->Px = pgsrec_.pobj[number][0];
|
---|
429 | entry->Py = pgsrec_.pobj[number][1];
|
---|
430 | entry->Pz = pgsrec_.pobj[number][2];
|
---|
431 |
|
---|
432 | TVector3 vector(entry->Px, entry->Py, entry->Pz);
|
---|
433 |
|
---|
434 | entry->PT = vector.Perp();
|
---|
435 | signEta = (entry->Pz >= 0.0) ? 1.0 : -1.0;
|
---|
436 | entry->Eta = vector.CosTheta()*vector.CosTheta() == 1.0 ? signEta*999.9 : vector.Eta();
|
---|
437 | entry->Phi = vector.Phi();
|
---|
438 |
|
---|
439 | entry->Eem = pgsrec_.vecobj[number][0];
|
---|
440 | entry->Ehad = pgsrec_.vecobj[number][1];
|
---|
441 | entry->PTtrk = pgsrec_.vecobj[number][2];
|
---|
442 |
|
---|
443 | entry->Niso = pgsrec_.vecobj[number][3];
|
---|
444 |
|
---|
445 | entry->ET = pgsrec_.vecobj[number][5];
|
---|
446 | entry->ETiso = pgsrec_.vecobj[number][6];
|
---|
447 | entry->PTiso = pgsrec_.vecobj[number][7];
|
---|
448 |
|
---|
449 | entry->EhadOverEem = pgsrec_.vecobj[number][8];
|
---|
450 | entry->EemOverPtrk = pgsrec_.vecobj[number][9];
|
---|
451 |
|
---|
452 | entry->ParticleIndex = pgsrec_.indobj[number] - 1;
|
---|
453 | }
|
---|
454 |
|
---|
455 | //---------------------------------------------------------------------------
|
---|
456 |
|
---|
457 | static void analyse_electron(Int_t number, ExRootTreeBranch *branch)
|
---|
458 | {
|
---|
459 | TRootElectron *entry;
|
---|
460 |
|
---|
461 | Double_t signEta;
|
---|
462 |
|
---|
463 | entry = static_cast<TRootElectron*>(branch->NewEntry());
|
---|
464 |
|
---|
465 | entry->E = pgsrec_.pobj[number][3];
|
---|
466 | entry->Px = pgsrec_.pobj[number][0];
|
---|
467 | entry->Py = pgsrec_.pobj[number][1];
|
---|
468 | entry->Pz = pgsrec_.pobj[number][2];
|
---|
469 |
|
---|
470 | TVector3 vector(entry->Px, entry->Py, entry->Pz);
|
---|
471 |
|
---|
472 | entry->PT = vector.Perp();
|
---|
473 | signEta = (entry->Pz >= 0.0) ? 1.0 : -1.0;
|
---|
474 | entry->Eta = vector.CosTheta()*vector.CosTheta() == 1.0 ? signEta*999.9 : vector.Eta();
|
---|
475 | entry->Phi = vector.Phi();
|
---|
476 |
|
---|
477 | entry->Charge = pgsrec_.qobj[number];
|
---|
478 |
|
---|
479 | entry->Eem = pgsrec_.vecobj[number][0];
|
---|
480 | entry->Ehad = pgsrec_.vecobj[number][1];
|
---|
481 | entry->PTtrk = pgsrec_.vecobj[number][2];
|
---|
482 |
|
---|
483 | entry->Niso = pgsrec_.vecobj[number][3];
|
---|
484 |
|
---|
485 | entry->ET = pgsrec_.vecobj[number][5];
|
---|
486 | entry->ETiso = pgsrec_.vecobj[number][6];
|
---|
487 | entry->PTisoMinusPTtrk = pgsrec_.vecobj[number][7];
|
---|
488 |
|
---|
489 | entry->EhadOverEem = pgsrec_.vecobj[number][8];
|
---|
490 | entry->EemOverPtrk = pgsrec_.vecobj[number][9];
|
---|
491 |
|
---|
492 | entry->ParticleIndex = pgsrec_.indobj[number] - 1;
|
---|
493 | }
|
---|
494 |
|
---|
495 | //---------------------------------------------------------------------------
|
---|
496 |
|
---|
497 | static void analyse_muon(Int_t number, ExRootTreeBranch *branch)
|
---|
498 | {
|
---|
499 | TRootMuon *entry;
|
---|
500 |
|
---|
501 | Double_t signEta;
|
---|
502 |
|
---|
503 | entry = static_cast<TRootMuon*>(branch->NewEntry());
|
---|
504 |
|
---|
505 | entry->E = pgsrec_.pobj[number][3];
|
---|
506 | entry->Px = pgsrec_.pobj[number][0];
|
---|
507 | entry->Py = pgsrec_.pobj[number][1];
|
---|
508 | entry->Pz = pgsrec_.pobj[number][2];
|
---|
509 |
|
---|
510 | TVector3 vector(entry->Px, entry->Py, entry->Pz);
|
---|
511 |
|
---|
512 | entry->PT = vector.Perp();
|
---|
513 | signEta = (entry->Pz >= 0.0) ? 1.0 : -1.0;
|
---|
514 | entry->Eta = vector.CosTheta()*vector.CosTheta() == 1.0 ? signEta*999.9 : vector.Eta();
|
---|
515 | entry->Phi = vector.Phi();
|
---|
516 |
|
---|
517 | entry->Charge = pgsrec_.qobj[number];
|
---|
518 |
|
---|
519 | entry->Eem = pgsrec_.vecobj[number][0];
|
---|
520 | entry->Ehad = pgsrec_.vecobj[number][1];
|
---|
521 | entry->Ptrk = pgsrec_.vecobj[number][2];
|
---|
522 |
|
---|
523 | entry->Niso = pgsrec_.vecobj[number][3];
|
---|
524 |
|
---|
525 | entry->Etrk = pgsrec_.vecobj[number][4];
|
---|
526 | entry->ETiso = pgsrec_.vecobj[number][5];
|
---|
527 | entry->PTiso = pgsrec_.vecobj[number][6];
|
---|
528 |
|
---|
529 | entry->ParticleIndex = pgsrec_.indobj[number] - 1;
|
---|
530 | }
|
---|
531 |
|
---|
532 | //---------------------------------------------------------------------------
|
---|
533 |
|
---|
534 | static void analyse_tau(Int_t number, ExRootTreeBranch *branch)
|
---|
535 | {
|
---|
536 | TRootTau *entry;
|
---|
537 |
|
---|
538 | Double_t signEta;
|
---|
539 |
|
---|
540 | entry = static_cast<TRootTau*>(branch->NewEntry());
|
---|
541 |
|
---|
542 | entry->E = pgsrec_.pobj[number][3];
|
---|
543 | entry->Px = pgsrec_.pobj[number][0];
|
---|
544 | entry->Py = pgsrec_.pobj[number][1];
|
---|
545 | entry->Pz = pgsrec_.pobj[number][2];
|
---|
546 |
|
---|
547 | TVector3 vector(entry->Px, entry->Py, entry->Pz);
|
---|
548 |
|
---|
549 | entry->PT = vector.Perp();
|
---|
550 | signEta = (entry->Pz >= 0.0) ? 1.0 : -1.0;
|
---|
551 | entry->Eta = vector.CosTheta()*vector.CosTheta() == 1.0 ? signEta*999.9 : vector.Eta();
|
---|
552 | entry->Phi = vector.Phi();
|
---|
553 |
|
---|
554 | entry->Charge = pgsrec_.qobj[number];
|
---|
555 |
|
---|
556 | entry->Eem = pgsrec_.vecobj[number][0];
|
---|
557 | entry->Ehad = pgsrec_.vecobj[number][1];
|
---|
558 | entry->Etrk = pgsrec_.vecobj[number][2];
|
---|
559 |
|
---|
560 | entry->Ntrk = pgsrec_.vecobj[number][3];
|
---|
561 |
|
---|
562 | entry->Width = pgsrec_.vecobj[number][4];
|
---|
563 | entry->Ecut = pgsrec_.vecobj[number][5];
|
---|
564 | entry->PTmax = pgsrec_.vecobj[number][6];
|
---|
565 |
|
---|
566 | entry->SeedTrackIndex = pgsrec_.vecobj[number][7] - 1;
|
---|
567 | entry->ClusterIndex = pgsrec_.indobj[number] - 1;
|
---|
568 | }
|
---|
569 |
|
---|
570 | //---------------------------------------------------------------------------
|
---|
571 |
|
---|
572 | static void analyse_jet(Int_t number, ExRootTreeBranch *branch)
|
---|
573 | {
|
---|
574 | TRootJet *entry;
|
---|
575 |
|
---|
576 | Double_t signEta;
|
---|
577 |
|
---|
578 | entry = static_cast<TRootJet*>(branch->NewEntry());
|
---|
579 |
|
---|
580 | entry->E = pgsrec_.pobj[number][3];
|
---|
581 | entry->Px = pgsrec_.pobj[number][0];
|
---|
582 | entry->Py = pgsrec_.pobj[number][1];
|
---|
583 | entry->Pz = pgsrec_.pobj[number][2];
|
---|
584 |
|
---|
585 | TVector3 vector(entry->Px, entry->Py, entry->Pz);
|
---|
586 |
|
---|
587 | entry->PT = vector.Perp();
|
---|
588 | signEta = (entry->Pz >= 0.0) ? 1.0 : -1.0;
|
---|
589 | entry->Eta = vector.CosTheta()*vector.CosTheta() == 1.0 ? signEta*999.9 : vector.Eta();
|
---|
590 | entry->Phi = vector.Phi();
|
---|
591 |
|
---|
592 | entry->Charge = pgsrec_.qobj[number];
|
---|
593 |
|
---|
594 | entry->Eem = pgsrec_.vecobj[number][0];
|
---|
595 | entry->Ehad = pgsrec_.vecobj[number][1];
|
---|
596 | entry->Etrk = pgsrec_.vecobj[number][2];
|
---|
597 |
|
---|
598 | entry->Ntrk = pgsrec_.vecobj[number][3];
|
---|
599 |
|
---|
600 | entry->Width = pgsrec_.vecobj[number][4];
|
---|
601 |
|
---|
602 | entry->Type = pgsrec_.vecobj[number][5]; // type: 21=g, 1=d, 2=u, 3=s, 4=c, 5=b
|
---|
603 |
|
---|
604 | entry->CTag = pgsrec_.vecobj[number][6];
|
---|
605 | entry->BTagVtx = pgsrec_.vecobj[number][7];
|
---|
606 | entry->BTagImp = pgsrec_.vecobj[number][8];
|
---|
607 |
|
---|
608 | entry->ClusterIndex = pgsrec_.indobj[number] - 1;
|
---|
609 | }
|
---|
610 |
|
---|
611 | //---------------------------------------------------------------------------
|
---|
612 |
|
---|
613 | static void analyse_heavy(Int_t number, ExRootTreeBranch *branch)
|
---|
614 | {
|
---|
615 | TRootHeavy *entry;
|
---|
616 |
|
---|
617 | Double_t signEta;
|
---|
618 |
|
---|
619 | entry = static_cast<TRootHeavy*>(branch->NewEntry());
|
---|
620 |
|
---|
621 | entry->E = pgsrec_.pobj[number][3];
|
---|
622 | entry->Px = pgsrec_.pobj[number][0];
|
---|
623 | entry->Py = pgsrec_.pobj[number][1];
|
---|
624 | entry->Pz = pgsrec_.pobj[number][2];
|
---|
625 |
|
---|
626 | TVector3 vector(entry->Px, entry->Py, entry->Pz);
|
---|
627 |
|
---|
628 | entry->PT = vector.Perp();
|
---|
629 | signEta = (entry->Pz >= 0.0) ? 1.0 : -1.0;
|
---|
630 | entry->Eta = vector.CosTheta()*vector.CosTheta() == 1.0 ? signEta*999.9 : vector.Eta();
|
---|
631 | entry->Phi = vector.Phi();
|
---|
632 |
|
---|
633 | entry->ParticleIndex = pgsrec_.indobj[number] - 1;
|
---|
634 | }
|
---|
635 |
|
---|
636 | //---------------------------------------------------------------------------
|
---|
637 |
|
---|