Wraps essential single particle calibration data ready for export to a Root file. More...
#include <Calibratable.h>
Wraps essential single particle calibration data ready for export to a Root file.
Note that a Reflex dictionary must be produced for this class, for the Root branching mechanisms to work.
Definition at line 122 of file Calibratable.h.
pftools::Calibratable::Calibratable | ( | ) | [inline] |
virtual pftools::Calibratable::~Calibratable | ( | ) | [inline, virtual] |
Definition at line 129 of file Calibratable.h.
{ }
CalibratableElement Calibratable::computeMean | ( | const std::vector< CalibratableElement > & | diets | ) | [virtual] |
Compute the mean of a vector of CalibratableElements
diets |
Definition at line 138 of file Calibratable.cc.
References pftools::CalibratableElement::energy_, pftools::CalibratableElement::eta_, pftools::CalibratableElement::extent_, pftools::CalibratableElement::phi_, and pftools::CalibratableElement::time_.
Referenced by recompute().
{ CalibratableElement dmean; if (diets.size() == 0) return dmean; for (std::vector<CalibratableElement>::const_iterator cit = diets.begin(); cit != diets.end(); ++cit) { CalibratableElement d = *cit; dmean.energy_ += d.energy_; dmean.eta_ += d.eta_; dmean.phi_ += d.phi_; dmean.extent_ += d.extent_; dmean.time_ += d.time_; } dmean.energy_ /= diets.size(); dmean.eta_ /= diets.size(); dmean.phi_ /= diets.size(); dmean.extent_ /= diets.size(); dmean.time_ /= diets.size(); return dmean; }
CandidateWrapper Calibratable::computeMean | ( | const std::vector< CandidateWrapper > & | wrappers | ) | [virtual] |
Compute the mean of a vector of CandidateWrappers
wrappers |
Definition at line 111 of file Calibratable.cc.
References trackerHits::c, pftools::CandidateWrapper::energy_, pftools::CandidateWrapper::energyEcal_, pftools::CandidateWrapper::energyHcal_, pftools::CandidateWrapper::eta_, pftools::CandidateWrapper::phi_, and pftools::CandidateWrapper::type_.
{ CandidateWrapper cw; if (wrappers.size() == 0) return cw; for (std::vector<CandidateWrapper>::const_iterator it = wrappers.begin(); it != wrappers.end(); ++it) { const CandidateWrapper& c = *it; cw.energy_ += c.energy_; cw.phi_ += c.phi_; cw.eta_ += c.eta_; cw.energyEcal_ += c.energyEcal_; cw.energyHcal_ += c.energyHcal_; cw.type_ += c.type_; } cw.energy_ /= wrappers.size(); cw.phi_ /= wrappers.size(); cw.eta_ /= wrappers.size(); cw.energyEcal_ /= wrappers.size(); cw.energyHcal_ /= wrappers.size(); cw.type_ /= wrappers.size(); return cw; }
void Calibratable::fillCaloWindow | ( | const std::vector< CalibratableElement > & | source, |
CaloWindow & | destination | ||
) | const [virtual] |
Helper method to fill a CaloWindow with CalibratableElement objects You should initialise the CaloWindow first!
source | |
destination |
Definition at line 160 of file Calibratable.cc.
References pftools::CaloWindow::addHit(), gather_cfg::cout, pftools::CalibratableElement::energy_, pftools::CalibratableElement::eta_, convertSQLiteXML::ok, and pftools::CalibratableElement::phi_.
{ std::vector<CalibratableElement>::const_iterator cit = source.begin(); for (; cit != source.end(); ++cit) { const CalibratableElement& ce = *cit; bool ok = destination.addHit(ce.eta_, ce.phi_, ce.energy_); if (!ok) std::cout << __PRETTY_FUNCTION__ << ": couldn't fill CaloWindow with " << ce << "\n"; } }
void Calibratable::recompute | ( | ) | [virtual] |
Definition at line 45 of file Calibratable.cc.
References trackerHits::c, cand_energyEcal_, cand_energyEvent_, cand_energyHcal_, cand_energyNeutralEM_, cand_energyNeutralHad_, cand_eta_, cand_phi_, cand_type_, cands_, cands_mean_, cands_num_, cluster_ecal_, cluster_energyEcal_, cluster_energyEvent_, cluster_energyHcal_, cluster_hcal_, cluster_meanEcal_, cluster_meanHcal_, cluster_numEcal_, cluster_numHcal_, computeMean(), pftools::CandidateWrapper::energy_, pftools::CalibratableElement::energy_, pftools::CandidateWrapper::energyEcal_, pftools::CandidateWrapper::energyHcal_, pftools::CandidateWrapper::eta_, pftools::CandidateWrapper::phi_, rechits_ecal_, rechits_energyEcal_, rechits_energyEvent_, rechits_energyHcal_, rechits_hcal_, rechits_meanEcal_, rechits_meanHcal_, rechits_numEcal_, rechits_numHcal_, pftools::CandidateWrapper::recompute(), python::multivaluedict::sort(), tb_ecal_, tb_energyEcal_, tb_energyEvent_, tb_energyHcal_, tb_hcal_, tb_meanEcal_, tb_meanHcal_, tb_numEcal_, tb_numHcal_, and pftools::CandidateWrapper::type_.
Referenced by pftools::TreeUtility::dumpCaloDataToCSV(), pftools::CalibCompare::evaluateCalibrations(), and CalibratableTest::fillTreeAndReset().
{ cluster_meanEcal_ = computeMean(cluster_ecal_); cluster_meanHcal_ = computeMean(cluster_hcal_); rechits_meanEcal_ = computeMean(rechits_ecal_); rechits_meanHcal_ = computeMean(rechits_hcal_); tb_meanEcal_ = computeMean(tb_ecal_); tb_meanHcal_ = computeMean(tb_hcal_); cluster_numEcal_ = cluster_ecal_.size(); cluster_numHcal_ = cluster_hcal_.size(); rechits_numEcal_ = rechits_ecal_.size(); rechits_numHcal_ = rechits_hcal_.size(); tb_numEcal_ = tb_ecal_.size(); tb_numHcal_ = tb_hcal_.size(); cluster_energyEvent_ = cluster_meanEcal_.energy_ * cluster_ecal_.size() + cluster_meanHcal_.energy_ * cluster_hcal_.size(); cluster_energyEcal_ = cluster_meanEcal_.energy_ * cluster_ecal_.size(); cluster_energyHcal_ = cluster_meanHcal_.energy_ * cluster_hcal_.size(); rechits_energyEvent_ = rechits_meanEcal_.energy_ * rechits_ecal_.size() + rechits_meanHcal_.energy_ * rechits_hcal_.size(); rechits_energyEcal_ = rechits_meanEcal_.energy_ * rechits_ecal_.size(); rechits_energyHcal_ = rechits_meanHcal_.energy_ * rechits_hcal_.size(); tb_energyEvent_ = tb_meanEcal_.energy_ * tb_ecal_.size() + tb_meanHcal_.energy_ * tb_hcal_.size(); tb_energyEcal_ = tb_meanEcal_.energy_ * tb_ecal_.size(); tb_energyHcal_ = tb_meanHcal_.energy_ * tb_hcal_.size(); cands_num_ = cands_.size(); cands_mean_ = computeMean(cands_); cand_energyEvent_ = 0; cand_energyEcal_ = 0; cand_energyHcal_ = 0; cand_energyNeutralEM_ = 0; cand_energyNeutralHad_ = 0; cand_type_ = 0; cand_eta_ = cands_mean_.eta_; cand_phi_ = cands_mean_.phi_; for (std::vector<CandidateWrapper>::iterator it = cands_.begin(); it != cands_.end(); ++it) { CandidateWrapper& c = *it; if (c.type_ == 4) cand_energyNeutralEM_ += c.energy_; if (c.type_ == 5) cand_energyNeutralHad_ += c.energy_; cand_energyEvent_ += c.energy_; cand_energyEcal_ += c.energyEcal_; cand_energyHcal_ += c.energyHcal_; cand_type_ += c.type_; c.recompute(); } std::sort(tb_ecal_.begin(), tb_ecal_.end()); std::sort(tb_hcal_.begin(), tb_hcal_.end()); std::sort(rechits_ecal_.begin(), rechits_ecal_.end()); std::sort(rechits_hcal_.begin(), rechits_hcal_.end()); std::sort(cluster_ecal_.begin(), cluster_ecal_.end()); std::sort(cluster_hcal_.begin(), cluster_hcal_.end()); }
void Calibratable::reset | ( | void | ) | [virtual] |
Call to reset() (useful for TTree users)
Definition at line 172 of file Calibratable.cc.
References calibrations_, calowindow_ecal_, calowindow_hcal_, cand_energyEcal_, cand_energyEvent_, cand_energyHcal_, cand_energyNeutralEM_, cand_energyNeutralHad_, cand_eta_, cand_phi_, cand_type_, cands_, cands_mean_, cands_num_, cluster_ecal_, cluster_energyEcal_, cluster_energyEvent_, cluster_energyHcal_, cluster_hcal_, cluster_meanEcal_, cluster_meanHcal_, cluster_numEcal_, cluster_numHcal_, rechits_ecal_, rechits_energyEcal_, rechits_energyEvent_, rechits_energyHcal_, rechits_hcal_, rechits_meanEcal_, rechits_meanHcal_, rechits_numEcal_, rechits_numHcal_, recotrk_charge_, recotrk_deltaRWithSim_, recotrk_etaEcal_, recotrk_momentum_, recotrk_numHits_, recotrk_phiEcal_, recotrk_quality_, pftools::CaloWindow::reset(), pftools::CalibratableElement::reset(), pftools::CandidateWrapper::reset(), sim_energyEcal_, sim_energyEvent_, sim_energyHcal_, sim_eta_, sim_etaEcal_, sim_etaHcal_, sim_isMC_, sim_numEvent_, sim_phi_, sim_phiEcal_, sim_phiHcal_, tb_ck2_, tb_ck3_, tb_ecal_, tb_energyEcal_, tb_energyEvent_, tb_energyHcal_, tb_eta_, tb_hcal_, tb_isTB_, tb_meanEcal_, tb_meanHcal_, tb_numEcal_, tb_numHcal_, tb_pdg_, tb_phi_, tb_run_, tb_tof_, and tb_vetosPassed_.
Referenced by CalibratableTest::analyze(), Calibratable(), pftools::CalibCompare::evaluateCalibrations(), pftools::Exercises3::evaluateCalibrator(), and CalibratableTest::fillTreeAndReset().
{ calibrations_.clear(); sim_energyEvent_ = 0; sim_energyEcal_ = 0; sim_energyHcal_ = 0; sim_eta_ = 0; sim_phi_ = 0; sim_numEvent_ = 0; sim_isMC_ = false; tb_isTB_ = false; tb_eta_ = 0.0; tb_phi_ = 0.0; tb_run_ = 0; tb_pdg_ = 0; tb_tof_ = 0; tb_ck3_ = 0; tb_ck2_ = 0; tb_vetosPassed_ = 0; tb_energyEvent_ = 0; tb_energyEcal_ = 0; tb_energyHcal_ = 0; tb_ecal_.clear(); tb_hcal_.clear(); tb_numEcal_ = 0; tb_numHcal_ = 0; tb_meanEcal_.reset(); tb_meanHcal_.reset(); sim_etaEcal_ = 0; sim_etaHcal_ = 0; sim_phiEcal_ = 0; sim_phiHcal_ = 0; recotrk_numHits_ = 0; recotrk_quality_ = 0; recotrk_charge_ = 0; recotrk_etaEcal_ = 0; recotrk_phiEcal_ = 0; //TODO:: check this is sufficient recotrk_momentum_.SetPxPyPzE(0, 0, 0, 0); recotrk_deltaRWithSim_ = 0.0; cluster_energyEvent_ = 0; cluster_energyEcal_ = 0; cluster_energyHcal_ = 0; cluster_numEcal_ = 0; cluster_numHcal_ = 0; cluster_ecal_.clear(); cluster_hcal_.clear(); cluster_meanEcal_.reset(); cluster_meanHcal_.reset(); rechits_energyEvent_ = 0; rechits_ecal_.clear(); rechits_hcal_.clear(); rechits_energyEcal_ = 0; rechits_energyHcal_ = 0; rechits_numEcal_ = 0; rechits_numHcal_ = 0; rechits_meanEcal_.reset(); rechits_meanHcal_.reset(); cands_.clear(); cands_num_ = 0; cands_mean_.reset(); cand_energyEvent_ = 0; cand_energyEcal_ = 0; cand_energyHcal_ = 0; cand_eta_ = 0; cand_phi_ = 0; cand_type_ = -1; cand_energyNeutralEM_ = 0; cand_energyNeutralHad_ = 0; calowindow_ecal_.reset(); calowindow_hcal_.reset(); }
Definition at line 206 of file Calibratable.h.
Referenced by pftools::PFClusterCalibration::calibrate(), pftools::CalibCompare::evaluateCalibrations(), pftools::Exercises3::evaluateCalibrator(), and reset().
Definition at line 178 of file Calibratable.h.
Referenced by reset().
Definition at line 179 of file Calibratable.h.
Referenced by reset().
Definition at line 201 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), recompute(), and reset().
Definition at line 201 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 201 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), recompute(), and reset().
Definition at line 203 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 203 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 201 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), recompute(), and reset().
Definition at line 201 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), recompute(), and reset().
Definition at line 204 of file Calibratable.h.
Referenced by recompute(), and reset().
std::vector<CandidateWrapper> pftools::Calibratable::cands_ |
Definition at line 196 of file Calibratable.h.
Referenced by CalibratableTest::extractCandidate(), pftools::operator<<(), recompute(), and reset().
Definition at line 197 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 198 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::dumpCaloDataToCSV(), pftools::TreeUtility::getCalibratablesFromRootFile(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), recompute(), and reset().
std::vector<CalibratableElement> pftools::Calibratable::cluster_ecal_ |
Definition at line 184 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::dumpCaloDataToCSV(), CalibratableTest::extractCandidate(), pftools::TreeUtility::getCalibratablesFromRootFile(), pftools::TreeUtility::getParticleDepositsDirectly(), recompute(), and reset().
Definition at line 183 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::CalibCompare::evaluateCalibrations(), pftools::PFClusterCalibration::getCalibrationResultWrapper(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), recompute(), and reset().
Definition at line 183 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 183 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::CalibCompare::evaluateCalibrations(), pftools::PFClusterCalibration::getCalibrationResultWrapper(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), recompute(), and reset().
std::vector<CalibratableElement> pftools::Calibratable::cluster_hcal_ |
Definition at line 184 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::dumpCaloDataToCSV(), CalibratableTest::extractCandidate(), pftools::TreeUtility::getCalibratablesFromRootFile(), pftools::TreeUtility::getParticleDepositsDirectly(), recompute(), and reset().
Definition at line 186 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::CalibCompare::evaluateCalibrations(), pftools::PFClusterCalibration::getCalibrationResultWrapper(), pftools::TreeUtility::getParticleDepositsDirectly(), recompute(), and reset().
Definition at line 186 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::CalibCompare::evaluateCalibrations(), pftools::TreeUtility::getParticleDepositsDirectly(), recompute(), and reset().
Definition at line 185 of file Calibratable.h.
Referenced by pftools::CalibCompare::evaluateCalibrations(), recompute(), and reset().
Definition at line 185 of file Calibratable.h.
Referenced by pftools::CalibCompare::evaluateCalibrations(), recompute(), and reset().
std::vector<CalibratableElement> pftools::Calibratable::rechits_ecal_ |
Definition at line 191 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), recompute(), and reset().
Definition at line 190 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 190 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 190 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
std::vector<CalibratableElement> pftools::Calibratable::rechits_hcal_ |
Definition at line 191 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), recompute(), and reset().
Definition at line 193 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::Exercises3::evaluateCalibrator(), pftools::TreeUtility::getParticleDepositsDirectly(), recompute(), and reset().
Definition at line 193 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::Exercises3::evaluateCalibrator(), pftools::TreeUtility::getParticleDepositsDirectly(), recompute(), and reset().
Definition at line 192 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 192 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 171 of file Calibratable.h.
Referenced by reset().
Definition at line 174 of file Calibratable.h.
Referenced by reset().
Definition at line 172 of file Calibratable.h.
Referenced by reset().
Definition at line 175 of file Calibratable.h.
Referenced by reset().
Definition at line 171 of file Calibratable.h.
Referenced by reset().
Definition at line 172 of file Calibratable.h.
Referenced by reset().
Definition at line 171 of file Calibratable.h.
Referenced by reset().
Definition at line 147 of file Calibratable.h.
Referenced by reset().
For each collection: candidates, clusters, rechits and truth overall energy, ecal, hcal, n of each, eta and phi naming scheme: collection_variable_ All _energyEcal_, _energyHcal_, _eta_ and _phi_ are mean values (i.e. value = sum of elements/number of elements) BUT _energyEvent_ fields are sums of all elements.
Definition at line 146 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::dumpCaloDataToCSV(), pftools::CalibCompare::evaluateCalibrations(), pftools::Exercises3::evaluateCalibrator(), pftools::PFClusterCalibration::getCalibrationResultWrapper(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), and reset().
Definition at line 147 of file Calibratable.h.
Referenced by reset().
Definition at line 146 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::dumpCaloDataToCSV(), pftools::TreeUtility::getParticleDepositsDirectly(), and reset().
Definition at line 148 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), pftools::CalibCompare::evaluateCalibrations(), pftools::Exercises3::evaluateCalibrator(), pftools::operator<<(), and reset().
Definition at line 148 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), and reset().
Definition at line 151 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), and reset().
Definition at line 149 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), and reset().
Definition at line 146 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), and reset().
Definition at line 148 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), pftools::CalibCompare::evaluateCalibrations(), pftools::operator<<(), and reset().
Definition at line 148 of file Calibratable.h.
Referenced by CalibratableTest::analyze(), and reset().
Definition at line 159 of file Calibratable.h.
Referenced by reset().
Definition at line 159 of file Calibratable.h.
Referenced by reset().
std::vector<CalibratableElement> pftools::Calibratable::tb_ecal_ |
Definition at line 165 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 164 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 164 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 164 of file Calibratable.h.
Referenced by pftools::operator<<(), recompute(), and reset().
Definition at line 155 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), and reset().
std::vector<CalibratableElement> pftools::Calibratable::tb_hcal_ |
Definition at line 165 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 153 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), and reset().
Definition at line 168 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 168 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 166 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 166 of file Calibratable.h.
Referenced by recompute(), and reset().
Definition at line 157 of file Calibratable.h.
Referenced by reset().
Definition at line 155 of file Calibratable.h.
Referenced by pftools::TreeUtility::convertCalibratablesToParticleDeposits(), pftools::TreeUtility::getParticleDepositsDirectly(), pftools::operator<<(), and reset().
Definition at line 157 of file Calibratable.h.
Referenced by reset().
Definition at line 159 of file Calibratable.h.
Referenced by reset().
Definition at line 161 of file Calibratable.h.
Referenced by reset().