Skip to content

Commit

Permalink
Merge pull request #37357 from sifuluo/PR-CMSSW_12_3_X
Browse files Browse the repository at this point in the history
[CMSSW_12_3_X] Fix CSC CLCT resolution validation plots
  • Loading branch information
cmsbuild committed Mar 27, 2022
2 parents 06e7c89 + 940c827 commit 28c9584
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
Expand Up @@ -16,8 +16,6 @@ class CSCStubResolutionValidation : public CSCBaseValidation {
void analyze(const edm::Event &, const edm::EventSetup &) override;

private:
edm::InputTag inputTag_;

std::unique_ptr<CSCStubMatcher> cscStubMatcher_;

// resolution for each CSC TP; 10 CSC stations;
Expand All @@ -29,10 +27,6 @@ class CSCStubResolutionValidation : public CSCBaseValidation {

edm::EDGetTokenT<edm::SimVertexContainer> simVertexInput_;
edm::EDGetTokenT<edm::SimTrackContainer> simTrackInput_;

double simTrackMinPt_;
double simTrackMinEta_;
double simTrackMaxEta_;
};

#endif
20 changes: 15 additions & 5 deletions Validation/MuonCSCDigis/src/CSCStubResolutionValidation.cc
Expand Up @@ -90,19 +90,27 @@ void CSCStubResolutionValidation::analyze(const edm::Event& e, const edm::EventS
// CLCTs
for (auto& [id, container] : clcts) {
const CSCDetId cscId(id);
const unsigned chamberType(cscId.iChamberType());

// get the best clct in chamber
const auto& clct = cscStubMatcher_->bestClctInChamber(id);
if (!clct.isValid())
continue;

hitCLCT[chamberType - 1] = true;
// ME1a CLCTs are saved in ME1b container. So the DetId need to be specified
const bool isME11(cscId.station() == 1 and (cscId.ring() == 4 or cscId.ring() == 1));
const bool isME1a(isME11 and clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B);
int ring = cscId.ring();
if (isME1a)
ring = 4;
else if (isME11)
ring = 1;
CSCDetId cscId2(cscId.endcap(), cscId.station(), ring, cscId.chamber(), 0);
auto id2 = cscId2.rawId();

// calculate deltastrip for ME1/a. Basically, we need to subtract 64 from the CLCT key strip to
// compare with key strip as obtained through the fit to simhits positions.
int deltaStrip = 0;
if (cscId.station() == 1 and cscId.ring() == 4 and clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B)
if (isME1a)
deltaStrip = CSCConstants::NUM_STRIPS_ME1B;

// fractional strip
Expand All @@ -116,17 +124,19 @@ void CSCStubResolutionValidation::analyze(const edm::Event& e, const edm::EventS

// get the fit hits in chamber for true value
float stripIntercept, stripSlope;
cscStubMatcher_->cscDigiMatcher()->muonSimHitMatcher()->fitHitsInChamber(id, stripIntercept, stripSlope);
cscStubMatcher_->cscDigiMatcher()->muonSimHitMatcher()->fitHitsInChamber(id2, stripIntercept, stripSlope);

// add offset of +0.25 strips for non-ME1/1 chambers
const bool isME11(cscId.station() == 1 and (cscId.ring() == 4 or cscId.ring() == 1));
if (!isME11) {
stripIntercept -= 0.25;
}

const float strip_csc_sh = stripIntercept;
const float bend_csc_sh = stripSlope;

const unsigned chamberType(cscId2.iChamberType());
hitCLCT[chamberType - 1] = true;

delta_fhs_clct[chamberType - 1] = fhs_clct - deltaStrip - strip_csc_sh;
delta_fqs_clct[chamberType - 1] = fqs_clct - deltaStrip - strip_csc_sh;
delta_fes_clct[chamberType - 1] = fes_clct - deltaStrip - strip_csc_sh;
Expand Down

0 comments on commit 28c9584

Please sign in to comment.