41 #include "TPaveStats.h" 49 SiStripApvGainContainer(
const std::shared_ptr<SiStripApvGain>&
payload,
53 payloadType_ =
"SiStripApvGain";
57 void storeAllValues()
override {
58 std::vector<uint32_t> detid;
59 payload_->getDetIds(detid);
61 for (
const auto&
d : detid) {
65 SiStripCondData_.fillByPushBack(
d, payload_->getApvGain(
it,
range));
74 class SiStripApvGainTest :
public Histogram1D<SiStripApvGain, SINGLE_IOV> {
79 bool fill()
override {
80 auto tag = PlotBase::getTag<0>();
82 for (
auto const& iov :
tag.iovs) {
83 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
85 SiStripApvGainContainer* objContainer =
new SiStripApvGainContainer(
payload, iov,
tagname);
86 objContainer->printAll();
94 class SiStripApvGainByPartition :
public PlotImage<SiStripApvGain, SINGLE_IOV> {
98 bool fill()
override {
99 auto tag = PlotBase::getTag<0>();
100 auto iov =
tag.iovs.front();
102 std::shared_ptr<SiStripApvGain>
payload = fetchPayload(std::get<1>(iov));
104 SiStripApvGainContainer* objContainer =
new SiStripApvGainContainer(
payload, iov,
tagname);
107 TCanvas
canvas(
"Partition summary",
"partition summary", 1400, 1000);
108 objContainer->fillByPartition(
canvas, 100, 0., 2.);
117 class SiStripApvGainCompareByPartition :
public PlotImage<SiStripApvGain, MULTI_IOV, 2> {
119 SiStripApvGainCompareByPartition()
122 bool fill()
override {
124 auto theIOVs = PlotBase::getTag<0>().iovs;
125 auto tagname1 = PlotBase::getTag<0>().
name;
126 auto tag2iovs = PlotBase::getTag<1>().iovs;
127 auto tagname2 = PlotBase::getTag<1>().
name;
131 std::shared_ptr<SiStripApvGain> last_payload = fetchPayload(std::get<1>(lastiov));
132 std::shared_ptr<SiStripApvGain> first_payload = fetchPayload(std::get<1>(firstiov));
134 SiStripApvGainContainer* l_objContainer =
new SiStripApvGainContainer(last_payload, lastiov, tagname1);
135 SiStripApvGainContainer* f_objContainer =
new SiStripApvGainContainer(first_payload, firstiov, tagname2);
137 l_objContainer->compare(f_objContainer);
141 TCanvas
canvas(
"Partition summary",
"partition summary", 1400, 1000);
142 l_objContainer->fillByPartition(
canvas, 100, 0.5, 1.5);
151 class SiStripApvGainRatioByPartition :
public PlotImage<SiStripApvGain, MULTI_IOV, 2> {
155 bool fill()
override {
157 auto theIOVs = PlotBase::getTag<0>().iovs;
158 auto tagname1 = PlotBase::getTag<0>().
name;
159 auto tag2iovs = PlotBase::getTag<1>().iovs;
160 auto tagname2 = PlotBase::getTag<1>().
name;
164 std::shared_ptr<SiStripApvGain> last_payload = fetchPayload(std::get<1>(lastiov));
165 std::shared_ptr<SiStripApvGain> first_payload = fetchPayload(std::get<1>(firstiov));
167 SiStripApvGainContainer* l_objContainer =
new SiStripApvGainContainer(last_payload, lastiov, tagname1);
168 SiStripApvGainContainer* f_objContainer =
new SiStripApvGainContainer(first_payload, firstiov, tagname2);
170 l_objContainer->divide(f_objContainer);
174 TCanvas
canvas(
"Partition summary",
"partition summary", 1400, 1000);
175 l_objContainer->fillByPartition(
canvas, 200, 0.5, 1.5);
186 class SiStripApvGainDiffByPartition :
public PlotImage<SiStripApvGain, MULTI_IOV, 2> {
190 bool fill()
override {
192 auto theIOVs = PlotBase::getTag<0>().iovs;
193 auto tagname1 = PlotBase::getTag<0>().
name;
194 auto tag2iovs = PlotBase::getTag<1>().iovs;
195 auto tagname2 = PlotBase::getTag<1>().
name;
199 std::shared_ptr<SiStripApvGain> last_payload = fetchPayload(std::get<1>(lastiov));
200 std::shared_ptr<SiStripApvGain> first_payload = fetchPayload(std::get<1>(firstiov));
202 SiStripApvGainContainer* l_objContainer =
new SiStripApvGainContainer(last_payload, lastiov, tagname1);
203 SiStripApvGainContainer* f_objContainer =
new SiStripApvGainContainer(first_payload, firstiov, tagname2);
205 l_objContainer->subtract(f_objContainer);
209 TCanvas
canvas(
"Partition summary",
"partition summary", 1400, 1000);
210 l_objContainer->fillByPartition(
canvas, 100, -0.1, 0.1);
224 class SiStripApvGainsValue :
public Histogram1D<SiStripApvGain, SINGLE_IOV> {
226 SiStripApvGainsValue()
230 bool fill()
override {
231 auto tag = PlotBase::getTag<0>();
232 for (
auto const& iov :
tag.iovs) {
233 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
235 std::vector<uint32_t> detid;
238 for (
const auto&
d : detid) {
258 class SiStripApvBarrelGainsByLayer :
public Histogram1D<SiStripApvGain, SINGLE_IOV> {
260 SiStripApvBarrelGainsByLayer()
262 "Barrel layer (0-3: TIB), (4-9: TOB)",
266 "average SiStripApv Gain") {}
268 bool fill()
override {
269 auto tag = PlotBase::getTag<0>();
270 for (
auto const& iov :
tag.iovs) {
271 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
276 std::vector<uint32_t> detid;
279 std::map<int, std::pair<float, float>> sumOfGainsByLayer;
281 for (
const auto&
d : detid) {
297 sumOfGainsByLayer[
layer].second += 1.;
302 for (
auto&
data : sumOfGainsByLayer) {
303 fillWithBinAndValue(
data.first - 1, (
data.second.first /
data.second.second));
317 class SiStripApvAbsoluteBarrelGainsByLayer :
public Histogram2D<SiStripApvGain, SINGLE_IOV> {
319 SiStripApvAbsoluteBarrelGainsByLayer()
321 "Barrel layer (0-3: TIB), (4-9: TOB)",
329 bool fill()
override {
330 auto tag = PlotBase::getTag<0>();
331 for (
auto const& iov :
tag.iovs) {
332 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
337 std::vector<uint32_t> detid;
339 for (
const auto&
d : detid) {
341 if (subid != 3 && subid != 5)
347 fillWithValue(static_cast<float>((subid == 5) ? tTopo.
tobLayer(
d) + 3 : tTopo.
tibLayer(
d) - 1),
363 class SiStripApvEndcapMinusGainsByDisk :
public Histogram1D<SiStripApvGain, SINGLE_IOV> {
365 SiStripApvEndcapMinusGainsByDisk()
367 "Endcap (minus) disk (0-2: TID), (3-11: TEC)",
371 "average SiStripApv Gain") {}
373 bool fill()
override {
374 auto tag = PlotBase::getTag<0>();
375 for (
auto const& iov :
tag.iovs) {
376 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
381 std::vector<uint32_t> detid;
384 std::map<int, std::pair<float, float>> sumOfGainsByDisk;
386 for (
const auto&
d : detid) {
410 sumOfGainsByDisk[disk].second += 1.;
415 for (
auto&
data : sumOfGainsByDisk) {
416 fillWithBinAndValue(
data.first - 1, (
data.second.first /
data.second.second));
431 class SiStripApvEndcapPlusGainsByDisk :
public Histogram1D<SiStripApvGain, SINGLE_IOV> {
433 SiStripApvEndcapPlusGainsByDisk()
435 "Endcap (plus) disk (0-2: TID), (3-11: TEC)",
439 "average SiStripApv Gain") {}
441 bool fill()
override {
442 auto tag = PlotBase::getTag<0>();
443 for (
auto const& iov :
tag.iovs) {
444 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
449 std::vector<uint32_t> detid;
452 std::map<int, std::pair<float, float>> sumOfGainsByDisk;
454 for (
const auto&
d : detid) {
479 sumOfGainsByDisk[disk].second += 1.;
484 for (
auto&
data : sumOfGainsByDisk) {
485 fillWithBinAndValue(
data.first - 1, (
data.second.first /
data.second.second));
498 class SiStripApvAbsoluteEndcapMinusGainsByDisk :
public Histogram2D<SiStripApvGain, SINGLE_IOV> {
500 SiStripApvAbsoluteEndcapMinusGainsByDisk()
502 "Endcap (minus) disk (0-2: TID), (3-11: TEC)",
511 bool fill()
override {
512 auto tag = PlotBase::getTag<0>();
513 for (
auto const& iov :
tag.iovs) {
514 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
519 std::vector<uint32_t> detid;
522 for (
const auto&
d : detid) {
543 fillWithValue((
float)disk - 1, (
gain > 2.0) ? 2.0 :
gain);
556 class SiStripApvAbsoluteEndcapPlusGainsByDisk :
public Histogram2D<SiStripApvGain, SINGLE_IOV> {
558 SiStripApvAbsoluteEndcapPlusGainsByDisk()
560 "Endcap (plus) disk (0-2: TID), (3-11: TEC)",
568 bool fill()
override {
569 auto tag = PlotBase::getTag<0>();
570 for (
auto const& iov :
tag.iovs) {
571 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
576 std::vector<uint32_t> detid;
579 for (
const auto&
d : detid) {
600 fillWithValue((
float)disk - 1, (
gain > 2.0) ? 2.0 :
gain);
612 class SiStripApvGainsAverageTrackerMap :
public PlotImage<SiStripApvGain, SINGLE_IOV> {
616 bool fill()
override {
617 auto tag = PlotBase::getTag<0>();
618 auto iov =
tag.iovs.front();
619 std::shared_ptr<SiStripApvGain>
payload = fetchPayload(std::get<1>(iov));
621 std::string titleMap =
"SiStrip APV Gain average per module (payload : " + std::get<1>(iov) +
")";
623 std::unique_ptr<TrackerMap> tmap = std::make_unique<TrackerMap>(
"SiStripApvGains");
624 tmap->setTitle(titleMap);
627 std::vector<uint32_t> detid;
630 std::map<uint32_t, float> store;
632 for (
const auto&
d : detid) {
634 float sumOfGains = 0;
635 float nAPVsPerModule = 0.;
641 store[
d] = (sumOfGains / nAPVsPerModule);
642 tmap->fill(
d, (sumOfGains / nAPVsPerModule));
659 class SiStripApvGainsDefaultTrackerMap :
public PlotImage<SiStripApvGain, SINGLE_IOV> {
661 SiStripApvGainsDefaultTrackerMap()
664 bool fill()
override {
665 auto tag = PlotBase::getTag<0>();
666 auto iov =
tag.iovs.front();
667 std::shared_ptr<SiStripApvGain>
payload = fetchPayload(std::get<1>(iov));
669 std::unique_ptr<TrackerMap> tmap = std::make_unique<TrackerMap>(
"SiStripApvGains");
673 std::vector<uint32_t> detid;
684 int totalG1DefaultAPVs = 0;
685 int totalG2DefaultAPVs = 0;
687 for (
const auto&
d : detid) {
689 float sumOfGains = 0;
690 float nAPVsPerModule = 0.;
691 int countDefaults = 0;
699 if (countDefaults > 0.) {
700 tmap->fill(
d, countDefaults);
702 if (countDefaults == nAPVsPerModule) {
703 if (std::fmod((sumOfGains / countDefaults), G1default) == 0.) {
704 totalG1DefaultAPVs += countDefaults;
705 }
else if (std::fmod((sumOfGains / countDefaults), G2default) == 0.) {
706 totalG2DefaultAPVs += countDefaults;
714 if (totalG2DefaultAPVs == 0) {
715 gainType =
"G1 value (=690./640.)";
716 }
else if (totalG1DefaultAPVs == 0) {
717 gainType =
"G2 value (=1)";
720 std::string titleMap =
"# of APVs/module w/ default " + gainType +
" (payload : " + std::get<1>(iov) +
")";
721 tmap->setTitle(titleMap);
734 template <
int ntags, IOVMultiplicity nIOVs>
735 class SiStripApvGainsRatioTrackerMapBase :
public PlotImage<SiStripApvGain, nIOVs, ntags> {
737 SiStripApvGainsRatioTrackerMapBase()
742 bool fill()
override {
744 unsigned int nsigma(1);
747 auto ip = paramValues.find(
"nsigma");
748 if (ip != paramValues.end()) {
749 nsigma = std::stoul(ip->second);
753 auto theIOVs = PlotBase::getTag<0>().iovs;
754 auto tagname1 = PlotBase::getTag<0>().
name;
756 auto firstiov = theIOVs.front();
760 assert(this->m_plotAnnotations.ntags < 3);
762 if (this->m_plotAnnotations.ntags == 2) {
763 auto tag2iovs = PlotBase::getTag<1>().iovs;
764 tagname2 = PlotBase::getTag<1>().
name;
765 lastiov = tag2iovs.front();
767 lastiov = theIOVs.back();
770 std::shared_ptr<SiStripApvGain> last_payload = this->fetchPayload(std::get<1>(lastiov));
771 std::shared_ptr<SiStripApvGain> first_payload = this->fetchPayload(std::get<1>(firstiov));
773 std::string titleMap =
"SiStrip APV Gain ratio per module average (IOV: ";
776 titleMap +=
"/ IOV:";
780 titleMap += +
" " +
std::to_string(nsigma) +
" std. dev. saturation";
782 std::unique_ptr<TrackerMap> tmap = std::make_unique<TrackerMap>(
"SiStripApvGains");
783 tmap->setTitle(titleMap);
786 std::map<uint32_t, float> lastmap, firstmap;
788 std::vector<uint32_t> detid;
789 last_payload->getDetIds(detid);
792 for (
const auto&
d : detid) {
800 lastmap[
d] = (
Gain / nAPV);
805 first_payload->getDetIds(detid);
808 for (
const auto&
d : detid) {
816 firstmap[
d] = (
Gain / nAPV);
819 std::map<uint32_t, float> cachedRatio;
820 for (
const auto&
d : detid) {
821 float ratio = firstmap[
d] / lastmap[
d];
836 using SiStripApvGainsAvgDeviationRatioWithPreviousIOVTrackerMap = SiStripApvGainsRatioTrackerMapBase<1, MULTI_IOV>;
837 using SiStripApvGainsAvgDeviationRatioTrackerMapTwoTags = SiStripApvGainsRatioTrackerMapBase<2, SINGLE_IOV>;
843 template <
int ntags, IOVMultiplicity nIOVs>
844 class SiStripApvGainsRatioMaxDeviationTrackerMapBase :
public PlotImage<SiStripApvGain, nIOVs, ntags> {
846 SiStripApvGainsRatioMaxDeviationTrackerMapBase()
848 "Tracker Map of ratio (for largest deviation) of SiStripGains with previous IOV") {
852 bool fill()
override {
853 unsigned int nsigma(1);
855 auto ip = paramValues.find(
"nsigma");
856 if (ip != paramValues.end()) {
857 nsigma = std::stoul(ip->second);
859 <<
"using custom z-axis saturation: " << nsigma <<
" sigmas" << std::endl;
862 <<
"using default saturation: " << nsigma <<
" sigmas" << std::endl;
866 auto theIOVs = PlotBase::getTag<0>().iovs;
867 auto tagname1 = PlotBase::getTag<0>().
name;
869 auto firstiov = theIOVs.front();
873 assert(this->m_plotAnnotations.ntags < 3);
875 if (this->m_plotAnnotations.ntags == 2) {
876 auto tag2iovs = PlotBase::getTag<1>().iovs;
877 tagname2 = PlotBase::getTag<1>().
name;
878 lastiov = tag2iovs.front();
880 lastiov = theIOVs.back();
883 std::shared_ptr<SiStripApvGain> last_payload = this->fetchPayload(std::get<1>(lastiov));
884 std::shared_ptr<SiStripApvGain> first_payload = this->fetchPayload(std::get<1>(firstiov));
886 std::string titleMap =
"SiStrip APV Gain ratio for largest deviation per module (IOV: ";
889 titleMap +=
"/ IOV:";
893 titleMap += +
" - " +
std::to_string(nsigma) +
" std. dev. saturation";
895 std::unique_ptr<TrackerMap> tmap = std::make_unique<TrackerMap>(
"SiStripApvGains");
896 tmap->setTitle(titleMap);
899 std::map<std::pair<uint32_t, int>,
float> lastmap, firstmap;
901 std::vector<uint32_t> detid;
902 last_payload->getDetIds(detid);
905 for (
const auto&
d : detid) {
911 std::pair<uint32_t, int>
index = std::make_pair(
d, nAPV);
918 first_payload->getDetIds(detid);
921 for (
const auto&
d : detid) {
927 std::pair<uint32_t, int>
index = std::make_pair(
d, nAPV);
933 std::map<uint32_t, float> cachedRatio;
935 for (
const auto&
item : firstmap) {
942 if (cachedRatio[
mod]) {
952 for (
const auto& element : cachedRatio) {
953 tmap->fill(element.first, element.second);
968 using SiStripApvGainsMaxDeviationRatioWithPreviousIOVTrackerMap =
969 SiStripApvGainsRatioMaxDeviationTrackerMapBase<1, MULTI_IOV>;
971 using SiStripApvGainsMaxDeviationRatioTrackerMapTwoTags =
972 SiStripApvGainsRatioMaxDeviationTrackerMapBase<2, SINGLE_IOV>;
977 class SiStripApvGainsMaximumTrackerMap :
public PlotImage<SiStripApvGain, SINGLE_IOV> {
979 SiStripApvGainsMaximumTrackerMap()
982 bool fill()
override {
983 auto tag = PlotBase::getTag<0>();
984 auto iov =
tag.iovs.front();
985 std::shared_ptr<SiStripApvGain>
payload = fetchPayload(std::get<1>(iov));
987 std::string titleMap =
"SiStrip APV Gain maximum per module (payload : " + std::get<1>(iov) +
")";
989 std::unique_ptr<TrackerMap> tmap = std::make_unique<TrackerMap>(
"SiStripApvGains");
990 tmap->setTitle(titleMap);
993 std::vector<uint32_t> detid;
996 for (
const auto&
d : detid) {
998 float theMaxGain = 0;
1001 if (currentGain > theMaxGain) {
1002 theMaxGain = currentGain;
1006 tmap->fill(
d, theMaxGain);
1011 std::pair<float, float> extrema = tmap->getAutomaticRange();
1016 if (extrema.first != extrema.second) {
1019 tmap->save(
true, extrema.first * 0.95, extrema.first * 1.05,
fileName);
1029 class SiStripApvGainsMinimumTrackerMap :
public PlotImage<SiStripApvGain, SINGLE_IOV> {
1031 SiStripApvGainsMinimumTrackerMap()
1034 bool fill()
override {
1035 auto tag = PlotBase::getTag<0>();
1036 auto iov =
tag.iovs.front();
1038 std::shared_ptr<SiStripApvGain>
payload = fetchPayload(std::get<1>(iov));
1040 std::string titleMap =
"SiStrip APV Gain minumum per module (payload : " + std::get<1>(iov) +
")";
1042 std::unique_ptr<TrackerMap> tmap = std::make_unique<TrackerMap>(
"SiStripApvGains");
1043 tmap->setTitle(titleMap);
1044 tmap->setPalette(1);
1046 std::vector<uint32_t> detid;
1049 for (
const auto&
d : detid) {
1051 float theMinGain = 999.;
1054 if (currentGain < theMinGain) {
1055 theMinGain = currentGain;
1059 tmap->fill(
d, theMinGain);
1064 std::pair<float, float> extrema = tmap->getAutomaticRange();
1069 if (extrema.first != extrema.second) {
1072 tmap->save(
true, extrema.first * 0.95, extrema.first * 1.05,
fileName);
1083 class SiStripApvGainByRunMeans :
public HistoryPlot<SiStripApvGain, float> {
1085 SiStripApvGainByRunMeans()
1087 ~SiStripApvGainByRunMeans()
override =
default;
1090 std::vector<uint32_t> detid;
1094 float sumOfGains = 0;
1096 for (
const auto&
d : detid) {
1104 return sumOfGains / nAPVs;
1112 template <SiStripPI::estimator est>
1113 class SiStripApvGainProperties :
public HistoryPlot<SiStripApvGain, float> {
1115 SiStripApvGainProperties()
1118 ~SiStripApvGainProperties()
override =
default;
1121 std::vector<uint32_t> detid;
1125 float sumOfGains = 0;
1126 float meanOfGains = 0;
1127 float rmsOfGains = 0;
1130 for (
const auto&
d : detid) {
1144 meanOfGains = sumOfGains / nAPVs;
1157 if ((rmsOfGains / nAPVs - meanOfGains * meanOfGains) > 0.) {
1158 return sqrt(rmsOfGains / nAPVs - meanOfGains * meanOfGains);
1171 typedef SiStripApvGainProperties<SiStripPI::min> SiStripApvGainMin_History;
1172 typedef SiStripApvGainProperties<SiStripPI::max> SiStripApvGainMax_History;
1173 typedef SiStripApvGainProperties<SiStripPI::mean> SiStripApvGainMean_History;
1174 typedef SiStripApvGainProperties<SiStripPI::rms> SiStripApvGainRMS_History;
1180 class SiStripApvTIBGainByRunMeans :
public HistoryPlot<SiStripApvGain, float> {
1182 SiStripApvTIBGainByRunMeans()
1184 "average Tracker Inner Barrel APV gain value") {}
1185 ~SiStripApvTIBGainByRunMeans()
override =
default;
1188 std::vector<uint32_t> detid;
1192 float sumOfGains = 0;
1194 for (
const auto&
d : detid) {
1206 return sumOfGains / nAPVs;
1215 class SiStripApvTOBGainByRunMeans :
public HistoryPlot<SiStripApvGain, float> {
1217 SiStripApvTOBGainByRunMeans()
1219 ~SiStripApvTOBGainByRunMeans()
override =
default;
1222 std::vector<uint32_t> detid;
1226 float sumOfGains = 0;
1228 for (
const auto&
d : detid) {
1240 return sumOfGains / nAPVs;
1249 class SiStripApvTIDGainByRunMeans :
public HistoryPlot<SiStripApvGain, float> {
1251 SiStripApvTIDGainByRunMeans()
1254 ~SiStripApvTIDGainByRunMeans()
override =
default;
1257 std::vector<uint32_t> detid;
1261 float sumOfGains = 0;
1262 for (
const auto&
d : detid) {
1274 return sumOfGains / nAPVs;
1283 class SiStripApvTECGainByRunMeans :
public HistoryPlot<SiStripApvGain, float> {
1285 SiStripApvTECGainByRunMeans()
1287 "average Tracker Endcaps APV gain value") {}
1288 ~SiStripApvTECGainByRunMeans()
override =
default;
1291 std::vector<uint32_t> detid;
1295 float sumOfGains = 0;
1297 for (
const auto&
d : detid) {
1309 return sumOfGains / nAPVs;
1318 class SiStripApvGainsTest :
public Histogram1D<SiStripApvGain, SINGLE_IOV> {
1320 SiStripApvGainsTest()
1325 bool fill()
override {
1326 auto tag = PlotBase::getTag<0>();
1327 for (
auto const& iov :
tag.iovs) {
1328 std::shared_ptr<SiStripApvGain>
payload = Base::fetchPayload(std::get<1>(iov));
1330 std::vector<uint32_t> detid;
1335 for (
const auto&
d : detid) {
1342 std::map<unsigned int, SiStripDetSummary::Values>
map = summaryGain.getCounts();
1346 std::stringstream
ss;
1347 ss <<
"Summary of gain values:" << std::endl;
1348 summaryGain.print(
ss,
true);
1363 template <
int ntags, IOVMultiplicity nIOVs>
1364 class SiStripApvGainsComparatorBase :
public PlotImage<SiStripApvGain, nIOVs, ntags> {
1368 bool fill()
override {
1370 auto theIOVs = PlotBase::getTag<0>().iovs;
1371 auto tagname1 = PlotBase::getTag<0>().
name;
1373 auto firstiov = theIOVs.front();
1377 assert(this->m_plotAnnotations.ntags < 3);
1379 if (this->m_plotAnnotations.ntags == 2) {
1380 auto tag2iovs = PlotBase::getTag<1>().iovs;
1381 tagname2 = PlotBase::getTag<1>().
name;
1382 lastiov = tag2iovs.front();
1384 lastiov = theIOVs.back();
1387 std::shared_ptr<SiStripApvGain> last_payload = this->fetchPayload(std::get<1>(lastiov));
1388 std::shared_ptr<SiStripApvGain> first_payload = this->fetchPayload(std::get<1>(firstiov));
1393 std::vector<uint32_t> detid;
1394 last_payload->getDetIds(detid);
1396 std::map<std::pair<uint32_t, int>,
float> lastmap, firstmap;
1399 for (
const auto&
d : detid) {
1406 std::pair<uint32_t, int>
index = std::make_pair(
d, nAPV);
1412 first_payload->getDetIds(detid);
1415 for (
const auto&
d : detid) {
1422 std::pair<uint32_t, int>
index = std::make_pair(
d, nAPV);
1427 TCanvas
canvas(
"Payload comparison",
"payload comparison", 1400, 1000);
1430 std::map<std::string, std::shared_ptr<TH1F>>
ratios;
1431 std::map<std::string, std::shared_ptr<TH2F>> scatters;
1432 std::map<std::string, int> colormap;
1433 std::map<std::string, int> markermap;
1434 colormap[
"TIB"] = kRed;
1435 markermap[
"TIB"] = kFullCircle;
1436 colormap[
"TOB"] = kGreen;
1437 markermap[
"TOB"] = kFullTriangleUp;
1438 colormap[
"TID"] = kBlack;
1439 markermap[
"TID"] = kFullSquare;
1440 colormap[
"TEC"] = kBlue;
1441 markermap[
"TEC"] = kFullTriangleDown;
1443 std::vector<std::string>
parts = {
"TEC",
"TOB",
"TIB",
"TID"};
1447 Form(
"hRatio_%s",
part.c_str()),
1448 Form(
"Gains ratio IOV: %s/ IOV: %s ;Previous Gain (%s) / New Gain (%s);Number of APV",
1449 firstIOVsince.c_str(),
1450 lastIOVsince.c_str(),
1451 firstIOVsince.c_str(),
1452 lastIOVsince.c_str()),
1457 std::make_shared<TH2F>(Form(
"hScatter_%s",
part.c_str()),
1458 Form(
"new Gain (%s) vs previous Gain (%s);Previous Gain (%s);New Gain (%s)",
1459 lastIOVsince.c_str(),
1460 firstIOVsince.c_str(),
1461 firstIOVsince.c_str(),
1462 lastIOVsince.c_str()),
1472 for (
const auto&
item : firstmap) {
1482 scatters[
"TIB"]->Fill(firstmap[
index], lastmap[
index]);
1487 scatters[
"TOB"]->Fill(firstmap[
index], lastmap[
index]);
1492 scatters[
"TID"]->Fill(firstmap[
index], lastmap[
index]);
1497 scatters[
"TEC"]->Fill(firstmap[
index], lastmap[
index]);
1501 auto legend = TLegend(0.60, 0.8, 0.92, 0.95);
1502 legend.SetTextSize(0.05);
1504 canvas.cd(1)->SetTopMargin(0.05);
1505 canvas.cd(1)->SetLeftMargin(0.13);
1506 canvas.cd(1)->SetRightMargin(0.08);
1524 auto legend2 = TLegend(0.60, 0.8, 0.92, 0.95);
1525 legend2.SetTextSize(0.05);
1527 canvas.cd(2)->SetTopMargin(0.05);
1528 canvas.cd(2)->SetLeftMargin(0.13);
1529 canvas.cd(2)->SetRightMargin(0.08);
1533 scatters[
part]->SetStats(
false);
1534 scatters[
part]->SetMarkerColor(colormap[
part]);
1535 scatters[
part]->SetMarkerStyle(markermap[
part]);
1536 scatters[
part]->SetMarkerSize(0.5);
1538 auto temp = (TH2F*)(scatters[
part]->Clone());
1539 temp->SetMarkerSize(1.3);
1542 scatters[
part]->Draw(
"P");
1544 scatters[
part]->Draw(
"Psame");
1546 legend2.AddEntry(
temp,
part.c_str(),
"P");
1549 TLine diagonal(0.5, 0.5, 1.8, 1.8);
1550 diagonal.SetLineWidth(3);
1551 diagonal.SetLineStyle(2);
1552 diagonal.Draw(
"same");
1554 legend2.Draw(
"same");
1563 using SiStripApvGainsComparatorSingleTag = SiStripApvGainsComparatorBase<1, MULTI_IOV>;
1564 using SiStripApvGainsComparatorTwoTags = SiStripApvGainsComparatorBase<2, SINGLE_IOV>;
1570 class SiStripApvGainsTHStack :
public PlotImage<SiStripApvGain, SINGLE_IOV> {
1572 SiStripApvGainsTHStack()
1577 bool fill()
override {
1579 auto tag = PlotBase::getTag<0>();
1580 auto iov =
tag.iovs.front();
1582 std::shared_ptr<SiStripApvGain>
payload = this->fetchPayload(std::get<1>(iov));
1585 std::map<partition, std::shared_ptr<TH1F>> h_gains;
1588 std::vector<partition>
regions;
1590 std::vector<uint32_t> detid;
1594 for (
const auto&
d : detid) {
1596 auto region = this->getThePartition(
d);
1602 LogDebug(
"SiStripApvGainsTHStack") <<
"regions.size()=" <<
regions.size() << std::endl;
1604 for (
const auto& r :
regions) {
1609 h_gains[
r] = std::make_shared<TH1F>(Form(
"hGains_%s",
part.c_str()),
1610 Form(
"Gains values for IOV: %s ;Gain;Number of APV", IOVsince.c_str()),
1617 for (
const auto&
d : detid) {
1619 auto region = this->getThePartition(
d);
1627 TCanvas
canvas(
"Payload breakout",
"payload breakout", 1200, 800);
1630 std::array<int, 6>
colors = {{kRed, kBlue, kGreen, kCyan, 8, kMagenta}};
1632 THStack* hs =
new THStack(
"hs", Form(
"Gains values for IOV: %s;Gain;Number of APV", IOVsince.c_str()));
1633 int colorCounter = 0;
1634 for (
const auto& r :
regions) {
1635 hs->Add(h_gains[r].
get());
1637 h_gains[
r]->SetFillColor(
colors[colorCounter]);
1639 h_gains[
r]->SetLineWidth(2);
1643 TLegend
legend = TLegend(0.60, 0.65, 0.95, 0.93);
1644 legend.SetTextSize(0.05);
1645 legend.SetHeader(
"Gain break-out",
"C");
1646 for (
const auto& r :
regions) {
1648 legend.AddEntry(h_gains[r].
get(),
part.c_str(),
"F");
1652 canvas.cd(1)->SetTopMargin(0.07);
1653 canvas.cd(1)->SetBottomMargin(0.10);
1654 canvas.cd(1)->SetLeftMargin(0.15);
1655 canvas.cd(1)->SetRightMargin(0.05);
1659 auto stack = hs->GetHists();
1660 double maximum = hs->GetMaximum(
"nostack");
1662 TLegend legend2 = TLegend(0.70, 0.65, 0.95, 0.93);
1663 legend2.SetTextSize(0.05);
1664 legend2.SetHeader(
"Partition",
"C");
1666 for (
const auto&& elem : *
stack) {
1667 auto clone = (TH1F*)(elem->Clone(Form(
"hclone_%s", elem->GetName())));
1669 clone->SetFillColor(0);
1670 clone->SetMarkerStyle(20);
1673 clone->SetMaximum(maximum * 10);
1675 legend2.AddEntry(
clone,
candName.ReplaceAll(
"hclone_hGains_",
""),
"L");
1677 clone->Draw(
"HIST");
1679 clone->Draw(
"HISTsame");
1684 legend2.Draw(
"same");
1687 canvas.cd(2)->SetTopMargin(0.07);
1688 canvas.cd(2)->SetBottomMargin(0.10);
1689 canvas.cd(2)->SetLeftMargin(0.12);
1690 canvas.cd(2)->SetRightMargin(0.05);
1693 hs->GetYaxis()->SetMaxDigits(2);
1694 SiStripPI::makeNiceStyle<THStack>(hs);
1756 stereo = m_trackerTopo.
tibStereo(detid);
1761 stereo = m_trackerTopo.
tobStereo(detid);
1767 stereo = m_trackerTopo.
tecStereo(detid);
1773 stereo = m_trackerTopo.
tidStereo(detid);
1778 detNum +=
layer * 10 + stereo;
1787 template <
int ntags, IOVMultiplicity nIOVs>
1788 class SiStripApvGainsValuesComparatorBase :
public PlotImage<SiStripApvGain, nIOVs, ntags> {
1790 SiStripApvGainsValuesComparatorBase()
1793 bool fill()
override {
1794 TH1F::SetDefaultSumw2(
true);
1797 auto theIOVs = PlotBase::getTag<0>().iovs;
1798 auto tagname1 = PlotBase::getTag<0>().
name;
1800 auto firstiov = theIOVs.front();
1804 assert(this->m_plotAnnotations.ntags < 3);
1806 if (this->m_plotAnnotations.ntags == 2) {
1807 auto tag2iovs = PlotBase::getTag<1>().iovs;
1808 tagname2 = PlotBase::getTag<1>().
name;
1809 lastiov = tag2iovs.front();
1811 lastiov = theIOVs.back();
1814 std::shared_ptr<SiStripApvGain> last_payload = this->fetchPayload(std::get<1>(lastiov));
1815 std::shared_ptr<SiStripApvGain> first_payload = this->fetchPayload(std::get<1>(firstiov));
1820 std::vector<uint32_t> detid;
1821 last_payload->getDetIds(detid);
1823 std::map<std::pair<uint32_t, int>,
float> lastmap, firstmap;
1826 for (
const auto&
d : detid) {
1831 auto index = std::make_pair(
d, nAPV);
1837 first_payload->getDetIds(detid);
1840 for (
const auto&
d : detid) {
1845 auto index = std::make_pair(
d, nAPV);
1850 TCanvas
canvas(
"Payload comparison",
"payload comparison", 1000, 1000);
1853 TPad
pad1(
"pad1",
"pad1", 0, 0.3, 1, 1.0);
1854 pad1.SetBottomMargin(0.02);
1855 pad1.SetTopMargin(0.07);
1856 pad1.SetRightMargin(0.05);
1857 pad1.SetLeftMargin(0.15);
1862 std::make_shared<TH1F>(
"hFirstGains",
"SiStrip APV gains values; APV Gains;n. APVs", 200, 0.2, 1.8);
1864 std::make_shared<TH1F>(
"hLastGains",
"SiStrip APV gains values; APV Gains;n. APVs", 200, 0.2, 1.8);
1866 for (
const auto&
item : firstmap) {
1867 h_firstGains->Fill(
item.second);
1870 for (
const auto&
item : lastmap) {
1871 h_lastGains->Fill(
item.second);
1877 TH1F* hratio = (TH1F*)h_firstGains->Clone(
"hratio");
1879 h_firstGains->SetLineColor(kRed);
1880 h_lastGains->SetLineColor(kBlue);
1882 h_firstGains->SetMarkerColor(kRed);
1883 h_lastGains->SetMarkerColor(kBlue);
1885 h_firstGains->SetMarkerSize(1.);
1886 h_lastGains->SetMarkerSize(1.);
1888 h_firstGains->SetLineWidth(1);
1889 h_lastGains->SetLineWidth(1);
1891 h_firstGains->SetMarkerStyle(20);
1892 h_lastGains->SetMarkerStyle(21);
1894 h_firstGains->GetXaxis()->SetLabelOffset(2.);
1895 h_lastGains->GetXaxis()->SetLabelOffset(2.);
1897 h_firstGains->Draw(
"HIST");
1898 h_lastGains->Draw(
"HISTsame");
1900 TLegend
legend = TLegend(0.70, 0.7, 0.95, 0.9);
1901 legend.SetHeader(
"Gain Comparison",
"C");
1902 legend.AddEntry(h_firstGains.get(), (
"IOV: " +
std::to_string(std::get<0>(firstiov))).c_str(),
"PL");
1903 legend.AddEntry(h_lastGains.get(), (
"IOV: " +
std::to_string(std::get<0>(lastiov))).c_str(),
"PL");
1908 TPad
pad2(
"pad2",
"pad2", 0, 0.005, 1, 0.3);
1909 pad2.SetTopMargin(0.01);
1910 pad2.SetBottomMargin(0.2);
1911 pad2.SetRightMargin(0.05);
1912 pad2.SetLeftMargin(0.15);
1918 hratio->SetLineColor(kBlack);
1919 hratio->SetMarkerColor(kBlack);
1920 hratio->SetTitle(
"");
1921 hratio->SetMinimum(0.55);
1922 hratio->SetMaximum(1.55);
1923 hratio->SetStats(
false);
1924 hratio->Divide(h_lastGains.get());
1925 hratio->SetMarkerStyle(20);
1929 hratio->GetYaxis()->SetTitle(
1932 hratio->GetYaxis()->SetNdivisions(505);
1936 hratio->GetYaxis()->SetTitleSize(25);
1937 hratio->GetXaxis()->SetLabelSize(25);
1939 hratio->GetYaxis()->SetTitleFont(43);
1940 hratio->GetYaxis()->SetTitleOffset(2.5);
1941 hratio->GetYaxis()->SetLabelFont(43);
1942 hratio->GetYaxis()->SetLabelSize(25);
1945 hratio->GetXaxis()->SetTitleSize(30);
1946 hratio->GetXaxis()->SetTitleFont(43);
1947 hratio->GetXaxis()->SetTitle(
"SiStrip APV Gains");
1948 hratio->GetXaxis()->SetLabelFont(43);
1949 hratio->GetXaxis()->SetTitleOffset(3.);
1958 using SiStripApvGainsValuesComparatorSingleTag = SiStripApvGainsValuesComparatorBase<1, MULTI_IOV>;
1959 using SiStripApvGainsValuesComparatorTwoTags = SiStripApvGainsValuesComparatorBase<2, SINGLE_IOV>;
1965 template <
int ntags, IOVMultiplicity nIOVs>
1966 class SiStripApvGainsRatioComparatorByRegionBase :
public PlotImage<SiStripApvGain, nIOVs, ntags> {
1968 SiStripApvGainsRatioComparatorByRegionBase()
1973 bool fill()
override {
1978 auto theIOVs = PlotBase::getTag<0>().iovs;
1979 auto tagname1 = PlotBase::getTag<0>().
name;
1981 auto firstiov = theIOVs.front();
1985 assert(this->m_plotAnnotations.ntags < 3);
1987 if (this->m_plotAnnotations.ntags == 2) {
1988 auto tag2iovs = PlotBase::getTag<1>().iovs;
1989 tagname2 = PlotBase::getTag<1>().
name;
1990 lastiov = tag2iovs.front();
1992 lastiov = theIOVs.back();
1995 std::shared_ptr<SiStripApvGain> last_payload = this->fetchPayload(std::get<1>(lastiov));
1996 std::shared_ptr<SiStripApvGain> first_payload = this->fetchPayload(std::get<1>(firstiov));
2001 std::vector<uint32_t> detid;
2002 last_payload->getDetIds(detid);
2004 std::map<std::pair<uint32_t, int>,
float> lastmap, firstmap;
2007 for (
const auto&
d : detid) {
2014 std::pair<uint32_t, int>
index = std::make_pair(
d, nAPV);
2020 first_payload->getDetIds(detid);
2023 for (
const auto&
d : detid) {
2030 std::pair<uint32_t, int>
index = std::make_pair(
d, nAPV);
2035 TCanvas
canvas(
"Payload comparison by Tracker Region",
"payload comparison by Tracker Region", 1800, 800);
2038 auto h2first = std::make_unique<TH2F>(
2039 "byRegion1",
"SiStrip APV Gain values by region;; average SiStrip Gain", 38, 1., 39., 100., 0., 2.);
2040 auto h2last = std::make_unique<TH2F>(
2041 "byRegion2",
"SiStrip APV Gain values by region;; average SiStrip Gain", 38, 1., 39., 100., 0., 2.);
2043 auto h2ratio = std::make_unique<TH2F>(
"byRegionRatio",
2044 Form(
"SiStrip APV Gains ratio by region;; Gains ratio IOV: %s/ IOV %s",
2045 lastIOVsince.c_str(),
2046 firstIOVsince.c_str()),
2054 h2first->SetStats(
false);
2055 h2last->SetStats(
false);
2056 h2ratio->SetStats(
false);
2058 canvas.cd(1)->SetBottomMargin(0.18);
2059 canvas.cd(1)->SetLeftMargin(0.12);
2060 canvas.cd(1)->SetRightMargin(0.05);
2063 std::vector<int> boundaries;
2067 for (
const auto& element : lastmap) {
2068 auto region = this->getTheRegion(element.first.first);
2072 h2last->Fill(
bin, element.second);
2073 h2last->GetXaxis()->SetBinLabel(
bin,
label);
2074 h2ratio->Fill(
bin, element.second / firstmap[element.first]);
2075 h2ratio->GetXaxis()->SetBinLabel(
bin,
label);
2078 for (
const auto& element : firstmap) {
2079 auto region = this->getTheRegion(element.first.first);
2083 h2first->Fill(
bin, element.second);
2084 h2first->GetXaxis()->SetBinLabel(
bin,
label);
2087 h2first->GetXaxis()->LabelsOption(
"v");
2088 h2last->GetXaxis()->LabelsOption(
"v");
2089 h2ratio->GetXaxis()->LabelsOption(
"v");
2091 h2last->SetLineColor(kBlue);
2092 h2first->SetLineColor(kRed);
2093 h2first->SetFillColor(kRed);
2095 h2first->SetMarkerStyle(20);
2096 h2last->SetMarkerStyle(21);
2098 h2first->SetMarkerColor(kRed);
2099 h2last->SetMarkerColor(kBlue);
2102 h2first->Draw(
"BOX");
2103 h2last->Draw(
"BOXsame");
2105 TLegend
legend = TLegend(0.70, 0.8, 0.95, 0.9);
2106 legend.SetHeader(
"Gain Comparison",
"C");
2107 legend.AddEntry(h2first.get(), (
"IOV: " +
std::to_string(std::get<0>(firstiov))).c_str(),
"F");
2112 canvas.cd(2)->SetBottomMargin(0.18);
2113 canvas.cd(2)->SetLeftMargin(0.12);
2114 canvas.cd(2)->SetRightMargin(0.12);
2116 h2ratio->Draw(
"COLZ");
2117 auto hpfx_tmp = (TProfile*)(h2ratio->ProfileX(
"_pfx", 1, -1,
"o"));
2118 hpfx_tmp->SetStats(kFALSE);
2119 hpfx_tmp->SetMarkerColor(kRed);
2120 hpfx_tmp->SetLineColor(kRed);
2121 hpfx_tmp->SetMarkerSize(1.2);
2122 hpfx_tmp->SetMarkerStyle(20);
2123 hpfx_tmp->Draw(
"same");
2143 stereo = m_trackerTopo.
tibStereo(detid);
2148 stereo = m_trackerTopo.
tobStereo(detid);
2154 stereo = m_trackerTopo.
tecStereo(detid);
2160 stereo = m_trackerTopo.
tidStereo(detid);
2165 detNum +=
layer * 10 + stereo;
2170 using SiStripApvGainsRatioComparatorByRegionSingleTag = SiStripApvGainsRatioComparatorByRegionBase<1, MULTI_IOV>;
2171 using SiStripApvGainsRatioComparatorByRegionTwoTags = SiStripApvGainsRatioComparatorByRegionBase<2, SINGLE_IOV>;
2177 template <
int ntags, IOVMultiplicity nIOVs>
2178 class SiStripApvGainsComparatorByRegionBase :
public PlotImage<SiStripApvGain, nIOVs, ntags> {
2180 SiStripApvGainsComparatorByRegionBase()
2185 bool fill()
override {
2187 auto theIOVs = PlotBase::getTag<0>().iovs;
2188 auto tagname1 = PlotBase::getTag<0>().
name;
2190 auto firstiov = theIOVs.front();
2194 assert(this->m_plotAnnotations.ntags < 3);
2196 if (this->m_plotAnnotations.ntags == 2) {
2197 auto tag2iovs = PlotBase::getTag<1>().iovs;
2198 tagname2 = PlotBase::getTag<1>().
name;
2199 lastiov = tag2iovs.front();
2201 lastiov = theIOVs.back();
2204 std::shared_ptr<SiStripApvGain> last_payload = this->fetchPayload(std::get<1>(lastiov));
2205 std::shared_ptr<SiStripApvGain> first_payload = this->fetchPayload(std::get<1>(firstiov));
2207 std::vector<uint32_t> detid;
2208 last_payload->getDetIds(detid);
2212 for (
const auto&
d : detid) {
2215 summaryLastGain.add(
d, last_payload->getApvGain(
it,
range));
2221 for (
const auto&
d : detid) {
2224 summaryFirstGain.add(
d, first_payload->getApvGain(
it,
range));
2228 std::map<unsigned int, SiStripDetSummary::Values> firstmap = summaryFirstGain.getCounts();
2229 std::map<unsigned int, SiStripDetSummary::Values> lastmap = summaryLastGain.getCounts();
2232 TCanvas
canvas(
"Region summary",
"region summary", 1200, 1000);
2235 auto hfirst = std::make_unique<TH1F>(
"byRegion1",
2236 "SiStrip APV Gain average by region;; average SiStrip Gain",
2240 auto hlast = std::make_unique<TH1F>(
2241 "byRegion2",
"SiStrip APV Gain average by region;; average SiStrip Gain", lastmap.size(), 0., lastmap.size());
2243 hfirst->SetStats(
false);
2244 hlast->SetStats(
false);
2246 canvas.SetBottomMargin(0.18);
2247 canvas.SetLeftMargin(0.12);
2248 canvas.SetRightMargin(0.05);
2251 std::vector<int> boundaries;
2252 unsigned int iBin = 0;
2257 for (
const auto& element : lastmap) {
2259 int count = element.second.count;
2260 double mean = (element.second.mean) /
count;
2262 if (currentDetector.empty())
2263 currentDetector =
"TIB";
2265 switch ((element.first) / 1000) {
2280 hlast->SetBinContent(iBin,
mean);
2281 hlast->SetBinError(iBin,
mean / 10000.);
2283 hlast->GetXaxis()->LabelsOption(
"v");
2286 boundaries.push_back(iBin);
2294 for (
const auto& element : firstmap) {
2296 int count = element.second.count;
2297 double mean = (element.second.mean) /
count;
2299 hfirst->SetBinContent(iBin,
mean);
2300 hfirst->SetBinError(iBin,
mean / 10000.);
2302 hfirst->GetXaxis()->LabelsOption(
"v");
2306 hlast->GetYaxis()->SetRangeUser(extrema.first, extrema.second);
2308 hlast->SetMarkerStyle(20);
2309 hlast->SetMarkerSize(1);
2311 hlast->Draw(
"Psame");
2313 hfirst->SetMarkerStyle(18);
2314 hfirst->SetMarkerSize(1);
2315 hfirst->SetLineColor(kBlue);
2316 hfirst->SetMarkerColor(kBlue);
2317 hfirst->Draw(
"E1same");
2318 hfirst->Draw(
"Psame");
2323 TLine
l[boundaries.size()];
2325 for (
const auto&
line : boundaries) {
2327 hfirst->GetBinLowEdge(
line),
canvas.cd()->GetUymin(), hfirst->GetBinLowEdge(
line),
canvas.cd()->GetUymax());
2328 l[
i].SetLineWidth(1);
2329 l[
i].SetLineStyle(9);
2330 l[
i].SetLineColor(2);
2335 TLegend
legend = TLegend(0.70, 0.8, 0.95, 0.9);
2336 legend.SetHeader(
"Gain Comparison",
"C");
2337 legend.AddEntry(hfirst.get(), (
"IOV: " +
std::to_string(std::get<0>(firstiov))).c_str(),
"PL");
2351 using SiStripApvGainsComparatorByRegionSingleTag = SiStripApvGainsComparatorByRegionBase<1, MULTI_IOV>;
2352 using SiStripApvGainsComparatorByRegionTwoTags = SiStripApvGainsComparatorByRegionBase<2, SINGLE_IOV>;
2358 class SiStripApvGainsByRegion :
public PlotImage<SiStripApvGain, SINGLE_IOV> {
2360 SiStripApvGainsByRegion()
2365 bool fill()
override {
2366 auto tag = PlotBase::getTag<0>();
2367 auto iov =
tag.iovs.front();
2368 std::shared_ptr<SiStripApvGain>
payload = fetchPayload(std::get<1>(iov));
2370 std::vector<uint32_t> detid;
2375 for (
const auto&
d : detid) {
2382 std::map<unsigned int, SiStripDetSummary::Values>
map = summaryGain.getCounts();
2385 TCanvas
canvas(
"Region summary",
"region summary", 1200, 1000);
2387 auto h1 = std::make_unique<TH1F>(
2388 "byRegion",
"SiStrip Gain average by region;; average SiStrip Gain",
map.size(), 0.,
map.size());
2389 h1->SetStats(
false);
2390 canvas.SetBottomMargin(0.18);
2391 canvas.SetLeftMargin(0.12);
2392 canvas.SetRightMargin(0.05);
2395 std::vector<int> boundaries;
2396 unsigned int iBin = 0;
2401 for (
const auto& element :
map) {
2403 int count = element.second.count;
2404 double mean = (element.second.mean) /
count;
2406 if (currentDetector.empty())
2407 currentDetector =
"TIB";
2409 switch ((element.first) / 1000) {
2424 h1->SetBinContent(iBin,
mean);
2426 h1->GetXaxis()->LabelsOption(
"v");
2429 boundaries.push_back(iBin);
2434 h1->SetMarkerStyle(20);
2435 h1->SetMarkerSize(1);
2441 TLine
l[boundaries.size()];
2443 for (
const auto&
line : boundaries) {
2445 l[
i].SetLineWidth(1);
2446 l[
i].SetLineStyle(9);
2447 l[
i].SetLineColor(2);
2452 TLegend
legend = TLegend(0.52, 0.82, 0.95, 0.9);
2453 legend.SetHeader((std::get<1>(iov)).c_str(),
"C");
2455 legend.SetTextSize(0.025);
static constexpr auto TEC
unsigned int tobLayer(const DetId &id) const
std::pair< int, const char * > regionType(int index)
uint32_t tidStereo(const DetId &id) const
unsigned int tidSide(const DetId &id) const
unsigned int tidWheel(const DetId &id) const
unsigned int tecWheel(const DetId &id) const
ALPAKA_FN_ACC int side(int ieta, int iphi)
void setPaletteStyle(SiStripPI::palette palette)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
static std::string to_string(const XMLCh *ch)
std::tuple< cond::Time_t, cond::Hash > MetaData
std::pair< float, float > getTheRange(std::map< uint32_t, float > values, const float nsigma)
#define PAYLOAD_INSPECTOR_CLASS(CLASS_NAME)
std::pair< float, float > getExtrema(TH1 *h1, TH1 *h2)
uint32_t tobStereo(const DetId &id) const
void drawStatBox(std::map< std::string, std::shared_ptr< TH1F >> histos, std::map< std::string, int > colormap, std::vector< std::string > legend, double X=0.15, double Y=0.93, double W=0.15, double H=0.10)
unsigned int tecSide(const DetId &id) const
Abs< T >::type abs(const T &t)
std::pair< ContainerIterator, ContainerIterator > Range
void makeNicePlotStyle(TH1 *hist)
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto TOB
#define PAYLOAD_INSPECTOR_MODULE(PAYLOAD_TYPENAME)
std::string estimatorType(SiStripPI::estimator e)
Log< level::Warning, true > LogPrint
const std::map< std::string, std::string > & inputParamValues() const
void addInputParam(const std::string ¶mName)
static constexpr auto TIB
TEveGeoShape * clone(const TEveElement *element, TEveElement *parent)
char data[epos_bytes_allocation]
TrackerTopology fromTrackerParametersXMLFile(const std::string &xmlFileName)
uint32_t tecStereo(const DetId &id) const
unsigned int tibLayer(const DetId &id) const
Log< level::Warning, false > LogWarning
T mod(const T &a, const T &b)
static constexpr auto TID
uint32_t tibStereo(const DetId &id) const