-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #145 from johnalison/mergeTo12_1_X
Merge updates for 12_1_x and BTV HLT Dev
- Loading branch information
Showing
108 changed files
with
4,027,990 additions
and
1,809 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
*.pyc | ||
*.root | ||
*.txt | ||
*.*~ | ||
#*.*# | ||
__init__.py | ||
*.log | ||
|
||
pydump.py | ||
test/CRAB/crab_projects_* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
## Following are instructions for detailed DQM studies : | ||
|
||
Setup the RecoBTag-PerformanceMeasurements pactkage as described in the README.md | ||
|
||
# Make Target Reference BTagAnalyzer NTuple | ||
``` | ||
cp RecoBTag/PerformanceMeasurements/python/defaults/Run3.py RecoBTag/PerformanceMeasurements/python/defaults/Run3Reference.py | ||
[ edit Run3Refernce to point to the right file ] | ||
cd RecoBTag/PerformanceMeasurements/test/ | ||
cmsRun runBTagAnalyzer_cfg.py defaults=Run3Reference runOnData=(True or False, depending on your needs) | ||
cd - | ||
``` | ||
|
||
# Make Target Reference BTagAnalyzer NTuple | ||
``` | ||
cp RecoBTag/PerformanceMeasurements/python/defaults/Run3.py RecoBTag/PerformanceMeasurements/python/defaults/Run3Target.py | ||
[ edit Run3Target to point to the right file ] | ||
cd RecoBTag/PerformanceMeasurements/test/ | ||
cmsRun runBTagAnalyzer_cfg.py defaults=Run3Target runOnData=(True or False, depending on your needs) | ||
cd - | ||
``` | ||
|
||
### Process Ntuples To make ROOT file with histograms | ||
|
||
Additional Software setup to process BTagNtuples for offline validation monitoring | ||
|
||
``` | ||
git cms-merge-topic johnalison:MakePy3Bind11ParameterSetsIncludingCommandLineArguments | ||
git clone -b BTVDQM [email protected]:patrickbryant/nTupleAnalysis.git | ||
git clone -b 12_1_X [email protected]:johnalison/TriggerStudies.git | ||
``` | ||
|
||
``` | ||
BTagAnalyzer TriggerStudies/NtupleAna/scripts/BTagAnalyzer_cfg.py \ | ||
--inputRAW path/to/target/BTagAnalyzer/Ntuple/JetTree.root \ | ||
--inputAOD path/to/reference/BTagAnalyzer/Ntuple/JetTree.root \ | ||
-o $PWD \ | ||
-y Run3 \ | ||
--histogramming 1 \ | ||
--histFile hists_Run3_offlineValidation.root \ | ||
--isMC \ | ||
--doTracks \ | ||
--jetDetailString matchedJet.allTaggers.innerPixHit.noInnerPixHit.DeepJetBins \ | ||
--pfJetName "" \ | ||
--nevents -1 | ||
``` | ||
|
||
|
||
|
||
### Make plots presentation | ||
``` | ||
git clone -b 12_1_X [email protected]:johnalison/ROOTHelp.git | ||
source ROOTHelp/setup.sh | ||
source TriggerStudies/plotting/offlineDQMPlots.sh hists_Run3_offlineValidation.root hists_Run3_offlineValidation targetName [python3] | ||
``` | ||
Outpus a slides in hists_Run3_offlineValidation directory | ||
give the option python3 to actually make the plots |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,198 @@ | ||
#ifndef ANALYZERBASE_H | ||
#define ANALYZERBASE_H | ||
|
||
// system include files | ||
#include <memory> | ||
|
||
// user include files | ||
#include "FWCore/Framework/interface/Frameworkfwd.h" | ||
#include "FWCore/Framework/interface/EDAnalyzer.h" | ||
#include "FWCore/Framework/interface/Event.h" | ||
#include "FWCore/Framework/interface/MakerMacros.h" | ||
#include "FWCore/ParameterSet/interface/ParameterSet.h" | ||
|
||
#include "DataFormats/Common/interface/RefToPtr.h" | ||
#include "DataFormats/JetReco/interface/JetTracksAssociation.h" | ||
#include "DataFormats/BTauReco/interface/CandIPTagInfo.h" | ||
#include "DataFormats/BTauReco/interface/CandSoftLeptonTagInfo.h" | ||
#include "DataFormats/BTauReco/interface/BoostedDoubleSVTagInfo.h" | ||
#include "DataFormats/BTauReco/interface/TrackIPTagInfo.h" | ||
#include "DataFormats/Math/interface/deltaR.h" | ||
|
||
#include "DataFormats/GeometrySurface/interface/Line.h" | ||
#include "DataFormats/GeometryCommonDetAlgo/interface/Measurement1D.h" | ||
|
||
//#include "SimTracker/Records/interface/TrackAssociatorRecord.h" | ||
#include "SimDataFormats/TrackingAnalysis/interface/TrackingParticle.h" | ||
|
||
#include "SimDataFormats/GeneratorProducts/interface/LHEEventProduct.h" | ||
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" | ||
#include "RecoBTag/PerformanceMeasurements/interface/CategoryFinder.h" | ||
|
||
// reco track and vertex | ||
#include "DataFormats/Candidate/interface/VertexCompositePtrCandidate.h" | ||
#include "DataFormats/PatCandidates/interface/PackedCandidate.h" | ||
#include "DataFormats/TrackReco/interface/Track.h" | ||
#include "DataFormats/VertexReco/interface/Vertex.h" | ||
#include "RecoVertex/VertexPrimitives/interface/TransientVertex.h" | ||
#include "DataFormats/BTauReco/interface/JetTag.h" | ||
#include "DataFormats/JetReco/interface/JetCollection.h" | ||
#include "DataFormats/JetReco/interface/Jet.h" | ||
|
||
#include "DataFormats/TrackReco/interface/TrackFwd.h" | ||
#include "DataFormats/TrackingRecHit/interface/TrackingRecHit.h" | ||
#include "DataFormats/TrackingRecHit/interface/TrackingRecHitFwd.h" | ||
#include "TH1F.h" | ||
#include "TH2F.h" | ||
#include "TFile.h" | ||
#include "TTree.h" | ||
#include "TVector3.h" | ||
#include "TLorentzVector.h" | ||
#include "Math/GenVector/VectorUtil.h" | ||
#include "Math/GenVector/PxPyPzE4D.h" | ||
#include "TGraphErrors.h" | ||
|
||
#include "DataFormats/BTauReco/interface/SecondaryVertexTagInfo.h" | ||
|
||
#include "SimDataFormats/Associations/interface/TrackToTrackingParticleAssociator.h" | ||
#include "SimTracker/TrackHistory/interface/TrackCategories.h" | ||
#include "SimTracker/TrackHistory/interface/TrackClassifier.h" | ||
#include "DataFormats/BTauReco/interface/SoftLeptonTagInfo.h" | ||
#include "DataFormats/BTauReco/interface/DeepFlavourFeatures.h" | ||
#include "DataFormats/BTauReco/interface/DeepDoubleXFeatures.h" | ||
#include "DataFormats/BTauReco/interface/DeepBoostedJetFeatures.h" | ||
#include "DataFormats/MuonReco/interface/Muon.h" | ||
#include "DataFormats/PatCandidates/interface/Electron.h" | ||
#include "DataFormats/PatCandidates/interface/MET.h" | ||
|
||
// trigger | ||
#include "DataFormats/Common/interface/TriggerResults.h" | ||
#include "FWCore/Framework/interface/TriggerNamesService.h" | ||
#include "FWCore/ServiceRegistry/interface/Service.h" | ||
#include "CommonTools/UtilAlgos/interface/TFileService.h" | ||
|
||
#include "SimDataFormats/PileupSummaryInfo/interface/PileupSummaryInfo.h" | ||
#include "DataFormats/HepMCCandidate/interface/GenParticleFwd.h" | ||
#include "DataFormats/HepMCCandidate/interface/GenParticle.h" | ||
#include "DataFormats/JetReco/interface/JetCollection.h" | ||
#include "DataFormats/JetReco/interface/GenJetCollection.h" | ||
#include "DataFormats/PatCandidates/interface/Jet.h" | ||
#include "DataFormats/PatCandidates/interface/Muon.h" | ||
|
||
// reconstruct IP | ||
#include "TrackingTools/IPTools/interface/IPTools.h" | ||
|
||
// Math clusters to TrackingParticles | ||
#include "SimTracker/TrackerHitAssociation/interface/ClusterTPAssociation.h" | ||
|
||
#include "RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputer.h" | ||
#include "RecoBTau/JetTagComputer/interface/GenericMVAJetTagComputerWrapper.h" | ||
#include "RecoBTau/JetTagComputer/interface/JetTagComputer.h" | ||
#include "RecoBTau/JetTagComputer/interface/JetTagComputerRecord.h" | ||
#include "RecoBTag/SecondaryVertex/interface/CombinedSVComputer.h" | ||
#include "RecoBTag/SecondaryVertex/interface/TrackKinematics.h" | ||
#include "RecoBTag/SecondaryVertex/interface/V0Filter.h" | ||
// #include "RecoBTag/ImpactParameter/plugins/IPProducer.h" | ||
#include "RecoVertex/VertexPrimitives/interface/ConvertToFromReco.h" | ||
|
||
#include "TrackingTools/GeomPropagators/interface/AnalyticalImpactPointExtrapolator.h" | ||
|
||
#include "FWCore/Utilities/interface/RegexMatch.h" | ||
#include <boost/regex.hpp> | ||
|
||
#include "RecoBTag/PerformanceMeasurements/interface/JetInfoBranches.h" | ||
#include "RecoBTag/PerformanceMeasurements/interface/EventInfoBranches.h" | ||
#include "RecoBTag/PerformanceMeasurements/interface/BookHistograms.h" | ||
#include "RecoBTag/PerformanceMeasurements/interface/VariableParser.h" | ||
|
||
#include "SimDataFormats/GeneratorProducts/interface/GenEventInfoProduct.h" | ||
#include "FWCore/Common/interface/Provenance.h" | ||
#include "PhysicsTools/SelectorUtils/interface/PFJetIDSelectionFunctor.h" | ||
#include "DataFormats/ParticleFlowCandidate/interface/PFCandidate.h" | ||
#include "DataFormats/PatCandidates/interface/PackedCandidate.h" | ||
|
||
#include "TrackingTools/TransientTrack/interface/TransientTrackBuilder.h" | ||
#include "TrackingTools/Records/interface/TransientTrackRecord.h" | ||
#include "TrackingTools/IPTools/interface/IPTools.h" | ||
|
||
#include "fastjet/contrib/Njettiness.hh" | ||
|
||
// #include "RecoBTag/SecondaryVertex/interface/CombinedSVSoftLeptonComputer.h" | ||
#include "DataFormats/BTauReco/interface/DeepFlavourTagInfo.h" | ||
#include "DataFormats/BTauReco/interface/DeepDoubleXTagInfo.h" | ||
#include "DataFormats/BTauReco/interface/DeepBoostedJetTagInfo.h" | ||
|
||
|
||
|
||
namespace analyzerBase{ | ||
|
||
// | ||
// constants, enums and typedefs | ||
// | ||
typedef edm::View<pat::Jet> PatJetCollection; | ||
typedef std::vector<edm::Ptr<pat::Jet> > PatJetPtrCollection; | ||
|
||
// | ||
// class declaration | ||
// | ||
|
||
struct orderByPt { | ||
const std::string mCorrLevel; | ||
orderByPt(const std::string& fCorrLevel) : mCorrLevel(fCorrLevel) {} | ||
bool operator ()(edm::Ptr<pat::Jet> const& a, edm::Ptr<pat::Jet> const& b) { | ||
if( mCorrLevel=="Uncorrected" ) | ||
return a->correctedJet("Uncorrected").pt() > b->correctedJet("Uncorrected").pt(); | ||
else | ||
return a->pt() > b->pt(); | ||
} | ||
}; | ||
|
||
class simPrimaryVertex { | ||
public: | ||
simPrimaryVertex(double x1,double y1,double z1):x(x1),y(y1),z(z1),ptsq(0),nGenTrk(0){}; | ||
double x,y,z; | ||
HepMC::FourVector ptot; | ||
//HepLorentzVector ptot; | ||
double ptsq; | ||
int nGenTrk; | ||
std::vector<int> finalstateParticles; | ||
std::vector<int> simTrackIndex; | ||
std::vector<int> genVertex; | ||
const reco::Vertex *recVtx; | ||
}; | ||
|
||
const reco::TrackBaseRef toTrackRef(const reco::TrackRef & trk); | ||
const reco::TrackBaseRef toTrackRef(const edm::Ptr<reco::Candidate> & cnd); | ||
|
||
const math::XYZPoint & position(const reco::Vertex & sv); | ||
const math::XYZPoint & position(const reco::VertexCompositePtrCandidate & sv); | ||
const double xError(const reco::Vertex & sv); | ||
const double xError(const reco::VertexCompositePtrCandidate & sv); | ||
const double yError(const reco::Vertex & sv); | ||
const double yError(const reco::VertexCompositePtrCandidate & sv); | ||
const double zError(const reco::Vertex & sv); | ||
const double zError(const reco::VertexCompositePtrCandidate & sv); | ||
const double chi2(const reco::Vertex & sv); | ||
const double chi2(const reco::VertexCompositePtrCandidate & sv); | ||
const double ndof(const reco::Vertex & sv); | ||
const double ndof(const reco::VertexCompositePtrCandidate & sv); | ||
const unsigned int vtxTracks(const reco::Vertex & sv); | ||
const unsigned int vtxTracks(const reco::VertexCompositePtrCandidate & sv); | ||
|
||
// This is needed to get a TrackingParticle --> Cluster match (instead of Cluster-->TP) (only needed in processJets) | ||
using P = std::pair<OmniClusterRef, TrackingParticleRef>; | ||
bool compare(const P& i, const P& j); | ||
|
||
|
||
enum JetFlavor {UNDEFINED, G, UD, S, C, GCC, CC, B, GBB, BB, LeptonicB, LeptonicB_C, TAU}; | ||
|
||
JetFlavor jet_flavour(const pat::Jet& jet, | ||
const std::vector<reco::GenParticle>& gToBB, | ||
const std::vector<reco::GenParticle>& gToCC, | ||
const std::vector<reco::GenParticle>& neutrinosLepB, | ||
const std::vector<reco::GenParticle>& neutrinosLepB_C, | ||
const std::vector<reco::GenParticle>& alltaus, | ||
bool usePhysForLightAndUndefined=false); | ||
|
||
} | ||
#endif |
Oops, something went wrong.