35 gSystem->Load(
"libFWCoreFWLite");
41 std::cout <<
"Usage : " << argv[0] <<
" [parameters.py]" << std::endl;
45 std::cout <<
" ERROR: ParametersSet 'process' is missing in your configuration file" << std::endl;
60 TH1F* muonPt_ = dir.
make<TH1F>(
"muonPt",
"pt", 100, 0., 300.);
61 TH1F* muonEta_ = dir.make<TH1F>(
"muonEta",
"eta", 100, -3., 3.);
62 TH1F* muonPhi_ = dir.make<TH1F>(
"muonPhi",
"phi", 100, -5., 5.);
66 int maxEvents_(inputHandler_.maxEvents());
67 for (
unsigned int iFile = 0; iFile < inputHandler_.files().size(); ++iFile) {
69 TFile* inFile = TFile::Open(inputHandler_.files()[iFile].c_str());
83 if (maxEvents_ > 0 ? ievt + 1 > maxEvents_ :
false)
86 if (inputHandler_.reportAfter() != 0 ? (ievt > 0 && ievt % inputHandler_.reportAfter() == 0) :
false)
87 std::cout <<
" processing event: " << ievt << std::endl;
91 event.getByLabel(muons_, muons);
94 for (
unsigned i = 0;
i < muons->size(); ++
i) {
95 muonPt_->Fill((*muons)[
i].
pt());
96 muonEta_->Fill((*muons)[
i].
eta());
97 muonPhi_->Fill((*muons)[
i].
phi());
105 if (maxEvents_ > 0 ? ievt + 1 > maxEvents_ :
false)
Event const & toBegin() override
Go to the very first Event.
static void enable()
enable automatic library loading
std::unique_ptr< edm::ParameterSet > readPSetsFrom(std::string const &fileOrString)
T * make(const Args &...args) const
make new ROOT object
bool atEnd() const override
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
T getParameter(std::string const &) const
std::string const & file() const
return output fuke name