10 #include <ecl/modules/eclCovarianceMatrix/ECLCovarianceMatrixModule.h>
16 #include <mdst/dataobjects/EventLevelClusteringInfo.h>
19 #include <ecl/dataobjects/ECLShower.h>
34 m_eclShowers(eclShowerArrayName()),
35 m_eventLevelClusteringInfo(eventLevelClusteringInfoName())
38 setDescription(
"ECLCovarianceMatrix: Sets the ECL photon shower covariance matrix.");
65 double background = 0.0;
76 const double energy = eclShower.getEnergy();
80 if (energy > 0.) invEnergy = 1. / energy;
83 double invRoot2Energy = 0;
84 if (energy > 0.) invRoot2Energy = 1. / TMath::Power(energy, 0.5);
87 double invRoot4Energy = 0;
88 if (energy > 0.) invRoot4Energy = 1. / TMath::Power(energy, 0.25);
90 int detregion = eclShower.getDetectorRegion();
91 if (detregion == 11 or detregion == 13) detregion = 2;
93 double sigmaEnergy = 0.;
94 double sigmaTheta = 0.;
98 if (detregion == 1 and background < 0.05) {
99 if (energy <= 0.022) {sigmaEnergy = energy * (0.0449188); }
100 else {sigmaEnergy = energy * (-0.0912379 * invEnergy + 1.91849 * invRoot2Energy + -2.82169 * invRoot4Energy + 3.03119) / 100.;}
101 }
else if (detregion == 1 and background <= 0.3) {
102 if (energy <= 0.022) {sigmaEnergy = energy * (0.100769); }
103 else {sigmaEnergy = energy * (-0.0725928 * invEnergy + 3.4685 * invRoot2Energy + -5.44127 * invRoot4Energy + 4.12045) / 100.;}
104 }
else if (detregion == 1 and background > 0.3) {
105 if (energy <= 0.022) {sigmaEnergy = energy * (0.148462); }
106 else {sigmaEnergy = energy * (-0.239931 * invEnergy + 6.94958 * invRoot2Energy + -10.4085 * invRoot4Energy + 5.92412) / 100.;}
109 if (detregion == 1 and background < 0.05) {
110 if (energy <= 0.0289609) { sigmaTheta = 1e-3 * (6.4008);}
111 else {sigmaTheta = 1e-3 * (-0.110397 * invEnergy + 0.753603 * invRoot2Energy + 2.63652 * invRoot4Energy + -0.606703);}
112 }
else if (detregion == 1 and background <= 0.3) {
113 if (energy <= 0.0274562) { sigmaTheta = 1e-3 * (7.39868);}
114 else {sigmaTheta = 1e-3 * (-0.207278 * invEnergy + 2.68616 * invRoot2Energy + -0.905487 * invRoot4Energy + 0.961485);}
115 }
else if (detregion == 1 and background > 0.3) {
116 if (energy <= 0.022) { sigmaTheta = 1e-3 * (8.83505);}
117 else {sigmaTheta = 1e-3 * (-0.160921 * invEnergy + 2.35311 * invRoot2Energy + -0.107975 * invRoot4Energy + 0.565367);}
120 if (detregion == 1 and background < 0.05) {
121 if (energy <= 0.0391279) {sigmaPhi = 1e-3 * (15.4147);}
122 else {sigmaPhi = 1e-3 * (-0.35934 * invEnergy + 2.01807 * invRoot2Energy + 7.26313 * invRoot4Energy + -1.93438);}
123 }
else if (detregion == 1 and background <= 0.3) {
124 if (energy <= 0.022) {sigmaPhi = 1e-3 * (18.1096);}
125 else {sigmaPhi = 1e-3 * (-0.178258 * invEnergy + 1.39155 * invRoot2Energy + 6.97462 * invRoot4Energy + -1.2795);}
126 }
else if (detregion == 1 and background > 0.3) {
127 if (energy <= 0.0224565) {sigmaPhi = 1e-3 * (20.1605);}
128 else {sigmaPhi = 1e-3 * (-0.344617 * invEnergy + 3.80823 * invRoot2Energy + 4.08729 * invRoot4Energy + -0.464714);}
131 if (detregion == 2 and background < 0.05) {
132 if (energy <= 0.022) {sigmaEnergy = energy * (0.0466552); }
133 else {sigmaEnergy = energy * (-0.0473491 * invEnergy + 1.02015 * invRoot2Energy + -0.705164 * invRoot4Energy + 1.77086) / 100.;}
134 }
else if (detregion == 2 and background <= 0.3) {
135 if (energy <= 0.022) {sigmaEnergy = energy * (0.112299); }
136 else {sigmaEnergy = energy * (0.0469588 * invEnergy + 1.81959 * invRoot2Energy + -2.13666 * invRoot4Energy + 2.37568) / 100.;}
137 }
else if (detregion == 2 and background > 0.3) {
138 if (energy <= 0.022) {sigmaEnergy = energy * (0.164881); }
139 else {sigmaEnergy = energy * (-0.267069 * invEnergy + 7.6176 * invRoot2Energy + -11.0341 * invRoot4Energy + 5.9203) / 100.;}
142 if (detregion == 2 and background < 0.05) {
143 if (energy <= 0.0309077) { sigmaTheta = 1e-3 * (9.31098);}
144 else {sigmaTheta = 1e-3 * (-0.221073 * invEnergy + 2.19876 * invRoot2Energy + 1.50833 * invRoot4Energy + 0.359609);}
145 }
else if (detregion == 2 and background <= 0.3) {
146 if (energy <= 0.022) { sigmaTheta = 1e-3 * (11.6166);}
147 else {sigmaTheta = 1e-3 * (-0.126603 * invEnergy + 1.81898 * invRoot2Energy + 1.85132 * invRoot4Energy + 0.300728);}
148 }
else if (detregion == 2 and background > 0.3) {
149 if (energy <= 0.022) { sigmaTheta = 1e-3 * (13.159);}
150 else {sigmaTheta = 1e-3 * (-0.316561 * invEnergy + 4.94686 * invRoot2Energy + -3.12199 * invRoot4Energy + 2.30275);}
153 if (detregion == 2 and background < 0.05) {
154 if (energy <= 0.0381178) {sigmaPhi = 1e-3 * (10.7661);}
155 else {sigmaPhi = 1e-3 * (-0.21842 * invEnergy + 0.648976 * invRoot2Energy + 7.1901 * invRoot4Energy + -3.10025);}
156 }
else if (detregion == 2 and background <= 0.3) {
157 if (energy <= 0.022237) {sigmaPhi = 1e-3 * (12.6804);}
158 else {sigmaPhi = 1e-3 * (-0.141507 * invEnergy + 0.488293 * invRoot2Energy + 7.30055 * invRoot4Energy + -3.13591);}
159 }
else if (detregion == 2 and background > 0.3) {
160 if (energy <= 0.024905) {sigmaPhi = 1e-3 * (14.8726);}
161 else {sigmaPhi = 1e-3 * (-0.323752 * invEnergy + 3.60933 * invRoot2Energy + 2.48526 * invRoot4Energy + -1.25493);}
164 if (detregion == 3 and background < 0.05) {
165 if (energy <= 0.022) {sigmaEnergy = energy * (0.0466662); }
166 else {sigmaEnergy = energy * (-0.106729 * invEnergy + 2.38163 * invRoot2Energy + -4.11299 * invRoot4Energy + 4.14056) / 100.;}
167 }
else if (detregion == 3 and background <= 0.3) {
168 if (energy <= 0.022) {sigmaEnergy = energy * (0.128851); }
169 else {sigmaEnergy = energy * (-0.204362 * invEnergy + 6.43 * invRoot2Energy + -10.8673 * invRoot4Energy + 7.04059) / 100.;}
170 }
else if (detregion == 3 and background > 0.3) {
171 if (energy <= 0.022) {sigmaEnergy = energy * (0.255153); }
172 else {sigmaEnergy = energy * (-0.316245 * invEnergy + 11.5211 * invRoot2Energy + -18.3626 * invRoot4Energy + 9.89422) / 100.;}
175 if (detregion == 3 and background < 0.05) {
176 if (energy <= 0.0318079) { sigmaTheta = 1e-3 * (10.4446);}
177 else {sigmaTheta = 1e-3 * (-0.295827 * invEnergy + 3.37748 * invRoot2Energy + -0.284446 * invRoot4Energy + 1.48098);}
178 }
else if (detregion == 3 and background <= 0.3) {
179 if (energy <= 0.022) { sigmaTheta = 1e-3 * (13.828);}
180 else {sigmaTheta = 1e-3 * (-0.252479 * invEnergy + 4.18833 * invRoot2Energy + -2.04822 * invRoot4Energy + 2.38486);}
181 }
else if (detregion == 3 and background > 0.3) {
182 if (energy <= 0.022) { sigmaTheta = 1e-3 * (17.0354);}
183 else {sigmaTheta = 1e-3 * (-0.420215 * invEnergy + 7.08904 * invRoot2Energy + -5.88269 * invRoot4Energy + 3.61643);}
186 if (detregion == 3 and background < 0.05) {
187 if (energy <= 0.022) {sigmaPhi = 1e-3 * (15.129);}
188 else {sigmaPhi = 1e-3 * (-0.0534441 * invEnergy + -1.72466 * invRoot2Energy + 12.8625 * invRoot4Energy + -4.21203);}
189 }
else if (detregion == 3 and background <= 0.3) {
190 if (energy <= 0.022) {sigmaPhi = 1e-3 * (20.1408);}
191 else {sigmaPhi = 1e-3 * (0.0869293 * invEnergy + -1.93352 * invRoot2Energy + 12.8105 * invRoot4Energy + -4.03756);}
192 }
else if (detregion == 3 and background > 0.3) {
193 if (energy <= 0.022) {sigmaPhi = 1e-3 * (23.2771);}
194 else {sigmaPhi = 1e-3 * (-0.439611 * invEnergy + 5.74196 * invRoot2Energy + 1.76693 * invRoot4Energy + -0.0407866);}
197 B2DEBUG(175,
"energy=" << energy <<
", detector region=" << detregion);
198 B2DEBUG(175,
"sigmaEnergy=" << sigmaEnergy <<
", sigmaPhi=" << sigmaPhi <<
", sigmaTheta=" << sigmaTheta);
200 double covMatrix[6] = {sigmaEnergy * sigmaEnergy, 0.0, sigmaPhi * sigmaPhi, 0.0, 0.0, sigmaTheta * sigmaTheta};
201 eclShower.setCovarianceMatrix(covMatrix);
const double m_fullBkgdCount
Nominal Background at BGx1.0 (MC12)
StoreArray< ECLShower > m_eclShowers
Store array: ECLShower.
virtual void initialize() override
Initialize.
virtual void event() override
Event.
~ECLCovarianceMatrixModule()
Destructor.
virtual const char * eclShowerArrayName() const
Default name ECLShowers.
virtual void endRun() override
End run.
virtual void terminate() override
Terminate.
ECLCovarianceMatrixModule()
Constructor.
virtual void beginRun() override
Begin run.
virtual const char * eventLevelClusteringInfoName() const
Name to be used for default option: EventLevelClusteringInfo.
StoreObjPtr< EventLevelClusteringInfo > m_eventLevelClusteringInfo
Store object pointer: EventLevelClusteringInfo.
@ c_nPhotons
CR is split into n photons (N1)
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
REG_MODULE(arichBtest)
Register the Module.
Abstract base class for different kinds of events.