26 auto fileNameUrl =
"http://root.cern.ch/files/tutorials/df014_CsvDataSource_MuRun2010B.csv";
27 auto fileName =
"df014_CsvDataSource_MuRun2010B_cpp.csv";
37 df.Filter(
"Q1 * Q2 == -1")
38 .Define(
"m",
"sqrt(pow(E1 + E2, 2) - (pow(px1 + px2, 2) + pow(py1 + py2, 2) + pow(pz1 + pz2, 2)))");
42 filteredEvents.Histo1D({
"invMass",
"CMS Opendata: #mu#mu mass;#mu#mu mass [GeV];Events", 512, 2, 110},
"m");
54 filteredEvents.Histo1D({
"Spectrum",
"Subset of CMS Run 2010B;#mu#mu mass [GeV];Events", 1024, 2, 110},
"m");
58 double jpsiLow = 2.95;
59 double jpsiHigh = 3.25;
60 auto jpsiCut = [jpsiLow, jpsiHigh](
double m) {
return m < jpsiHigh && m > jpsiLow; };
62 filteredEvents.Filter(jpsiCut, {
"m"})
63 .Histo1D({
"jpsi",
"Subset of CMS Run 2010B: J/#psi window;#mu#mu mass [GeV];Events", 128, jpsiLow, jpsiHigh},
67 auto dualCanvas =
new TCanvas(
"DualCanvas",
"DualCanvas", 800, 512);
68 dualCanvas->Divide(2, 1);
69 auto leftPad = dualCanvas->cd(1);
72 fullSpectrum->DrawClone(
"Hist");
74 jpsi->DrawClone(
"HistP");
R__EXTERN TSystem * gSystem
virtual Bool_t Cp(const char *dst, Bool_t progressbar=kTRUE, UInt_t buffersize=1000000)
Allows to copy this file to the dst URL.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
RDataFrame FromCSV(std::string_view fileName, bool readHeaders=true, char delimiter=',', Long64_t linesChunkSize=-1LL, std::unordered_map< std::string, char > &&colTypes={})
Factory method to create a CSV RDataFrame.