Skip to content

Commit

Permalink
Merge branch 'CMSSW_13_1_X' into 131X_WFs2023D
Browse files Browse the repository at this point in the history
  • Loading branch information
sunilUIET authored Aug 2, 2023
2 parents 607e2cb + 0870b59 commit dd333e7
Show file tree
Hide file tree
Showing 22 changed files with 325 additions and 90 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -152,15 +152,22 @@ class SiStripHitEffFromCalibTree : public ConditionDBWriter<SiStripBadStrip> {
float tkMapMin_;
float effPlotMin_;
TString title_;
bool storeModEff_;

unsigned int nTEClayers;

TH1F* bxHisto;
TH1F* instLumiHisto;
TH1F* PUHisto;

TH1F* bxHisto_cutOnTracks;
TH1F* instLumiHisto_cutOnTracks;
TH1F* PUHisto_cutOnTracks;

// for association of informations of the hitEff tree and the event infos tree
map<pair<unsigned int, unsigned int>, array<double, 3> > eventInfos;
// for using events after number of tracks cut
map<pair<unsigned int, unsigned int>, bool> event_used;

vector<hit> hits[23];
vector<TH2F*> HotColdMaps;
Expand Down Expand Up @@ -215,6 +222,7 @@ SiStripHitEffFromCalibTree::SiStripHitEffFromCalibTree(const edm::ParameterSet&
tkMapMin_ = conf.getUntrackedParameter<double>("TkMapMin", 0.9);
effPlotMin_ = conf.getUntrackedParameter<double>("EffPlotMin", 0.9);
title_ = conf.getParameter<std::string>("Title");
storeModEff_ = conf.getUntrackedParameter<bool>("StoreModuleEff", false);
detInfo_ = SiStripDetInfoFileReader::read(fileInPath_.fullPath());

nTEClayers = 9; // number of wheels
Expand Down Expand Up @@ -259,7 +267,11 @@ void SiStripHitEffFromCalibTree::algoAnalyze(const edm::Event& e, const edm::Eve

bxHisto = fs->make<TH1F>("bx", "bx", 3600, 0, 3600);
instLumiHisto = fs->make<TH1F>("instLumi", "inst. lumi.", 250, 0, 25000);
PUHisto = fs->make<TH1F>("PU", "PU", 200, 0, 200);
PUHisto = fs->make<TH1F>("PU", "PU", 300, 0, 300);

bxHisto_cutOnTracks = fs->make<TH1F>("bx_cutOnTracks", "bx", 3600, 0, 3600);
instLumiHisto_cutOnTracks = fs->make<TH1F>("instLumi_cutOnTracks", "inst. lumi.", 250, 0, 25000);
PUHisto_cutOnTracks = fs->make<TH1F>("PU_cutOnTracks", "PU", 300, 0, 300);

for (int l = 0; l < 35; l++) {
goodlayertotal[l] = 0;
Expand Down Expand Up @@ -354,6 +366,7 @@ void SiStripHitEffFromCalibTree::algoAnalyze(const edm::Event& e, const edm::Eve
PUHisto->Fill(PU);

eventInfos[make_pair(run, evt)] = array<double, 3>{{(double)bx, instLumi, PU}};
event_used[make_pair(run, evt)] = false;
}
}

Expand Down Expand Up @@ -388,6 +401,7 @@ void SiStripHitEffFromCalibTree::algoAnalyze(const edm::Event& e, const edm::Eve
LOGPRINT << "Successfully loaded analyze function with " << nevents << " events!\n";

map<pair<unsigned int, unsigned int>, array<double, 3> >::iterator itEventInfos;
map<pair<unsigned int, unsigned int>, bool>::iterator itEventUsed;

//Loop through all of the events
for (int j = 0; j < nevents; j++) {
Expand Down Expand Up @@ -430,6 +444,10 @@ void SiStripHitEffFromCalibTree::algoAnalyze(const edm::Event& e, const edm::Eve
instLumi = InstLumiLf->GetValue(); // branch not filled by default
if (PULf != nullptr)
PU = PULf->GetValue(); // branch not filled by default
// Mark new event
itEventUsed = event_used.find(make_pair(run, evt));
if (itEventUsed == event_used.end())
event_used[make_pair(run, evt)] = false;
}
int CM = -100;
if (useCM_)
Expand All @@ -445,6 +463,18 @@ void SiStripHitEffFromCalibTree::algoAnalyze(const edm::Event& e, const edm::Eve
}
}

// Fill event info for events from the anEff tree
// They can differ from the eventInfo tree due to an optional cut on the #tracks when filling the anEff tree
itEventUsed = event_used.find(make_pair(run, evt));
if (itEventUsed != event_used.end()) {
if (itEventUsed->second == false) {
bxHisto_cutOnTracks->Fill(bx);
instLumiHisto_cutOnTracks->Fill(instLumi);
PUHisto_cutOnTracks->Fill(PU);
itEventUsed->second = true;
}
}

//We have two things we want to do, both an XY color plot, and the efficiency measurement
//First, ignore anything that isn't in acceptance and isn't good quality

Expand Down Expand Up @@ -1004,6 +1034,22 @@ void SiStripHitEffFromCalibTree::makeHotColdMaps() {

void SiStripHitEffFromCalibTree::makeTKMap(bool autoTagging = false) {
LOGPRINT << "Entering TKMap generation!\n";

TTree* tree = nullptr;
unsigned int t_DetId, t_found, t_total;
unsigned char t_layer;
bool t_isTaggedIneff;
float t_threshold;
if (storeModEff_) {
tree = fs->make<TTree>("ModEff", "ModEff");
tree->Branch("DetId", &t_DetId, "DetId/i");
tree->Branch("Layer", &t_layer, "Layer/b");
tree->Branch("FoundHits", &t_found, "FoundHits/i");
tree->Branch("AllHits", &t_total, "AllHits/i");
tree->Branch("IsTaggedIneff", &t_isTaggedIneff, "IsTaggedIneff/O");
tree->Branch("TagThreshold", &t_threshold, "TagThreshold/F");
}

tkmap = new TrackerMap(" Detector Inefficiency ");
tkmapbad = new TrackerMap(" Inefficient Modules ");
tkmapeff = new TrackerMap(title_.Data());
Expand Down Expand Up @@ -1052,6 +1098,16 @@ void SiStripHitEffFromCalibTree::makeTKMap(bool autoTagging = false) {
}
}

if (storeModEff_) {
t_DetId = ih.first;
t_layer = i;
t_found = mynum;
t_total = myden;
t_isTaggedIneff = false;
t_threshold = 0;
tree->Fill();
}

//Put any module into the TKMap
tkmap->fill(ih.first, 1. - myeff);
tkmapeff->fill(ih.first, myeff);
Expand Down Expand Up @@ -1089,9 +1145,11 @@ void SiStripHitEffFromCalibTree::makeTKMap(bool autoTagging = false) {
//We have a bad module, put it in the list!
BadModules[ih.first] = myeff;
tkmapbad->fillc(ih.first, 255, 0, 0);
t_isTaggedIneff = true;
} else {
//Fill the bad list with empty results for every module
tkmapbad->fillc(ih.first, 255, 255, 255);
t_isTaggedIneff = false;
}
if (myeff_up < layer_min_eff + 0.08) // printing message also for modules slighly above (8%) the limit
LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers) << ") module " << ih.first
Expand All @@ -1100,6 +1158,15 @@ void SiStripHitEffFromCalibTree::makeTKMap(bool autoTagging = false) {
LOGPRINT << "Layer " << i << " (" << ::layerName(i, showRings_, nTEClayers) << ") module " << ih.first
<< " layer " << i << " is under occupancy at " << myden;
}

if (storeModEff_) {
t_DetId = ih.first;
t_layer = i;
t_found = mynum;
t_total = myden;
t_threshold = layer_min_eff;
tree->Fill();
}
}
}
}
Expand All @@ -1109,6 +1176,8 @@ void SiStripHitEffFromCalibTree::makeTKMap(bool autoTagging = false) {
tkmapnum->save(true, 0, 0, "SiStripHitEffTKMapNum.png");
tkmapden->save(true, 0, 0, "SiStripHitEffTKMapDen.png");
LOGPRINT << "Finished TKMap Generation\n";
if (storeModEff_)
LOGPRINT << "Modules efficiencies stored in tree\n";
}

void SiStripHitEffFromCalibTree::makeSQLite() {
Expand Down Expand Up @@ -1369,6 +1438,7 @@ void SiStripHitEffFromCalibTree::makeSummary() {
leg->Draw("same");

c7->SaveAs("Summary.png");
c7->SaveAs("Summary.C");
}

void SiStripHitEffFromCalibTree::makeSummaryVsBx() {
Expand Down
4 changes: 2 additions & 2 deletions CondTools/RunInfo/plugins/LHCInfoPerFillPopConAnalyzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,8 @@ namespace theLHCInfoPerFillImpl {
bool comparePayloads(const LHCInfoPerFill& rhs, const LHCInfoPerFill& lhs) {
if (rhs.fillNumber() != lhs.fillNumber() || rhs.delivLumi() != lhs.delivLumi() || rhs.recLumi() != lhs.recLumi() ||
rhs.instLumi() != lhs.instLumi() || rhs.instLumiError() != lhs.instLumiError() ||
rhs.lhcState() != rhs.lhcState() || rhs.lhcComment() != rhs.lhcComment() ||
rhs.ctppsStatus() != rhs.ctppsStatus()) {
rhs.lhcState() != lhs.lhcState() || rhs.lhcComment() != lhs.lhcComment() ||
rhs.ctppsStatus() != lhs.ctppsStatus()) {
return false;
}
return true;
Expand Down
10 changes: 5 additions & 5 deletions CondTools/RunInfo/src/LHCInfoPopConSourceHandler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -562,15 +562,15 @@ namespace LHCInfoImpl {
return false;
if (rhs.instLumiError() != lhs.instLumiError())
return false;
if (rhs.crossingAngle() != rhs.crossingAngle())
if (rhs.crossingAngle() != lhs.crossingAngle())
return false;
if (rhs.betaStar() != rhs.betaStar())
if (rhs.betaStar() != lhs.betaStar())
return false;
if (rhs.lhcState() != rhs.lhcState())
if (rhs.lhcState() != lhs.lhcState())
return false;
if (rhs.lhcComment() != rhs.lhcComment())
if (rhs.lhcComment() != lhs.lhcComment())
return false;
if (rhs.ctppsStatus() != rhs.ctppsStatus())
if (rhs.ctppsStatus() != lhs.ctppsStatus())
return false;
return true;
}
Expand Down
16 changes: 8 additions & 8 deletions Configuration/AlCa/python/autoCond.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@
'run2_data_promptlike_hi' : '124X_dataRun2_PromptLike_HI_v1',
# GlobalTag with fixed snapshot time for Run2 HLT RelVals: customizations to run with fixed L1 Menu
'run2_hlt_relval' : '123X_dataRun2_HLT_relval_v3',
# GlobalTag for Run3 HLT: identical to the online GT (130X_dataRun3_HLT_v2) but with snapshot at 2023-06-14 12:00:00 (UTC)
'run3_hlt' : '130X_dataRun3_HLT_frozen_v3',
# GlobalTag for Run3 data relvals (express GT) - identical to 130X_dataRun3_Express_v3 but with snapshot at 2023-06-14 12:00:00 (UTC)
'run3_data_express' : '130X_dataRun3_Express_frozen_v3',
# GlobalTag for Run3 data relvals (prompt GT) - identical to 130X_dataRun3_Prompt_v4 but with snapshot at 2023-06-14 12:00:00 (UTC)
'run3_data_prompt' : '130X_dataRun3_Prompt_frozen_v3',
# GlobalTag for Run3 HLT: identical to the online GT (130X_dataRun3_HLT_v2) but with snapshot at 2023-07-25 12:00:00 (UTC)
'run3_hlt' : '130X_dataRun3_HLT_frozen_v4',
# GlobalTag for Run3 data relvals (express GT) - identical to 130X_dataRun3_Express_v3 but with snapshot at 2023-07-25 12:00:00 (UTC)
'run3_data_express' : '130X_dataRun3_Express_frozen_v4',
# GlobalTag for Run3 data relvals (prompt GT) - identical to 130X_dataRun3_Prompt_v4 but with snapshot at 2023-07-25 12:00:00 (UTC)
'run3_data_prompt' : '130X_dataRun3_Prompt_frozen_v4',
# GlobalTag for Run3 offline data reprocessing - snapshot at 2023-05-09 15:38:20 (UTC)
'run3_data' : '130X_dataRun3_v2',
# GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2017 (and 0,0,~0-centred beamspot)
Expand Down Expand Up @@ -76,9 +76,9 @@
# GlobalTag for MC production with perfectly aligned and calibrated detector for Phase1 2023
'phase1_2023_design' : '131X_mcRun3_2023_design_v7',
# GlobalTag for MC production with realistic conditions for Phase1 2023
'phase1_2023_realistic' : '131X_mcRun3_2023_realistic_v8',
'phase1_2023_realistic' : '131X_mcRun3_2023_realistic_v9',
# GlobalTag for MC production (cosmics) with realistic conditions for Phase1 2023, Strip tracker in DECO mode
'phase1_2023_cosmics' : '131X_mcRun3_2023cosmics_realistic_deco_v8',
'phase1_2023_cosmics' : '131X_mcRun3_2023cosmics_realistic_deco_v9',
# GlobalTag for MC production (cosmics) with perfectly aligned and calibrated detector for Phase1 2023, Strip tracker in DECO mode
'phase1_2023_cosmics_design' : '131X_mcRun3_2023cosmics_design_deco_v7',
# GlobalTag for MC production with realistic conditions for Phase1 2023 detector for Heavy Ion
Expand Down
6 changes: 6 additions & 0 deletions Configuration/Eras/python/Era_Run3_2023_FastSim_cff.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import FWCore.ParameterSet.Config as cms

from Configuration.Eras.Era_Run3_2023_cff import Run3_2023
from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM

Run3_2023_FastSim = Run3_2023.copyAndExclude([run3_GEM])
46 changes: 31 additions & 15 deletions Configuration/PyReleaseValidation/python/relval_standard.py
Original file line number Diff line number Diff line change
Expand Up @@ -498,22 +498,22 @@
workflows[140.076] = ['',['RunEGamma2022E','HLTDR3_2022','RECONANORUN3_reHLT','HARVESTRUN3']]
workflows[140.077] = ['',['RunTau2022E','HLTDR3_2022','RECONANORUN3_reHLT','HARVESTRUN3']]
workflows[140.078] = ['',['RunMuonEG2022E','HLTDR3_2022','RECONANORUN3_reHLT','HARVESTRUN3']]
### run3 (2023) skims ###

workflows[140.104] = ['',['RunZeroBias2022D','HLTDR3_2022','RECONANORUN3_reHLT','SKIMZEROBIASRUN3_reHLT']]
workflows[140.105] = ['',['RunBTagMu2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMBTAGMURUN3_reHLT']]
workflows[140.106] = ['',['RunJetMET2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMJETMET0RUN3_reHLT']]
workflows[140.107] = ['',['RunDisplacedJet2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMDISPLACEDJETRUN3_reHLT']]
workflows[140.109] = ['',['RunEGamma2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMEGAMMA0RUN3_reHLT']]
workflows[140.110] = ['',['RunTau2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMTAURUN3_reHLT']]
workflows[140.111] = ['',['RunMuon2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMMUON0RUN3_reHLT']]
workflows[140.112] = ['',['RunMuonEG2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMMUONEGRUN3_reHLT']]
workflows[140.113] = ['',['RunNoBPTX2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMNOBPTXRUN3_reHLT']]
workflows[140.114] = ['',['RunHcalNZS2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMHCALNZSRUN3_reHLT']]
workflows[140.115] = ['',['RunHLTPhysics2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMHLTPHYSICSRUN3_reHLT']]
workflows[140.116] = ['',['RunCommissioning2022D','HLTDR3_2023','RECONANORUN3_reHLT','SKIMCOMMISSIONINGRUN3_reHLT']]
workflows[140.117] = ['',['RunCosmics2022D','HLTDR3_2023','RECOCOSMRUN3_reHLT','SKIMCOSMICSRUN3_reHLT']]
#workflows[140.118] = ['',['RunParkingBPH2022B','HLTDR3_2023','RECONANORUN3_reHLT','SKIMPARKINGBPHRUN3_reHLT']]

### run3 (2022) skims ###
workflows[140.101] = ['',['RunZeroBias2022D','HLTDR3_2022','SKIMZEROBIASRUN3_reHLT_2022','HARVESTRUN3_ZB']]
workflows[140.102] = ['',['RunBTagMu2022D','HLTDR3_2022','SKIMBTAGMURUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.103] = ['',['RunJetMET2022D','HLTDR3_2022','SKIMJETMET0RUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.104] = ['',['RunDisplacedJet2022D','HLTDR3_2022','SKIMDISPLACEDJETRUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.105] = ['',['RunEGamma2022D','HLTDR3_2022','SKIMEGAMMA0RUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.106] = ['',['RunTau2022D','HLTDR3_2022','SKIMTAURUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.107] = ['',['RunMuon2022D','HLTDR3_2022','SKIMMUON0RUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.108] = ['',['RunMuonEG2022D','HLTDR3_2022','SKIMMUONEGRUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.109] = ['',['RunNoBPTX2022D','HLTDR3_2022','SKIMNOBPTXRUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.110] = ['',['RunHcalNZS2022D','HLTDR3_2022','SKIMHCALNZSRUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.111] = ['',['RunHLTPhysics2022D','HLTDR3_2022','SKIMHLTPHYSICSRUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.112] = ['',['RunCommissioning2022D','HLTDR3_2022','SKIMCOMMISSIONINGRUN3_reHLT_2022','HARVESTRUN3']]
workflows[140.113] = ['',['RunCosmics2022D','HLTDR3_2022','SKIMCOSMICSRUN3_reHLT_2022','HARVESTRUN3_COS']]

### run3 (2023) ###
workflows[141.001] = ['',['RunMuon2023B','HLTDR3_2023B','RECONANORUN3_reHLT_2023B','HARVESTRUN3_2023B']]
Expand Down Expand Up @@ -551,6 +551,22 @@
workflows[141.049] = ['',['RunParkingDoubleMuonLowMass2023D','HLTDR3_2023','RECONANORUN3_reHLT_2023','HARVESTRUN3_2023']]


### run3 (2023) skims ###
workflows[141.101] = ['',['RunZeroBias2023C','HLTDR3_2023','SKIMZEROBIASRUN3_reHLT_2023','HARVESTRUN3_ZB_2023']]
workflows[141.102] = ['',['RunBTagMu2023C','HLTDR3_2023','SKIMBTAGMURUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.103] = ['',['RunJetMET2023C','HLTDR3_2023','SKIMJETMET0RUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.104] = ['',['RunDisplacedJet2023C','HLTDR3_2023','SKIMDISPLACEDJETRUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.105] = ['',['RunEGamma2023C','HLTDR3_2023','SKIMEGAMMA0RUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.106] = ['',['RunTau2023C','HLTDR3_2023','SKIMTAURUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.107] = ['',['RunMuon2023C','HLTDR3_2023','SKIMMUON0RUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.108] = ['',['RunMuonEG2023C','HLTDR3_2023','SKIMMUONEGRUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.109] = ['',['RunNoBPTX2023C','HLTDR3_2023','SKIMNOBPTXRUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.110] = ['',['RunHcalNZS2023C','HLTDR3_2023','SKIMHCALNZSRUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.111] = ['',['RunHLTPhysics2023C','HLTDR3_2023','SKIMHLTPHYSICSRUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.112] = ['',['RunCommissioning2023C','HLTDR3_2023','SKIMCOMMISSIONINGRUN3_reHLT_2023','HARVESTRUN3_2023']]
workflows[141.113] = ['',['RunCosmics2023C','HLTDR3_2023','SKIMCOSMICSRUN3_reHLT_2023','HARVESTRUN3_COS_2023']]
workflows[141.114] = ['',['RunParkingDoubleMuonLowMass2023C','HLTDR3_2023','SKIMPARKINGDOUBLEMUONLOWMASS0RUN3_reHLT_2023','HARVESTRUN3_2023']]

### fastsim ###
workflows[5.1] = ['TTbarFS', ['TTbarFS','HARVESTFS']]
workflows[5.2] = ['SingleMuPt10FS', ['SingleMuPt10FS','HARVESTFS']]
Expand Down
Loading

0 comments on commit dd333e7

Please sign in to comment.