@@ -195,6 +195,25 @@ JetAnalyzer::JetAnalyzer(const edm::ParameterSet& pSet)
195
195
}
196
196
pfjetIDFunctor = PFJetIDSelectionFunctor (pfjetidversion, pfjetidquality);
197
197
}
198
+
199
+ // Jet ID definitions for scouting PF jets
200
+ if (isScoutingJet_) {
201
+ if (JetIDVersion_ == " RUN3Scouting" ) {
202
+ run3scoutingpfjetidversion = Run3ScoutingPFJetIDSelectionFunctor::RUN3Scouting;
203
+ } else {
204
+ if (verbose_)
205
+ std::cout << " no valid scouting Run3ScoutinPF JetID version given" << std::endl;
206
+ }
207
+ if (JetIDQuality_ == " TIGHT" ) {
208
+ run3scoutingpfjetidquality = Run3ScoutingPFJetIDSelectionFunctor::TIGHT;
209
+ } else {
210
+ if (verbose_)
211
+ std::cout << " no Valid scouting Run3ScoutinPF JetID quality given" << std::endl;
212
+ }
213
+ run3scoutingpfjetIDFunctor =
214
+ Run3ScoutingPFJetIDSelectionFunctor (run3scoutingpfjetidversion, run3scoutingpfjetidquality);
215
+ }
216
+
198
217
// check later if some of those are also needed for PFJets
199
218
leadJetFlag_ = 0 ;
200
219
jetLoPass_ = 0 ;
@@ -293,7 +312,10 @@ JetAnalyzer::~JetAnalyzer() {
293
312
// ***********************************************************
294
313
void JetAnalyzer::bookHistograms (DQMStore::IBooker& ibooker, edm::Run const & iRun, edm::EventSetup const &) {
295
314
if (isScoutingJet_) {
296
- if (!jetCleaningFlag_) {
315
+ if (jetCleaningFlag_) {
316
+ ibooker.setCurrentFolder (" HLT/ScoutingOffline/Jet/Cleaned" + mInputCollection_ .label ());
317
+ DirName = " HLT/ScoutingOffline/Jet/Cleaned" + mInputCollection_ .label ();
318
+ } else {
297
319
ibooker.setCurrentFolder (" HLT/ScoutingOffline/Jet/Uncleaned" + mInputCollection_ .label ());
298
320
DirName = " HLT/ScoutingOffline/Jet/Uncleaned" + mInputCollection_ .label ();
299
321
}
@@ -2592,7 +2614,9 @@ void JetAnalyzer::dqmBeginRun(const edm::Run& iRun, const edm::EventSetup& iSetu
2592
2614
void JetAnalyzer::analyze (const edm::Event& iEvent, const edm::EventSetup& iSetup) {
2593
2615
// set general folders first --> change later on for different folders
2594
2616
if (isScoutingJet_) {
2595
- if (!jetCleaningFlag_) {
2617
+ if (jetCleaningFlag_) {
2618
+ DirName = " HLT/ScoutingOffline/Jet/Cleaned" + mInputCollection_ .label ();
2619
+ } else {
2596
2620
DirName = " HLT/ScoutingOffline/Jet/Uncleaned" + mInputCollection_ .label ();
2597
2621
}
2598
2622
} else {
@@ -2900,12 +2924,13 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
2900
2924
if (isMiniAODJet_)
2901
2925
jetCollectionIsValid = patJets.isValid ();
2902
2926
2903
- if (jetCleaningFlag_ && (!jetCollectionIsValid || !bPrimaryVertex || !dcsDecision)) // why "jetCleaningFlag_ &&" ???
2904
- return ;
2905
-
2906
2927
if (isScoutingJet_) {
2907
2928
if (!scoutingJets.isValid ())
2908
2929
return ;
2930
+ } else {
2931
+ if (jetCleaningFlag_ &&
2932
+ (!jetCollectionIsValid || !bPrimaryVertex || !dcsDecision)) // why "jetCleaningFlag_ &&" ???
2933
+ return ;
2909
2934
}
2910
2935
2911
2936
unsigned int collSize = -1 ;
@@ -3036,12 +3061,19 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
3036
3061
// remove the continue line, for physics selections we might losen the pt-thresholds as we care only about leading jets
3037
3062
3038
3063
numofscoutingjets++;
3064
+ bool jetpassidScouting = true ;
3065
+ bool ThiscleanedScouting = true ;
3039
3066
if (isScoutingJet_) {
3040
3067
jetEnergy = (*scoutingJets)[ijet].chargedHadronEnergy () + (*scoutingJets)[ijet].neutralHadronEnergy () +
3041
3068
(*scoutingJets)[ijet].electronEnergy () + (*scoutingJets)[ijet].photonEnergy () +
3042
3069
(*scoutingJets)[ijet].muonEnergy () + (*scoutingJets)[ijet].HFEMEnergy ();
3043
3070
3044
- if (pass_uncorrected) {
3071
+ jetpassidScouting = run3scoutingpfjetIDFunctor ((*scoutingJets)[ijet]);
3072
+ if (jetCleaningFlag_) {
3073
+ ThiscleanedScouting = jetpassidScouting;
3074
+ }
3075
+
3076
+ if (ThiscleanedScouting && pass_uncorrected) {
3045
3077
mPt_uncor = map_of_MEs[DirName + " /" + " Pt_uncor" ];
3046
3078
if (mPt_uncor && mPt_uncor ->getRootObject ())
3047
3079
mPt_uncor ->Fill ((*scoutingJets)[ijet].pt ());
@@ -3056,7 +3088,7 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
3056
3088
mJetArea_uncor ->Fill ((*scoutingJets)[ijet].jetArea ());
3057
3089
}
3058
3090
3059
- if (pass_corrected) {
3091
+ if (ThiscleanedScouting && pass_corrected) {
3060
3092
mPt = map_of_MEs[DirName + " /" + " Pt" ];
3061
3093
if (mPt && mPt ->getRootObject ())
3062
3094
mPt ->Fill (correctedJet.pt ());
@@ -3069,7 +3101,6 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
3069
3101
mJetArea = map_of_MEs[DirName + " /" + " JetArea" ];
3070
3102
if (mJetArea && mJetArea ->getRootObject ())
3071
3103
mJetArea ->Fill (correctedJet.jetArea ());
3072
- // if (fabs((*scoutingJets)[ijet].eta()) <= 0.5 && 30 <= (*scoutingJets)[ijet].pt() <= 50) {
3073
3104
mJetEnergyCorr = map_of_MEs[DirName + " /" + " JetEnergyCorr" ];
3074
3105
if (mJetEnergyCorr && mJetEnergyCorr ->getRootObject ())
3075
3106
mJetEnergyCorr ->Fill (correctedJet.pt () / (*scoutingJets)[ijet].pt ());
@@ -3079,8 +3110,36 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
3079
3110
mJetEnergyCorrVSPt = map_of_MEs[DirName + " /" + " JetEnergyCorrVSPt" ];
3080
3111
if (mJetEnergyCorrVSPt && mJetEnergyCorrVSPt ->getRootObject ())
3081
3112
mJetEnergyCorrVSPt ->Fill (correctedJet.pt (), correctedJet.pt () / (*scoutingJets)[ijet].pt ());
3082
- // }
3083
3113
}
3114
+
3115
+ if (!runcosmics_ && pass_corrected) {
3116
+ if (jetpassidScouting) {
3117
+ mLooseJIDPassFractionVSeta = map_of_MEs[DirName + " /" + " JetIDPassFractionVSeta" ];
3118
+ if (mLooseJIDPassFractionVSeta && mLooseJIDPassFractionVSeta ->getRootObject ())
3119
+ mLooseJIDPassFractionVSeta ->Fill (correctedJet.eta (), 1 .);
3120
+ mLooseJIDPassFractionVSpt = map_of_MEs[DirName + " /" + " JetIDPassFractionVSpt" ];
3121
+ if (mLooseJIDPassFractionVSpt && mLooseJIDPassFractionVSpt ->getRootObject ())
3122
+ mLooseJIDPassFractionVSpt ->Fill (correctedJet.pt (), 1 .);
3123
+ if (fabs (correctedJet.eta ()) < 3.0 ) {
3124
+ mLooseJIDPassFractionVSptNoHF = map_of_MEs[DirName + " /" + " JetIDPassFractionVSptNoHF" ];
3125
+ if (mLooseJIDPassFractionVSptNoHF && mLooseJIDPassFractionVSptNoHF ->getRootObject ())
3126
+ mLooseJIDPassFractionVSptNoHF ->Fill (correctedJet.pt (), 1 .);
3127
+ }
3128
+ } else {
3129
+ mLooseJIDPassFractionVSeta = map_of_MEs[DirName + " /" + " JetIDPassFractionVSeta" ];
3130
+ if (mLooseJIDPassFractionVSeta && mLooseJIDPassFractionVSeta ->getRootObject ())
3131
+ mLooseJIDPassFractionVSeta ->Fill (correctedJet.eta (), 0 .);
3132
+ mLooseJIDPassFractionVSpt = map_of_MEs[DirName + " /" + " JetIDPassFractionVSpt" ];
3133
+ if (mLooseJIDPassFractionVSpt && mLooseJIDPassFractionVSpt ->getRootObject ())
3134
+ mLooseJIDPassFractionVSpt ->Fill (correctedJet.pt (), 0 .);
3135
+ if (fabs (correctedJet.eta ()) < 3.0 ) {
3136
+ mLooseJIDPassFractionVSptNoHF = map_of_MEs[DirName + " /" + " JetIDPassFractionVSptNoHF" ];
3137
+ if (mLooseJIDPassFractionVSptNoHF && mLooseJIDPassFractionVSptNoHF ->getRootObject ())
3138
+ mLooseJIDPassFractionVSptNoHF ->Fill (correctedJet.pt (), 0 .);
3139
+ }
3140
+ }
3141
+ }
3142
+
3084
3143
// mConstituents = map_of_MEs[DirName + "/" + "Constituents"];
3085
3144
// if (mConstituents && mConstituents->getRootObject())
3086
3145
// mConstituents->Fill((*scoutingJets)[ijet].constituents());
@@ -4686,7 +4745,7 @@ void JetAnalyzer::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetu
4686
4745
}
4687
4746
// after jettype specific variables are filled -> perform histograms for all jets
4688
4747
// fill JetID efficiencies if uncleaned selection is chosen
4689
- if (!runcosmics_ && pass_corrected) {
4748
+ if (!runcosmics_ && !isScoutingJet_ && pass_corrected) {
4690
4749
if (jetpassid) {
4691
4750
mLooseJIDPassFractionVSeta = map_of_MEs[DirName + " /" + " JetIDPassFractionVSeta" ];
4692
4751
if (mLooseJIDPassFractionVSeta && mLooseJIDPassFractionVSeta ->getRootObject ())
0 commit comments