/praktikum/petrecofmf/calibration_all.root |
Cannot display: file marked as a binary type.
|
svn:mime-type = application/octet-stream |
Property changes: |
Deleted: svn:mime-type |
## -1 +0,0 ## |
-application/octet-stream |
\ No newline at end of property |
Index: petrecofmf/config_zero.xml |
=================================================================== |
Cannot display: file marked as a binary type. |
svn:mime-type = application/xml |
/petrecofmf/config_zero.xml |
Property changes: |
Deleted: svn:mime-type |
## -1 +0,0 ## |
-application/xml |
\ No newline at end of property |
Index: petrecofmf/PETProjDataMgr.C |
=================================================================== |
--- petrecofmf/PETProjDataMgr.C (revision 113) |
+++ petrecofmf/PETProjDataMgr.C (nonexistent) |
@@ -1,612 +0,0 @@ |
-// |
-// ../bin/FBP2D FBP2D.par |
-// |
-// ******************************************************************** |
-// * License and Disclaimer * |
-// * * |
-// * The GAMOS software is copyright of the Copyright Holders of * |
-// * the GAMOS Collaboration. It is provided under the terms and * |
-// * conditions of the GAMOS Software License, included in the file * |
-// * LICENSE and available at http://fismed.ciemat.es/GAMOS/license .* |
-// * These include a list of copyright holders. * |
-// * * |
-// * Neither the authors of this software system, nor their employing * |
-// * institutes,nor the agencies providing financial support for this * |
-// * work make any representation or warranty, express or implied, * |
-// * regarding this software system or assume any liability for its * |
-// * use. Please see the license in the file LICENSE and URL above * |
-// * for the full disclaimer and the limitation of liability. * |
-// * * |
-// * This code implementation is the result of the scientific and * |
-// * technical work of the GAMOS collaboration. * |
-// * By using, copying, modifying or distributing the software (or * |
-// * any work based on the software) you agree to acknowledge its * |
-// * use in resulting scientific publications, and indicate your * |
-// * acceptance of all terms of the GAMOS Software license. * |
-// ******************************************************************** |
-// |
-#include "PETProjDataMgr.h" |
-#include "TH2F.h" |
-#include "TH3F.h" |
-#include "TMath.h" |
-#include "TRandom3.h" |
- |
-#include <iomanip> |
-#include <iostream> |
-#include <cstdlib> |
- |
-using namespace std; |
- |
-//---------------------------------------------------------------------- |
-PETProjDataMgr* PETProjDataMgr::m_Instance = 0; |
- |
-//---------------------------------------------------------------------- |
-PETProjDataMgr* PETProjDataMgr::GetInstance() |
-{ |
- if( !m_Instance ) { |
- m_Instance = new PETProjDataMgr; |
- } |
- |
- return m_Instance; |
- |
-} |
- |
-//----------------------------------------------------------------------- |
-PETProjDataMgr::PETProjDataMgr() |
-{ |
- |
- /* |
-// ARGUMENTS: |
-" cout << " -------------------------- \n" |
-" Arguments convention: \n" |
-" -a Axial FOV (mm), <theDist_axial=100.0> \n" |
-" -d Diameter Transaxial FOV (mm), <m_RingDiameter=300.0> \n" |
-" -i Type of the input file (by default: 0 = Arce_binary), <typeINfile=0> \n" |
-" \n" |
-" -m Maximum ring difference (by default: -1 = m_NOfPlanes), <m_MaxRingDifferenceiff> \n" |
-" -n Name of output file, <m_Filename> \n" |
-" -p Axial number of planes, <m_NOfPlanes> \n" |
-" -r Number of bins, \"distancias\", <m_NOfBins> \n" |
- // -s Span TO DO:span !!!!! |
-" -t Number of angular views, \"direcciones\", <m_NOfAngles> \n" |
-" -v Verbosity (by default: 0=silent, 3=debug), <verbos> \n" |
-" -x Maximum number of coincidences to be stored (by default: -1 = no limit), <Max_Coinci> \n" |
-" -o Output type (by default: 0 = mcc Interfile, 1 = STIR Interfile), <OutType> \n" |
- |
-" \n" |
-" PET Reconstruction. CIEMAT 2009-11 \n" |
-" mario.canadas@ciemat.es \n" |
- " -------------------------- \n"; |
- */ |
- m_rnd= new TRandom3(); |
- m_AxialDistance = (9-1)*2.25; // Axial pixel dimension*NOfPlanes |
- m_RingDiameter = 120.0; // notranji premer peta |
- m_NOfPlanes = 9; // stevilo ravnin |
- m_NOfBins = 128; // stevilo binov v razdalji |
- m_nch = 128; // stevilo padov okoli in okoli |
- m_NOfAngles = TMath::Abs(m_nch)/2; // stevilo kotov = stevilo padov okoli in okoli /2 |
- |
- m_MaxRingDifference = -1; |
- //m_MaxRingDifference = 3; // najvecja razdalja med padi |
- // toDo: theSpan = int(GmParameterMgr::GetInstance()->GetNumericValue("PET:ProjData:Span",1)); |
- |
- |
- m_OutFormat = 1; // 1.. projections 0 .. image |
- m_Filename = "sino3D"; |
- m_Debug=1; |
- |
- if (m_MaxRingDifference==-1) m_MaxRingDifference=m_NOfPlanes-1; |
- |
- |
- m_TotalAxialPlanes=m_NOfPlanes*m_NOfPlanes; |
- if (m_OutFormat==1) m_TotalAxialPlanes= (2*m_NOfPlanes-1 - m_MaxRingDifference)*m_MaxRingDifference + m_NOfPlanes; // total number of Axial planes (segments*planes) in STIR format |
- |
- /*--- Initialize sino3D ---*/ |
- m_projections = new SINO_TYPE**[m_NOfBins]; |
- for(int i=0;i<m_NOfBins;i++){ |
- m_projections[i] = new SINO_TYPE*[m_NOfAngles]; |
- for(int j=0;j<m_NOfAngles;j++){ |
- m_projections[i][j] = new SINO_TYPE[m_TotalAxialPlanes]; /// ! If m_OutFormat==1 (STIR output):Matrix size depends on the MAX_Ring_Difference |
- for(int k=0;k<m_TotalAxialPlanes;k++){ |
- m_projections[i][j][k]=0; |
- } |
- } |
- } |
- |
- m_TotalProjectionCoincidences=0; |
- m_TotalCoincidences=0; |
- //OutputType = "pet"; |
-} |
- |
-//----------------------------------------------------------------------- |
-void PETProjDataMgr::SetProjection( int axialplane, TH2F * h) |
-{ |
-for(int i=0;i<m_NOfBins;i++){ |
- for(int j=0;j<m_NOfAngles;j++){ |
- m_projections[i][j][axialplane]=h->GetBinContent(i+1,j+1); |
- } |
-} |
- |
-} |
-//----------------------------------------------------------------------- |
- |
-//----------------------------------------------------------- |
-// from Gate |
-//------------------------------------------------------------ |
-double ComputeSinogramS(double X1, double Y1, double X2, double Y2) |
-{ |
- double s; |
- |
- double denom = (Y1-Y2) * (Y1-Y2) + (X2-X1) * (X2-X1); |
- |
- if (denom!=0.) { |
- denom = sqrt(denom); |
- s = ( X1 * (Y2-Y1) + Y1 * (X1-X2) ) / denom; |
- } else { |
- s = 0.; |
- } |
- |
- double theta; |
- if ((X1-X2)!=0.) { |
- theta=atan((X1-X2) /(Y1-Y2)); |
- } else { |
- theta=3.1416/2.; |
- } |
- if ((theta > 0.) && ((X1-X2) > 0.)) s = -s; |
- if ((theta < 0.) && ((X1-X2) < 0.)) s = -s; |
- if ( theta < 0.) { |
- theta = theta+3.1416; |
- s = -s; |
- } |
- return s; |
-} |
- |
- |
-void PETProjDataMgr::AddEvent( const TVector3& pos1 , const TVector3& pos2) |
-{ |
- int z1_i, z2_i; |
- //for discretization on the crystal: int x1_i, x2_i, y1_i, y2_i; |
- |
- double z1_abs=pos1.z()+m_AxialDistance/2; |
- double z2_abs=pos2.z()+m_AxialDistance/2; |
- double a, b, phi, dis; |
- int phi_i, dis_i; |
- int ring_diff; |
- |
- double _PI=2*asin(1); |
- |
- m_TotalCoincidences++; |
- |
- z1_i=(int)(m_NOfPlanes* z1_abs/m_AxialDistance); //round --> m_NOfPlanes+1 ... |
- z2_i=(int)(m_NOfPlanes* z2_abs/m_AxialDistance); |
- |
- // control; if z_i out of range: return |
- |
- if ( (pos1.x()==pos2.x()) && (pos1.y()==pos2.y()) ) { |
-#ifndef GAMOS_NO_VERBOSE |
- if( m_Debug ) { |
- cout << "PETProjDataMgr::AddEvent:WARNING! Event_1 == Event_2 ; x= " << pos2.x() << ", y= " << pos2.y() << ", z= " << pos2.z() << endl; |
- } |
-#endif |
- return; |
- } |
- |
- if ( (z1_i<0) || (z2_i<0) || (z1_i>= m_NOfPlanes) || (z2_i>= m_NOfPlanes) ) { |
-#ifndef GAMOS_NO_VERBOSE |
- if( m_Debug ) { |
- cout << "PETProjDataMgr::AddEvent:WARNING! Event out of bounds (Axial): x1= " << pos1.x() << ", y1= " << pos1.y() << ", z1= " << pos1.z() << " ; x2= " << pos2.x() << ", y2= " << pos2.y() << ", z2= " << pos2.z() << endl; |
- } |
-#endif |
- return; |
- } |
- |
- ring_diff = (int)fabs(z1_i-z2_i); |
- |
- // max ring difference; control: |
- if (ring_diff > m_MaxRingDifference) { |
-#ifndef GAMOS_NO_VERBOSE |
- if( m_Debug ) { |
- cout <<"PETProjDataMgr::AddEvent:WARNING! Event out of bounds (Max. Ring Diff.): " << ring_diff << ">" << m_MaxRingDifference << " x1= " << pos1.x() << ", y1= " << pos1.y() << ", z1= " << pos1.z() << " ; x2= " << pos2.x() << ", y2= " << pos2.y() << ", z2= " << pos2.z() << endl; |
- } |
-#endif |
- return; |
- } |
- |
- a=(double)(pos2.y()- pos1.y()); |
- b=(double)(pos2.x()- pos1.x()); |
- |
- if (a==0.0){ |
- phi=_PI*0.5; |
- } |
- else{ |
- phi=atan(b/a); |
- } |
- |
- if (phi<0) phi = phi +_PI; |
- |
- dis=pos1.x()*cos(phi) - pos1.y()*sin(phi); |
- //dis=ComputeSinogramS(pos1.x(), pos1.y(), pos2.x(), pos2.x()); |
- // control; transaxial FOV |
- if ( fabs(dis) > m_RingDiameter*0.5 ) { |
-#ifndef GAMOS_NO_VERBOSE |
- if( m_Debug ) { |
- cout << "PETProjDataMgr::AddEvent:WARNING! Event out of bounds (Transaxial): x1= " << pos1.x() << ", y1= " << pos1.y() << ", z1= " << pos1.z() << " ; x2= " << pos2.x() << ", y2= " << pos2.y() << ", z2= " << pos2.z() << endl; |
- } |
-#endif |
- return; |
- } |
- |
- dis = dis + m_RingDiameter*0.5; |
- |
- // discret values: |
- phi_i=(int)round( (double)(m_NOfAngles-1)*phi/_PI ); |
- dis_i=(int)round( (double)(m_NOfBins-1)*dis/(double)m_RingDiameter ); |
- |
- if ((phi_i>=m_NOfAngles) || (dis_i>=m_NOfBins)) return; // only possible "=" because 'round' check it.. |
- |
- // OLD: (SRRB included) sino3D[dis_i][phi_i][ (z1_i+z2_i)+ring_diff*(m_NOfPlanes-1) ]++; |
- |
- int Zpos; |
- |
- if (m_OutFormat==0) { |
- Zpos = (z1_i*m_NOfPlanes + z2_i); |
- } |
- else{ |
- |
- if (z1_i>=z2_i) { // SIN Max Ring_Diff: Zpos= ( ((m_NOfPlanes-ring_diff)*(m_NOfPlanes-1-ring_diff))/2 + z2_i ); |
- |
- Zpos= ( ((2*m_NOfPlanes-1 - m_MaxRingDifference - ring_diff)*(m_MaxRingDifference - ring_diff))/2 + z2_i); |
- |
- }else{ |
- Zpos= ( (m_TotalAxialPlanes) - ((2*m_NOfPlanes-1 - m_MaxRingDifference - ring_diff +1)*(m_MaxRingDifference - ring_diff +1))/2 + z1_i ); |
- |
- } |
- } |
- |
- m_projections[dis_i][phi_i][ Zpos ]++; |
- m_TotalProjectionCoincidences++; |
- |
-#ifndef GAMOS_NO_VERBOSE |
- if( m_Debug >1) { |
- cout << "PETProjDataMgr::AddEvent: x1= " << pos1.x() << ", y1= " << pos1.y() << ", z1= " << pos1.z() << " ; x2= " << pos2.x() << ", y2= " << pos2.y() << ", z2= " << pos2.z() << endl; |
- cout << "PETProjDataMgr::AddEvent: Sinogram pos.: distance(s)= " << dis_i << ", angular view(phi)= " << phi_i << " ; Zpos=" << Zpos <<"; Segment (Ring diff.) = " << ring_diff << endl; |
- } |
-#endif |
- |
- |
-} |
- |
-//----------------------------------------------------------------------- |
-PETProjDataMgr::~PETProjDataMgr() |
-{ |
- int i,j; |
- |
- for(i=0;i<m_NOfBins;i++){ |
- for(j=0;j<m_NOfAngles;j++){ |
- free(m_projections[i][j]); |
- |
- } |
- free(m_projections[i]); |
- |
- } |
- free(m_projections); |
- |
-} |
- |
-/* TO DO: call lm_to_sino3D program |
-//----------------------------------------------------------------------- |
-void PETIOMgr::ReadFile() |
-{ |
- if( !theFileIn ) OpenFileIn(); |
- |
- PETOutput po; |
- G4bool bEof; |
- for(;;) { |
- po = ReadEvent( bEof ); |
- // theFileIn->read(reinterpret_cast<char *>(&po),sizeof(PetOutput)); |
- if(bDumpCout) PrintEvent(" PETOutput: ", po, bCartesian); |
- if( bEof ) break; |
- } |
-} |
-//----------------------------------------------------------------------- |
-PETOutput PETProjDataMgr::ReadEvent( G4bool& bEof ) |
-{ |
- if( theFileIn == 0 ){ |
- G4Exception("PETIOMgr::ReadEvent, file not opened, call OpenFileIn() first "); |
- } |
- |
- PETOutput po; |
- fread (&po, sizeof(struct PETOutput),1,theFileIn); |
- if ( feof( theFileIn ) ) { |
- bEof = TRUE; |
- } else { |
- bEof = FALSE; |
- } |
- |
- return po; |
- |
-} |
-*/ |
- |
- |
-//----------------------------------------------------------------------- |
-void PETProjDataMgr::WriteInterfile() |
-{ |
- |
- char name_hv[512]; |
- char name_v[512]; |
- |
- if (m_OutFormat==0){ |
- |
- strcpy(name_hv, m_Filename); |
- strcpy(name_v,m_Filename); |
- strcat(name_hv, ".hv"); |
- strcat(name_v, ".v"); |
- |
- fp=fopen(name_hv, "w"); |
- |
- fprintf (fp, "!INTERFILE := \n"); |
- fprintf (fp, "name of data file := %s\n", name_v); |
- fprintf (fp, "!GENERAL DATA := \n"); |
- fprintf (fp, "!GENERAL IMAGE DATA :=\n"); |
- fprintf (fp, "!type of data := tomographic\n"); |
- fprintf (fp, "!version of keys := 3.3\n"); |
- fprintf (fp, "!data offset in bytes := 0\n"); |
- fprintf (fp, "imagedata byte order := littleendian\n"); |
- fprintf (fp, "!PET STUDY (General) :=\n"); |
- fprintf (fp, "!PET data type := 3D-Sinogram\n"); |
- fprintf (fp, "process status := Reconstructed\n"); |
- fprintf (fp, "!number format := unsigned short\n"); |
- fprintf (fp, "!number of bytes per pixel := 2\n"); |
- fprintf (fp, "number of dimensions := 3\n"); |
- fprintf (fp, "matrix axis label [1] := x\n"); |
- fprintf (fp, "!matrix size [1] := %i\n",m_NOfBins); |
- fprintf (fp, "scaling factor (mm/pixel) [1] := %f\n",(float)(m_RingDiameter/(m_NOfBins-1.0))); |
- |
- fprintf (fp, "matrix axis label [2] := y\n"); |
- fprintf (fp, "!matrix size [2] := %i\n",m_NOfAngles); |
- |
- fprintf (fp, "scaling factor (degree/pixel) [2] := %f\n",(float)(360./m_NOfAngles)); |
- |
- fprintf (fp, "matrix axis label [3] := z\n"); |
- fprintf (fp, "!matrix size [3] := %i\n",m_NOfPlanes*m_NOfPlanes); |
- fprintf (fp, "scaling factor (mm/pixel) [3] := %f\n",(float)(m_AxialDistance/(m_NOfPlanes-1.0))); |
- |
- fprintf (fp, "number of slices := %i\n",m_NOfPlanes*m_NOfPlanes); |
- fprintf (fp, "number of time frames := 1\n"); |
- fprintf (fp, "image scaling factor[1] := 1\n"); |
- fprintf (fp, "data offset in bytes[1] := 0\n"); |
- fprintf (fp, "quantification units := 1\n"); |
- fprintf (fp, "!END OF INTERFILE := \n"); |
- |
- fclose(fp); |
- //(size_t)(m_NOfBins*m_NOfAngles*m_NOfPlanes*m_NOfPlanes); |
- |
- }else{ |
- |
- strcpy(name_hv, m_Filename); |
- strcpy(name_v,m_Filename); |
- |
- strcat(name_hv, ".hs"); // STIR extension: .hs .s |
- strcat(name_v, ".s"); |
- |
- fp=fopen(name_hv, "w"); |
- |
- fprintf (fp, "!INTERFILE := \n"); |
- fprintf (fp, "name of data file := %s\n",name_v); |
- fprintf (fp, "!GENERAL DATA := \n"); |
- fprintf (fp, "!GENERAL IMAGE DATA :=\n"); |
- fprintf (fp, "!type of data := PET\n"); |
- // fprintf (fp, "!version of keys := 3.3\n"); STIR format is not 3.3 (almost but not completely), ERROR in STIR if it is not removed |
- // fprintf (fp, "!data offset in bytes := 0\n"); |
- fprintf (fp, "imagedata byte order := littleendian\n"); |
- fprintf (fp, "!PET STUDY (General) :=\n"); |
- fprintf (fp, "!PET data type := Emission\n"); |
- fprintf (fp, "applied corrections := {arc correction}\n"); // {none}\n"); |
- // fprintf (fp, "process status := Reconstructed\n"); |
- fprintf (fp, "!number format := unsigned integer\n"); |
- fprintf (fp, "!number of bytes per pixel := 2\n"); |
- |
- fprintf (fp, "number of dimensions := 4\n"); |
- fprintf (fp, "matrix axis label [4] := segment\n"); |
- fprintf (fp, "!matrix size [4] := %i\n",m_MaxRingDifference*2 + 1); |
- // fprintf (fp, "scaling factor (mm/pixel) [1] := %f\n",(float)(d_FOV/(m_NOfBins-1))); |
- fprintf (fp, "matrix axis label [3] := axial coordinate\n"); |
- fprintf (fp, "!matrix size [3] := { "); |
- if (m_MaxRingDifference==0) |
- { |
- fprintf (fp, "%i}\n", m_NOfPlanes); |
- }else{ |
- for(int m=m_NOfPlanes-m_MaxRingDifference;m<=m_NOfPlanes;m++) fprintf (fp, "%i,", m); |
- for(int m=m_NOfPlanes-1;m>m_NOfPlanes-m_MaxRingDifference;m--) fprintf (fp, "%i,", m); |
- fprintf (fp, "%i}\n", m_NOfPlanes-m_MaxRingDifference); |
- } |
- fprintf (fp, "matrix axis label [2] := view\n"); |
- fprintf (fp, "!matrix size [2] := %i\n",m_NOfAngles); |
- fprintf (fp, "matrix axis label [1] := tangential coordinate\n"); |
- fprintf (fp, "!matrix size [1] := %i\n",m_NOfBins); |
- |
- fprintf (fp, "minimum ring difference per segment := {"); // TO DO : add SPAN (m_MaxRingDifferenceiff per seg. variable) |
- fprintf (fp, "%i", -m_MaxRingDifference); |
- for(int m=-m_MaxRingDifference+1;m<=m_MaxRingDifference;m++) fprintf (fp, ",%i", m); |
- fprintf (fp, "}\n"); |
- fprintf (fp, "maximum ring difference per segment := {"); // TO DO : add SPAN (m_MaxRingDifferenceiff per seg. variable) |
- fprintf (fp, "%i", -m_MaxRingDifference); |
- for(int m=-m_MaxRingDifference+1;m<=m_MaxRingDifference;m++) fprintf (fp, ",%i", m); |
- fprintf (fp, "}\n"); |
- |
- fprintf (fp, "inner ring diameter (cm) := %f\n", m_RingDiameter/10); // STIR Required parameter, now assigned to FOV (not detectors) |
- fprintf (fp, "average depth of interaction (cm) := 0.0001\n"); |
- fprintf (fp, "default bin size (cm) := %f\n",0.1*((float)m_RingDiameter/((float)m_NOfBins-1.0)) ); |
- fprintf (fp, "number of rings := %i\n",m_NOfPlanes ); |
- fprintf (fp, "distance between rings (cm) := %f\n", 0.1*((float)m_AxialDistance/(float)(m_NOfPlanes-1)) ); // Axial pixel dimension |
- |
- fprintf (fp, "number of detectors per ring := %i\n",m_NOfAngles*2 ); |
- // fprintf (fp, "number of slices := %i\n",m_NOfPlanes*m_NOfPlanes); |
- fprintf (fp, "number of time frames := 1\n"); |
- fprintf (fp, "image scaling factor[1] := 1\n"); |
- fprintf (fp, "data offset in bytes[1] := 0\n"); |
- fprintf (fp, "quantification units := 1\n"); |
- fprintf (fp, "!END OF INTERFILE := \n"); |
- |
- fclose(fp); |
- |
- } |
- m_Buffer = (SINO_TYPE*) malloc( m_NOfBins*m_NOfAngles*m_TotalAxialPlanes*sizeof(SINO_TYPE)); |
- |
- long unsigned int cont=0; |
- int i,j,k; |
- |
- for(k=0;k<m_TotalAxialPlanes;k++){ |
- for(j=0;j<m_NOfAngles;j++){ |
- for(i=0;i<m_NOfBins;i++){ |
- m_Buffer[cont]=m_projections[i][j][k]; |
- cont++; |
- } |
- } |
- } |
- |
- fp=fopen(name_v, "wb"); |
- |
- //cout << 4096*sizeof(SINO_TYPE) << endl; |
- int nb=fwrite(m_Buffer,1,m_NOfBins*m_NOfAngles*m_TotalAxialPlanes*sizeof(SINO_TYPE), fp); |
- fclose(fp); |
- |
-#ifndef GAMOS_NO_VERBOSE |
- cout << "PETProjDataMgr::WriteInterfile: File name: " << m_Filename << endl; |
- cout << "PETProjDataMgr::WriteInterfile: Numer of bytes written: " << nb << endl; |
- cout << "PETProjDataMgr::WriteInterfile: Planes = " << m_NOfPlanes << "; bins = " << m_NOfBins << "; ang_views = " << m_NOfAngles << endl; |
- cout << "PETProjDataMgr::WriteInterfile: Dimensions (mm): Transaxial FOV = " << m_RingDiameter << "; Axial FOV = " << m_AxialDistance << " ; Transaxial_pix = " << m_RingDiameter/(m_NOfBins-1) <<"; Plane width = " << m_AxialDistance/(m_NOfPlanes-1) << endl; // Image Axial Pixel(ssrb) == 0.5*(Plane_Width); |
- cout << "... " << endl; |
- |
- cout << "PETProjDataMgr::WriteInterfile: Total Coinci: " << m_TotalCoincidences << endl; |
- cout << "PETProjDataMgr::WriteInterfile: Sino3D Coinci: " << m_TotalProjectionCoincidences << endl; |
-#endif |
- |
-} |
- |
- |
-TVector3 PETProjDataMgr::Hits2Digits(const TVector3 &r){ |
- if (!m_nch) return r; |
- float smear=0.5; |
- |
- if (m_nch<0) smear=m_rnd->Rndm(); |
- |
- double angle = TMath::ATan2(r.X(),r.Y()); // vrne kot med -pi in pi |
- if (angle<0) angle+=TMath::TwoPi(); |
- |
- angle= (int(angle/TMath::TwoPi()*TMath::Abs(m_nch))+smear)*TMath::TwoPi()/TMath::Abs(m_nch); |
- //(m_rnd->Rndm()-0.5)*m_AxialDistance; |
- return TVector3(sin(angle), cos(angle),0); // z coordinata ni cisto v redu |
- |
-} |
- |
-int PETProjDataMgr::FwdProject(double x,double y, double z, int nmax, TH1*h){ |
-TVector3 r(x,y,z); |
-int h2d=h->InheritsFrom("TH2F"); |
-double tfac=m_RingDiameter*m_RingDiameter/4-r.Mag2(); |
-double rfac= m_AxialDistance/m_RingDiameter; |
-for (int i=0;i<nmax;i++){ |
- |
- double phi= m_rnd->Rndm()*TMath::Pi(); |
- TVector3 s(1,0,0); |
- s.SetPhi(phi); |
- double sign = (m_rnd->Rndm()>0.5)? 1 : 0; |
- double theta = TMath::ACos(m_rnd->Rndm()*rfac); |
- theta+=sign*TMath::Pi(); |
- |
- s.SetTheta(theta); |
- double t=r*s; |
- TVector3 rx=r-t*s; |
- |
- double d=TMath::Sqrt(t*t+tfac); |
- |
- TVector3 r1=rx+d*s; |
- TVector3 r2=rx-d*s; |
- |
- //r1=Hits2Digits(r1); |
- //r2=Hits2Digits(r2); |
- |
- AddEvent( r1 , r2); |
- if (h!=NULL){ |
- TVector3 s1=r2-r1; |
- double s1len= s1.Mag(); |
- int niter=int (100*s1len/m_RingDiameter); |
- for (int j=0;j<niter;j++){ |
- r2=r1+m_rnd->Rndm()*s1; |
- if (h2d) ((TH2F *) h)->Fill(r2.X(),r2.Y()); |
- else ((TH3F *) h)->Fill(r2.X(),r2.Y(),r2.Z()); |
- } |
- } |
-} |
-return 0; |
-} |
- |
-int PETProjDataMgr::FwdProject(TH2F *img, TH2F *h){ |
- |
-for (int i=0;i<img->GetNbinsX();i++) { |
- double x_=img->GetXaxis()->GetBinCenter( i+1 ); |
- for (int j=0;j<img->GetNbinsY();j++) { |
- double y_=img->GetYaxis()->GetBinCenter( j+1 ); |
- double density= img->GetBinContent(i+1,j+1); |
- if (density>0) FwdProject(x_,y_,m_AxialDistance*(m_rnd->Rndm()-0.5), density,h); |
- } |
-} |
-return 0; |
-} |
- |
-int PETProjDataMgr::FwdProject(TH3F *img, TH3F *h){ |
- |
-for (int i=0;i<img->GetNbinsX();i++) { |
- double x_=img->GetXaxis()->GetBinCenter( i+1 ); |
- for (int j=0;j<img->GetNbinsY();j++) { |
- double y_=img->GetYaxis()->GetBinCenter( j+1 ); |
- for (int k=0;k<img->GetNbinsZ();k++) { |
- double z_=img->GetZaxis()->GetBinCenter( k+1 ); |
- double density= img->GetBinContent(i+1,j+1,k+1); |
- if (density>0) FwdProject(x_,y_,z_, density,h); |
- } |
- } |
-} |
-return 0; |
-} |
- |
-TH2F *PETProjDataMgr::Phantom(int kaj){ |
-TH2F *img= new TH2F("img","Original Image",100,-50,50,100,-50,50); |
- |
-// izberi sliko 0: kroglice, 1: point source 2: central ball |
-switch (kaj){ |
- |
-case 0: |
-for (int i=0;i<img->GetNbinsX();i++) { |
- for (int j=0;j<img->GetNbinsY();j++) { |
- double x_=img->GetXaxis()->GetBinCenter( i+1 ); |
- double y_=img->GetYaxis()->GetBinCenter( j+1 ); |
- double density=1000; |
- if ((x_*x_+y_*y_)<6) img->SetBinContent(i+1,j+1,density); |
- |
- density=500; if ((x_-25)*(x_-25)+y_*y_<12) img->SetBinContent(i+1,j+1,density); |
- density=2000; if ((y_-25)*(y_-25)+x_*x_<2) img->SetBinContent(i+1,j+1,density); |
- } |
-} |
-break; |
- |
-case 2: |
-for (int i=0;i<img->GetNbinsX();i++) { |
- for (int j=0;j<img->GetNbinsY();j++) { |
- double x_=img->GetXaxis()->GetBinCenter( i+1 ); |
- double y_=img->GetYaxis()->GetBinCenter( j+1 ); |
- double density=1000; |
- if ((x_*x_+y_*y_)<12.5) img->SetBinContent(i+1,j+1,density); |
- } |
-} |
-break; |
- |
-case 1: |
-img->Fill(25,25,10000); |
-break; |
- |
-} |
- |
-return img; |
-} |
Index: petrecofmf/pedestals_new.dat |
=================================================================== |
--- petrecofmf/pedestals_new.dat (revision 113) |
+++ petrecofmf/pedestals_new.dat (nonexistent) |
@@ -1,64 +0,0 @@ |
-0 339.13 |
-1 354.26 |
-2 327.546 |
-3 282.69 |
-4 312.863 |
-5 365.795 |
-6 317.055 |
-7 316.198 |
-8 348.804 |
-9 337.947 |
-10 385.535 |
-11 341.414 |
-12 351.877 |
-13 346.92 |
-14 339.204 |
-15 334.106 |
-16 331.704 |
-17 333.163 |
-18 302.789 |
-19 319.067 |
-20 325.209 |
-21 348.417 |
-22 337.329 |
-23 326.671 |
-24 351.699 |
-25 348.799 |
-26 308.549 |
-27 286.519 |
-28 332.446 |
-29 324.031 |
-30 351.92 |
-31 342.048 |
-32 359.25 |
-33 325.419 |
-34 334.892 |
-35 322.25 |
-36 293.95 |
-37 354.971 |
-38 304.267 |
-39 370.495 |
-40 374.192 |
-41 347.656 |
-42 340.723 |
-43 311.266 |
-44 301.842 |
-45 320.301 |
-46 387.6 |
-47 318.137 |
-48 321.878 |
-49 348.859 |
-50 342.913 |
-51 332.14 |
-52 346.995 |
-53 350.787 |
-54 337.321 |
-55 329.6 |
-56 346.56 |
-57 303.365 |
-58 298.587 |
-59 302.891 |
-60 306.159 |
-61 293.716 |
-62 324.878 |
-63 341.973 |
Index: petrecofmf/config.xml |
=================================================================== |
Cannot display: file marked as a binary type. |
svn:mime-type = application/xml |
/petrecofmf/config.xml |
Property changes: |
Deleted: svn:mime-type |
## -1 +0,0 ## |
-application/xml |
\ No newline at end of property |
Index: petrecofmf/ph511.dat |
=================================================================== |
--- petrecofmf/ph511.dat (revision 113) |
+++ petrecofmf/ph511.dat (nonexistent) |
@@ -1,84 +0,0 @@ |
-0 1700 |
-1 1900 |
-2 1680 |
-3 1700 |
-4 1870 |
-5 1680 |
-6 1430 |
-7 1460 |
-8 1680 |
-9 1700 |
-10 1713 |
-11 1650 |
-12 1630 |
-13 1830 |
-14 1750 |
-15 1740 |
-16 2440 |
-17 2320 |
-18 2640 |
-19 2500 |
-20 2790 |
-21 2600 |
-22 2900 |
-23 2820 |
-24 2660 |
-25 2470 |
-26 2310 |
-27 2330 |
-28 2817 |
-29 2860 |
-30 2140 |
-31 2140 |
-32 2120 |
-33 2410 |
-34 1990 |
-35 2480 |
-36 2200 |
-37 2100 |
-38 2040 |
-39 2060 |
-40 2090 |
-41 1970 |
-42 2032 |
-43 1970 |
-44 2054 |
-45 2120 |
-46 2076 |
-47 1920 |
-48 2206 |
-49 2420 |
-50 1930 |
-51 2290 |
-52 2400 |
-53 2425 |
-54 1950 |
-55 2400 |
-56 2076 |
-57 2010 |
-58 1792 |
-59 1830 |
-60 2000 |
-61 2032 |
-62 1640 |
-63 1614 |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
Index: petrecofmf/sinoread.cxx |
=================================================================== |
--- petrecofmf/sinoread.cxx (revision 113) |
+++ petrecofmf/sinoread.cxx (nonexistent) |
@@ -1,152 +0,0 @@ |
-#include <stdio.h> |
-#include "TH2F.h" |
-#include "TCanvas.h" |
-#include "TMath.h" |
-#include "TStyle.h" |
-#include "TColor.h" |
- |
-void mypalette(){ |
- |
- Int_t MyPalette[1000]; |
- double stops[] = {0.00, 0.34, 0.61, 0.84, 1.00}; |
- double red[] = {1.00, 0.84, 0.61, 0.34, 0.00}; |
- double green[] = {1.00, 0.84, 0.61, 0.34, 0.00}; |
- double blue[] = {1.00, 0.84, 0.61, 0.34, 0.00}; |
- |
- |
- Int_t gs = TColor::CreateGradientColorTable(5, stops, red, green, blue, 999); |
- //for (int i=0;i<999;i++) MyPalette[i] = gs+998-i; |
- |
- for (int i=0;i<999;i++) MyPalette[i] = gs+i; |
- gStyle->SetPalette(999, MyPalette); |
-} |
- |
-int imageread(char *fname,int nchx=28, int nchy=56, int nchz=0, int format=0, int size=0, char *opt=""){ |
-FILE *fp= fopen(fname,"read"); |
-const int maxbuf=360000; |
-float *fbuf= new float[maxbuf]; |
-unsigned short*ibuf=((unsigned short*) &fbuf[0]); |
-if (size==0) { |
- if (format) size=sizeof(float); |
- else size=sizeof(unsigned short); |
-} |
-int ncount=0; |
- |
-if(fp){ |
- |
-gStyle->SetPalette(100); |
-mypalette(); |
-TCanvas *c=new TCanvas("c","c",1500,1500); |
-int sizx=sqrt(nchz); |
-c->Divide(sizx,TMath::Ceil(nchz/double(sizx)) ); |
-char hname[128]; |
- |
-while (!feof(fp)){ |
- |
- |
-int nb=fread(fbuf,size,nchx*nchy,fp); |
-printf("nb=%d\n",nb); |
-if (nb>0){ |
- sprintf(hname,"slice %d",ncount); |
- TH2F *h=new TH2F("h",hname,nchx,-0.5,nchx-0.5,nchy,-0.5,nchy-0.5); |
- float val=0; |
- for (int i=0 ; i<nb;i++){ |
- //h->SetBinContent(i%nchx+1, i/nchx+1, fbuf[i]); |
- if (format) val=fbuf[i]; else val=float(ibuf[i]); |
- h->SetBinContent(i/nchy+1,i%nchy+1, val); |
- } |
- c->cd(ncount+1); |
- h->SetMinimum(0); |
- h->Draw(opt); |
-} |
- |
-ncount++; |
-} |
-fclose(fp); |
-c->Modified(); |
-c->Update(); |
-} |
- |
-delete fbuf; |
-return 0; |
-} |
- |
-int interfileread(char *fname, char *opt=""){ |
- FILE *fp=fopen(fname,"r"); |
- if (!fp) { |
- printf("Cannot open %s\n",fname); |
- return 0; |
- } |
- int j=0; |
- int ndim=400; |
- char *line= new char[ndim]; |
- int indx[4]={-1,-1,-1,-1}; |
- int dim[5]; |
- char *cmd,*val,*token; |
- char fimage[100]; |
- while (fgets(line,ndim,fp)!=NULL) { |
- char *v= strstr(line,":="); |
- if (v!=NULL) { |
- cmd=line; |
- v[0]=0; |
- val = &v[2]; |
- val[strlen(val)-1]=0; |
- printf("%d #%s# %s\n",j++, val, cmd); |
- int axis=-1; |
- if (strstr(cmd,"matrix axis label")!= NULL){ |
- |
- sscanf(cmd,"matrix axis label [%d]", &axis); |
- if(axis>0 && axis<5){ |
- if (strstr(val," x")!= NULL) indx[axis-1]=1; |
- if (strstr(val," y")!= NULL) indx[axis-1]=0; |
- if (strstr(val," z")!= NULL) indx[axis-1]=3; |
- |
- if (strstr(val,"view") != NULL) indx[axis-1]=0; |
- if (strstr(val,"tangential")!= NULL) indx[axis-1]=1; |
- if (strstr(val,"segment") != NULL) indx[axis-1]=2; |
- if (strstr(val,"axial") != NULL) indx[axis-1]=3; |
- printf("-->> %s axis=%d indx=%d\n",val, axis,indx[axis-1]); |
- |
- } |
- } |
- if (strstr(cmd,"!matrix size")!= NULL){ |
- sscanf(cmd,"!matrix size [%d]", &axis); |
- if(axis>0 && axis<5){ |
- if (indx[axis-1]<3){ dim[indx[axis-1]]=atoi(val);} |
- else { |
- int sum=0; |
- token = strtok(val,"{,"); |
- sum+=atoi(token); |
- while ( (token=strtok(NULL,"{,")) ) sum+=atoi(token); |
- printf("total dim=%d\n",sum); |
- dim[3]=sum; |
- }; |
- } |
- printf("axis=%d indx=%d\n",axis,indx[axis-1]); |
- } |
- if (strstr(cmd,"name of data file")!= NULL){ |
- sscanf(val,"%s",fimage); |
- printf("image file=%s\n",fimage); |
- } |
- if (strstr(cmd,"!number of bytes per pixel")!= NULL){ |
- dim[4]=atoi(val); |
- printf("bytes per pixel=%d\n",dim[4]); |
- } |
- if (strstr(cmd,"!number format")!= NULL){ |
- if (strstr(val,"float")!=NULL){ dim[5]=1; }; |
- if (strstr(val,"integer")!=NULL){ dim[5]=0; }; |
- printf("number format=%d\n",dim[5]); |
- } |
- |
- } |
- } |
- for (int i=0;i<6;i++) printf ("dim[%d]=%d\n", i,dim[i]); |
- fclose(fp); |
- imageread(fimage,dim[0], dim[1], dim[3], dim[5], dim[4], opt); |
- return 0; |
-} |
- |
- |
-int sinoread(char *fname, char *opt=""){ |
- return interfileread(fname,opt); |
-} |
Index: petrecofmf/FBP2D.sh |
=================================================================== |
--- petrecofmf/FBP2D.sh (revision 113) |
+++ petrecofmf/FBP2D.sh (nonexistent) |
@@ -1,58 +0,0 @@ |
-#!/bin/bash |
-# |
-export STIRPATH=~rok/pet/reco/STIR2.1/STIR |
-# |
-export PATH=$PATH:$STIRPATH/bin |
-EXE=FBP2D |
-IMAGEVIEW=manip_image |
-HVNAME=$2.hv |
- |
-TEMPFILE=`tempfile` |
-rm -f $TEMPFILE |
-echo -n "fbp2dparameters := |
- |
-input file := $1 |
-output filename prefix := $2 |
- |
-;input file := sino3D.hs |
-;output filename prefix := output |
- |
- |
-; output image parameters |
-; zoom defaults to 1 |
-zoom := 1 |
-; image size defaults to whole FOV |
-; ;;;;;;;; zakomentirano 8.1.2013 xy output image size (in pixels) := 100 |
-xy output image size (in pixels) := 200 |
- |
-; can be used to call SSRB first |
-; default means: call SSRB only if no axial compression is already present |
-;num segments to combine with ssrb := -1 |
- |
-; filter parameters, default to pure ramp |
-alpha parameter for ramp filter := 0.5 |
-cut-off for ramp filter (in cycles) := 0.3 |
- |
-; allow less padding. DO NOT USE |
-; (unless you're sure that the object occupies only half the FOV) |
-;Transaxial extension for FFT:=1 |
- |
-; back projector that could be used (defaults to interpolating backprojector) |
-; Back projector type:= some type |
- |
-; display data during processing for debugging purposes |
-Display level := 1 |
-end := |
-" >> $TEMPFILE |
- |
-echo $EXE $TEMPFILE |
-$EXE $TEMPFILE |
- |
- |
-$IMAGEVIEW $HVNAME |
-root src/sinoread.cxx+\(\"$HVNAME\",\"colz\"\) |
- |
-echo "za ponovni ogled slike" |
-echo $IMAGEVIEW $HVNAME |
-echo ali |
-echo root src/sinoread.cxx+\(\"$HVNAME\",\"colz\"\) |
/petrecofmf/FBP2D.sh |
Property changes: |
Deleted: svn:executable |
Index: petrecofmf/PETProjDataMgr.h |
=================================================================== |
--- petrecofmf/PETProjDataMgr.h (revision 113) |
+++ petrecofmf/PETProjDataMgr.h (nonexistent) |
@@ -1,120 +0,0 @@ |
-// |
-// ******************************************************************** |
-// * License and Disclaimer * |
-// * * |
-// * The GAMOS software is copyright of the Copyright Holders of * |
-// * the GAMOS Collaboration. It is provided under the terms and * |
-// * conditions of the GAMOS Software License, included in the file * |
-// * LICENSE and available at http://fismed.ciemat.es/GAMOS/license .* |
-// * These include a list of copyright holders. * |
-// * * |
-// * Neither the authors of this software system, nor their employing * |
-// * institutes,nor the agencies providing financial support for this * |
-// * work make any representation or warranty, express or implied, * |
-// * regarding this software system or assume any liability for its * |
-// * use. Please see the license in the file LICENSE and URL above * |
-// * for the full disclaimer and the limitation of liability. * |
-// * * |
-// * This code implementation is the result of the scientific and * |
-// * technical work of the GAMOS collaboration. * |
-// * By using, copying, modifying or distributing the software (or * |
-// * any work based on the software) you agree to acknowledge its * |
-// * use in resulting scientific publications, and indicate your * |
-// * acceptance of all terms of the GAMOS Software license. * |
-// ******************************************************************** |
-// |
- |
-#ifndef PETProjDataMgr_h |
-#define PETProjDataMgr_h |
- |
-/*--------------------------------------------------------------------------- |
-ClassName: PETProjDataMgr |
-Author: M. Canadas, P. Arce |
-Changes: 01/11: creation |
- |
-------------------------------------------------------------------------- |
-// Description |
- |
- PET output (List-mode X Y Z) into projection data (sinograms). |
- |
- Output data: Sinograms for PET image reconstruction. Interfile format, STIR compatible (.hs/.s), |
- STIR Software for Tomographic Image Reconstruction: http://stir.sourceforge.net/main.htm |
- |
------------------------------------------------------------------------*/ |
- |
-#include <iostream> |
-#include "TVector3.h" |
-class TH2F; |
- |
-//#include <math.h> |
-#include <map> |
-#include <vector> |
-#include <set> |
-#include <string> |
- |
-class TH1; |
-class TH2F; |
-class TH3F; |
-class TRandom3; |
- |
- typedef unsigned short SINO_TYPE; //!!NOTE: Check "Write_sino3D" (.hv file) if SINO_TYPE changes !! |
- |
-//------------------------------------------------------------------------ |
-class PETProjDataMgr |
-{ |
- private: |
- PETProjDataMgr(); |
- int m_Debug; |
- public: |
- ~PETProjDataMgr(); |
- |
- //! Get the only instance |
- static PETProjDataMgr* GetInstance(); |
- void AddEvent(const TVector3& pos1, const TVector3& pos2); |
- //void ReadFile(); |
- //PETOutput ReadEvent( G4bool& bEof ); |
- void SetProjection(int axialplane, TH2F*h); |
- void WriteInterfile(); |
- void SetNPlanes(int n){m_NOfPlanes=n;}; |
- void SetNBin(int n){m_NOfBins=n;}; |
- void SetNAng(int n){m_NOfAngles=n;}; |
- void SetDebug(int n){m_Debug=n;}; |
- void SetNumberOfChannels(int n){m_nch=n;}; |
- void SetFilename( const char *fname){ m_Filename= TString(fname); }; |
- void SetRingDiameter( double x){ m_RingDiameter = x; }; |
- void SetAxialDistance( double x){ m_AxialDistance = x; }; |
- TH2F *Phantom(int kaj); |
- int FwdProject(TH2F *img, TH2F *h=NULL); |
- int FwdProject(TH3F *img, TH3F *h=NULL); |
- |
- int FwdProject(double x,double y, double z, int nmax, TH1 *h=NULL); |
- TVector3 Hits2Digits(const TVector3 &r); |
- |
-private: |
- static PETProjDataMgr* m_Instance; |
- |
- double m_AxialDistance; |
- double m_RingDiameter; |
- int m_NOfPlanes; |
- int m_NOfBins; |
- int m_NOfAngles; |
- int m_MaxRingDifference; |
- int m_OutFormat; |
- int m_nch; |
- int m_TotalAxialPlanes; |
- TString m_Filename; |
- TRandom3 * m_rnd; |
- //G4bool bDumpCout; |
- |
- SINO_TYPE ***m_projections; |
- SINO_TYPE *m_Buffer; |
- |
- unsigned long int m_TotalCoincidences; |
- unsigned long int m_TotalProjectionCoincidences; |
- |
- |
- FILE *fp; |
-}; |
- |
-#endif |
- |
Index: petrecofmf/m16_reverse.map |
=================================================================== |
--- petrecofmf/m16_reverse.map (revision 113) |
+++ petrecofmf/m16_reverse.map (nonexistent) |
@@ -1,17 +0,0 @@ |
-#CH IX IY |
-0 0 0 |
-1 0 1 |
-2 1 0 |
-3 1 1 |
-4 0 3 |
-5 0 2 |
-6 1 3 |
-7 1 2 |
-8 2 3 |
-9 2 2 |
-10 3 3 |
-11 3 2 |
-12 2 0 |
-13 2 1 |
-14 3 0 |
-15 3 1 |
Index: petrecofmf/Makefile |
=================================================================== |
--- petrecofmf/Makefile (revision 113) |
+++ petrecofmf/Makefile (nonexistent) |
@@ -1,60 +0,0 @@ |
- |
-ROOTINC=$(shell root-config --incdir ) |
-ROOTLIB=$(shell root-config --libs ) |
-ROOTGLIBS=$(shell root-config --libs --glibs ) |
- |
-LIBS=$(ROOTLIB) -L./ -lm |
- |
- |
-XMLCFLAGS =$(shell xml2-config --cflags ) |
-XMLLIBS =$(shell xml2-config --libs ) |
- |
- |
-INC=-I. -I$(ROOTINC) $(XMLCFLAGS) |
-LIBS=$(ROOTGLIBS) $(XMLLIBS) |
- |
-SRC = . |
-INC1 = -I. -I../lib -I/usr/include |
-DBG = |
-CFLAGS = $(DBG) $(INC1) -Wall -g |
- |
- |
- |
- |
-BIN= bin |
-LIB=lib |
- |
-TARGET = $(BIN)/petreco |
-FILES = $(SRC)/readdata.C $(SRC)/PETProjDataMgr.C |
- |
-LIBFILE = $(LIB)/libfmfpetreco.a |
- |
- |
- |
-OBJ_FILES = $(SRC)/readdata.o |
- |
-$(TARGET): $(FILES) |
- $(CXX) $(INC) -DMAIN $(FILES) $(CFLAGS) -o $(TARGET) $(LIBS) -lstdc++ |
- |
- |
- |
-.C.o: |
- $(CXX) $(INC) -c $< |
- ar r $(LIBFILE) $@ |
- |
-.c.o: |
- $(CXX) -c $< |
- ar r $(LIBFILE) $@ |
- |
- |
-xpath2: $(SRC)/xpath2.c |
- $(CXX) -o $(BIN)/xpath2 `xml2-config --cflags` $(SRC)/xpath2.c `xml2-config --libs` |
- |
- |
- |
-clean: |
- rm Dict.C $(OBJ_FILES) $(TARGET) $(LIBFILE) |
- |
- |
-tgz: |
- tar czvf fmfpet.tgz Makefile README $(SRC)/*.C $(SRC)/*.h $(SRC)/*.c $(SRC)/*.cxx $(SRC)/*.sh *.xml *.dat *.map *.root |
Index: petrecofmf/plot.cxx |
=================================================================== |
--- petrecofmf/plot.cxx (revision 113) |
+++ petrecofmf/plot.cxx (nonexistent) |
@@ -1,186 +0,0 @@ |
-//--------------------------------------------------- |
-int plot2d(char *opt="colz", float max=0){ |
-char hname[50]; |
- char hn[50]; |
- TCanvas *c; |
- TH1I *gICh = (TH1I * ) gDirectory->Get("mapping"); |
- for (int i=0;i<4;i++) { |
- sprintf(hname,"cz%d",i); |
- sprintf(hn,"Corr Pmt %d",i); |
- c =new TCanvas(hname,hn, 1000,1000); |
- c->Divide(4,4); |
- for (int j=0;j<16;j++){ |
- c->cd(gICh->GetBinContent(j+1)+1); |
- sprintf(hn,"corrch%d",i*16+j); |
- TH1F*h= (TH1F * ) gDirectory->Get(hn); |
- if (max>0) h->SetMaximum(max); |
- h->Draw(opt); |
- } |
- c->Modified(); |
- c->Update(); |
- } |
-return 0; |
-} |
- |
-//--------------------------------------------------- |
-int plot( char *fname=NULL, float max=0){ |
- if (fname!=NULL){ |
- cout << "Rootname:" << fname << endl; |
- delete gROOT->GetListOfFiles()->FindObject(fname); // clear memory of file name |
- if( gSystem->AccessPathName(fname) ) { |
- cout << endl << "File: " << fname << " not there!!!" << endl << endl; |
- return 0; |
- } |
- TFile *rootfile = new TFile(fname); |
- } |
- //if (buf) delete buf; |
- char hn[255]; |
- |
- TCanvas *c1; |
- for (int i=0;i<4;i++){ |
- sprintf(hn,"csumadc%d",i); |
- c1=new TCanvas(hn,hn,1200,1200); |
- c1->Divide(9,9,0,0); |
- sprintf(hn,"sumadc%d",i); |
- TH2F *h = ((TH2F * )gDirectory->Get(hn)); |
- for (int j=0;j<81;j++){ |
- c1->cd(1+j); |
- TH1D *h0 = h->ProjectionX(" ",1+j,1+j); |
- h0->DrawCopy(); |
- } |
- c1->Modified(); |
- c1->Update(); |
- } |
- |
- |
- |
- TCanvas *c2=new TCanvas("c2","c2",800,800); |
- c2->Divide(2,2); |
- for (int i=0;i<4;i++){ |
- c2->cd(1+i); |
- sprintf(hn,"pmt1%d",i); |
- ((TH1F * ) gDirectory->Get(hn))->Draw("colz"); |
- } |
- c2->Modified(); |
- c2->Update(); |
- |
- TCanvas *c6=new TCanvas("c6","c6",800,800); |
- c6->Divide(2,2); |
- for (int i=0;i<4;i++){ |
- c6->cd(1+i); |
- sprintf(hn,"pmt3%d",i); |
- ((TH1F * ) gDirectory->Get(hn))->Draw("colz"); |
- } |
- c6->Modified(); |
- c6->Update(); |
- |
- TCanvas *c5=new TCanvas("c5","c5",800,800); |
- |
- |
- ((TH1F * ) gDirectory->Get("globalxy"))->Draw("colz"); |
- |
- c5->Modified(); |
- c5->Update(); |
- |
- |
- TCanvas *c3=new TCanvas("c3","c3",800,800); |
- c3->Divide(2,2); |
- for (int i=0;i<4;i++){ |
- c3->cd(1+i); |
- sprintf(hn,"pmt2%d",i); |
- ((TH1F * ) gDirectory->Get(hn))->Draw("colz"); |
- } |
- |
- |
- c3->Modified(); |
- c3->Update(); |
- |
- TCanvas *c4=new TCanvas("c4","c4",800,800); |
- c4->Divide(4,4); |
- for (int i=0;i<16;i++){ |
- c4->cd(1+i)->SetLogy(); |
- sprintf(hn,"ach%d",i); |
- ((TH1F * ) gDirectory->Get(hn))->Draw(); |
- } |
- c4->Modified(); |
- c4->Update(); |
- plot2d("colz",max); |
- return 0; |
-} |
- |
-//--------------------------------------------------- |
-int plotadc(){ |
- char hn[255]; |
- TCanvas *c; |
- char hname[50]; |
- char hn[50]; |
- TH1I *gICh = (TH1I * ) gDirectory->Get("mapping"); |
- for (int i=0;i<4;i++) { |
- sprintf(hname,"cx%d",i); |
- sprintf(hn,"Pmt %d",i); |
- c =new TCanvas(hname,hn, 1000,1000); |
- c->Divide(4,4); |
- for (int j=0;j<16;j++){ |
- c->cd(gICh->GetBinContent(j+1)+1)->SetLogy(); |
- sprintf(hn,"ach%d",i*16+j); |
- ((TH1F * ) gDirectory->Get(hn))->Draw(); |
- } |
- c->Modified(); |
- c->Update(); |
- } |
- |
- return 0; |
-} |
- |
-//--------------------------------------------------- |
-int plotsingles(char *opt="colz", float max=0){ |
- char hname[50]; |
- char hn[50]; |
- TCanvas *c; |
- TH1I *gICh = (TH1I * ) gDirectory->Get("mapping"); |
- for (int i=0;i<4;i++) { |
- sprintf(hname,"cy%d",i); |
- sprintf(hn,"Single Pmt %d",i); |
- c =new TCanvas(hname,hn, 1000,1000); |
- c->Divide(4,4); |
- for (int j=0;j<16;j++){ |
- c->cd(gICh->GetBinContent(j+1)+1); |
- sprintf(hn,"singlech%d",i*16+j); |
- TH1F*h= (TH1F * ) gDirectory->Get(hn); |
- if (max>0) gHistoSingle[i*16+j]->SetMaximum(max); |
- h->Draw(opt); |
- } |
- c->Modified(); |
- c->Update(); |
- } |
- |
- return 0; |
-} |
- |
- |
- |
- |
-//--------------------------------------------------- |
-int plotcut(char *opt="", float max=0){ |
-char hname[50]; |
- char hn[50]; |
- TCanvas *c; |
- TH1I *gICh = (TH1I * ) gDirectory->Get("mapping"); |
- for (int i=0;i<4;i++) { |
- sprintf(hname,"cz%d",i); |
- sprintf(hn,"Cut Pmt %d",i); |
- c =new TCanvas(hname,hn, 1000,1000); |
- c->Divide(4,4); |
- for (int j=0;j<16;j++){ |
- c->cd(gICh->GetBinContent(j+1)+1)->SetLogy(); |
- sprintf(hn,"corrch%d",i); |
- TH1F*h= (TH1F * ) gDirectory->Get(hn); |
- if (max>0) h->SetMaximum(max); |
- h->Draw(opt); |
- } |
- c->Modified(); |
- c->Update(); |
- } |
-return 0; |
-} |
-//--------------------------------------------------- |
Index: petrecofmf/sumpedestals_zero.dat |
=================================================================== |
--- petrecofmf/sumpedestals_zero.dat (revision 113) |
+++ petrecofmf/sumpedestals_zero.dat (nonexistent) |
@@ -1,4 +0,0 @@ |
-0 6000 |
-1 5264.29 |
-2 5394.42 |
-3 5261.11 |
Index: petrecofmf/m16.map |
=================================================================== |
--- petrecofmf/m16.map (revision 113) |
+++ petrecofmf/m16.map (nonexistent) |
@@ -1,17 +0,0 @@ |
-#CH IX IY |
-15 0 0 |
-14 0 1 |
-13 1 0 |
-12 1 1 |
-11 0 3 |
-10 0 2 |
-9 1 3 |
-8 1 2 |
-7 2 3 |
-6 2 2 |
-5 3 3 |
-4 3 2 |
-3 2 0 |
-2 2 1 |
-1 3 0 |
-0 3 1 |
Index: petrecofmf/sumpedestals.dat |
=================================================================== |
--- petrecofmf/sumpedestals.dat (revision 113) |
+++ petrecofmf/sumpedestals.dat (nonexistent) |
@@ -1,4 +0,0 @@ |
-0 5413.22 |
-1 5264.29 |
-2 5394.42 |
-3 5261.11 |