stablejet is hosted by Hepforge, IPPP Durham
StableJet
TransverseFuzzinessCalculator.h
1 //
2 // This code calculates an overall "fuzzinness"
3 // of the event given the matrix which defines
4 // probabilities of particle assignments to jets.
5 //
6 
7 #ifndef TransverseFuzzinessCalculator_h
8 #define TransverseFuzzinessCalculator_h
9 
10 #include "AbsFuzzinessCalculator.h"
11 
12 namespace stab {
14  {
15  public:
16  //
17  // Flags which modify the code behavior have the following
18  // meaning:
19  //
20  // divideTotalFuzzinessByNJets : if true, the total event
21  // fuzziness will be divided by the number of jets in
22  // the event.
23  //
24  // divideFuzzinessByPtSum : if true, the contribution
25  // of each jet into the overall event fuzziness will be
26  // weighted by the jet Pt.
27  //
28  // addInQuadrature : if true, fuzziness values
29  // for individual jets will be combined in quadrature in
30  // order to form the event fuzziness (otherwise they are
31  // combined linearly).
32  //
33  // It does not make much sense to set true both
34  // "divideTotalFuzzinessByNJets" and "divideFuzzinessByPtSum".
35  //
36  inline TransverseFuzzinessCalculator(bool divideTotalFuzzinessByNJets,
37  bool divideFuzzinessByPtSum,
38  bool addInQuadrature)
39  : divideByNjets_(divideTotalFuzzinessByNJets),
40  divideByPt_(divideFuzzinessByPtSum) ,
41  addInQuadrature_(addInQuadrature){}
42 
43  inline virtual ~TransverseFuzzinessCalculator() {}
44 
45  // Inspectors
46  inline bool divideByNjets() const {return divideByNjets_;}
47  inline bool divideByPt() const {return divideByPt_;}
48 
49  // "initialParticles" and "finalJets" are the collections
50  // of particles and jets in the event of interest.
51  //
52  // "weights" is the left-stochastic matrix of weights,
53  // dimensioned nJets x nParts. The order of rows/columns
54  // should correspond to the order of jets/particles
55  // in the relevant input collection.
56  //
57  // The overall event jet fuzzinness is returned. Fuzzinness
58  // values for individual jets are calculated according to
59  // the generalized multinomial distribution assumption. They
60  // are placed into the "jetFuzziness" array on exit. The
61  // length of this array (provided as "lenJetFuzziness"
62  // argument) should be equal to or larger than the number
63  // of jets.
64  //
65  double calculate(const Event &initialParticles,
66  const Event &finalJets,
67  const double *weights,
68  unsigned nJets, unsigned nParts,
69  bool lastFinalJetIsUnclustered,
70  double *jetFuzziness, unsigned lenJetFuzziness) const;
71  private:
72  virtual void singleJetFuzziness(
73  const double *ptValues, const double *weights, unsigned len,
74  double* thisJetFuzzines, double* eventFuzzinesContribution) const;
75 
76  mutable std::vector<double> ptStorage_;
77  bool divideByNjets_;
78  bool divideByPt_;
79  bool addInQuadrature_;
80  };
81 }
82 
83 #endif // TransverseFuzzinessCalculator_h