#include <EnergyTask.h>
Public Types | |
enum | MESets { kHitMap, kHitMapAll, kHit, kHitAll, kMiniCluster, nMESets } |
Public Member Functions | |
void | analyze (const void *, Collections) |
void | beginRun (const edm::Run &, const edm::EventSetup &) |
EnergyTask (const edm::ParameterSet &, const edm::ParameterSet &) | |
bool | filterRunType (const std::vector< short > &) |
void | runOnRecHits (const EcalRecHitCollection &) |
~EnergyTask () | |
Static Public Member Functions | |
static void | setMEData (std::vector< MEData > &) |
Private Attributes | |
bool | isPhysicsRun_ |
float | threshS9_ |
const CaloTopology * | topology_ |
Definition at line 12 of file EnergyTask.h.
Reimplemented from ecaldqm::DQWorker.
Definition at line 25 of file EnergyTask.h.
{ kHitMap, // profile2d kHitMapAll, // k3x3Map, // profile2d kHit, // h1f kHitAll, kMiniCluster, // h1f nMESets };
data refman pasoursint CMSSW_5_3_8_patch3 src DQM EcalBarrelMonitorTasks src EnergyTask cc ecaldqm::EnergyTask::EnergyTask | ( | const edm::ParameterSet & | _params, |
const edm::ParameterSet & | _paths | ||
) |
Definition at line 12 of file EnergyTask.cc.
References edm::ParameterSet::getUntrackedParameter(), edm::ParameterSet::getUntrackedParameterSet(), ecaldqm::kEBRecHit, ecaldqm::kEERecHit, ecaldqm::kRun, and mergeVDriftHistosByStation::name.
{ collectionMask_ = (0x1 << kRun) | (0x1 << kEBRecHit) | (0x1 << kEERecHit); edm::ParameterSet const& taskParams(_params.getUntrackedParameterSet(name_)); isPhysicsRun_ = taskParams.getUntrackedParameter<bool>("isPhysicsRun"); threshS9_ = taskParams.getUntrackedParameter<double>("threshS9"); std::map<std::string, std::string> replacements; if(!isPhysicsRun_) replacements["oot"] = " (outOfTime)"; else replacements["oot"] = ""; for(unsigned iME(0); iME < nMESets; iME++) MEs_[iME]->name(replacements); }
ecaldqm::EnergyTask::~EnergyTask | ( | ) |
Definition at line 36 of file EnergyTask.cc.
{ }
void ecaldqm::EnergyTask::analyze | ( | const void * | _p, |
Collections | _collection | ||
) | [inline, virtual] |
Reimplemented from ecaldqm::DQWorkerTask.
Definition at line 43 of file EnergyTask.h.
References ecaldqm::kEBRecHit, ecaldqm::kEERecHit, and runOnRecHits().
{ switch(_collection){ case kEBRecHit: case kEERecHit: runOnRecHits(*static_cast<const EcalRecHitCollection*>(_p)); break; default: break; } }
void ecaldqm::EnergyTask::beginRun | ( | const edm::Run & | , |
const edm::EventSetup & | _es | ||
) | [virtual] |
Reimplemented from ecaldqm::DQWorker.
Definition at line 41 of file EnergyTask.cc.
References Exception, edm::EventSetup::get(), edm::ESHandle< T >::product(), and topology_.
{ edm::ESHandle<CaloTopology> topoHndl; _es.get<CaloTopologyRecord>().get(topoHndl); topology_ = topoHndl.product(); if(!topology_) throw cms::Exception("EventSetup") << "CaloTopology missing" << std::endl; }
bool ecaldqm::EnergyTask::filterRunType | ( | const std::vector< short > & | _runType | ) | [virtual] |
Reimplemented from ecaldqm::DQWorkerTask.
Definition at line 51 of file EnergyTask.cc.
References EcalDCCHeaderBlock::COSMIC, EcalDCCHeaderBlock::COSMICS_GLOBAL, EcalDCCHeaderBlock::COSMICS_LOCAL, EcalDCCHeaderBlock::MTCC, EcalDCCHeaderBlock::PHYSICS_GLOBAL, and EcalDCCHeaderBlock::PHYSICS_LOCAL.
{ for(int iFED(0); iFED < 54; iFED++){ if ( _runType[iFED] == EcalDCCHeaderBlock::COSMIC || _runType[iFED] == EcalDCCHeaderBlock::MTCC || _runType[iFED] == EcalDCCHeaderBlock::COSMICS_GLOBAL || _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_GLOBAL || _runType[iFED] == EcalDCCHeaderBlock::COSMICS_LOCAL || _runType[iFED] == EcalDCCHeaderBlock::PHYSICS_LOCAL ) return true; } return false; }
void ecaldqm::EnergyTask::runOnRecHits | ( | const EcalRecHitCollection & | _hits | ) |
Definition at line 66 of file EnergyTask.cc.
References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), relval_parameters_module::energy, edm::SortedCollection< T, SORT >::find(), CaloTopology::getWindow(), errorMatrix2Lands_multiChannel::id, isPhysicsRun_, EcalRecHit::kGood, kHit, kHitAll, kHitMap, kHitMapAll, kMiniCluster, ecaldqm::DQWorker::MEs_, threshS9_, topology_, and svgfig::window().
Referenced by analyze().
{ uint32_t mask(~(0x1 << EcalRecHit::kGood)); for(EcalRecHitCollection::const_iterator hitItr(_hits.begin()); hitItr != _hits.end(); ++hitItr){ if(isPhysicsRun_ && hitItr->checkFlagMask(mask)) continue; float energy(isPhysicsRun_ ? hitItr->energy() : hitItr->outOfTimeEnergy()); if ( energy < 0. ) energy = 0.0; DetId id(hitItr->id()); MEs_[kHitMap]->fill(id, energy); MEs_[kHitMapAll]->fill(id, energy); MEs_[kHit]->fill(id, energy); MEs_[kHitAll]->fill(id, energy); // look for the seeds float e3x3(energy); bool isSeed = true; EcalRecHitCollection::const_iterator neighborItr; float neighborE; std::vector<DetId> window(topology_->getWindow(id, 3, 3)); for(std::vector<DetId>::iterator idItr(window.begin()); idItr != window.end(); ++idItr){ if((neighborItr = _hits.find(*idItr)) == _hits.end()) continue; if(isPhysicsRun_ && neighborItr->checkFlagMask(mask)) continue; neighborE = isPhysicsRun_ ? neighborItr->energy() : neighborItr->outOfTimeEnergy(); if(neighborE > energy){ isSeed = false; break; } e3x3 += neighborE; } if(!isSeed) continue; if ( e3x3 >= threshS9_ ) MEs_[kMiniCluster]->fill(id, e3x3); } }
void ecaldqm::EnergyTask::setMEData | ( | std::vector< MEData > & | _data | ) | [static] |
Reimplemented from ecaldqm::DQWorker.
Definition at line 113 of file EnergyTask.cc.
References MonitorElement::DQM_KIND_TH1F, MonitorElement::DQM_KIND_TPROFILE2D, EcalDQMBinningService::AxisSpecs::high, EcalDQMBinningService::kCrystal, EcalDQMBinningService::kEcal2P, kHit, kHitAll, kHitMap, kHitMapAll, kMiniCluster, EcalDQMBinningService::kSM, EcalDQMBinningService::kSuperCrystal, EcalDQMBinningService::kUser, EcalDQMBinningService::AxisSpecs::low, and EcalDQMBinningService::AxisSpecs::nbins.
{ BinService::AxisSpecs xaxis, zaxis; zaxis.low = 0.; zaxis.high = 10.; _data[kHitMap] = MEData("HitMap", BinService::kSM, BinService::kCrystal, MonitorElement::DQM_KIND_TPROFILE2D, 0, 0, &zaxis); _data[kHitMapAll] = MEData("HitMap", BinService::kEcal2P, BinService::kSuperCrystal, MonitorElement::DQM_KIND_TPROFILE2D, 0, 0, &zaxis); xaxis.nbins = 50; xaxis.low = 0.; xaxis.high = 20.; _data[kHit] = MEData("Hit", BinService::kSM, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &xaxis); _data[kHitAll] = MEData("Hit", BinService::kEcal2P, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &xaxis); _data[kMiniCluster] = MEData("MiniCluster", BinService::kSM, BinService::kUser, MonitorElement::DQM_KIND_TH1F, &xaxis); }
bool ecaldqm::EnergyTask::isPhysicsRun_ [private] |
Definition at line 39 of file EnergyTask.h.
Referenced by runOnRecHits().
float ecaldqm::EnergyTask::threshS9_ [private] |
Definition at line 40 of file EnergyTask.h.
Referenced by runOnRecHits().
const CaloTopology* ecaldqm::EnergyTask::topology_ [private] |
Definition at line 38 of file EnergyTask.h.
Referenced by beginRun(), and runOnRecHits().