|
|
#include <MuonAnalysis/MomentumScaleCalibration/plugins/TestCorrection.cc>
|
| TestCorrection (const edm::ParameterSet &) |
|
| TestCorrection (const edm::ParameterSet &) |
|
| ~TestCorrection () |
|
| ~TestCorrection () override |
|
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
|
| EDAnalyzer () |
|
SerialTaskQueue * | globalLuminosityBlocksQueue () |
|
SerialTaskQueue * | globalRunsQueue () |
|
ModuleDescription const & | moduleDescription () const |
|
std::string | workerType () const |
|
| ~EDAnalyzer () override |
|
std::vector< ConsumesInfo > | consumesInfo () const |
|
void | convertCurrentProcessAlias (std::string const &processName) |
| Convert "@currentProcess" in InputTag process names to the actual current process name. More...
|
|
| EDConsumerBase () |
|
| EDConsumerBase (EDConsumerBase &&)=default |
|
| EDConsumerBase (EDConsumerBase const &)=delete |
|
ESProxyIndex const * | esGetTokenIndices (edm::Transition iTrans) const |
|
ProductResolverIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
|
void | itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
void | itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
std::vector< ProductResolverIndexAndSkipBit > const & | itemsToGetFrom (BranchType iType) const |
|
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
|
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
|
EDConsumerBase & | operator= (EDConsumerBase &&)=default |
|
EDConsumerBase const & | operator= (EDConsumerBase const &)=delete |
|
bool | registeredToConsume (ProductResolverIndex, bool, BranchType) const |
|
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
|
ProductResolverIndexAndSkipBit | uncheckedIndexFrom (EDGetToken) const |
|
void | updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet) |
|
void | updateLookup (eventsetup::ESRecordsToProxyIndices const &) |
|
virtual | ~EDConsumerBase () noexcept(false) |
|
|
typedef EDAnalyzer | ModuleType |
|
typedef ProductLabels | Labels |
|
static const std::string & | baseType () |
|
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
|
static void | prevalidate (ConfigurationDescriptions &) |
|
static bool | wantsGlobalLuminosityBlocks () |
|
static bool | wantsGlobalRuns () |
|
static bool | wantsStreamLuminosityBlocks () |
|
static bool | wantsStreamRuns () |
|
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
|
ConsumesCollector | consumesCollector () |
| Use a ConsumesCollector to gather consumes information from helper functions. More...
|
|
template<typename ProductType , BranchType B = InEvent> |
void | consumesMany () |
|
void | consumesMany (const TypeToGet &id) |
|
template<BranchType B> |
void | consumesMany (const TypeToGet &id) |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes () |
|
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event> |
auto | esConsumes (ESInputTag const &tag) |
|
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
|
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 60 of file TestCorrection.cc.
◆ TestCorrection() [1/2]
Definition at line 139 of file TestCorrection.cc.
152 uncorrectedPt_ =
new TH1F(
"uncorrectedPt",
"uncorrected pt", 1000, 0, 100);
153 uncorrectedPtVsEta_ =
new TProfile(
"uncorrectedPtVsEta",
"uncorrected pt vs eta", 1000, 0, 100, -3., 3.);
154 correctedPt_ =
new TH1F(
"correctedPt",
"corrected pt", 1000, 0, 100);
155 correctedPtVsEta_ =
new TProfile(
"correctedPtVsEta",
"corrected pt vs eta", 1000, 0, 100, -3., 3.);
References background_, correctedPt_, correctedPtVsEta_, corrector_, gather_cfg::cout, eventCounter_, MuScleFitBase::fillHistoMap(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), download_sqlite_cfg::outputFile, MuScleFitUtils::parResol, MuScleFitUtils::resfind, resolution_, MuScleFitUtils::resolutionFunction, MuScleFitUtils::resolutionFunctionForVec, resolutionFunctionVecService(), AlCaHLTBitMon_QueryRunRegistry::string, MuScleFitBase::theFiles_, MuScleFitBase::theRootFileName_, uncorrectedPt_, and uncorrectedPtVsEta_.
◆ ~TestCorrection() [1/2]
TestCorrection::~TestCorrection |
( |
| ) |
|
|
override |
Definition at line 172 of file TestCorrection.cc.
174 TCanvas
canvas(
"ptComparison",
"pt comparison", 1000, 800);
178 TLegend*
legend =
new TLegend(0.7, 0.71, 0.98, 1.);
179 legend->SetTextSize(0.02);
References svgfig::canvas(), correctedPt_, correctedPtVsEta_, gather_cfg::cout, eventCounter_, listHistos::legend, MuScleFitBase::theFiles_, uncorrectedPt_, uncorrectedPtVsEta_, and MuScleFitBase::writeHistoMap().
◆ TestCorrection() [2/2]
◆ ~TestCorrection() [2/2]
TestCorrection::~TestCorrection |
( |
| ) |
|
◆ analyze() [1/2]
◆ analyze() [2/2]
Implements edm::EDAnalyzer.
Definition at line 204 of file TestCorrection.cc.
217 std::vector<MuScleFitMuon>
muons;
261 if ((
std::abs(recMu1.eta()) < 2.5) && (recMu1.pt() > 2.5)) {
262 mapHisto_[
"hRecBestMu_Acc"]->Fill(recMu1);
265 if ((
std::abs(recMu2.eta()) < 2.5) && (recMu2.pt() > 2.5)) {
266 mapHisto_[
"hRecBestMu_Acc"]->Fill(recMu2);
268 mapHisto_[
"hDeltaRecBestMu"]->Fill(recMu1, recMu2);
270 mapHisto_[
"hRecBestRes"]->Fill(bestRecRes);
271 if ((
std::abs(recMu1.eta()) < 2.5) && (recMu1.pt() > 2.5) && (
std::abs(recMu2.eta()) < 2.5) &&
272 (recMu2.pt() > 2.5)) {
273 mapHisto_[
"hRecBestRes_Acc"]->Fill(bestRecRes);
275 mapHisto_[
"hRecBestResVSMu"]->Fill(recMu1, bestRecRes, -1);
276 mapHisto_[
"hRecBestResVSMu"]->Fill(recMu2, bestRecRes, +1);
281 std::vector<MuScleFitMuon>::const_iterator recMuon =
muons.begin();
283 for (; recMuon !=
muons.end(); ++recMuon, ++muonCount) {
289 std::cout <<
"correcting muon[" << muonCount <<
"] with pt = " << recMuon->pt() << std::endl;
290 double corrPt = (*corrector_)(*recMuon);
291 std::cout <<
"to pt = " << corrPt << std::endl;
References funct::abs(), correctedPt_, correctedPtVsEta_, correctMuon(), gather_cfg::cout, eventCounter_, fillMuonCollection(), MuScleFitUtils::findBestRecoRes(), glbMuonsToken_, iEvent, initialize(), MuScleFitBase::mapHisto_, PDWG_BPHSkim_cff::muons, MuScleFitUtils::ResFound, saMuonsToken_, MuScleFitUtils::SavedPair, MuScleFitBase::theMuonType_, PDWG_EXOHSCP_cff::tracks, tracksToken_, uncorrectedPt_, and uncorrectedPtVsEta_.
◆ correctMuon() [1/2]
◆ correctMuon() [2/2]
◆ endJob() [1/2]
virtual void TestCorrection::endJob |
( |
void |
| ) |
|
|
inlineprivatevirtual |
◆ endJob() [2/2]
void TestCorrection::endJob |
( |
void |
| ) |
|
|
inlineoverrideprivatevirtual |
◆ fillMuonCollection() [1/2]
template<typename T >
std::vector<MuScleFitMuon> TestCorrection::fillMuonCollection |
( |
const std::vector< T > & |
tracks | ) |
|
|
inlineprivate |
◆ fillMuonCollection() [2/2]
template<typename T >
std::vector<MuScleFitMuon> TestCorrection::fillMuonCollection |
( |
const std::vector< T > & |
tracks | ) |
|
|
inlineprivate |
Definition at line 71 of file TestCorrection.h.
73 std::vector<MuScleFitMuon>
muons;
74 typename std::vector<T>::const_iterator
track;
80 Double_t hitsTk(0), hitsMuon(0), ptError(0);
81 if (
const reco::Muon* myMu = dynamic_cast<const reco::Muon*>(&(*
track)) ){
82 hitsTk = myMu->innerTrack()->hitPattern().numberOfValidTrackerHits();
83 hitsMuon = myMu->innerTrack()->hitPattern().numberOfValidMuonHits();
84 ptError = myMu->innerTrack()->ptError();
86 else if (
const pat::Muon* myMu = dynamic_cast<const pat::Muon*>(&(*
track)) ) {
87 hitsTk = myMu->innerTrack()->hitPattern().numberOfValidTrackerHits();
88 hitsMuon = myMu->innerTrack()->hitPattern().numberOfValidMuonHits();
89 ptError = myMu->innerTrack()->ptError();
91 else if (
const reco::Track* myMu = dynamic_cast<const reco::Track*>(&(*
track))){
92 hitsTk = myMu->hitPattern().numberOfValidTrackerHits();
93 hitsMuon = myMu->hitPattern().numberOfValidMuonHits();
94 ptError = myMu->ptError();
100 std::cout<<
"[TestCorrection::fillMuonCollection] after MuScleFitMuon initialization"<<std::endl;
References gather_cfg::cout, MuScleFitBase::debug_, amptDefaultParameters_cff::mu, HLT_2018_cff::muon, PDWG_BPHSkim_cff::muons, mathSSE::sqrt(), HLT_2018_cff::track, and PDWG_EXOHSCP_cff::tracks.
◆ initialize() [1/2]
◆ initialize() [2/2]
◆ background_
◆ correctedPt_
TH1F * TestCorrection::correctedPt_ |
|
private |
◆ correctedPtVsEta_
TProfile * TestCorrection::correctedPtVsEta_ |
|
private |
◆ corrector_
◆ eventCounter_
int TestCorrection::eventCounter_ |
|
private |
◆ glbMuonsToken_
◆ resolution_
◆ saMuonsToken_
◆ tracksToken_
◆ uncorrectedPt_
TH1F * TestCorrection::uncorrectedPt_ |
|
private |
◆ uncorrectedPtVsEta_
TProfile * TestCorrection::uncorrectedPtVsEta_ |
|
private |
std::unique_ptr< MomentumScaleCorrector > corrector_
static std::pair< MuScleFitMuon, MuScleFitMuon > findBestRecoRes(const std::vector< MuScleFitMuon > &muons)
TProfile * uncorrectedPtVsEta_
virtual void initialize(const edm::EventSetup &)
edm::EDGetTokenT< reco::TrackCollection > saMuonsToken_
std::unique_ptr< ResolutionFunction > resolution_
T getUntrackedParameter(std::string const &, T const &) const
Analysis-level muon class.
void readProbabilityDistributionsFromFile()
Read probability distributions from a local root file.
static std::vector< int > resfind
math::XYZTLorentzVector LorentzVector
Lorentz vector.
resolutionFunctionBase< std::vector< double > > * resolutionFunctionVecService(const int identifier)
Service to build the resolution functor corresponding to the passed identifier when receiving a std::...
std::vector< TFile * > theFiles_
The files were the histograms are saved.
static std::vector< double > parResol
std::vector< MuScleFitMuon > fillMuonCollection(const std::vector< T > &tracks)
edm::InputTag theMuonLabel_
static resolutionFunctionBase< std::vector< double > > * resolutionFunctionForVec
std::string theRootFileName_
reco::Particle::LorentzVector lorentzVector
edm::EDGetTokenT< reco::MuonCollection > glbMuonsToken_
void fillHistoMap(TFile *outputFile, unsigned int iLoop)
Create the histograms map.
MuScleFitBase(const edm::ParameterSet &iConfig)
TProfile * correctedPtVsEta_
lorentzVector correctMuon(const lorentzVector &muon)
static std::vector< std::pair< lorentzVector, lorentzVector > > SavedPair
edm::EDGetTokenT< reco::TrackCollection > tracksToken_
T getParameter(std::string const &) const
static lorentzVector fromPtEtaPhiToPxPyPz(const double *ptEtaPhiE)
Abs< T >::type abs(const T &t)
std::map< std::string, Histograms * > mapHisto_
The map of histograms.
static resolutionFunctionBase< double * > * resolutionFunction
std::unique_ptr< BackgroundFunction > background_
void writeHistoMap(const unsigned int iLoop)
Save the histograms map to file.