forked from cms-bph/BToKMuMu
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Xin Shi
committed
Sep 24, 2013
1 parent
20a5b4b
commit 4390e5b
Showing
5 changed files
with
200 additions
and
3 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,7 @@ | ||
<use name="FWCore/Framework"/> | ||
<use name="FWCore/PluginManager"/> | ||
<use name="FWCore/ParameterSet"/> | ||
<flags EDM_PLUGIN="1"/> | ||
<export> | ||
<lib name="1"/> | ||
</export> |
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 |
---|---|---|
@@ -1,4 +1,14 @@ | ||
BToKMuMu | ||
======== | ||
# B To K Mu Mu Analysis | ||
|
||
## Build | ||
|
||
> cd /path/to/your/destinaiton | ||
> git clone https://github.com/xshi/BToKMuMu.git | ||
> cd BToKMuMu | ||
> scram b | ||
## Run | ||
|
||
> cd python | ||
> cmsRun btokmumu_cfg.py | ||
B To K Mu Mu Analysis |
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,20 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
process = cms.Process("Demo") | ||
|
||
process.load("FWCore.MessageService.MessageLogger_cfi") | ||
|
||
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) ) | ||
|
||
process.source = cms.Source("PoolSource", | ||
# replace 'myfile.root' with the source file you want to use | ||
fileNames = cms.untracked.vstring( | ||
'file:myfile.root' | ||
) | ||
) | ||
|
||
process.demo = cms.EDAnalyzer('BToKMuMu' | ||
) | ||
|
||
|
||
process.p = cms.Path(process.demo) |
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,4 @@ | ||
import FWCore.ParameterSet.Config as cms | ||
|
||
demo = cms.EDAnalyzer('BToKMuMu' | ||
) |
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,156 @@ | ||
// -*- C++ -*- | ||
// | ||
// Package: BToKMuMu | ||
// Class: BToKMuMu | ||
// | ||
/**\class BToKMuMu BToKMuMu.cc BphAna/BToKMuMu/src/BToKMuMu.cc | ||
Description: [one line class summary] | ||
Implementation: | ||
[Notes on implementation] | ||
*/ | ||
// | ||
// Original Author: Xin Shi,598 R-016,+41227679822, | ||
// Created: Tue Sep 24 09:16:20 CEST 2013 | ||
// $Id$ | ||
// | ||
// | ||
|
||
|
||
// 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" | ||
// | ||
// class declaration | ||
// | ||
|
||
class BToKMuMu : public edm::EDAnalyzer { | ||
public: | ||
explicit BToKMuMu(const edm::ParameterSet&); | ||
~BToKMuMu(); | ||
|
||
static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); | ||
|
||
|
||
private: | ||
virtual void beginJob() ; | ||
virtual void analyze(const edm::Event&, const edm::EventSetup&); | ||
virtual void endJob() ; | ||
|
||
virtual void beginRun(edm::Run const&, edm::EventSetup const&); | ||
virtual void endRun(edm::Run const&, edm::EventSetup const&); | ||
virtual void beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&); | ||
virtual void endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&); | ||
|
||
// ----------member data --------------------------- | ||
}; | ||
|
||
// | ||
// constants, enums and typedefs | ||
// | ||
|
||
// | ||
// static data member definitions | ||
// | ||
|
||
// | ||
// constructors and destructor | ||
// | ||
BToKMuMu::BToKMuMu(const edm::ParameterSet& iConfig) | ||
|
||
{ | ||
//now do what ever initialization is needed | ||
|
||
} | ||
|
||
|
||
BToKMuMu::~BToKMuMu() | ||
{ | ||
|
||
// do anything here that needs to be done at desctruction time | ||
// (e.g. close files, deallocate resources etc.) | ||
|
||
} | ||
|
||
|
||
// | ||
// member functions | ||
// | ||
|
||
// ------------ method called for each event ------------ | ||
void | ||
BToKMuMu::analyze(const edm::Event& iEvent, const edm::EventSetup& iSetup) | ||
{ | ||
using namespace edm; | ||
|
||
|
||
|
||
#ifdef THIS_IS_AN_EVENT_EXAMPLE | ||
Handle<ExampleData> pIn; | ||
iEvent.getByLabel("example",pIn); | ||
#endif | ||
|
||
#ifdef THIS_IS_AN_EVENTSETUP_EXAMPLE | ||
ESHandle<SetupData> pSetup; | ||
iSetup.get<SetupRecord>().get(pSetup); | ||
#endif | ||
} | ||
|
||
|
||
// ------------ method called once each job just before starting event loop ------------ | ||
void | ||
BToKMuMu::beginJob() | ||
{ | ||
} | ||
|
||
// ------------ method called once each job just after ending the event loop ------------ | ||
void | ||
BToKMuMu::endJob() | ||
{ | ||
} | ||
|
||
// ------------ method called when starting to processes a run ------------ | ||
void | ||
BToKMuMu::beginRun(edm::Run const&, edm::EventSetup const&) | ||
{ | ||
} | ||
|
||
// ------------ method called when ending the processing of a run ------------ | ||
void | ||
BToKMuMu::endRun(edm::Run const&, edm::EventSetup const&) | ||
{ | ||
} | ||
|
||
// ------------ method called when starting to processes a luminosity block ------------ | ||
void | ||
BToKMuMu::beginLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) | ||
{ | ||
} | ||
|
||
// ------------ method called when ending the processing of a luminosity block ------------ | ||
void | ||
BToKMuMu::endLuminosityBlock(edm::LuminosityBlock const&, edm::EventSetup const&) | ||
{ | ||
} | ||
|
||
// ------------ method fills 'descriptions' with the allowed parameters for the module ------------ | ||
void | ||
BToKMuMu::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { | ||
//The following says we do not know what parameters are allowed so do no validation | ||
// Please change this to state exactly what you do use, even if it is no parameters | ||
edm::ParameterSetDescription desc; | ||
desc.setUnknown(); | ||
descriptions.addDefault(desc); | ||
} | ||
|
||
//define this as a plug-in | ||
DEFINE_FWK_MODULE(BToKMuMu); |