9 #include "RooDerivative.h"
31 if (filename.length()==0){
33 cout <<
"Omitting calibration checks..." << endl ;
39 cout <<
"Writing pulses to file: " << endl ;
41 cout << filename << endl ;
43 cout <<
"------------------------------------" << endl << endl ;
45 TFile outfile(filename.c_str() ,
"recreate") ;
49 outfile.mkdir(
"REF/Good") ;
50 outfile.mkdir(
"REF/Weak") ;
51 outfile.mkdir(
"REF/Saturated") ;
53 outfile.mkdir(
"TGT/Good") ;
54 outfile.mkdir(
"TGT/Weak") ;
55 outfile.mkdir(
"TGT/Saturated") ;
60 for (
auto & sm : SuperMods){
62 for (
auto & spm : sm->get_ref_pmts()){
64 if (spm->getNBPulse()->IsGood()==
true) outfile.cd(
"REF/Good") ;
66 if (spm->getNBPulse()->IsSaturatedHit()==
true) outfile.cd(
"REF/Saturated") ;
68 if (spm->getNBPulse()->IsWeak()==
true) outfile.cd(
"REF/Weak") ;
70 spm->getNBPulse()->getHtime_full()->Write() ;
72 if (spm->getNBPulse()->IsFitted()==
true){
74 RooWorkspace w = spm->getNBPulse()->getWorkspace() ;
76 TH1D* h = spm->getNBPulse()->getHtime_full() ;
90 for (
auto & sms : sm->get_sources()){
92 for (
auto & spm : sms.second){
94 if (spm->getNBPulse()->IsGood()==
true) outfile.cd(
"TGT/Good") ;
96 if (spm->getNBPulse()->IsSaturatedHit()==
true) outfile.cd(
"TGT/Saturated") ;
98 if (spm->getNBPulse()->IsWeak()==
true) outfile.cd(
"TGT/Weak") ;
100 spm->getNBPulse()->getHtime_full()->Write() ;
102 if (spm->getNBPulse()->IsFitted()==
true){
104 RooWorkspace w = spm->getNBPulse()->getWorkspace() ;
106 TH1D* h = spm->getNBPulse()->getHtime_full() ;
131 int main(
int argc,
char **argv) {
vector< SuperModule * > getSuperModules()
Get the SuperModules in the DU.
Structure to store the different command line arguments for JRunAnalyzer.
void write_output(IO options, vector< vector< TH2D * > > ToT_vs_time, vector< vector< TH1D * > > ToT, vector< vector< TH1D * > > time)
Writes a .root file with the nanobeacon pulses found by JPulseFinder.
JDetector loadDetector(string detectorFile)
Loads the content of a detector file in a JDetector object.
TCanvas * c1
Global variables to handle mouse events.
void analyze(int option)
Loops over all the SUPERMODULES.
Class dedicated to the nanobeacon analyses, where the Modules in the detector are not regarded as sin...
int read_user_options(IO &options, int argc, char **argv)
Parses the command line options and fills an IO structure with them.
TCanvas * RooCanvas(RooWorkspace w, TH1D *h)
Produces a TCanvas with the nanobeacon peak and the fit performed with Roofit.
int main(int argc, char *argv[])