Commit ade97b67 authored by Emilio Depero's avatar Emilio Depero
Browse files

update analysis

parent 8c6d32bb
...@@ -4,7 +4,7 @@ INCLUDE := include/ ...@@ -4,7 +4,7 @@ INCLUDE := include/
DEP := include/Micromega.cc include/MicromegasPlane.cc include/physicalStrip.cc include/stripsCluster.cc DEP := include/Micromega.cc include/MicromegasPlane.cc include/physicalStrip.cc include/stripsCluster.cc
LIBS := `root-config --cflags --glibs` LIBS := `root-config --cflags --glibs`
all: map_multiplex ConvertOutputMM analyze_PositionData reconstructAndPlot PlotMacro all: map_multiplex ConvertOutputMM analyze_PositionData reconstructAndPlot PlotMacro checkfile
%: %.cc %: %.cc
$(CXX) -o $@ $< -I$(INCLUDE) $(DEP) $(FLAGS) $(LIBS) $(CXX) -o $@ $< -I$(INCLUDE) $(DEP) $(FLAGS) $(LIBS)
......
...@@ -74,8 +74,11 @@ int main(int argc, char *argv[]) ...@@ -74,8 +74,11 @@ int main(int argc, char *argv[])
vector<TString> histonames; vector<TString> histonames;
histonames.push_back("decayPositions_z"); histonames.push_back("decayPositions_z");
histonames.push_back("decayPositions_z_target"); histonames.push_back("decayPositions_z_target");
//histonames.push_back("decayPositions_z_20deg"); histonames.push_back("decayPositions_z_20deg");
//histonames.push_back("angle"); histonames.push_back("decayPositions_z_17deg");
histonames.push_back("decayPositions_z_13deg");
histonames.push_back("decayPositions_z_10deg");
histonames.push_back("angle");
for(unsigned int d(0); d < histonames.size(); ++d) for(unsigned int d(0); d < histonames.size(); ++d)
{ {
......
#!/bin/bash #!/bin/bash
#daq parameters
export MASTERPATH="/home/deperoe/MuMass/mumass-mm-analysis"
export DAQEXE="" #to be set
export DAQDIR=""
export DAQOUTDIR=$MASTERPATH"/run_November2021"
export rotangle="0" export rotangle="0"
if [ $# -eq 1 ] export OUTDIR=$DAOUTDIR"/analysed"
if [ $# -eq 1 ] || [ $# -eq 2 ] || [ $# -eq 3 ]
then then
rotangle=$1 rotangle=$1
distmm1=$2
fi fi
#daq parameters #optional target output
export DAQEXE="" #to be set if [ $# -eq 3 ]
export DAQDIR="" then
export DAQOUTDIR="/home/positron/LymanAlpha/MuMass/data" OUTDIR=$3
mkdir -p $OUTDIR
fi
#reconstruction #reconstruction
export RECOMULTEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/map_multiplex" #to be set export RECOMULTEXE=$MASTERPATH"/map_multiplex" #to be set
export RECOEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/analyze_PositionData" export RECOEXE=$MASTERPATH"/analyze_PositionData"
export RECODIR=$DAQOUTDIR"/reconstructed" export RECODIR=$DAQOUTDIR"/reconstructed"
#plotting and fitting #plotting and fitting
export ANALEXE="/home/positron/LymanAlpha/MuMass/mumass-mm-analysis/reconstructAndPlot" export ANALEXE=$MASTERPATH"/reconstructAndPlot"
export ANALDIR=$DAQOUTDIR"/analysed" export ANALDIR=$DAQOUTDIR"/analysed"
...@@ -25,12 +35,14 @@ make $ANALEXE ...@@ -25,12 +35,14 @@ make $ANALEXE
for file in $RECODIR/*root for file in $RECODIR/*root
do do
#check file
./checkfile $file
#analysed data #analysed data
export analfileout=$DAQOUTDIR/"analysed/Analysed_"$(basename $file) export analfileout=$OUTDIR"/Analysed_"$(basename $file)
#run the reco #run the reco
echo "running reco for $file" echo "running reco for $file"
$ANALEXE $file $analfileout $rotangle $ANALEXE $file $analfileout $rotangle $distmm1
done done
......
...@@ -122,17 +122,31 @@ void Analyze(int argc, char *argv[]) ...@@ -122,17 +122,31 @@ void Analyze(int argc, char *argv[])
// define variables to extract data from the g4bl ntuples // define variables to extract data from the g4bl ntuples
Float_t x,y,t,EventID, qmax, rotangle; Float_t x,y,t,EventID, qmax, rotangle;
if (argc < 3 || argc>4) if (argc < 3 || argc>5)
{ {
std::cout << "Usage: ./executable [inputFileName] [outpuFileName] [rotangle (optional, in degree)]." << std::endl; std::cout << "Usage: ./executable [inputFileName] [outpuFileName] [rotangle (optional, in degree)] [distance MM1 (optional, in mm)]." << std::endl;
return; return;
} }
// distance between two detectors, exactly the same as Jonas run, mechanics was fixed already
float dist_MM12 = 66.5; //mm
// distance of MM1C from center plane
float dist_MM1 = 135.; //measured by mike, 59 mm dist + half of cube
float size_MM = 80.0; // size in mm
// get parameters from command line arguments // get parameters from command line arguments
TString inputFileName(argv[1]); TString inputFileName(argv[1]);
TString outputFileName(argv[2]); TString outputFileName(argv[2]);
int degreeangle; int degreeangle;
if(argc > 3) if ( argc > 4)
{
degreeangle = atoi(argv[3]);
dist_MM1 = atof(argv[4]);
rotangle = degreeangle/180.*TMath::Pi(); //radiant convertion
outputFileName += TString::Format("-rotation%i-distmm1%0.1f.root", degreeangle, dist_MM1);
}
else if(argc > 3)
{ {
degreeangle = atoi(argv[3]); degreeangle = atoi(argv[3]);
rotangle = degreeangle/180.*TMath::Pi(); //radiant convertion rotangle = degreeangle/180.*TMath::Pi(); //radiant convertion
...@@ -151,13 +165,6 @@ void Analyze(int argc, char *argv[]) ...@@ -151,13 +165,6 @@ void Analyze(int argc, char *argv[])
MM_Names.push_back("MM1"); MM_Names.push_back("MM1");
MM_Names.push_back("MM2"); MM_Names.push_back("MM2");
// distance between two detectors, exactly the same as Jonas run, mechanics was fixed already
float dist_MM12 = 66.5; //mm
// distance of MM1C from center plane
float dist_MM1 = 90.; //modify for the setup, preliminary
float size_MM = 80.0; // size in mm
// cut angle in degrees // cut angle in degrees
std::vector<float> maxAngle_degree = {20.0,17.0,13,10.0}; std::vector<float> maxAngle_degree = {20.0,17.0,13,10.0};
std::vector<float> maxAngle_rad; std::vector<float> maxAngle_rad;
...@@ -218,18 +225,19 @@ void Analyze(int argc, char *argv[]) ...@@ -218,18 +225,19 @@ void Analyze(int argc, char *argv[])
TH2D* qmaxMap_1 = new TH2D("qmaxMap_1","qmax distribution for MM2; x [mm] ; z [mm] ",80,-43,43,80,-43,43); TH2D* qmaxMap_1 = new TH2D("qmaxMap_1","qmax distribution for MM2; x [mm] ; z [mm] ",80,-43,43,80,-43,43);
TH2D* qmaxMap_2 = new TH2D("qmaxMap_2","qmax distribution for MM1; x [mm] ; z [mm] ",80,-43,43,80,-43,43); TH2D* qmaxMap_2 = new TH2D("qmaxMap_2","qmax distribution for MM1; x [mm] ; z [mm] ",80,-43,43,80,-43,43);
TH2D* qmaxMap_projected_13deg = new TH2D("qmaxMap_projected_13deg","average qmax for projected, cut at 6 degrees; x [mm] ; z [mm] ",80,-43,43,80,-43,43); TH2D* qmaxMap_projected_13deg = new TH2D("qmaxMap_projected_13deg","average qmax for projected, cut at 6 degrees; x [mm] ; z [mm] ",80,-43,43,80,-43,43);
const double decaypost_r[] = {-80, 80};
TH1D* decayPositions_z = new TH1D("decayPositions_z","reconstructed decay positions in z direction; z [mm] ",100,-32,32); const int decaypost_nbin = 200;
TH1D* decayPositions_z_target = new TH1D("decayPositions_z_target","reconstructed decay positions in z direction for -10<x1,x2,x3<10; z [mm] ",100,-32,32); TH1D* decayPositions_z = new TH1D("decayPositions_z","reconstructed decay positions in z direction; z [mm] ",decaypost_nbin, decaypost_r[0], decaypost_r[1]);
TH1D* decayPositions_z_20deg = new TH1D("decayPositions_z_20deg","reconstructed decay positions in z direction, angle<20deg; z [mm] ",120,-32,32); TH1D* decayPositions_z_target = new TH1D("decayPositions_z_target","reconstructed decay positions in z direction for -10<x1,x2,x3<10; z [mm] ",decaypost_nbin, decaypost_r[0], decaypost_r[1]);
TH1D* decayPositions_z_17deg = new TH1D("decayPositions_z_17deg","reconstructed decay positions in z direction, angle<17deg; z [mm] ",120,-32,32); TH1D* decayPositions_z_20deg = new TH1D("decayPositions_z_20deg","reconstructed decay positions in z direction, angle<20deg; z [mm] ",decaypost_nbin, decaypost_r[0], decaypost_r[1]);
TH1D* decayPositions_z_13deg = new TH1D("decayPositions_z_13deg","reconstructed decay positions in z direction, angle<13deg; z [mm] ",120,-32,32); TH1D* decayPositions_z_17deg = new TH1D("decayPositions_z_17deg","reconstructed decay positions in z direction, angle<17deg; z [mm] ",decaypost_nbin, decaypost_r[0], decaypost_r[1]);
TH1D* decayPositions_z_10deg = new TH1D("decayPositions_z_10deg","reconstructed decay positions in z direction, angle<10deg; z [mm] ",120,-32,32); TH1D* decayPositions_z_13deg = new TH1D("decayPositions_z_13deg","reconstructed decay positions in z direction, angle<13deg; z [mm] ",decaypost_nbin, decaypost_r[0], decaypost_r[1]);
TH1D* decayPositions_z_10deg = new TH1D("decayPositions_z_10deg","reconstructed decay positions in z direction, angle<10deg; z [mm] ",decaypost_nbin, decaypost_r[0], decaypost_r[1]);
TH1D* qMax_All = new TH1D("qMax_All","distribution of (average) qmax; qmax ",200,0,1.4e6); TH1D* qMax_All = new TH1D("qMax_All","distribution of (average) qmax; qmax ",200,0,1.4e6);
TH1D* qMax_double = new TH1D("qMax_double","distribution of average qmax (only double hits); qmax ",200,0,1.4e6); TH1D* qMax_double = new TH1D("qMax_double","distribution of average qmax (only double hits); qmax ",200,0,1.4e6);
TH1D* qMax_13deg = new TH1D("qMax_13deg","average qmax passed 6 degree cuts; qmax",200,0,1.4e6); TH1D* qMax_13deg = new TH1D("qMax_13deg","average qmax passed 6 degree cuts; qmax",200,0,1.4e6);
TH1D* qMax_double_small = new TH1D("qMax_double_small","distribution of average qmax (only double hits); qmax ",200,0,1.e5); TH1D* qMax_double_small = new TH1D("qMax_double_small","distribution of average qmax (only double hits); qmax ",200,0,1.e5);
TH1D* qMax_13deg_small = new TH1D("qMax_13deg_small","average qmax passed 6 degree cuts; qmax",200,0,1.e5); TH1D* qMax_13deg_small = new TH1D("qMax_13deg_small","average qmax passed 6 degree cuts; qmax",200,0,1.e5);
TH1D* angle = new TH1D("angle","angle to vertical; angle [rad]",1000,0,1.); TH1D* angle = new TH1D("angle","angle to vertical; angle [rad]",1000,0,1.);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment