37 gSystem->Load(
"libFWCoreFWLite" );
43 std::cout <<
"Usage : " << argv[0] <<
" [parameters.py]" << std::endl;
47 std::cout <<
" ERROR: ParametersSet 'process' is missing in your configuration file" << std::endl;
exit(0);
61 TH1F* muonPt_ = dir.
make<TH1F>(
"muonPt",
"pt", 100, 0.,300.);
62 TH1F* muonEta_ = dir.make<TH1F>(
"muonEta",
"eta", 100, -3., 3.);
63 TH1F* muonPhi_ = dir.make<TH1F>(
"muonPhi",
"phi", 100, -5., 5.);
67 int maxEvents_( inputHandler_.maxEvents() );
68 for(
unsigned int iFile=0; iFile<inputHandler_.files().size(); ++iFile){
70 TFile* inFile = TFile::Open(inputHandler_.files()[iFile].c_str());
84 if(maxEvents_>0 ? ievt+1>maxEvents_ :
false)
break;
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)
break;
T getParameter(std::string const &) const
Event const & toBegin() override
Go to the very first Event.
std::shared_ptr< ParameterSet > readPSetsFrom(std::string const &fileOrString)
int main(int argc, char *argv[])
virtual bool atEnd() const override
static void enable()
enable automatic library loading
T * make(const Args &...args) const
make new ROOT object
TFileDirectory mkdir(const std::string &dir, const std::string &descr="")
create a new subdirectory
std::string const & file() const
return output fuke name