#include "hmdcoffsetchecktimeshift.h"

HMdcOffsetCheckTimeShift


class description - source file - inheritance tree (.pdf)

class HMdcOffsetCheckTimeShift : public HReconstructor

Inheritance Chart:
TObject
<-
TNamed
<-
HTask
<-
HReconstructor
<-
HMdcOffsetCheckTimeShift

    protected:
void createHist(TFile*, Int_t, Int_t, Int_t, Int_t) void deleteHist() void fillHist(Int_t, Int_t, Int_t, Int_t) Int_t fitHist(Int_t, Int_t, Int_t, Int_t) Float_t getstarttime() Bool_t isNaN(float f) TDirectory* Mkdir(TDirectory*, Char_t*, Int_t, Int_t p = 1) ofstream* openAsciiFile() void setDefault() void writeAscii(ofstream&, Int_t, Int_t, Int_t, Int_t) void writeHist(TFile*) public:
HMdcOffsetCheckTimeShift() HMdcOffsetCheckTimeShift(Text_t* name, Text_t* title) ~HMdcOffsetCheckTimeShift() static TClass* Class() virtual Int_t execute() virtual Bool_t finalize() virtual Bool_t init() virtual TClass* IsA() const virtual Bool_t reinit() void setNoise(Int_t o, Int_t w) void setNoiseOffset(Int_t i) void setNoiseWidth(Int_t i) void setNoStart() void setNumberOfEvents(Int_t i) void setOutputAscii(Char_t*) void setOutputRoot(Char_t*) void setPulserFile() void setRangeGauss(Int_t i) void setStepSize(Int_t i) void setThreshold(Float_t min, Float_t max) void setThresholdMax(Float_t f) void setThresholdMin(Float_t f) void setTimeCut(Bool_t cut) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members


    protected:
static const Int_t nbin Number of bins ih the histogramms static const Int_t nbinm1 nbin - 1 static const Int_t nbinp1 nbin + 1 static const Int_t nSubEvents The max. number of objects per event HCategory* rawCat pointer to the raw data HCategory* calStartCat ! pointer to the cal data HIterator* iter iterator on raw data HIterator* iter_start ! iterator on start cal data. HMdcCalParRaw* calparraw pointer to HMdcCalParRaw container HMdcTimeCut* timecut pointer to HMdcTimeCut container HMdcLookupGeom* lookupgeom pointer to HMdcLookupGeom container Int_t eventcounter counts number of calculated events of all files Int_t filecounter counts the number of files Int_t skipcount counts the number of events Int_t numberofevents counts the number of events which are collected in each step Int_t step counts the number of step of stepsize in same file Int_t stepsize number of events between the hists in same file Bool_t isPulserFile flag for a external calibration file (pulser) Bool_t noStart flag if starttime should not be used Bool_t useTimeCut flag if time cuts should be perormed. Char_t filenames[50][200] Array to store the names of the anaylyzed files Char_t* fNameAsciiOffset file name of ascii output file Char_t* fNameRootOffset file name of root output file Float_t minfitthreshold minimum threshold for linear fit (y-range) Float_t maxfitthreshold maximum threshold for linear fit (y-range) Int_t offsetfitNoise offset of the fit range for the subtraction of the noise (start at yequalzero going to the left) Int_t widthfitNoise width of the fit range Int_t rangeGauss fit range of the gaussian fit around calculated offset int* hreverse[6][4][20][50][2048] array for the drift-time (Time1) to be filled in eventloop int* hintegral[6][4][20][50][2048] array for the integrated drift-time TH1F* hinv drift-time histograms to hold collected data TH1F* hint integrated drift-time histograms float yequalzero intersection point of the first fit and the x-axis float crosspointX x-value of the intersection point of the two linear fits->offset float fitpar0 first fit parameter of the first linear fit float fitpar0error error of the first fit parameter of the first linear fit float fitpar1 second fit parameter of the first linear fit float fitpar1error error of the second fit parameter of the first linear fit float fitparNoise0 first fit parameter of the second linear fit float fitparNoise0error error of the first fit parameter of the second linear fit float fitparNoise1 second fit parameter of the second linear fit float fitparNoise1error error of the second fit parameter of the second linear fit float totalsigma sigma of the offset calculated from the sigmas of the two linear fits float fitGaussMean mean of the gaussian fit float fitGaussSigma sigma of the gaussian fit

Class Description


 HMdcOffsetCheckTimeShift

 Defines the offset  parameter for MDC calibration. Uses HMdcCalParRaw container
 as  input/output for calibration data



HMdcOffsetCheckTimeShift(void)

HMdcOffsetCheckTimeShift(Text_t* name,Text_t* title) : HReconstructor(name,title)

~HMdcOffsetCheckTimeShift(void)
 Destructor.

void setDefault()
 Sets the the default values for the fits.

void setOutputAscii(Char_t *c)
 Sets ascii output of HMdcOffsetCheckTimeShift for debugging output.

void setOutputRoot(Char_t *c)
 Sets rootfile output of HMdcOffsetCheckTimeShift where all created histograms were written.


Bool_t init(void)
  Inits HMdcOffsetCheckTimeShift and the needed HMdcCalParRaw, if this container does not exists

Bool_t reinit(void)
  Inits HMdcOffsetCheckTimeShift and the needed HMdcCalParRaw, if this container does not exists

void createHist(TFile* file,Int_t s, Int_t m, Int_t step,Int_t f)
 Histograms for inverted Time1 and integrated Time1 per Tdc-Channel are created
 in a subdirectory structure.

void deleteHist()
 Created histograms are deleted

void fillHist(Int_t s, Int_t m, Int_t step,Int_t f)
 Histograms for inverted Time1 and integrated Time1 per Tdc-Channel are filled

Int_t fitHist(Int_t s, Int_t m, Int_t step,Int_t file)
 The offset is calculated from two linear fits. Some pictures of the fitted histograms
 can be found on 
MDC calibration page
 .
 The first linear fit (red) is done to find the rising edge of the integrated spectra.
 The second linear fit (blue) is done to substract the noise.
 The ranges for both fits can be set through the functions setNoise()(x-range) for the
 second fit (default values: 100,50) and setThreshold()(y-range) for the first fit
 (default values :0.15,0.50). The y-range is calculated by the percentage of the maximum
 height of the spectra.
 The offset ist calculated from the intersection point of both linear fits.
 The sigma of the offset is calculated from the sigmas of the two linear fits.

 If the analyzed file is a pulser file for external calibration a gaussian fit is done.
 To set this fit the function setPulserFile() has to be used in the macro. The range of
 the fit is set through the function setRangeGauss()(default value: 50) around the calculated
 offset.The mean and sigma of the fit is written to the ascii debugging output.

void writeAscii(ofstream &fout, Int_t s, Int_t m, Int_t step,Int_t f)
 The adresses of the channel(sector,module,mbo,tdc),offset, two fitparameters for the
 two linear fits, the sigma of the offset ,offset and the integral(number of entries for this channel)
 are written to the ascii debugging output.In the case of an pulser file (external calibration)
 the mean and the sigma of the gaussian fit are also written to the output.

void writeHist(TFile* file)
 All created histograms are written to a rootfile.The file is structured for sector,module,mbo.

ofstream* openAsciiFile()
 Opens the ascii debugging output and writes the headerline.

Bool_t finalize(void)
 This function is called after the execute function is finished. At this point
 the arrays for the drift-time are filled. Froms this arrays the histograms for
 the drift-time and the integrated drift-time are filled. The fits for the calcutation
 of the offsets are done and the offsets and the sigma of the offsets are
 calculated .All histograms are written to a rootfile output and the information
 of the fits to an ascii debugging output. The offset and the sigma of the offset
 are filled into the container (HMdcCalParRaw) for the calibration parameters.
 To characterize the method of calculation of the offsets the function setOffsetMethod()
 of HMdcCalParRaw is used. As default value for the method 2 is used for  automatic
 calibration. If no calibration is done this value is set to 0.

TDirectory* Mkdir(TDirectory *dirOld, Char_t *c, Int_t i, Int_t p) //! Makes new Dir, changes to Dir, returns pointer to new Dir
 Function to create subdirectories

Float_t getstarttime()

Int_t execute()
 Raw data of Time1  multiplied by the slope of the channel taken from the
 container of the calibration parameters are filled into the array for the
 drift-time . This array contains 2048 (corresponding to the resulution of
 the tdc chip) entries for each tdc channel.



Inline Functions


               void setPulserFile()
               void setNoStart()
               void setTimeCut(Bool_t cut)
               void setStepSize(Int_t i)
               void setNumberOfEvents(Int_t i)
               void setNoiseOffset(Int_t i)
               void setNoiseWidth(Int_t i)
               void setThresholdMin(Float_t f)
               void setThresholdMax(Float_t f)
               void setNoise(Int_t o, Int_t w)
               void setThreshold(Float_t min, Float_t max)
               void setRangeGauss(Int_t i)
             Bool_t isNaN(float f)
            TClass* Class()
            TClass* IsA() const
               void ShowMembers(TMemberInspector& insp, char* parent)
               void Streamer(TBuffer& b)
               void StreamerNVirtual(TBuffer& b)


Last update: Fri Jan 26 12:13:13 2007


ROOT page - Class index - Class Hierarchy - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.