32 gSystem->Load(
"libFWCoreFWLite");
41 parser.
stringValue(
"outputFile") =
"analyzeEdmTuple.root";
46 unsigned int outputEvery_ = parser.
integerValue(
"outputEvery");
48 std::vector<std::string> inputFiles_ = parser.
stringVector(
"inputFiles");
53 TH1F* muonPt_ = dir.
make<TH1F>(
"muonPt",
"pt", 100, 0., 300.);
54 TH1F* muonEta_ = dir.
make<TH1F>(
"muonEta",
"eta", 100, -3., 3.);
55 TH1F* muonPhi_ = dir.
make<TH1F>(
"muonPhi",
"phi", 100, -5., 5.);
59 for (
unsigned int iFile = 0; iFile < inputFiles_.size(); ++iFile) {
61 TFile* inFile = TFile::Open(inputFiles_[iFile].c_str());
75 if (maxEvents_ > 0 ? ievt + 1 > maxEvents_ :
false)
78 if (outputEvery_ != 0 ? (ievt > 0 && ievt % outputEvery_ == 0) :
false)
79 std::cout <<
" processing event: " << ievt << std::endl;
83 event.getByLabel(
std::string(
"patMuonAnalyzer:pt"), muonPt);
85 for (std::vector<float>::const_iterator mu1 = muonPt->begin(); mu1 != muonPt->end(); ++mu1) {
90 event.getByLabel(
std::string(
"patMuonAnalyzer:eta"), muonEta);
91 for (std::vector<float>::const_iterator mu1 = muonEta->begin(); mu1 != muonEta->end(); ++mu1) {
96 event.getByLabel(
std::string(
"patMuonAnalyzer:phi"), muonPhi);
97 for (std::vector<float>::const_iterator mu1 = muonPhi->begin(); mu1 != muonPhi->end(); ++mu1) {
106 if (maxEvents_ > 0 ? ievt + 1 > maxEvents_ :
false)
Event const & toBegin() override
Go to the very first Event.
std::string & stringValue(std::string key)
void parseArguments(int argc, char **argv, bool allowArgs=false)
int & integerValue(std::string key)
static void enable()
enable automatic library loading
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
SVec & stringVector(std::string key)