#include "LegsDB.h"

LegsDB


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

class LegsDB : public TNamed

Inheritance Chart:
TObject
<-
TNamed
<-
LegsDB
    private:
map<string,vector<float,allocator<float> >,less<string>,allocator<pair<const string,vector<float,allocator<float> > > > >::const_iterator GetIterator(string parName) void InitCalib() void InitRunNumberVector() void MakeTwobodyKinematics() public:
LegsDB() LegsDB(const LegsDB&) virtual ~LegsDB() static TClass* Class() Float_t GetAdcThresh(UChar_t det, UShort_t detIndex) const map<string,vector<Float_t> >* GetCalMap() const Float_t GetCalMapVector(string calName_COL, UInt_t index) Float_t GetCg3(UShort_t id, UChar_t pol, string type) Float_t GetCG3eff(UChar_t tagBin) Float_t GetCG4eff(UChar_t tagBin) Float_t GetEloss(UShort_t partName, const Float_t& theta, const Float_t& tkin, const Float_t& phi) UChar_t GetMappedOppositePolState() UChar_t GetMappedPolState() Float_t GetNbEgy(UShort_t id, UShort_t adc) Float_t GetNbEgyThresh(UShort_t id) Float_t GetNbTof(UShort_t id, UShort_t tdc) Float_t GetNvEgy(UShort_t id, UShort_t adc) Float_t GetNvEgyThresh(UShort_t id) UChar_t GetOppositeRegPolState() Float_t GetPbEgy(UShort_t id, UShort_t adc) Float_t GetPbEgyGamma(UShort_t id, UShort_t adc) Float_t GetPbEgyThresh(UShort_t id) Float_t GetPbStartTof() Float_t GetPbTagPeak(UShort_t id) Float_t GetPbTdcDispersion(UShort_t id) Float_t GetPbTof(UShort_t id, UShort_t tdc) Float_t GetPhotPol(UShort_t id, UChar_t pol) Float_t GetPnEgy(UShort_t id, UShort_t adc1, UShort_t adc2) Float_t GetPnEgy(UShort_t id, UShort_t adc1, UShort_t adc2, UShort_t tdc1, UShort_t tdc2) Float_t GetPnEgyThresh(UShort_t id) Float_t GetPnLtoEProt(const Float_t& lgt) Float_t GetPnTagPeak(UShort_t id) Float_t GetPnTagXCorr(UShort_t id, const Float_t& xpos) Float_t GetPnTof(UShort_t id, UShort_t tdc1, UShort_t tdc2) Float_t GetPnTof(UShort_t id, UShort_t tdc1, UShort_t tdc2, UShort_t adc1, UShort_t adc2) Float_t GetPnXpos(UShort_t id, UShort_t tdc1, UShort_t tdc2) Float_t GetPnXpos(UShort_t id, UShort_t tdc1, UShort_t tdc2, UShort_t adc1, UShort_t adc2) Float_t GetPnXposCosmicsCorrected(UShort_t id, const Float_t& oldX) Float_t GetPvEgy(UShort_t id, UShort_t adc1, UShort_t adc2) Float_t GetPvEgy(UShort_t id, UShort_t adc1, UShort_t adc2, UShort_t tdc1, UShort_t tdc2) Float_t GetPvEgyThresh(UShort_t id) Float_t GetPvTagPeak(UShort_t id) Float_t GetPvTagXCorr(UShort_t id, const Float_t& xpos) Float_t GetPvTof(UShort_t id, UShort_t tdc1, UShort_t tdc2) Float_t GetPvTof(UShort_t id, UShort_t tdc1, UShort_t tdc2, UShort_t adc1, UShort_t adc2) Float_t GetPvXpos(UShort_t id, UShort_t tdc1, UShort_t tdc2, UShort_t adc1, UShort_t adc2) UInt_t GetRunNumber(const UInt_t& runTime) Float_t GetSimNbEgyRes(UShort_t id) Float_t GetSimNvEgyRes(UShort_t id) Float_t GetSimPbEgyGamma(UShort_t id, const Float_t& lgt) Float_t GetSimPbEgyRes(UShort_t id) Float_t GetSimPbTofRes(UShort_t id) Float_t GetSimPfEgyRes(UShort_t id) Float_t GetSimPnEgyRes(UShort_t id) Float_t GetSimPnTofRes(UShort_t id) Float_t GetSimPnXposRes(UShort_t id) Float_t GetSimPvEgyRes(UShort_t id) Float_t GetSimPvTofRes(UShort_t id) Float_t GetSimPvXposRes(UShort_t id) Float_t GetSimXcEgyGamma(UShort_t id, const Float_t& lgt) Float_t GetSimXcEgyRes(UShort_t id) Float_t GetSimXcZposRes(UShort_t id) Float_t GetSimXtEgyGamma(UShort_t id, const Float_t& lgt) Float_t GetSimXtEgyRes(UShort_t id) Float_t GetSimXvEgyRes(UShort_t id) Float_t GetStartTof(UShort_t id, UShort_t tdc) Float_t GetTagEgy(UShort_t id) Float_t GetTagPeak(UChar_t det, UShort_t id) Float_t GetTagPosCorr(UChar_t det, UShort_t id, const Float_t& pos) Float_t GetTagTof(UShort_t id, UShort_t tdc) Float_t GetTagTof() Float_t GetTagTofDetGrpShift(UChar_t id) void GetTargetParas(Float_t& density, Float_t& length) void GetTargetPosition(Float_t& x, Float_t& y, Float_t& z) void GetTrueTagBin(Float_t& peak, Float_t& halfwidth) void GetTrueTagBinMonitor(Float_t& peak, Float_t& halfwidth) void GetTrueTagBinMonitorCG4(Float_t& peak, Float_t& halfwidth) CTwobody* GetTwobodyKinematics() Float_t GetXcEgy(UShort_t id, UShort_t adc1, UShort_t adc2) Float_t GetXcEgyGamma(UShort_t id, UShort_t adc1, UShort_t adc2) Float_t GetXcEgyThresh(UShort_t id) Float_t GetXcTagPeak(UShort_t id) Float_t GetXcTagZCorr(UShort_t id, const Float_t& zpos) Float_t GetXcZpos(UShort_t id, UShort_t adc1, UShort_t adc2) Float_t GetXtEgy(UShort_t id, UShort_t adc) Float_t GetXtEgyGamma(UShort_t id, UShort_t adc) Float_t GetXtEgyThresh(UShort_t id) const Float_t GetXtLtoEPion(const Float_t& lgt) const Float_t GetXtLtoEProt(const Float_t& lgt) Float_t GetXtPhiCorr(const Float_t& phi) Float_t GetXtTagPeak(UShort_t id) Float_t GetXtThetaCorr(const Float_t& theta) Float_t GetXtXposCorr(const Float_t& x) Float_t GetXtYposCorr(const Float_t& y) Float_t GetXtZposCorr(const Float_t& z) Float_t GetXvEgy(UShort_t id, UShort_t adc) Float_t GetXvEgy(UChar_t xvFace, UShort_t adc, const Float_t& z) Float_t GetXvEgy(const Float_t& origTheta, const Float_t& origPhi, UShort_t adc, UChar_t origFace) Float_t GetXvEgyThresh(UShort_t id) Float_t GetXvTagPeak(UShort_t id) void InitGeoPtr() static LegsDB* Instance() virtual TClass* IsA() const LegsDB& operator=(const LegsDB&) virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b) void UpdateCalib(const UInt_t& time, const string& parName)

Data Members

    private:
static LegsDB* fInstance LegsAccessorToolKit* fAccessorToolKit LegsRunHdrDB* fRunHdrDB LegsEloss* fProtonEloss LegsEloss* fPionEloss CTwobody* fTwobody TList* fMakerList UInt_t fRunHdrIndex string fCurrentTagEgyCalibrationFileName map<string,vector<UInt_t> > fCalTimeMap map<string,Int_t> fCalTimeIndexMap map<string,vector<Float_t> > fCalMap LegsGeo* fGeo

Class Description

 LegsDB Class deals with Geometry data base of SASY and
 calibration parameters IO, and actual calculations related to
 calibrations.  It's member functions are called when something
 needs to be calibrated.  It is not really independent class, it
 needs information from LegsRun for many reasons.  Pointer to this
 class is made global gDB.  Basically it is an archive of all
 sorts of calibration and geometry info about SASY, which updates
 itself "automatically".  Also the class deals with display of
 geometry and events graphically on screen.

LegsDB* Instance()

LegsDB() : TNamed("DB","Geometry and Calibrations dataBase")
 constructor of the class

void InitGeoPtr()

void InitCalib()
 initialize all vectors with calibration times from DB/calib.db
 the file needs to be updated manually every time new calibration is added with
 help of program UpdateCalibDB.cxx

Float_t GetXcZpos(const UShort_t id, UShort_t adc1, UShort_t adc2)
 get z-position of XC
 Zpos = p0 + p1*X + p2*X^2 + p3*X^3

Float_t GetPbTdcDispersion(UShort_t id)
 returns the TDC dispersion b of the PbG counters
      tof = a + b*tdc


Float_t GetPbTof(UShort_t id, UShort_t tdc)
 returns tof of the PbG counters
      tof = a + b*tdc


Float_t GetNbTof(UShort_t id, UShort_t tdc)
 returns tof for n-barrel

Float_t GetPnEgy(UShort_t id, UShort_t adc1,UShort_t adc2)
 returns light deposited in PN-bar according to the formula
      geomean = sqrt( g1*(adc1+ped1) * g2*(adc2+ped2) )
      egy = a + b*geomean + c*geomean*geomean


Float_t GetPnEgy(UShort_t id, UShort_t adc1, UShort_t adc2, UShort_t tdc1, UShort_t tdc2)
 returns light deposited in PN-bar according to the formula
      geomean = sqrt( g1*(adc1+ped1) * g2*(adc2+ped2) )
      egy = a + b*geomean + c*geomean*geomean

      in the full bars the light is corrected for a quadratic position dependence in x


Float_t GetPvEgy(UShort_t id, UShort_t adc1,UShort_t adc2)
 returns light deposited in PV-paddles according to the formula
      geomean = sqrt( g1*(adc1+ped1) * g2*(adc2+ped2) )
      egy = a + b*geomean + c*geomean*geomean


Float_t GetPvEgy(UShort_t id, UShort_t adc1, UShort_t adc2, UShort_t tdc1, UShort_t tdc2)
 returns light deposited in PV-paddles according to the formula
      geomean = sqrt( g1*(adc1+ped1) * g2*(adc2+ped2) )
      egy = a + b*geomean + c*geomean*geomean

      in the full bars the light is corrected for a quadratic position dependence in x


Float_t GetPbEgy(UShort_t id, UShort_t adc)
 returns light deposited in the PbG counters
       adcp = adc + ped
       egy  = a + b*adcp + c*adcp*adcp


Float_t GetPbEgyGamma(UShort_t id, UShort_t adc)

Float_t GetXtEgyGamma(UShort_t id, UShort_t adc)

Float_t GetXtEgy(UShort_t id, UShort_t adc)
 return egy of xt

Float_t GetNbEgy(UShort_t id, UShort_t adc)
 returns light deposited in the NB counters
       adcp = adc + ped
       egy  = a + b*adcp + c*adcp*adcp


Float_t GetNvEgy(UShort_t id, UShort_t adc)
 returns light deposited in the NV veto counters
       adcp = adc + ped
       egy  = a + b*adcp + c*adcp*adcp


Float_t GetSimXcEgyRes(UShort_t id)
 return resolution for PN XPOS

Float_t GetSimXvEgyRes(UShort_t id)
 return resolution for XV

Float_t GetSimNbEgyRes(UShort_t id)
 return resolution for XV

Float_t GetSimNvEgyRes(UShort_t id)
 return resolution for XV

Float_t GetSimPvTofRes(UShort_t id)
 return resolution for PV TOF

Float_t GetSimPnTofRes(UShort_t id)
 return resolution for PN TOF

Float_t GetSimXcZposRes(UShort_t id)
 return resolution for PN XPOS

Float_t GetSimPvXposRes(UShort_t id)
 return resolution for PV TOF

Float_t GetSimPnXposRes(UShort_t id)
 return resolution for PN XPOS

Float_t GetSimPbTofRes(UShort_t id)
 return resolution for PV TOF

Float_t GetXtThetaCorr(const Float_t& theta)
 return correction of polar angle in XT for charged particles

Float_t GetXtPhiCorr(const Float_t& phi)
 return correction of azimuthal angle in XT for charged particles

Float_t GetXtXposCorr(const Float_t& x)
 return a correction of the x-position in XT for charged particles

Float_t GetXtYposCorr(const Float_t& y)
 return a correction of the y-position in XT for charged particles

Float_t GetXtZposCorr(const Float_t& z)
 return a correction of the x-position in XT for charged particles

Float_t GetSimXtEgyRes(UShort_t id)
 return resolution for XV

Float_t GetSimPvEgyRes(UShort_t id)
 return resolution for XT

Float_t GetSimPnEgyRes(UShort_t id)
 return resolution for XT

Float_t GetSimPbEgyRes(UShort_t id)
 return resolution for XT

Float_t GetSimPfEgyRes(UShort_t id)
 return resolution for XT

Float_t GetXvEgyThresh(UShort_t id)
 return threshold for XT

Float_t GetPvEgyThresh(UShort_t id)
 return threshold for XT

Float_t GetPnEgyThresh(UShort_t id)
 return threshold for XT

Float_t GetPbEgyThresh(UShort_t id)
 return threshold for XT

Float_t GetXcEgyThresh(UShort_t id)
 return threshold for XT

Float_t GetXtEgyThresh(UShort_t id)
 return threshold for XT

Float_t GetNbEgyThresh(UShort_t id)
 return threshold for XT

Float_t GetNvEgyThresh(UShort_t id)
 return threshold for XT

const Float_t GetXtLtoEPion(const Float_t& lgt)
 return energy loss corrected for light non-linearities

Float_t GetXtLtoEProt(const Float_t& lgt)
 return correction of polar angle in XT for charged particles

Float_t GetPnLtoEProt(const Float_t& lgt)
 return correction of polar angle in XT for charged particles

Float_t GetSimXtEgyGamma(UShort_t id,const Float_t& lgt)
 return egy of MC simulated xt for gamma

Float_t GetSimPbEgyGamma(UShort_t id,const Float_t& lgt)
 return egy of MC simulated xt for gamma

Float_t GetSimXcEgyGamma(UShort_t id,const Float_t& lgt)
 return egy of MC simulated xc for gamma

Float_t GetXcEgyGamma(UShort_t id, UShort_t adc1, UShort_t adc2)

Float_t GetXcEgy(UShort_t id, UShort_t adc1, UShort_t adc2)
 return egy of xc

Float_t GetEloss(UShort_t partName, const Float_t& theta, const Float_t& tkin, const Float_t& phi)

Float_t GetPnTof(UShort_t id, UShort_t tdc1, UShort_t tdc2)
 returns tof for pn-bars

Float_t GetPnTof(UShort_t id, UShort_t tdc1, UShort_t tdc2, UShort_t adc1, UShort_t adc2)
 returns tof for pn-bars using egy walk correction ( good for data starting nov99)
      t1 = a1 * (tdc1 + b1) - slew1 / sqrt(adc1+ped1)
      t2 = a2 * (tdc2 + b2) - slew2 / sqrt(adc2+ped2)
      tof  = 0.5 * (t1 + t2)


Float_t GetXvEgy(UShort_t id, UShort_t adc)
 calculates energy based on face only. better use next one

Float_t GetXvEgy(const UChar_t xvFace, UShort_t adc,const Float_t& z)
  returns light deposited in the XV counters with correction to angle of incidence of particle.
  This light is corrected for the angle of the hit and for the attenuation along the counter.

Float_t GetXvEgy(const Float_t& origTheta,const Float_t& origPhi, UShort_t adc,const UChar_t origFace)
   //  returns light deposited in the XV counters with correction to angle of incidence of particle.
   //  This light is corrected for the angle of the hit and for the attenuation along the counter.

Float_t GetPnXpos(UShort_t id, UShort_t tdc1, UShort_t tdc2)
 returns xpos for pn-bars

Float_t GetPnXpos(UShort_t id, UShort_t tdc1, UShort_t tdc2, UShort_t adc1, UShort_t adc2)
 returns x-position for PN-bars
      t1 = a1 * (tdc1 + b1) - slew1 / sqrt(adc1+ped1)
      t2 = a2 * (tdc2 + b2) - slew2 / sqrt(adc2+ped2)
      x  = 0.5 * clgt1 * (t1 - t2)          for full bars, then clgt1 = clgt2
      x1 = 0.5 * clgt1 * (t1 - t2)          for half bar 1
      x2 = 0.5 * clgt2 * (t1 - t2)          for half bar 2


Float_t GetPnXposCosmicsCorrected(UShort_t id, const Float_t& oldX)
 returns cosmics corrected xpos for pn-bars

Float_t GetPvTof(UShort_t id, UShort_t tdc1, UShort_t tdc2)
 returns tof for pv-vetos

Float_t GetPvTof(UShort_t id, UShort_t tdc1, UShort_t tdc2, UShort_t adc1, UShort_t adc2)
 returns tof for PV-paddles using energy walk correction ( good for data starting nov99)
      t1 = a1 * (tdc1 + b1) - slew1 / sqrt(adc1+ped1)
      t2 = a2 * (tdc2 + b2) - slew2 / sqrt(adc2+ped2)
      tof  = 0.5 * (t1 + t2)


void UpdateCalib(const UInt_t& time,const string& parName )
 updates calibration vectors in fCalTimeMap map based on available
 calibration files the files must have certain format (specified
 below). When new files are added to the directory DB they must be
 scanned by program UpdateCalib ( available in directory
 programs), which creates list in calib.db. That list is used by
 LegsRun to determine when to stop and to read in next file. New
 calibration files will be available to LegRun only if they are in
 calib.db.

Float_t GetTagEgy(UShort_t id)
 return tagger egy
 parameter in brackets is tagger bin ID 1-64

Float_t GetTagTof()
 return tagger time

Float_t GetTagTofDetGrpShift(UChar_t id)

Float_t GetTagTof(UShort_t id, UShort_t tdc)
 return tagger time

Float_t GetPbStartTof()
 return trigger time of PbG

Float_t GetStartTof(UShort_t id, UShort_t tdc)
 return tagger time

Float_t GetTagPeak(UChar_t det, UShort_t id)
 return position of true tagger peak (single hits)

Float_t GetXvTagPeak(UShort_t id)
 return position of true tagger peak of XV (single hits)

Float_t GetXtTagPeak(UShort_t id)
 return position of true tagger peak of XT (single hits)

Float_t GetXcTagPeak(UShort_t id)
 return position of true tagger peak of XC (single hits)

Float_t GetPvTagPeak(UShort_t id)
 return position of true tagger peak of PV (single hits)

Float_t GetPnTagPeak(UShort_t id)
 return position of true tagger peak of PN (single hits)

Float_t GetPbTagPeak(UShort_t id)
 return position of true tagger peak of PB (single hits)

Float_t GetTagPosCorr(UChar_t det, UShort_t id, const Float_t& pos)
 return position correction of true tagger peak (single hits)

Float_t GetXcTagZCorr(UShort_t id, const Float_t& zpos)
 return position of true tagger peak of PN dependent on the X position of the hit

Float_t GetPnTagXCorr(UShort_t id, const Float_t& xpos)
 return position of true tagger peak of PN dependent on the X position of the hit

Float_t GetPvTagXCorr(UShort_t id, const Float_t& xpos)
 return position of true tagger peak of PV dependent on the X position of the hit

CTwobody* GetTwobodyKinematics()
 create twobody kinematics lookup tables if they don't exist yet
 for current egy calibration
 return pointer to CTwobody object containing valid lookup tables.

void MakeTwobodyKinematics()
 REcreate twobody kinematics lookup tables even if they exist
 for current egy calibration

UInt_t GetRunNumber(const UInt_t& runTime)
 determine run number from current time - lookup in table created earlier DB/runDB.dat
 asumption : valid run start and end time are available in file DB/runDB.dat in appropriate format.
 this file is created automatically when ntuples are created by ntuple creation program.

void GetTrueTagBin(Float_t& peak, Float_t& halfwidth)
 return minimum and maximum windo boundaries for true tag tdc,
 determined with help of LegMakerTrueTag maker.
 used by LegsRun::GetTrueTagBin()

void GetTrueTagBinMonitor(Float_t& peak, Float_t& halfwidth)
 return minimum and maximum windo boundaries for true tag tdc CG3, ev32

void GetTrueTagBinMonitorCG4(Float_t& peak, Float_t& halfwidth)
 return minimum and maximum window boundaries for true tag tdc CG4, ev32

void GetTargetParas(Float_t& density, Float_t& length)
 return density and length of the target, (Density in cm^3/mol ; Length in cm )
 used to evaluate the cross sections

void GetTargetPosition(Float_t& x, Float_t& y, Float_t& z)
 return x, y, and z position of the target in the REAL run, (x, y, z in cm)
 used to put the target in the correct position in respect to the detector reference frame.

Float_t GetCg3(UShort_t id, UChar_t pol, string type)
 return flux (Cg3) per tag channel id and polarization state pol

Float_t GetCG3eff(UChar_t tagBin)

Float_t GetCG4eff(UChar_t tagBin)

UChar_t GetMappedPolState()
   return mapped pol state
 0  not polarized Brems
 1  linear 0
 2  linear 90
 3  linear -45
 4  linear 45
 5  left circular
 6  right circular

UChar_t GetMappedOppositePolState()
   return mapped pol state oppposite to current mapped polarization state

UChar_t GetOppositeRegPolState()
   return hardware pol state oppposite to current hardware polarization state

Float_t GetPhotPol(UShort_t id, UChar_t pol)
 parameters tagBin,  reg_pol
 return beam polarization

Float_t GetPvXpos(UShort_t id, UShort_t tdc1, UShort_t tdc2, UShort_t adc1, UShort_t adc2)
 returns x-position for PV-paddles
      t1 = a1 * (tdc1 + b1) - slew1 / sqrt(adc1+ped1)
      t2 = a2 * (tdc2 + b2) - slew2 / sqrt(adc2+ped2)
      x  = 0.5 * clgt1 * (t1 - t2)          , since here clgt1 = clgt2


Float_t GetCalMapVector(string calName_COL, UInt_t index)

Float_t GetAdcThresh(UChar_t det, UShort_t detIndex)
 return threshold for detector with index "detIndex" in detector  group "det"

mapIter GetIterator(string parName)



Inline Functions


                                       void ~LegsDB()
                                       void InitRunNumberVector()
        const map<string,vector<Float_t> >* GetCalMap() const
                                    TClass* Class()
                                    TClass* IsA() const
                                       void ShowMembers(TMemberInspector& insp, char* parent)
                                       void Streamer(TBuffer& b)
                                       void StreamerNVirtual(TBuffer& b)
                                     LegsDB LegsDB(const LegsDB&)
                                    LegsDB& operator=(const LegsDB&)


Last update: Wed May 18 13:32:05 2005


ROOT page - Home 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.