Back to index

See source file

CSidcSetup.h

 
//----------------------------------------------------------------------------- 
//  $Header: /asis/offline/ceres/cool/project/RCS/CSidcSetup.h,v 3.15 1997/07/16 11:27:57 messer Exp $ 
// 
//  COOL Program Library 
//  Copyright (C) CERES collaboration, 1996 
// 
//  Declarations of CSidcSetup class. 
// 
//----------------------------------------------------------------------------- 
#ifndef CSIDCSETUP_H 
#define CSIDCSETUP_H 
 
#include "cool.h" 
#include "CDetectorSetup.h" 
 
class CSidcSetup : public CDetectorSetup { 
public:    
   enum CWaferType { noWaferType, threeInch, fourInch }; 
    
   CSidcSetup(); 
    
public: 
   void read(const char*); 
   void list(ostream& ost = cout); 
   void _read(const char*); 
   void _list(ostream& ost = cout); 
    
public: 
   int getWaferType() const { return waferType; } 
   int getNAnodes() const { return nAnodes; } 
   int getNTimeBins() const { return nTimeBins; } 
   int getNNim() const { return nNim; } 
   int getFirstCrate() const { return firstCrate; } 
    
   CString getCalibrationFileName() const { return calibrationFileName; } 
   CString getDrCorrectionFileName() const { return drCorrectionFileName; } 
    
   double getMaxRadius() const { return maxRadius; } 
   double getMinRadius() const { return minRadius; } 
   double getMaxTimeBinReference() const { return maxTimeBinReference; } 
   double getMinTimeBin() const { return minTimeBin; } 
   double getMaxTimeBin() const; 
   double getDriftVelocity() const { return driftVelocity; } 
   double getDriftVelocityReference() const { return driftVelocityReference; } 
    
   double getPhiOffset() const { return phiOffset; } 
   double getZPosition() const { return zPosition; } 
   double getMinCellAmplitude() const { return minCellAmplitude; } 
   double getTimeOffsetBTDC() const { return timeOffsetBTDC; } 
   double getStopPulseThreshold() const { return stopPulseThreshold; } 
   CBoolean getIsFlipped() const { return isFlipped; } 
    
   double getSinglePulseSigma(int i) 
   { 
      if ( i < 0 || i > 1 ) 
         return 0.; 
      else   
	 return singlePulseSigma[i]; 
   } 
   double getMaxDeviationForSinglePulse() const { return maxDeviationForSinglePulse; } 
   double getSaturationAmplitude() const { return saturationAmplitude; } 
    
   double getTimeWindowForHit() const { return timeWindowForHit; } 
   int getAnodeWindowForHit() const { return anodeWindowForHit; } 
   int getMinTimeBinsForHit() const { return minTimeBinsForHit; } 
   int getNumberOfDeadFadcChannel() const { return numberOfDeadFADC; } 
   double getAnodePhiOffset() const { return anodePhiOffset; } 
   double getDiffusionConstants(int i) const 
   { 
      if ( i < 0 || i > 1 ) 
         return 0.; 
      else   
	 return diffusionConstants[i]; 
   } 
    
   double getAnodePhiStructure(int i) const 
   { 
      if ( i < 0 || i > 2 ) 
         return 0.; 
      else   
	 return anodePhiStructure[i]; 
   } 
    
   inline double getLowerStopPulseCoGCut(int, int); 
    
   double getTiltCorrection(int i) const 
   { 
      if ( i < 0 || i >= 2 ) 
         return 0.; 
      else   
         return tiltCorrection[i]; 
   } 
    
   double getDeformationCorrection(int i) const 
   { 
      if ( i < 0 || i >= 4 ) 
         return 0.; 
      else   
         return deformationCorrection[i]; 
   } 
    
   double getBallisticDeficit(int i) const 
   { 
      if ( i < 0 || i >= 4 ) 
         return 0.; 
      else   
         return ballisticDeficit[i]; 
   } 
    
   int getDeadFadcChannel(int i) const 
   { 
      if ( i < 0 || i > 360 ) 
         return 0; 
      else  
	 return listOfDeadFADC[i]; 
   } 
    
   void setDriftVelocity(double val) { driftVelocity = val; } 
   void setMinTimeBin(double val)    { minTimeBin = val; } 
 
   void setZPosition(double val) { zPosition = val; } 
   void setMinCellAmplitude(double val) { minCellAmplitude = val; }    
   void setTimeWindowForHit(double val) { timeWindowForHit = val; } 
   void setAnodeWindowForHit(int val) { anodeWindowForHit = val; } 
   void setMinTimeBinsForHit(int val) { minTimeBinsForHit = val; } 
   void setDriftVelocityReference(double val) { driftVelocityReference = val; } 
 
 
public: 
   void     setMCHitLabel        (int      val) { mcHitLabel        = val; } 
   void     setMCMeanAmplitude   (double   val) { mcMeanAmplitude   = val; } 
   void     setMCHitWidth        (double   val) { mcHitWidth        = val; } 
   void     setMCUseNoise        (CBoolean val) { mcUseNoise        = val; } 
   void     setMCZOffset         (double   val) { mcZOffset         = val; } 
   void     setMCSigmaRadius     (double   val) { mcSigmaRadius     = val; } 
   void     setMCSigmaPhi        (double   val) { mcSigmaPhi        = val; } 
   void     setMCSigmaElectronic (double   val) { mcSigmaElectronic = val; } 
   void     setMCDiffusionConst  (double   val) { mcDiffusionConst  = val; }  
   void	    setMCTimeBin         (double   val) { mcTimeBin	    = val; } 
   void     setMCNoise           (double   val) { mcNoise           = val; } 
   void     setMCGeVToElectrons  (double   val) { mcGeVToElectrons  = val; } 
   void	    setMCElectronsToVolt (double   val) { mcElectronsToVolt = val; } 
   void     setMCPedestal        (double   val) { mcPedestal	    = val; } 
   void     setMCNoiseScale      (double   val) { mcNoiseScale	    = val; }    
   void     setMCThreshhold	 (int      val) { mcThreshhold      = val; } 
   void     setMCCmToRad         (double   val) { mcCmToRad         = val; } 
  
   int      getMCHitLabel        () const { return mcHitLabel        ; } 
   double   getMCMeanAmplitude   () const { return mcMeanAmplitude   ; } 
   double   getMCHitWidth        () const { return mcHitWidth        ; } 
   CBoolean getMCUseNoise        () const { return mcUseNoise        ; } 
   double   getMCZOffset         () const { return mcZOffset         ; } 
   double   getMCSigmaRadius     () const { return mcSigmaRadius     ; } 
   double   getMCSigmaPhi        () const { return mcSigmaPhi        ; } 
   double   getMCSigmaElectronic () const { return mcSigmaElectronic ; } 
   double   getMCDiffusionConst  () const { return mcDiffusionConst   ; }  
   double   getMCTimeBin         () const { return mcTimeBin         ; } 
   double   getMCNoise           () const { return mcNoise           ; } 
   double   getMCGevToElectrons  () const { return mcGeVToElectrons  ; } 
   double   getMCElectronsToVolt () const { return mcElectronsToVolt ; } 
   double   getMCPedestal        () const { return mcPedestal        ; } 
   int      getMCThreshhold	 () const { return mcThreshhold      ; } 
   double   getMCCmToRad         () const { return mcCmToRad         ; } 
  
protected:    
   int    waferType; 
   int    nAnodes; 
   int    nTimeBins; 
   int    nNim; 
   int    firstCrate; 
    
   CString calibrationFileName; 
   CString drCorrectionFileName; 
    
   double maxRadius; 
   double minRadius; 
   double maxTimeBinReference; 
   double minTimeBin; 
   double driftVelocity; 
   double driftVelocityReference; 
   double phiOffset; 
   double zPosition; 
   double minCellAmplitude; 
   double timeOffsetBTDC; 
   double stopPulseThreshold; 
    
   int    lastRequestedRunNumber;        // | 
   int    indexOfLastRequestedRunNumber; // | 
   int    numberOfRunsForStopPulseCuts;  //  > for run-individual stoppulse-calibration 
   int    *runNumbersForStopPulseCuts;   // | 
   double *lowerStopPulseCoGCut;         // | 
 
   double diffusionConstants[2];  // 
   double anodePhiOffset;         // needed for Jan's phi fitting 
   double anodePhiStructure[3];   // 
    
   double tiltCorrection[2]; 
   double deformationCorrection[4]; 
   double ballisticDeficit[4]; 
   CBoolean isFlipped; 
 
   int    numberOfDeadFADC; 
   int    listOfDeadFADC[360]; 
 
   double singlePulseSigma[2];        // radial variation of pulse-width 
   double saturationAmplitude; 
   double maxDeviationForSinglePulse; // to decide for double-pulse-fit 
    
   double timeWindowForHit;         // max time difference of pulses in a hit 
   int    anodeWindowForHit;        // anodes to take into account 
   int    minTimeBinsForHit;        // minimum number of time bins over threshold 
 
   int      mcHitLabel; 
   double   mcMeanAmplitude; 
   double   mcHitWidth; 
   CBoolean mcUseNoise; 
   double   mcZOffset; 
   double   mcSigmaRadius; 
   double   mcSigmaPhi; 
   double   mcSigmaElectronic;  
   double   mcDiffusionConst; 
   double   mcTimeBin; 
   double   mcNoise;  
   double   mcGeVToElectrons; 
   double   mcElectronsToVolt; 
   double   mcPedestal;  
   double   mcNoiseScale;    
   int      mcThreshhold; 
   double   mcCmToRad; 
}; 
 
double CSidcSetup::getLowerStopPulseCoGCut(int runNumber, int i) 
{ 
   int indexOfRequestedRunNumber; 
 
   if ( i < 0 || i >= 4 ) 
      return 0.; 
   else { 
      if (runNumber == lastRequestedRunNumber) 
	 indexOfRequestedRunNumber = indexOfLastRequestedRunNumber; 
      else { 
	 for (int iRun=0; iRun<numberOfRunsForStopPulseCuts; iRun++) { 
	    if (runNumber >= runNumbersForStopPulseCuts[iRun]) { 
	       indexOfRequestedRunNumber     = iRun; 
	       indexOfLastRequestedRunNumber = iRun; 
	    } 
	 } 
      } 
      return lowerStopPulseCoGCut[indexOfRequestedRunNumber*4+i]; 
   } 
} 
 
 
 
 
 
 
#endif /* CSIDCSETUP_H */ 

Back to index

See source file