9 for (
const auto& vec : inputVectors){
30 for (
const auto& vec : inputVectors){
42 for (
const auto& vec : inputVectors){
57 double phi = 0, eIn =-1., eOut=-1.;
58 for(
unsigned int i=0;
i<numberOfSteps; ++
i){
61 double cosphi = TMath::Cos(phi);
62 double sinphi = TMath::Sin(phi);
65 sum+=
TMath::Abs(cosphi*vec.x()+sinphi*vec.y());
67 if( eOut<0. || sum<eOut ) eOut=sum;
68 if( eIn <0. || sum>eIn ) eIn =sum;
70 return (eIn-eOut)/eIn;
81 area+=TMath::Sqrt(vec.x()*vec.x()+vec.y()*vec.y());
83 for(
unsigned int i=0;
i<numberOfSteps; ++
i){
86 double cosphi = TMath::Cos(
phi);
87 double sinphi = TMath::Sin(
phi);
88 for(
const auto& vec: inputVectors_){
89 sum+=
TMath::Abs(cosphi*vec.x()+sinphi*vec.y());
92 if( circularity<0 || tmp<circularity ){
123 TMatrixDSym momentumTensor(3);
124 momentumTensor.Zero();
129 double p2 = vec.Dot(vec);
130 double pR = (
r_ == 2. ) ? p2 : TMath::Power(p2, 0.5*
r_);
132 double pRminus2 = (
r_ == 2. ) ? 1. : TMath::Power(p2, 0.5*
r_ - 1.);
133 momentumTensor(0,0) += pRminus2*vec.x()*vec.x();
134 momentumTensor(0,1) += pRminus2*vec.x()*vec.y();
135 momentumTensor(0,2) += pRminus2*vec.x()*vec.z();
136 momentumTensor(1,0) += pRminus2*vec.y()*vec.x();
137 momentumTensor(1,1) += pRminus2*vec.y()*vec.y();
138 momentumTensor(1,2) += pRminus2*vec.y()*vec.z();
139 momentumTensor(2,0) += pRminus2*vec.z()*vec.x();
140 momentumTensor(2,1) += pRminus2*vec.z()*vec.y();
141 momentumTensor(2,2) += pRminus2*vec.z()*vec.z();
144 if( momentumTensor.IsSymmetric() && ( momentumTensor.NonZeros() != 0 ) ){
152 momentumTensor *= (1./norm);
155 if( momentumTensor.IsSymmetric() && ( momentumTensor.NonZeros() != 0 ) ){
233 double esum_total(0.) ;
237 double esum_total_sq = esum_total * esum_total ;
242 if ( p_i <= 0 ) continue ;
244 for (
unsigned int j = 0 ; j <=
i ; j ++ ) {
247 if ( p_j <= 0 ) continue ;
251 int symmetry_factor = 2;
252 if( j ==
i ) symmetry_factor = 1;
253 double p_ij = p_i * p_j;
255 double pi_pj_over_etot2 = p_ij / esum_total_sq ;
264 Pn2 = pi_pj_over_etot2;
265 fwmom_[0] += Pn2*symmetry_factor;
268 Pn1 = pi_pj_over_etot2 * cosTheta;
269 fwmom_[1] += Pn1*symmetry_factor;
272 double Pn = ((2*
n-1)*cosTheta*Pn1 - (
n-1)*Pn2)/
n;
273 fwmom_[
n] += Pn*symmetry_factor;
std::vector< double > eigenValuesNoNorm_
double circularity(const unsigned int &numberOfSteps=1000) const
TVectorD eigenValuesNoNormTmp_
void setFWmax(unsigned m)
set number of Fox-Wolfram moments to compute
std::vector< double > eigenValues_
double r_
caching of output
EventShapeVariables(const edm::View< reco::Candidate > &inputVectors)
constructor from reco::Candidates
const std::vector< double > & getFWmoments()
double getFWmoment(unsigned l)
std::vector< math::XYZVector > inputVectors_
caching of input vectors
unsigned fwmom_maxl_
Owen ; save computed Fox-Wolfram moments.
XYZVectorD XYZVector
spatial vector with cartesian internal representation
void set_r(double r)
set exponent for computation of momentum tensor and related products
void compTensorsAndVectors()
double isotropy(const unsigned int &numberOfSteps=1000) const
std::vector< std::vector< double > > tmp
std::vector< double > fwmom_