68 #include "TObjString.h" 82 #include <unordered_map> 101 void algoEndJob()
override;
104 int statCollectionFromMode(
const char*
tag)
const;
105 void bookDQMHistos(
const char* dqm_dir,
const char*
tag);
108 void swapBFieldMode(
void);
111 void algoAnalyzeTheTree();
112 void algoComputeMPVandGain();
115 void getPeakOfLandau(TH1* InputHisto,
double* FitResults,
double LowRange = 50,
double HighRange = 5400);
116 bool IsGoodLandauFit(
double* FitResults);
118 void qualityMonitor();
119 void MakeCalibrationMap();
120 bool produceTagFilter();
122 template <
typename T>
130 std::unique_ptr<SiStripApvGain> getNewObject()
override;
175 std::array<std::vector<APVGain::APVmon>, 7>
Charge_1;
176 std::array<std::vector<APVGain::APVmon>, 7>
Charge_2;
177 std::array<std::vector<APVGain::APVmon>, 7>
Charge_3;
178 std::array<std::vector<APVGain::APVmon>, 7>
Charge_4;
261 unsigned int eventnumber = 0;
263 const std::vector<bool>* TrigTech =
nullptr;
267 const std::vector<double>* trackchi2ndof =
nullptr;
269 const std::vector<float>* trackp =
nullptr;
271 const std::vector<float>* trackpt =
nullptr;
273 const std::vector<double>* tracketa =
nullptr;
275 const std::vector<double>* trackphi =
nullptr;
277 const std::vector<unsigned int>* trackhitsvalid =
nullptr;
279 const std::vector<int>* trackalgo =
nullptr;
283 const std::vector<int>* trackindex =
nullptr;
285 const std::vector<unsigned int>* rawid =
nullptr;
287 const std::vector<double>* localdirx =
nullptr;
289 const std::vector<double>* localdiry =
nullptr;
291 const std::vector<double>* localdirz =
nullptr;
293 const std::vector<unsigned short>* firststrip =
nullptr;
295 const std::vector<unsigned short>* nstrips =
nullptr;
297 const std::vector<bool>* saturation =
nullptr;
299 const std::vector<bool>* overlapping =
nullptr;
301 const std::vector<bool>* farfromedge =
nullptr;
303 const std::vector<unsigned int>*
charge =
nullptr;
305 const std::vector<double>*
path =
nullptr;
307 const std::vector<double>* chargeoverpath =
nullptr;
311 const std::vector<double>* gainused =
nullptr;
313 const std::vector<double>* gainusedTick =
nullptr;
325 std::unordered_map<unsigned int, stAPVGain*>
APVsColl;
330 std::vector<string>::const_iterator it = dqm_tag_.begin();
331 while (it != dqm_tag_.end()) {
333 return it - dqm_tag_.begin();
344 if (A->GetNbinsX() == B->GetNbinsX()) {
347 for (
int x = 0; x <= B->GetNbinsX() + 1; x++) {
348 for (
int y = 0; y <= B->GetNbinsY() + 1; y++) {
349 A->SetBinContent(x, y, A->GetBinContent(x, y) + B->GetBinContent(x, y));
434 consumes<std::vector<unsigned short>>(
edm::InputTag(label, CalibPrefix_ +
"firststrip" + CalibSuffix_));
442 consumes<std::vector<double>>(
edm::InputTag(label, CalibPrefix_ +
"chargeoverpath" + CalibSuffix_));
444 consumes<std::vector<unsigned char>>(
edm::InputTag(label, CalibPrefix_ +
"amplitude" + CalibSuffix_));
447 consumes<std::vector<double>>(
edm::InputTag(label, CalibPrefix_ +
"gainusedTick" + CalibSuffix_));
451 EventPrefix_ = evtinfo_pset.getUntrackedParameter<
string>(
"prefix");
452 EventSuffix_ = evtinfo_pset.getUntrackedParameter<
string>(
"suffix");
457 TrackPrefix_ = track_pset.getUntrackedParameter<
string>(
"prefix");
458 TrackSuffix_ = track_pset.getUntrackedParameter<
string>(
"suffix");
466 consumes<std::vector<unsigned int>>(
edm::InputTag(label, TrackPrefix_ +
"hitsvalid" + TrackSuffix_));
474 <<
"Setting " << dqm_dir <<
"in DQM and booking histograms for tag " << tag << std::endl;
482 if (!stag.empty() && stag[0] !=
'_')
483 stag.insert(0, 1,
'_');
506 std::vector<float> binXarray;
509 binXarray.push_back((
float)
a);
512 std::array<float, 688> binYarray;
514 double p1 = 0.002113;
515 double p2 = 69.01576;
517 for (
int b = 0;
b < 687;
b++) {
522 y = (p0 -
log(
exp(p0 - p1 * y) - p2 * p1)) / p1;
524 binYarray[687] = 4000.;
538 std::vector<std::pair<std::string, std::string>> hnames =
540 for (
unsigned int i = 0;
i < hnames.size();
i++) {
550 for (
unsigned int i = 0;
i < hnames.size();
i++) {
560 for (
unsigned int i = 0;
i < hnames.size();
i++) {
570 for (
unsigned int i = 0;
i < hnames.size();
i++) {
599 NoMPVfit =
dbe->
book2DD(
"NoMPVfit",
"Modules with bad Landau Fit", 350, -350, 350, 240, 0, 120);
637 std::vector<std::pair<std::string, std::string>> hnames =
639 for (
unsigned int i = 0;
i < hnames.size();
i++) {
655 const char* dqm_dir =
"AlCaReco/SiStripGainsHarvesting/";
662 edm::LogInfo(
"SiStripGainFromCalibTree") <<
"Switching calibration mode for endorsing BField status: " << prevMode
672 tTopo_ = TopoHandle.product();
676 auto const&
Det = tkGeom->
dets();
680 unsigned int Index = 0;
681 for (
unsigned int i = 0;
i <
Det.size();
i++) {
692 unsigned int NAPV = Topo.
nstrips() / 128;
694 for (
unsigned int j = 0;
j < NAPV;
j++) {
710 APV->
x = DetUnit->position().basicVector().x();
711 APV->
y = DetUnit->position().basicVector().y();
712 APV->
z = DetUnit->position().basicVector().z();
713 APV->
Eta = DetUnit->position().basicVector().eta();
714 APV->
Phi = DetUnit->position().basicVector().phi();
715 APV->
R = DetUnit->position().basicVector().transverse();
716 APV->
Thickness = DetUnit->surface().bounds().thickness();
728 for (
unsigned int i = 0;
i <
Det.size();
738 unsigned int NROCRow = Topo.
nrows() / (80.);
739 unsigned int NROCCol = Topo.
ncolumns() / (52.);
741 for (
unsigned int j = 0;
j < NROCRow;
j++) {
742 for (
unsigned int i = 0;
i < NROCCol;
i++) {
757 APV->
x = DetUnit->position().basicVector().x();
758 APV->
y = DetUnit->position().basicVector().y();
759 APV->
z = DetUnit->position().basicVector().z();
760 APV->
Eta = DetUnit->position().basicVector().eta();
761 APV->
Phi = DetUnit->position().basicVector().phi();
762 APV->
R = DetUnit->position().basicVector().transverse();
763 APV->
Thickness = DetUnit->surface().bounds().thickness();
797 return ((isOn && !is0T) || (!isOn && is0T));
814 edm::LogInfo(
"SiStripGainFromCalibTree") <<
"Switching calibration mode for endorsing BField status: " << prevMode
822 edm::LogError(
"SiStripGainFromCalibTree") <<
"gainHandle is not valid\n";
840 edm::LogError(
"SiStripGainFromCalibTree") <<
"NUMBER OF GAIN TAG IS EXPECTED TO BE 2\n";
846 edm::LogWarning(
"SiStripGainFromCalibTree") <<
"WARNING: ParticleGain in the global tag changed\n";
852 <<
"WARNING: TickMarkGain in the global tag changed\n" 854 <<
" APV->SubDet: " << APV->
SubDet <<
" APV->APVId:" << APV->
APVId << std::endl
855 <<
" APV->PreviousGainTick: " << APV->
PreviousGainTick <<
" newPreviousGainTick: " << newPreviousGainTick
874 edm::LogInfo(
"SiStripGainFromCalibTree") <<
"Starting harvesting statistics" << std::endl;
881 if (!stag.empty() && stag[0] !=
'_')
882 stag.insert(0, 1,
'_');
916 <<
"Harvesting: could not retrieve " << cvi.c_str() <<
", statistics will not be summed!" << std::endl;
920 <<
"Harvesting " << (
Charge_Vs_Index[elepos])->getTH2S()->GetEntries() <<
" more clusters" << std::endl;
930 <<
"Harvesting: could not retrieve " << cvpTIB.c_str() <<
", statistics will not be summed!" << std::endl;
936 <<
"Harvesting: could not retrieve " << cvpTOB.c_str() <<
", statistics will not be summed!" << std::endl;
942 <<
"Harvesting: could not retrieve " << cvpTIDP.c_str() <<
", statistics will not be summed!" << std::endl;
948 <<
"Harvesting: could not retrieve " << cvpTIDM.c_str() <<
", statistics will not be summed!" << std::endl;
954 <<
"Harvesting: could not retrieve " << cvpTECP1.c_str() <<
", statistics will not be summed!" << std::endl;
960 <<
"Harvesting: could not retrieve " << cvpTECP2.c_str() <<
", statistics will not be summed!" << std::endl;
966 <<
"Harvesting: could not retrieve " << cvpTECM1.c_str() <<
", statistics will not be summed!" << std::endl;
972 <<
"Harvesting: could not retrieve " << cvpTECM2.c_str() <<
", statistics will not be summed!" << std::endl;
977 std::vector<std::pair<std::string, std::string>>
tags =
979 for (
unsigned int i = 0;
i < tags.size();
i++) {
982 if ((
Charge_1[elepos][
i]).getMonitor() ==
nullptr) {
984 <<
"Harvesting: could not retrieve " << tag.c_str() <<
", statistics will not be summed!" << std::endl;
986 (
Charge_1[Harvest][i]).getMonitor()->getTH1D()->Add((
Charge_1[elepos][i]).getMonitor()->getTH1D());
990 for (
unsigned int i = 0;
i < tags.size();
i++) {
993 if ((
Charge_2[elepos][
i]).getMonitor() ==
nullptr) {
995 <<
"Harvesting: could not retrieve " << tag.c_str() <<
", statistics will not be summed!" << std::endl;
997 (
Charge_2[Harvest][i]).getMonitor()->getTH1D()->Add((
Charge_2[elepos][i]).getMonitor()->getTH1D());
1001 for (
unsigned int i = 0;
i < tags.size();
i++) {
1004 if ((
Charge_3[elepos][
i]).getMonitor() ==
nullptr) {
1006 <<
"Harvesting: could not retrieve " << tag.c_str() <<
", statistics will not be summed!" << std::endl;
1008 (
Charge_3[Harvest][i]).getMonitor()->getTH1D()->Add((
Charge_3[elepos][i]).getMonitor()->getTH1D());
1012 for (
unsigned int i = 0;
i < tags.size();
i++) {
1015 if ((
Charge_4[elepos][
i]).getMonitor() ==
nullptr) {
1017 <<
"Harvesting: could not retrieve " << tag.c_str() <<
", statistics will not be summed!" << std::endl;
1019 (
Charge_4[Harvest][i]).getMonitor()->getTH1D()->Add((
Charge_4[elepos][i]).getMonitor()->getTH1D());
1030 edm::LogInfo(
"SiStripGainFromCalibTree") <<
"Analyzing calibration tree" << std::endl;
1049 edm::LogInfo(
"SiStripGainFromCalibTree") <<
"Saving summary into root file" << std::endl;
1082 FitResults[0] = -0.5;
1084 FitResults[2] = -0.5;
1086 FitResults[4] = -0.5;
1093 TF1* MyLandau =
new TF1(
"MyLandau",
"landau", LowRange, HighRange);
1094 MyLandau->SetParameter(1, 300);
1095 InputHisto->Fit(MyLandau,
"0QR WW");
1098 FitResults[0] = MyLandau->GetParameter(1);
1099 FitResults[1] = MyLandau->GetParError(1);
1100 FitResults[2] = MyLandau->GetParameter(2);
1101 FitResults[3] = MyLandau->GetParError(2);
1102 FitResults[4] = MyLandau->GetChisquare() / MyLandau->GetNDF();
1103 FitResults[5] = MyLandau->GetParameter(0);
1109 if (FitResults[0] <= 0)
1126 NTrack += (*trackp).size();
1130 unsigned int FirstAmplitude = 0;
1131 for (
unsigned int i = 0;
i < (*chargeoverpath).size();
i++) {
1132 FirstAmplitude += (*nstrips)[
i];
1133 int TI = (*trackindex)[
i];
1184 bool Saturation =
false;
1185 for (
unsigned int s = 0;
s < (*nstrips)[
i];
s++) {
1186 int StripCharge = (*amplitude)[FirstAmplitude - (*nstrips)[
i] +
s];
1194 if (StripCharge > 1024) {
1197 }
else if (StripCharge > 254) {
1201 Charge += StripCharge;
1205 }
else if (APV->
SubDet > 2) {
1206 Charge = (*charge)[
i];
1208 Charge = (*charge)[
i] / 265.0;
1213 double ClusterChargeOverPath = ((double)Charge) / (*path)[
i];
1216 ClusterChargeOverPath /= (*gainused)[
i];
1219 ClusterChargeOverPath *= (*gainused)[
i];
1235 for (
unsigned int s = 0;
s < (*nstrips)[
i];
s++) {
1236 int StripCharge = (*amplitude)[FirstAmplitude - (*nstrips)[
i] +
s];
1237 if (StripCharge > 1024)
1239 else if (StripCharge > 254)
1241 mCharge1 += StripCharge;
1242 mCharge2 += StripCharge;
1243 mCharge3 += StripCharge;
1244 mCharge4 += StripCharge;
1247 mCharge2 *= (*gainused)[
i];
1248 mCharge3 *= (*gainusedTick)[
i];
1249 mCharge4 *= ((*gainused)[
i] * (*gainusedTick)[
i]);
1251 std::vector<APVGain::APVmon>& v1 =
Charge_1[elepos];
1253 for (
unsigned int m = 0;
m < cmon1.size();
m++)
1254 cmon1[
m]->
Fill(((
double)mCharge1) / (*path)[
i]);
1256 std::vector<APVGain::APVmon>& v2 =
Charge_2[elepos];
1258 for (
unsigned int m = 0;
m < cmon2.size();
m++)
1259 cmon2[
m]->
Fill(((
double)mCharge2) / (*path)[
i]);
1261 std::vector<APVGain::APVmon>& v3 =
Charge_3[elepos];
1263 for (
unsigned int m = 0;
m < cmon3.size();
m++)
1264 cmon3[
m]->
Fill(((
double)mCharge3) / (*path)[
i]);
1266 std::vector<APVGain::APVmon>& v4 =
Charge_4[elepos];
1268 for (
unsigned int m = 0;
m < cmon4.size();
m++)
1269 cmon4[
m]->
Fill(((
double)mCharge4) / (*path)[
i]);
1282 else if (APV->
Eta > 0) {
1294 }
else if (APV->
Eta > 0) {
1312 TString tree_path = TString::Format(
"gainCalibrationTree%s/tree",
m_calibrationMode.c_str());
1313 TTree*
tree =
dynamic_cast<TTree*
>(tfile->Get(tree_path.Data()));
1344 unsigned int nentries = tree->GetEntries();
1345 printf(
"Number of Events = %i + %i = %i\n",
NEvent, nentries, (
NEvent + nentries));
1346 printf(
"Progressing Bar :0%% 20%% 40%% 60%% 80%% 100%%\n");
1347 printf(
"Looping on the Tree :");
1348 int TreeStep = nentries / 50;
1351 for (
unsigned int ientry = 0; ientry < tree->GetEntries(); ientry++) {
1352 if (ientry % TreeStep == 0) {
1356 tree->GetEntry(ientry);
1365 TH1F* Proj =
nullptr;
1366 double FitResults[6];
1367 double MPVmean = 300;
1373 <<
"Harvesting: could not execute algoComputeMPVandGain method because " <<
m_calibrationMode.c_str()
1374 <<
" statistics cannot be retrieved.\n" 1375 <<
"Please check if input contains " <<
m_calibrationMode.c_str() <<
" data." << std::endl;
1381 printf(
"Progressing Bar :0%% 20%% 40%% 60%% 80%% 100%%\n");
1382 printf(
"Fitting Charge Distribution :");
1383 int TreeStep =
APVsColl.size() / 50;
1385 if (I % TreeStep == 0) {
1391 APV->
Bin = chvsidx->GetXaxis()->FindBin(APV->
Index);
1399 Proj = (TH1F*)(chvsidx->ProjectionY(
1400 "", chvsidx->GetXaxis()->FindBin(APV->
Index), chvsidx->GetXaxis()->FindBin(APV->
Index),
"e"));
1406 int SecondAPVId = APV->
APVId;
1407 if (SecondAPVId % 2 == 0) {
1408 SecondAPVId = SecondAPVId + 1;
1410 SecondAPVId = SecondAPVId - 1;
1414 APV2->
Bin = chvsidx->GetXaxis()->FindBin(APV2->
Index);
1415 TH1F* Proj2 = (TH1F*)(chvsidx->ProjectionY(
"", APV2->
Bin, APV2->
Bin,
"e"));
1417 Proj->Add(Proj2, 1);
1421 for (
unsigned int i = 0;
i < 16;
i++) {
1429 APV2->
Bin = chvsidx->GetXaxis()->FindBin(APV2->
Index);
1430 TH1F* Proj2 = (TH1F*)(chvsidx->ProjectionY(
"", APV2->
Bin, APV2->
Bin,
"e"));
1432 Proj->Add(Proj2, 1);
1442 APV->
FitMPV = FitResults[0];
1448 APV->
NEntries = Proj->GetEntries();
1476 unsigned int Index = APV->
Index;
1480 float Eta = APV->
Eta;
1484 double FitMPV = APV->
FitMPV;
1496 int bin = chvsidx->GetXaxis()->FindBin(Index);
1497 TH1D* Proj = chvsidx->ProjectionY(
"proj", bin, bin);
1498 for (
int binId = 0; binId < Proj->GetXaxis()->GetNbins(); binId++) {
1499 double new_charge = Proj->GetXaxis()->GetBinCenter(binId) /
Gain;
1500 if (Proj->GetBinContent(binId) != 0.) {
1501 for (
unsigned int h = 0;
h < charge_histos.size();
h++) {
1502 TH1D* chisto = (charge_histos[
h])->getTH1D();
1503 for (
int e = 0;
e < Proj->GetBinContent(binId);
e++)
1504 chisto->Fill(new_charge);
1521 if (Thickness < 0.04)
1523 if (Thickness > 0.04)
1537 }
else if (SubDet == 4) {
1546 }
else if (SubDet == 5) {
1551 }
else if (SubDet == 6) {
1559 if (Thickness < 0.04) {
1568 if (Thickness > 0.04) {
1580 if (SubDet == 3 && PreviousGain != 0.)
1582 else if (SubDet == 4 && PreviousGain != 0.)
1584 else if (SubDet == 5 && PreviousGain != 0.)
1586 else if (SubDet == 6 && PreviousGain != 0.)
1591 else if (SubDet == 4)
1593 else if (SubDet == 5)
1595 else if (SubDet == 6)
1601 unsigned int tree_Index;
1602 unsigned int tree_Bin;
1603 unsigned int tree_DetId;
1604 unsigned char tree_APVId;
1605 unsigned char tree_SubDet;
1612 float tree_Thickness;
1614 float tree_FitMPVErr;
1615 float tree_FitWidth;
1616 float tree_FitWidthErr;
1617 float tree_FitChi2NDF;
1620 double tree_PrevGain;
1621 double tree_PrevGainTick;
1622 double tree_NEntries;
1626 MyTree = tfs->
make<TTree>(
"APVGain",
"APVGain");
1627 MyTree->Branch(
"Index", &tree_Index,
"Index/i");
1628 MyTree->Branch(
"Bin", &tree_Bin,
"Bin/i");
1629 MyTree->Branch(
"DetId", &tree_DetId,
"DetId/i");
1630 MyTree->Branch(
"APVId", &tree_APVId,
"APVId/b");
1631 MyTree->Branch(
"SubDet", &tree_SubDet,
"SubDet/b");
1632 MyTree->Branch(
"x", &tree_x,
"x/F");
1633 MyTree->Branch(
"y", &tree_y,
"y/F");
1634 MyTree->Branch(
"z", &tree_z,
"z/F");
1635 MyTree->Branch(
"Eta", &tree_Eta,
"Eta/F");
1636 MyTree->Branch(
"R", &tree_R,
"R/F");
1637 MyTree->Branch(
"Phi", &tree_Phi,
"Phi/F");
1638 MyTree->Branch(
"Thickness", &tree_Thickness,
"Thickness/F");
1639 MyTree->Branch(
"FitMPV", &tree_FitMPV,
"FitMPV/F");
1640 MyTree->Branch(
"FitMPVErr", &tree_FitMPVErr,
"FitMPVErr/F");
1641 MyTree->Branch(
"FitWidth", &tree_FitWidth,
"FitWidth/F");
1642 MyTree->Branch(
"FitWidthErr", &tree_FitWidthErr,
"FitWidthErr/F");
1643 MyTree->Branch(
"FitChi2NDF", &tree_FitChi2NDF,
"FitChi2NDF/F");
1644 MyTree->Branch(
"FitNorm", &tree_FitNorm,
"FitNorm/F");
1645 MyTree->Branch(
"Gain", &tree_Gain,
"Gain/D");
1646 MyTree->Branch(
"PrevGain", &tree_PrevGain,
"PrevGain/D");
1647 MyTree->Branch(
"PrevGainTick", &tree_PrevGainTick,
"PrevGainTick/D");
1648 MyTree->Branch(
"NEntries", &tree_NEntries,
"NEntries/D");
1649 MyTree->Branch(
"isMasked", &tree_isMasked,
"isMasked/O");
1652 fprintf(Gains,
"NEvents = %i\n",
NEvent);
1653 fprintf(Gains,
"NTracks = %i\n",
NTrack);
1657 fprintf(Gains,
"Number of Strip APVs = %lu\n", static_cast<unsigned long>(
NStripAPVs));
1659 "GoodFits = %i BadFits = %i ratio = %f%% (MASKED=%i)\n",
1666 fprintf(Gains,
"NEvents = %i\n",
NEvent);
1667 fprintf(Gains,
"NTracks = %i\n",
NTrack);
1670 fprintf(Gains,
"Number of Strip APVs = %lu\n", static_cast<unsigned long>(
NStripAPVs));
1673 "GoodFits = %i BadFits = %i ratio = %f%% (MASKED=%i)\n",
1687 "%i | %i | PreviousGain = %7.5f(tick) x %7.5f(particle) NewGain (particle) = %7.5f (#clusters=%8.0f)\n",
1695 tree_Index = APV->
Index;
1697 tree_DetId = APV->
DetId;
1698 tree_APVId = APV->
APVId;
1699 tree_SubDet = APV->
SubDet;
1703 tree_Eta = APV->
Eta;
1705 tree_Phi = APV->
Phi;
1707 tree_FitMPV = APV->
FitMPV;
1711 tree_FitChi2NDF = APV->
FitChi2;
1713 tree_Gain = APV->
Gain;
1719 if (tree_DetId == 402673324) {
1720 printf(
"%i | %i : %f --> %f (%f)\n", tree_DetId, tree_APVId, tree_PrevGain, tree_Gain, tree_NEntries);
1735 <<
"produceTagFilter -> Return false: could not retrieve the " <<
m_calibrationMode.c_str() <<
" statistics.\n" 1736 <<
"Please check if input contains " <<
m_calibrationMode.c_str() <<
" data." << std::endl;
1744 <<
"produceTagFilter -> Return false: Statistics is too low : " << integral << endl;
1750 <<
"produceTagFilter -> Return false: ratio of GOOD/TOTAL is too low: " << (1.0 *
GOOD) / (
GOOD +
BAD) << endl;
1757 auto obj = std::make_unique<SiStripApvGain>();
1763 <<
"getNewObject -> will not produce a paylaod because produceTagFilter returned false " << endl;
1768 std::vector<float>* theSiStripVector =
nullptr;
1769 unsigned int PreviousDetId = 0;
1772 if (APV ==
nullptr) {
1778 if (APV->
DetId != PreviousDetId) {
1779 if (theSiStripVector !=
nullptr) {
1781 if (!
obj->put(PreviousDetId,
range))
1782 printf(
"Bug to put detId = %i\n", PreviousDetId);
1784 theSiStripVector =
new std::vector<float>;
1785 PreviousDetId = APV->
DetId;
1787 theSiStripVector->push_back(APV->
Gain);
1789 if (theSiStripVector !=
nullptr) {
1791 if (!
obj->put(PreviousDetId,
range))
1792 printf(
"Bug to put detId = %i\n", PreviousDetId);
1795 if (theSiStripVector !=
nullptr)
1796 delete theSiStripVector;
1815 TChain*
t1 =
new TChain(
"SiStripCalib/APVGain");
1818 unsigned int tree_DetId;
1819 unsigned char tree_APVId;
1822 t1->SetBranchAddress(
"DetId", &tree_DetId);
1823 t1->SetBranchAddress(
"APVId", &tree_APVId);
1824 t1->SetBranchAddress(
"Gain", &tree_Gain);
1826 for (
unsigned int ientry = 0; ientry < t1->GetEntries(); ientry++) {
1827 t1->GetEntry(ientry);
MonitorElement * MPVError
bool IsApvBad(const uint32_t &detid, const short &apvNb) const
edm::EDGetTokenT< std::vector< int > > trackindex_token_
std::vector< MonitorElement * > Charge_Vs_Index
T getParameter(std::string const &) const
EventNumber_t event() const
static constexpr auto TEC
void swapBFieldMode(void)
T getUntrackedParameter(std::string const &, T const &) const
FWCore Framework interface EventSetupRecordImplementation h
Helper function to determine trigger accepts.
std::vector< string > dqm_tag_
MonitorElement * MPVsTECP2
virtual int nrows() const =0
const std::vector< float > * trackp
unsigned int MinTrackHits
edm::EDGetTokenT< std::vector< double > > tracketa_token_
edm::EDGetTokenT< std::vector< unsigned char > > amplitude_token_
std::vector< APVGain::APVmon > newCharge
const std::vector< double > * chargeoverpath
MonitorElement * DiffWRTPrevGainTEC
MonitorElement * book2DD(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2D histogram.
edm::EDGetTokenT< std::vector< unsigned int > > rawid_token_
const std::vector< unsigned char > * amplitude
bool isBFieldConsistentWithMode(const edm::EventSetup &iSetup) const
~SiStripGainFromCalibTree() override
dqm::legacy::DQMStore DQMStore
MonitorElement * MPV_Vs_PhiTEC
MonitorElement * MPVsTIDP
const std::vector< double > * localdirz
size_t getNumberOfTags() const
bool getByToken(EDGetToken token, Handle< PROD > &result) const
MonitorElement * MPVErrorVsN
const std::vector< double > * trackchi2ndof
void algoBeginRun(const edm::Run &run, const edm::EventSetup &iSetup) override
const std::vector< double > * localdirx
const std::vector< double > * gainusedTick
MonitorElement * MPV_Vs_PhiTID
dispatcher processEvent(e, inputTag, standby)
unsigned int NClusterPixel
void algoEndRun(const edm::Run &run, const edm::EventSetup &iSetup) override
std::vector< MonitorElement * > FetchMonitor(std::vector< APVmon >, uint32_t, const TrackerTopology *topo=0)
MonitorElement * MPV_Vs_EtaTOB
const std::vector< unsigned int > * rawid
MonitorElement * MPV_Vs_PhiTIB
constexpr uint32_t rawId() const
get the raw id
edm::EDGetTokenT< std::vector< bool > > overlapping_token_
dqm::legacy::MonitorElement MonitorElement
double tagCondition_GoodFrac
SiStripGainFromCalibTree(const edm::ParameterSet &)
const TrackerTopology * tTopo_
edm::Handle< T > connect(const T *&ptr, edm::EDGetTokenT< T > token, const edm::Event &evt)
MonitorElement * MPVErrorVsPhi
int subdetectorPlane(uint32_t, const TrackerTopology *)
const std::vector< int > * trackalgo
std::vector< MonitorElement * > Charge_Vs_PathlengthTOB
MonitorElement * MPV_Vs_EtaTIB
void storeOnTree(TFileService *tfs)
T * make(const Args &...args) const
make new ROOT object
const std::vector< float > * trackpt
std::vector< MonitorElement * > Charge_Vs_PathlengthTECM1
const std::vector< unsigned int > * trackhitsvalid
MonitorElement * MPVsTECP
MonitorElement * MPVsTECM
void MakeCalibrationMap()
MonitorElement * MPVsTECM2
std::vector< MonitorElement * > Charge_Vs_PathlengthTECM2
MonitorElement * MPV_Vs_EtaTECthick
double MaxTrackChiOverNdf
static float getApvGain(const uint16_t &apv, const SiStripApvGain::Range &range)
MonitorElement * GainVsPrevGainTIB
edm::EDGetTokenT< std::vector< bool > > farfromedge_token_
U second(std::pair< T, U > const &p)
edm::EDGetTokenT< std::vector< unsigned int > > trackhitsvalid_token_
std::string m_calibrationMode
const DetContainer & dets() const override
Returm a vector of all GeomDet (including all GeomDetUnits)
std::vector< stAPVGain * > APVsCollOrdered
MonitorElement * get(std::string const &path) const
get ME from full pathname (e.g. "my/long/dir/my_histo")
edm::EDGetTokenT< std::vector< double > > path_token_
void algoComputeMPVandGain()
edm::EDGetTokenT< std::vector< int > > trackalgo_token_
#define DEFINE_FWK_MODULE(type)
MonitorElement * GainVsPrevGainTEC
MonitorElement * MPVErrorVsEta
edm::EDGetTokenT< std::vector< float > > trackp_token_
bool IsGoodLandauFit(double *FitResults)
std::unique_ptr< SiStripApvGain > getNewObject() override
void Fill(HcalDetId &id, double val, std::vector< TH2F > &depth)
std::unordered_map< unsigned int, stAPVGain * > APVsColl
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
bool doChargeMonitorPerPlane
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
void algoBeginJob(const edm::EventSetup &iSetup) override
std::pair< ContainerIterator, ContainerIterator > Range
edm::EDGetTokenT< std::vector< bool > > TrigTech_token_
edm::EDGetTokenT< std::vector< double > > chargeoverpath_token_
const std::complex< double > I
edm::EDGetTokenT< std::vector< double > > gainusedTick_token_
const std::vector< double > * gainused
MonitorElement * MPV_Vs_EtaTID
MonitorElement * GainVsPrevGainTOB
MonitorElement * MPVsTECthick
std::vector< MonitorElement * > Charge_Vs_PathlengthTECP1
edm::EDGetTokenT< std::vector< double > > localdirz_token_
static const std::string B
static constexpr auto TOB
const std::vector< unsigned short > * firststrip
std::vector< MonitorElement * > Charge_Vs_PathlengthTIDM
const std::vector< double > * localdiry
edm::EDGetTokenT< std::vector< unsigned int > > charge_token_
MonitorElement * MPV_Vs_PhiTECthick
MonitorElement * NoMPVmasked
MonitorElement * GainVsPrevGainTID
MonitorElement * MPV_Vs_PhiTOB
Integral< F, X >::type integral(const F &f)
def elem(elemtype, innerHTML='', html_class='', kwargs)
MonitorElement * DiffWRTPrevGainTIB
vector< string > VInputFiles
void algoEndJob() override
edm::EDGetTokenT< std::vector< unsigned short > > nstrips_token_
std::vector< MonitorElement * > Charge_Vs_PathlengthTECP2
std::string m_calibrationPath
const std::vector< int > * trackindex
int statCollectionFromMode(const char *tag) const
MonitorElement * MPVsTECthin
std::vector< MonitorElement * > Charge_Vs_PathlengthTIB
edm::EDGetTokenT< std::vector< unsigned short > > firststrip_token_
void algoAnalyze(const edm::Event &, const edm::EventSetup &) override
static constexpr auto TIB
edm::EDGetTokenT< std::vector< float > > trackpt_token_
MonitorElement * DiffWRTPrevGainTOB
T const * product() const
MonitorElement * book2S(char_string const &name, char_string const &title, int nchX, double lowX, double highX, int nchY, double lowY, double highY)
Book 2S histogram.
const std::vector< bool > * overlapping
const std::vector< bool > * saturation
MonitorElement * MPVsTECP1
MonitorElement * MPV_Vs_EtaTECthin
virtual int nstrips() const =0
bool merge(LuminosityBlockRange &lh, LuminosityBlockRange &rh)
std::array< std::vector< APVGain::APVmon >, 7 > Charge_4
void getPeakOfLandau(TH1 *InputHisto, double *FitResults, double LowRange=50, double HighRange=5400)
int subdetectorSide(uint32_t, const TrackerTopology *)
void algoAnalyzeTheTree()
MonitorElement * MPVsTECM1
const std::vector< bool > * farfromedge
MonitorElement * MPV_Vs_PhiTECthin
void setCurrentFolder(std::string const &fullpath)
MonitorElement * MPV_Vs_EtaTEC
const std::vector< bool > * TrigTech
void setDoStore(const bool doStore)
When set to false the payload will not be written to the db.
MonitorElement * NoMPVfit
virtual int ncolumns() const =0
MonitorElement * MPVErrorVsMPV
std::vector< std::string > VChargeHisto
double tagCondition_NClusters
edm::EDGetTokenT< std::vector< double > > localdirx_token_
edm::EDGetTokenT< std::vector< bool > > saturation_token_
edm::EDGetTokenT< std::vector< double > > trackchi2ndof_token_
std::vector< MonitorElement * > Charge_Vs_PathlengthTIDP
edm::EDGetTokenT< std::vector< double > > localdiry_token_
std::array< std::vector< APVGain::APVmon >, 7 > Charge_3
const std::vector< unsigned int > * charge
std::vector< std::pair< std::string, std::string > > monHnames(std::vector< std::string >, bool, const char *tag)
std::array< std::vector< APVGain::APVmon >, 7 > Charge_1
const std::vector< double > * path
const std::vector< double > * trackphi
static constexpr auto TID
const std::vector< unsigned short > * nstrips
T const * product() const
edm::EDGetTokenT< std::vector< double > > gainused_token_
MonitorElement * book1DD(char_string const &name, char_string const &title, int nchX, double lowX, double highX)
Book 1S histogram.
std::array< std::vector< APVGain::APVmon >, 7 > Charge_2
int subdetectorId(uint32_t)
MonitorElement * DiffWRTPrevGainTID
void bookDQMHistos(const char *dqm_dir, const char *tag)
edm::EDGetTokenT< std::vector< double > > trackphi_token_
const std::vector< double > * tracketa
MonitorElement * MPVsTIDM
unsigned int NClusterStrip
void merge(TH2 *A, TH2 *B)
const SiStripApvGain::Range getRange(uint32_t detID) const