Back to home page

sPhenix code displayed by LXR

 
 

    


File indexing completed on 2025-08-05 08:14:37

0001 
0002 #ifndef _HCALCONTROLS_H_
0003 #define _HCALCONTROLS_H_
0004 #include <Riostream.h>
0005 #include <TString.h>
0006 
0007 
0008 enum OBJECTKINDS {
0009   CALOR,
0010   COUNTER
0011 };
0012 enum GAINS {
0013   HIGH,
0014   LOW
0015 };
0016 enum STACKS{
0017   EMC,         //  EMCal
0018   HINNER,      //  Inner HCal
0019   HOUTER,      //  Outer HCal
0020   HODO,        //  Scintillating Hodoscope
0021   SCINT,       //  Scintillators (Counters along the beam line)+Cherenkovs
0022   CHER         //  CHerenkov counters
0023 };
0024 
0025 // **************************************************************************
0026 
0027 //  CURRENTLY OPERATING DAQ
0028 static const    int READOUTCHANNELS   = 192; // four ADC stations (EMC/HCInner/HCOuter/Service)
0029 
0030 static const    int TRIGGERCHANNELS   = 0;   // 4;
0031 
0032 //  defaults
0033 static const    int chinspected       = 32;  //  high and low gains in HCal Inner
0034 static const    int triggerinsp       = 0;
0035 
0036 //  HCAL 2016 EXTERNAL COUNTERS AND HODOSCOPES
0037 
0038 //  T1044 CONFIGURATION
0039 static const      int CALSTACKS         = 6;   
0040 static const      int T1044TRIGGERCH    = 14;
0041 static const      int T1044HODO         = 16;
0042 static const      int NSAMPLES          = 24;
0043 static const Double_t PEDESTAL          = 2048.;
0044 //  thresholds below are in units ADC in selected TRIGGER gain range
0045 //  all thresholds    are in 8 adc counts steps
0046 //  mixed amplitudes are stored in LG units, so the actual trigger thresholds is computed as
0047 //  8./(TRGAINRANGE==0?  HLGRATIO : 1)*TWRAMPTHR
0048 //  8./(TRGAINRANGE==0?  HLGRATIO : 1)*STTOTAMPTHR
0049 //  the 8 corresponds to lowerst 3 bits suppressed by Chi before thresholding
0050 static       Int_t    TRGAINRANGE       = 0;   //  gain range used to trigger
0051 static const Int_t    STTOTAMPTHR       = 10;  //  total sum threshold in daq.c
0052 static const Int_t    TWRAMPTHR         = 1;   //  individual tower threshold in daq.c
0053 static const Int_t    STHITMIN          = 3;   //  minimal number of hits above threshold in stack in daq.c
0054 static const Int_t    STHITMAX          = 14;
0055 //  next two thresholds are computed based upon pedestal widths in towers and stacks
0056 //  Towers(RMS) ~ 1.2; Stacks (RMS) ~4.7 (sum, cleaned), 7.1 (Fit)  (in units of LG)
0057 static const Double_t TWRZEROSUPTHR     = 1.;  //  tower zero suppression threshold (units of LG) 
0058 static const Double_t STZEROSUPTHR      = 5.; 
0059 static const Double_t HLGRATIO          = 16.;
0060 static const Float_t  hlgratios[]       = {  1., 32., 16., 1., 1., 1.};
0061 static Int_t          emcGainSelection  = 1;
0062 //  HCAL PROTOTYPE
0063 static const    int HCALTOWERS        = 16;
0064 static const    int HCALROWS          = 4;
0065 static const    int HCALCOLUMNS       = 4;
0066 static const    int HCALGAINS         = 2;
0067 
0068 //  EMC  2016 PROTOTYPE
0069 static const    int EMCTOWERS         = 64;
0070 static const    int EMCROWS           = 8;  
0071 static const    int EMCCOLUMNS        = 8; 
0072 static const    int EMCGAINS          = 1;
0073 
0074 static          int CHTOTAL           = 0;   // all channels stored into ROOT file         
0075 static          int ACTIVECHANNELS    = 0;   // total number of mapped channels
0076 static          int detchannels       = 0;  
0077 static          int hgDetChannels     = 0;
0078 static          int lgDetChannels     = 0;
0079 static const    int ovrflow           =  1990;  // 2048
0080 static const    int undflow           = -1990;  //-2048
0081 //  CALORIMETER CALIBRATION
0082 //  GeV/ADC count (LG)
0083 static const Double_t stECalib[]      = {0.008, 0.010, 0.005, 1., 1., 1.};  
0084 //  HINNER has HGain dropped by x2. 
0085 //  This kind of Scaling to be used only to get uncalibrated sums of amplitudes
0086 static       Double_t stAScale[]      = {1., 2., 1., 1., 1., 1.};
0087 
0088 //  TILE
0089 static const    int TILEFIBERS        = 4;
0090 static const    int TILECHANNELS      = 2*TILEFIBERS;
0091 
0092 //  TILE CONTROLS
0093 //static const    int NSAMPLES          = 24;
0094 static const    int TILETRIGGERCH     = 8;
0095 static const    int TRIGGERRES        = 3;
0096 static const    int CHANNELTHRESHOLDS = 25;
0097 static const    int HITMULTTHRESHOLDS = 8;
0098 static const    int RISETIME          = 4;
0099 static const    int FALLTIME          = 5;
0100 static const    int NPARAMETERS       = 6;
0101 static const    int DISPLAYX          = 4;   // maximum number of channels per display panel
0102 // number of channels in detector (set by Helper, if left zero on the first call to hLabHelper
0103 //  - it will be set to ACTIVECHANNELS-TRIGGERCHANNELS
0104 
0105 // **************************************************************************
0106 //  all informative ADC (TILE) channels (stored into .root file)
0107 static const int chInUse[]       = {  115, 113, 119, 117, 123, 121, 127, 125 };
0108 
0109 // **************************************************************************
0110 //  DEFAULTS FOR INSPECTION AND PLOTTING
0111 //static const int feechinsp[] = {64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,
0112 //              80,81,82,83,84,85,86,87,88,89,90,91.92,93.94,95};
0113 //  Mapping for HINNER 3/2/2016
0114 static const int feechinsp[] = {64,72,80,88,66,74,82,90,68,76,84,92,70,78,86,94,
0115                 65,73,81,89,67,75,83,91,69,77,85,93,71,79,87,95};
0116 // **************************************************************************
0117 //  2016 FNAL Beam Test Prototype
0118 static const int hcalInnerCh[] = { 64, 72, 80, 88, 66, 74, 82, 90, 68, 76, 84, 92, 70, 78, 86, 94,
0119                    65, 73, 81, 89, 67, 75, 83, 91, 69, 77, 85, 93, 71, 79, 87, 95};
0120 static const int hcalOuterCh[] = {112,120,128,136,114,122,130,138,116,124,132,140,118,126,134,142,
0121                   113,121,129,137,115,123,131,139,117,125,133,141,119,127,135,143};
0122 // static const int hcalOuterCh[] = {16,24,32,40,18,26,34,42,20,28,36,44,22,30,38,46,
0123 //                17,25,33,41,19,27,35,43,21,29,37,45,23,31,39,47};
0124 
0125 
0126 
0127 
0128 
0129 static const int emcCh[]       = {   5,  4,  7,  6,  1,  0,  3,  2, 13, 12, 15, 14,  9,  8, 11, 10,
0130                     21, 20, 23, 22, 17, 16, 19, 18, 29, 28, 31, 30, 25, 24, 27, 26, 
0131                     37, 36, 39, 38, 33, 32, 35, 34, 45, 44, 47, 46, 41, 40, 43, 42,
0132                     53, 52, 55, 54, 49, 48, 51, 50, 61, 60, 63, 62, 57, 56, 59, 58};
0133 static const int hodoCh[]      = {  96, 97, 98, 99,100,101,102,103,104,105,106,107,108,109,110,111};
0134 static const int counters[]    = { 144,145,146,147,148,149,150,
0135                    160,161,162,163,164,165,166}; //  including cherenkov's
0136 
0137 // **************************************************************************
0138 //  SMART TILE VERSION 0
0139 
0140 static const    Double_t  tileSizeX      = 25.;
0141 static const    Double_t  tileSizeY      = 15.;
0142 static const    Int_t     minProjEntries = 50;  // min # of hits to try fitting the light yield
0143 //  TILECHANNELS
0144 static const int feech1[]        = { 115, 119, 123, 127, 113, 117, 121, 125 };  //  HG channels only. Valid for earlier runs
0145 static const int feech2[]        = { 115, 113, 119, 117, 123, 121, 127, 125 };  //  HG channels only. Valid starting Run 803
0146 //  TRIGGERCHANNELS
0147 //static const int trch[]          = { 134, 135, 128, 129, 130, 131, 132, 133 };
0148 
0149 static const int trch1125[]        = {  128, 129, 130, 131 };  //  two of the four channels are used by trigger tags
0150 static const int trch1152[]        = {   98,  99, 129, 131 };  //  first are two gain ranges for Tower then sc trigger tags
0151 //  Calibration data at different times
0152 static const Double_t sc_779[] = { 3.6,    5.2,   5.2,   4.5,   6.6,  5.3,  7.9,  4.2  };  //  single cell calibration - cosmic run 779
0153 static const Double_t mu_779[] = { 72.7, 130.6, 141.5, 132.1, 132., 138., 135.5, 68.4 };   //  cosmic calibration Run 779
0154 
0155 static const Double_t sc_900[]  = {  6.6, 12.3, 12.9, 12.3, 14.6, 14.2, 12.25, 6.42 };      //  cosmic run, low amp. signals
0156 
0157 static const Double_t sc_1061[] = {  6.71, 12.74, 13.13, 12.76, 14.30, 14.35, 12.70, 6.56 };  //  cosmic run, low amp. signals, mode 1
0158 //const    Double_t sc_1061[] = {  6.65, 12.68, 12.86, 12.55, 14.25 , 14.10, 12.23, 6.59 };  //  cosmic run, low amp. signals, mode 0
0159 
0160 static const Double_t sc_1123[] = {  6.61, 11.83, 12.77, 12.41, 13.75, 13.55, 12.31, 6.44 };  //  cosmic run, low amp. signals, mode 0
0161 //  this is just an educated guess for the time being. Estimate includes Gain difference at the same bias.
0162 
0163 // **************************************************************************
0164 //      SMART TILE DATA
0165 //  data and ROOT files on RCF
0166 //static const TString             RCFdataDir("/direct/phenix+user04/sphenix/bnl/buffer/");
0167 //static const TString             RCFrootDir("/direct/phenix+user04/sphenix/bnl/buffer/rootf/");
0168 //  data and ROOT files on sphnxdaq
0169 //static const TString             HLABdataDir("/scratch/buffer/bnl/");
0170 //static const TString             HLABrootDir("/scratch/buffer/bnl/rootf/");
0171 // **************************************************************************
0172 
0173 //      PROTOTYPE 2016 COSMIC & LED  DATA
0174 //  data and ROOT files on RCF
0175 //  static const TString             RCFdataDir("/gpfs/mnt/gpfs02/sphenix/sim/sim01/user04/sphenix/bnl/buffer/");
0176 //  before April 1st 2016
0177 // static const TString             RCFdataDir("/gpfs/mnt/gpfs02/sphenix/data/data01/t1044-2016a/cosmics/");
0178 // static const TString             RCFrootDir("/gpfs/mnt/gpfs02/sphenix/sim/sim01/user04phenix/bnl/buffer/tbsest/");
0179 //  Beginning April 1st, 2016
0180 //static const TString             RCFdataDir("/sphenix/data/data01/t1044-2016a/fnal/cosmics/");
0181 static const TString             RCFdataDir("/sphenix/data/data01/t1044-2016a/fnal/");
0182 static const TString             RCFrootDir("/sphenix/data/data01/kistenev/rootf/");
0183 
0184 //  data and ROOT files on sphnxdaq
0185 static const TString             HLABdataDir("/scratch/buffer/bnl/");
0186 static const TString             HLABrootDir("/scratch/buffer/bnl/rootf/");
0187 // **************************************************************************
0188 
0189 //  USEFUL CONSTANTS
0190 #define   piMass     0.1356
0191 
0192 
0193 
0194 #endif // _HCALCONTROLS_H_