33 gSystem->Load(
"libFWCoreFWLite");
38 std::cout <<
"Usage : " <<
argv[0] <<
" [parameters.py]" << std::endl;
43 std::cout <<
" ERROR: ParametersSet 'process' is missing in your configuration file" << std::endl;
58 TH1F* muonPt_ =
dir.make<TH1F>(
"muonPt",
"pt", 100, 0., 300.);
59 TH1F* muonEta_ =
dir.make<TH1F>(
"muonEta",
"eta", 100, -3., 3.);
60 TH1F* muonPhi_ =
dir.make<TH1F>(
"muonPhi",
"phi", 100, -5., 5.);
61 TH1F* mumuMass_ =
dir.make<TH1F>(
"mumuMass",
"mass", 90, 30., 120.);
65 int maxEvents_(inputHandler_.maxEvents());
66 for (
unsigned int iFile = 0; iFile < inputHandler_.files().size(); ++iFile) {
68 TFile*
inFile = TFile::Open(inputHandler_.files()[iFile].c_str());
79 for (
ev.toBegin(); !
ev.atEnd(); ++
ev, ++ievt) {
82 if (maxEvents_ > 0 ? ievt + 1 > maxEvents_ :
false)
85 if (inputHandler_.reportAfter() != 0 ? (ievt > 0 && ievt % inputHandler_.reportAfter() == 0) :
false)
86 std::cout <<
" processing event: " << ievt << std::endl;
90 event.getByLabel(muons_,
muons);
93 for (std::vector<Muon>::const_iterator mu1 =
muons->begin(); mu1 !=
muons->end(); ++mu1) {
94 muonPt_->Fill(mu1->pt());
95 muonEta_->Fill(mu1->eta());
96 muonPhi_->Fill(mu1->phi());
97 if (mu1->pt() > 20 && fabs(mu1->eta()) < 2.1) {
98 for (std::vector<Muon>::const_iterator mu2 =
muons->begin(); mu2 !=
muons->end(); ++mu2) {
100 if (mu1->charge() * mu2->charge() < 0) {
101 if (mu2->pt() > 20 && fabs(mu2->eta()) < 2.1) {
102 mumuMass_->Fill((mu1->p4() + mu2->p4()).
mass());
115 if (maxEvents_ > 0 ? ievt + 1 > maxEvents_ :
false)
int main(int argc, char *argv[])
muons
the two sets of parameters below are mutually exclusive, depending if RECO or ALCARECO is used the us...
static void enable()
enable automatic library loading
std::unique_ptr< edm::ParameterSet > readPSetsFrom(std::string const &fileOrString)
std::string const & file() const
return output fuke name