EDAnalyzer to exercise and demonstrate usage of Calibratable tree. More...
#include <CalibratableTest.h>
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) override |
virtual void | beginJob () override |
double | deltaR (const double &eta1, const double &eta2, const double &phi1, const double &phi2) |
virtual void | endJob () override |
void | extractCandidate (const reco::PFCandidate &cand) |
virtual void | fillTreeAndReset () |
std::vector< unsigned > | findCandidatesInDeltaR (const reco::PFSimParticle &pft, const std::vector< reco::PFCandidate > &cands, const double &deltaR) |
std::vector< unsigned > | findPrimarySimParticles (const std::vector< reco::PFSimParticle > &sims) |
Private Attributes | |
pftools::Calibratable * | calib_ |
edm::Handle< reco::PFClusterCollection > * | clustersEcal_ |
edm::Handle< reco::PFClusterCollection > * | clustersHcal_ |
int | debug_ |
double | deltaRCandToSim_ |
edm::Service< TFileService > | fileservice_ |
edm::InputTag | inputTagCandidates_ |
edm::InputTag | inputTagClustersEcal_ |
edm::InputTag | inputTagClustersHcal_ |
edm::InputTag | inputTagSimParticles_ |
unsigned | nEventFails_ |
unsigned | nEventWrites_ |
unsigned | nParticleFails_ |
unsigned | nParticleWrites_ |
edm::Handle< reco::PFCandidateCollection > * | pfCandidates_ |
edm::Handle< reco::PFSimParticleCollection > * | simParticles_ |
bool | thisEventPasses_ |
bool | thisParticlePasses_ |
TTree * | tree_ |
Additional Inherited Members | |
Public Types inherited from edm::one::EDAnalyzerBase | |
typedef EDAnalyzerBase | ModuleType |
Public Types inherited from edm::EDConsumerBase | |
typedef ProductLabels | Labels |
Static Public Member Functions inherited from edm::one::EDAnalyzerBase | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &descriptions) |
Protected Member Functions inherited from edm::EDConsumerBase | |
template<typename ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
EDGetToken | consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent> | |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
template<BranchType B> | |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
EDAnalyzer to exercise and demonstrate usage of Calibratable tree.
OBJECTIVE: this analyzer will create a tree of PFClusterTools/Calibratable instances. Each entry of the tree represents particle flow information relating to one pion in a multi-pion event. The use of monte carlo is assumed as sim particle information is extracted too.
USAGE: This is an analyzer, not a producer: the tree it produces is stored in a seperate ROOT file using the CMSSW TFileService.
Consult test/CalibratableTest_FastSim.py for a sample CMSSW configuration. Run the example from that directory with, cmsRun CalibratableTest_FastSim.py This will produce a file with a tree inside. Browse the contents in bare root with a TBrowser.
NOTE: This analyzer does not exercise the complete functionality of the Calibratable class. For instance, tracks and rechits are not stored. Contact me (the author) for more details, and for an analyzer that we use to extract particle information to calibrate the particle flow algorithm. A MUCH more involved example from my private analysis is to be found in, UserCode/JamieBallin/interface/DipionDelegate.h
General details about the usage of Calibratable may be found at, https://twiki.cern.ch/twiki/bin/view/CMS/PFClusterToolsPackage
Definition at line 57 of file CalibratableTest.h.
|
explicit |
Definition at line 24 of file CalibratableTest.cc.
References calib_, gather_cfg::cout, debug_, deltaRCandToSim_, fileservice_, edm::ParameterSet::getParameter(), inputTagCandidates_, inputTagClustersEcal_, inputTagClustersHcal_, inputTagSimParticles_, TFileService::make(), and tree_.
CalibratableTest::~CalibratableTest | ( | ) |
Definition at line 43 of file CalibratableTest.cc.
|
overrideprivatevirtual |
Definition at line 53 of file CalibratableTest.cc.
References calib_, objects.IsoTrackAnalyzer::candidates, clustersEcal_, clustersHcal_, gather_cfg::cout, debug_, deltaRCandToSim_, extractCandidate(), fillTreeAndReset(), findCandidatesInDeltaR(), findPrimarySimParticles(), getCollection(), inputTagCandidates_, inputTagClustersEcal_, inputTagClustersHcal_, inputTagSimParticles_, reco::PFTrajectoryPoint::momentum(), nEventFails_, nEventWrites_, reco::PFTrack::nTrajectoryPoints(), pfCandidates_, reco::PFTrajectoryPoint::positionREP(), pftools::Calibratable::reset(), pftools::Calibratable::sim_energyEvent_, pftools::Calibratable::sim_eta_, pftools::Calibratable::sim_etaEcal_, pftools::Calibratable::sim_etaHcal_, pftools::Calibratable::sim_isMC_, pftools::Calibratable::sim_numEvent_, pftools::Calibratable::sim_phi_, pftools::Calibratable::sim_phiEcal_, pftools::Calibratable::sim_phiHcal_, simParticles_, thisEventPasses_, thisParticlePasses_, and reco::PFTrack::trajectoryPoint().
|
overrideprivatevirtual |
Reimplemented from edm::one::EDAnalyzerBase.
Definition at line 47 of file CalibratableTest.cc.
References gather_cfg::cout, and debug_.
|
private |
Definition at line 301 of file CalibratableTest.cc.
References spr::deltaEta, hiPixelPairStep_cff::deltaPhi, M_PI, funct::pow(), and mathSSE::sqrt().
Referenced by findCandidatesInDeltaR().
|
overrideprivatevirtual |
Reimplemented from edm::one::EDAnalyzerBase.
Definition at line 287 of file CalibratableTest.cc.
References gather_cfg::cout, debug_, nEventFails_, nEventWrites_, nParticleFails_, and nParticleWrites_.
|
private |
Definition at line 167 of file CalibratableTest.cc.
References groupFilesInBlocks::block, calib_, pftools::Calibratable::cands_, pftools::Calibratable::cluster_ecal_, pftools::Calibratable::cluster_hcal_, gather_cfg::cout, edmIntegrityCheck::d, debug_, ECAL, allElectronIsolations_cfi::elements, reco::PFBlock::elements(), reco::PFCluster::energy(), pftools::CandidateWrapper::energy_, pftools::CandidateWrapper::energyEcal_, pftools::CandidateWrapper::energyHcal_, pftools::CandidateWrapper::eta_, HCAL, reco::PFCluster::layer(), pftools::CandidateWrapper::phi_, reco::PFCluster::positionREP(), and pftools::CandidateWrapper::type_.
Referenced by analyze().
|
privatevirtual |
Definition at line 270 of file CalibratableTest.cc.
References calib_, gather_cfg::cout, debug_, nParticleFails_, nParticleWrites_, pftools::Calibratable::recompute(), pftools::Calibratable::reset(), thisEventPasses_, thisParticlePasses_, and tree_.
Referenced by analyze().
|
private |
Definition at line 243 of file CalibratableTest.cc.
References deltaR(), reco::LeafCandidate::eta(), diffTreeTool::index, reco::LeafCandidate::phi(), reco::PFTrajectoryPoint::positionREP(), and reco::PFTrack::trajectoryPoint().
Referenced by analyze().
|
private |
Definition at line 145 of file CalibratableTest.cc.
References funct::abs(), reco::PFSimParticle::daughterIds(), diffTreeTool::index, reco::PFSimParticle::motherId(), and reco::PFSimParticle::pdgCode().
Referenced by analyze().
void CalibratableTest::getCollection | ( | edm::Handle< T > & | c, |
const edm::InputTag & | tag, | ||
const edm::Event & | event | ||
) | const |
Definition at line 147 of file CalibratableTest.h.
References gather_cfg::cout, and edm::HandleBase::isValid().
Referenced by analyze().
|
private |
Definition at line 123 of file CalibratableTest.h.
Referenced by analyze(), CalibratableTest(), extractCandidate(), and fillTreeAndReset().
|
private |
Definition at line 142 of file CalibratableTest.h.
Referenced by analyze().
|
private |
Definition at line 143 of file CalibratableTest.h.
Referenced by analyze().
|
private |
Definition at line 112 of file CalibratableTest.h.
Referenced by analyze(), beginJob(), CalibratableTest(), endJob(), extractCandidate(), and fillTreeAndReset().
|
private |
Definition at line 131 of file CalibratableTest.h.
Referenced by analyze(), and CalibratableTest().
|
private |
Definition at line 109 of file CalibratableTest.h.
Referenced by CalibratableTest().
|
private |
Definition at line 134 of file CalibratableTest.h.
Referenced by analyze(), and CalibratableTest().
|
private |
Definition at line 136 of file CalibratableTest.h.
Referenced by analyze(), and CalibratableTest().
|
private |
Definition at line 137 of file CalibratableTest.h.
Referenced by analyze(), and CalibratableTest().
|
private |
Definition at line 135 of file CalibratableTest.h.
Referenced by analyze(), and CalibratableTest().
|
private |
Definition at line 128 of file CalibratableTest.h.
|
private |
Definition at line 128 of file CalibratableTest.h.
|
private |
Definition at line 127 of file CalibratableTest.h.
Referenced by endJob(), and fillTreeAndReset().
|
private |
Definition at line 127 of file CalibratableTest.h.
Referenced by endJob(), and fillTreeAndReset().
|
private |
Definition at line 140 of file CalibratableTest.h.
Referenced by analyze().
|
private |
Definition at line 141 of file CalibratableTest.h.
Referenced by analyze().
|
private |
Definition at line 116 of file CalibratableTest.h.
Referenced by analyze(), and fillTreeAndReset().
|
private |
Definition at line 120 of file CalibratableTest.h.
Referenced by analyze(), and fillTreeAndReset().
|
private |
Definition at line 106 of file CalibratableTest.h.
Referenced by CalibratableTest(), and fillTreeAndReset().