Skip to content

Commit

Permalink
Merge pull request #41050 from mmusich/devel_13_1_X_cleanUpSiStripHit…
Browse files Browse the repository at this point in the history
…Efficiency

Clean-up in `CalibTracker/SiStripHitEfficiency` and add trend of efficiency vs lumi, PU and BX in `SiStripHitEfficiencyHarvester`
  • Loading branch information
cmsbuild authored Mar 15, 2023
2 parents d90d72f + fba034e commit 24bb0d1
Show file tree
Hide file tree
Showing 6 changed files with 306 additions and 259 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,20 @@ namespace {
k_END_OF_LAYS_AND_RINGS = 35
};

/*
* for the trend plots of efficiency vs some variable
*/
enum projections { k_vs_LUMI = 0, k_vs_PU = 1, k_vs_BX = 2, k_SIZE = 3 };

const std::array<std::string, projections::k_SIZE> projFolder = {{"VsLumi", "VsPu", "VsBx"}};
const std::array<std::string, projections::k_SIZE> projFoundHisto = {
{"layerfound_vsLumi_layer_", "layerfound_vsPU_layer_", "foundVsBx_layer"}};
const std::array<std::string, projections::k_SIZE> projTotalHisto = {
{"layertotal_vsLumi_layer_", "layertotal_vsPU_layer_", "totalVsBx_layer"}};
const std::array<std::string, projections::k_SIZE> projTitle = {{"Inst Lumi", "Pile-Up", "Bunch Crossing"}};
const std::array<std::string, projections::k_SIZE> projXtitle = {
{"instantaneous luminosity [Hz/cm^{2}]", "Pile-Up events", "Bunch Crossing number"}};

inline void replaceInString(std::string& str, const std::string& from, const std::string& to) {
if (from.empty())
return;
Expand Down
7 changes: 4 additions & 3 deletions CalibTracker/SiStripHitEfficiency/plugins/HitEff.cc
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ HitEff::HitEff(const edm::ParameterSet& conf)
chi2MeasurementEstimatorToken_(esConsumes(edm::ESInputTag("", "Chi2"))),
propagatorToken_(esConsumes(edm::ESInputTag("", "PropagatorWithMaterial"))),
conf_(conf) {
usesResource(TFileService::kSharedResource);
compSettings = conf_.getUntrackedParameter<int>("CompressionSettings", -1);
layers = conf_.getParameter<int>("Layer");
DEBUG = conf_.getParameter<bool>("Debug");
Expand Down Expand Up @@ -243,7 +244,7 @@ void HitEff::analyze(const edm::Event& e, const edm::EventSetup& es) {
//e.getByLabel("siStripDigis", fedErrorIds );
e.getByToken(digis_token_, fedErrorIds);

ESHandle<MeasurementTracker> measurementTrackerHandle = es.getHandle(measurementTkToken_);
edm::ESHandle<MeasurementTracker> measurementTrackerHandle = es.getHandle(measurementTkToken_);

edm::Handle<MeasurementTrackerEvent> measurementTrackerEvent;
//e.getByLabel("MeasurementTrackerEvent", measurementTrackerEvent);
Expand Down Expand Up @@ -298,7 +299,7 @@ void HitEff::analyze(const edm::Event& e, const edm::EventSetup& es) {

#ifdef ExtendedCALIBTree
//get dEdx info if available
Handle<ValueMap<DeDxData> > dEdxUncalibHandle;
edm::Handle<ValueMap<DeDxData> > dEdxUncalibHandle;
if (e.getByLabel("dedxMedianCTF", dEdxUncalibHandle)) {
const ValueMap<DeDxData> dEdxTrackUncalib = *dEdxUncalibHandle.product();

Expand All @@ -311,7 +312,7 @@ void HitEff::analyze(const edm::Event& e, const edm::EventSetup& es) {
}

//get muon and ecal timing info if available
Handle<MuonCollection> muH;
edm::Handle<MuonCollection> muH;
if (e.getByLabel("muonsWitht0Correction", muH)) {
const MuonCollection& muonsT0 = *muH.product();
if (!muonsT0.empty()) {
Expand Down
2 changes: 1 addition & 1 deletion CalibTracker/SiStripHitEfficiency/plugins/HitEff.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

class TrackerTopology;

class HitEff : public edm::one::EDAnalyzer<> {
class HitEff : public edm::one::EDAnalyzer<edm::one::SharedResources> {
public:
explicit HitEff(const edm::ParameterSet& conf);
~HitEff() override = default;
Expand Down
Loading

0 comments on commit 24bb0d1

Please sign in to comment.