Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CMSSW_12_3_X] Fix CSC CLCT resolution validation plots #37357

Merged
merged 5 commits into from
Mar 27, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
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