cheetah/include/cheetahEvent.h

Go to the documentation of this file.
00001 /*
00002  *  cheetahEvent.h
00003  *  cheetah
00004  *
00005  *  Created by Anton Barty on 6/2/11.
00006  *  Copyright 2011 CFEL. All rights reserved.
00007  *
00008  */
00009 
00010 
00011 #include <stdarg.h>
00012 #include <vector>
00013 #include "cheetah/peakfinders.h"
00014 
00015 
00016 #ifndef CHEETAHEVENT_H
00017 #define CHEETAHEVENT_H
00018 
00019 // Need to announce this is included from elsewhere
00020 //typedef tPeakList;
00021 
00022 
00023 /*
00024  *      Structure used for passing information to worker threads
00025  */
00026 class cEventData {
00027         
00028 public:
00029         // Reference to common global structure
00030         cGlobal         *pGlobal;
00031         int                     busy;
00032         long            threadNum;
00033         long        frameNumber;
00034         long        frameNumberIncludingSkipped;
00035         long        frameNum;
00036         uint stackSlice;
00037         bool writeFlag;
00038         
00039         // Detector data
00040         cPixelDetectorEvent             detector[MAX_DETECTORS];
00041 
00042         // Misc. EPICS data
00043         float       epicsPvFloatValues[MAX_EPICS_PVS];
00044         
00045         // TOF Detector data
00046         cTOFDetectorEvent               tofDetector[MAX_TOF_DETECTORS];
00047         int                     TOFPresent;
00048         
00049         // Pulnix 120Hz visible camera
00050         int                             pulnixFail;
00051         int                             pulnixWidth, pulnixHeight;
00052         unsigned short  *pulnixImage;
00053         
00054         // Opal2k energy spectrum camera
00055         int             specFail;
00056         int             specWidth, specHeight;
00057         unsigned short  *specImage;
00058         
00059         // energy spectrum data (2D camera downstream)
00060         int             energySpectrumExist;
00061         double          *energySpectrum1D;
00062 
00063         // FEE energy spectrum data
00064         int                             FEEspec_present;
00065         uint32_t                *FEEspec_hproj;
00066         uint32_t                *FEEspec_vproj;
00067         long                    FEEspec_hproj_size;
00068         long                    FEEspec_vproj_size;
00069         
00070         
00071 
00072         // Hit finding
00073         int                     hit;
00074         int                     powderClass;
00075         
00076         
00077     // Tof hitfinding
00078     int            nProtons;
00079     
00080         // Peak list
00081         tPeakList       peaklist;
00082         
00083         
00084         // Peak info
00085         int             nPeaks;
00086         int             nHot;
00087         float           peakResolution;                 // Radius of 80% of peaks
00088         float           peakResolutionA;                        // Radius of 80% of peaks
00089         float           peakDensity;                    // Density of peaks within this 80% figure
00090         float           peakNpix;                               // Number of pixels in peaks
00091         float           peakTotal;                              // Total integrated intensity in peaks
00092         //int                   *good_peaks;           // Good peaks, after post peak-finding criteria
00093         
00094         
00095         // Beamline data, etc
00096         int                     seconds;
00097         int                     nanoSeconds;
00098         unsigned        fiducial;
00099         char            timeString[1024];
00100         char            eventname[1024];
00101         char            eventStamp[1024];
00102         char            eventSubdir[1024];
00103 
00104         bool            beamOn;
00105         unsigned        runNumber;
00106 
00107         double          photonEnergyeV;         // in eV
00108         double          wavelengthA;            // in Angstrom
00109         
00110         double      gmd;
00111         double      gmd1;
00112         double      gmd2;
00113         double          gmd11;
00114         double          gmd12;
00115         double          gmd21;
00116         double          gmd22;
00117     
00118         int         pumpLaserOn;
00119         int         pumpLaserCode;
00120         double      pumpLaserDelay;
00121         
00122         // Position of the sample stage
00123         double      samplePos[3]; // in um
00124 
00125         // Electrojet voltage
00126         double      sampleVoltage[1]; // in Volt
00127 
00128         double          fEbeamCharge;           // in nC
00129         double          fEbeamL3Energy;         // in MeV
00130         double          fEbeamLTUPosX;          // in mm
00131         double          fEbeamLTUPosY;          // in mm
00132         double          fEbeamLTUAngX;          // in mrad
00133         double          fEbeamLTUAngY;          // in mrad
00134         double          fEbeamPkCurrBC2;        // in Amps
00135         
00136         double          phaseCavityTime1;
00137         double          phaseCavityTime2;
00138         double          phaseCavityCharge1;
00139         double          phaseCavityCharge2;
00140         
00141         // Thread management
00142         int     threadID;
00143         int     useThreads;
00144         
00145 } ;
00146 
00147 #define ERROR(...) cheetahError(__FILE__, __LINE__, __VA_ARGS__)
00148 
00149 #define DEBUGL1_ONLY if(global->debugLevel >= 1)
00150 #define DEBUGL2_ONLY if(global->debugLevel >= 2)
00151 
00152 #define DEBUG1(...) if(global->debugLevel >= 1) cheetahDebug(__FILE__, __LINE__, __VA_ARGS__)
00153 #define DEBUG2(...) if(global->debugLevel >= 2) cheetahDebug(__FILE__, __LINE__, __VA_ARGS__)
00154 #define DEBUG3(...) if(global->debugLevel >= 3) cheetahDebug(__FILE__, __LINE__, __VA_ARGS__)
00155 
00156 #define DEBUG(...) cheetahDebug(__FILE__, __LINE__, __VA_ARGS__)
00157 
00158 void cheetahError(const char *filename, int line, const char *format, ...);
00159 void cheetahDebug(const char *filename, int line, const char *format, ...);
00160 
00161 #define STATUS(...) fprintf(stderr, __VA_ARGS__)
00162 #define INFO(...) fprintf(stdout, __VA_ARGS__)
00163 
00164 #endif
00165 

Generated on 19 Dec 2016 for PSDMSoftware by  doxygen 1.4.7