Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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>
13 changes: 9 additions & 4 deletions 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 @@ -236,11 +241,11 @@ void CSCSimHitMatcher::fitHitsInChamber(unsigned int detid, float& intercept, fl
return;

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");
TF1 fit("fit", "pol1", -3, 4);
gr->Fit(&fit, "EMQN");

intercept = fit->GetParameter(0);
slope = fit->GetParameter(1);
intercept = fit.GetParameter(0);
slope = fit.GetParameter(1);
}

float CSCSimHitMatcher::simHitsMeanStrip(const edm::PSimHitContainer& sim_hits) const {
Expand Down