#include #include #include #include #include #include #include TH1F *rocker(Int_t px, Int_t py, char *prefix, Int_t seq, Int_t count) { std::stringstream sst; sst << "rocking curve for scan " << TString(prefix) << " pixel px,py=" << px << "," << py; TH1F *h1 = new TH1F("h1",sst.str().c_str(),count,0,count); Double_t offset=0; for (Int_t index=0; indexGetHeight(); Int_t width = img->GetWidth(); UInt_t *pixel; pixel = (UInt_t *)img->GetRgbaArray(); Int_t k = px+py*width; Int_t red = (pixel[k]>>24) & 0xff; Int_t green = (pixel[k]>>16) & 0xff; Int_t blue = (pixel[k]>>8) & 0xff; Int_t alpha = (pixel[k]>>0) & 0xff; Double_t intensity = red+green+blue; offset = (offset > 0)? offset : intensity; if (intensity > offset-5) { h1->Fill(index,intensity-offset); } delete [] pixel; delete img; } return h1; }