Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 09:15:46

0001 /***********************************************************************************************
0002 *** provided by,                                                                          ******
0003 ***     Friederike Bock, fbock@cern.ch                                                    ******
0004 ************************************************************************************************/
0005 
0006 #ifndef COMMONVARIABLES
0007 #define COMMONVARIABLES
0008   
0009   // Definition of color/marker arrays for plotting
0010   Color_t colorLayer[16]    = { kRed-7, kBlue+1, kCyan-3, kMagenta+1, kPink-1, kViolet-9, kOrange, kGreen+1,  
0011                                 kRed+1, kBlue-9, kCyan+1, kMagenta-7, kOrange+7, kSpring+5, kPink+5, kViolet+8 };
0012   Color_t colorReadBoard[8] = { kRed+1, kBlue+1, kCyan+1, kMagenta+1, kOrange, kGreen+1, kPink+5, kViolet-9};
0013   Style_t markerLayer[16]     = { 20, 25, 33, 28, 29, 37, 41, 46,
0014                                   24, 21, 27, 34, 30, 39, 40, 47};
0015   Style_t markerReadBoard[8]  = { 20, 21, 33, 34, 29, 39, 40, 46};
0016   
0017   Color_t colorBeamE[16]    = { kPink-1, kRed-7, kCyan-3, kMagenta+1, kBlue+1,  kViolet-9, kOrange, kGreen+1,  
0018                                 kRed+1, kGreen+1, kCyan+1, kMagenta-7, kOrange+7, kSpring+5, kPink+5, kViolet+8 };
0019   Color_t colorVoltage[16]  = { kPink-1, kRed-7, kCyan-3, kMagenta+1, kBlue+1,  kViolet-9, kOrange, kGreen+1,  
0020                                 kRed+1, kGreen+1, kCyan+1, kMagenta-7, kOrange+7, kSpring+5, kPink+5, kViolet+8 };
0021   
0022   
0023   // SPS - H4 2023 variables
0024   std::vector<Float_t> beamE_SPS2023    = {20, 40, 60, 80, 100, 150, 200, 220, 250, 300, 350};
0025   std::vector<Int_t> gainScan_SPS2023   = {10, 20, 30, 40, 50, 60, 63};
0026                                   // e,   h
0027   Int_t species_SPS2023[2]      = {0,     1};
0028   std::vector<Float_t> vov_SPS2023      = {0.5, 1.5, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0, 5.5};
0029   
0030   //*******************************************************************
0031   // Find index in array for voltage
0032   //*******************************************************************
0033   Int_t GetOverVoltageIndex(Double_t vov, Int_t tbdata){
0034     // TB data 2023 SPS H4
0035     if (tbdata == 1){ 
0036       Int_t n = 0; 
0037       while (n < (Int_t)vov_SPS2023.size() && vov != vov_SPS2023.at(n) ){
0038         n++;
0039       }
0040       if (n ==  (Int_t)vov_SPS2023.size()) return -1;
0041       else return n;
0042     } 
0043     return -1;
0044   }
0045 
0046   //*******************************************************************
0047   // Get over voltage from index
0048   //*******************************************************************
0049   Float_t GetOverVoltageFromIndex(Int_t index, Int_t tbdata){
0050     // TB data 2023 SPS H4
0051     if (tbdata == 1){ 
0052       if (index < 0 || index > (Int_t)vov_SPS2023.size()-1) return -1.;
0053       else return vov_SPS2023.at(index);
0054     } 
0055     return -1.;
0056   }
0057   
0058   
0059   //*******************************************************************
0060   // Find index in array for beam energy
0061   //*******************************************************************
0062   Int_t GetBeamEnergyIndex(Double_t energy, Int_t tbdata){
0063     // TB data 2023 SPS H4
0064     if (tbdata == 1){ 
0065       Int_t n = 0; 
0066       while ( n < (Int_t)beamE_SPS2023.size() && energy != beamE_SPS2023.at(n) ) n++;
0067       if (n ==  (Int_t)beamE_SPS2023.size()) return -1;
0068       else return n;
0069     } 
0070     return -1;
0071   }
0072   //*******************************************************************
0073   // Get beam energy from index
0074   //*******************************************************************
0075   Float_t GetBeamEnergyFromIndex(Int_t index, Int_t tbdata){
0076     // TB data 2023 SPS H4
0077     if (tbdata == 1){ 
0078       if (index < 0 || index > (Int_t)beamE_SPS2023.size()-1) return -1.;
0079       else return beamE_SPS2023.at(index);
0080     } 
0081     return -1.;
0082   }
0083   
0084   //*******************************************************************
0085   // Find index in array for gain setting
0086   //*******************************************************************
0087   Int_t GetGainSetIndex(Int_t hgSet, Int_t lgSet, Int_t tbdata){
0088     // TB data 2023 SPS H4
0089     if (tbdata == 1){ 
0090       Int_t n = 0; 
0091       if (hgSet != lgSet) return -1;
0092       while (n < (Int_t)gainScan_SPS2023.size() && hgSet != gainScan_SPS2023.at(n) ) n++;
0093       if (n ==  (Int_t)gainScan_SPS2023.size()) return -1;
0094       else return n;
0095     } 
0096     return -1;
0097   }
0098   
0099   //*******************************************************************
0100   // Get low Gain setting from index
0101   //*******************************************************************
0102   Int_t GetLGGainSetIndex(Int_t index, Int_t tbdata){
0103     // TB data 2023 SPS H4
0104     if (tbdata == 1){ 
0105       if (index < 0 || index > (Int_t)gainScan_SPS2023.size()-1) return -1;
0106       else return gainScan_SPS2023.at(index);
0107     } 
0108     return -1;
0109   }
0110   //*******************************************************************
0111   // Get high Gain setting from index
0112   //*******************************************************************
0113   Int_t GetHGGainSetIndex(Int_t index, Int_t tbdata){
0114     // TB data 2023 SPS H4
0115     if (tbdata == 1){ 
0116       if (index < 0 || index > (Int_t)gainScan_SPS2023.size()-1) return -1;
0117       else return gainScan_SPS2023.at(index);
0118     } 
0119     return -1;
0120   }
0121   
0122   
0123 #endif