9 : refNoise(
nullptr), oldGain(
nullptr), newGain(
nullptr), cacheID_noise(0xFFFFFFFF), cacheID_gain(0xFFFFFFFF) {
12 edm::LogError(
"TkLayerMap") <<
"\n------------------------------------------" 13 "\nUnAvailable Service SiStripDetInfoFileReader: please insert in " 14 "the configuration file an instance like" 15 "\n\tprocess.SiStripDetInfoFileReader = " 16 "cms.Service(\"SiStripDetInfoFileReader\")" 17 "\n------------------------------------------";
21 file =
new TFile(
"correlTest.root",
"RECREATE");
48 sprintf(dir,
"Run_%d",
theRun);
80 TCanvas *
C =
new TCanvas();
84 sprintf(outName,
"Run_%d.png",
theRun);
85 for (
size_t i = 0;
i <
vTH1.size();
i++)
86 if (
vTH1[
i] !=
nullptr) {
89 vTH1[
i]->SetLineColor(
i / 100);
91 C->cd(
i / 100)->SetLogy();
103 sprintf(dir,
"Run_%d_TkMap.png",
theRun);
113 typedef std::vector<SiStripNoises::ratioData>
collection;
114 collection divNoise = Noise /
refNoise;
123 std::vector<TH1F *>
histos;
125 collection::const_iterator iter = divNoise.begin();
126 collection::const_iterator iterE = divNoise.end();
129 float gainRatio = 1.;
131 for (; iter != iterE; ++iter) {
134 size_t strip = 0, stripE = iter->values.size();
137 for (; strip < stripE; ++
strip) {
138 if (!
equalGain && strip / 128 != apvNb) {
143 edm::LogInfo(
"") <<
"[Doanalysis] detid " << iter->detid <<
" strip " << strip <<
" apvNb " << apvNb;
147 value = iter->values[
strip] * gainRatio;
149 for (
size_t i = 0;
i < histos.size(); ++
i)
150 histos[
i]->
Fill(value);
159 if (oldRange.first == oldRange.second || newRange.first == newRange.second)
166 const uint32_t &firstStrip,
167 const uint32_t &range) {
169 for (
size_t istrip = firstStrip; istrip < firstStrip + range; istrip++) {
172 return mean / (1. * range);
177 std::vector<TH1F *> &
histos) {
181 int component = -999;
197 int index = 100 + subdet * 100 + component;
199 histos.push_back(
getHisto(100 + 100 * subdet));
204 if (
vTH1.size() < index + 1)
205 vTH1.resize(index + 1,
nullptr);
207 if (
vTH1[index] ==
nullptr) {
212 else if (index < 300)
214 else if (index < 400)
218 sprintf(name,
"%d_%lu__%s",
theRun, index, SubD.c_str());
219 edm::LogInfo(
"") <<
"[getHisto] creating index " << index << std::endl;
220 vTH1[
index] =
new TH1F(name, name, 200, -0.5, 10.5);
TH1F * getHisto(const long unsigned int &index)
~SiStripCorrelateNoise() override
unsigned long long cacheID_noise
void getHistos(const uint32_t &detid, const TrackerTopology *tTopo, std::vector< TH1F * > &histos)
unsigned int tibLayer(const DetId &id) const
void beginRun(const edm::Run &run, const edm::EventSetup &es) override
static float getApvGain(uint16_t apv, const Range &range)
float getMeanNoise(const SiStripNoises::Range &noiseRange, const uint32_t &first, const uint32_t &range)
unsigned int tidWheel(const DetId &id) const
void DoAnalysis(const edm::EventSetup &, const SiStripNoises &, SiStripNoises &)
static float getNoise(uint16_t strip, const Range &range)
unsigned int tidSide(const DetId &id) const
edm::ESHandle< SiStripApvGain > gainHandle_
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
void save(bool print_total=true, float minval=0., float maxval=0., std::string s="svgmap.svg", int width=1500, int height=800)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
std::pair< ContainerIterator, ContainerIterator > Range
float getGainRatio(const uint32_t &detid, const uint16_t &apv)
unsigned long long getNoiseCache(const edm::EventSetup &eSetup)
Detector identifier class for the strip tracker.
edm::ESHandle< SiStripNoises > noiseHandle_
unsigned long long cacheID_gain
std::vector< TH1F * > vTH1
unsigned long long getGainCache(const edm::EventSetup &eSetup)
const Range getRange(const uint32_t detID) const
SiStripCorrelateNoise(const edm::ParameterSet &)
void checkGainCache(const edm::EventSetup &es)
std::pair< ContainerIterator, ContainerIterator > Range
unsigned int tecWheel(const DetId &id) const
T const * product() const
SiStripDetInfoFileReader * fr
void fill(int layer, int ring, int nmod, float x)
unsigned int tobLayer(const DetId &id) const
unsigned int tecSide(const DetId &id) const