33 TFile* regressionFile = TFile::Open(regressionFileName.c_str());
36 cout<<
"ERROR: Cannot open regression file "<<regressionFileName<<
"\n";
43 cout<<
"ERROR: Cannot find forest "<<bdtName<<
" in "<<regressionFileName<<
"\n";
44 regressionFile->Close();
47 regressionFile->Close();
59 cout<<
"ERROR: The combination tool is not initialized\n";
67 int electronClass = mySimpleElectron.
getElClass();
70 bool isEB = mySimpleElectron.
isEB();
73 float energyRelError = energyError /
energy;
74 float momentumRelError = momentumError / momentum;
75 float errorRatio = energyRelError / momentumRelError;
78 float eOverP = energy / momentum;
79 float eOverPerror =
sqrt(
80 (energyError/momentum)*(energyError/momentum) +
81 (energy*momentumError/momentum/momentum)*
82 (energy*momentumError/momentum/momentum));
85 float* regressionInputs =
new float[11];
86 regressionInputs[0] =
energy;
87 regressionInputs[1] = energyRelError;
88 regressionInputs[2] = momentum;
89 regressionInputs[3] = momentumRelError;
90 regressionInputs[4] = errorRatio;
91 regressionInputs[5] = eOverP;
92 regressionInputs[6] = eOverPerror;
93 regressionInputs[7] =
static_cast<float>(isEcalDriven);
94 regressionInputs[8] =
static_cast<float>(isTrackerDriven);
95 regressionInputs[9] =
static_cast<float>(electronClass);
96 regressionInputs[10] =
static_cast<float>(isEB);
101 &&fabs(momentum-energy)<15.*
sqrt(momentumError*momentumError + energyError*energyError)
102 &&(!applyExtraHighEnergyProtection || ((momentumError < 10.*momentum) || (energy < 200.)))
106 if(weight>1.) weight = 1.;
107 else if(weight<0.) weight = 0.;
110 float combinedMomentum = weight*momentum + (1.-
weight)*energy;
111 float combinedMomentumError =
sqrt(weight*weight*momentumError*momentumError + (1.-weight)*(1.-weight)*energyError*energyError);
115 if(momentumError!=999. || weight==0.)
121 delete[] regressionInputs;
double GetResponse(const float *vector) const
void setCombinedMomentum(double combinedMomentum)
tuple applyExtraHighEnergyProtection
double getTrackerMomentum()
double getNewEnergyError()
double getTrackerMomentumError()
void setCombinedMomentumError(double combinedMomentumError)
float energyError(float E, float *par)