Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Validation/MuonHits/BuildFile.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<use name="SimDataFormats/Vertex"/>
<use name="root"/>
<use name="clhep"/>
<use name="rootminuit"/>
<export>
<lib name="1"/>
</export>
7 changes: 6 additions & 1 deletion Validation/MuonHits/src/CSCSimHitMatcher.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "Validation/MuonHits/interface/CSCSimHitMatcher.h"
#include "TGraphErrors.h"
#include "TF1.h"
#include "TMinuitMinimizer.h"

using namespace std;

Expand All @@ -13,6 +14,10 @@ CSCSimHitMatcher::CSCSimHitMatcher(const edm::ParameterSet& ps, edm::ConsumesCol

simHitInput_ = iC.consumes<edm::PSimHitContainer>(simHitPSet_.getParameter<edm::InputTag>("inputTag"));
geomToken_ = iC.esConsumes<CSCGeometry, MuonGeometryRecord>();

//In order to make fitting ROOT histograms thread safe
// one must call this undocumented function
TMinuitMinimizer::UseStaticMinuit(false);
}

/// initialize the event
Expand Down Expand Up @@ -237,7 +242,7 @@ void CSCSimHitMatcher::fitHitsInChamber(unsigned int detid, float& intercept, fl

std::unique_ptr<TGraphErrors> gr(new TGraphErrors(x.size(), &x[0], &y[0], &xe[0], &ye[0]));
std::unique_ptr<TF1> fit(new TF1("fit", "pol1", -3, 4));
gr->Fit("fit", "EMQ");
gr->Fit("fit", "EMQN");

intercept = fit->GetParameter(0);
slope = fit->GetParameter(1);
Expand Down