Changeset 14725


Ignore:
Timestamp:
12/05/12 09:45:15 (12 years ago)
Author:
Jens Buss
Message:
added doxygen comments
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/marsmacros/mc2csv/MonteCarlo.h

    r14657 r14725  
    22#define MONTECARLO_H
    33
    4 /**  A one line description of the class.
     4/*! \class MonteCarlo
     5 * \brief Monte Carlo class to handle MC-Data from mars-root-file produced with ceres.
    56 *
    6  * #include "XX.h" <BR>
     7 * #include "MonteCarlo.h" <BR>
    78 * -llib
    89 *
    9  * A longer description.
     10 * Class can be used in Mars to load Monte Carlo data from a root-file
     11 * containing Mars classes that where produced by CERES
    1012 *
    1113 * @see something
     
    6466using namespace TMath;
    6567
    66 struct pixel_t
     68struct pixel_t          //struct gathering information of a camera pixel
    6769{
    68     int                 SoftId;
    69 //    int                 ChId;
    70     unsigned short*     rawData;
    71     float               pedestal;
     70    int                 SoftId;         //Mars Software ID of Pixel
     71//    int                 ChId;         //continous Hardware ID of Pixel
     72    unsigned short*     rawData;        //array with raw data of slices* amplitudes
     73    float               pedestal;       //amplitude of baseline
    7274};
    7375
     
    7981    /** Default constructor.
    8082    */
    81     MonteCarlo();
    82     MonteCarlo(TString filename);
    83     MonteCarlo(TString filename, TString evtsTreeName);
    84     MonteCarlo(TString filename, TString evtsTreeName, TString headerTreeName);
     83    MonteCarlo();                       // Default constructor
     84    /*! constructor
     85     * \param filename name of mc data file that will to load
     86    */
     87    MonteCarlo( TString filename);      // name of mc data file will to load
     88    /*! constructor
     89     * \param filename name of mc data file that will to load
     90     * \param evtsTreeName name of tree containg events
     91    */
     92    MonteCarlo( TString filename,       // name of mc data file will to load
     93                TString evtsTreeName);  // name of tree containg events
     94    /*! constructor
     95     * \param filename name of mc data file that will to load
     96     * \param evtsTreeName name of tree containg events
     97     * \param headerTreeName name of tree containg run meta data
     98    */
     99    MonteCarlo( TString filename,       // name of mc data file will to load
     100                TString evtsTreeName,   // name of tree containg events
     101                TString headerTreeName);// name of tree containg meta data
    85102
    86103
     
    108125
    109126// OPERATIONS
     127private:
     128    /*! Initiate all pointer Variables to NULL*/
    110129    void InitVariables();
    111130
     131public:
     132    /*! Write Monte Carlo Data into a Csv-file WriteMc2Csv(filename)
     133     * \param filename The Filename of the CSV File to which data will be written
     134    */
    112135    void WriteMc2Csv(TString filename );
     136
     137    /*! write pixels' raw data for a given pixel into the given csv file
     138     * \param pixelID Software ID of pixel
     139     */
    113140    void WritePixelData2Csv(int pixelID);
     141
     142    /*! loop over all pixels and call WritePixelData2Csv
     143     */
    114144    void WriteEventData2Csv();
     145
     146    /*! write table headings for coulums with pixels' raw data
     147     */
    115148    void WriteEventDataInfo2Csv();
     149
     150    /*! write table headings for coulums with event meta information
     151     */
    116152    void WriteEventHeaderInfo2Csv();
     153
     154    /*! write meta information of current event to csv
     155     */
    117156    void WriteEventHeader2Csv();
     157
     158    /*! write table headings for coulums with run meta information
     159     */
    118160    void WriteRunHeaderInfo2Csv();
     161
     162    /*! write meta information of current run to csv
     163     */
    119164    void WriteRunHeader2Csv();
     165
     166    /*! write the header of the csv file containing brief info about the converted mc file
     167     */
    120168    void WriteFileInfo2Csv();
     169
     170    /*! write table headings for coulums with pixels' pedestal amplitude
     171     */
    121172    void WritePedestal2Csv();
     173
     174    /*! write table headings for coulums with pixels' pedestal amplitude
     175     */
    122176    void WritePedestalInfo2Csv();
    123177
    124178
    125179// ACCESS
     180    /*! set the verbosity level for verbosity cout on cmd-line
     181     * \param verbLvl Votrbosity Level
     182     */
    126183    void SetVerbosityLevel(int verbLvl);
     184
     185    /*! Get the verbosity level for verbosity cout on cmd-line
     186     */
    127187    int  GetVerbosityLevel();
    128188
     189    /*! Open the mars-root-file produced with ceres
     190     */
    129191    void OpenRootFile();
     192
     193    /*!  Close the mars-root-file produced with ceres
     194     */
    130195    void CloseRootFile();
    131196
     197    /*! Open csv-file to which data will be written
     198     * \param fileName Filename of the csv-file e.g. "mc20120605.csv"
     199     */
    132200    void OpenCsvFile(   TString fileName);
     201
     202    /*! Close csv-file to which data was be written
     203     */
    133204    void CloseCsvFile();
    134205
     206    /*! set according pointers to tree containing event information and its branches
     207     * \param treeName Name of TTree containing event information
     208     */
    135209    void LoadEventTree( TString treeName);
     210
     211    /*! set according pointers to tree containing run information and its branches
     212     * \param treeName Name of TTree containing run information
     213     */
    136214    void LoadHeaderTree(TString treeName);
    137215
     216    /*! set values of members  to according leafs in TTree for run meta data
     217     */
    138218    void ReadRunHeader();
     219
     220    /*! set values of members  to according leafs in TTree for event raw data
     221     */
    139222    void ReadEventRawData();
     223
     224    /*! set values of members  to according leafs in TTree for event meta data
     225     */
    140226    void ReadEventMetaData();
     227
     228    /*! call ReadEventRawData() and ReadEventMetaData() for given event
     229     * \param Event Event ID to read data
     230     */
    141231    void ReadEvent(int Event);
    142232
    143233// INQUIRY
    144234private:
     235    /*! Verbostiy Level */
    145236    int                 mVerbosityLvl;
     237    /*! Whether the rootfile is open */
    146238    bool                mRootFileOpend;
    147239
     240    /*! filename of output csv file */
    148241    TString             mCsvFileName;
     242    /*! steam into csv output file */
    149243    ofstream            mCsv;
     244    /*! filename of input root file */
    150245    TString             mFileName;
     246    /*! pointer to input root file */
    151247    TFile*              mpRootFile;
     248    /*! Array for pixels' raw data */
    152249    pixel_t*            mpPixel;
    153250
     251    /*! pointer to event tree */
    154252    TTree*              mpEventTree;
     253    /*! pointer to run header tree */
    155254    TTree*              mpHeaderTree;
    156255
    157     //header data types
     256    //run header tree branches
     257    /*! mars class pointer to branch with same name in TTree */
    158258    MParameterD*        mpIntendedPulsePos;
     259    /*! mars class pointer to branch with same name in TTree */
    159260    MMcRunHeader*       mpMcRunHeader;
     261    /*! mars class pointer to branch with same name in TTree */
    160262    MGeomCamFACT*       mpGeomCam;
     263    /*! mars class pointer to branch with same name in TTree */
    161264    MRawRunHeader*      mpRawRunHeader;
     265    /*! mars class pointer to branch with same name in TTree */
    162266    MCorsikaRunHeader*  mpCorsikaRunHeader;
    163267
    164     //Evt data types
     268    //Event tree branches
     269    /*! mars class pointer to branch with same name in TTree */
    165270    MPedestalCam*       mpElectronicNoise;
     271    /*! mars class pointer to branch with same name in TTree */
    166272    MRawEvtData*        mpRawEventData;
     273    /*! mars class pointer to branch with same name in TTree */
    167274    MParameterD*        mpIncidentAngle;
     275    /*! mars class pointer to branch "MMcEvt" in TTree */
    168276    MMcEvt*             mpMcEventMetaData;
     277    /*! mars class pointer to branch with same name in TTree */
    169278    MRawEvtHeader*      mpRawEventHeader;
     279    /*! mars class pointer to branch with same name in TTree */
    170280    MCorsikaEvtHeader*  mpCorsikaEvtHeader;
    171281
    172     unsigned short *    mpSamples;          // array with MC events raw data
     282//    /*! array with MC events raw data */
     283//    unsigned short *    mpSamples;          // array with MC events raw data
     284    /*! coulumn seperator in csv file */
    173285    TString             mSeparator;
    174286
    175287    //Run Meta Data
     288    /*! number of entries(events) in event tree  */
    176289    int                 mNumberOfEntries;
     290    /*! number of events in file NOT WORKING WITH CURRENT CERES VERSION */
    177291    int                 mNumberOfEvents;
     292    /*! position (slice) of simulated cherenkov pulse in pixel */
    178293    float               mIntendedPulsePos;
    179     float               mPedestalOffset;
     294    /*! number of showers simulated by corsika*/
    180295    int                 mNumSimulatedShowers;
     296    /*! total number of simulated camera pixels */
    181297    int                 mNumberOfPixels;
     298    /*! ??? */
    182299    int                 mNumberOfSectors;
     300    /*! ??? */
    183301    int                 mNumberOfAreas;
     302    /*! number of Samples (slices) -> simulated Region of interest */
    184303    float               mNumberOfSamples;
     304    /*! simulated sampling frequency  */
    185305    float               mSamplingFrequency;
     306    /*! ??? */
    186307    int                 mNumberOfEventsRead;
     308    /*! ??? */
    187309    float               mCamDist;
     310    /*! name of simulated source */
    188311    const char*         mSourceName;
     312    /*! slope of simulated spectrum */
    189313    float               mSlopeSpectrum;
     314    /*! minimum of simulated spectrum  */
    190315    float               mEnergyMin;
     316    /*! maximum of simulated spectrum */
    191317    float               mEnergyMax;
     318    /*! minimum Zenidth of simulated showers */
    192319    float               mZdMin;
     320    /*! maximum Zenidth of simulated showers */
    193321    float               mZdMax;
     322    /*! minimum Azimuth of simulated showers */
    194323    float               mAzMin;
     324    /*! maximum Azimuth of simulated showers */
    195325    float               mAzMax;
     326    /*! file number from raw run header */
    196327    unsigned int        mFileNumber;
     328    /*! corsika run number */
    197329    int                 mRunNumber;
     330    /*! runtype: e.g. Pedestal, data, calibration run,... */
    198331    int                 mRunType;
     332    /*! number of bytes per sample */
    199333    int                 mNumberOfBytes;
    200334
    201335    //Event Meta Data
     336    /*! Incident Angle */
    202337    float               mIncidentAngle;
     338    /*! id of primary particle of shower */
    203339    int                 mPartId;
     340    /*! energy of primary particle of shower */
    204341    float               mEnergy;
     342    /*! impact parameter of primary particle of shower  */
    205343    float               mImpact;
     344    /*! Telescope Phi of shower */
    206345    float               mTelescopePhi;
     346    /*! Telescope Theta of shower */
    207347    float               mTelescopeTheta;
     348    /*! Phi of shower */
    208349    float               mPhi;
     350    /*! Theta of shower */
    209351    float               mTheta;
     352    /*! name of primary particle of shower */
    210353    TString             mPartName;
     354    /*! symbol of primary particle of shower */
    211355    TString             mPartSymbol;
     356    /*! corsika event number */
    212357    unsigned int        mCorsikaEventNumber;
     358    /*! Passed qe, coming from the shower */
    213359    unsigned int        mPhotElFromShower;
     360    /*! usPhotElfromShower + mean of phe from NSB */
    214361    unsigned int        mPhotElinCamera;
     362    /*! Number running from 0 to N-1, being N the number
     363     * of times a Corsika event has been reused, by
     364     * orienting the telescope in different ways or by
     365     * setting it at a different location on the ground. */
    215366    int                 mEvtReuse;
     367    /*! Number of Events from DAQ */
    216368    int                 mEventNumber;
     369    /*! Number of 1st level tiggers between 2 events Used in MSimTrigger for the index of the trigger channel */
    217370    float               mNumTriggerLvl1;
     371    /*! Number of 2nd level tiggers between 2 events */
    218372    float               mNumTriggerLvl2;
     373    /*! [cm] z coordinate, first intercation height */
    219374    float               mFirstInteractionHeight;
     375    /*! [GeV/c] "+west"    "-east" */
    220376    float               mMomentumX;
     377    /*! [GeV/c] "+south"   "-north"
     378     * (north denotes the magnet north which is defined to be in the geografic north!)
     379     */
    221380    float               mMomentumY;
     381    /*! [GeV/c] "+upwards" "-downwards" */
    222382    float               mMomentumZ;
     383    /*! [rad] Zenith distance */
    223384    float               mZd;
     385    /*! [rad] Azimuth (north=0; east=90)
     386     * (north denotes the magnet north which is defined to be in the geografic north!)
     387    */
    224388    float               mAz;
     389    /*! [cm] Position of telescope on ground x / - impact parameter x */
    225390    float               mX;
     391    /*! [cm] Position of telescope on gorund y / - impact parameter y */
    226392    float               mY;
     393    /*! weighted number of photons arriving at observation level */
    227394//    int                 mWeightedNumPhotons;
    228395
Note: See TracChangeset for help on using the changeset viewer.