Ignore:
Timestamp:
09/21/00 12:35:27 (24 years ago)
Author:
harald
Message:
Changed the format for root to store the raw data from the pixels.
This is the version that was discussed on the software meeting in
Goettingen.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/include-Classes/MRawPixel.cxx

    r371 r434  
    11#include <iostream.h>
    22
    3 #include "TClonesArray.h"
    43#include "TString.h"
    54#include "TRandom.h"
     
    2625// ---------
    2726//
    28 // UShort_t     PixelId     ;   
     27// Short_t     PixelId     ;   
    2928//
    3029// This is to identify the Pixel.
     
    3534// low-gain-branch of the Fadc´s only if there is a signal in. Then the
    3635// PixelId is:
    37 //                   PixelId = 10000 + PixelId   .
     36//                   PixelId = - PixelId   .
     37// if there is an entry in the low gain list.
    3838//
    39 // For the high gain Fadc values the rule is:
     39// Otherwise Fadc values the rule is:
    4040//                   PixelId = PixelId .
    4141//
     
    4343// ---------
    4444//
    45 // UChar_t      PixelStatus ;   
    46 //
    47 // The PixelStatus may contain information if the Pixel has triggered
    48 // this event. Also the kind of gain-branch (high or low) may be indicated
    49 // by one bit of the PixelStatus. etc
    50 //
    51 // ---------
    52 //
    53 // UChar_t      Fadc[ FADC_SLICES ]  ;
     45// Byte_t    FADCSamples[FADC_SLICES] ;
    5446//
    5547// The values of FADC_SLICES fadc-slices. This is the information of the
    5648// measured ADC values for one branch (high gain or low gain). The typ of
    5749// branch is indicated in the usPixelNumber and in the PixelStatus.
     50// In this first version the number of FADC_SLICES is going to be fixed
    5851
    5952ClassImp(MRawPixel)
     
    6659  //
    6760   
    68     PixelId     = 0 ;
    69     PixelStatus = 0 ;
    70    
    71     for (Int_t i = 0; i<FADC_SLICES; i++)
    72       Fadc[i]   = 0 ;
     61  PixelId     = 0 ;
     62
     63  for (Int_t i = 0; i<FADC_SLICES; i++)
     64    FADCSamples[i]   = 0 ;
     65
    7366}
    7467
    7568
    76 MRawPixel::MRawPixel(UShort_t PId) {
     69MRawPixel::MRawPixel(Short_t PId) {
    7770  //
    7871  //  constructor II  overloaded
     
    8174 
    8275  PixelId     = PId ;
    83   PixelStatus = 0 ;
    84  
    8576  for (Int_t i = 0; i<FADC_SLICES; i++)
    86     Fadc[i]   = 0 ;
     77     FADCSamples[i]   = 0 ;
     78
    8779}
    8880
    8981
    90 MRawPixel::MRawPixel(UShort_t usPId, UChar_t ucSt, UChar_t ucF[]) {
     82MRawPixel::MRawPixel(Short_t usPId, Byte_t ucF[]) {
    9183  //
    9284  // constructor III overloaded
    9385  //
    94   // parameters are PixelId, Status and an array with Fadc numbers.
     86  // parameters are PixelId and an array with Fadc values.
    9587 
    9688  PixelId     = usPId ;
    97   PixelStatus = ucSt  ;
    9889 
    99   for (Int_t i = 0; i<FADC_SLICES; i++)
    100     Fadc[i]   = ucF[i] ;
     90   for (Int_t i = 0; i<FADC_SLICES; i++)
     91    FADCSamples[i]   = ucF[i] ;
    10192}
     93
    10294MRawPixel::~MRawPixel(){
    10395  //
     
    111103  //
    112104  PixelId     = 0 ;
    113   PixelStatus = 0 ;
    114  
    115   for (Int_t i = 0; i<FADC_SLICES; i++)
    116     Fadc[i]   = 0 ;
     105
     106  for (Int_t i=0;i<FADC_SLICES; i++){
     107  FADCSamples[i] = 0;
     108  }
    117109}
    118 
    119110
    120111void MRawPixel::Print()
     
    125116
    126117  cout << endl << "PixId " << PixelId          ;
    127   cout << " Stat " << (Int_t) PixelStatus << " --> "     ;
    128118
    129119  for (Int_t i=0 ; i<FADC_SLICES ; i++ ) {
    130     cout<<" / " << (int) Fadc[i] ;
     120    cout<<" / " << FADCSamples[i];
    131121  }
    132122}
    133  
    134 UShort_t MRawPixel::GetPixelId() {
     123
     124void MRawPixel::FillPixel (Short_t usPId, Byte_t ucF[]){
     125  //
     126  //  Fills the event information
     127  //
     128
     129  PixelId= usPId;
     130
     131  for (Int_t i = 0; i<FADC_SLICES; i++){
     132    FADCSamples[i]= ucF[i];
     133  }
     134
     135}
     136
     137Short_t MRawPixel::GetPixelId() {
    135138  //
    136139  // returns back the PixelId of the Pixel
     
    139142}
    140143
    141 UChar_t MRawPixel::GetFadcSlice( Int_t iSli ) {
     144Byte_t MRawPixel::GetFadcSlice( Int_t iSli ) {
    142145  //
    143146  // returns back the fadc content of the slice iSli
    144147  //
    145   return ( Fadc[iSli] ) ;
     148
     149    return (FADCSamples[iSli]) ;
    146150}
    147 
    148 
    149 
    150 
    151 
    152 
Note: See TracChangeset for help on using the changeset viewer.