Fork me on GitHub

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

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

new CaloIsolation for muons : EtRatio up-to-date

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