-
Notifications
You must be signed in to change notification settings - Fork 0
/
LHC-FASER_signal_calculator_stuff.hpp
executable file
·1139 lines (984 loc) · 43.3 KB
/
LHC-FASER_signal_calculator_stuff.hpp
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
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* LHC-FASER_signal_calculator_stuff.hpp
*
* Created on: 17 Nov 2010
* 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.
*/
#ifndef LHC_FASER_SIGNAL_CALCULATOR_STUFF_HPP_
#define LHC_FASER_SIGNAL_CALCULATOR_STUFF_HPP_
#include "LHC-FASER_global_stuff.hpp"
#include "LHC-FASER_signal_data_collection_stuff.hpp"
/* NOTES FOR WRITING NEW SIGNALS:
*
* I have tried to make it as straightforward as possible to write new signals,
* but inevitably there is going to have to be some new code written for each
* new signal. Until I get around to writing a better version of these notes,
* you'll have to go by the existing signals as examples.
*
* Things to remember:
* - valueForCurrentCascades(...) has to be written for any class derived from
* signalCalculator, even if it doesn't use it because it over-rides
* calculateValue(...) itself. however, most signals should just have their
* own valueForCurrentCascades(...), unless they do something strange.
* - make sure that exclusiveBrHandler::alwaysNeglectedDecays doesn't
* interfere with the new signal. exclusiveBrHandler returns a NULL pointer
* if the decay is in alwaysNeglectedDecays.
* - fire hot, hot hurt.
*/
namespace LHC_FASER
{
// this abstract base class encapsulates the general lepton acceptance
// separate from the jet acceptance.
class leptonAcceptanceForCascadePair
{
public:
leptonAcceptanceForCascadePair();
virtual
~leptonAcceptanceForCascadePair();
virtual double
withExactlyNJets( signalDefinitionSet const* const signalDefinitions,
int const exactNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const = 0;
virtual double
withAtLeastNJets( signalDefinitionSet const* const signalDefinitions,
int const minimumNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
protected:
static int const maximumNumberOfJets;
};
namespace leptonAcceptanceStyle
{
// this class derived from leptonAcceptanceForCascadePair is the most
// general I could think of.
class fullySpecified : public leptonAcceptanceForCascadePair
{
public:
fullySpecified( int const numberOfNegativeElectrons,
int const numberOfPositiveElectrons,
int const numberOfNegativeMuons,
int const numberOfPositiveMuons );
virtual
~fullySpecified();
virtual double
withExactlyNJets( signalDefinitionSet const* const signalDefinitions,
int const exactNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
protected:
int const numberOfNegativeElectrons;
int const numberOfPositiveElectrons;
int const numberOfNegativeMuons;
int const numberOfPositiveMuons;
};
// this class derived from leptonAcceptanceForCascadePair just returns
// 100% lepton / additional jet acceptance.
class noLeptonCutNorExtraJetCut : public leptonAcceptanceForCascadePair
{
public:
noLeptonCutNorExtraJetCut();
virtual
~noLeptonCutNorExtraJetCut();
virtual double
withExactlyNJets( signalDefinitionSet const* const signalDefinitions,
int const minimumNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
virtual double
withAtLeastNJets( signalDefinitionSet const* const signalDefinitions,
int const minimumNumberOfJets,
fullCascade* const firstCascade,
bool firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
};
// this class derived from leptonAcceptanceForCascadePair sums up over
// all combinations of electrons & muons & charges.
class chargeAndFlavorSummed : public leptonAcceptanceForCascadePair
{
public:
chargeAndFlavorSummed( int const numberOfLeptons );
virtual
~chargeAndFlavorSummed();
virtual double
withExactlyNJets( signalDefinitionSet const* const signalDefinitions,
int const exactNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
protected:
int const numberOfLeptons;
};
// this class derived from leptonAcceptanceForCascadePair sums up over
// all combinations of charges, distinguishing electrons from muons.
class chargeSummed : public leptonAcceptanceForCascadePair
{
public:
chargeSummed( int const numberOfElectrons,
int const numberOfMuons );
virtual
~chargeSummed();
virtual double
withExactlyNJets( signalDefinitionSet const* const signalDefinitions,
int const exactNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
protected:
int const numberOfElectrons;
int const numberOfMuons;
};
// this class derived from leptonAcceptanceForCascadePair sums up over
// all combinations of electrons & muons charges, distinguishing charges.
class flavorSummed : public leptonAcceptanceForCascadePair
{
public:
flavorSummed( int const numberOfNegativeLeptons,
int const numberOfPositiveLeptons );
virtual
~flavorSummed();
virtual double
withExactlyNJets( signalDefinitionSet const* const signalDefinitions,
int const exactNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
protected:
int const numberOfNegativeLeptons;
int const numberOfPositiveLeptons;
};
// this class derived from leptonAcceptanceForCascadePair returns the
// acceptance for *exactly one* OSSF-OSDF pair.
class ossfMinusOsdf : public leptonAcceptanceForCascadePair
{
public:
ossfMinusOsdf();
virtual
~ossfMinusOsdf();
virtual double
withExactlyNJets( signalDefinitionSet const* const signalDefinitions,
int const exactNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
};
// this class derived from leptonAcceptanceForCascadePair returns the
// acceptance for *exactly one* same-sign, same-flavor pair.
class sameSignSameFlavor : public leptonAcceptanceForCascadePair
{
public:
sameSignSameFlavor();
virtual
~sameSignSameFlavor();
virtual double
withExactlyNJets( signalDefinitionSet const* const signalDefinitions,
int const exactNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const;
};
} // end of leptonAcceptanceStyle namespace
/* this is an abstract base class to do the actual calculation of the value
* of the event rate for a signal. the main differences in derived classes
* are what acceptances they access from the handlers, how they put them
* together, & how they estimate the uncertainty factor.
*/
class signalCalculator
{
public:
signalCalculator( signalDefinitionSet const* const signalDefinitions );
signalCalculator();
// the version without any argument is used for reallyWrongCalculator.
virtual
~signalCalculator();
/* actually, this doesn't work, for various reasons. currently C++ does not
* allow virtual static functions. I was only going to use it to force me
* to remember to write the appropriate static functions in derived classes
* anyway.
*/
/*virtual static
signalCalculator*
getCalculator( std::string const* const argumentString,
signalDefinitionSet const* const signalDefinitions )
= 0;*/
/* this should be over-written in each derived class to construct a new
* instance of the derived class based on arguments, & return a pointer to
* the new instance of the derived class, or NULL if the string could not
* be parsed as a correct key for the derived class.
*/
virtual bool
calculateValue( double* signalValue,
double* uncertaintyFactor );
/* this calculates the event rate for the signal & puts its value in
* signalValue, & puts an estimate for the uncertainty into
* uncertaintyFactor, & returns true if it did all this successfully.
*
* by default, this calls goThroughCascadesNormally( signalValue,
* uncertaintyFactor )
* which calls valueForCurrentCascades(...) for each pair of cascades.
* it is expected that valueForCurrentCascades(...) for each derived class
* - checks the cross-section times BRs for the cascade pair - if it's high
* enough, it proceeds
* - checks the lepton acceptances for the cascade pair - if they're high
* enough in combination with the BRs & the cross-section, it proceeds
* - obtains its jet acceptance from its kinematics table, checks
* cross-section * BRs * acceptances, & if high enough, returns the
* product, or 0.0 otherwise.
*/
void
setSignalName( std::string const& signalName );
protected:
static bool
parseBeamEnergy( std::string& argumentString,
signalDefinitionSet* const signalDefinitions );
/* this looks for "_7TeV", "_07TeV", "_10TeV", or "_14TeV", removes it from
* argumentString & sets the beam energy appropriately. returns false if it
* could not find any (& does not modify argumentString in this case).
*/
static leptonAcceptanceForCascadePair*
parseLeptonAcceptance( std::string& argumentString,
signalDefinitionSet* const signalDefinitions );
/* this looks for strings encoding the type of lepton cuts to use. the
* strings are, where # stands for any string representing an integer, in
* the order in which they are checked:
* "_ossf" : ossfMinusOsdf
* "_sssf" : sameSignSameFlavor
* "_noExtraCut" : noLeptonCutNorExtraJetCut
* "_#l" : chargeAndFlavorSummed
* "_#lm#lp" : flavorSummed
* "_#epm#mpm" : chargeSummed
* "_#em#ep#mm#mp" : fullySpecified
* parseLeptonTransverseMomentumCuts is then called on the remainder of
* argumentString. finally, it creates a new leptonAcceptanceForCascadePair
* & returns a pointer to it. NULL is returned if argumentString could not
* be properly interpretted.
*/
static bool
separateOutIntegerSubstring( int& destinationInt,
std::string& argumentString );
/* this checks if argumentString begins with a numeric character,
* & if so destinationInt is set to the value of the int made from the
* unbroken sequences of numeric characters from the start of
* argumentString up to the first non-numeric character, & these characters
* are removed from the start of argumentString, & true is returned.
* otherwise argumentString is left as it is & false is returned.
*/
static bool
separateOutDecimalSubstring( double& destinationDouble,
std::string& argumentString );
/* this uses separateOutIntegerSubstring to check if argumentString begins
* with a numeric character or '.'. destinationDouble is then set to be
* equal to the int that separateOutIntegerSubstring found (or 0 if
* argumentString begins with '.'), & then if there is an int after the '.'
* (if there is a '.'), that becomes the part of destinationDouble after
* the decimal point.
*/
static bool
parseLeptonTransverseMomentumCuts( std::string& argumentString,
signalDefinitionSet* const signalDefinitions );
/* this looks for "_pTl" then a double then "GeV", then a subsequent
* double, & a subsequent "GeV", interpretted as the primary & secondary
* lepton cuts respectively. it returns true if there is nothing more in
* argumentString, false otherwise.
*/
static bool
findAndRemoveSubstring( std::string const& soughtSubstring,
std::string& searchedString );
/* this removes soughtSubstring from searchedString if found as a
* substring, & returns true. if it is not found, searchedString is left
* untouched & false is returned.
*/
std::string signalName;
signalDefinitionSet const* const signalDefinitions;
inputHandler const* const inputShortcut;
std::vector< productionChannelPointerSet* > productionChannels;
std::vector< fullCascade* >* firstCascades;
std::vector< fullCascade* >* secondCascades;
std::list< int > excludedFinalStateParticles;
double firstCascadeBrToEwino;
double secondCascadeBrToEwino;
signedParticleShortcutPair const* initialPair;
bool firstSparticleIsNotAntiparticle;
bool secondSparticleIsNotAntiparticle;
double subchannelCrossSectionTimesBrToEwinos;
virtual double
valueForCurrentCascades( fullCascade* firstCascade,
fullCascade* secondCascade )
= 0;
/* this function should assume that firstCascadeBrToEwino,
* secondCascadeBrToEwino, initialPair, firstSparticleIsNotAntiparticle,
* secondCascadeBrToEwino, & subchannelCrossSectionTimesBrToEwinos have all
* been set correctly.
* it is expected that valueForCurrentCascades(...) for each derived class
* - checks the cross-section times BRs for the cascade pair - if it's high
* enough, it proceeds
* - checks the lepton acceptances for the cascade pair - if they're high
* enough in combination with the BRs & the cross-section, it proceeds
* - obtains its jet acceptance from its kinematics table, checks
* cross-section * BRs * acceptances, & if high enough, returns the
* product, or 0.0 otherwise.
*/
bool
goThroughCascadesNormally( double* signalValue,
double* uncertaintyFactor );
// this calls valueForCurrentCascades(...) for each pair of cascades for
// each production channel.
};
namespace signalClasses
{
/* this is a derived class which just always returns
* CppSLHA::CppSLHA_global::really_wrong_value as its value. it is used for
* malformed signal names.
*/
class reallyWrongCalculator : public signalCalculator
{
public:
reallyWrongCalculator();
virtual
~reallyWrongCalculator();
bool
calculateValue( double* signalValue,
double* uncertaintyFactor );
// this always returns false, & always sets signalValue &
// uncertaintyFactor to CppSLHA::CppSLHA_global::really_wrong_value.
protected:
virtual double
valueForCurrentCascades( fullCascade* firstCascade,
fullCascade* secondCascade );
// this shouldn't be called.
};
/* this is a derived class to test whether I break down the production
* channels & recombine them correctly. all acceptances are set to 1.0 so
* that I should just recover the total cross-section.
*/
class sigmaBreakdownTest : public signalCalculator
{
public:
static signalCalculator*
getCalculator( std::string const& argumentString,
signalDefinitionSet* const signalDefinitions );
/* this either returns a pointer to a new sigmaBreakdownTest with cuts
* decided by the given string, or NULL if the string could not be parsed
* properly.
*/
~sigmaBreakdownTest();
bool
calculateValue( double* const signalValue,
double* const uncertaintyFactor );
// this over-rides the base version because it does things a bit
// differently in a few of the steps.
protected:
double channelBrTotal;
sigmaBreakdownTest( signalDefinitionSet const* const signalDefinitions );
virtual double
valueForCurrentCascades( fullCascade* firstCascade,
fullCascade* secondCascade );
// this shouldn't be called.
};
/* this is a derived class to calculateValue the "Atlas 4 jets plus missing
* transverse momentum plus some lepton cut" signal.
* it takes the kinematics from the Atlas4jMET grid & combines them with
* cascade decays leading to however many leptons passing whichever cut.
*/
class atlasFourJetMetPlusGivenLeptonCuts : public signalCalculator
{
public:
static int const jetAcceptanceGridTableColumn;
// this is dependent on the format of the grids.
static double const defaultExtraJetCut;
// this is the standard cut for the jets beyond the hardest cut for this
// signal as implemented in this code.
static double const defaultPrimaryLeptonCut;
static double const defaultSecondaryLeptonCut;
// the default Atlas lepton transverse momentum cuts are 20.0 GeV
// (for a single lepton to *pass*) & 10.0 GeV (for all others to *fail*).
static signalCalculator*
getCalculator( std::string const& argumentString,
signalDefinitionSet* const signalDefinitions );
/* this either returns a pointer to a new
* atlasFourJetMetPlusGivenLeptonCuts with cuts decided by the given
* string, or NULL if the string could not be parsed properly.
*/
~atlasFourJetMetPlusGivenLeptonCuts();
protected:
leptonAcceptanceForCascadePair const* const leptonAcceptanceCalculator;
jetAcceptanceTable* fourJetKinematics;
jetAcceptanceTable* threeJetKinematics;
jetAcceptanceTable* twoJetKinematics;
/* the 4-jet signal is complicated enough that we also consider only 3 of
* the 4 required hard jets coming from (showered) decays to
* electroweakinos, with the 4th coming from a cascade decay of the
* electroweakinos. hence we need an extra kinematics set (though it is
* only used for direct jet acceptance). we also consider only 2 of the 4
* hard jets coming from the decays to electroweakinos & the other 2
* coming from the decays of the electroweakinos.
*/
double fourJetAcceptance;
double threeJetAcceptance;
// these are used as each pairing of cascades from each production
// channel is calculated:
double subchannelValue;
double subchannelZeroOrMoreJets;
double subchannelOneOrMoreJets;
double subchannelTwoOrMoreJets;
atlasFourJetMetPlusGivenLeptonCuts(
signalDefinitionSet const* const signalDefinitions,
leptonAcceptanceForCascadePair const* const leptonAcceptanceCalculator );
virtual double
valueForCurrentCascades( fullCascade* firstCascade,
fullCascade* secondCascade );
// see base version's description.
};
/* this is a derived class to calculateValue the "Atlas 3 jets plus missing
* transverse momentum plus some lepton cut" signal.
* it takes the kinematics from the Atlas3jMET grid & combines them with
* cascade decays leading to however many leptons passing whichever cut.
*/
class atlasThreeJetMetPlusGivenLeptonCuts : public signalCalculator
{
public:
static int const jetAcceptanceGridTableColumn;
// this is dependent on the format of the grids.
static double const defaultExtraJetCut;
// this is the standard cut for the jets beyond the hardest cut for this
// signal as implemented in this code.
static double const defaultPrimaryLeptonCut;
static double const defaultSecondaryLeptonCut;
// the default Atlas lepton transverse momentum cuts are 20.0 GeV
// (for a single lepton to *pass*) & 10.0 GeV (for all others to *fail*).
static signalCalculator*
getCalculator( std::string const& argumentString,
signalDefinitionSet* const signalDefinitions );
/* this either returns a pointer to a new
* atlasThreeJetMetPlusGivenLeptonCuts with cuts decided by the given
* string, or NULL if the string could not be parsed properly.
*/
~atlasThreeJetMetPlusGivenLeptonCuts();
protected:
leptonAcceptanceForCascadePair const* const leptonAcceptanceCalculator;
jetAcceptanceTable* threeJetKinematics;
jetAcceptanceTable* twoJetKinematics;
/* the 3-jet signal is complicated enough that we also consider only 2 of
* the 3 required hard jets coming from (showered) decays to
* electroweakinos, with the 3rd coming from a cascade decay of the
* electroweakinos. hence we need an extra kinematics set (though it is
* only used for direct jet acceptance).
*/
double threeJetAcceptance;
// these are used as each pairing of cascades from each production
// channel is calculated:
double subchannelValue;
double subchannelZeroOrMoreJets;
double subchannelOneOrMoreJets;
atlasThreeJetMetPlusGivenLeptonCuts(
signalDefinitionSet const* const signalDefinitions,
leptonAcceptanceForCascadePair const* const leptonAcceptanceCalculator );
virtual double
valueForCurrentCascades( fullCascade* firstCascade,
fullCascade* secondCascade );
// see base version's description.
};
/* this is a derived class to calculateValue the "CMS 2 jets plus missing
* transverse momentum indirectly through the alpha_T variable plus some
* lepton cut" signal.
* it takes the kinematics from the CMS2jalphaT grid & combines them with
* cascade decays leading to however many leptons passing whichever cut.
*/
class cmsAlphaTPlusGivenLeptonCuts : public signalCalculator
{
public:
static int const jetAcceptanceGridTableColumn;
// this is dependent on the format of the grids.
static double const defaultPrimaryLeptonCut;
static double const defaultSecondaryLeptonCut;
// the default CMS lepton transverse momentum cuts are 20.0 GeV
// (for a single lepton to *pass*) & 10.0 GeV (for all others to *fail*).
static signalCalculator*
getCalculator( std::string const& argumentString,
signalDefinitionSet* const signalDefinitions );
/* this either returns a pointer to a new
* atlasThreeJetMetPlusGivenLeptonCuts with cuts decided by the given
* string, or NULL if the string could not be parsed properly.
*/
~cmsAlphaTPlusGivenLeptonCuts();
protected:
leptonAcceptanceForCascadePair const* const leptonAcceptanceCalculator;
jetAcceptanceTable* twoJetKinematics;
// these are used as each pairing of cascades from each production
// channel is calculated:
double subchannelValue;
double subchannelZeroOrMoreJets;
double twoJetAcceptance;
cmsAlphaTPlusGivenLeptonCuts(
signalDefinitionSet const* const signalDefinitions,
leptonAcceptanceForCascadePair const* const leptonAcceptanceCalculator );
virtual double
valueForCurrentCascades( fullCascade* firstCascade,
fullCascade* secondCascade );
// see base version's description.
};
/* this is a derived class to calculateValue the "no cut on jets or missing
* transverse momentum, but some lepton cut" signal.
* it only takes cascade decays leading to however many leptons passing
* whichever cut.
*/
class noJetMetButGivenLeptonCuts : public signalCalculator
{
public:
static double const defaultPrimaryLeptonCut;
static double const defaultSecondaryLeptonCut;
// the default Atlas lepton transverse momentum cuts are 20.0 GeV
// (for a single lepton to *pass*) & 10.0 GeV (for all others to *fail*).
static signalCalculator*
getCalculator( std::string const& argumentString,
signalDefinitionSet* const signalDefinitions );
/* this either returns a pointer to a new noJetMetButGivenLeptonCuts with
* cuts decided by the given string, or NULL if the string could not be
* parsed properly.
*/
~noJetMetButGivenLeptonCuts();
protected:
leptonAcceptanceForCascadePair const* const leptonAcceptanceCalculator;
// these are used as each pairing of cascades from each production
// channel is calculated:
double subchannelValue;
noJetMetButGivenLeptonCuts(
signalDefinitionSet const* const signalDefinitions,
leptonAcceptanceForCascadePair const* const leptonAcceptanceCalculator );
virtual double
valueForCurrentCascades( fullCascade* firstCascade,
fullCascade* secondCascade );
// see base version's description.
};
} // end of signalClasses namespace.
// this class calculates how much cross-section has been ignored by
// considering only 1- or 2-step electroweak decays.
class ignoredCrossSectionCalculator : public getsReadiedForNewPoint
{
public:
ignoredCrossSectionCalculator(
signalDefinitionSet const* const signalDefinitions );
~ignoredCrossSectionCalculator();
double
getIgnoredCrossSection();
protected:
inputHandler const* const inputShortcut;
std::vector< productionChannelPointerSet* > productionChannels;
double currentIgnoredCrossSection;
std::vector< fullCascade* >* firstCascades;
std::vector< fullCascade* >* secondCascades;
std::list< int > excludedFinalStateParticles;
double firstCascadeBrToEwino;
double secondCascadeBrToEwino;
CppSLHA::particle_decay_set_handler const* currentEwinoDecays;
std::list< int > const neutralinoOneCodeList;
std::list< int > soughtDecayProductList;
std::list< int > excludedSmParticles;
std::map< particlePointer, double > ignoredEwinoBrs;
double currentIgnoredBr;
void
resetIgnoredEwinoBrs();
double
ignoredBrFromEwino( fullCascade* cascadeOfEwino );
double
getEwinoToLspBrThrough( particlePointer intermediateSlepton );
};
// this class returns pointers to appropriate ignoredCrossSectionCalculator
// instances for the beam energy of signalDefinitions.
class ignoredCrossSectionCalculatorSet
{
public:
ignoredCrossSectionCalculatorSet();
~ignoredCrossSectionCalculatorSet();
ignoredCrossSectionCalculator*
getIgnoredCrossSectionCalculator(
signalDefinitionSet const* const signalDefinitions );
protected:
std::map< int, ignoredCrossSectionCalculator* > ignoredCrossSections;
std::map< int, ignoredCrossSectionCalculator* >::iterator mapIterator;
};
/* this is a class to handle each individual signal to be calculated.
* it accesses numbers common to different signals through the
* crossSectionHandler, kinematicsHandler & cascadeHandler classes.
* it takes a string encoding what it should calculate, & constructs a
* signalCalculator object to actually calculate the signal with the
* given handlers. it also takes care of updating the signal & storing its
* value & estimated uncertainty.
*/
class signalHandler : public getsReadiedForNewPoint
{
public:
typedef signalCalculator* (*signalCalculatorCreator)( std::string const&,
signalDefinitionSet* const );
signalHandler( std::string const signalName,
double const crossSectionUnitFactor,
signalDefinitionSet const* const signalDefinitions,
ignoredCrossSectionCalculatorSet* ignoredCrossSectionSet,
bool const complainAboutBadSignalNames = true );
~signalHandler();
std::string const*
getName()
const;
double
getValue();
double
getUpperUncertainty();
double
getLowerUncertainty();
double
getUpperValue();
double
getLowerValue();
double
getLogUncertainty();
bool
isGood() const { return isGoodFlag; }
protected:
std::string signalName;
signalCalculator* rateCalculator;
signalShortcuts const* const inputShortcut;
signalDefinitionSet signalPreparationDefinitions;
ignoredCrossSectionCalculator* ignoredCrossSection;
double signalValue;
double uncertaintyFactor;
double crossSectionUnitFactor;
// this is to allow for the user to specify event rates in fb, pb or nb.
bool isGoodFlag;
};
// inline functions:
inline double
leptonAcceptanceForCascadePair::withAtLeastNJets(
signalDefinitionSet const* const signalDefinitions,
int const minimumNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const
{
double returnValue( 0.0 );
for( int numberOfJets( minimumNumberOfJets );
maximumNumberOfJets >= numberOfJets;
++numberOfJets )
{
returnValue += withExactlyNJets( signalDefinitions,
numberOfJets,
firstCascade,
firstIsNotAntiparticle,
secondCascade,
secondIsNotAntiparticle );
}
return returnValue;
}
namespace leptonAcceptanceStyle
{
inline double
noLeptonCutNorExtraJetCut::withExactlyNJets(
signalDefinitionSet const* const signalDefinitions,
int const exactNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const
{
return 1.0;
}
inline double
noLeptonCutNorExtraJetCut::withAtLeastNJets(
signalDefinitionSet const* const signalDefinitions,
int const minimumNumberOfJets,
fullCascade* const firstCascade,
bool const firstIsNotAntiparticle,
fullCascade* const secondCascade,
bool const secondIsNotAntiparticle ) const
{
return 1.0;
}
} // end of leptonAcceptanceStyle namespace
inline bool
signalCalculator::calculateValue( double* signalValue,
double* uncertaintyFactor )
/* this calculates the event rate for the signal & puts its value in
* signalValue, & puts an estimate for the uncertainty into
* uncertaintyFactor, & returns true if it did all this successfully.
*
* by default, this calls goThroughCascadesNormally( signalValue,
* uncertaintyFactor )
* which calls valueForCurrentCascades(...) for each pair of cascades.
* it is expected that valueForCurrentCascades(...) for each derived class
* - checks the cross-section times BRs for the cascade pair - if it's high
* enough, it proceeds
* - checks the lepton acceptances for the cascade pair - if they're high
* enough in combination with the BRs & the cross-section, it proceeds
* - obtains its jet acceptance from its kinematics table, checks
* cross-section * BRs * acceptances, & if high enough, returns the
* product, or 0.0 otherwise.
*/
{
return goThroughCascadesNormally( signalValue,
uncertaintyFactor );
}
inline void
signalCalculator::setSignalName( std::string const& signalName )
{
this->signalName.assign( signalName );
}
inline double
ignoredCrossSectionCalculator::ignoredBrFromEwino(
fullCascade* cascadeOfEwino )
{
// debugging:
/**std::cout << std::endl << "debugging:"
<< std::endl
<< "ignoredCrossSectionCalculator::ignoredBrFromEwino( " << cascadeOfEwino
<< " => "
<< *(cascadeOfEwino->getElectroweakinoAtEndOfScoloredness()->get_name())
<< " ) returning "
<< ignoredEwinoBrs[
cascadeOfEwino->getElectroweakinoAtEndOfScoloredness() ];
std::cout << std::endl;**/
return
ignoredEwinoBrs[ cascadeOfEwino->getElectroweakinoAtEndOfScoloredness() ];
}
inline double
ignoredCrossSectionCalculator::getEwinoToLspBrThrough(
particlePointer intermediateSlepton )
{
soughtDecayProductList.front() = intermediateSlepton->get_PDG_code();
double returnValue( currentEwinoDecays->get_branching_ratio_for_subset(
&soughtDecayProductList,
&excludedSmParticles ) );
soughtDecayProductList.front() = -soughtDecayProductList.front();
returnValue += currentEwinoDecays->get_branching_ratio_for_subset(
&soughtDecayProductList,
&excludedSmParticles );
return ( returnValue * intermediateSlepton->inspect_direct_decay_handler(
)->get_branching_ratio_for_subset(
&neutralinoOneCodeList,
&excludedSmParticles ) );
}
inline ignoredCrossSectionCalculator*
ignoredCrossSectionCalculatorSet::getIgnoredCrossSectionCalculator(
signalDefinitionSet const* const signalDefinitions )
{
mapIterator
= ignoredCrossSections.find( signalDefinitions->getBeamEnergy() );
if( ignoredCrossSections.end() == mapIterator )
{
mapIterator = ignoredCrossSections.insert(
std::pair< int, ignoredCrossSectionCalculator* >(
signalDefinitions->getBeamEnergy(),
new ignoredCrossSectionCalculator(
signalDefinitions ) ) ).first;
}
return mapIterator->second;
}
inline std::string const*
signalHandler::getName()
const
{
return &signalName;
}
inline double
signalHandler::getValue()
{
// if the signal has not been calculated for this point, update
// signalValue before returning it:
if( needsToPrepareForThisPoint() )
{
rateCalculator->calculateValue( &signalValue,
&uncertaintyFactor );