29 TFile* regressionFile = TFile::Open(regressionFileName.c_str());
32 std::cout<<
"ERROR: Cannot open regression file "<<regressionFileName<<
"\n";
41 std::cout<<
"ERROR: Cannot find forest "<<bdtName<<
" in "<<regressionFileName<<
"\n";
42 regressionFile->Close();
45 regressionFile->Close();
64 std::cout<<
"ERROR: The combination tool is not initialized\n";
68 float energy = mySimpleElectron.getNewEnergy();
69 float energyError = mySimpleElectron.getNewEnergyError();
70 float momentum = mySimpleElectron.getTrackerMomentum();
71 float momentumError = mySimpleElectron.getTrackerMomentumError();
72 int electronClass = mySimpleElectron.getElClass();
73 bool isEcalDriven = mySimpleElectron.isEcalDriven();
74 bool isTrackerDriven = mySimpleElectron.isTrackerDriven();
75 bool isEB = mySimpleElectron.isEB();
78 float energyRelError = energyError /
energy;
79 float momentumRelError = momentumError / momentum;
80 float errorRatio = energyRelError / momentumRelError;
83 float eOverP = energy / momentum;
84 float eOverPerror =
sqrt(
85 (energyError/momentum)*(energyError/momentum) +
86 (energy*momentumError/momentum/momentum)*
87 (energy*momentumError/momentum/momentum));
90 float regressionInputs[11];
91 regressionInputs[0] =
energy;
92 regressionInputs[1] = energyRelError;
93 regressionInputs[2] = momentum;
94 regressionInputs[3] = momentumRelError;
95 regressionInputs[4] = errorRatio;
96 regressionInputs[5] = eOverP;
97 regressionInputs[6] = eOverPerror;
98 regressionInputs[7] =
static_cast<float>(isEcalDriven);
99 regressionInputs[8] =
static_cast<float>(isTrackerDriven);
100 regressionInputs[9] =
static_cast<float>(electronClass);
101 regressionInputs[10] =
static_cast<float>(isEB);
106 &&fabs(momentum-energy)<15.*
sqrt(momentumError*momentumError + energyError*energyError)
107 &&((momentumError < 10.*momentum) || (energy < 200.))
110 weight = m_forest->GetResponse(regressionInputs);
111 if(weight>1.) weight = 1.;
112 else if(weight<0.) weight = 0.;
115 float combinedMomentum = weight*momentum + (1.-
weight)*energy;
116 float combinedMomentumError =
sqrt(weight*weight*momentumError*momentumError + (1.-weight)*(1.-weight)*energyError*energyError);
120 if(momentumError!=999. || weight==0.)
122 mySimpleElectron.setCombinedMomentum(combinedMomentum);
123 mySimpleElectron.setCombinedMomentumError(combinedMomentumError);
volatile std::atomic< bool > shutdown_flag false
float energyError(float E, float *par)