--- PamCut/CollectionActions/Histo2DActions/RigFillAction/RigFillAction.cpp 2010/03/11 19:11:27 1.1 +++ PamCut/CollectionActions/Histo2DActions/RigFillAction/RigFillAction.cpp 2010/05/11 14:25:56 1.1.2.1 @@ -10,23 +10,21 @@ #include "RigFillAction.h" RigFillAction::RigFillAction(const char *actionName, TString outFileBase, vector &bins, float thresholdCoeff, - float chargeSign, bool spilloverFlag, float spilloverLimit) : - Histo2DAction (actionName, "", outFileBase, "RECREATE", false, true), _thresholdCoeff(thresholdCoeff), - _chargeSign(chargeSign), _spilloverFlag(spilloverFlag), _spilloverLimit(spilloverLimit) { + float chargeSign, bool spilloverFlag, float spilloverLimit, float mdrMin) : + Histo2DAction (actionName, "", outFileBase, "RECREATE", false, true), _thresholdCoeff(thresholdCoeff), + _chargeSign(chargeSign), _spilloverFlag(spilloverFlag), _spilloverLimit(spilloverLimit), _mdrMin(mdrMin) { SetXAxis("Rc [GV]", bins); SetYAxis("R [GV]", bins); - } RigFillAction::RigFillAction(const char *actionName, TString outFileBase, TString rigBinsFile, float thresholdCoeff, - float chargeSign, bool spilloverFlag, float spilloverLimit) : - Histo2DAction (actionName, "", outFileBase, "RECREATE", false, true), _thresholdCoeff(thresholdCoeff), - _chargeSign(chargeSign), _spilloverFlag(spilloverFlag), _spilloverLimit(spilloverLimit) { + float chargeSign, bool spilloverFlag, float spilloverLimit, float mdrMin) : + Histo2DAction (actionName, "", outFileBase, "RECREATE", false, true), _thresholdCoeff(thresholdCoeff), + _chargeSign(chargeSign), _spilloverFlag(spilloverFlag), _spilloverLimit(spilloverLimit), _mdrMin(mdrMin) { SetXAxis("Rc [GV]", rigBinsFile); SetYAxis("R [GV]", rigBinsFile); - } void RigFillAction::OnGood(PamLevel2 *event) { @@ -34,6 +32,15 @@ float rigThreshold = _thresholdCoeff * event->GetOrbitalInfo()->GetCutoffSVL(); float rig = 1. / event->GetTrack(0)->GetTrkTrack()->GetDeflection(); + // Compute deflection correction due to MDR cut + if (_mdrMin > 0.) { + Double_t F = 0.; + if (_mdrMin > 300.) { + F = 2.215e-4 * (log(_mdrMin) - log(300.)); + } + rig = 1. / (1. / rig + F); + } + if (rig / _chargeSign > 0) { // Check if the particle has the right sign Fill(rigThreshold, rig); } @@ -46,7 +53,7 @@ void RigFillAction::Finalize() { // Save the histogram - Histo2DAction::Finalize(); + Histo2DAction::Finalize(); // Save the zero bins if (_outFileBase != "") {