Fork me on GitHub

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

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

update

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