#include <DQM/SiStripMonitorSummary/plugins/SiStripPlotGain.cc>
Public Member Functions | |
SiStripPlotGain (const edm::ParameterSet &) | |
~SiStripPlotGain () | |
Private Member Functions | |
virtual void | analyze (const edm::Event &, const edm::EventSetup &) |
virtual void | beginRun (const edm::Run &run, const edm::EventSetup &es) |
void | DoAnalysis (const SiStripApvGain &) |
virtual void | endJob () |
unsigned long long | getCache (const edm::EventSetup &eSetup) |
TH1F * | getHisto (const long unsigned int &index) |
Returns the histogram contained by the Monitor Element. | |
void | getHistos (const uint32_t &detid, std::vector< TH1F * > &histos) |
Private Attributes | |
unsigned long long | cacheID |
TFile * | file |
SiStripDetInfoFileReader * | fr |
edm::ESHandle< SiStripApvGain > | Handle_ |
TrackerMap * | tkmap |
std::vector< TH1F * > | vTH1 |
Description: <one line="" class="" summary>="">
Implementation: <Notes on="" implementation>="">
Definition at line 49 of file SiStripPlotGain.h.
SiStripPlotGain::SiStripPlotGain | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 10 of file SiStripPlotGain.cc.
References file, fr, cmsCodeRules::cppFunctionSkipper::operator, and tkmap.
: cacheID(0xFFFFFFFF) { //now do what ever initialization is needed if(!edm::Service<SiStripDetInfoFileReader>().isAvailable()){ edm::LogError("TkLayerMap") << "\n------------------------------------------" "\nUnAvailable Service SiStripDetInfoFileReader: please insert in the configuration file an instance like" "\n\tprocess.SiStripDetInfoFileReader = cms.Service(\"SiStripDetInfoFileReader\")" "\n------------------------------------------"; } fr=edm::Service<SiStripDetInfoFileReader>().operator->(); file = new TFile("correlTest.root","RECREATE"); tkmap = new TrackerMap(); }
SiStripPlotGain::~SiStripPlotGain | ( | ) |
Definition at line 28 of file SiStripPlotGain.cc.
{}
virtual void SiStripPlotGain::analyze | ( | const edm::Event & | , |
const edm::EventSetup & | |||
) | [inline, private, virtual] |
void SiStripPlotGain::beginRun | ( | const edm::Run & | run, |
const edm::EventSetup & | es | ||
) | [private, virtual] |
Reimplemented from edm::EDAnalyzer.
Definition at line 34 of file SiStripPlotGain.cc.
References cacheID, DoAnalysis(), edm::EventSetup::get(), getCache(), Handle_, and edm::ESHandle< T >::product().
{ if(getCache(es)==cacheID ) return; cacheID=getCache(es); edm::LogInfo("") << "[SiStripPlotGain::beginRun] cacheID " << cacheID << std::endl; es.get<SiStripApvGainRcd>().get(Handle_); DoAnalysis(*Handle_.product()); }
void SiStripPlotGain::DoAnalysis | ( | const SiStripApvGain & | gain | ) | [private] |
Definition at line 49 of file SiStripPlotGain.cc.
References SiStripApvGain::RegistryPointers::detid_begin, SiStripApvGain::RegistryPointers::detid_end, HcalObjRepresent::Fill(), TrackerMap::fill(), SiStripApvGain::getApvGain(), SiStripApvGain::RegistryPointers::getFirstElement(), getHistos(), SiStripApvGain::RegistryPointers::getLastElement(), SiStripApvGain::getRegistryPointers(), mergeVDriftHistosByStation::histos, i, AlCaHLTBitMon_ParallelJobs::p, tkmap, and relativeConstraints::value.
Referenced by beginRun().
{ edm::LogInfo("") << "[Doanalysis]"; std::vector<TH1F *>histos; SiStripApvGain::RegistryPointers p=gain.getRegistryPointers(); SiStripApvGain::RegistryConstIterator iter, iterE; iter=p.detid_begin; iterE=p.detid_end; float value; //Divide result by d for(;iter!=iterE;++iter){ getHistos(*iter,histos); SiStripApvGain::Range range=SiStripApvGain::Range(p.getFirstElement(iter),p.getLastElement(iter)); edm::LogInfo("") << "[Doanalysis] detid " << *iter << " range " << range.second-range.first; size_t apv=0, apvE= (range.second-range.first); for (;apv<apvE;apv+=2){ value=gain.getApvGain(apv,range); tkmap->fill(*iter,value); for(size_t i=0;i<histos.size();++i) histos[i]->Fill(value); } } }
void SiStripPlotGain::endJob | ( | void | ) | [private, virtual] |
unsigned long long SiStripPlotGain::getCache | ( | const edm::EventSetup & | eSetup | ) | [inline, private] |
Definition at line 64 of file SiStripPlotGain.h.
References edm::EventSetup::get().
Referenced by beginRun().
{ return eSetup.get<SiStripApvGainRcd>().cacheIdentifier();}
TH1F * SiStripPlotGain::getHisto | ( | const long unsigned int & | index | ) | [private] |
Returns the histogram contained by the Monitor Element.
me | Monitor Element |
clone | (boolean) if true clone the histogram |
ret | in case of clonation delete the histogram first |
debug | dump out debugging info |
Definition at line 110 of file SiStripPlotGain.cc.
References getHLTprescales::index, mergeVDriftHistosByStation::name, and vTH1.
Referenced by getHistos().
void SiStripPlotGain::getHistos | ( | const uint32_t & | detid, |
std::vector< TH1F * > & | histos | ||
) | [private] |
Definition at line 81 of file SiStripPlotGain.cc.
References a, getHisto(), getHLTprescales::index, TIBDetId::layer(), TOBDetId::layer(), TIDDetId::side(), TECDetId::side(), DetId::subdetId(), TIDDetId::wheel(), and TECDetId::wheel().
Referenced by DoAnalysis().
{ histos.clear(); int subdet=-999; int component=-999; SiStripDetId a(detid); if ( a.subdetId() == 3 ){ subdet=0; component=TIBDetId(detid).layer(); } else if ( a.subdetId() == 4 ) { subdet=1; component=TIDDetId(detid).side()==2?TIDDetId(detid).wheel():TIDDetId(detid).wheel()+3; } else if ( a.subdetId() == 5 ) { subdet=2; component=TOBDetId(detid).layer(); } else if ( a.subdetId() == 6 ) { subdet=3; component=TECDetId(detid).side()==2?TECDetId(detid).wheel():TECDetId(detid).wheel()+9; } int index=100+subdet*100+component; histos.push_back(getHisto(subdet+1)); histos.push_back(getHisto(index)); }
unsigned long long SiStripPlotGain::cacheID [private] |
Definition at line 81 of file SiStripPlotGain.h.
Referenced by beginRun().
TFile* SiStripPlotGain::file [private] |
Definition at line 75 of file SiStripPlotGain.h.
Referenced by endJob(), and SiStripPlotGain().
SiStripDetInfoFileReader* SiStripPlotGain::fr [private] |
Definition at line 70 of file SiStripPlotGain.h.
Referenced by SiStripPlotGain().
edm::ESHandle<SiStripApvGain> SiStripPlotGain::Handle_ [private] |
Definition at line 72 of file SiStripPlotGain.h.
Referenced by beginRun().
TrackerMap* SiStripPlotGain::tkmap [private] |
Definition at line 78 of file SiStripPlotGain.h.
Referenced by DoAnalysis(), endJob(), and SiStripPlotGain().
std::vector<TH1F*> SiStripPlotGain::vTH1 [private] |
Definition at line 76 of file SiStripPlotGain.h.
Referenced by endJob(), and getHisto().