64 gainToken_ = esConsumes<edm::Transition::BeginRun>();
72 static constexpr float defaultGainTick = 690. / 640.;
77 if (!gainHandle.isValid()) {
78 edm::LogError(
"SiStripGainPCLHarvester") <<
"gainHandle is not valid\n";
90 APV->isMasked = stripQuality.IsApvBad(
APV->DetId,
APV->APVId);
92 if (gainHandle->getNumberOfTags() != 2) {
93 edm::LogError(
"SiStripGainPCLHarvester") <<
"NUMBER OF GAIN TAG IS EXPECTED TO BE 2\n";
97 float newPreviousGain = gainHandle->getApvGain(
APV->APVId, gainHandle->getRange(
APV->DetId, 1), 1);
98 if (
APV->PreviousGain != 1 and newPreviousGain !=
APV->PreviousGain)
99 edm::LogWarning(
"SiStripGainPCLHarvester") <<
"WARNING: ParticleGain in the global tag changed\n";
100 APV->PreviousGain = newPreviousGain;
102 float newPreviousGainTick =
103 APV->isMasked ? defaultGainTick : gainHandle->getApvGain(
APV->APVId, gainHandle->getRange(
APV->DetId, 0), 0);
104 if (
APV->PreviousGainTick != 1 and newPreviousGainTick !=
APV->PreviousGainTick) {
106 <<
"WARNING: TickMarkGain in the global tag changed\n" 108 <<
" APV->SubDet: " <<
APV->SubDet <<
" APV->APVId:" <<
APV->APVId << std::endl
109 <<
" APV->PreviousGainTick: " <<
APV->PreviousGainTick <<
" newPreviousGainTick: " << newPreviousGainTick
112 APV->PreviousGainTick = newPreviousGainTick;
118 edm::LogInfo(
"SiStripGainsPCLHarvester") <<
"Starting harvesting statistics" << std::endl;
123 if (!stag.empty() && stag[0] !=
'_')
124 stag.insert(0, 1,
'_');
130 if (Charge_Vs_Index ==
nullptr) {
132 <<
"Harvesting: could not retrieve " << cvi.c_str() <<
", statistics will not be summed!" << std::endl;
135 <<
"Harvesting " << (Charge_Vs_Index)->getTH2S()->GetEntries() <<
" more clusters" << std::endl;
139 std::unique_ptr<SiStripApvGain> theAPVGains = this->
getNewObject(Charge_Vs_Index);
148 throw std::runtime_error(
"PoolDBService required.");
150 edm::LogInfo(
"SiStripGainsPCLHarvester") <<
"Will not produce payload!" << std::endl;
157 if (Charge_Vs_Index !=
nullptr) {
161 <<
"Harvesting: could not retrieve " << cvi.c_str() <<
"Tree won't be stored" << std::endl;
171 std::vector<APVGain::APVmon> new_charge_histos;
172 std::vector<std::pair<std::string, std::string>> cnames =
174 for (
unsigned int i = 0;
i < cnames.size();
i++) {
188 ibooker_.
book2DD(
"MPVvsEtaTIB",
"MPV vs Eta TIB", 50, -3.0, 3.0, MPVbin, MPVmin, MPVmax);
190 ibooker_.
book2DD(
"MPVvsEtaTID",
"MPV vs Eta TID", 50, -3.0, 3.0, MPVbin, MPVmin, MPVmax);
192 ibooker_.
book2DD(
"MPVvsEtaTOB",
"MPV vs Eta TOB", 50, -3.0, 3.0, MPVbin, MPVmin, MPVmax);
194 ibooker_.
book2DD(
"MPVvsEtaTEC",
"MPV vs Eta TEC", 50, -3.0, 3.0, MPVbin, MPVmin, MPVmax);
196 ibooker_.
book2DD(
"MPVvsEtaTEC1",
"MPV vs Eta TEC-thin", 50, -3.0, 3.0, MPVbin, MPVmin, MPVmax);
198 ibooker_.
book2DD(
"MPVvsEtaTEC2",
"MPV vs Eta TEC-thick", 50, -3.0, 3.0, MPVbin, MPVmin, MPVmax);
201 ibooker_.
book2DD(
"MPVvsPhiTIB",
"MPV vs Phi TIB", 50, -3.4, 3.4, MPVbin, MPVmin, MPVmax);
203 ibooker_.
book2DD(
"MPVvsPhiTID",
"MPV vs Phi TID", 50, -3.4, 3.4, MPVbin, MPVmin, MPVmax);
205 ibooker_.
book2DD(
"MPVvsPhiTOB",
"MPV vs Phi TOB", 50, -3.4, 3.4, MPVbin, MPVmin, MPVmax);
207 ibooker_.
book2DD(
"MPVvsPhiTEC",
"MPV vs Phi TEC", 50, -3.4, 3.4, MPVbin, MPVmin, MPVmax);
209 ibooker_.
book2DD(
"MPVvsPhiTEC1",
"MPV vs Phi TEC-thin ", 50, -3.4, 3.4, MPVbin, MPVmin, MPVmax);
211 ibooker_.
book2DD(
"MPVvsPhiTEC2",
"MPV vs Phi TEC-thick", 50, -3.4, 3.4, MPVbin, MPVmin, MPVmax);
213 MonitorElement* NoMPVfit = ibooker_.
book2DD(
"NoMPVfit",
"Modules with bad Landau Fit", 350, -350, 350, 240, 0, 120);
214 MonitorElement* NoMPVmasked = ibooker_.
book2DD(
"NoMPVmasked",
"Masked Modules", 350, -350, 350, 240, 0, 120);
229 MonitorElement* MPVsTECthick = ibooker_.
book1DD(
"MPV_TEC2",
"MPV TEC thick", MPVbin, MPVmin, MPVmax);
236 MonitorElement* MPVErrorVsMPV = ibooker_.
book2DD(
"MPVErrorVsMPV",
"MPV Error vs MPV", 300, 0, 600, 150, 0, 150);
237 MonitorElement* MPVErrorVsEta = ibooker_.
book2DD(
"MPVErrorVsEta",
"MPV Error vs Eta", 50, -3.0, 3.0, 150, 0, 150);
238 MonitorElement* MPVErrorVsPhi = ibooker_.
book2DD(
"MPVErrorVsPhi",
"MPV Error vs Phi", 50, -3.4, 3.4, 150, 0, 150);
239 MonitorElement* MPVErrorVsN = ibooker_.
book2DD(
"MPVErrorVsN",
"MPV Error vs N", 500, 0, 1000, 150, 0, 150);
241 MonitorElement* DiffWRTPrevGainTIB = ibooker_.
book1DD(
"DiffWRTPrevGainTIB",
"Diff w.r.t. PrevGain TIB", 250, 0, 2);
242 MonitorElement* DiffWRTPrevGainTID = ibooker_.
book1DD(
"DiffWRTPrevGainTID",
"Diff w.r.t. PrevGain TID", 250, 0, 2);
243 MonitorElement* DiffWRTPrevGainTOB = ibooker_.
book1DD(
"DiffWRTPrevGainTOB",
"Diff w.r.t. PrevGain TOB", 250, 0, 2);
244 MonitorElement* DiffWRTPrevGainTEC = ibooker_.
book1DD(
"DiffWRTPrevGainTEC",
"Diff w.r.t. PrevGain TEC", 250, 0, 2);
247 ibooker_.
book2DD(
"GainVsPrevGainTIB",
"Gain vs PrevGain TIB", 100, 0, 2, 100, 0, 2);
249 ibooker_.
book2DD(
"GainVsPrevGainTID",
"Gain vs PrevGain TID", 100, 0, 2, 100, 0, 2);
251 ibooker_.
book2DD(
"GainVsPrevGainTOB",
"Gain vs PrevGain TOB", 100, 0, 2, 100, 0, 2);
253 ibooker_.
book2DD(
"GainVsPrevGainTEC",
"Gain vs PrevGain TEC", 100, 0, 2, 100, 0, 2);
260 unsigned int Index =
APV->Index;
264 float Eta =
APV->Eta;
267 float Thickness =
APV->Thickness;
268 double FitMPV =
APV->FitMPV;
269 double FitMPVErr =
APV->FitMPVErr;
271 double NEntries =
APV->NEntries;
272 double PreviousGain =
APV->PreviousGain;
280 if (!Charge_Vs_Index)
282 TH2S* chvsidx = (Charge_Vs_Index)->getTH2S();
283 int bin = chvsidx->GetXaxis()->FindBin(Index);
284 TH1D* Proj = chvsidx->ProjectionY(
"proj",
bin,
bin);
285 for (
int binId = 0; binId < Proj->GetXaxis()->GetNbins(); binId++) {
286 double new_charge = Proj->GetXaxis()->GetBinCenter(binId) /
Gain;
287 if (Proj->GetBinContent(binId) != 0.) {
288 for (
unsigned int h = 0;
h < charge_histos.size();
h++) {
289 TH1D* chisto = (charge_histos[
h])->getTH1D();
290 for (
int e = 0;
e < Proj->GetBinContent(binId);
e++)
291 chisto->Fill(new_charge);
308 if (Thickness < 0.04)
309 MPVs320->
Fill(FitMPV);
310 if (Thickness > 0.04)
311 MPVs500->
Fill(FitMPV);
313 MPVError->
Fill(FitMPVErr);
314 MPVErrorVsMPV->
Fill(FitMPV, FitMPVErr);
315 MPVErrorVsEta->
Fill(Eta, FitMPVErr);
316 MPVErrorVsPhi->
Fill(
Phi, FitMPVErr);
317 MPVErrorVsN->
Fill(NEntries, FitMPVErr);
320 MPV_Vs_EtaTIB->
Fill(Eta, FitMPV);
321 MPV_Vs_PhiTIB->
Fill(
Phi, FitMPV);
322 MPVsTIB->
Fill(FitMPV);
325 MPV_Vs_EtaTID->
Fill(Eta, FitMPV);
326 MPV_Vs_PhiTID->
Fill(
Phi, FitMPV);
327 MPVsTID->
Fill(FitMPV);
329 MPVsTIDM->
Fill(FitMPV);
331 MPVsTIDP->
Fill(FitMPV);
334 MPV_Vs_EtaTOB->
Fill(Eta, FitMPV);
335 MPV_Vs_PhiTOB->
Fill(
Phi, FitMPV);
336 MPVsTOB->
Fill(FitMPV);
339 MPV_Vs_EtaTEC->
Fill(Eta, FitMPV);
340 MPV_Vs_PhiTEC->
Fill(
Phi, FitMPV);
341 MPVsTEC->
Fill(FitMPV);
343 MPVsTECM->
Fill(FitMPV);
345 MPVsTECP->
Fill(FitMPV);
346 if (Thickness < 0.04) {
347 MPV_Vs_EtaTECthin->
Fill(Eta, FitMPV);
348 MPV_Vs_PhiTECthin->
Fill(
Phi, FitMPV);
349 MPVsTECthin->
Fill(FitMPV);
351 MPVsTECP1->
Fill(FitMPV);
353 MPVsTECM1->
Fill(FitMPV);
355 if (Thickness > 0.04) {
356 MPV_Vs_EtaTECthick->
Fill(Eta, FitMPV);
357 MPV_Vs_PhiTECthick->
Fill(
Phi, FitMPV);
358 MPVsTECthick->
Fill(FitMPV);
360 MPVsTECP2->
Fill(FitMPV);
362 MPVsTECM2->
Fill(FitMPV);
367 if (
SubDet == 3 && PreviousGain != 0.)
368 DiffWRTPrevGainTIB->
Fill(
Gain / PreviousGain);
369 else if (
SubDet == 4 && PreviousGain != 0.)
370 DiffWRTPrevGainTID->
Fill(
Gain / PreviousGain);
371 else if (
SubDet == 5 && PreviousGain != 0.)
372 DiffWRTPrevGainTOB->
Fill(
Gain / PreviousGain);
373 else if (
SubDet == 6 && PreviousGain != 0.)
374 DiffWRTPrevGainTEC->
Fill(
Gain / PreviousGain);
377 GainVsPrevGainTIB->
Fill(PreviousGain,
Gain);
379 GainVsPrevGainTID->
Fill(PreviousGain,
Gain);
381 GainVsPrevGainTOB->
Fill(PreviousGain,
Gain);
383 GainVsPrevGainTEC->
Fill(PreviousGain,
Gain);
389 std::pair<double, double> findFitRange(TH1* inputHisto) {
392 auto charge_clone = std::unique_ptr<TH1D>(
dynamic_cast<TH1D*
>(inputHisto->Rebin(10,
"charge_clone")));
394 float max_content = -1;
396 for (
int i = 1;
i < charge_clone->GetNbinsX() + 1; ++
i) {
397 const auto bin_content = charge_clone->GetBinContent(
i);
398 const auto bin_center = charge_clone->GetXaxis()->GetBinCenter(
i);
399 if ((bin_content > max_content) && (bin_center > 100.)) {
400 max_content = bin_content;
404 return std::pair<double, double>(
xMax - 100.,
xMax + 500.);
407 Double_t langaufun(Double_t*
x, Double_t* par) {
409 Double_t invsq2pi = 0.3989422804014;
410 Double_t mpshift = -0.22278298;
426 mpc = par[1] - mpshift * par[0];
429 xlow =
x[0] - sc * par[3];
430 xupp =
x[0] + sc * par[3];
432 step = (xupp - xlow) /
np;
435 for (
i = 1.0;
i <=
np / 2;
i++) {
437 fland = TMath::Landau(
xx, mpc, par[0]) / par[0];
438 sum += fland * TMath::Gaus(
x[0],
xx, par[3]);
441 fland = TMath::Landau(
xx, mpc, par[0]) / par[0];
443 sum += fland * TMath::Gaus(
x[0],
xx, par[3]);
446 return (par[2] *
step * sum * invsq2pi / par[3]);
449 std::unique_ptr<TF1> langaufit(TH1D* his,
451 Double_t* startvalues,
452 Double_t* parlimitslo,
453 Double_t* parlimitshi,
461 sprintf(FunName,
"Fitfcn_%s", his->GetName());
463 TF1* ffitold =
dynamic_cast<TF1*
>(gROOT->GetListOfFunctions()->FindObject(FunName));
467 auto ffit = std::make_unique<TF1>(FunName, langaufun, fitrange[0], fitrange[1], 4);
469 ffit->SetParameters(startvalues);
470 ffit->SetParNames(
"Width",
"MP",
"Area",
"GSigma");
472 for (
i = 0;
i < 4;
i++) {
473 ffit->SetParLimits(
i, parlimitslo[
i], parlimitshi[
i]);
476 his->Fit(FunName,
"QRB0");
478 ffit->GetParameters(fitparams);
479 for (
i = 0;
i < 4;
i++) {
480 fiterrors[
i] = ffit->GetParError(
i);
482 ChiSqr[0] = ffit->GetChisquare();
483 NDF[0] = ffit->GetNDF();
492 TH1D* Proj =
nullptr;
494 double FitResults[6] = {DEF_F, DEF_F, DEF_F, DEF_F, DEF_F, DEF_F};
495 double MPVmean = 300;
497 if (Charge_Vs_Index ==
nullptr) {
499 <<
"Harvesting: could not execute algoComputeMPVandGain method because " <<
m_calibrationMode 500 <<
" statistics cannot be retrieved.\n" 501 <<
"Please check if input contains " <<
m_calibrationMode <<
" data." << std::endl;
505 TH2S* chvsidx = (Charge_Vs_Index)->getTH2S();
507 printf(
"Progressing Bar :0%% 20%% 40%% 60%% 80%% 100%%\n");
508 printf(
"Fitting Charge Distribution :");
509 int TreeStep =
APVsColl.size() / 50;
512 if (
I % TreeStep == 0) {
516 std::shared_ptr<stAPVGain>
APV =
it->second;
518 APV->Bin = chvsidx->GetXaxis()->FindBin(
APV->Index);
521 APV->Gain =
APV->PreviousGain;
526 Proj = chvsidx->ProjectionY(
527 "", chvsidx->GetXaxis()->FindBin(
APV->Index), chvsidx->GetXaxis()->FindBin(
APV->Index),
"e");
533 int SecondAPVId =
APV->APVId;
534 if (SecondAPVId % 2 == 0) {
535 SecondAPVId = SecondAPVId + 1;
537 SecondAPVId = SecondAPVId - 1;
539 std::shared_ptr<stAPVGain> APV2 =
APVsColl[(
APV->DetId << 4) | SecondAPVId];
541 APV2->Bin = chvsidx->GetXaxis()->FindBin(APV2->Index);
542 TH1D* Proj2 = chvsidx->ProjectionY(
"", APV2->Bin, APV2->Bin,
"e");
548 for (
unsigned int i = 0;
i < 16;
i++) {
552 std::shared_ptr<stAPVGain> APV2 = tmpit->second;
553 if (APV2->DetId !=
APV->DetId || APV2->APVId ==
APV->APVId)
556 APV2->Bin = chvsidx->GetXaxis()->FindBin(APV2->Index);
557 TH1D* Proj2 = chvsidx->ProjectionY(
"", APV2->Bin, APV2->Bin,
"e");
568 std::pair<double, double> fitRange{50., 5400.};
570 fitRange = findFitRange(Proj);
573 const bool isTOBL5L6 =
582 assert(FitResults[0] != DEF_F);
584 APV->FitMPV = FitResults[0];
585 APV->FitMPVErr = FitResults[1];
586 APV->FitWidth = FitResults[2];
587 APV->FitWidthErr = FitResults[3];
588 APV->FitChi2 = FitResults[4];
589 APV->FitNorm = FitResults[5];
590 APV->NEntries = Proj->GetEntries();
593 if (
APV->FitChi2 <= 0.1) {
595 <<
"fit failed on this APV:" <<
APV->DetId <<
":" <<
APV->APVId <<
" !" << std::endl;
597 std::fill(FitResults, FitResults + 6, 0);
598 fitRange = std::make_pair(50., 5400.);
602 getPeakOfLandau(Proj, FitResults, fitRange.first, fitRange.second,
false);
604 APV->FitMPV = FitResults[0];
605 APV->FitMPVErr = FitResults[1];
606 APV->FitWidth = FitResults[2];
607 APV->FitWidthErr = FitResults[3];
608 APV->FitChi2 = FitResults[4];
609 APV->FitNorm = FitResults[5];
610 APV->NEntries = Proj->GetEntries();
616 APV->Gain =
APV->FitMPV / MPVmean;
620 APV->Gain =
APV->PreviousGain;
634 TH1* InputHisto,
double* FitResults,
double LowRange,
double HighRange,
bool gaussianConvolution) {
636 FitResults[0] = -0.5;
638 FitResults[2] = -0.5;
640 FitResults[4] = -0.5;
646 if (gaussianConvolution) {
648 Double_t fr[2] = {LowRange, HighRange};
649 Double_t
sv[4] = {25., 300., InputHisto->Integral(), 40.};
650 Double_t pllo[4] = {0.5, 100., 1.0, 0.4};
651 Double_t plhi[4] = {100., 500., 1.e7, 100.};
652 Double_t
fp[4], fpe[4];
655 auto fitsnr = langaufit(dynamic_cast<TH1D*>(InputHisto), fr,
sv, pllo, plhi,
fp, fpe, &chisqr, &ndf);
656 FitResults[0] = fitsnr->GetMaximumX();
657 FitResults[1] = fpe[1];
658 FitResults[2] =
fp[0];
659 FitResults[3] = fpe[0];
660 FitResults[4] = chisqr / ndf;
661 FitResults[5] =
fp[2];
664 TF1 MyLandau(
"MyLandau",
"landau", LowRange, HighRange);
665 MyLandau.SetParameter(1, 300);
666 InputHisto->Fit(&MyLandau,
"0QR WW");
668 FitResults[0] = MyLandau.GetParameter(1);
669 FitResults[1] = MyLandau.GetParError(1);
670 FitResults[2] = MyLandau.GetParameter(2);
671 FitResults[3] = MyLandau.GetParError(2);
672 FitResults[4] = MyLandau.GetChisquare() / MyLandau.GetNDF();
673 FitResults[5] = MyLandau.GetParameter(0);
679 if (FitResults[0] <= 0)
695 auto const&
Det = newBareTkGeomPtr->dets();
697 unsigned int Index = 0;
699 for (
unsigned int i = 0;
i <
Det.size();
i++) {
710 unsigned int NAPV = Topo.
nstrips() / 128;
712 for (
unsigned int j = 0;
j < NAPV;
j++) {
713 auto APV = std::make_shared<stAPVGain>();
720 APV->Side = bareTkTopoPtr->tidSide(Detid);
722 APV->Side = bareTkTopoPtr->tecSide(Detid);
730 APV->FitWidthErr = -1;
735 APV->PreviousGain = 1;
736 APV->PreviousGainTick = 1;
737 APV->x = DetUnit->position().basicVector().x();
738 APV->y = DetUnit->position().basicVector().y();
739 APV->z = DetUnit->position().basicVector().z();
740 APV->Eta = DetUnit->position().basicVector().eta();
741 APV->Phi = DetUnit->position().basicVector().phi();
742 APV->R = DetUnit->position().basicVector().transverse();
743 APV->Thickness = DetUnit->surface().bounds().thickness();
745 APV->isMasked =
false;
755 for (
unsigned int i = 0;
i <
Det.size();
765 unsigned int NROCRow = Topo.
nrows() / (80.);
766 unsigned int NROCCol = Topo.
ncolumns() / (52.);
768 for (
unsigned int j = 0;
j < NROCRow;
j++) {
769 for (
unsigned int i = 0;
i < NROCCol;
i++) {
770 auto APV = std::make_shared<stAPVGain>();
775 APV->APVId = (
j << 3 |
i);
780 APV->FitWidthErr = -1;
784 APV->PreviousGain = 1;
785 APV->PreviousGainTick = 1;
786 APV->x = DetUnit->position().basicVector().x();
787 APV->y = DetUnit->position().basicVector().y();
788 APV->z = DetUnit->position().basicVector().z();
789 APV->Eta = DetUnit->position().basicVector().eta();
790 APV->Phi = DetUnit->position().basicVector().phi();
791 APV->R = DetUnit->position().basicVector().transverse();
792 APV->Thickness = DetUnit->surface().bounds().thickness();
793 APV->isMasked =
false;
814 if (Charge_Vs_Index ==
nullptr) {
816 <<
"produceTagFilter -> Return false: could not retrieve the " <<
m_calibrationMode <<
" statistics.\n" 817 <<
"Please check if input contains " <<
m_calibrationMode <<
" data." << std::endl;
821 float integral = (Charge_Vs_Index)->getTH2S()->Integral();
825 <<
"produceTagFilter -> Return false: Statistics is too low : " <<
integral << std::endl;
831 <<
"produceTagFilter -> Return false: ratio of GOOD/TOTAL is too low: " << (1.0 *
GOOD) / (
GOOD +
BAD)
840 std::unique_ptr<SiStripApvGain>
obj = std::make_unique<SiStripApvGain>();
844 <<
"getNewObject -> will not produce a paylaod because produceTagFilter returned false " << std::endl;
850 std::vector<float> theSiStripVector;
851 unsigned int PreviousDetId = 0;
854 if (
APV ==
nullptr) {
858 if (
APV->SubDet <= 2)
860 if (
APV->DetId != PreviousDetId) {
861 if (!theSiStripVector.empty()) {
863 if (!
obj->put(PreviousDetId,
range))
864 printf(
"Bug to put detId = %i\n", PreviousDetId);
866 theSiStripVector.clear();
867 PreviousDetId =
APV->DetId;
869 theSiStripVector.push_back(
APV->Gain);
871 LogDebug(
"SiStripGainsPCLHarvester") <<
" DetId: " <<
APV->DetId <<
" APV: " <<
APV->APVId
872 <<
" Gain: " <<
APV->Gain << std::endl;
874 if (!theSiStripVector.empty()) {
876 if (!
obj->put(PreviousDetId,
range))
877 printf(
"Bug to put detId = %i\n", PreviousDetId);
884 unsigned int t_Index, t_Bin, t_DetId;
885 unsigned char t_APVId, t_SubDet;
886 float t_x,
t_y,
t_z, t_Eta, t_R, t_Phi, t_Thickness;
887 float t_FitMPV, t_FitMPVErr, t_FitWidth, t_FitWidthErr, t_FitChi2NDF, t_FitNorm, t_FitGrade;
888 double t_Gain, t_PrevGain, t_PrevGainTick, t_NEntries;
891 tree->Branch(
"Index", &t_Index,
"Index/i");
892 tree->Branch(
"Bin", &t_Bin,
"Bin/i");
893 tree->Branch(
"DetId", &t_DetId,
"DetId/i");
894 tree->Branch(
"APVId", &t_APVId,
"APVId/b");
895 tree->Branch(
"SubDet", &t_SubDet,
"SubDet/b");
896 tree->Branch(
"x", &
t_x,
"x/F");
897 tree->Branch(
"y", &
t_y,
"y/F");
898 tree->Branch(
"z", &
t_z,
"z/F");
899 tree->Branch(
"Eta", &t_Eta,
"Eta/F");
900 tree->Branch(
"R", &t_R,
"R/F");
901 tree->Branch(
"Phi", &t_Phi,
"Phi/F");
902 tree->Branch(
"Thickness", &t_Thickness,
"Thickness/F");
903 tree->Branch(
"FitMPV", &t_FitMPV,
"FitMPV/F");
904 tree->Branch(
"FitMPVErr", &t_FitMPVErr,
"FitMPVErr/F");
905 tree->Branch(
"FitWidth", &t_FitWidth,
"FitWidth/F");
906 tree->Branch(
"FitWidthErr", &t_FitWidthErr,
"FitWidthErr/F");
907 tree->Branch(
"FitChi2NDF", &t_FitChi2NDF,
"FitChi2NDF/F");
908 tree->Branch(
"FitNorm", &t_FitNorm,
"FitNorm/F");
909 tree->Branch(
"FitGrade", &t_FitGrade,
"FitGrade/F");
910 tree->Branch(
"Gain", &t_Gain,
"Gain/D");
911 tree->Branch(
"PrevGain", &t_PrevGain,
"PrevGain/D");
912 tree->Branch(
"PrevGainTick", &t_PrevGainTick,
"PrevGainTick/D");
913 tree->Branch(
"NEntries", &t_NEntries,
"NEntries/D");
914 tree->Branch(
"isMasked", &t_isMasked,
"isMasked/O");
918 t_Index = iAPV->Index;
919 t_Bin = chVsIdxXaxis->FindBin(iAPV->Index);
920 t_DetId = iAPV->DetId;
921 t_APVId = iAPV->APVId;
922 t_SubDet = iAPV->SubDet;
929 t_Thickness = iAPV->Thickness;
930 t_FitMPV = iAPV->FitMPV;
931 t_FitMPVErr = iAPV->FitMPVErr;
932 t_FitWidth = iAPV->FitWidth;
933 t_FitWidthErr = iAPV->FitWidthErr;
934 t_FitChi2NDF = iAPV->FitChi2;
935 t_FitNorm = iAPV->FitNorm;
936 t_FitGrade = iAPV->FitGrade;
938 t_PrevGain = iAPV->PreviousGain;
939 t_PrevGainTick = iAPV->PreviousGainTick;
940 t_NEntries = iAPV->NEntries;
941 t_isMasked = iAPV->isMasked;
bool fit_gaussianConvolutionTOBL56_
std::unique_ptr< SiStripApvGain > getNewObject(const MonitorElement *Charge_Vs_Index)
static constexpr auto TEC
virtual int nstrips() const =0
void storeGainsTree(const TAxis *chVsIdxXaxis) const
void dqmEndJob(DQMStore::IBooker &ibooker_, DQMStore::IGetter &igetter_) override
T const & getData(const ESGetToken< T, R > &iToken) const noexcept(false)
virtual void setCurrentFolder(std::string const &fullpath)
virtual int ncolumns() const =0
bool fit_gaussianConvolution_
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoTokenBR_
virtual int nrows() const =0
int subdetectorPlane(uint32_t, const TrackerTopology *)
ALPAKA_FN_ACC int side(int ieta, int iphi)
std::vector< std::string > dqm_tag_
void beginRun(edm::Run const &run, edm::EventSetup const &isetup) override
bool produceTagFilter(const MonitorElement *Charge_Vs_Index)
Log< level::Error, false > LogError
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
void algoComputeMPVandGain(const MonitorElement *Charge_Vs_Index)
T getUntrackedParameter(std::string const &, T const &) const
U second(std::pair< T, U > const &p)
SiStripGainsPCLHarvester(const edm::ParameterSet &ps)
MonitorElement * book1DD(TString const &name, TString const &title, int nchX, double lowX, double highX, FUNC onbooking=NOOP())
Data available (reporting)
void addDefault(ParameterSetDescription const &psetDescription)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
edm::ESGetToken< SiStripQuality, SiStripQualityRcd > qualityToken_
double tagCondition_GoodFrac
cond::Time_t currentTime() const
bool doChargeMonitorPerPlane
void gainQualityMonitor(DQMStore::IBooker &ibooker_, const MonitorElement *Charge_Vs_Index) const
void getPeakOfLandau(TH1 *InputHisto, double *FitResults, double LowRange=50, double HighRange=5400, bool gaussianConvolution=false)
std::pair< ContainerIterator, ContainerIterator > Range
Hash writeOneIOV(const T &payload, Time_t time, const std::string &recordName)
const std::complex< double > I
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
static constexpr auto TOB
std::vector< std::string > VChargeHisto
std::unique_ptr< TrackerTopology > tTopo_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
Integral< F, X >::type integral(const F &f)
std::string m_calibrationMode
Log< level::Info, false > LogInfo
bool IsGoodLandauFit(double *FitResults)
static constexpr auto TIB
constexpr uint32_t rawId() const
get the raw id
std::vector< MonitorElement * > FetchMonitor(std::vector< APVmon >, uint32_t, const TrackerTopology *topo=nullptr)
int subdetectorSide(uint32_t, const TrackerTopology *)
const TrackerGeometry * bareTkGeomPtr_
void endRun(edm::Run const &run, edm::EventSetup const &isetup) override
double tagCondition_NClusters
virtual MonitorElement * get(std::string const &fullpath) const
MonitorElement * book2DD(TString const &name, TString const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY, FUNC onbooking=NOOP())
virtual void checkBookAPVColls(const edm::EventSetup &setup)
std::vector< std::shared_ptr< stAPVGain > > APVsCollOrdered
bool fit_dataDrivenRange_
edm::ESGetToken< SiStripGain, SiStripGainRcd > gainToken_
Log< level::Warning, false > LogWarning
std::vector< std::pair< std::string, std::string > > monHnames(std::vector< std::string >, bool, const char *tag)
The Signals That Services Can Subscribe To This is based on ActivityRegistry h
Helper function to determine trigger accepts.
edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > tTopoTokenER_
static constexpr auto TID
int subdetectorId(uint32_t)
virtual TH2S * getTH2S() const
edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > tkGeomToken_
std::unordered_map< unsigned int, std::shared_ptr< stAPVGain > > APVsColl