26 double px = ptEtaPhiE[0] *
cos(ptEtaPhiE[2]);
27 double py = ptEtaPhiE[0] *
sin(ptEtaPhiE[2]);
28 double tmp = 2 * atan(
exp(-ptEtaPhiE[1]));
41 std::cout <<
"Please provide the name of the file with file: or rfio: as needed" << std::endl;
46 std::cout <<
"Please provide the name of the file with file: or rfio: as needed" << std::endl;
59 gSystem->Load(
"libFWCoreFWLite");
65 TH1F* muonPt_ = theDir.
make<TH1F>(
"muonPt",
"pt", 100, 0., 300.);
66 TH1F* muonEta_ = theDir.
make<TH1F>(
"muonEta",
"eta", 100, -3., 3.);
67 TH1F* muonPhi_ = theDir.
make<TH1F>(
"muonPhi",
"phi", 100, -5., 5.);
70 TFile* inFile = TFile::Open(
fileName.c_str());
90 std::vector<MuonPair> pairVector;
108 muon1pt.
getByLabel(
ev,
"goodZToMuMuEdmNtupleLoose",
"zGoldenDau1Pt");
109 muon1eta.
getByLabel(
ev,
"goodZToMuMuEdmNtupleLoose",
"zGoldenDau1Eta");
110 muon1phi.
getByLabel(
ev,
"goodZToMuMuEdmNtupleLoose",
"zGoldenDau1Phi");
111 muon2pt.
getByLabel(
ev,
"goodZToMuMuEdmNtupleLoose",
"zGoldenDau2Pt");
112 muon2eta.
getByLabel(
ev,
"goodZToMuMuEdmNtupleLoose",
"zGoldenDau2Eta");
113 muon2phi.
getByLabel(
ev,
"goodZToMuMuEdmNtupleLoose",
"zGoldenDau2Phi");
130 if (muon1pt->size() != muon2pt->size()) {
131 std::cout <<
"Error: size of muon1 and muon2 is different. Skipping event" << std::endl;
134 for (
unsigned i = 0;
i < muon1pt->size(); ++
i) {
135 muonPt_->Fill((*muon1pt)[
i]);
136 muonEta_->Fill((*muon1eta)[
i]);
137 muonPhi_->Fill((*muon1phi)[
i]);
138 muonPt_->Fill((*muon2pt)[
i]);
139 muonEta_->Fill((*muon2eta)[
i]);
140 muonPhi_->Fill((*muon2phi)[
i]);
142 double muon1[3] = {(*muon1pt)[
i], (*muon1eta)[
i], (*muon1phi)[
i]};
143 double muon2[3] = {(*muon2pt)[
i], (*muon2eta)[
i], (*muon2phi)[
i]};
146 pairVector.push_back(
150 size_t namePos =
fileName.find_last_of(
"/");
151 treeHandler.writeTree((
"tree_" +
fileName.substr(namePos + 1,
fileName.size())).c_str(), &pairVector);