-
Notifications
You must be signed in to change notification settings - Fork 28
Expand file tree
/
Copy pathPlotCRVPEsVsMCEDep.C
More file actions
34 lines (26 loc) · 908 Bytes
/
PlotCRVPEsVsMCEDep.C
File metadata and controls
34 lines (26 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
//
// An example of how to plot CRV information
// This uses cut functions defined in common_cuts.hh
//
#include "EventNtuple/rooutil/inc/RooUtil.hh"
#include "EventNtuple/rooutil/inc/common_cuts.hh"
#include "TH2F.h"
using namespace rooutil;
void PlotCRVPEsVsMCEDep(std::string filename) {
// Create the histogram you want to fill
TH2F* hPEs_MCEDep = new TH2F("hPEs_MCEDep", "Total PEs per Crv Coincidence", 100,0,300, 100,0,300);
// Set up RooUtil
RooUtil util(filename);
// Loop through the events
for (int i_event = 0; i_event < util.GetNEvents(); ++i_event) {
// Get the next event
auto& event = util.GetEvent(i_event);
auto crv_coincs = event.GetCrvCoincs();
for (auto& crv_coinc : crv_coincs) {
// Fill the histogram
hPEs_MCEDep->Fill(crv_coinc.reco->PEs, crv_coinc.mc->depositedEnergy);
}
}
// Draw the histogram
hPEs_MCEDep->Draw("COLZ");
}