Commit 4de38be7 authored by rohe's avatar rohe
Browse files

Added a function for pulse shape measurement pulseShapeGraph x y Rg Ia

parent 74e98049
......@@ -198,6 +198,8 @@ CMD_PROC(seqcalscan)
#include "TTree.h"
#include "TBranch.h"
#include "TLeaf.h"
#include "TGraph.h"
CMD_PROC(pixelAlive)
{
......@@ -307,6 +309,7 @@ CMD_PROC(pulseShape) {
printf("Setting cal for pixel x:%d y:%d\n",calX,calY);
tb.r4s_SetPixCal(calX, calY);
printf("Taking data...");fflush(stdout);
for (unsigned int i=0;i<hold_max;i++)
{
tb.r4s_SetHoldPos(i);
......@@ -336,3 +339,59 @@ CMD_PROC(pulseShape) {
rootFile->Close();
}
//pulse shape, creating a graph
CMD_PROC(pulseShapeGraph) {
int calX,calY, Rg, Ia;
PAR_INT(calX,0,255);
PAR_INT(calY,0,255);
PAR_INT(Rg,0,2500);
PAR_INT(Ia,0,2000);
TFile *rootFile = new TFile("data/pulseShapeGraph.root","update");
// create arrays with values
int t[256], pulseHight[256];
R4sImg map;
const unsigned int hold_max = 255;
//set parameters and get the data
tb._SetIA(Ia*10);
printf("Set Ia to %d mA\n",Ia);
tb.r4s_SetRgsh(Rg);
tb.r4s_SetRgpr(Rg);
printf("Set Rgpr and Rgsh to %d mV\n",Rg);
tb.r4s_SetPixCal(calX, calY);
printf("Set cal for pixel x:%d y:%d\n",calX,calY);
printf("Taking data...");fflush(stdout);
// loo over all values for hold
for (unsigned int i=0;i<hold_max;i++)
{
tb.r4s_SetHoldPos(i);
ReadImage(map,false);
//write values into arrays
t[i] = (i*5);//one unit in hold is 5ns
pulseHight[i] = map.Get(calX,calY);
}
printf("Done.\n");
// t, pulseHight arrays
TGraph *gr = new TGraph( (hold_max), t, pulseHight);
char GraphName[60];
sprintf(GraphName, "PulseShapeX%dY%dRg%dIa%d",calX,calY,Rg,Ia);
gr->Write(GraphName);
rootFile->Close();
}
......@@ -22,6 +22,6 @@ CMD_REG(seqcalscan, "", "Load calibrate scan sequence")
//CMD_REG(test, "" , "print 'Hello World!'")
CMD_REG(pixelAlive, "" ,"performs a pixel alive test")
CMD_REG(pixelDist,"<iterations>","distribution of calibration pulses per pixel");
CMD_REG(pulseShape,"<x> <y>","analogue out as a function of the hold position");
CMD_REG(pulseShape,"<x> <y>","analogue out as a function of the hold position, creating a tree ");
CMD_REG(pulseShapeGraph,"<x> <y> <Rg> <Ia>","analogue out as a function of the hold position. Rgsh=Rgpr and Ia can be set. Output is a graph created in a rootfile");
//CMD_REG(gui, "", "Start graphical user interface");
Markdown is supported
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