EDAnalyzer to exercise and demonstrate usage of Calibratable tree. More...
#include <CalibratableTest.h>
Public Member Functions | |
CalibratableTest (const edm::ParameterSet &) | |
template<class T > | |
void | getCollection (edm::Handle< T > &c, const edm::InputTag &tag, const edm::Event &event) const |
~CalibratableTest () | |
Public Member Functions inherited from edm::EDAnalyzer | |
EDAnalyzer () | |
std::string | workerType () const |
virtual | ~EDAnalyzer () |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginJob () |
double | deltaR (const double &eta1, const double &eta2, const double &phi1, const double &phi2) |
virtual void | endJob () |
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::EDAnalyzer | |
typedef EDAnalyzer | ModuleType |
typedef WorkerT< EDAnalyzer > | WorkerType |
Static Public Member Functions inherited from edm::EDAnalyzer | |
static const std::string & | baseType () |
static void | fillDescriptions (ConfigurationDescriptions &descriptions) |
static void | prevalidate (ConfigurationDescriptions &) |
Protected Member Functions inherited from edm::EDAnalyzer | |
CurrentProcessingContext const * | currentContext () const |
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 28 of file CalibratableTest.cc.
References calib_, gather_cfg::cout, debug_, deltaRCandToSim_, fileservice_, edm::ParameterSet::getParameter(), inputTagCandidates_, inputTagClustersEcal_, inputTagClustersHcal_, inputTagSimParticles_, TFileDirectory::make(), and tree_.
CalibratableTest::~CalibratableTest | ( | ) |
Definition at line 47 of file CalibratableTest.cc.
|
privatevirtual |
Implements edm::EDAnalyzer.
Definition at line 57 of file CalibratableTest.cc.
References calib_, 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().
|
privatevirtual |
Reimplemented from edm::EDAnalyzer.
Definition at line 51 of file CalibratableTest.cc.
References gather_cfg::cout, and debug_.
|
private |
Definition at line 305 of file CalibratableTest.cc.
References HLTFastRecoForTau_cff::deltaEta, SiPixelRawToDigiRegional_cfi::deltaPhi, M_PI, funct::pow(), and mathSSE::sqrt().
Referenced by findCandidatesInDeltaR().
|
privatevirtual |
Reimplemented from edm::EDAnalyzer.
Definition at line 291 of file CalibratableTest.cc.
References gather_cfg::cout, debug_, nEventFails_, nEventWrites_, nParticleFails_, and nParticleWrites_.
|
private |
Definition at line 171 of file CalibratableTest.cc.
References createPayload::block, calib_, pftools::Calibratable::cands_, pftools::Calibratable::cluster_ecal_, pftools::Calibratable::cluster_hcal_, gather_cfg::cout, debug_, ECAL, reco::PFBlock::elements(), asciidump::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 274 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 247 of file CalibratableTest.cc.
References deltaR(), reco::LeafCandidate::eta(), getHLTprescales::index, reco::LeafCandidate::phi(), reco::PFTrajectoryPoint::positionREP(), and reco::PFTrack::trajectoryPoint().
Referenced by analyze().
|
private |
Definition at line 149 of file CalibratableTest.cc.
References abs, reco::PFSimParticle::daughterIds(), getHLTprescales::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().