Fork me on GitHub

source: svn/trunk/src/SmearUtil.cc@ 380

Last change on this file since 380 was 380, checked in by Xavier Rouby, 16 years ago

new PDG table

File size: 70.1 KB
Line 
1/***********************************************************************
2** **
3** /----------------------------------------------\ **
4** | Delphes, a framework for the fast simulation | **
5** | of a generic collider experiment | **
6** \----------------------------------------------/ **
7** **
8** **
9** This package uses: **
10** ------------------ **
11** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **
12** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **
13** FROG: [hep-ex/0901.2718v1] **
14** **
15** ------------------------------------------------------------------ **
16** **
17** Main authors: **
18** ------------- **
19** **
20** Severine Ovyn Xavier Rouby **
21** severine.ovyn@uclouvain.be xavier.rouby@cern **
22** **
23** Center for Particle Physics and Phenomenology (CP3) **
24** Universite catholique de Louvain (UCL) **
25** Louvain-la-Neuve, Belgium **
26** **
27** Copyright (C) 2008-2009, **
28** All rights reserved. **
29** **
30***********************************************************************/
31
32
33/// \file SmearUtil.cc
34/// \brief RESOLution class, and some generic definitions
35
36
37#include "SmearUtil.h"
38#include "TRandom.h"
39
40#include <iostream>
41#include <fstream>
42#include <sstream>
43#include <iomanip>
44#include <map>
45using namespace std;
46
47//------------------------------------------------------------------------------
48
49RESOLution::RESOLution() {
50
51 // Detector characteristics
52 CEN_max_tracker = 2.5; // Maximum tracker coverage
53 CEN_max_calo_cen = 3.0; // central calorimeter coverage
54 CEN_max_calo_fwd = 5.0; // forward calorimeter pseudorapidity coverage
55 CEN_max_mu = 2.4; // muon chambers pseudorapidity coverage
56
57 // Energy resolution for electron/photon
58 // \sigma/E = C + N/E + S/\sqrt{E}
59 ELG_Scen = 0.05; // S term for central ECAL
60 ELG_Ncen = 0.25; // N term for central ECAL
61 ELG_Ccen = 0.005; // C term for central ECAL
62 ELG_Sfwd = 2.084; // S term for FCAL
63 ELG_Nfwd = 0.0; // N term for FCAL
64 ELG_Cfwd = 0.107; // C term for FCAL
65 ELG_Szdc = 0.70; // S term for ZDC
66 ELG_Nzdc = 0.0; // N term for ZDC
67 ELG_Czdc = 0.08; // C term for ZDC
68
69 // Energy resolution for hadrons in ecal/hcal/hf
70 // \sigma/E = C + N/E + S/\sqrt{E}
71 HAD_Shcal = 1.5; // S term for central HCAL
72 HAD_Nhcal = 0.; // N term for central HCAL
73 HAD_Chcal = 0.05; // C term for central HCAL
74 HAD_Shf = 2.7; // S term for FCAL
75 HAD_Nhf = 0.; // N term for FCAL
76 HAD_Chf = 0.13; // C term for FCAL
77 HAD_Szdc = 1.38; // S term for ZDC
78 HAD_Nzdc = 0.; // N term for ZDC
79 HAD_Czdc = 0.13; // C term for ZDC
80
81 // Muon smearing
82 MU_SmearPt = 0.01;
83
84 // time resolution
85 ZDC_T_resolution = 0; // resolution for time measurement [s]
86 RP220_T_resolution = 0;
87 RP420_T_resolution = 0;
88
89 // Tracking efficiencies
90 TRACK_ptmin = 0.9; // minimal pt needed to reach the calorimeter in GeV
91 TRACK_eff = 100; // efficiency associated to the tracking
92
93 // Calorimetric towers
94 TOWER_number = 40;
95 const float tower_eta_edges[41] = {
96 0., 0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, 0.783, 0.870, 0.957, 1.044, 1.131, 1.218, 1.305, 1.392, 1.479, 1.566,
97 1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.868, 2.950, 3.125, 3.300, 3.475, 3.650, 3.825, 4.000, 4.175,
98 4.350, 4.525, 4.700, 5.000}; // temporary object
99 TOWER_eta_edges = new float[TOWER_number+1];
100 for(unsigned int i=0; i<TOWER_number +1; i++) TOWER_eta_edges[i] = tower_eta_edges[i];
101
102 const float tower_dphi[40] = {
103 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
104 10,10,10,10,10, 10,10,10,10,10, 10,10,10,10,10, 10,10,10,20, 20 }; // temporary object
105 TOWER_dphi = new float[TOWER_number];
106 for(unsigned int i=0; i<TOWER_number; i++) TOWER_dphi[i] = tower_dphi[i];
107
108
109 // Thresholds for reconstructed objetcs (GeV)
110 PTCUT_elec = 10.0;
111 PTCUT_muon = 10.0;
112 PTCUT_jet = 20.0;
113 PTCUT_gamma = 10.0;
114 PTCUT_taujet = 10.0;
115
116 ZDC_gamma_E = 20; // GeV
117 ZDC_n_E = 50; // GeV
118
119 // Isolation
120 ISOL_PT = 2.0; //minimal pt of tracks for isolation criteria
121 ISOL_Cone = 0.5; //Cone for isolation criteria
122 ISOL_Calo_ET = 1E99; //minimal tower energy for isolation criteria. Default off = 1E99
123 ISOL_Calo_Grid = 3; //Grid size (N x N) for calorimetric isolation
124
125 // General jet variable
126 JET_coneradius = 0.7; // generic jet radius ; not for tau's !!!
127 JET_jetalgo = 1; // 1 for Cone algorithm, 2 for MidPoint algorithm, 3 for SIScone algorithm, 4 for kt algorithm
128 JET_seed = 1.0; // minimum seed to start jet reconstruction
129
130 // Tagging definition
131 BTAG_b = 40;
132 BTAG_mistag_c = 10;
133 BTAG_mistag_l = 1;
134
135 // FLAGS
136 FLAG_bfield = 1; //1 to run the bfield propagation else 0
137 FLAG_vfd = 1; //1 to run the very forward detectors else 0
138 FLAG_RP = 1; //1 to run the zero degree calorimeter else 0
139 FLAG_trigger = 1; //1 to run the trigger selection else 0
140 FLAG_frog = 1; //1 to run the FROG event display
141 FLAG_lhco = 1;
142
143 // In case BField propagation allowed
144 TRACK_radius = 129; //radius of the BField coverage
145 TRACK_length = 300; //length of the BField coverage
146 TRACK_bfield_x = 0; //X composant of the BField
147 TRACK_bfield_y = 0; //Y composant of the BField
148 TRACK_bfield_z = 3.8; //Z composant of the BField
149
150 // In case Very forward detectors allowed
151 VFD_min_calo_vfd = 5.2; // very forward calorimeter (if any) like CASTOR
152 VFD_max_calo_vfd = 6.6;
153 VFD_min_zdc = 8.3;
154 VFD_s_zdc = 140; // distance of the Zero Degree Calorimeter, from the Interaction poin, in [m]
155
156 RP_220_s = 220; // distance of the RP to the IP, in meters
157 RP_220_x = 0.002; // distance of the RP to the beam, in meters
158 RP_420_s = 420; // distance of the RP to the IP, in meters
159 RP_420_x = 0.004; // distance of the RP to the beam, in meters
160 RP_IP_name = "IP5";
161 RP_beam1Card = "data/LHCB1IR5_v6.500.tfs";
162 RP_beam2Card = "data/LHCB1IR5_v6.500.tfs";
163
164 // In case FROG event display allowed
165 NEvents_Frog = 10;
166
167 //********************************************
168 //jet stuffs not defined in the input datacard
169 //********************************************
170
171 JET_overlap = 0.75;
172 // MidPoint algorithm definition
173 JET_M_coneareafraction = 0.25;
174 JET_M_maxpairsize = 2;
175 JET_M_maxiterations = 100;
176 // Define Cone algorithm.
177 JET_C_adjacencycut = 2;
178 JET_C_maxiterations = 100;
179 JET_C_iratch = 1;
180 //Define SISCone algorithm.
181 JET_S_npass = 0;
182 JET_S_protojet_ptmin= 0.0;
183
184 //For Tau-jet definition
185 TAU_energy_scone = 0.15; // radius R of the cone for tau definition, based on energy threshold
186 TAU_track_scone = 0.4; // radius R of the cone for tau definition, based on track number
187 TAU_track_pt = 2; // minimal pt [GeV] for tracks to be considered in tau definition
188 TAU_energy_frac = 0.95; // fraction of energy required in the central part of the cone, for tau jets
189
190 PT_QUARKS_MIN = 2.0 ; // minimal pt needed by quarks to do b-tag
191
192 //for very forward detectors
193 RP_offsetEl_s = 120;
194 RP_offsetEl_x = 0.097;
195 RP_cross_x = -500;
196 RP_cross_y = 0.0;
197 RP_cross_ang = 142.5;
198
199 PdgTableFilename = "data/particle.tbl";
200
201}
202
203
204RESOLution::RESOLution(const RESOLution & DET) {
205 // Detector characteristics
206 CEN_max_tracker = DET.CEN_max_tracker;
207 CEN_max_calo_cen = DET.CEN_max_calo_cen;
208 CEN_max_calo_fwd = DET.CEN_max_calo_fwd;
209 CEN_max_mu = DET.CEN_max_mu;
210
211 // Energy resolution for electron/photon
212 ELG_Scen = DET.ELG_Scen;
213 ELG_Ncen = DET.ELG_Ncen;
214 ELG_Ccen = DET.ELG_Ccen;
215 ELG_Cfwd = DET.ELG_Cfwd;
216 ELG_Sfwd = DET.ELG_Sfwd;
217 ELG_Nfwd = DET.ELG_Nfwd;
218 ELG_Czdc = DET.ELG_Czdc;
219 ELG_Szdc = DET.ELG_Szdc;
220 ELG_Nzdc = DET.ELG_Nzdc;
221
222 // Energy resolution for hadrons in ecal/hcal/hf/zdc
223 HAD_Shcal = DET.HAD_Shcal;
224 HAD_Nhcal = DET.HAD_Nhcal;
225 HAD_Chcal = DET.HAD_Chcal;
226 HAD_Shf = DET.HAD_Shf;
227 HAD_Nhf = DET.HAD_Nhf;
228 HAD_Chf = DET.HAD_Chf;
229 HAD_Szdc = DET.HAD_Szdc;
230 HAD_Nzdc = DET.HAD_Nzdc;
231 HAD_Czdc = DET.HAD_Czdc;
232
233 // time resolution
234 ZDC_T_resolution = DET.ZDC_T_resolution; // resolution for time measurement [s]
235 RP220_T_resolution = DET.RP220_T_resolution;
236 RP420_T_resolution = DET.RP420_T_resolution;
237
238 // Muon smearing
239 MU_SmearPt = DET.MU_SmearPt;
240
241 // Tracking efficiencies
242 TRACK_ptmin = DET.TRACK_ptmin;
243 TRACK_eff = DET.TRACK_eff;
244
245 // Calorimetric towers
246 TOWER_number = DET.TOWER_number;
247 TOWER_eta_edges = new float[TOWER_number+1];
248 for(unsigned int i=0; i<TOWER_number +1; i++) TOWER_eta_edges[i] = DET.TOWER_eta_edges[i];
249
250 TOWER_dphi = new float[TOWER_number];
251 for(unsigned int i=0; i<TOWER_number; i++) TOWER_dphi[i] = DET.TOWER_dphi[i];
252
253 // Thresholds for reconstructed objetcs
254 PTCUT_elec = DET.PTCUT_elec;
255 PTCUT_muon = DET.PTCUT_muon;
256 PTCUT_jet = DET.PTCUT_jet;
257 PTCUT_gamma = DET.PTCUT_gamma;
258 PTCUT_taujet = DET.PTCUT_taujet;
259
260 ZDC_gamma_E = DET.ZDC_gamma_E;
261 ZDC_n_E = DET.ZDC_n_E;
262
263 // Isolation
264 ISOL_PT = DET.ISOL_PT; // tracking isolation
265 ISOL_Cone = DET.ISOL_Cone;
266 ISOL_Calo_ET = DET.ISOL_Calo_ET; // calorimeter isolation, defaut off
267 ISOL_Calo_Grid = DET.ISOL_Calo_Grid;
268
269
270 // General jet variable
271 JET_coneradius = DET.JET_coneradius;
272 JET_jetalgo = DET.JET_jetalgo;
273 JET_seed = DET.JET_seed;
274
275 // Tagging definition
276 BTAG_b = DET.BTAG_b;
277 BTAG_mistag_c = DET.BTAG_mistag_c;
278 BTAG_mistag_l = DET.BTAG_mistag_l;
279
280 // FLAGS
281 FLAG_bfield = DET.FLAG_bfield;
282 FLAG_vfd = DET.FLAG_vfd;
283 FLAG_RP = DET.FLAG_RP;
284 FLAG_trigger = DET.FLAG_trigger;
285 FLAG_frog = DET.FLAG_frog;
286 FLAG_lhco = DET.FLAG_lhco;
287
288 // In case BField propagation allowed
289 TRACK_radius = DET.TRACK_radius;
290 TRACK_length = DET.TRACK_length;
291 TRACK_bfield_x = DET.TRACK_bfield_x;
292 TRACK_bfield_y = DET.TRACK_bfield_y;
293 TRACK_bfield_z = DET.TRACK_bfield_z;
294
295 // In case Very forward detectors allowed
296 VFD_min_calo_vfd = DET.VFD_min_calo_vfd;
297 VFD_max_calo_vfd = DET.VFD_max_calo_vfd;
298 VFD_min_zdc = DET.VFD_min_zdc;
299 VFD_s_zdc = DET.VFD_s_zdc;
300
301 RP_220_s = DET.RP_220_s;
302 RP_220_x = DET.RP_220_x;
303 RP_420_s = DET.RP_420_s;
304 RP_420_x = DET.RP_420_x;
305 RP_beam1Card = DET.RP_beam1Card;
306 RP_beam2Card = DET.RP_beam2Card;
307 RP_offsetEl_s = DET.RP_offsetEl_s;
308 RP_offsetEl_x = DET.RP_offsetEl_x;
309 RP_cross_x = DET.RP_cross_x;
310 RP_cross_y = DET.RP_cross_y;
311 RP_cross_ang = DET.RP_cross_ang;
312 RP_IP_name = DET.RP_IP_name;
313
314 // In case FROG event display allowed
315 NEvents_Frog = DET.NEvents_Frog;
316
317 JET_overlap = DET.JET_overlap;
318 // MidPoint algorithm definition
319 JET_M_coneareafraction = DET.JET_M_coneareafraction;
320 JET_M_maxpairsize = DET.JET_M_maxpairsize;
321 JET_M_maxiterations = DET.JET_M_maxiterations;
322 // Define Cone algorithm.
323 JET_C_adjacencycut = DET.JET_C_adjacencycut;
324 JET_C_maxiterations = DET.JET_C_maxiterations;
325 JET_C_iratch = DET.JET_C_iratch;
326 //Define SISCone algorithm.
327 JET_S_npass = DET.JET_S_npass;
328 JET_S_protojet_ptmin = DET.JET_S_protojet_ptmin;
329
330 //For Tau-jet definition
331 TAU_energy_scone = DET.TAU_energy_scone;
332 TAU_track_scone = DET.TAU_track_scone;
333 TAU_track_pt = DET.TAU_track_pt;
334 TAU_energy_frac = DET.TAU_energy_frac;
335
336 PT_QUARKS_MIN = DET.PT_QUARKS_MIN;
337 PdgTableFilename = DET.PdgTableFilename;
338 PDGtable = DET.PDGtable;
339}
340
341RESOLution& RESOLution::operator=(const RESOLution& DET) {
342 if(this==&DET) return *this;
343 // Detector characteristics
344 CEN_max_tracker = DET.CEN_max_tracker;
345 CEN_max_calo_cen = DET.CEN_max_calo_cen;
346 CEN_max_calo_fwd = DET.CEN_max_calo_fwd;
347 CEN_max_mu = DET.CEN_max_mu;
348
349 // Energy resolution for electron/photon
350 ELG_Scen = DET.ELG_Scen;
351 ELG_Ncen = DET.ELG_Ncen;
352 ELG_Ccen = DET.ELG_Ccen;
353 ELG_Cfwd = DET.ELG_Cfwd;
354 ELG_Sfwd = DET.ELG_Sfwd;
355 ELG_Nfwd = DET.ELG_Nfwd;
356 ELG_Czdc = DET.ELG_Czdc;
357 ELG_Szdc = DET.ELG_Szdc;
358 ELG_Nzdc = DET.ELG_Nzdc;
359
360 // Energy resolution for hadrons in ecal/hcal/hf
361 HAD_Shcal = DET.HAD_Shcal;
362 HAD_Nhcal = DET.HAD_Nhcal;
363 HAD_Chcal = DET.HAD_Chcal;
364 HAD_Shf = DET.HAD_Shf;
365 HAD_Nhf = DET.HAD_Nhf;
366 HAD_Chf = DET.HAD_Chf;
367 HAD_Szdc = DET.HAD_Szdc;
368 HAD_Nzdc = DET.HAD_Nzdc;
369 HAD_Czdc = DET.HAD_Czdc;
370
371 // time resolution
372 ZDC_T_resolution = DET.ZDC_T_resolution; // resolution for time measurement [s]
373 RP220_T_resolution = DET.RP220_T_resolution;
374 RP420_T_resolution = DET.RP420_T_resolution;
375
376 // Muon smearing
377 MU_SmearPt = DET.MU_SmearPt;
378
379 // Tracking efficiencies
380 TRACK_ptmin = DET.TRACK_ptmin;
381 TRACK_eff = DET.TRACK_eff;
382
383 // Calorimetric towers
384 TOWER_number = DET.TOWER_number;
385 TOWER_eta_edges = new float[TOWER_number+1];
386 for(unsigned int i=0; i<TOWER_number +1; i++) TOWER_eta_edges[i] = DET.TOWER_eta_edges[i];
387
388 TOWER_dphi = new float[TOWER_number];
389 for(unsigned int i=0; i<TOWER_number; i++) TOWER_dphi[i] = DET.TOWER_dphi[i];
390
391 // Thresholds for reconstructed objetcs
392 PTCUT_elec = DET.PTCUT_elec;
393 PTCUT_muon = DET.PTCUT_muon;
394 PTCUT_jet = DET.PTCUT_jet;
395 PTCUT_gamma = DET.PTCUT_gamma;
396 PTCUT_taujet = DET.PTCUT_taujet;
397
398 ZDC_gamma_E = DET.ZDC_gamma_E;
399 ZDC_n_E = DET.ZDC_n_E;
400
401 // Isolation
402 ISOL_PT = DET.ISOL_PT; // tracking isolation
403 ISOL_Cone = DET.ISOL_Cone;
404 ISOL_Calo_ET = DET.ISOL_Calo_ET; // calorimeter isolation, defaut off
405 ISOL_Calo_Grid = DET.ISOL_Calo_Grid;
406
407 // General jet variable
408 JET_coneradius = DET.JET_coneradius;
409 JET_jetalgo = DET.JET_jetalgo;
410 JET_seed = DET.JET_seed;
411
412 // Tagging definition
413 BTAG_b = DET.BTAG_b;
414 BTAG_mistag_c = DET.BTAG_mistag_c;
415 BTAG_mistag_l = DET.BTAG_mistag_l;
416
417 // FLAGS
418 FLAG_bfield = DET.FLAG_bfield;
419 FLAG_vfd = DET.FLAG_vfd;
420 FLAG_RP = DET.FLAG_RP;
421 FLAG_trigger = DET.FLAG_trigger;
422 FLAG_frog = DET.FLAG_frog;
423 FLAG_lhco = DET.FLAG_lhco;
424
425 // In case BField propagation allowed
426 TRACK_radius = DET.TRACK_radius;
427 TRACK_length = DET.TRACK_length;
428 TRACK_bfield_x = DET.TRACK_bfield_x;
429 TRACK_bfield_y = DET.TRACK_bfield_y;
430 TRACK_bfield_z = DET.TRACK_bfield_z;
431
432 // In case Very forward detectors allowed
433 VFD_min_calo_vfd = DET.VFD_min_calo_vfd;
434 VFD_max_calo_vfd = DET.VFD_max_calo_vfd;
435 VFD_min_zdc = DET.VFD_min_zdc;
436 VFD_s_zdc = DET.VFD_s_zdc;
437
438 RP_220_s = DET.RP_220_s;
439 RP_220_x = DET.RP_220_x;
440 RP_420_s = DET.RP_420_s;
441 RP_420_x = DET.RP_420_x;
442 RP_offsetEl_s = DET.RP_offsetEl_s;
443 RP_offsetEl_x = DET.RP_offsetEl_x;
444 RP_beam1Card = DET.RP_beam1Card;
445 RP_beam2Card = DET.RP_beam2Card;
446 RP_cross_x = DET.RP_cross_x;
447 RP_cross_y = DET.RP_cross_y;
448 RP_cross_ang = DET.RP_cross_ang;
449 RP_IP_name = DET.RP_IP_name;
450
451
452 // In case FROG event display allowed
453 NEvents_Frog = DET.NEvents_Frog;
454
455 JET_overlap = DET.JET_overlap;
456 // MidPoint algorithm definition
457 JET_M_coneareafraction = DET.JET_M_coneareafraction;
458 JET_M_maxpairsize = DET.JET_M_maxpairsize;
459 JET_M_maxiterations = DET.JET_M_maxiterations;
460 // Define Cone algorithm.
461 JET_C_adjacencycut = DET.JET_C_adjacencycut;
462 JET_C_maxiterations = DET.JET_C_maxiterations;
463 JET_C_iratch = DET.JET_C_iratch;
464 //Define SISCone algorithm.
465 JET_S_npass = DET.JET_S_npass;
466 JET_S_protojet_ptmin = DET.JET_S_protojet_ptmin;
467
468 //For Tau-jet definition
469 TAU_energy_scone = DET.TAU_energy_scone;
470 TAU_track_scone = DET.TAU_track_scone;
471 TAU_track_pt = DET.TAU_track_pt;
472 TAU_energy_frac = DET.TAU_energy_frac;
473
474 PT_QUARKS_MIN = DET.PT_QUARKS_MIN;
475
476 PdgTableFilename = DET.PdgTableFilename;
477 PDGtable = DET.PDGtable;
478 return *this;
479}
480
481
482
483
484//------------------------------------------------------------------------------
485void RESOLution::ReadDataCard(const string datacard) {
486
487 string temp_string;
488 istringstream curstring;
489
490 ifstream fichier_a_lire(datacard.c_str());
491 if(!fichier_a_lire.good()) {
492 cout <<"** WARNING: Datadard not found, use default values **" << endl;
493 return;
494 }
495
496 while (getline(fichier_a_lire,temp_string)) {
497 curstring.clear(); // needed when using several times istringstream::str(string)
498 curstring.str(temp_string);
499 string varname;
500 float value; int ivalue; string svalue;
501
502 if(strstr(temp_string.c_str(),"#")) { }
503 else if(strstr(temp_string.c_str(),"CEN_max_tracker")) {curstring >> varname >> value; CEN_max_tracker = value;}
504 else if(strstr(temp_string.c_str(),"CEN_max_calo_cen")) {curstring >> varname >> value; CEN_max_calo_cen = value;}
505 else if(strstr(temp_string.c_str(),"CEN_max_calo_fwd")) {curstring >> varname >> value; CEN_max_calo_fwd = value;}
506 else if(strstr(temp_string.c_str(),"CEN_max_mu")) {curstring >> varname >> value; CEN_max_mu = value;}
507
508 else if(strstr(temp_string.c_str(),"VFD_min_calo_vfd")) {curstring >> varname >> value; VFD_min_calo_vfd = value;}
509 else if(strstr(temp_string.c_str(),"VFD_max_calo_vfd")) {curstring >> varname >> value; VFD_max_calo_vfd = value;}
510 else if(strstr(temp_string.c_str(),"VFD_min_zdc")) {curstring >> varname >> value; VFD_min_zdc = value;}
511 else if(strstr(temp_string.c_str(),"VFD_s_zdc")) {curstring >> varname >> value; VFD_s_zdc = value;}
512
513 else if(strstr(temp_string.c_str(),"RP_220_s")) {curstring >> varname >> value; RP_220_s = value;}
514 else if(strstr(temp_string.c_str(),"RP_220_x")) {curstring >> varname >> value; RP_220_x = value;}
515 else if(strstr(temp_string.c_str(),"RP_420_s")) {curstring >> varname >> value; RP_420_s = value;}
516 else if(strstr(temp_string.c_str(),"RP_420_x")) {curstring >> varname >> value; RP_420_x = value;}
517 else if(strstr(temp_string.c_str(),"RP_beam1Card")) {curstring >> varname >> svalue;RP_beam1Card = svalue;}
518 else if(strstr(temp_string.c_str(),"RP_beam2Card")) {curstring >> varname >> svalue;RP_beam2Card = svalue;}
519 else if(strstr(temp_string.c_str(),"RP_IP_name")) {curstring >> varname >> svalue;RP_IP_name = svalue;}
520
521 else if(strstr(temp_string.c_str(),"ELG_Scen")) {curstring >> varname >> value; ELG_Scen = value;}
522 else if(strstr(temp_string.c_str(),"ELG_Ncen")) {curstring >> varname >> value; ELG_Ncen = value;}
523 else if(strstr(temp_string.c_str(),"ELG_Ccen")) {curstring >> varname >> value; ELG_Ccen = value;}
524 else if(strstr(temp_string.c_str(),"ELG_Sfwd")) {curstring >> varname >> value; ELG_Sfwd = value;}
525 else if(strstr(temp_string.c_str(),"ELG_Cfwd")) {curstring >> varname >> value; ELG_Cfwd = value;}
526 else if(strstr(temp_string.c_str(),"ELG_Nfwd")) {curstring >> varname >> value; ELG_Nfwd = value;}
527 else if(strstr(temp_string.c_str(),"ELG_Szdc")) {curstring >> varname >> value; ELG_Szdc = value;}
528 else if(strstr(temp_string.c_str(),"ELG_Czdc")) {curstring >> varname >> value; ELG_Czdc = value;}
529 else if(strstr(temp_string.c_str(),"ELG_Nzdc")) {curstring >> varname >> value; ELG_Nzdc = value;}
530
531 else if(strstr(temp_string.c_str(),"HAD_Shcal")) {curstring >> varname >> value; HAD_Shcal = value;}
532 else if(strstr(temp_string.c_str(),"HAD_Nhcal")) {curstring >> varname >> value; HAD_Nhcal = value;}
533 else if(strstr(temp_string.c_str(),"HAD_Chcal")) {curstring >> varname >> value; HAD_Chcal = value;}
534 else if(strstr(temp_string.c_str(),"HAD_Shf")) {curstring >> varname >> value; HAD_Shf = value;}
535 else if(strstr(temp_string.c_str(),"HAD_Nhf")) {curstring >> varname >> value; HAD_Nhf = value;}
536 else if(strstr(temp_string.c_str(),"HAD_Chf")) {curstring >> varname >> value; HAD_Chf = value;}
537 else if(strstr(temp_string.c_str(),"HAD_Szdc")) {curstring >> varname >> value; HAD_Szdc = value;}
538 else if(strstr(temp_string.c_str(),"HAD_Nzdc")) {curstring >> varname >> value; HAD_Nzdc = value;}
539 else if(strstr(temp_string.c_str(),"HAD_Czdc")) {curstring >> varname >> value; HAD_Czdc = value;}
540 else if(strstr(temp_string.c_str(),"ZDC_T_resolution")) {curstring >> varname >> value; ZDC_T_resolution = value;}
541 else if(strstr(temp_string.c_str(),"RP220_T_resolution")) {curstring >> varname >> value; RP220_T_resolution = value;}
542 else if(strstr(temp_string.c_str(),"RP420_T_resolution")) {curstring >> varname >> value; RP420_T_resolution = value;}
543 else if(strstr(temp_string.c_str(),"MU_SmearPt")) {curstring >> varname >> value; MU_SmearPt = value;}
544
545 else if(strstr(temp_string.c_str(),"TRACK_radius")) {curstring >> varname >> ivalue;TRACK_radius = ivalue;}
546 else if(strstr(temp_string.c_str(),"TRACK_length")) {curstring >> varname >> ivalue;TRACK_length = ivalue;}
547 else if(strstr(temp_string.c_str(),"TRACK_bfield_x")) {curstring >> varname >> value; TRACK_bfield_x = value;}
548 else if(strstr(temp_string.c_str(),"TRACK_bfield_y")) {curstring >> varname >> value; TRACK_bfield_y = value;}
549 else if(strstr(temp_string.c_str(),"TRACK_bfield_z")) {curstring >> varname >> value; TRACK_bfield_z = value;}
550 else if(strstr(temp_string.c_str(),"FLAG_bfield")) {curstring >> varname >> ivalue; FLAG_bfield = ivalue;}
551 else if(strstr(temp_string.c_str(),"TRACK_ptmin")) {curstring >> varname >> value; TRACK_ptmin = value;}
552 else if(strstr(temp_string.c_str(),"TRACK_eff")) {curstring >> varname >> ivalue;TRACK_eff = ivalue;}
553
554 else if(strstr(temp_string.c_str(),"TOWER_number")) {curstring >> varname >> ivalue;TOWER_number = ivalue;}
555 else if(strstr(temp_string.c_str(),"TOWER_eta_edges")){
556 curstring >> varname; for(unsigned int i=0; i<TOWER_number+1; i++) {curstring >> value; TOWER_eta_edges[i] = value;} }
557 else if(strstr(temp_string.c_str(),"TOWER_dphi")){
558 curstring >> varname; for(unsigned int i=0; i<TOWER_number; i++) {curstring >> value; TOWER_dphi[i] = value;} }
559
560 else if(strstr(temp_string.c_str(),"PTCUT_elec")) {curstring >> varname >> value; PTCUT_elec = value;}
561 else if(strstr(temp_string.c_str(),"PTCUT_muon")) {curstring >> varname >> value; PTCUT_muon = value;}
562 else if(strstr(temp_string.c_str(),"PTCUT_jet")) {curstring >> varname >> value; PTCUT_jet = value;}
563 else if(strstr(temp_string.c_str(),"PTCUT_gamma")) {curstring >> varname >> value; PTCUT_gamma = value;}
564 else if(strstr(temp_string.c_str(),"PTCUT_taujet")) {curstring >> varname >> value; PTCUT_taujet = value;}
565 else if(strstr(temp_string.c_str(),"ZDC_gamma_E")) {curstring >> varname >> value; ZDC_gamma_E = value;}
566 else if(strstr(temp_string.c_str(),"ZDC_n_E")) {curstring >> varname >> value; ZDC_n_E = value;}
567
568 else if(strstr(temp_string.c_str(),"ISOL_PT")) {curstring >> varname >> value; ISOL_PT = value;}
569 else if(strstr(temp_string.c_str(),"ISOL_Cone")) {curstring >> varname >> value; ISOL_Cone = value;}
570 else if(strstr(temp_string.c_str(),"ISOL_Calo_ET")) {curstring >> varname >> value; ISOL_Calo_ET = value;}
571 else if(strstr(temp_string.c_str(),"ISOL_Calo_Grid")) {curstring >> varname >> ivalue; ISOL_Calo_Grid = ivalue;}
572
573 else if(strstr(temp_string.c_str(),"JET_coneradius")) {curstring >> varname >> value; JET_coneradius = value;}
574 else if(strstr(temp_string.c_str(),"JET_jetalgo")) {curstring >> varname >> ivalue;JET_jetalgo = ivalue;}
575 else if(strstr(temp_string.c_str(),"JET_seed")) {curstring >> varname >> value; JET_seed = value;}
576
577 else if(strstr(temp_string.c_str(),"BTAG_b")) {curstring >> varname >> ivalue;BTAG_b = ivalue;}
578 else if(strstr(temp_string.c_str(),"BTAG_mistag_c")) {curstring >> varname >> ivalue;BTAG_mistag_c = ivalue;}
579 else if(strstr(temp_string.c_str(),"BTAG_mistag_l")) {curstring >> varname >> ivalue;BTAG_mistag_l = ivalue;}
580
581 else if(strstr(temp_string.c_str(),"FLAG_vfd")) {curstring >> varname >> ivalue; FLAG_vfd = ivalue;}
582 else if(strstr(temp_string.c_str(),"FLAG_RP")) {curstring >> varname >> ivalue; FLAG_RP = ivalue;}
583 else if(strstr(temp_string.c_str(),"FLAG_trigger")) {curstring >> varname >> ivalue; FLAG_trigger = ivalue;}
584 else if(strstr(temp_string.c_str(),"FLAG_frog")) {curstring >> varname >> ivalue; FLAG_frog = ivalue;}
585 else if(strstr(temp_string.c_str(),"FLAG_lhco")) {curstring >> varname >> ivalue; FLAG_lhco = ivalue;}
586 else if(strstr(temp_string.c_str(),"NEvents_Frog")) {curstring >> varname >> ivalue; NEvents_Frog = ivalue;}
587
588 else if(strstr(temp_string.c_str(),"PdgTableFilename")) {curstring >> varname >> svalue; PdgTableFilename = svalue;}
589 }
590
591 //jet stuffs not defined in the input datacard
592 JET_overlap = 0.75;
593 // MidPoint algorithm definition
594 JET_M_coneareafraction = 0.25;
595 JET_M_maxpairsize = 2;
596 JET_M_maxiterations = 100;
597 // Define Cone algorithm.
598 JET_C_adjacencycut = 2;
599 JET_C_maxiterations = 100;
600 JET_C_iratch = 1;
601 //Define SISCone algorithm.
602 JET_S_npass = 0;
603 JET_S_protojet_ptmin= 0.0;
604
605 //For Tau-jet definition
606 TAU_energy_scone = 0.15; // radius R of the cone for tau definition, based on energy threshold
607 TAU_track_scone = 0.4; // radius R of the cone for tau definition, based on track number
608 TAU_track_pt = 2; // minimal pt [GeV] for tracks to be considered in tau definition
609 TAU_energy_frac = 0.95; // fraction of energy required in the central part of the cone, for tau jets
610
611}
612
613void RESOLution::Logfile(const string& LogName) {
614 //void RESOLution::Logfile(string outputfilename) {
615
616 ofstream f_out(LogName.c_str());
617
618 f_out <<"**********************************************************************"<< endl;
619 f_out <<"**********************************************************************"<< endl;
620 f_out <<"** **"<< endl;
621 f_out <<"** Welcome to **"<< endl;
622 f_out <<"** **"<< endl;
623 f_out <<"** **"<< endl;
624 f_out <<"** .ddddddd- lL hH **"<< endl;
625 f_out <<"** -Dd` `dD: Ll hH` **"<< endl;
626 f_out <<"** dDd dDd eeee. lL .pp+pp Hh+hhh` -eeee- `sssss **"<< endl;
627 f_out <<"** -Dd `DD ee. ee Ll .Pp. PP Hh. HH. ee. ee sSs **"<< endl;
628 f_out <<"** dD` dDd eEeee: lL. pP. pP hH hH` eEeee:` -sSSSs. **"<< endl;
629 f_out <<"** .Dd :dd eE. LlL PpppPP Hh Hh eE sSS **"<< endl;
630 f_out <<"** dddddd:. eee+: lL. pp. hh. hh eee+ sssssS **"<< endl;
631 f_out <<"** Pp **"<< endl;
632 f_out <<"** **"<< endl;
633 f_out <<"** Delphes, a framework for the fast simulation **"<< endl;
634 f_out <<"** of a generic collider experiment **"<< endl;
635 f_out <<"** **"<< endl;
636 f_out <<"** --- Version 1.4beta of Delphes --- **"<< endl;
637 f_out <<"** Last date of change: 9 February 2009 **"<< endl;
638 f_out <<"** **"<< endl;
639 f_out <<"** **"<< endl;
640 f_out <<"** This package uses: **"<< endl;
641 f_out <<"** ------------------ **"<< endl;
642 f_out <<"** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] **"<< endl;
643 f_out <<"** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] **"<< endl;
644 f_out <<"** FROG: L. Quertenmont, V. Roberfroid [hep-ex/0901.2718v1] **"<< endl;
645 f_out <<"** **"<< endl;
646 f_out <<"** ---------------------------------------------------------------- **"<< endl;
647 f_out <<"** **"<< endl;
648 f_out <<"** Main authors: **"<< endl;
649 f_out <<"** ------------- **"<< endl;
650 f_out <<"** **"<< endl;
651 f_out <<"** Séverine Ovyn Xavier Rouby **"<< endl;
652 f_out <<"** severine.ovyn@uclouvain.be xavier.rouby@cern **"<< endl;
653 f_out <<"** Center for Particle Physics and Phenomenology (CP3) **"<< endl;
654 f_out <<"** Universite Catholique de Louvain (UCL) **"<< endl;
655 f_out <<"** Louvain-la-Neuve, Belgium **"<< endl;
656 f_out <<"** **"<< endl;
657 f_out <<"** ---------------------------------------------------------------- **"<< endl;
658 f_out <<"** **"<< endl;
659 f_out <<"** Former Delphes versions and documentation can be found on : **"<< endl;
660 f_out <<"** http://www.fynu.ucl.ac.be/delphes.html **"<< endl;
661 f_out <<"** **"<< endl;
662 f_out <<"** **"<< endl;
663 f_out <<"** Disclaimer: this program is a beta version of Delphes and **"<< endl;
664 f_out <<"** therefore comes without guarantees. Beware of errors and please **"<< endl;
665 f_out <<"** give us your feedbacks about potential bugs **"<< endl;
666 f_out <<"** **"<< endl;
667 f_out <<"**********************************************************************"<< endl;
668 f_out <<"** **"<< endl;
669 f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n";
670 f_out<<"# Input PDG table : " << PdgTableFilename << " *"<<"\n";
671 f_out<<"* *"<<"\n";
672 f_out<<"* *"<<"\n";
673 f_out<<"#******************************** *"<<"\n";
674 f_out<<"# Central detector caracteristics *"<<"\n";
675 f_out<<"#******************************** *"<<"\n";
676 f_out<<"* *"<<"\n";
677 f_out << left << setw(30) <<"* Maximum tracking system: "<<""
678 << left << setw(10) <<CEN_max_tracker <<""<< right << setw(15)<<"*"<<"\n";
679 f_out << left << setw(30) <<"* Maximum central calorimeter: "<<""
680 << left << setw(10) <<CEN_max_calo_cen <<""<< right << setw(15)<<"*"<<"\n";
681 f_out << left << setw(30) <<"* Maximum forward calorimeter: "<<""
682 << left << setw(10) <<CEN_max_calo_fwd <<""<< right << setw(15)<<"*"<<"\n";
683 f_out << left << setw(30) <<"* Muon chambers coverage: "<<""
684 << left << setw(10) <<CEN_max_mu <<""<< right << setw(15)<<"*"<<"\n";
685 f_out<<"* *"<<"\n";
686 if(FLAG_RP==1){
687 f_out<<"#************************************ *"<<"\n";
688 f_out<<"# Very forward Roman Pots switched on *"<<"\n";
689 f_out<<"#************************************ *"<<"\n";
690 f_out<<"* *"<<"\n";
691 f_out << left << setw(55) <<"* Distance of the 220 RP to the IP in meters:"<<""
692 << left << setw(5) <<RP_220_s <<""<< right << setw(10)<<"*"<<"\n";
693 f_out << left << setw(55) <<"* Distance of the 220 RP to the beam in meters:"<<""
694 << left << setw(5) <<RP_220_x <<""<< right << setw(10)<<"*"<<"\n";
695 f_out << left << setw(55) <<"* Distance of the 420 RP to the IP in meters:"<<""
696 << left << setw(5) <<RP_420_s <<""<< right << setw(10)<<"*"<<"\n";
697 f_out << left << setw(55) <<"* Distance of the 420 RP to the beam in meters:"<<""
698 << left << setw(5) <<RP_420_x <<""<< right << setw(10)<<"*"<<"\n";
699 f_out << left << setw(55) <<"* Interaction point at the LHC named: "<<""
700 << left << setw(5) <<RP_IP_name <<""<< right << setw(10)<<"*"<<"\n";
701 f_out << left << setw(35) <<"* Datacard for beam 1: "<<""
702 << left << setw(25) <<RP_beam1Card <<""<< right << setw(10)<<"*"<<"\n";
703 f_out << left << setw(35) <<"* Datacard for beam 2: "<<""
704 << left << setw(25) <<RP_beam2Card <<""<< right << setw(10)<<"*"<<"\n";
705 f_out << left << setw(44) <<"* Beam separation, in meters: "<<""
706 << left << setw(6) << RP_offsetEl_x <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
707 f_out << left << setw(44) <<"* Distance from IP for Beam separation (m):"<<""
708 << left << setw(6) <<RP_offsetEl_s <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
709 f_out << left << setw(44) <<"* X offset of beam crossing in micrometers:"<<""
710 << left << setw(6) <<RP_cross_x <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
711 f_out << left << setw(44) <<"* Y offset of beam crossing in micrometers:"<<""
712 << left << setw(6) <<RP_cross_y <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
713 f_out << left << setw(44) <<"* Angle of beam crossing:"<<""
714 << left << setw(6) <<RP_cross_ang <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
715 f_out<<"* *"<<"\n";
716 }
717 else {
718 f_out<<"#************************************* *"<<"\n";
719 f_out<<"# Very forward Roman Pots switched off *"<<"\n";
720 f_out<<"#************************************* *"<<"\n";
721 f_out<<"* *"<<"\n";
722 }
723 if(FLAG_vfd==1){
724 f_out<<"#************************************** *"<<"\n";
725 f_out<<"# Very forward calorimeters switched on *"<<"\n";
726 f_out<<"#************************************** *"<<"\n";
727 f_out<<"* *"<<"\n";
728 f_out << left << setw(55) <<"* Minimum very forward calorimeter: "<<""
729 << left << setw(5) <<VFD_min_calo_vfd <<""<< right << setw(10)<<"*"<<"\n";
730 f_out << left << setw(55) <<"* Maximum very forward calorimeter: "<<""
731 << left << setw(5) <<VFD_max_calo_vfd <<""<< right << setw(10)<<"*"<<"\n";
732 f_out << left << setw(55) <<"* Minimum coverage zero_degree calorimeter "<<""
733 << left << setw(5) <<VFD_min_zdc <<""<< right << setw(10)<<"*"<<"\n";
734 f_out << left << setw(55) <<"* Distance of the ZDC to the IP, in meters: "<<""
735 << left << setw(5) <<VFD_s_zdc <<""<< right << setw(10)<<"*"<<"\n";
736 f_out<<"* *"<<"\n";
737 }
738 else {
739 f_out<<"#*************************************** *"<<"\n";
740 f_out<<"# Very forward calorimeters switched off *"<<"\n";
741 f_out<<"#*************************************** *"<<"\n";
742 f_out<<"* *"<<"\n";
743 }
744
745 f_out<<"#************************************ *"<<"\n";
746 f_out<<"# Electromagnetic smearing parameters *"<<"\n";
747 f_out<<"#************************************ *"<<"\n";
748 f_out<<"* *"<<"\n";
749 //# \sigma/E = C + N/E + S/\sqrt{E}
750 f_out << left << setw(30) <<"* S term for central ECAL: "<<""
751 << left << setw(30) <<ELG_Scen <<""<< right << setw(10)<<"*"<<"\n";
752 f_out << left << setw(30) <<"* N term for central ECAL: "<<""
753 << left << setw(30) <<ELG_Ncen <<""<< right << setw(10)<<"*"<<"\n";
754 f_out << left << setw(30) <<"* C term for central ECAL: "<<""
755 << left << setw(30) <<ELG_Ccen <<""<< right << setw(10)<<"*"<<"\n";
756 f_out << left << setw(30) <<"* S term for FCAL: "<<""
757 << left << setw(30) <<ELG_Sfwd <<""<< right << setw(10)<<"*"<<"\n";
758 f_out << left << setw(30) <<"* N term for FCAL: "<<""
759 << left << setw(30) <<ELG_Nfwd <<""<< right << setw(10)<<"*"<<"\n";
760 f_out << left << setw(30) <<"* C term for FCAL: "<<""
761 << left << setw(30) <<ELG_Cfwd <<""<< right << setw(10)<<"*"<<"\n";
762 f_out << left << setw(30) <<"* S term for ZDC: "<<""
763 << left << setw(30) <<ELG_Szdc <<""<< right << setw(10)<<"*"<<"\n";
764 f_out << left << setw(30) <<"* N term for ZDC: "<<""
765 << left << setw(30) <<ELG_Nzdc <<""<< right << setw(10)<<"*"<<"\n";
766 f_out << left << setw(30) <<"* C term for ZDC: "<<""
767 << left << setw(30) <<ELG_Czdc <<""<< right << setw(10)<<"*"<<"\n";
768
769 f_out<<"* *"<<"\n";
770 f_out<<"#***************************** *"<<"\n";
771 f_out<<"# Hadronic smearing parameters *"<<"\n";
772 f_out<<"#***************************** *"<<"\n";
773 f_out<<"* *"<<"\n";
774 f_out << left << setw(30) <<"* S term for central HCAL: "<<""
775 << left << setw(30) <<HAD_Shcal <<""<< right << setw(10)<<"*"<<"\n";
776 f_out << left << setw(30) <<"* N term for central HCAL: "<<""
777 << left << setw(30) <<HAD_Nhcal <<""<< right << setw(10)<<"*"<<"\n";
778 f_out << left << setw(30) <<"* C term for central HCAL: "<<""
779 << left << setw(30) <<HAD_Chcal <<""<< right << setw(10)<<"*"<<"\n";
780 f_out << left << setw(30) <<"* S term for FCAL: "<<""
781 << left << setw(30) <<HAD_Shf <<""<< right << setw(10)<<"*"<<"\n";
782 f_out << left << setw(30) <<"* N term for FCAL: "<<""
783 << left << setw(30) <<HAD_Nhf <<""<< right << setw(10)<<"*"<<"\n";
784 f_out << left << setw(30) <<"* C term for FCAL: "<<""
785 << left << setw(30) <<HAD_Chf <<""<< right << setw(10)<<"*"<<"\n";
786 f_out << left << setw(30) <<"* S term for ZDC: "<<""
787 << left << setw(30) <<HAD_Szdc <<""<< right << setw(10)<<"*"<<"\n";
788 f_out << left << setw(30) <<"* N term for ZDC: "<<""
789 << left << setw(30) <<HAD_Nzdc <<""<< right << setw(10)<<"*"<<"\n";
790 f_out << left << setw(30) <<"* C term for ZDC: "<<""
791 << left << setw(30) <<HAD_Czdc <<""<< right << setw(10)<<"*"<<"\n";
792
793 f_out<<"* *"<<"\n";
794 f_out<<"#************************* *"<<"\n";
795 f_out<<"# Time smearing parameters *"<<"\n";
796 f_out<<"#************************* *"<<"\n";
797 f_out<<"* *"<<"\n";
798 f_out << left << setw(55) <<"* Time resolution for ZDC : "<<""
799 << left << setw(5) <<ZDC_T_resolution <<""<< right << setw(10)<<"*"<<"\n";
800 f_out << left << setw(55) <<"* Time resolution for RP220 : "<<""
801 << left << setw(5) <<RP220_T_resolution <<""<< right << setw(10)<<"*"<<"\n";
802 f_out << left << setw(55) <<"* Time resolution for RP420 : "<<""
803 << left << setw(5) <<RP420_T_resolution <<""<< right << setw(10)<<"*"<<"\n";
804 f_out<<"* *"<<"\n";
805
806 f_out<<"* *"<<"\n";
807 f_out<<"#************************* *"<<"\n";
808 f_out<<"# Muon smearing parameters *"<<"\n";
809 f_out<<"#************************* *"<<"\n";
810 f_out<<"* *"<<"\n";
811 f_out << left << setw(55) <<"* PT resolution for muons : "<<""
812 << left << setw(5) <<MU_SmearPt <<""<< right << setw(10)<<"*"<<"\n";
813 f_out<<"* *"<<"\n";
814 if(FLAG_bfield==1){
815 f_out<<"#*************************** *"<<"\n";
816 f_out<<"# Magnetic field switched on *"<<"\n";
817 f_out<<"#*************************** *"<<"\n";
818 f_out<<"* *"<<"\n";
819 f_out << left << setw(55) <<"* Radius of the BField coverage: "<<""
820 << left << setw(5) <<TRACK_radius <<""<< right << setw(10)<<"*"<<"\n";
821 f_out << left << setw(55) <<"* Length of the BField coverage: "<<""
822 << left << setw(5) <<TRACK_length <<""<< right << setw(10)<<"*"<<"\n";
823 f_out << left << setw(55) <<"* BField X component: "<<""
824 << left << setw(5) <<TRACK_bfield_x <<""<< right << setw(10)<<"*"<<"\n";
825 f_out << left << setw(55) <<"* BField Y component: "<<""
826 << left << setw(5) <<TRACK_bfield_y <<""<< right << setw(10)<<"*"<<"\n";
827 f_out << left << setw(55) <<"* BField Z component: "<<""
828 << left << setw(5) <<TRACK_bfield_z <<""<< right << setw(10)<<"*"<<"\n";
829 f_out << left << setw(55) <<"* Minimal pT needed to reach the calorimeter [GeV]: "<<""
830 << left << setw(10) <<TRACK_ptmin <<""<< right << setw(5)<<"*"<<"\n";
831 f_out << left << setw(55) <<"* Efficiency associated to the tracking: "<<""
832 << left << setw(10) <<TRACK_eff <<""<< right << setw(5)<<"*"<<"\n";
833 f_out<<"* *"<<"\n";
834 }
835 else {
836 f_out<<"#**************************** *"<<"\n";
837 f_out<<"# Magnetic field switched off *"<<"\n";
838 f_out<<"#**************************** *"<<"\n";
839 f_out << left << setw(55) <<"* Minimal pT needed to reach the calorimeter [GeV]: "<<""
840 << left << setw(10) <<TRACK_ptmin <<""<< right << setw(5)<<"*"<<"\n";
841 f_out << left << setw(55) <<"* Efficiency associated to the tracking: "<<""
842 << left << setw(10) <<TRACK_eff <<""<< right << setw(5)<<"*"<<"\n";
843 f_out<<"* *"<<"\n";
844 }
845 f_out<<"#******************** *"<<"\n";
846 f_out<<"# Calorimetric Towers *"<<"\n";
847 f_out<<"#******************** *"<<"\n";
848 f_out << left << setw(55) <<"* Number of calorimetric towers in eta, for eta>0: "<<""
849 << left << setw(5) << TOWER_number <<""<< right << setw(10)<<"*"<<"\n";
850 f_out << left << setw(55) <<"* Tower edges in eta, for eta>0: "<<"" << right << setw(15)<<"*"<<"\n";
851 f_out << "* ";
852 for (unsigned int i=0; i<TOWER_number+1; i++) {
853 f_out << left << setw(7) << TOWER_eta_edges[i];
854 if(!( (i+1) %9 )) f_out << right << setw(3) << "*" << "\n" << "* ";
855 }
856 for (unsigned int i=(TOWER_number+1)%9; i<9; i++) f_out << left << setw(7) << "";
857 f_out << right << setw(3)<<"*"<<"\n";
858 f_out << left << setw(55) <<"* Tower sizes in phi, for eta>0 [degree]:"<<"" << right << setw(15)<<"*"<<"\n";
859 f_out << "* ";
860 for (unsigned int i=0; i<TOWER_number; i++) {
861 f_out << left << setw(7) << TOWER_dphi[i];
862 if(!( (i+1) %9 )) f_out << right << setw(3) << "*" << "\n" << "* ";
863 }
864 for (unsigned int i=(TOWER_number)%9; i<9; i++) f_out << left << setw(7) << "";
865 f_out << right << setw(3)<<"*"<<"\n";
866 f_out<<"* *"<<"\n";
867 f_out<<"#******************* *"<<"\n";
868 f_out<<"# Minimum pT's [GeV] *"<<"\n";
869 f_out<<"#******************* *"<<"\n";
870 f_out<<"* *"<<"\n";
871 f_out << left << setw(40) <<"* Minimum pT for electrons: "<<""
872 << left << setw(20) <<PTCUT_elec <<""<< right << setw(10)<<"*"<<"\n";
873 f_out << left << setw(40) <<"* Minimum pT for muons: "<<""
874 << left << setw(20) <<PTCUT_muon <<""<< right << setw(10)<<"*"<<"\n";
875 f_out << left << setw(40) <<"* Minimum pT for jets: "<<""
876 << left << setw(20) <<PTCUT_jet <<""<< right << setw(10)<<"*"<<"\n";
877 f_out << left << setw(40) <<"* Minimum pT for Tau-jets: "<<""
878 << left << setw(20) <<PTCUT_taujet <<""<< right << setw(10)<<"*"<<"\n";
879 f_out << left << setw(40) <<"* Minimum pT for photons: "<<""
880 << left << setw(20) <<PTCUT_gamma <<""<< right << setw(10)<<"*"<<"\n";
881 f_out << left << setw(40) <<"* Minimum E for photons in ZDC: "<<""
882 << left << setw(20) <<ZDC_gamma_E <<""<< right << setw(10)<<"*"<<"\n";
883 f_out << left << setw(40) <<"* Minimum E for neutrons in ZDC: "<<""
884 << left << setw(20) <<ZDC_n_E <<""<< right << setw(10)<<"*"<<"\n";
885
886 f_out<<"* *"<<"\n";
887 f_out<<"#******************* *"<<"\n";
888 f_out<<"# Isolation criteria *"<<"\n";
889 f_out<<"#******************* *"<<"\n";
890 f_out<<"* *"<<"\n";
891 f_out << left << setw(40) <<"* Minimum pT for tracks [GeV]: "<<""
892 << left << setw(20) <<ISOL_PT <<""<< right << setw(10)<<"*"<<"\n";
893 f_out << left << setw(40) <<"* Cone for isolation criteria: "<<""
894 << left << setw(20) <<ISOL_Cone <<""<< right << setw(10)<<"*"<<"\n";
895
896 if(ISOL_Calo_ET > 1E98) f_out<<"# No Calorimetric isolation applied *"<<"\n";
897 else {
898 f_out << left << setw(40) <<"* Minimum ET for towers [GeV]: "<<""
899 << left << setw(20) <<ISOL_Calo_ET <<""<< right << setw(10)<<"*"<<"\n";
900 f_out << left << setw(40) <<"* Grid size (NxN) for calorimetric isolation: "<<""
901 << left << setw(20) <<ISOL_Calo_Grid <<""<< right << setw(10)<<"*"<<"\n";
902 }
903
904
905 f_out<<"* *"<<"\n";
906 f_out<<"#*************** *"<<"\n";
907 f_out<<"# Jet definition *"<<"\n";
908 f_out<<"#*************** *"<<"\n";
909 f_out<<"* *"<<"\n";
910 f_out<<"* Six algorithms are currently available: *"<<"\n";
911 f_out<<"* - 1) CDF cone algorithm, *"<<"\n";
912 f_out<<"* - 2) CDF MidPoint algorithm, *"<<"\n";
913 f_out<<"* - 3) SIScone algorithm, *"<<"\n";
914 f_out<<"* - 4) kt algorithm, *"<<"\n";
915 f_out<<"* - 5) Cambrigde/Aachen algorithm, *"<<"\n";
916 f_out<<"* - 6) Anti-kt algorithm. *"<<"\n";
917 f_out<<"* *"<<"\n";
918 f_out<<"* You have chosen *"<<"\n";
919 switch(JET_jetalgo) {
920 default:
921 case 1: {
922 f_out<<"* CDF JetClu jet algorithm with parameters: *"<<"\n";
923 f_out << left << setw(40) <<"* - Seed threshold: "<<""
924 << left << setw(10) <<JET_seed <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
925 f_out << left << setw(40) <<"* - Cone radius: "<<""
926 << left << setw(10) <<JET_coneradius <<""<< right << setw(20)<<"*"<<"\n";
927 f_out << left << setw(40) <<"* - Adjacency cut: "<<""
928 << left << setw(10) <<JET_C_adjacencycut <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
929 f_out << left << setw(40) <<"* - Max iterations: "<<""
930 << left << setw(10) <<JET_C_maxiterations <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
931 f_out << left << setw(40) <<"* - Iratch: "<<""
932 << left << setw(10) <<JET_C_iratch <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
933 f_out << left << setw(40) <<"* - Overlap threshold: "<<""
934 << left << setw(10) <<JET_overlap <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
935 }
936 break;
937 case 2: {
938 f_out<<"* CDF midpoint jet algorithm with parameters: *"<<"\n";
939 f_out << left << setw(40) <<"* - Seed threshold: "<<""
940 << left << setw(20) <<JET_seed <<""<< right << setw(10)<<"! not in datacard *"<<"\n";
941 f_out << left << setw(40) <<"* - Cone radius: "<<""
942 << left << setw(20) <<JET_coneradius <<""<< right << setw(10)<<"*"<<"\n";
943 f_out << left << setw(40) <<"* - Cone area fraction:"<<""
944 << left << setw(20) <<JET_M_coneareafraction <<""<< right << setw(10)<<"! not in datacard *"<<"\n";
945 f_out << left << setw(40) <<"* - Maximum pair size: "<<""
946 << left << setw(20) <<JET_M_maxpairsize <<""<< right << setw(10)<<"! not in datacard *"<<"\n";
947 f_out << left << setw(40) <<"* - Max iterations: "<<""
948 << left << setw(20) <<JET_M_maxiterations <<""<< right << setw(10)<<"! not in datacard *"<<"\n";
949 f_out << left << setw(40) <<"* - Overlap threshold: "<<""
950 << left << setw(20) <<JET_overlap <<""<< right << setw(10)<<"! not in datacard *"<<"\n";
951 }
952 break;
953 case 3: {
954 f_out <<"* SISCone jet algorithm with parameters: *"<<"\n";
955 f_out << left << setw(40) <<"* - Cone radius: "<<""
956 << left << setw(20) <<JET_coneradius <<""<< right << setw(10)<<"*"<<"\n";
957 f_out << left << setw(40) <<"* - Overlap threshold: "<<""
958 << left << setw(20) <<JET_overlap <<""<< right << setw(10)<<"! not in datacard *"<<"\n";
959 f_out << left << setw(40) <<"* - Number pass max: "<<""
960 << left << setw(20) <<JET_S_npass <<""<< right << setw(10)<<"! not in datacard *"<<"\n";
961 f_out << left << setw(40) <<"* - Minimum pT for protojet: "<<""
962 << left << setw(20) <<JET_S_protojet_ptmin <<""<< right << setw(10)<<"! not in datacard *"<<"\n";
963 }
964 break;
965 case 4: {
966 f_out <<"* KT jet algorithm with parameters: *"<<"\n";
967 f_out << left << setw(40) <<"* - Cone radius: "<<""
968 << left << setw(20) <<JET_coneradius <<""<< right << setw(10)<<"*"<<"\n";
969 }
970 break;
971 case 5: {
972 f_out <<"* Cambridge/Aachen jet algorithm with parameters: *"<<"\n";
973 f_out << left << setw(40) <<"* - Cone radius: "<<""
974 << left << setw(20) <<JET_coneradius <<""<< right << setw(10)<<"*"<<"\n";
975 }
976 break;
977 case 6: {
978 f_out <<"* Anti-kt jet algorithm with parameters: *"<<"\n";
979 f_out << left << setw(40) <<"* - Cone radius: "<<""
980 << left << setw(20) <<JET_coneradius <<""<< right << setw(10)<<"*"<<"\n";
981 }
982 break;
983 }
984 f_out<<"* *"<<"\n";
985 f_out<<"#****************************** *"<<"\n";
986 f_out<<"# Tau-jet definition parameters *"<<"\n";
987 f_out<<"#****************************** *"<<"\n";
988 f_out<<"* *"<<"\n";
989 f_out << left << setw(45) <<"* Cone radius for calorimeter tagging: "<<""
990 << left << setw(5) <<TAU_energy_scone <<""<< right << setw(20)<<"*"<<"\n";
991 f_out << left << setw(45) <<"* Fraction of energy in the small cone: "<<""
992 << left << setw(5) <<TAU_energy_frac*100 <<""<< right << setw(20)<<"! not in datacard *"<<"\n";
993 f_out << left << setw(45) <<"* Cone radius for tracking tagging: "<<""
994 << left << setw(5) <<TAU_track_scone <<""<< right << setw(20)<<"*"<<"\n";
995 f_out << left << setw(45) <<"* Minimum track pT [GeV]: "<<""
996 << left << setw(5) <<TAU_track_pt <<""<< right << setw(20)<<"*"<<"\n";
997 f_out<<"* *"<<"\n";
998 f_out<<"#*************************** *"<<"\n";
999 f_out<<"# B-tagging efficiencies [%] *"<<"\n";
1000 f_out<<"#*************************** *"<<"\n";
1001 f_out<<"* *"<<"\n";
1002 f_out << left << setw(50) <<"* Efficiency to tag a \"b\" as a b-jet: "<<""
1003 << left << setw(10) <<BTAG_b <<""<< right << setw(10)<<"*"<<"\n";
1004 f_out << left << setw(50) <<"* Efficiency to mistag a c-jet as a b-jet: "<<""
1005 << left << setw(10) <<BTAG_mistag_c <<""<< right << setw(10)<<"*"<<"\n";
1006 f_out << left << setw(50) <<"* Efficiency to mistag a light jet as a b-jet: "<<""
1007 << left << setw(10) <<BTAG_mistag_l <<""<< right << setw(10)<<"*"<<"\n";
1008 f_out<<"* *"<<"\n";
1009 f_out<<"* *"<<"\n";
1010 f_out<<"#....................................................................*"<<"\n";
1011 f_out<<"#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>"<<"\n";
1012
1013}
1014
1015// **********Provides the smeared TLorentzVector for the electrons********
1016// Smears the electron energy, and changes the 4-momentum accordingly
1017// different smearing if the electron is central (eta < 2.5) or forward
1018void RESOLution::SmearElectron(TLorentzVector &electron) {
1019 // the 'electron' variable will be changed by the function
1020 float energy = electron.E(); // before smearing
1021 float energyS = 0.0; // after smearing // \sigma/E = C + N/E + S/\sqrt{E}
1022
1023 if(fabs(electron.Eta()) < CEN_max_tracker) { // if the electron is inside the tracker
1024 energyS = gRandom->Gaus(energy, sqrt(
1025 pow(ELG_Ncen,2) +
1026 pow(ELG_Ccen*energy,2) +
1027 pow(ELG_Scen*sqrt(energy),2) ));
1028 }
1029 if(fabs(electron.Eta()) > CEN_max_tracker && fabs(electron.Eta()) < CEN_max_calo_fwd){
1030 energyS = gRandom->Gaus(energy, sqrt(
1031 pow(ELG_Nfwd,2) +
1032 pow(ELG_Cfwd*energy,2) +
1033 pow(ELG_Sfwd*sqrt(energy),2) ) );
1034 }
1035 electron.SetPtEtaPhiE(energyS/cosh(electron.Eta()), electron.Eta(), electron.Phi(), energyS);
1036 if(electron.E() < 0)electron.SetPxPyPzE(0,0,0,0); // no negative values after smearing !
1037}
1038
1039
1040// **********Provides the smeared TLorentzVector for the muons********
1041// Smears the muon pT and changes the 4-momentum accordingly
1042void RESOLution::SmearMu(TLorentzVector &muon) {
1043 // the 'muon' variable will be changed by the function
1044 float pt = muon.Pt(); // before smearing
1045 float ptS=pt;
1046
1047 if(fabs(muon.Eta()) < CEN_max_mu )
1048 {
1049 ptS = gRandom->Gaus(pt, MU_SmearPt*pt ); // after smearing // \sigma/E = C + N/E + S/\sqrt{E}
1050 }
1051 muon.SetPtEtaPhiE(ptS, muon.Eta(), muon.Phi(), ptS*cosh(muon.Eta()));
1052
1053 if(muon.E() < 0)muon.SetPxPyPzE(0,0,0,0); // no negative values after smearing !
1054}
1055
1056
1057// **********Provides the smeared TLorentzVector for the hadrons********
1058// Smears the hadron 4-momentum
1059void RESOLution::SmearHadron(TLorentzVector &hadron, const float frac)
1060 // the 'hadron' variable will be changed by the function
1061 // the 'frac' variable describes the long-living particles. Should be 0.7 for K0S and Lambda, 1. otherwise
1062{
1063 float energy = hadron.E(); // before smearing
1064 float energyS = 0.0; // after smearing // \sigma/E = C + N/E + S/\sqrt{E}
1065 float energy_ecal = (1.0 - frac)*energy; // electromagnetic calorimeter
1066 float energy_hcal = frac*energy; // hadronic calorimeter
1067 // frac takes into account the decay of long-living particles, that decay in the calorimeters
1068 // some of the particles decay mostly in the ecal, some mostly in the hcal
1069
1070 float energyS1,energyS2;
1071 if(fabs(hadron.Eta()) < CEN_max_calo_cen) {
1072 energyS1 = gRandom->Gaus(energy_hcal, sqrt(
1073 pow(HAD_Nhcal,2) +
1074 pow(HAD_Chcal*energy_hcal,2) +
1075 pow(HAD_Shcal*sqrt(energy_hcal),2) )) ;
1076
1077
1078 energyS2 = gRandom->Gaus(energy_ecal, sqrt(
1079 pow(ELG_Ncen,2) +
1080 pow(ELG_Ccen*energy_ecal,2) +
1081 pow(ELG_Scen*sqrt(energy_ecal),2) ) );
1082
1083 energyS = ((energyS1>0)?energyS1:0) + ((energyS2>0)?energyS2:0);
1084 }
1085 if(fabs(hadron.Eta()) > CEN_max_calo_cen && fabs(hadron.Eta()) < CEN_max_calo_fwd){
1086 energyS = gRandom->Gaus(energy, sqrt(
1087 pow(HAD_Nhf,2) +
1088 pow(HAD_Chf*energy,2) +
1089 pow(HAD_Shf*sqrt(energy),2) ));
1090}
1091
1092
1093
1094 hadron.SetPtEtaPhiE(energyS/cosh(hadron.Eta()),hadron.Eta(), hadron.Phi(), energyS);
1095
1096 if(hadron.E() < 0)hadron.SetPxPyPzE(0,0,0,0);
1097}
1098
1099//******************************************************************************************
1100
1101//void RESOLution::SortedVector(vector<ParticleUtil> &vect)
1102void RESOLution::SortedVector(vector<D_Particle> &vect)
1103{
1104 int i,j = 0;
1105 TLorentzVector tmp;
1106 bool en_desordre = true;
1107 int entries=vect.size();
1108 for(i = 0 ; (i < entries) && en_desordre; i++)
1109 {
1110 en_desordre = false;
1111 for(j = 1 ; j < entries - i ; j++)
1112 {
1113 if ( vect[j].Pt() > vect[j-1].Pt() )
1114 {
1115 //ParticleUtil tmp = vect[j-1];
1116 D_Particle tmp = vect[j-1];
1117 vect[j-1] = vect[j];
1118 vect[j] = tmp;
1119 en_desordre = true;
1120 }
1121 }
1122 }
1123}
1124
1125// **********Provides the energy in the cone of radius TAU_CONE_ENERGY for the tau identification********
1126// to be taken into account, a calo tower should
1127// 1) have a transverse energy \f$ E_T = \sqrt{E_X^2 + E_Y^2} \f$ above a given threshold
1128// 2) be inside a cone with a radius R and the axis defined by (eta,phi)
1129double RESOLution::EnergySmallCone(const vector<PhysicsTower> &towers, const float eta, const float phi) {
1130 double Energie=0;
1131 for(unsigned int i=0; i < towers.size(); i++) {
1132 if(towers[i].fourVector.pt() < JET_seed) continue;
1133 if((DeltaR(phi,eta,towers[i].fourVector.phi(),towers[i].fourVector.eta()) < TAU_energy_scone)) {
1134 Energie += towers[i].fourVector.E;
1135 }
1136 }
1137 return Energie;
1138}
1139
1140
1141// **********Provides the number of tracks in the cone of radius TAU_CONE_TRACKS for the tau identification********
1142// to be taken into account, a track should
1143// 1) avec a transverse momentum \$f p_T \$ above a given threshold
1144// 2) be inside a cone with a radius R and the axis defined by (eta,phi)
1145// IMPORTANT REMARK !!!!!
1146// NEW : "charge" will contain the sum of all charged tracks in the cone TAU_track_scone
1147unsigned int RESOLution::NumTracks(float& charge, const vector<TRootTracks> &tracks, const float pt_track, const float eta, const float phi) {
1148 unsigned int numbtrack=0; // number of track in the tau-jet cone, which is smaller than R;
1149 charge=0;
1150 for(unsigned int i=0; i < tracks.size(); i++) {
1151 if(tracks[i].PT < pt_track ) continue;
1152 //float dr = DeltaR(phi,eta,tracks[i].PhiOuter,tracks[i].EtaOuter);
1153 float dr = DeltaR(phi,eta,tracks[i].Phi,tracks[i].Eta);
1154 if (dr > TAU_track_scone) continue;
1155 numbtrack++;
1156 charge += tracks[i].Charge; // total charge in the cone for Tau-jet
1157 }
1158 return numbtrack;
1159}
1160
1161//*** Returns the PID of the particle with the highest energy, in a cone with a radius CONERADIUS and an axis (eta,phi) *********
1162//used by Btaggedjet
1163///// Attention : bug removed => CONERADIUS/2 -> CONERADIUS !!
1164int RESOLution::Bjets(const TSimpleArray<TRootC::GenParticle> &subarray, const float& eta, const float& phi) {
1165 float emax=0;
1166 int Ppid=0;
1167 if(subarray.GetEntries()>0) {
1168 for(int i=0; i < subarray.GetEntries();i++) { // should have pt>PT_JETMIN and a small cone radius (r<CONE_JET)
1169 float genDeltaR = DeltaR(subarray[i]->Phi,subarray[i]->Eta,phi,eta);
1170 if(genDeltaR < JET_coneradius && subarray[i]->E > emax) {
1171 emax=subarray[i]->E;
1172 Ppid=abs(subarray[i]->PID);
1173 }
1174 }
1175 }
1176 return Ppid;
1177}
1178
1179
1180//******************** Simulates the b-tagging efficiency for real bjet, or the misendentification for other jets****************
1181bool RESOLution::Btaggedjet(const TLorentzVector &JET, const TSimpleArray<TRootC::GenParticle> &subarray) {
1182 if( rand()%100 < (BTAG_b+1) && Bjets(subarray,JET.Eta(),JET.Phi())==pB ) return true; // b-tag of b-jets is 40%
1183 else if( rand()%100 < (BTAG_mistag_c+1) && Bjets(subarray,JET.Eta(),JET.Phi())==pC ) return true; // b-tag of c-jets is 10%
1184 else if( rand()%100 < (BTAG_mistag_l+1) && Bjets(subarray,JET.Eta(),JET.Phi())!=0) return true; // b-tag of light jets is 1%
1185 return false;
1186}
1187
1188//***********************Isolation criteria***********************
1189//****************************************************************
1190bool RESOLution::Isolation(const D_Particle& part, const vector<TRootTracks> &tracks, const float& pt_second_track, const float& isolCone, float& ptiso )
1191{
1192 bool isolated = false;
1193 ptiso = 0; // sum of all track pt in isolation cone
1194 float deltar=1E99; // Initial value; should be high; no further repercussion
1195
1196 // loop on all tracks, with p_t above threshold, close enough from the charged lepton
1197 for(unsigned int i=0; i < tracks.size(); i++) {
1198 if(tracks[i].PT < pt_second_track) continue; // ptcut on tracks
1199 float genDeltaR = DeltaR(part.Phi(),part.Eta(),tracks[i].Phi,tracks[i].Eta);
1200 if(
1201 (genDeltaR > deltar) ||
1202 (genDeltaR==0) // rejets the track of the particle itself
1203 ) continue ;
1204 deltar=genDeltaR; // finds the closest track
1205
1206 // as long as (genDeltaR==0) is put above, the particle itself is not taken into account
1207 if( genDeltaR < ISOL_Cone) ptiso += tracks[i].PT; // dR cut on tracks
1208 }
1209 if(deltar > isolCone) isolated = true;
1210 return isolated;
1211}
1212
1213// ******* Calorimetric isolation
1214float RESOLution::CaloIsolation(const D_Particle& part, const D_CaloTowerList & towers) {
1215 // etrat, which is a percentage between 00 and 99. It is the ratio of the transverse energy
1216 // in a 3×3 grid surrounding the muon to the pT of the muon. For well-isolated muons, both ptiso and etrat will be small.
1217 if(ISOL_Calo_ET>1E10) return UNDEFINED; // avoid doing anything unreasonable...
1218 float etrat=0;
1219 // available parameters: ISOL_Calo_ET , ISOL_Calo_Grid
1220/* for(unsigned int i=0; i < towers.size(); i++) {
1221 if(towers[i].E > ISOL_Calo_ET) {
1222 float genDeltaR = DeltaR(part.Phi(),part.Eta(),towers[i].getPhi(),towers[i].getEta());
1223 if(genDeltaR < ISOL_Calo_Cone) {
1224 ptiso += towers[i].getET();
1225 }
1226 }
1227 } // loop on towers
1228 ptiso -=
1229*/
1230 etrat = 100*etrat/part.Pt();
1231 if(etrat<0) cout << "Error: negative etrat in CaloIsolation (" << etrat <<")\n";
1232 else if(etrat>99) cout << "Error: etrat shoud be in [0;99] in CaloIsolation (" << etrat <<")\n";
1233 return etrat;
1234}
1235
1236
1237 //********** returns a segmented value for eta and phi, for calo towers *****
1238void RESOLution::BinEtaPhi(const float phi, const float eta, float& iPhi, float& iEta){
1239 iEta = UNDEFINED;
1240 int index= iUNDEFINED;
1241 for (unsigned int i=1; i< TOWER_number+1; i++) {
1242 if(fabs(eta)>TOWER_eta_edges[i-1] && fabs(eta)<TOWER_eta_edges[i]) {
1243 iEta = (eta>0) ? TOWER_eta_edges[i-1] : -TOWER_eta_edges[i];
1244 index = i-1;
1245 break;
1246 }
1247 }
1248 if(index==UNDEFINED) return;
1249 iPhi = UNDEFINED;
1250 float dphi = TOWER_dphi[index]*pi/180.;
1251 for (unsigned int i=1; i < 360/TOWER_dphi[index]; i++ ) {
1252 float low = -pi+(i-1)*dphi;
1253 float high= low+dphi;
1254 if(phi > low && phi < high ){
1255 iPhi = low;
1256 break;
1257 }
1258 }
1259 if (phi > pi-dphi) iPhi = pi-dphi;
1260}
1261
1262
1263
1264//**************************** Returns the delta Phi ****************************
1265float DeltaPhi(const float phi1, const float phi2) {
1266 float deltaphi=phi1-phi2; // in here, -pi < phi < pi
1267 if(fabs(deltaphi) > pi) {
1268 deltaphi=2.*pi -fabs(deltaphi);// put deltaphi between 0 and pi
1269 }
1270 else deltaphi=fabs(deltaphi);
1271
1272 return deltaphi;
1273}
1274
1275//**************************** Returns the delta R****************************
1276float DeltaR(const float phi1, const float eta1, const float phi2, const float eta2) {
1277 return sqrt(pow(DeltaPhi(phi1,phi2),2) + pow(eta1-eta2,2));
1278}
1279
1280int sign(const int myint) {
1281 if (myint >0) return 1;
1282 else if (myint <0) return -1;
1283 else return 0;
1284}
1285
1286int sign(const float myfloat) {
1287 if (myfloat >0) return 1;
1288 else if (myfloat <0) return -1;
1289 else return 0;
1290}
1291
1292int ChargeVal(const int pid)
1293{
1294 cout << "ChargeVal :: deprecated function, do not use it anymore" << endl;
1295 int charge;
1296 if(
1297 (pid == pGAMMA) ||
1298 (pid == pPI0) ||
1299 (pid == pK0L) ||
1300 (pid == pN) ||
1301 (pid == pSIGMA0) ||
1302 (pid == pDELTA0) ||
1303 (pid == pK0S) // not charged particles : invisible by tracker
1304 )
1305 charge = 0;
1306 else charge = sign(pid);
1307 return charge;
1308
1309}
1310
1311//------------------------------------------------------------------------------
1312void RESOLution::ReadParticleDataGroupTable() {
1313
1314 string temp_string;
1315 istringstream curstring;
1316
1317 ifstream fichier_a_lire(PdgTableFilename.c_str());
1318 if(!fichier_a_lire.good()) {
1319 cout <<"** ERROR: PDG Table ("<< PdgTableFilename
1320 << ") not found! exit. **" << endl;
1321 exit(1);
1322 return;
1323 }
1324 // first three lines of the file are useless
1325 getline(fichier_a_lire,temp_string);
1326 getline(fichier_a_lire,temp_string);
1327 getline(fichier_a_lire,temp_string);
1328
1329
1330 while (getline(fichier_a_lire,temp_string)) {
1331 curstring.clear(); // needed when using several times istringstream::str(string)
1332 curstring.str(temp_string);
1333 int ID; string name; int charge; float mass; float width; float lifetime;
1334 // ID name chg mass total width lifetime
1335 // 1 d -1 0.33000 0.00000 0.00000E+00
1336 curstring >> ID >> name >> charge >> mass >> width >> lifetime;
1337 PdgParticle particle(ID,name,mass,charge/3.,width,lifetime);
1338 PDGtable.insert(ID,particle);
1339 //PdgTable.insert(pair<int,PdgParticle>(ID,particle));
1340 //cout << PDGtable[ID].name() << "\t" << PDGtable[ID].mass() << "\t" << PDGtable[ID].charge() << endl;
1341 }
1342
1343} // ReadParticleDataGroupTable
Note: See TracBrowser for help on using the repository browser.