3 #define _USE_MATH_DEFINES
8 using namespace marlin;
13 : Processor(
"AngularCorrection_dEdxProcessor") {
16 _description =
"Correct_AngularCorrection_dEdxProcessor: Makes a hard angular-based correction of dEdx for all the Tracks in the event. ATTENTION: this processor rewrites the MarlinTrk Collection and it is to be used only for simulations produced with ILCSoft from v02 to v02-02-01" ;
18 registerInputCollection(LCIO::TRACK,
20 "LDC track collection name",
22 std::string(
"MarlinTrkTracks"));
24 std::vector<float> _newpar = { 0.970205,
41 registerProcessorParameter(
"AngularCorrectionParameters",
42 "parameter for new angular correction dedx= uncorrected_dedx / f, with f= pol3(lambda)",
51 streamlog_out(DEBUG) <<
" init called " << std::endl ;
64 int nTrkCand =
_LDCCol->getNumberOfElements();
66 for (
int iTRK=0;iTRK<nTrkCand;++iTRK) {
68 TrackImpl * trkCand = (TrackImpl*)
_LDCCol->getElementAt( iTRK );
70 float dedx=trkCand->getdEdx();
71 float dedx_error=trkCand->getdEdxError();
72 float trklambda = trkCand->getTanLambda();
74 float lambda = fabs(atan(trklambda)*180./M_PI);
75 double f3 = 1 / (
_par[0] +
_par[1] * lambda +
_par[2] * pow(lambda,2) +
_par[3] * pow(lambda,3) );
77 double new_dedx = dedx*f3;
79 streamlog_out(DEBUG) <<
"Original dEdx: " <<dedx <<
" Error: "<<dedx_error <<std::endl;
80 streamlog_out(DEBUG) <<
"NeW dEdx: " <<new_dedx <<
" Error: "<<dedx_error <<std::endl;
83 trkCand->setdEdx(new_dedx);
84 trkCand->setdEdxError(dedx_error);
std::string _LDCTrackCollection
AngularCorrection_dEdxProcessor()
virtual void modifyEvent(LCEvent *evt)
AngularCorrection_dEdxProcessor This processor calculates an extra correction to be applied to the ...
virtual void processRunHeader(LCRunHeader *run)
AngularCorrection_dEdxProcessor aAngularCorrection_dEdxProcessor
std::vector< float > _par
virtual void check(LCEvent *evt)