forked from cms-sw/cmssw
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request cms-sw#25 from bendavid/WmassNanoProd_10_6_26_trac…
…krefit_v709 Update track fits for nano production (v709)
- Loading branch information
Showing
27 changed files
with
8,616 additions
and
21,854 deletions.
There are no files selected for viewing
3,282 changes: 0 additions & 3,282 deletions
3,282
Analysis/HitAnalyzer/plugins/ResidualGlobalCorrectionMaker.cc
This file was deleted.
Oops, something went wrong.
6,077 changes: 2,270 additions & 3,807 deletions
6,077
Analysis/HitAnalyzer/plugins/ResidualGlobalCorrectionMakerBase.cc
Large diffs are not rendered by default.
Oops, something went wrong.
254 changes: 111 additions & 143 deletions
254
Analysis/HitAnalyzer/plugins/ResidualGlobalCorrectionMakerBase.h
Large diffs are not rendered by default.
Oops, something went wrong.
4,099 changes: 1,529 additions & 2,570 deletions
4,099
Analysis/HitAnalyzer/plugins/ResidualGlobalCorrectionMakerG4e.cc
Large diffs are not rendered by default.
Oops, something went wrong.
2,430 changes: 0 additions & 2,430 deletions
2,430
Analysis/HitAnalyzer/plugins/ResidualGlobalCorrectionMakerSim.cc
This file was deleted.
Oops, something went wrong.
2,459 changes: 0 additions & 2,459 deletions
2,459
Analysis/HitAnalyzer/plugins/ResidualGlobalCorrectionMakerSimG4e.cc
This file was deleted.
Oops, something went wrong.
2,320 changes: 0 additions & 2,320 deletions
2,320
Analysis/HitAnalyzer/plugins/ResidualGlobalCorrectionMakerTwoTrack.cc
This file was deleted.
Oops, something went wrong.
1,650 changes: 685 additions & 965 deletions
1,650
Analysis/HitAnalyzer/plugins/ResidualGlobalCorrectionMakerTwoTrackG4e.cc
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
92 changes: 92 additions & 0 deletions
92
MagneticField/ParametrizedEngine/src/PolyFit3DParametrizedMagneticField.cc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
/** \file | ||
* | ||
* \author N. Amapane | ||
*/ | ||
|
||
#include "PolyFit3DParametrizedMagneticField.h" | ||
#include <FWCore/ParameterSet/interface/ParameterSet.h> | ||
#include <FWCore/MessageLogger/interface/MessageLogger.h> | ||
|
||
#include "BFit3D.h" | ||
|
||
|
||
using namespace std; | ||
using namespace magfieldparam; | ||
|
||
PolyFit3DParametrizedMagneticField::PolyFit3DParametrizedMagneticField(double bVal) : | ||
theParam(new BFit3D()) | ||
{ | ||
theParam->SetField(bVal); | ||
} | ||
|
||
|
||
PolyFit3DParametrizedMagneticField::PolyFit3DParametrizedMagneticField(const edm::ParameterSet& parameters) : theParam(new BFit3D()) { | ||
theParam->SetField(parameters.getParameter<double>("BValue")); | ||
|
||
// Additional options (documentation by Vassili): | ||
|
||
// By default, the package accepts signed value of "r". That means, | ||
// one can cross r=0 and orientation of the coordinate "orts" | ||
// e_r and e_phi will not be flipped over. | ||
// In other words for an r<0 the e_r points inward, in the direction r=0. | ||
// This is a "natural" mode. However, the default behavior may be | ||
// changed by the call | ||
|
||
// theParam->UseSignedRad(false); | ||
|
||
// In that case with crossing of r=0 e_r and e_phi will be flipped in | ||
// such a way that e_r always points outward. In other words instead of | ||
// (r<0, phi) the (abs(r), phi+PI) will be used in this mode. | ||
|
||
// The expansion coefficients for a nominal field in between measurement | ||
// field values (2.0T, 3.5T, 3.8T and 4.0T) by default are calculated by | ||
// means of a linear piecewise interpolation. Another provided | ||
// interpolation mode is cubic spline. This mode can be switched | ||
// on by the call: | ||
|
||
// theParam->UseSpline(true); | ||
|
||
// From practical point of view the use of spline interpolation doesn't | ||
// change much, but it makes the coefficients' behavior a bit more | ||
// physical at very low/high field values. | ||
} | ||
|
||
|
||
PolyFit3DParametrizedMagneticField::~PolyFit3DParametrizedMagneticField() { | ||
delete theParam; | ||
} | ||
|
||
|
||
GlobalVector | ||
PolyFit3DParametrizedMagneticField::inTesla(const GlobalPoint& gp) const { | ||
|
||
if (isDefined(gp)) { | ||
return inTeslaUnchecked(gp); | ||
} else { | ||
edm::LogWarning("MagneticField|FieldOutsideValidity") << " Point " << gp << " is outside the validity region of PolyFit3DParametrizedMagneticField"; | ||
return GlobalVector(); | ||
} | ||
} | ||
|
||
GlobalVector | ||
PolyFit3DParametrizedMagneticField::inTeslaUnchecked(const GlobalPoint& gp) const { | ||
double Br, Bz, Bphi; | ||
theParam->GetField(gp.perp()/100., gp.z()/100., gp.phi(), | ||
Br, Bz, Bphi); | ||
|
||
double cosphi = cos(gp.phi()); | ||
double sinphi = sin(gp.phi()); | ||
|
||
return GlobalVector(Br*cosphi - Bphi*sinphi, | ||
Br*sinphi + Bphi*cosphi, | ||
Bz); | ||
} | ||
|
||
bool | ||
PolyFit3DParametrizedMagneticField::isDefined(const GlobalPoint& gp) const { | ||
double z = fabs(gp.z()); | ||
double r = gp.perp(); | ||
//"rectangle" |z|<3.5, r<1.9 _except_ the "corners" |z|+2.5*r>6.7, everything in meters | ||
if (z>350. || r>190 || z+2.5*r>670.) return false; | ||
return true; | ||
} |
40 changes: 40 additions & 0 deletions
40
MagneticField/ParametrizedEngine/src/PolyFit3DParametrizedMagneticField.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#ifndef PolyFit3DParametrizedMagneticField_h | ||
#define PolyFit3DParametrizedMagneticField_h | ||
|
||
/** \class PolyFit3DParametrizedMagneticField | ||
* | ||
* Magnetic Field engine wrapper for V. Maroussov's 3D parametrization | ||
* of the MT data. | ||
* | ||
* \author N. Amapane | ||
*/ | ||
|
||
#include "MagneticField/Engine/interface/MagneticField.h" | ||
|
||
namespace edm { class ParameterSet; } | ||
namespace magfieldparam { class BFit3D; } | ||
|
||
|
||
class PolyFit3DParametrizedMagneticField : public MagneticField { | ||
public: | ||
/// Constructor. Fitted bVal for the nominal currents are: | ||
/// 2.0216; 3.5162; 3.8114; 4.01242188708911 | ||
PolyFit3DParametrizedMagneticField(double bVal = 3.8114); | ||
|
||
/// Constructor. Parameters taken from a PSet | ||
PolyFit3DParametrizedMagneticField(const edm::ParameterSet& parameters); | ||
|
||
/// Destructor | ||
virtual ~PolyFit3DParametrizedMagneticField(); | ||
|
||
GlobalVector inTesla (const GlobalPoint& gp) const; | ||
|
||
GlobalVector inTeslaUnchecked (const GlobalPoint& gp) const; | ||
|
||
bool isDefined(const GlobalPoint& gp) const; | ||
|
||
private: | ||
magfieldparam::BFit3D* theParam; | ||
}; | ||
#endif | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.