7 while getopts "s:b:j:" opt; do
10 SIGFILES="$SIGFILES $OPTARG"
13 BKGFILES="$BKGFILES $OPTARG"
19 echo "Invalid option: -$OPTARG" >&2
23 echo "Option -$OPTARG requires an argument." >&2
29 echo "Signal files are:"
30 for i in $SIGFILES;do echo $i;done
31 echo "Background files are:"
32 for i in $BKGFILES;do echo $i;done
33 echo "Job name is $JOBNAME"
35 #Hmm, when using mrb then $LARANA_DIR points to source tree, but
36 #in installed version then need to add source to path
37 if [ -d $LARANA_DIR/source ]; then
38 cp $LARANA_DIR/source/ParticleIdentification/scripts/TrainMVA.C ./
39 cp $LARANA_DIR/source/ParticleIdentification/scripts/runPID_noMVA.fcl ./
41 cp $LARANA_DIR/ParticleIdentification/scripts/TrainMVA.C ./
42 cp $LARANA_DIR/ParticleIdentification/scripts/runPID_noMVA.fcl ./
45 if [ -d $LARDATA_DIR/source ]; then
46 cp $LARDATA_DIR/source/AnalysisBase/MVAPIDResult.h ./
48 cp $LARDATA_DIR/AnalysisBase/MVAPIDResult.h ./
52 ##Build CINT dictionary for the MVAResult class
54 #pragma link C++ class anab::MVAPIDResult+;
55 #pragma link C++ class vector<anab::MVAPIDResult>+;
56 #pragma link C++ class map<string,double>+;
59 rootcint -f MVAResultDict.cxx -c $LARDATA_DIR/AnalysisBase/MVAPIDResult.h Linkdef.h
60 g++ -shared -o MVAResultDict.so `root-config --ldflags` -fPIC -I$ROOTSYS/include MVAResultDict.cxx
61 rm -f MVAResultDict.cxx MVAResultDict.h Linkdef.h
66 gROOT->ProcessLine(\"gSystem->Load(\\\"MVAResultDict.so\\\")\");
67 gROOT->ProcessLine(\".L TrainMVA.C\");
68 std::vector<std::string> sigFiles, bkgFiles;" > $ROOTSCRIPT
72 lar -c ./runPID_noMVA.fcl -s $i -n 100000
73 TUPLEFILE=ntuple_`basename $i`
74 mv ntuple.root $TUPLEFILE
76 BuildTree(\"${TUPLEFILE}\",\"train_"`basename $i`"\");
77 sigFiles.push_back(\"train_"`basename $i`"\");" >> $ROOTSCRIPT
82 mv ntuple.root ntuple_$i
83 lar -c ./runPID_noMVA.fcl -s $i -n 100000
84 TUPLEFILE=ntuple_`basename $i`
85 mv ntuple.root $TUPLEFILE
87 BuildTree(\"${TUPLEFILE}\",\"train_"`basename $i`"\");
88 bkgFiles.push_back(\"train_"`basename $i`"\");" >> $ROOTSCRIPT
92 TrainMVA(sigFiles,bkgFiles,\"mvaPlots.root\",\"$JOBNAME\");
98 root -l -b -q $ROOTSCRIPT