#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 edm::EventSetup &es, 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, const TrackerTopology *tTopo, 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 50 of file SiStripPlotGain.h.
SiStripPlotGain::SiStripPlotGain | ( | const edm::ParameterSet & | iConfig | ) | [explicit] |
Definition at line 8 of file SiStripPlotGain.cc.
References file, fr, 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 26 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 32 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(es, *Handle_.product()); }
void SiStripPlotGain::DoAnalysis | ( | const edm::EventSetup & | es, |
const SiStripApvGain & | gain | ||
) | [private] |
Definition at line 47 of file SiStripPlotGain.cc.
References SiStripApvGain::RegistryPointers::detid_begin, SiStripApvGain::RegistryPointers::detid_end, HcalObjRepresent::Fill(), TrackerMap::fill(), edm::EventSetup::get(), SiStripApvGain::getApvGain(), SiStripApvGain::RegistryPointers::getFirstElement(), getHistos(), SiStripApvGain::RegistryPointers::getLastElement(), SiStripApvGain::getRegistryPointers(), mergeVDriftHistosByStation::histos, i, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), tkmap, and relativeConstraints::value.
Referenced by beginRun().
{ edm::LogInfo("") << "[Doanalysis]"; //Retrieve tracker topology from geometry edm::ESHandle<TrackerTopology> tTopoHandle; es.get<IdealGeometryRecord>().get(tTopoHandle); const TrackerTopology* const tTopo = tTopoHandle.product(); 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,tTopo,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 65 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 113 of file SiStripPlotGain.cc.
References getHLTprescales::index, mergeVDriftHistosByStation::name, and vTH1.
Referenced by getHistos().
void SiStripPlotGain::getHistos | ( | const uint32_t & | detid, |
const TrackerTopology * | tTopo, | ||
std::vector< TH1F * > & | histos | ||
) | [private] |
Definition at line 84 of file SiStripPlotGain.cc.
References a, getHisto(), getHLTprescales::index, DetId::subdetId(), TrackerTopology::tecSide(), TrackerTopology::tecWheel(), TrackerTopology::tibLayer(), TrackerTopology::tidSide(), TrackerTopology::tidWheel(), and TrackerTopology::tobLayer().
Referenced by DoAnalysis().
{ histos.clear(); int subdet=-999; int component=-999; SiStripDetId a(detid); if ( a.subdetId() == 3 ){ subdet=0; component=tTopo->tibLayer(detid); } else if ( a.subdetId() == 4 ) { subdet=1; component=tTopo->tidSide(detid)==2?tTopo->tidWheel(detid):tTopo->tidWheel(detid)+3; } else if ( a.subdetId() == 5 ) { subdet=2; component=tTopo->tobLayer(detid); } else if ( a.subdetId() == 6 ) { subdet=3; component=tTopo->tecSide(detid)==2?tTopo->tecWheel(detid):tTopo->tecWheel(detid)+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 82 of file SiStripPlotGain.h.
Referenced by beginRun().
TFile* SiStripPlotGain::file [private] |
Definition at line 76 of file SiStripPlotGain.h.
Referenced by endJob(), and SiStripPlotGain().
SiStripDetInfoFileReader* SiStripPlotGain::fr [private] |
Definition at line 71 of file SiStripPlotGain.h.
Referenced by SiStripPlotGain().
edm::ESHandle<SiStripApvGain> SiStripPlotGain::Handle_ [private] |
Definition at line 73 of file SiStripPlotGain.h.
Referenced by beginRun().
TrackerMap* SiStripPlotGain::tkmap [private] |
Definition at line 79 of file SiStripPlotGain.h.
Referenced by DoAnalysis(), endJob(), and SiStripPlotGain().
std::vector<TH1F*> SiStripPlotGain::vTH1 [private] |
Definition at line 77 of file SiStripPlotGain.h.
Referenced by endJob(), and getHisto().