Difference between revisions of "IAC LeadTunstateCherenkovCrystalTests 2-15"
Jump to navigation
Jump to search
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| − | |||
=2/17/15= | =2/17/15= | ||
| Line 5: | Line 4: | ||
[[File:NearBP_021715-9.52.png| 200 px]][[File:RearBP_021715-9.52.png| 200 px]] | [[File:NearBP_021715-9.52.png| 200 px]][[File:RearBP_021715-9.52.png| 200 px]] | ||
| + | |||
| + | ;After calibrating . | ||
| + | |||
| + | [[File:CalNearBP_021715-9.52.png| 200 px]][[File:CalRearBP_021715-9.52.png| 200 px]] | ||
| + | |||
| + | =2/20/15= | ||
| + | |||
| + | [[File:NearBP_022015-7.35.png| 200 px]][[File:NearBP_022015-7.47.png| 200 px]][[File:RearBP_022015-7.47.png| 200 px]] | ||
| + | |||
| + | |||
| + | =Root script= | ||
| + | |||
| + | The Image2Hist.C program from the ROOT tutorials | ||
| + | |||
| + | <pre> | ||
| + | //Create a 2-D histogram from an image. | ||
| + | //Author: Olivier Couet | ||
| + | |||
| + | void image2hist() | ||
| + | { | ||
| + | // TASImage image("rose512.jpg"); | ||
| + | TASImage image("test.png"); | ||
| + | UInt_t yPixels = image.GetHeight(); | ||
| + | UInt_t xPixels = image.GetWidth(); | ||
| + | UInt_t *argb = image.GetArgbArray(); | ||
| + | |||
| + | TH2D* BeamShape = new TH2D("BeamShape","BeamShape",xPixels,-1,1,yPixels,-1,1); | ||
| + | |||
| + | for (int row=0; row<xPixels; ++row) { | ||
| + | for (int col=0; col<yPixels; ++col) { | ||
| + | int index = col*xPixels+row; | ||
| + | float grey = float(argb[index]&0xff)/256; | ||
| + | BeamShape->SetBinContent(row+1,yPixels-col,grey); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | gStyle->SetPalette(53); | ||
| + | BeamShape->Draw("colz"); | ||
| + | } | ||
| + | |||
| + | </pre> | ||
[[IAC_Experiments]] | [[IAC_Experiments]] | ||
Latest revision as of 16:29, 20 February 2015
2/17/15
Beam profile measurements using glass plates separated by 40.4 cm
- After calibrating .
2/20/15
Root script
The Image2Hist.C program from the ROOT tutorials
//Create a 2-D histogram from an image.
//Author: Olivier Couet
void image2hist()
{
// TASImage image("rose512.jpg");
TASImage image("test.png");
UInt_t yPixels = image.GetHeight();
UInt_t xPixels = image.GetWidth();
UInt_t *argb = image.GetArgbArray();
TH2D* BeamShape = new TH2D("BeamShape","BeamShape",xPixels,-1,1,yPixels,-1,1);
for (int row=0; row<xPixels; ++row) {
for (int col=0; col<yPixels; ++col) {
int index = col*xPixels+row;
float grey = float(argb[index]&0xff)/256;
BeamShape->SetBinContent(row+1,yPixels-col,grey);
}
}
gStyle->SetPalette(53);
BeamShape->Draw("colz");
}