#include <HcalQLPlotAnalAlgos.h>
Public Member Functions | |
void | end (void) |
HcalQLPlotAnalAlgos (const char *outputFilename, edm::ParameterSet histoParams) | |
void | processDigi (const HODigiCollection &hodigic) |
void | processDigi (const HFDigiCollection &hfdigic) |
void | processDigi (const HcalCalibDigiCollection &calibdigic, double calibFC2GeV) |
void | processDigi (const HBHEDigiCollection &hbhedigic) |
void | processRH (const HBHERecHitCollection &hbherhc, const HBHEDigiCollection &hbhedgc) |
void | processRH (const HORecHitCollection &horhc, const HODigiCollection &hodgc) |
void | processRH (const HFRecHitCollection &hfrhc, const HFDigiCollection &hfdgc) |
void | SetEventType (const HcalTBTriggerData &trigd) |
Private Member Functions | |
HcalCalibRecHit | recoCalib (const HcalCalibDataFrame &cdigi, double calibFC2GeV) |
Private Attributes | |
HcalQLPlotHistoMgr * | histos_ |
TFile * | mf_ |
HcalQLPlotHistoMgr::EventType | triggerID_ |
Definition at line 17 of file HcalQLPlotAnalAlgos.h.
HcalQLPlotAnalAlgos::HcalQLPlotAnalAlgos | ( | const char * | outputFilename, |
edm::ParameterSet | histoParams | ||
) |
Definition at line 44 of file HcalQLPlotAnalAlgos.cc.
References histos_, mf_, triggerID_, and pat::UNKNOWN.
{ triggerID_=HcalQLPlotHistoMgr::UNKNOWN; mf_ = new TFile(outputFilename,"RECREATE"); histos_ = new HcalQLPlotHistoMgr(mf_,histoParams); }
void HcalQLPlotAnalAlgos::end | ( | void | ) |
Definition at line 58 of file HcalQLPlotAnalAlgos.cc.
References mf_.
Referenced by HcalQLPlotAnal::endJob().
{ mf_->Write(); }
void HcalQLPlotAnalAlgos::processDigi | ( | const HFDigiCollection & | hfdigic | ) |
void HcalQLPlotAnalAlgos::processDigi | ( | const HcalCalibDigiCollection & | calibdigic, |
double | calibFC2GeV | ||
) |
Definition at line 279 of file HcalQLPlotAnalAlgos.cc.
References HcalCalibRecHit::amplitude(), edm::SortedCollection< T, SORT >::begin(), newFWLiteAna::bin, edm::SortedCollection< T, SORT >::end(), HcalQLPlotHistoMgr::ENERGY, HcalQLPlotHistoMgr::GetAHistogram(), histos_, HcalQLPlotHistoMgr::PULSE, recoCalib(), HcalQLPlotHistoMgr::TIME, HcalCalibRecHit::time(), and triggerID_.
{ HcalCalibDigiCollection::const_iterator it; for (it = calibdigic.begin(); it != calibdigic.end(); it++) { HcalCalibDetId id (it->id()); HcalElectronicsId eid (it->elecId()); TH1* phist=histos_->GetAHistogram(id,eid,HcalQLPlotHistoMgr::PULSE,triggerID_); if (phist){ for (int bin=0; bin<it->size(); bin++) phist->Fill(bin*1.0,(*it)[bin].nominal_fC()); } // HACK-reco the calib digi into a rechit: // HcalCalibRecHit rh = recoCalib(*it, calibFC2GeV); TH1* ehist=histos_->GetAHistogram(id,eid,HcalQLPlotHistoMgr::ENERGY,triggerID_); if (ehist){ ehist->Fill(rh.amplitude()); } TH1* thist=histos_->GetAHistogram(id,eid,HcalQLPlotHistoMgr::TIME,triggerID_); if (thist){ thist->Fill(rh.time()); } } }
void HcalQLPlotAnalAlgos::processDigi | ( | const HBHEDigiCollection & | hbhedigic | ) |
Definition at line 174 of file HcalQLPlotAnalAlgos.cc.
References HcalQLPlotHistoMgr::ADC, edm::SortedCollection< T, SORT >::begin(), newFWLiteAna::bin, edm::SortedCollection< T, SORT >::end(), HcalQLPlotHistoMgr::GetAHistogram(), histos_, HcalQLPlotHistoMgr::PEDESTAL, HcalQLPlotHistoMgr::PULSE, and triggerID_.
Referenced by HcalQLPlotAnal::analyze().
{ HBHEDigiCollection::const_iterator it; for (it = hbhedigic.begin(); it != hbhedigic.end(); it++) { HcalDetId id (it->id()); HcalElectronicsId eid (it->elecId()); TH1* phist=histos_->GetAHistogram(id,eid,HcalQLPlotHistoMgr::PULSE,triggerID_); if (phist){ for (int bin=0; bin<it->size(); bin++) phist->Fill(bin*1.0,(*it)[bin].nominal_fC()); } if (triggerID_ == HcalQLPlotHistoMgr::PEDESTAL) { phist=histos_->GetAHistogram(id,eid,HcalQLPlotHistoMgr::ADC,triggerID_); if (phist){ for (int bin=0; bin<it->size(); bin++) phist->Fill((*it)[bin].adc()); } } } }
void HcalQLPlotAnalAlgos::processDigi | ( | const HODigiCollection & | hodigic | ) |
void HcalQLPlotAnalAlgos::processRH | ( | const HORecHitCollection & | horhc, |
const HODigiCollection & | hodgc | ||
) |
void HcalQLPlotAnalAlgos::processRH | ( | const HFRecHitCollection & | hfrhc, |
const HFDigiCollection & | hfdgc | ||
) |
void HcalQLPlotAnalAlgos::processRH | ( | const HBHERecHitCollection & | hbherhc, |
const HBHEDigiCollection & | hbhedgc | ||
) |
Definition at line 81 of file HcalQLPlotAnalAlgos.cc.
References edm::SortedCollection< T, SORT >::begin(), edm::SortedCollection< T, SORT >::end(), HcalQLPlotHistoMgr::ENERGY, edm::SortedCollection< T, SORT >::find(), HcalQLPlotHistoMgr::GetAHistogram(), histos_, HcalQLPlotHistoMgr::TIME, and triggerID_.
Referenced by HcalQLPlotAnal::analyze().
{ HBHERecHitCollection::const_iterator it; for (it = hbherhc.begin(); it != hbherhc.end(); it++) { HcalDetId id (it->id()); HcalElectronicsId eid; HBHEDigiCollection::const_iterator dit = hbhedgc.find(id); if (dit != hbhedgc.end()) eid = dit->elecId(); else { edm::LogWarning("HcalQLPlotAnalAlgos::processRH") << "No digi found for id" << id; continue; } TH1* ehist=histos_->GetAHistogram(id,eid,HcalQLPlotHistoMgr::ENERGY,triggerID_); if (ehist){ ehist->Fill(it->energy()); } TH1* thist=histos_->GetAHistogram(id,eid,HcalQLPlotHistoMgr::TIME,triggerID_); if (thist){ thist->Fill(it->time()); } } }
HcalCalibRecHit HcalQLPlotAnalAlgos::recoCalib | ( | const HcalCalibDataFrame & | cdigi, |
double | calibFC2GeV | ||
) | [private] |
Definition at line 252 of file HcalQLPlotAnalAlgos.cc.
References i, HcalCalibDataFrame::id(), findQualityFiles::maxI, HcalCalibDataFrame::presamples(), HcalCalibDataFrame::size(), and cond::rpcobgas::time.
Referenced by processDigi().
{ double nominal_ped = (cdigi[0].nominal_fC() + cdigi[1].nominal_fC())/2.0; double totamp = 0.0; double maxA = -1e99; int maxI = -1; for (int i=0; i<cdigi.size(); i++) { double ampl = (cdigi[i].nominal_fC()-nominal_ped)*calibFC2GeV; totamp += ampl; if (ampl > maxA) { maxA = ampl; maxI = i; } } maxA=fabs(maxA); float t0 = (maxI > 0) ? (fabs((cdigi[maxI-1].nominal_fC()-nominal_ped))*calibFC2GeV):0.0; float t2 = fabs((cdigi[maxI+1].nominal_fC()-nominal_ped)*calibFC2GeV); float wpksamp = (maxA + 2.0*t2) / (t0 + maxA + t2); float time = (maxI - cdigi.presamples() + wpksamp)*25.0; return HcalCalibRecHit(cdigi.id(),totamp,time); }
void HcalQLPlotAnalAlgos::SetEventType | ( | const HcalTBTriggerData & | trigd | ) |
Definition at line 63 of file HcalQLPlotAnalAlgos.cc.
References HcalQLPlotHistoMgr::BEAM, alignCSCRings::e, exception, HcalQLPlotHistoMgr::LASER, HcalQLPlotHistoMgr::LED, HcalQLPlotHistoMgr::PEDESTAL, triggerID_, HcalQLPlotHistoMgr::UNKNOWN, HcalTBTriggerData::wasBeamTrigger(), HcalTBTriggerData::wasInSpillPedestalTrigger(), HcalTBTriggerData::wasLaserTrigger(), HcalTBTriggerData::wasLEDTrigger(), HcalTBTriggerData::wasOutSpillPedestalTrigger(), and HcalTBTriggerData::wasSpillIgnorantPedestalTrigger().
Referenced by HcalQLPlotAnal::analyze().
{ if( trigd.wasInSpillPedestalTrigger() || trigd.wasOutSpillPedestalTrigger() || trigd.wasSpillIgnorantPedestalTrigger() ) triggerID_=HcalQLPlotHistoMgr::PEDESTAL; if( trigd.wasLEDTrigger() ) triggerID_=HcalQLPlotHistoMgr::LED; if( trigd.wasLaserTrigger() ) triggerID_=HcalQLPlotHistoMgr::LASER; if( trigd.wasBeamTrigger() ) triggerID_=HcalQLPlotHistoMgr::BEAM; if( triggerID_ == HcalQLPlotHistoMgr::UNKNOWN) { edm::LogError("HcalQLPlotAnalAlgos::begin") << "Trigger Type unrecognized, aborting"; std::exception e; throw e; } }
HcalQLPlotHistoMgr* HcalQLPlotAnalAlgos::histos_ [private] |
Definition at line 41 of file HcalQLPlotAnalAlgos.h.
Referenced by HcalQLPlotAnalAlgos(), processDigi(), and processRH().
TFile* HcalQLPlotAnalAlgos::mf_ [private] |
Definition at line 42 of file HcalQLPlotAnalAlgos.h.
Referenced by end(), and HcalQLPlotAnalAlgos().
Definition at line 40 of file HcalQLPlotAnalAlgos.h.
Referenced by HcalQLPlotAnalAlgos(), processDigi(), processRH(), and SetEventType().