10#include <ecl/dataobjects/ECLShower.h>
13#include <gtest/gtest.h>
38 EXPECT_EQ(myECLShower.
getTheta(), 0);
39 EXPECT_EQ(myECLShower.
getPhi(), 0);
40 EXPECT_EQ(myECLShower.
getR(), 0);
44 EXPECT_EQ(myECLShower.
getTime(), 0);
56 EXPECT_EQ(myECLShower.
getE1oE9(), 0);
61 EXPECT_EQ(errorArray[0], 0);
62 EXPECT_EQ(errorArray[1], 0);
63 EXPECT_EQ(errorArray[2], 0);
64 EXPECT_EQ(errorArray[3], 0);
65 EXPECT_EQ(errorArray[4], 0);
66 EXPECT_EQ(errorArray[5], 0);
68 ROOT::Math::XYZVector momentum(myECLShower.
getMomentum());
69 EXPECT_EQ(momentum.X(), 0);
70 EXPECT_EQ(momentum.Y(), 0);
71 EXPECT_EQ(momentum.Z(), 0);
77 const bool isTrk =
true;
80 const int showerId = 6;
81 const int connectedRegionId = 7;
82 const int hypothesisId = 8;
84 const double energy = 1.1;
85 const double theta = 1.2;
86 const double phi = 1.3;
88 double error[6] = {2.1, 2.2, 2.3, 2.4, 2.5, 2.6};
89 const double time = 1.5;
90 const double timeResolution = 1.6;
91 const double highestEnergy = 1.7;
92 const double lateralEnergy = 1.8;
93 const double minTrkDistance = 1.9;
94 const double trkDepth = 4.1;
95 const double showerDepth = 3.1;
96 const double NofCrystals = 3.2;
97 const double absZernike40 = 1.1;
98 const double absZernike51 = 0.1;
99 const double zernikeMVA = 0.5;
100 const double secondMoment = 5.1;
101 const double E1oE9 = 3.8;
102 const double E9oE21 = 3.9;
131 EXPECT_EQ(myECLShower.
getStatus(), status);
135 EXPECT_EQ(myECLShower.
getEnergy(), energy);
136 EXPECT_EQ(myECLShower.
getTheta(), theta);
137 EXPECT_EQ(myECLShower.
getPhi(), phi);
141 EXPECT_EQ(myECLShower.
getTime(), time);
155 EXPECT_EQ(myECLShower.
getE1oE9(), E1oE9);
156 EXPECT_EQ(myECLShower.
getE9oE21(), E9oE21);
159 double errorArray[6];
161 EXPECT_EQ(errorArray[0], error[0]);
162 EXPECT_EQ(errorArray[1], error[1]);
163 EXPECT_EQ(errorArray[2], error[2]);
164 EXPECT_EQ(errorArray[3], error[3]);
165 EXPECT_EQ(errorArray[4], error[4]);
166 EXPECT_EQ(errorArray[5], error[5]);
168 ROOT::Math::XYZVector momentum(myECLShower.
getMomentum());
169 EXPECT_FLOAT_EQ(momentum.X(), energy * sin(theta) * cos(phi));
170 EXPECT_FLOAT_EQ(momentum.Y(), energy * sin(theta) * sin(phi));
171 EXPECT_FLOAT_EQ(momentum.Z(), energy * cos(theta));
Set up a few arrays and objects in the datastore.
Class to store ECL Showers.
int getStatus() const
Get Status.
void setE9oE21(double E9oE21)
Set energy ration E9 over E21.
void setLateralEnergy(double lateralEnergy)
Set Lateral Energy.
void setShowerId(int ShowerId)
Set Shower ID.
double getAbsZernikeMoment(unsigned int n, unsigned int m) const
Get absolute value of Zernike Moment nm.
void setEnergy(double Energy)
Set Energy.
void setPhi(double Phi)
Set Phi (rad)
int getHypothesisId() const
Get Hypothesis Id.
void setConnectedRegionId(int connectedRegionId)
Set Connected region ID.
void setNumberOfCrystals(double nofCrystals)
Set sum of weights of crystals.
void setEnergyHighestCrystal(double HighestEnergy)
Set Highest Energy.
double getPhi() const
Get Phi.
double getLateralEnergy() const
Get Lateral Energy in Shower.
double getE1oE9() const
Get energy ratio E1oE9.
void setShowerDepth(double showerDepth)
Set path on the average cluster direction.
int getShowerId() const
Get Shower Id.
double getEnergy() const
Get Energy.
void getCovarianceMatrixAsArray(double covArray[6]) const
Get Error Array for Energy->[0], Phi->[2], Theta->[5].
void setSecondMoment(double secondMoment)
Set second moment.
double getShowerDepth() const
path on track extrapolation to POCA to average cluster direction
void setCovarianceMatrix(double covArray[6])
Set symmetric Error Array(3x3) for [0]->Error on Energy [2]->Error on Phi [5]->Error on Theta.
int getConnectedRegionId() const
Get Connected region Id.
double getR() const
Get R.
void setHypothesisId(int hypothesisId)
Set Hypothesis identifier.
void setTheta(double Theta)
Set Theta (rad)
double getUncertaintyTheta() const
Get Error of theta.
void setIsTrack(bool val)
Set Match with Track.
double getE9oE21() const
Get energy ratio E9oE21.
void setTrkDepth(double trkDepth)
Set path on track extrapolation line to POCA to average cluster direction.
void setAbsZernikeMoment(unsigned int n, unsigned int m, double absZernikeMoment)
Set absolute value of Zernike Moment nm, for nm between 10 and 55.
void setR(double R)
Set R.
void setDeltaTime99(double TimeReso)
Set Time Resolution.
double getUncertaintyEnergy() const
Get Error of Energy.
ROOT::Math::XYZVector getMomentum() const
The method to get return ROOT::Math::XYZVector Momentum.
double getTrkDepth() const
path on track extrapolation to POCA to average cluster direction
double getMinTrkDistance() const
Get distance to closest Track.
double getNumberOfCrystals() const
Get NofCrystals.
double getEnergyHighestCrystal() const
Get Highest Energy in Shower.
double getZernikeMVA() const
Get Zernike MVA.
bool getIsTrack() const
Get if matched with a Track.
double getUncertaintyPhi() const
Get Error of phi.
void setTime(double Time)
Set Time.
void setE1oE9(double E1oE9)
Set energy ration E1 over E9.
void setStatus(int Status)
Set Status.
double getSecondMoment() const
Get second moment.
void setZernikeMVA(double zernikeMVA)
SetZernike MVA value.
double getTheta() const
Get Theta.
double getDeltaTime99() const
Get Time Resolution.
void setMinTrkDistance(double dist)
Set Distance to closest track.
double getTime() const
Get Time.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.