Skip to content

Commit

Permalink
Merge pull request #14 from tresreid/mods
Browse files Browse the repository at this point in the history
add rho2 for already included rho
  • Loading branch information
tresreid authored Sep 15, 2022
2 parents 47160c2 + 0f0363a commit 5f359dd
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions plugins/ScoutingNanoAOD.cc
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,7 @@ class ScoutingNanoAOD : public edm::one::EDAnalyzer<edm::one::SharedResources, e
const edm::EDGetTokenT<std::vector<reco::GenParticle> > gensToken;
//const edm::EDGetTokenT<GenEventInfoProduct> genEvtInfoToken;
const edm::EDGetTokenT<double> rhoToken;
const edm::EDGetTokenT<double> rhoToken2;

std::vector<std::string> triggerPathsVector;
std::map<std::string, int> triggerPathsMap;
Expand Down Expand Up @@ -334,6 +335,7 @@ class ScoutingNanoAOD : public edm::one::EDAnalyzer<edm::one::SharedResources, e
vector<Float16_t> Vertex_isValidVtx;

float rho;
float rho2;

// Event shape variables
float event_isotropy;
Expand Down Expand Up @@ -371,6 +373,7 @@ ScoutingNanoAOD::ScoutingNanoAOD(const edm::ParameterSet& iConfig):
pileupInfoToken (consumes<std::vector<PileupSummaryInfo> > (iConfig.getParameter<edm::InputTag>("pileupinfo"))),
gensToken (consumes<std::vector<reco::GenParticle> > (iConfig.getParameter<edm::InputTag>("gens"))),
rhoToken (consumes<double> (iConfig.getParameter<edm::InputTag>("rho"))),
rhoToken2 (consumes<double> (iConfig.getParameter<edm::InputTag>("rho2"))),
//genEvtInfoToken (consumes<GenEventInfoProduct> (iConfig.getParameter<edm::InputTag>("geneventinfo"))),
doL1 (iConfig.existsAs<bool>("doL1") ? iConfig.getParameter<bool> ("doL1") : false),
doData (iConfig.existsAs<bool>("doData") ? iConfig.getParameter<bool> ("doData") : false),
Expand Down Expand Up @@ -566,6 +569,7 @@ ScoutingNanoAOD::ScoutingNanoAOD(const edm::ParameterSet& iConfig):
tree->Branch("FatJet_nconst" ,&FatJet_nconst );

tree->Branch("rho", &rho);
tree->Branch("rho2", &rho2);

tree->Branch("event_isotropy" ,&event_isotropy );
tree->Branch("event_circularity" ,&event_circularity );
Expand Down Expand Up @@ -1266,6 +1270,9 @@ for(int e = 0; e < static_cast<int>(truth_pts.size()); e++){//loop over pf cands
Handle<double> rhoH;
iEvent.getByToken(rhoToken, rhoH);
rho = *rhoH;
Handle<double> rhoH2;
iEvent.getByToken(rhoToken2, rhoH2);
rho2 = *rhoH2;

// done for all events, no need to reset?
EventShapeVariables event_algo(event_tracks);
Expand Down
1 change: 1 addition & 0 deletions test/ScoutingNanoAOD_cfg.py
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@
#vertices = cms.InputTag("hltScoutingMuonPacker","displacedVtx"),
#geneventinfo = cms.InputTag("generator"),
rho = cms.InputTag("fixedGridRhoFastjetAllScouting"),
rho2 = cms.InputTag("hltScoutingPFPacker","rho"),

# for JEC corrections eventually
#L1corrAK4_DATA = cms.FileInPath('CMSDIJET/DijetScoutingRootTreeMaker/data/80X_dataRun2_HLT_v12/80X_dataRun2_HLT_v12_L1FastJet_AK4CaloHLT.txt'),
Expand Down

0 comments on commit 5f359dd

Please sign in to comment.