Skip to content

Commit c86327b

Browse files
committed
remove unmerged modules
1 parent 192a795 commit c86327b

2 files changed

Lines changed: 21 additions & 135 deletions

File tree

CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLHarvester.cc

Lines changed: 4 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -197,21 +197,9 @@ void SiPixelLorentzAnglePCLHarvester::beginRun(const edm::Run& iRun, const edm::
197197

198198
if (std::find(treatedIndices.begin(), treatedIndices.end(), i_index) != treatedIndices.end()) {
199199
hists.detIdsList.at(i_index).push_back(rawId);
200-
if (module >= 3 && module <= 6 && (layer == 3 || layer == 4)) {
201-
int i_index_merge = (module - 1) / 2 + (layer - 3) * 2 + hists.nlay * hists.nModules_[hists.nlay - 1] +
202-
(int)hists.BPixnewDetIds_.size();
203-
hists.detIdsList.at(i_index_merge).push_back(rawId);
204-
}
205200
} else {
206201
hists.detIdsList.insert(std::pair<uint32_t, std::vector<uint32_t>>(i_index, {rawId}));
207202
treatedIndices.push_back(i_index);
208-
209-
if (module >= 3 && module <= 6 && (layer == 3 || layer == 4)) {
210-
int i_index_merge = (module - 1) / 2 + (layer - 3) * 2 + hists.nlay * hists.nModules_[hists.nlay - 1] +
211-
(int)hists.BPixnewDetIds_.size();
212-
hists.detIdsList.insert(std::pair<uint32_t, std::vector<uint32_t>>(i_index_merge, {rawId}));
213-
treatedIndices.push_back(i_index_merge);
214-
}
215203
}
216204
}
217205

@@ -266,29 +254,6 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
266254

267255
hists.h_drift_depth_[i_index]->divide(
268256
hists.h_drift_depth_adc_[i_index], hists.h_drift_depth_noadc_[i_index], 1., 1., "");
269-
270-
if ((i_module == 3 || i_module == 5) && (i_layer == 3 || i_layer == 4)) {
271-
int i_index_merge = (i_module - 1) / 2 + (i_layer - 3) * 2 + hists.nlay * hists.nModules_[hists.nlay - 1] +
272-
(int)hists.BPixnewDetIds_.size();
273-
274-
hists.h_drift_depth_[i_index_merge] = iGetter.get(
275-
fmt::format("{}/h_drift_depth_layer{}_module{}_and_module{}", prefix_, i_layer, i_module, i_module + 1));
276-
277-
hists.h_drift_depth_adc_[i_index_merge] = iGetter.get(fmt::format(
278-
"{}/h_drift_depth_adc_layer{}_module{}_and_module{}", prefix_, i_layer, i_module, i_module + 1));
279-
280-
hists.h_drift_depth_adc2_[i_index_merge] = iGetter.get(fmt::format(
281-
"{}/h_drift_depth_adc2_layer{}_module{}_and_module{}", prefix_, i_layer, i_module, i_module + 1));
282-
283-
hists.h_drift_depth_noadc_[i_index_merge] = iGetter.get(fmt::format(
284-
"{}/h_drift_depth_noadc_layer{}_module{}_and_module{}", prefix_, i_layer, i_module, i_module + 1));
285-
286-
hists.h_mean_[i_index_merge] = iGetter.get(
287-
fmt::format("{}/h_mean_layer{}_module{}_and_module{}", dqmDir_, i_layer, i_module, i_module + 1));
288-
289-
hists.h_drift_depth_[i_index_merge]->divide(
290-
hists.h_drift_depth_adc_[i_index_merge], hists.h_drift_depth_noadc_[i_index_merge], 1., 1., "");
291-
}
292257
}
293258
}
294259

@@ -354,7 +319,7 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
354319
// retrieve the number of bins from the other monitoring histogram
355320
const auto& maxSect = hists.h_bySectOccupancy_->getNbinsX();
356321
const double lo = -0.5;
357-
const double hi = maxSect + 0.5;
322+
const double hi = maxSect - 0.5;
358323

359324
// this will be booked in the Harvesting folder
360325
iBooker.setCurrentFolder(fmt::format("{}Harvesting/SectorMonitoring", dqmDir_));
@@ -477,7 +442,6 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
477442
for (int i_layer = 1; i_layer <= hists.nlay; i_layer++) {
478443
for (int i_module = 1; i_module <= hists.nModules_[i_layer - 1]; i_module++) {
479444
int i_index = i_module + (i_layer - 1) * hists.nModules_[i_layer - 1];
480-
481445
if (hists.h_drift_depth_adc_[i_index] == nullptr)
482446
continue;
483447
//loop over bins in depth (z-local-coordinate) (in order to fit slices)
@@ -496,15 +460,6 @@ void SiPixelLorentzAnglePCLHarvester::dqmEndJob(DQMStore::IBooker& iBooker, DQMS
496460
<< res.chi2 << "\t" << res.prob << "\t"
497461
<< "null"
498462
<< "\t" << res.tan_LA << "\t" << res.error_LA;
499-
500-
if ((i_module == 3 || i_module == 5) && (i_layer == 3 || i_layer == 4)) {
501-
int i_index_merge = (i_module - 1) / 2 + (i_layer - 3) * 2 + hists.nlay * hists.nModules_[hists.nlay - 1] +
502-
(int)hists.BPixnewDetIds_.size();
503-
for (int i = 1; i <= hist_depth_; i++) {
504-
findMean(h_drift_depth_adc_slice_, i, i_index_merge);
505-
}
506-
const auto& res_combine = fitAndStore(LorentzAngle, i_index_merge, i_layer, i_module);
507-
}
508463
}
509464
} // end loop over modules and layers
510465

@@ -681,8 +636,7 @@ SiPixelLAHarvest::fitResults SiPixelLorentzAnglePCLHarvester::fitAndStore(
681636

682637
int nentries = hists.h_bySectOccupancy_->getBinContent(i_index); // number of on track hits in that sector
683638

684-
bool isNew = ((i_index > hists.nlay * hists.nModules_[hists.nlay - 1]) &&
685-
(i_index <= (hists.nlay * hists.nModules_[hists.nlay - 1] + (int)hists.BPixnewDetIds_.size())));
639+
bool isNew = (i_index > hists.nlay * hists.nModules_[hists.nlay - 1]);
686640
int shiftIdx = i_index - hists.nlay * hists.nModules_[hists.nlay - 1] - 1;
687641

688642
LogDebug("SiPixelLorentzAnglePCLHarvester")
@@ -691,13 +645,8 @@ SiPixelLAHarvest::fitResults SiPixelLorentzAnglePCLHarvester::fitAndStore(
691645
const auto& detIdsToFill =
692646
isNew ? std::vector<unsigned int>({hists.BPixnewDetIds_[shiftIdx]}) : hists.detIdsList.at(i_index);
693647

694-
if (i_index <= (hists.nlay * hists.nModules_[hists.nlay - 1] + (int)hists.BPixnewDetIds_.size())) {
695-
LogDebug("SiPixelLorentzAnglePCLHarvester")
696-
<< "index: " << i_index << " i_module: " << i_module << " i_layer: " << i_layer;
697-
} else {
698-
LogDebug("SiPixelLorentzAnglePCLHarvester") << "index: " << i_index << "combine i_module: " << i_module
699-
<< "and i_module+1" << i_module + 1 << " i_layer: " << i_layer;
700-
}
648+
LogDebug("SiPixelLorentzAnglePCLHarvester")
649+
<< "index: " << i_index << " i_module: " << i_module << " i_layer: " << i_layer;
701650
for (const auto& id : detIdsToFill) {
702651
LogDebug("SiPixelLorentzAnglePCLHarvester") << id << ",";
703652
}
@@ -716,8 +665,6 @@ SiPixelLAHarvest::fitResults SiPixelLorentzAnglePCLHarvester::fitAndStore(
716665
hists.h_bySectDeltaLA_->setBinContent(i_index, deltaLA);
717666

718667
for (const auto& id : detIdsToFill) {
719-
if (i_index > (hists.nlay * hists.nModules_[hists.nlay - 1] + (int)hists.BPixnewDetIds_.size()))
720-
continue;
721668
if (!theLAPayload->putLorentzAngle(id, LorentzAnglePerTesla_)) {
722669
edm::LogError("SiPixelLorentzAnglePCLHarvester") << "[SiPixelLorentzAnglePCLHarvester::fitAndStore]: detid ("
723670
<< i_layer << "," << i_module << ") already exists";
@@ -732,8 +679,6 @@ SiPixelLAHarvest::fitResults SiPixelLorentzAnglePCLHarvester::fitAndStore(
732679
hists.h_bySectDeltaLA_->setBinContent(i_index, 0.);
733680

734681
for (const auto& id : detIdsToFill) {
735-
if (i_index > (hists.nlay * hists.nModules_[hists.nlay - 1] + (int)hists.BPixnewDetIds_.size()))
736-
continue;
737682
LorentzAnglePerTesla_ = currentLorentzAngle->getLorentzAngle(id);
738683
if (!theLAPayload->putLorentzAngle(id, LorentzAnglePerTesla_)) {
739684
edm::LogError("SiPixelLorentzAnglePCLHarvester") << "[SiPixelLorentzAnglePCLHarvester::fitAndStore]: detid ("

CalibTracker/SiPixelLorentzAngle/src/SiPixelLorentzAnglePCLWorker.cc

Lines changed: 17 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -537,15 +537,21 @@ void SiPixelLorentzAnglePCLWorker::analyze(edm::Event const& iEvent, edm::EventS
537537
iHists.h_drift_depth_noadc_.at(i_index)->Fill(drift, depth, 1.);
538538
iHists.h_bySectOccupancy_->Fill(i_index - 1); // histogram starts at 0
539539

540-
if (module_ >= 3 && module_ <= 6 && (layer_ == 3 || layer_ == 4)) {
541-
int i_index_merge = (module_ - 1) / 2 + (layer_ - 3) * 2 +
542-
iHists.nlay * iHists.nModules_[iHists.nlay - 1] +
543-
(int)iHists.BPixnewDetIds_.size();
544-
545-
iHists.h_drift_depth_adc_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j]);
546-
iHists.h_drift_depth_adc2_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j] * pixinfo_.adc[j]);
547-
iHists.h_drift_depth_noadc_.at(i_index_merge)->Fill(drift, depth, 1.);
548-
iHists.h_bySectOccupancy_->Fill(i_index_merge - 1);
540+
if (tracker->getDetectorType(subDetID) == TrackerGeometry::ModuleType::Ph1PXB) {
541+
if ((module_ == 3 || module_ == 5) && (layer_ == 3 || layer_ == 4)) {
542+
int i_index_merge = i_index + 1;
543+
iHists.h_drift_depth_adc_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j]);
544+
iHists.h_drift_depth_adc2_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j] * pixinfo_.adc[j]);
545+
iHists.h_drift_depth_noadc_.at(i_index_merge)->Fill(drift, depth, 1.);
546+
iHists.h_bySectOccupancy_->Fill(i_index_merge - 1);
547+
}
548+
if ((module_ == 4 || module_ == 6) && (layer_ == 3 || layer_ == 4)) {
549+
int i_index_merge = i_index - 1;
550+
iHists.h_drift_depth_adc_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j]);
551+
iHists.h_drift_depth_adc2_.at(i_index_merge)->Fill(drift, depth, pixinfo_.adc[j] * pixinfo_.adc[j]);
552+
iHists.h_drift_depth_noadc_.at(i_index_merge)->Fill(drift, depth, 1.);
553+
iHists.h_bySectOccupancy_->Fill(i_index_merge - 1);
554+
}
549555
}
550556

551557
} else {
@@ -705,12 +711,11 @@ void SiPixelLorentzAnglePCLWorker::bookHistograms(DQMStore::IBooker& iBooker,
705711
edm::Run const& run,
706712
edm::EventSetup const& iSetup) {
707713
// book the by partition monitoring
708-
const auto maxSect = iHists.nlay * iHists.nModules_[iHists.nlay - 1] + (int)iHists.BPixnewDetIds_.size() +
709-
4; // add 4 more for combined modules
714+
const auto maxSect = iHists.nlay * iHists.nModules_[iHists.nlay - 1] + (int)iHists.BPixnewDetIds_.size();
710715

711716
iBooker.setCurrentFolder(fmt::sprintf("%s/SectorMonitoring", folder_.data()));
712717
iHists.h_bySectOccupancy_ = iBooker.book1D(
713-
"h_bySectorOccupancy", "hit occupancy by sector;pixel sector;hits on track", maxSect, -0.5, maxSect + 0.5);
718+
"h_bySectorOccupancy", "hit occupancy by sector;pixel sector;hits on track", maxSect, -0.5, maxSect - 0.5);
714719

715720
iBooker.setCurrentFolder(folder_);
716721
static constexpr double min_depth_ = -100.;
@@ -736,26 +741,6 @@ void SiPixelLorentzAnglePCLWorker::bookHistograms(DQMStore::IBooker& iBooker,
736741
i_layer,
737742
i_module);
738743
iHists.h_mean_[i_index] = iBooker.book1D(name, title, hist_depth_, min_depth_, max_depth_);
739-
740-
if ((i_module == 3 || i_module == 5) && (i_layer == 3 || i_layer == 4)) {
741-
int i_index_merge = (i_module - 1) / 2 + (i_layer - 3) * 2 + iHists.nlay * iHists.nModules_[iHists.nlay - 1] +
742-
(int)iHists.BPixnewDetIds_.size();
743-
744-
std::string binName = fmt::sprintf("BPix Layer%i Module %i and Module %i", i_layer, i_module, i_module + 1);
745-
LogDebug("SiPixelLorentzAnglePCLWorker") << " i_index_merge: " << i_index_merge << " bin name: " << binName
746-
<< " (i_layer: " << i_layer << " i_module:" << i_module << " and "
747-
<< " i_module:" << i_module + 1 << ")";
748-
749-
iHists.h_bySectOccupancy_->setBinLabel(i_index_merge, binName);
750-
751-
sprintf(name, "h_mean_layer%i_module%i_and_module%i", i_layer, i_module, i_module + 1);
752-
sprintf(title,
753-
"average drift vs depth layer%i module%i_and_module%i; production depth [#mum]; #LTdrift#GT [#mum]",
754-
i_layer,
755-
i_module,
756-
i_module + 1);
757-
iHists.h_mean_[i_index_merge] = iBooker.book1D(name, title, hist_depth_, min_depth_, max_depth_);
758-
}
759744
}
760745
}
761746
for (int i = 0; i < (int)iHists.BPixnewDetIds_.size(); i++) {
@@ -798,50 +783,6 @@ void SiPixelLorentzAnglePCLWorker::bookHistograms(DQMStore::IBooker& iBooker,
798783
sprintf(title, "depth vs drift layer%i module%i; drift [#mum]; production depth [#mum]", i_layer, i_module);
799784
iHists.h_drift_depth_[i_index] =
800785
iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
801-
802-
// merge modules 3 and 4 at L3 & L4, merge modules 5 and 6 at L3 & L4
803-
if ((i_module == 3 || i_module == 5) && (i_layer == 3 || i_layer == 4)) {
804-
unsigned int i_index_merge = (i_module - 1) / 2 + (i_layer - 3) * 2 +
805-
iHists.nlay * iHists.nModules_[iHists.nlay - 1] +
806-
(int)iHists.BPixnewDetIds_.size();
807-
808-
sprintf(name, "h_drift_depth_adc_layer%i_module%i_and_module%i", i_layer, i_module, i_module + 1);
809-
sprintf(title,
810-
"depth vs drift (ADC) layer%i module%i_and_module%i; drift [#mum]; production depth [#mum]",
811-
i_layer,
812-
i_module,
813-
i_module + 1);
814-
iHists.h_drift_depth_adc_[i_index_merge] =
815-
iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
816-
817-
sprintf(name, "h_drift_depth_adc2_layer%i_module%i_and_module%i", i_layer, i_module, i_module + 1);
818-
sprintf(title,
819-
"depth vs drift (ADC^{2}) layer%i module%i_and_module%i; drift [#mum]; production depth [#mum]",
820-
i_layer,
821-
i_module,
822-
i_module + 1);
823-
iHists.h_drift_depth_adc2_[i_index_merge] =
824-
iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
825-
826-
sprintf(name, "h_drift_depth_noadc_layer%i_module%i_and_module%i", i_layer, i_module, i_module + 1);
827-
sprintf(title,
828-
"depth vs drift (no ADC) layer%i module%i_and_module%i; drift [#mum]; production depth [#mum]",
829-
i_layer,
830-
i_module,
831-
i_module + 1);
832-
iHists.h_drift_depth_noadc_[i_index_merge] =
833-
iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
834-
835-
sprintf(name, "h_drift_depth_layer%i_module%i_and_module%i", i_layer, i_module, i_module + 1);
836-
sprintf(title,
837-
"depth vs drift layer%i module%i_and_module%i; drift [#mum]; production depth [#mum]",
838-
i_layer,
839-
i_module,
840-
i_module + 1);
841-
842-
iHists.h_drift_depth_[i_index_merge] =
843-
iBooker.book2D(name, title, hist_drift_, min_drift_, max_drift_, hist_depth_, min_depth_, max_depth_);
844-
}
845786
}
846787
}
847788

0 commit comments

Comments
 (0)