-
Notifications
You must be signed in to change notification settings - Fork 0
/
LHC-FASER_base_kinematics_stuff.cpp
executable file
·731 lines (704 loc) · 28.6 KB
/
LHC-FASER_base_kinematics_stuff.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
/*
* LHC-FASER_base_kinematics_stuff.cpp
*
* Created on: 02 Mar 2011
* Authors: Ben O'Leary (benjamin.oleary@gmail.com)
* Jonas Lindert (jonas.lindert@googlemail.com)
* Carsten Robens (carsten.robens@gmx.de)
* Copyright 2010 Ben O'Leary, Jonas Lindert, Carsten Robens
*
* This file is part of LHC-FASER.
*
* LHC-FASER is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LHC-FASER is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with LHC-FASER. If not, see <http://www.gnu.org/licenses/>.
*
* The GNU General Public License should be in GNU_public_license.txt
* the files of LHC-FASER are:
* LHC-FASER.hpp
* LHC-FASER.cpp
* LHC-FASER_base_electroweak_cascade_stuff.hpp
* LHC-FASER_base_electroweak_cascade_stuff.cpp
* LHC-FASER_base_kinematics_stuff.hpp
* LHC-FASER_base_kinematics_stuff.cpp
* LHC-FASER_base_lepton_distribution_stuff.hpp
* LHC-FASER_base_lepton_distribution_stuff.cpp
* LHC-FASER_charged_electroweak_cascade_stuff.hpp
* LHC-FASER_charged_electroweak_cascade_stuff.cpp
* LHC-FASER_cross-section_stuff.hpp
* LHC-FASER_cross-section_stuff.cpp
* LHC-FASER_derived_lepton_distributions.hpp
* LHC-FASER_derived_lepton_distributions.cpp
* LHC-FASER_electroweak_cascade_collection_stuff.hpp
* LHC-FASER_electroweak_cascade_collection_stuff.cpp
* LHC-FASER_full_cascade_stuff.hpp
* LHC-FASER_full_cascade_stuff.cpp
* LHC-FASER_global_stuff.hpp
* LHC-FASER_global_stuff.cpp
* LHC-FASER_input_handling_stuff.hpp
* LHC-FASER_input_handling_stuff.cpp
* LHC-FASER_jet_kinematics_stuff.hpp
* LHC-FASER_jet_kinematics_stuff.cpp
* LHC-FASER_lepton_kinematics_stuff.hpp
* LHC-FASER_lepton_kinematics_stuff.cpp
* LHC-FASER_neutral_electroweak_cascade_stuff.hpp
* LHC-FASER_neutral_electroweak_cascade_stuff.cpp
* LHC-FASER_signal_calculator_stuff.hpp
* LHC-FASER_signal_calculator_stuff.cpp
* LHC-FASER_signal_data_collection_stuff.hpp
* LHC-FASER_signal_data_collection_stuff.cpp
* LHC-FASER_sparticle_decay_stuff.hpp
* LHC-FASER_sparticle_decay_stuff.cpp
* LHC-FASER_template_classes.hpp
* and README.LHC-FASER.txt which describes the package.
*
* LHC-FASER also requires CppSLHA. It should be found in a subdirectory
* included with this package.
*
* LHC-FASER also requires grids of lookup values. These should also be
* found in a subdirectory included with this package.
*/
#include "LHC-FASER_base_kinematics_stuff.hpp"
namespace LHC_FASER
{
acceptanceCutSet::acceptanceCutSet() :
beamEnergy( -1 ),
primaryLeptonCut( -1.0 ),
secondaryLeptonCut( -1.0 ),
jetCut( -1.0 ),
leptonCutsAreEqualFlag( false ),
excludedStandardModelProducts( NULL )
// this constructor sets the acceptances to -1.0, which is the default
// "unset" value.
{
// just an initialization list.
}
acceptanceCutSet::acceptanceCutSet(
acceptanceCutSet const* const copyPointer ) :
beamEnergy( copyPointer->beamEnergy ),
primaryLeptonCut( copyPointer->primaryLeptonCut ),
secondaryLeptonCut( copyPointer->secondaryLeptonCut ),
jetCut( copyPointer->jetCut ),
leptonCutsAreEqualFlag( copyPointer->leptonCutsAreEqualFlag ),
excludedStandardModelProducts( copyPointer->excludedStandardModelProducts )
// this constructor copies the acceptances from a given acceptanceCutSet.
{
// just an initialization list.
}
acceptanceCutSet::~acceptanceCutSet()
{
// does nothing.
}
/* these are for which elements of the acceptanceValues vector of vectors
* of vectors to use.
* N.B.! this bit is HIGHLY format-dependent, since the acceptanceValues are
* read in in the order:
* 1: light - heavy
* 2: light - medium
* 3: light - light
* 4: medium - heavy
* 5: medium - medium
* 6: heavy - heavy
* though these are stored in the vector as elements
* 0, 1, 2, 3, 4, & 5, which is why the comments below seem to not
* match the code.
*/
unsigned int const acceptanceGrid::indexForLightLightNeutralinoPair( 2 );
unsigned int const acceptanceGrid::indexForLightMediumNeutralinoPair( 1 );
unsigned int const acceptanceGrid::indexForLightHeavyNeutralinoPair( 0 );
unsigned int const acceptanceGrid::indexForMediumMediumNeutralinoPair( 4 );
unsigned int const acceptanceGrid::indexForMediumHeavyNeutralinoPair( 3 );
unsigned int const acceptanceGrid::indexForHeavyHeavyNeutralinoPair( 5 );
acceptanceGrid::acceptanceGrid( std::string const* const gridFileLocation,
inputHandler const* const inputShortcut ) :
inputShortcut( inputShortcut ),
scoloredMassStepSize( CppSLHA::CppSLHA_global::really_wrong_value ),
lowestSquarkMass( CppSLHA::CppSLHA_global::really_wrong_value ),
highestSquarkMass( CppSLHA::CppSLHA_global::really_wrong_value ),
lowestGluinoMass( CppSLHA::CppSLHA_global::really_wrong_value ),
highestGluinoMass( CppSLHA::CppSLHA_global::really_wrong_value ),
lowElectroweakinoMassRatio(
CppSLHA::CppSLHA_global::really_wrong_value ),
mediumElectroweakinoMassRatio(
CppSLHA::CppSLHA_global::really_wrong_value ),
highElectroweakinoMassRatio(
CppSLHA::CppSLHA_global::really_wrong_value ),
acceptanceValues(),
lowerLeftVectorOfVectors( NULL ),
lowerRightVectorOfVectors( NULL ),
upperRightVectorOfVectors( NULL ),
upperLeftVectorOfVectors( NULL ),
squarkMassFraction( CppSLHA::CppSLHA_global::really_wrong_value ),
gluinoMassFraction( CppSLHA::CppSLHA_global::really_wrong_value )
{
// read in the grid:
if( NULL != gridFileLocation )
{
// open the file:
int const maxLengthOfGridFile( 100000 );
CppSLHA::hash_commented_file_reader inputFileReader( gridFileLocation,
maxLengthOfGridFile,
false );
/* a hundred thousand lines should be long enough for any grid file. if
* readIn() is reading in more lines than that, it's probably because
* of some file corruption.
* also, if it's not enough, change it here.
*/
std::string inputLineAsString;
// prepare a string to parse the line.
std::stringstream inputLineAsStream;
// prepare a stringstream to parse the line.
// the masses from the last line read & the currently-read line:
double lastSquarkMass( 0.0 );
double lastGluinoMass( 0.0 );
double currentSquarkMass( 0.0 );
double currentGluinoMass( 0.0 );
std::vector< double > neutralinoMasses;
lowestSquarkMass = 0.0;
lowestGluinoMass = 0.0;
double currentValue;
// the value currently being read in.
bool gridSizeStillUnknown( true );
// we start out not knowing the step size for the grid (but we do
// assume that it is a square grid).
std::vector< double >* currentAcceptanceVector( NULL );
// this holds all the acceptance acceptanceValues for a grid point.
std::vector< std::vector< double >* >* currentNeutralinoVector( NULL );
// this holds all the acceptanceValues for a set of points with the same
// squark & gluino masses, but varying neutralino masses.
std::vector< std::vector< std::vector< double >* >* >*
currentGluinoVector( NULL );
// this holds all the acceptanceValues for a set of points with the same
// squark masses, but varying gluino masses.
while( inputFileReader.read_line( &inputLineAsString ) )
// the evaluation of the conditional reads in the next line.
{
// read in the line for interpretting:
inputLineAsStream.clear();
inputLineAsStream.str( inputLineAsString );
// update what the masses for the last line were:
lastSquarkMass = currentSquarkMass;
lastGluinoMass = currentGluinoMass;
inputLineAsStream >> currentSquarkMass
>> currentGluinoMass;
inputLineAsStream >> currentValue;
if( gridSizeStillUnknown )
{
neutralinoMasses.push_back( currentValue );
}
inputLineAsStream >> currentValue;
if( gridSizeStillUnknown )
{
neutralinoMasses.push_back( currentValue );
}
currentAcceptanceVector = new std::vector< double >;
while( !(inputLineAsStream.eof()) )
{
inputLineAsStream >> currentValue;
currentAcceptanceVector->push_back( currentValue );
}
if( currentSquarkMass > lastSquarkMass )
// if the squark mass has changed, we need a new vector for the
// acceptanceValues for varying gluino masses.
{
// 1st record the last set of points with the same squark mass:
if( NULL != currentGluinoVector )
// if we have a vector to add...
{
currentGluinoVector->push_back( currentNeutralinoVector );
acceptanceValues.push_back( currentGluinoVector );
// debugging:
/**std::cout
<< std::endl
<< "pushed back a neutralino vector of size "
<< currentNeutralinoVector->size()
<< " and a gluino vector of size "
<< currentGluinoVector->size();**/
}
// prepare a new vector for the new squark mass:
currentGluinoVector
= new std::vector< std::vector< std::vector< double >* >* >;
// prepare a new vector for the new gluino mass:
currentNeutralinoVector = new std::vector< std::vector< double >* >;
}
else if( currentGluinoMass > lastGluinoMass )
/* if the gluino mass has changed (but the squark mass has not
* changed, we need a new vector for the acceptanceValues for varying
* neutralino masses.
*/
{
// 1st record the last set of points with the same gluino mass:
currentGluinoVector->push_back( currentNeutralinoVector );
// debugging:
/**std::cout
<< std::endl
<< "pushed back a neutralino vector of size "
<< currentNeutralinoVector->size();
**/
// prepare a new vector for the new gluino mass:
currentNeutralinoVector = new std::vector< std::vector< double >* >;
}
/*if( !gridSizeStillUnknown
&&
( acceptanceColumns > currentAcceptanceVector->size() ) )
{
acceptanceColumns = currentAcceptanceVector->size();
std::cout
<< std::endl
<< "LHC-FASER warning! read in an acceptance grid line that"
<< " is shorter than the previous one, so the grid is"
<< " \"ragged\"; hence *all* the lines for this grid will be"
<< " truncated to this smaller length.";
std::cout << std::endl;
}*/
currentNeutralinoVector->push_back( currentAcceptanceVector );
// debugging:
/**std::cout
<< std::endl
<< "pushed back an acceptance vector of size "
<< currentAcceptanceVector->size() << ", {";
for( std::vector< double >::iterator
acceptanceIterator( currentAcceptanceVector->begin() );
currentAcceptanceVector->end() > acceptanceIterator;
++acceptanceIterator )
{
std::cout << " " << *acceptanceIterator;
}
std::cout << " }";
**/
if( gridSizeStillUnknown
&&
( 0.0 < lastSquarkMass )
&&
( 0.0 < lastGluinoMass )
&&
( ( currentSquarkMass > lastSquarkMass )
||
( currentGluinoMass > lastGluinoMass ) ) )
// if we still need to work out the grid step size & we have read
// in enough to do so...
{
//acceptanceColumns = currentAcceptanceVector->size();
// first we take note of the 1st point, which should have the
// lowest co-ordinate acceptanceValues:
lowestSquarkMass = lastSquarkMass;
lowestGluinoMass = lastGluinoMass;
// then we work out the grid step size:
if( currentGluinoMass > lastGluinoMass )
// if it was the gluino mass that incremented...
{
scoloredMassStepSize = ( currentGluinoMass - lastGluinoMass );
}
else
// otherwise it was the squark mass that incremented...
{
scoloredMassStepSize = ( currentSquarkMass - lastSquarkMass );
}
// debugging:
/**std::cout
<< std::endl
<< "scoloredMassStepSize = " << scoloredMassStepSize;**/
// now we need to work out the neutralino mass ratios to the
// lighter colored sparticle:
double lighterScoloredMass( lastSquarkMass );
if( lastGluinoMass < lastSquarkMass )
{
lighterScoloredMass = lastGluinoMass;
}
double lowestNeutralinoMass( lighterScoloredMass );
double middleNeutralinoMass( lighterScoloredMass );
double highestNeutralinoMass( lighterScoloredMass );
for( std::vector< double >::const_iterator
massIterator( neutralinoMasses.begin() );
neutralinoMasses.end() > massIterator;
++massIterator )
{
if( *massIterator < lowestNeutralinoMass )
{
highestNeutralinoMass = middleNeutralinoMass;
middleNeutralinoMass = lowestNeutralinoMass;
lowestNeutralinoMass = *massIterator;
}
if( ( *massIterator < middleNeutralinoMass )
&&
( *massIterator > lowestNeutralinoMass ) )
{
highestNeutralinoMass = middleNeutralinoMass;
middleNeutralinoMass = *massIterator;
}
if( ( *massIterator < highestNeutralinoMass )
&&
( *massIterator > middleNeutralinoMass ) )
{
highestNeutralinoMass = *massIterator;
}
lowElectroweakinoMassRatio = ( lowestNeutralinoMass
/ lighterScoloredMass );
mediumElectroweakinoMassRatio = ( middleNeutralinoMass
/ lighterScoloredMass );
highElectroweakinoMassRatio = ( highestNeutralinoMass
/ lighterScoloredMass );
// debugging:
/**std::cout << std::endl << "debugging:"
<< std::endl
<< "lowElectroweakinoMassRatio = " << lowElectroweakinoMassRatio
<< std::endl
<< "mediumElectroweakinoMassRatio = "
<< mediumElectroweakinoMassRatio
<< std::endl
<< "highElectroweakinoMassRatio = " << highElectroweakinoMassRatio;
std::cout << std::endl;**/
}
gridSizeStillUnknown = false;
}
} // end of while loop going over the lines of the file.
// we still have to add the last vectors:
//acceptanceColumns = currentAcceptanceVector->size();
currentGluinoVector->push_back( currentNeutralinoVector );
acceptanceValues.push_back( currentGluinoVector );
// debugging:
/**std::cout
<< std::endl
<< "pushed back last currentNeutralinoVector of size "
<< currentNeutralinoVector->size()
<< " & last currentGluinoVector of size "
<< currentGluinoVector->size();
std::cout << std::endl;**/
// the last masses should be the maximal acceptanceValues:
highestSquarkMass = currentSquarkMass;
highestGluinoMass = currentGluinoMass;
}
else
// otherwise, a NULL pointer was given instead of a pointer to the
// grid file name string.
{
std::cout
<< std::endl
<< "LHC-FASER::error! asked to open a file with a NULL pointer!";
std::cout << std::endl;
}
// debugging:
/**std::cout
<< std::endl
<< "debugging: acceptanceGrid::readIn() finished: "
<< std::endl << "lowestSquarkMass = " << lowestSquarkMass
<< std::endl << "highestSquarkMass = " << highestSquarkMass
<< std::endl << "lowestGluinoMass = " << lowestGluinoMass
<< std::endl << "highestGluinoMass = " << highestGluinoMass
<< std::endl << "lowElectroweakinoMassRatio = "
<< lowElectroweakinoMassRatio
<< std::endl << "mediumElectroweakinoMassRatio = "
<< mediumElectroweakinoMassRatio
<< std::endl << "highElectroweakinoMassRatio = "
<< highElectroweakinoMassRatio
<< std::endl << "printing out to test.dat";
std::cout << std::endl;
std::ofstream testOutput;
testOutput.open( "test.dat" );
double outputSquarkMass;
double outputGluinoMass;
double outputLighterScoloredMass;
for( unsigned int squarkCounter( 0 );
acceptanceValues.size() > squarkCounter;
++squarkCounter )
{
outputSquarkMass
= ( lowestSquarkMass + ( scoloredMassStepSize * squarkCounter ) );
for( unsigned int gluinoCounter( 0 );
acceptanceValues.at( squarkCounter )->size() > gluinoCounter;
++gluinoCounter )
{
outputGluinoMass
= ( lowestGluinoMass + ( scoloredMassStepSize * gluinoCounter ) );
if( outputGluinoMass < outputSquarkMass )
{
outputLighterScoloredMass = outputGluinoMass;
}
else
{
outputLighterScoloredMass = outputSquarkMass;
}
for( int neutralinoCounter( 0 );
6 > neutralinoCounter;
++neutralinoCounter )
{
testOutput
<< " " << outputSquarkMass
<< " " << outputGluinoMass;
if( 0 == neutralinoCounter )
{
testOutput
<< " "
<< ( lowElectroweakinoMassRatio * outputLighterScoloredMass )
<< " "
<< ( highElectroweakinoMassRatio * outputLighterScoloredMass );
}
else if( 1 == neutralinoCounter )
{
testOutput
<< " "
<< ( lowElectroweakinoMassRatio * outputLighterScoloredMass )
<< " "
<< ( mediumElectroweakinoMassRatio * outputLighterScoloredMass );
}
else if( 2 == neutralinoCounter )
{
testOutput
<< " "
<< ( lowElectroweakinoMassRatio * outputLighterScoloredMass )
<< " "
<< ( lowElectroweakinoMassRatio * outputLighterScoloredMass );
}
else if( 3 == neutralinoCounter )
{
testOutput
<< " "
<< ( mediumElectroweakinoMassRatio * outputLighterScoloredMass )
<< " "
<< ( highElectroweakinoMassRatio * outputLighterScoloredMass );
}
else if( 4 == neutralinoCounter )
{
testOutput
<< " "
<< ( mediumElectroweakinoMassRatio * outputLighterScoloredMass )
<< " "
<< ( mediumElectroweakinoMassRatio * outputLighterScoloredMass );
}
else if( 5 == neutralinoCounter )
{
testOutput
<< " "
<< ( highElectroweakinoMassRatio * outputLighterScoloredMass )
<< " "
<< ( highElectroweakinoMassRatio * outputLighterScoloredMass );
}
for( std::vector< double >::const_iterator
acceptanceIterator( acceptanceValues.at( squarkCounter )->at(
gluinoCounter )->at(
neutralinoCounter )->begin() );
acceptanceValues.at( squarkCounter )->at(
gluinoCounter )->at( neutralinoCounter )->end()
> acceptanceIterator;
++acceptanceIterator )
{
testOutput << " " << *acceptanceIterator;
}
testOutput << std::endl;
}
}
}
testOutput.close();**/
}
acceptanceGrid::~acceptanceGrid()
{
// delete all the vectors held as pointers by the vector of vectors of
// vectors:
for( std::vector< std::vector< std::vector< std::vector< double
>* >* >* >::iterator
gluinoVectorIterator( acceptanceValues.begin() );
acceptanceValues.end() > gluinoVectorIterator;
++gluinoVectorIterator )
{
for( std::vector< std::vector< std::vector< double >* >* >::iterator
neutralinoVectorIterator( (*gluinoVectorIterator)->begin() );
(*gluinoVectorIterator)->end() > neutralinoVectorIterator;
++neutralinoVectorIterator )
{
for( std::vector< std::vector< double >* >::iterator
deletionIterator( (*neutralinoVectorIterator)->begin() );
(*neutralinoVectorIterator)->end() > deletionIterator;
++deletionIterator )
{
delete *deletionIterator;
}
delete *neutralinoVectorIterator;
}
delete *gluinoVectorIterator;
}
}
double
acceptanceGrid::testFunction( double const squarkMass,
double const gluinoMass,
int const electroweakinoIndex,
int const acceptanceIndex )
{
if( pointIsOnGrid( squarkMass,
gluinoMass )
&&
( 0 <= electroweakinoIndex )
&&
( lowerLeftVectorOfVectors->size()
> (unsigned int)electroweakinoIndex )
&&
( 0 <= acceptanceIndex )
&&
( lowerLeftVectorOfVectors->at( electroweakinoIndex )->size()
> (unsigned int)acceptanceIndex ) )
{
std::cout
<< std::endl
<< "squarkMassFraction = " << squarkMassFraction
<< std::endl
<< "gluinoMassFraction = " << gluinoMassFraction
<< std::endl
<< "lower left value = "
<< lowerLeftVectorOfVectors->at( electroweakinoIndex )->at(
acceptanceIndex )
<< std::endl
<< "lower right value = "
<< lowerRightVectorOfVectors->at( electroweakinoIndex )->at(
acceptanceIndex )
<< std::endl
<< "upper right value = "
<< upperRightVectorOfVectors->at( electroweakinoIndex )->at(
acceptanceIndex )
<< std::endl
<< "upper left value = "
<< upperLeftVectorOfVectors->at( electroweakinoIndex )->at(
acceptanceIndex );
std::cout << std::endl;
return lhcFaserGlobal::squareBilinearInterpolation( squarkMassFraction,
gluinoMassFraction,
lowerLeftVectorOfVectors->at(
electroweakinoIndex )->at(
acceptanceIndex ),
lowerRightVectorOfVectors->at(
electroweakinoIndex )->at(
acceptanceIndex ),
upperRightVectorOfVectors->at(
electroweakinoIndex )->at(
acceptanceIndex ),
upperLeftVectorOfVectors->at(
electroweakinoIndex )->at(
acceptanceIndex ) );
}
else
{
return CppSLHA::CppSLHA_global::really_wrong_value;
}
}
bool
acceptanceGrid::pointIsOnGrid( double const squarkMass,
double const gluinoMass )
/* this looks to see if the squark & gluino masses are on the grid, & if
* so, sets lowerLeftVectorOfVectors, lowerRightVectorOfVectors,
* upperRightVectorOfVectors, upperLeftVectorOfVectors, squarkMassFraction,
* & gluinoMassFraction appropriately, returning true. otherwise, it
* returns false.
*/
{
bool returnBool( false );
if( ( 0.0 < scoloredMassStepSize )
&&
( squarkMass >= lowestSquarkMass )
&&
( gluinoMass >= lowestGluinoMass ) )
{
squarkMassFraction
= ( ( squarkMass - lowestSquarkMass ) / scoloredMassStepSize );
unsigned int squarkElement( (unsigned int)squarkMassFraction );
squarkMassFraction -= (double)squarkElement;
if( ( acceptanceValues.size() == ( squarkElement + 1 ) )
&&
( 0.0 == squarkMassFraction ) )
{
--squarkElement;
squarkMassFraction = 1.0;
}
if( acceptanceValues.size() > ( squarkElement + 1 ) )
// if the x co-ordinate is less than its maximal grid value...
{
gluinoMassFraction
= ( ( gluinoMass - lowestGluinoMass ) / scoloredMassStepSize );
unsigned int gluinoElement( (unsigned int)gluinoMassFraction );
gluinoMassFraction -= (double)gluinoElement;
if( ( acceptanceValues.at( squarkElement )->size()
== ( gluinoElement + 1 ) )
&&
( 0.0 == gluinoMassFraction ) )
{
--gluinoElement;
gluinoMassFraction = 1.0;
}
if( ( acceptanceValues.at( squarkElement )->size()
> ( gluinoElement + 1 ) )
&&
( acceptanceValues.at( squarkElement + 1 )->size()
> ( gluinoElement + 1 ) ) )
// if the y co-ordinate is less than its maximal grid value (on both
// sides of the grid square)...
{
// debugging:
/**std::cout << std::endl << "debugging:"
<< std::endl
<< "acceptanceGrid::pointIsOnGrid( " << squarkMass << ", "
<< gluinoMass << " ) has squarkElement = " << squarkElement
<< ", gluinoElement = " << gluinoElement;
std::cout << std::endl;**/
lowerLeftVectorOfVectors
= acceptanceValues.at( squarkElement )->at( gluinoElement );
lowerRightVectorOfVectors
= acceptanceValues.at( squarkElement + 1 )->at( gluinoElement );
upperRightVectorOfVectors
= acceptanceValues.at( squarkElement + 1 )->at( gluinoElement + 1 );
upperLeftVectorOfVectors
= acceptanceValues.at( squarkElement )->at( gluinoElement + 1 );
returnBool = true;
}
else
// otherwise, it's off the grid:
{
if( inputShortcut->isVerbose() )
{
std::cout
<< std::endl
<< "LHC-FASER::warning! acceptance requested for a gluino mass"
<< " ( " << gluinoMass << " ) larger than allowed for ( "
<< highestGluinoMass << " ) in the lookup table!";
std::cout << std::endl;
}
}
}
else
// otherwise, it's off the grid:
{
if( inputShortcut->isVerbose() )
{
std::cout
<< std::endl
<< "LHC-FASER::warning! acceptance requested for a squark mass"
<< " ( " << squarkMass << " ) larger than allowed for ( "
<< highestSquarkMass << " ) in the lookup table!";
std::cout << std::endl;
}
}
}
else
// otherwise, it's off the grid:
{
if( inputShortcut->isVerbose() )
{
std::cout
<< std::endl
<< "LHC-FASER::warning! acceptance requested for a squark mass"
<< " ( " << squarkMass << " ) or gluino mass ( "
<< gluinoMass << " ) smaller than allowed for ( "
<< lowestSquarkMass << " or " << lowestGluinoMass << " respectively)"
<< " in the lookup table (or the table is malformed with a negative"
<< " grid size ( " << scoloredMassStepSize << " ))!";
std::cout << std::endl;
}
}
return returnBool;
}
} // end of LHC_FASER namespace.