LILookup Class Reference

#include <LILookup.h>

Inheritance diagram for LILookup:
LIAnalysis LIPlexMaps LIRun LITuning

List of all members.

Public Types

enum  ELINearOrFarSide { kUnknownSide = 0, kNearSide = 1, kFarSide = 2 }
typedef enum
LILookup::ELINearOrFarSide 
LINearOrFarSide_t

Public Member Functions

 LILookup ()
 ~LILookup ()
Double_t CalcGain (Double_t mean, Double_t rms, Double_t QE=0)
Double_t CalcMean (Double_t gain, Double_t rms, Double_t QE=0)
Double_t CalcMeanFromNpe (Double_t npe, Double_t rms, Double_t QE=0)
Double_t CalcNpe (Double_t mean, Double_t rms, Double_t QE=0)
Double_t CalcRms (Double_t mean, Double_t gain, Double_t QE=0)
Int_t Chip2Pmt (Int_t chip, Int_t detectorType)
Int_t ConvertEastWest (std::string sEastWest)
Int_t ConvertRackLevel (std::string sRackLevel)
UInt_t FindInsertPoint (const std::vector< Double_t > &v, Double_t valueToInsert)
std::pair< PlexPinDiodeId,
PlexPinDiodeId
GetPinDiodeIds (PlexHandle plexHandle, Int_t led)
Int_t GetOppCrate (Int_t pulserBox, Int_t detectorType)
Int_t GetOppPb (Int_t crate, Int_t detectorType)
std::pair< Int_t, Int_t > GetPinDiodePlanes (PlexPinDiodeId pinId, PlexHandle *plexHandle)
std::string GetVectorAsString (std::vector< Double_t > &v, const std::string &prefix="") const
std::string GetVectorAsString (std::vector< Int_t > &v, const std::string &prefix="") const
Double_t GetVectorPoint (const std::vector< Double_t > &v, UInt_t point)
Int_t Led2Ashtray (Int_t led, Int_t plane, Int_t detectorType)
Int_t NearOrFar (Int_t crate, Int_t pulserBox, Int_t farPulserBox, Int_t nearPulserBox, Int_t led, Int_t detectorType, Int_t plane, Int_t runNumber)
Int_t Pb2TrigPmtChannel (Int_t pulserBox, Int_t detectorType)
Int_t Plane2Pb (Int_t plane, Int_t side)
Int_t Plane2PbEast (Int_t plane)
Int_t Plane2PbWest (Int_t plane)
Int_t Plane2Crate (Int_t plane, Int_t side, Int_t detectorType)
Int_t Plane2CrateEast (Int_t plane, Int_t detectorType)
Int_t Plane2CrateWest (Int_t plane, Int_t detectorType)
void SetDetector (Int_t det)
void SetNewPoint (std::vector< Double_t > &v, Double_t value, UInt_t i)
void SetPbPlanes (Int_t *planeMin, Int_t *planeMax, Int_t detectorType)
Int_t Strip2Ashtray (Int_t strip, Int_t detectorType)
Int_t Strip2Led (Int_t strip, Int_t plane, Int_t detectorType, Int_t crate=0)
TGraphAsymmErrors * TGraphAsymmErrorsVectEY (std::vector< Double_t > &vX, std::vector< Double_t > &vY, std::vector< Double_t > &vEX, std::vector< Double_t > &vEY)
TGraph * TGraphVect (std::vector< Double_t > &vX, std::vector< Double_t > &vY)
void UnencodePlnStripEndKey (Int_t plnStripEndKey, Detector::Detector_t det, Int_t &plane, Int_t &strip, Int_t &stripEnd)
Int_t GetNumericMuxBox (Int_t pmtNo, Int_t detectorType=1)

Static Public Attributes

static Int_t FIRSTSTRIP = 0
static Int_t LASTSTRIP = 191
static Int_t NUMSTRIPS = 192
static Int_t NUMCHADD = 8000
static Int_t FIRSTLED = 1
static Int_t LASTLED = 20
static Int_t NUMLEDS = 20
static Int_t FIRSTASHTRAY = 1
static Int_t LASTASHTRAY = 20
static Int_t NUMASHTRAYS = 20
static Int_t FIRSTPULSERBOX = 0
static Int_t LASTPULSERBOX = 15
static Int_t NUMPULSERBOXES = 16
static Int_t NUMPULSERBOXESCURRENT = 14
static Int_t NUMCHANNELS = 8000
static Int_t FIRSTCRATE = 0
static Int_t LASTCRATE = 15
static Int_t NUMCRATES = 16
static Int_t FIRSTVARC = 0
static Int_t LASTVARC = 3
static Int_t NUMVARCS = 4
static Int_t FIRSTVMM = 0
static Int_t LASTVMM = 5
static Int_t NUMVMMS = 6
static Int_t FIRSTVFB = 0
static Int_t LASTVFB = 1
static Int_t NUMVFBS = 2
static Int_t FIRSTCHIP = 0
static Int_t LASTCHIP = 2
static Int_t NUMCHIPS = 3
static Int_t FIRSTPMT = 0
static Int_t LASTPMT = 2
static Int_t NUMPMTS = 3
static Int_t FIRSTPIXEL = 0
static Int_t LASTPIXEL = 15
static Int_t NUMPIXELS = 16
static Int_t FIRSTPIXELSPOT = 0
static Int_t LASTPIXELSPOT = 7
static Int_t NUMPIXELSPOTS = 8
static Int_t FIRSTVACHANNEL = 0
static Int_t LASTVACHANNEL = 21
static Int_t NUMVACHANNELS = 22
static Int_t FIRSTSIDE = 1
static Int_t LASTSIDE = 2
static Int_t NUMSIDES = 2
static Int_t FIRSTEND = 1
static Int_t LASTEND = 2
static Int_t SECONDEND = 2
static Int_t NUMENDS = 2
static Int_t NUMRACKLEVELS = 2
static Int_t NUMLEVELS = 3
static Int_t FIRSTRACK = 1
static Int_t LASTRACK = 16
static Int_t NUMRACKS = 16
static Int_t FIRSTMUX = 0
static Int_t LASTMUX = 7
static Int_t NUMMUX = 8
static Int_t NUMPINGAINS = 2
static Int_t PB0STARTPLANE = 0
static Int_t PB2STARTPLANE = 65
static Int_t PB4STARTPLANE = 129
static Int_t PB6STARTPLANE = 193
static Int_t PB8STARTPLANE = 249
static Int_t PB10STARTPLANE = 314
static Int_t PB12STARTPLANE = 378
static Int_t PB14STARTPLANE = 442
static Int_t FIRSTPLANE = 0
static Int_t FIRSTSCINTPLANE = 1
static Int_t LASTSM1SCINTPLANE = 248
static Int_t FIRSTSM2PLANE = 249
static Int_t FIRSTSM2SCINTPLANE = 250
static Int_t LASTSCINTPLANE = 485
static Int_t LASTPLANE = 485
static Int_t NUMPLANES = 486
static Int_t NUMBOOKENDS = 2
static Int_t SM1BOOKEND = 0
static Int_t SM2BOOKEND = 249
static Int_t FIRSTSPECTROMETERPLANE = 10000

Private Member Functions

 ClassDef (LILookup, 0)

Detailed Description

Definition at line 28 of file LILookup.h.


Member Typedef Documentation


Member Enumeration Documentation

Enumerator:
kUnknownSide 
kNearSide 
kFarSide 

Definition at line 35 of file LILookup.h.

00035                                 {
00036     kUnknownSide = 0,
00037     kNearSide    = 1,
00038     kFarSide     = 2
00039   } LINearOrFarSide_t;


Constructor & Destructor Documentation

LILookup::LILookup (  ) 

Definition at line 132 of file LILookup.cxx.

References Msg::kDebug, and MSG.

00133 {
00134   MSG("LILookup", Msg::kDebug) 
00135     <<"Running LILookup constructor..."<<endl;
00136 
00137   MSG("LILookup", Msg::kDebug) 
00138     <<"Finished LILookup constructor"<<endl;
00139 }

LILookup::~LILookup (  ) 

Definition at line 143 of file LILookup.cxx.

References Msg::kDebug, and MSG.

00144 {
00145   MSG("LILookup", Msg::kDebug) 
00146     <<"Running LILookup destructor..."<<endl;
00147 
00148 
00149   MSG("LILookup", Msg::kDebug) 
00150     <<"Finished LILookup destructor"<<endl;
00151 }


Member Function Documentation

Double_t LILookup::CalcGain ( Double_t  mean,
Double_t  rms,
Double_t  QE = 0 
)

Definition at line 798 of file LILookup.cxx.

Referenced by LIAnalysis::GainCurves(), LIPlexMaps::PeGen(), and LIAnalysis::ReflectorsGc().

00799 {
00800   //gain=rms**2/mean * 1/(1-p)
00801   Double_t gain=-1;
00802 
00803   //protect against fpe
00804   if (mean!=0 && 1-QE!=0) gain=(rms*rms/mean)*(1/(1-QE));
00805   
00806   return gain;
00807 }

Double_t LILookup::CalcMean ( Double_t  gain,
Double_t  rms,
Double_t  QE = 0 
)

Definition at line 838 of file LILookup.cxx.

00839 {
00840   //mean=rms**2/gain * 1/(1-p)
00841   Double_t mean=-1;
00842 
00843   //protect against fpe
00844   if (gain!=0 && 1-QE!=0) mean=(rms*rms/gain)*(1/(1-QE));
00845   
00846   return mean;
00847 }

Double_t LILookup::CalcMeanFromNpe ( Double_t  npe,
Double_t  rms,
Double_t  QE = 0 
)

Definition at line 851 of file LILookup.cxx.

00853 {
00854   //mean=sqrt(npe/(1-p)) * rms
00855   Double_t mean=-1;
00856 
00857   //protect against fpe
00858   Double_t x=0;
00859   if (1-QE!=0) x=npe/(1-QE);
00860   if (x>=0) mean=sqrt(x)*rms;
00861   
00862   return mean;
00863 }

Double_t LILookup::CalcNpe ( Double_t  mean,
Double_t  rms,
Double_t  QE = 0 
)

Definition at line 811 of file LILookup.cxx.

Referenced by LIPlexMaps::LIErrors(), and LIPlexMaps::PeGen().

00812 {
00813   //npe=(mean/rms)**2 * (1-p)
00814   Double_t npe=-1;
00815 
00816   //protect against fpe
00817   if (rms!=0) npe=pow(mean/rms,2)*(1-QE);
00818   
00819   return npe;
00820 }

Double_t LILookup::CalcRms ( Double_t  mean,
Double_t  gain,
Double_t  QE = 0 
)

Definition at line 824 of file LILookup.cxx.

Referenced by LIPlexMaps::LIErrors(), and LIPlexMaps::PeGen().

00825 {
00826   //rms=sqrt(gain*mean*(1-p))
00827   Double_t rms=-1;
00828 
00829   //protect against fpe
00830   Double_t rms2=gain*mean*(1-QE);
00831   if (rms2>=0) rms=sqrt(rms2);
00832   
00833   return rms;
00834 }

Int_t LILookup::Chip2Pmt ( Int_t  chip,
Int_t  detectorType 
)

Definition at line 1117 of file LILookup.cxx.

References Msg::kDebug, Detector::kFar, Msg::kWarning, and MSG.

Referenced by LIAnalysis::PixelVsPlane().

01118 { 
01119   MSG("LILookup",Msg::kDebug) 
01120     <<" ** Running the Chip2Pmt method... ** "<<endl;
01121 
01122   Int_t pmt=-1;
01123 
01124   if (detectorType==Detector::kFar){
01125     if (chip==0) pmt=0;
01126     if (chip==1) pmt=2;
01127     if (chip==2) pmt=1;
01128   }
01129   else{
01130     MSG("LILookup",Msg::kWarning)
01131       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01132   }
01133 
01134   MSG("LILookup",Msg::kDebug) 
01135     <<" ** Finished the Chip2Pmt method **"<<endl;
01136   return pmt;
01137 }

LILookup::ClassDef ( LILookup  ,
 
) [private]
Int_t LILookup::ConvertEastWest ( std::string  sEastWest  ) 
Int_t LILookup::ConvertRackLevel ( std::string  sRackLevel  ) 
UInt_t LILookup::FindInsertPoint ( const std::vector< Double_t > &  v,
Double_t  valueToInsert 
)

Definition at line 666 of file LILookup.cxx.

References Msg::kDebug, Msg::kVerbose, and MSG.

Referenced by LIRun::AddPoint().

00668 {
00669   MSG("LILookup",Msg::kVerbose) 
00670     <<"Running FindInsertPoint method..."<<endl;
00671   
00672   //insert point - the ith element of the vector
00673   UInt_t i=0;
00674   
00675   if (v.size()>=1){
00676     //get iterator
00677     vector<Double_t>::const_iterator vectValue;
00678     //set iterator to the begining
00679     vectValue=v.begin();
00680     //loop over the vector
00681     while (vectValue!=v.end()){
00682       //if the vector element is greater than the value to insert
00683       //then stop looping
00684       //else increment the vector element
00685       //the min value of i is 0, 
00686       //the max is v.size(), i.e. one past the end 
00687 
00688       MSG("LILookup",Msg::kDebug)
00689         <<"i="<<i<<", ith value="<<*vectValue
00690         <<", valueToInsert="<<valueToInsert<<endl;
00691 
00692       if (*vectValue>valueToInsert) break;
00693       i++;
00694       vectValue++;
00695     }
00696   }
00697 
00698   //check if first point
00699   if (v.size()==0){
00700     MSG("LILookup",Msg::kDebug)
00701       <<endl<<"First point to be inserted: i="<<i
00702       <<", vSize="<<v.size()
00703       <<", valueToInsert="<<valueToInsert<<endl;
00704   }
00705   //insert at beginning (of finite vector)
00706   else if (i==0){
00707     MSG("LILookup",Msg::kDebug)
00708       <<endl<<"Insert at beginning of vector: i="<<i
00709       <<", first current value="<<v[i]
00710       <<", vSize="<<v.size()
00711       <<", valueToInsert="<<valueToInsert<<endl;
00712   }
00713   //insert at end
00714   else if (i==v.size()){
00715     MSG("LILookup",Msg::kDebug)
00716       <<endl<<"Insert at end of vector: i="<<i
00717       <<", last current value="<<v[i-1]
00718       <<", vSize="<<v.size()
00719       <<", valueToInsert="<<valueToInsert<<endl;
00720   }
00721   //insert somewhere in the middle
00722   else{
00723     MSG("LILookup",Msg::kDebug)
00724       <<endl<<"Insert at point i="<<i
00725       <<", v[i-1]="<<v[i-1]
00726       <<", v[i]="<<v[i]
00727       <<", vSize="<<v.size()
00728       <<", valueToInsert="<<valueToInsert<<endl;
00729   }
00730   
00731   MSG("LILookup",Msg::kVerbose) 
00732     <<"FindInsertPoint method finished"<<endl;
00733   return i;
00734 }

Int_t LILookup::GetNumericMuxBox ( Int_t  pmtNo,
Int_t  detectorType = 1 
)

Definition at line 1776 of file LILookup.cxx.

References Msg::kDebug, Detector::kNear, Msg::kWarning, and MSG.

01777 {
01778   MSG("LILookup",Msg::kDebug)
01779     <<" ** Running the GetNumericMuxBox method... ** "<<endl;
01780 
01781   Int_t MuxBox = -1;
01782 
01783   if (detectorType==Detector::kNear){
01784 
01785     Int_t numericMuxBox[194] = {4112,4113,5136,4114,5137,4115,5138,5139,4116,5140,4117,5141,4118,4119,5142,4128,
01786                                 5143,4129,5152,5153,4130,5154,4131,5155,4132,4133,5156,4134,5157,4135,5158,5159,
01787                                 4144,5168,4145,5169,4146,4147,5170,4148,5171,4149,5172,5173,4150,5174,4151,5175,
01788                                 4160,4161,5184,4162,5185,4163,5186,5187,4164,5188,4165,5189,4166,4167,5190,4176,
01789                                 5191,4177,5200,5201,4178,5202,4179,5203,4180,4181,5204,4182,5205,4183,5206,5207,
01790                                 4192,5216,4193,5217,4194,4195,5218,4196,5219,4197,5220,5221,4198,5222,4199,5223,
01791                                 4208,4209,5232,4210,5233,4211,5234,5235,4212,5236,4213,5237,4214,4215,5238,4224,
01792                                 5239,4225,5248,5249,4226,5250,4227,5251,4228,4229,5252,4230,5253,4231,5254,5255,
01793                                 4240,5264,4241,5265,4242,4243,5266,4244,5267,4245,5268,5269,4246,5270,4247,5271,
01794                                 4257,4256,5280,5281,4258,5282,4261,4260,5284,5285,4262,5286,4273,4272,5296,5297,
01795                                 4274,5298,4277,4276,5300,5301,4278,5302,4289,4288,5312,5313,4290,5314,4293,4292,
01796                                 5316,5317,4294,5318,4305,4304,5328,5329,4306,5330,4309,4308,5332,5333,4310,5334,
01797                                 4311,4307};
01798     MuxBox = numericMuxBox[pmtNo];
01799   }
01800   else{
01801     MSG("LILookup",Msg::kWarning)
01802       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01803   }
01804 
01805   MSG("LILookup",Msg::kDebug)
01806     <<" ** Finished the GetNumericMuxBox method **"<<endl;
01807   return MuxBox;
01808 }

Int_t LILookup::GetOppCrate ( Int_t  pulserBox,
Int_t  detectorType 
)

Definition at line 947 of file LILookup.cxx.

References FIRSTCRATE, Detector::kCalDet, Msg::kDebug, Detector::kFar, Msg::kWarning, LASTCRATE, and MSG.

00948 { 
00949   MSG("LILookup",Msg::kDebug) 
00950     <<" ** Running the GetOppCrate method... ** "<<endl;
00951 
00952   Int_t oppCrate=-1;
00953 
00954   if (detectorType==Detector::kFar){
00955     if (crate>=FIRSTCRATE && crate<=LASTCRATE){ 
00956       if (crate%2==0){//east
00957         oppCrate=crate+1;
00958       }
00959       else if (crate%2==1){//west
00960         oppCrate=crate-1;
00961       }
00962     }
00963   }
00964   else if(detectorType==Detector::kCalDet){
00965     if (crate>=0 && crate<=1){ 
00966       if (crate==0){
00967         oppCrate=crate+1;
00968       }
00969       else if (crate==1){
00970         oppCrate=crate-1;
00971       }
00972     }
00973   }
00974   else{
00975     MSG("LILookup",Msg::kWarning)
00976       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
00977   }
00978 
00979   MSG("LILookup",Msg::kDebug) 
00980     <<" ** Finished the GetOppCrate method **"<<endl;
00981   return oppCrate;
00982 }

Int_t LILookup::GetOppPb ( Int_t  crate,
Int_t  detectorType 
)

Definition at line 909 of file LILookup.cxx.

References FIRSTPULSERBOX, Detector::kCalDet, Msg::kDebug, Detector::kFar, Detector::kNear, Msg::kWarning, LASTPULSERBOX, and MSG.

Referenced by LISummarySorter::ReconstructPin(), LISummarySorter::ReconstructTrigPmt(), and LIAnalysis::StripVsPlane().

00910 { 
00911   MSG("LILookup",Msg::kDebug) 
00912     <<" ** Running the GetOppPb method... ** "<<endl;
00913 
00914   Int_t oppPulserBox=-1;
00915   
00916   if (detectorType==Detector::kFar){
00917     if (pulserBox>=FIRSTPULSERBOX && pulserBox<=LASTPULSERBOX){ 
00918       if (pulserBox%2==0){//east
00919         oppPulserBox=pulserBox+1;
00920       }
00921       else if (pulserBox%2==1){//west
00922         oppPulserBox=pulserBox-1;
00923       }
00924     }    
00925   }
00926   else if(detectorType==Detector::kCalDet){
00927     //only 1 pulser box at CalDet!
00928     oppPulserBox=pulserBox;
00929   }
00930   else if(detectorType==Detector::kNear){
00931     //pulser boxes are only on one side so this is meaningless
00932     //but return it anyway
00933     oppPulserBox=pulserBox;
00934   }
00935   else{
00936     MSG("LILookup",Msg::kWarning)
00937       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
00938   }
00939 
00940   MSG("LILookup",Msg::kDebug) 
00941     <<" ** Finished the GetOppPb method **"<<endl;
00942   return oppPulserBox;
00943 }

pair< PlexPinDiodeId, PlexPinDiodeId > LILookup::GetPinDiodeIds ( PlexHandle  plexHandle,
Int_t  led 
)

Definition at line 1303 of file LILookup.cxx.

References PlexHandle::GetPinDiodeId(), Detector::kCalDet, and ElecType::kVA.

Referenced by LIPlexMaps::GetRawPinMap(), LIPlexMaps::GetRefAdcPinRatio(), LIPlexMaps::MakePinPlexTables(), and LIPlexMaps::PrintPlexPinDiodeInfo().

01304 {
01306   //prior to march 2003
01308   //Int_t highpinchadds[6]={4146,4274,4402,4786,4914,5042};
01309   //Int_t lowpinchadds[6]={4114,4242,4370,4626,4882,5010};
01310  
01311   //The pin diode information in the plex is as follows
01312   //The electronics information is in descending hierarchial order
01313   //(x:y) is pulser box x and led y
01314   //e.g. (crate,varc,vmm,vfb,VA chip,VA channel)
01315 
01316   //(0:1) Planes=41&43 Pin1=VA(0,2,0,0,0,18)=4114 
01317   //Pin2=VA(0,2,0,0,1,18)=4146
01318   //(0:2) Planes=45&47 Pin1=VA(0,2,0,1,0,18)=4242 
01319   //Pin2=VA(0,2,0,1,1,18)=4274
01320   //(0:3) Planes=49&51 Pin1=VA(0,2,1,0,0,18)=4370 
01321   //Pin2=VA(0,2,1,0,1,18)=4402
01322   //(0:4) Planes=40&42 Pin1=VA(0,2,2,0,0,18)=4626 
01323   //Pin2=VA(0,2,2,1,1,18)=4786
01324   //(0:5) Planes=44&46 Pin1=VA(0,2,3,0,0,18)=4882 
01325   //Pin2=VA(0,2,3,0,1,18)=4914
01326   //(0:6) Planes=48&50 Pin1=VA(0,2,3,1,0,18)=5010 
01327   //Pin2=VA(0,2,3,1,1,18)=5042
01328 
01330   //since to march 2003
01332   Int_t highpinchadds[6]={4146,4274,4402,4786,4914,5042};
01333   Int_t lowpinchadds[6]={4114,4242,4370,4626,4882,5010};
01334 
01335   //get high
01336   PlexPinDiodeId high=plexHandle.GetPinDiodeId
01337     (RawChannelId(Detector::kCalDet,ElecType::kVA,
01338                   0,highpinchadds[led-1]));
01339   
01340   //get low
01341   PlexPinDiodeId low=plexHandle.GetPinDiodeId
01342     (RawChannelId(Detector::kCalDet,ElecType::kVA,
01343                   0,lowpinchadds[led-1]));
01344   
01345   //  cout<<"Therefore: "<<high.GetEncoded()<<"\t"
01346   //    << low.GetEncoded()<<endl;
01347     return make_pair(high,low);
01348 }

pair< Int_t, Int_t > LILookup::GetPinDiodePlanes ( PlexPinDiodeId  pinId,
PlexHandle plexHandle 
)

Definition at line 1242 of file LILookup.cxx.

References PlexSEIdAltL::GetPlane(), PlexHandle::GetRawChannelId(), PlexHandle::GetSEIdAltL(), RawChannelId::GetVaChip(), MsgService::Instance(), Msg::kDebug, MSG, NUMVACHANNELS, RawChannelId::Print(), and RawChannelId::SetVaChannel().

Referenced by LIPlexMaps::PrintPlexPinDiodeInfo(), and LISummarySorter::ReconstructPin().

01244 {
01245   //this function returns the planes associated with the pin
01246   //diode, i.e. readout by the same chip on the vfb
01247 
01248   //a pair to hold the potentially two planes associated 
01249   //with the pin diodes
01250   pair<Int_t,Int_t> planes(-1,-1);
01251 
01252   //get the raw channel ids of the pins
01253   RawChannelId rawChanId=plexHandle->GetRawChannelId(pinId);
01254   
01255   if (MsgService::Instance()->IsActive("LILookup",Msg::kDebug)){
01256     rawChanId.Print();
01257     cout<<endl;//the above doesn't leave a line annoyingly
01258   }
01259     
01260   MSG("LIPlexMaps",Msg::kDebug) 
01261     <<"Pin chip="<<rawChanId.GetVaChip()<<endl;
01262 
01263   //loop over all the channels on the va chip 
01264   //At caldet the first pin is on a non-shared pmt (chip 0),
01265   //the second pin is on the shared pmt and chip 1
01266   for (Int_t i=0;i<NUMVACHANNELS;i++){
01267     //change the channel, get the altlist and then the plane
01268     rawChanId.SetVaChannel(i);
01269       
01270     //Get strip-end alternative list
01271     PlexSEIdAltL altList=plexHandle->GetSEIdAltL(rawChanId);
01272     
01273     //the plane is known from the rawchannel via altlist
01274     Int_t currentPlane=altList.GetPlane();  
01275     if (currentPlane>-1 && planes.first==-1){
01276       planes.first=currentPlane;
01277     }
01278     else if (currentPlane>-1 && currentPlane!=planes.first){
01279       planes.second=currentPlane;
01280     }
01281     
01282     MSG("LIPlexMaps",Msg::kDebug) 
01283       <<"Looping over VA: channel="<<i<<", plane1="<<planes.first
01284       <<", plane2="<<planes.second<<endl;    
01285 
01286     //jump out of loop if you have both planes
01287     if (planes.second>-1) break;
01288   }
01289 
01290   //sort the planes so lowest is first (except if only one plane
01291   Int_t tempPlane=planes.first;
01292   if (planes.second<planes.first  && planes.second!=-1){
01293     planes.first=planes.second;
01294     planes.second=tempPlane;
01295   }
01296 
01297   return planes;  
01298 }

string LILookup::GetVectorAsString ( std::vector< Int_t > &  v,
const std::string &  prefix = "" 
) const

Definition at line 768 of file LILookup.cxx.

References Form(), Msg::kDebug, Msg::kVerbose, and MSG.

00770 {
00771   MSG("LILookup",Msg::kVerbose) 
00772     <<"Running GetVectorAsString method..."<<endl;
00773 
00774   string sV="";
00775 
00776   MSG("LILookup",Msg::kVerbose)
00777     <<endl<<"Vector size = "<<v.size()<<", prefix="<<prefix<<endl;
00778 
00779   //loop over the vector
00780   for (UInt_t i=0;i<v.size();i++){
00781     if (i==0) sV+=prefix;
00782     sV+=Form("%d",static_cast<Int_t>(v[i]));
00783     MSG("LILookup",Msg::kVerbose)
00784       <<Form("%d",static_cast<Int_t>(v[i]))<<endl;
00785     if (i==v.size()-1) sV+="\n";
00786     else sV+=",";
00787   }
00788 
00789   MSG("LILookup",Msg::kDebug)<<"Returning string:"<<sV<<endl;
00790 
00791   MSG("LILookup",Msg::kVerbose) 
00792     <<"GetVectorAsString method finished"<<endl;
00793   return sV;
00794 }

string LILookup::GetVectorAsString ( std::vector< Double_t > &  v,
const std::string &  prefix = "" 
) const

Definition at line 738 of file LILookup.cxx.

References Form(), Msg::kDebug, Msg::kVerbose, and MSG.

Referenced by LIRun::PrintAll(), and LIPmt::PrintNearestNeighbours().

00740 {
00741   MSG("LILookup",Msg::kVerbose) 
00742     <<"Running GetVectorAsString method..."<<endl;
00743 
00744   string sV="";
00745 
00746   MSG("LILookup",Msg::kVerbose)
00747     <<endl<<"Vector size = "<<v.size()<<", prefix="<<prefix<<endl;
00748 
00749   //loop over the vector
00750   for (UInt_t i=0;i<v.size();i++){
00751     if (i==0) sV+=prefix;
00752     sV+=Form("%d",static_cast<Int_t>(v[i]));
00753     MSG("LILookup",Msg::kVerbose)
00754       <<Form("%d",static_cast<Int_t>(v[i]))<<endl;
00755     if (i==v.size()-1) sV+="\n";
00756     else sV+=",";
00757   }
00758 
00759   MSG("LILookup",Msg::kDebug)<<"Returning string:"<<sV<<endl;
00760 
00761   MSG("LILookup",Msg::kVerbose) 
00762     <<"GetVectorAsString method finished"<<endl;
00763   return sV;
00764 }

Double_t LILookup::GetVectorPoint ( const std::vector< Double_t > &  v,
UInt_t  point 
)

Definition at line 647 of file LILookup.cxx.

References Msg::kVerbose, Msg::kWarning, and MSG.

00649 {
00650   MSG("LILookup",Msg::kVerbose) 
00651     <<"Running GetVectorPoint method..."<<endl;
00652   
00653   if (point<v.size()) return v[point];
00654   else {
00655     MSG("LILookup",Msg::kWarning) 
00656       <<"Only "<<v.size()<<" elements available, returning -1"<<endl;
00657     return -1;
00658   }
00659 
00660   MSG("LILookup",Msg::kVerbose) 
00661     <<"GetVectorPoint method finished"<<endl;
00662 }

Int_t LILookup::Led2Ashtray ( Int_t  led,
Int_t  plane,
Int_t  detectorType 
)

Definition at line 1141 of file LILookup.cxx.

References FIRSTLED, FIRSTSCINTPLANE, Detector::kCalDet, Msg::kDebug, Detector::kFar, Detector::kNear, Msg::kWarning, LASTSM1SCINTPLANE, MSG, and NUMLEDS.

Referenced by LIAnalysis::MiswiringSearch(), and LISummarySorter::ReconstructStripEnd().

01142 {  //this should go in the plex!!
01143 
01144   MSG("LILookup",Msg::kDebug) 
01145     <<" ** Running the Led2Ashtray method... ** "<<endl;
01146 
01147   Int_t ashtray=-1;
01148 
01149   if (detectorType==Detector::kFar){
01150     Int_t led2Ashtray[20]={20,19,18,17,16,
01151                                 15,14,13,12,11,
01152                                 10, 9, 8, 7, 6,
01153                                 5, 4, 3, 2, 1};
01154     
01155     if (led>=FIRSTLED && led<=NUMLEDS){
01156       ashtray=led2Ashtray[led-1];
01157       //SM1
01158       if (plane>=FIRSTSCINTPLANE && plane<=LASTSM1SCINTPLANE){
01159         if((plane-1)%4>1){
01160           ashtray=ashtray-1;
01161           if(ashtray<1) ashtray=20;
01162         }
01163       }
01164       //SM2
01165       else{
01166         if ((plane%4)<2) {
01167           ashtray=ashtray-1;
01168           if(ashtray<1) ashtray=20;
01169         }
01170       }
01171     }
01172     MSG("LILookup_Led2Ashtray", Msg::kDebug) 
01173     <<"  ashtray="<<ashtray
01174     <<", led="<<led
01175     <<endl;
01176   }
01177   else if (detectorType==Detector::kCalDet){
01178     //you need to know the side as well to do this
01179     //see ryans webpage for details
01180     ashtray=-1;
01181   }
01182   else if (detectorType==Detector::kNear){
01183     //not implemented yet
01184     ashtray=-1;
01185   }
01186   else{
01187     MSG("LILookup",Msg::kWarning)
01188       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01189   }
01190 
01191   MSG("LILookup",Msg::kDebug) 
01192     <<" ** Finished the Led2Ashtray method **"<<endl;
01193   return ashtray;
01194 }

Int_t LILookup::NearOrFar ( Int_t  crate,
Int_t  pulserBox,
Int_t  farPulserBox,
Int_t  nearPulserBox,
Int_t  led,
Int_t  detectorType,
Int_t  plane,
Int_t  runNumber 
)

For CalDet: leds 1,2,3 are on the crate 1&2 side (ND, kWest, KPos) leds 4,5,6 are on the crate 0 side (FD, kEast, kNeg)

Definition at line 1624 of file LILookup.cxx.

References Detector::kCalDet, Msg::kDebug, Detector::kFar, kFarSide, Detector::kNear, kNearSide, kUnknownSide, Msg::kWarning, LASTPULSERBOX, and MSG.

Referenced by LIAnalysis::AdcDistribution(), LIAnalysis::AdcVsLed(), LIAnalysis::AdcVsPixel(), LIAnalysis::GainCurves(), LIAnalysis::HighGainSearch(), LIAnalysis::PmtGain(), LIAnalysis::PrintElec(), LIAnalysis::Reflectors(), LIAnalysis::ReflectorsGc(), LIAnalysis::StripVsPlane(), LIAnalysis::WriteGainCurveTextFile(), LIAnalysis::WriteGainsTextFile(), and LIAnalysis::WriteOldGainsTextFile().

01628 {
01629   MSG("LILookup",Msg::kDebug) 
01630     <<" ** Running the NearOrFar method... ** "<<endl;
01631 
01635 
01636   //modified 16/08/03 to include the fact that the ND electronics
01637   //at caldet now has 2 crates
01638 
01639   Int_t nearOrFar=kUnknownSide;
01640 
01641   if (detectorType==Detector::kFar){ 
01642 
01643     if (pulserBox<FIRSTPULSERBOX || pulserBox>LASTPULSERBOX){
01644       MSG("LILookup",Msg::kWarning)
01645         <<"Near or far determination not possible, PB out of range="
01646         <<pulserBox<<endl;      
01647     }
01648     else if (pulserBox==nearPulserBox){
01649       nearOrFar=kNearSide;
01650     }
01651     else if (pulserBox==farPulserBox){
01652       nearOrFar=kFarSide;
01653     }
01654     else{
01655       nearOrFar=kUnknownSide;
01656     }
01657   }
01658   else if (detectorType==Detector::kCalDet){  
01659 
01660     if (runNumber<80000){
01661       if (led==1 || led==2 || led==3){
01662         if (crate==1 || crate==2) nearOrFar=kNearSide;
01663         else if (crate==0) nearOrFar=kFarSide;
01664       }
01665       else if (led==4 || led==5 || led==6){
01666         if (crate==0) nearOrFar=kNearSide;
01667         else if (crate==1 || crate==2) nearOrFar=kFarSide;
01668       }
01669       else{
01670         MSG("LILookup",Msg::kWarning)
01671           <<"Near or far determination not possible for led = "
01672           <<led<<endl;      }
01673     }
01674     else{//section for near only running=pain in the arse
01675       //even planes have leds 1-3 as near leds
01676       //odd planes have leds 4-6 as near leds
01677       if (led==1 || led==2 || led==3){
01678         if (plane%2==0) nearOrFar=kNearSide;
01679         else if (plane%2==1) nearOrFar=kFarSide;
01680       }
01681       else if (led==4 || led==5 || led==6){
01682         if (plane%2==1) nearOrFar=kNearSide;
01683         else if (plane%2==0) nearOrFar=kFarSide;
01684       }
01685       else{
01686         MSG("LILookup",Msg::kWarning)
01687           <<"Near or far determination not possible for led = "
01688           <<led<<endl;
01689       }
01690     }
01691   }
01692   else if (detectorType==Detector::kNear){
01693     //always return kNearSide, it's all it can be!
01694     nearOrFar=kNearSide;
01695   }
01696   else {
01697     MSG("LILookup",Msg::kWarning)
01698       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01699   }
01700 
01701   MSG("LILookup",Msg::kDebug) 
01702     <<" ** Finished the NearOrFar method **"<<endl;
01703   return nearOrFar;
01704 }

Int_t LILookup::Pb2TrigPmtChannel ( Int_t  pulserBox,
Int_t  detectorType 
)

Definition at line 986 of file LILookup.cxx.

References FIRSTPULSERBOX, Detector::kCalDet, Msg::kDebug, Detector::kFar, Detector::kNear, Msg::kWarning, LASTPULSERBOX, and MSG.

Referenced by LISummarySorter::ReconstructTrigPmt().

00987 { 
00988   MSG("LILookup",Msg::kDebug) 
00989     <<" ** Running the Pb2TrigPmtChannel method... ** "<<endl;
00990 
00991   Int_t channel=-1;
00992 
00993   if (detectorType==Detector::kFar){
00994     //This list was made empirically by looking at the channels which had
00995     //saturated adc values
00996     Int_t pB2TrigPmtChannel[]=
00997       {14,  3, 12,  9,  6,
00998        11, 15,  4,  5, 16,
00999        7,  10, 13,  8,  2,
01000        17};
01001 
01002     if (pulserBox>=FIRSTPULSERBOX && pulserBox<=LASTPULSERBOX){ 
01003       channel=pB2TrigPmtChannel[pulserBox];
01004     }    
01005   }
01006   else if(detectorType==Detector::kCalDet){
01007     //varc 2 vmm 5 vfb 0 chip 1
01008     Int_t pB2TrigPmtChannel[]={4};
01009     
01010     if (pulserBox>=0){ 
01011       channel=pB2TrigPmtChannel[pulserBox];
01012     }    
01013   }
01014   else if(detectorType==Detector::kNear){
01015     //need to work out the tpmt channels for pb 1 and 2
01016     //QIE(0,16,0,14)
01017     Int_t pB2TrigPmtChannel[]={8,  14, -1};
01018     if (pulserBox>=FIRSTPULSERBOX && pulserBox<=LASTPULSERBOX){ 
01019       channel=pB2TrigPmtChannel[pulserBox];
01020     } 
01021     else{
01022       MSG("LILookup",Msg::kWarning)<<"No pulser box="<<pulserBox<<endl;
01023     }
01024   }
01025   else{
01026     MSG("LILookup",Msg::kWarning)
01027       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01028   }
01029 
01030   MSG("LILookup",Msg::kDebug) 
01031     <<" ** Finished the Pb2TrigPmtChannel method **"<<endl;
01032   return channel;
01033 }

Int_t LILookup::Plane2Crate ( Int_t  plane,
Int_t  side,
Int_t  detectorType 
)

Definition at line 1527 of file LILookup.cxx.

References Detector::kCalDet, Msg::kDebug, StripEnd::kEast, Detector::kFar, Detector::kNear, Msg::kWarning, StripEnd::kWest, MAXMSG, MSG, Plane2CrateEast(), and Plane2CrateWest().

Referenced by LIPlexMaps::ReadDbPulserDrift().

01528 {
01529   MSG("LILookup",Msg::kDebug) 
01530     <<" ** Running the Plane2Crate method... **"<<endl;
01531 
01532   Int_t crate=-1;
01533 
01534   if (detectorType==Detector::kFar){
01535     if (side==StripEnd::kEast){
01536       crate=Plane2CrateEast(plane,detectorType);
01537     }
01538     else if (side==StripEnd::kWest){
01539       crate=Plane2CrateWest(plane,detectorType);
01540     }
01541     //else crate stays as -1
01542   }
01543   else if (detectorType==Detector::kCalDet){
01544 
01545     //this gets a bit messy for near only running
01546     if (side==StripEnd::kEast){
01547       crate=0;
01548     }
01549     if (side==StripEnd::kWest){
01550       crate=1;
01551     }
01552     //else crate stays as -1
01553   }
01554   else if (detectorType==Detector::kNear){
01555     MAXMSG("LILookup",Msg::kWarning,3)
01556       <<"Detector Type = "<<detectorType
01557       <<" not supported properly yet, returning crate=0"<<endl;
01558     crate=0;
01559   }
01560   else {
01561     MSG("LILookup",Msg::kWarning)
01562       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01563   }
01564 
01565   MSG("LILookup",Msg::kDebug) 
01566     <<" ** Finished the Plane2Crate method **"<<endl;
01567   return crate;
01568 }

Int_t LILookup::Plane2CrateEast ( Int_t  plane,
Int_t  detectorType 
)

For CalDet assume that east is left and west is right

Definition at line 1572 of file LILookup.cxx.

References Detector::kCalDet, Msg::kDebug, Detector::kFar, Msg::kWarning, MSG, and Plane2PbEast().

Referenced by LIAnalysis::AdcVsPixel(), and Plane2Crate().

01573 {
01574   MSG("LILookup",Msg::kDebug) 
01575     <<" ** Running the Plane2CrateEast method... **"<<endl;
01576 
01578 
01579   Int_t crate=-1;
01580 
01581   if (detectorType==Detector::kFar){
01582     crate=Plane2PbEast(plane);//pb and cr have the same numbers
01583   }
01584   else if (detectorType==Detector::kCalDet){
01585     crate=0;//the left side
01586   }
01587   else {
01588     MSG("LILookup",Msg::kWarning)
01589       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01590   }
01591   
01592   MSG("LILookup",Msg::kDebug) 
01593     <<" ** Finished the Plane2CrateEast method **"<<endl;
01594   return crate;
01595 }

Int_t LILookup::Plane2CrateWest ( Int_t  plane,
Int_t  detectorType 
)

Definition at line 1599 of file LILookup.cxx.

References Detector::kCalDet, Msg::kDebug, Detector::kFar, Msg::kWarning, MSG, and Plane2PbWest().

Referenced by LIAnalysis::AdcVsPixel(), and Plane2Crate().

01600 {
01601   MSG("LILookup",Msg::kDebug) 
01602     <<" ** Running the Plane2CrateWest method... ** "<<endl;
01603 
01604   Int_t crate=-1;
01605 
01606   if (detectorType==Detector::kFar){
01607     crate=Plane2PbWest(plane);//pb and cr have the same numbers
01608   }
01609   else if (detectorType==Detector::kCalDet){
01610     crate=1;//the right side
01611   }
01612   else {
01613     MSG("LILookup",Msg::kWarning)
01614       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01615   }
01616 
01617   MSG("LILookup",Msg::kDebug) 
01618     <<" ** Finished the Plane2CrateWest method **"<<endl;
01619   return crate;
01620 }

Int_t LILookup::Plane2Pb ( Int_t  plane,
Int_t  side 
)

Definition at line 1463 of file LILookup.cxx.

References Msg::kDebug, StripEnd::kEast, Msg::kInfo, StripEnd::kWest, MSG, Plane2PbEast(), and Plane2PbWest().

01464 {
01465   MSG("LILookup",Msg::kDebug) 
01466     <<" ** Running the Plane2Pb method... ** "<<endl;
01467 
01468   Int_t pulserBox=-1;
01469 
01470   if (side==StripEnd::kEast){
01471     pulserBox=Plane2PbEast(plane);
01472   }
01473   if (side==StripEnd::kWest){
01474     if (side!=2) MSG("LILookup",Msg::kInfo)<<"Convention error!"<<endl; 
01475     pulserBox=Plane2PbWest(plane);
01476   }
01477   //else pulser box stays as -1
01478 
01479   MSG("LILookup",Msg::kDebug) 
01480     <<" ** Finished the Plane2Pb method **"<<endl;
01481   return pulserBox;
01482 }

Int_t LILookup::Plane2PbEast ( Int_t  plane  ) 

Definition at line 1486 of file LILookup.cxx.

References FIRSTSCINTPLANE, Msg::kDebug, LASTSCINTPLANE, LASTSM1SCINTPLANE, MSG, PB10STARTPLANE, PB12STARTPLANE, PB14STARTPLANE, PB2STARTPLANE, PB4STARTPLANE, PB6STARTPLANE, and PB8STARTPLANE.

Referenced by Plane2CrateEast(), Plane2Pb(), and Plane2PbWest().

01487 {
01488   MSG("LILookup",Msg::kDebug) 
01489     <<" ** Running the Plane2PbEast method... ** "<<endl;
01490 
01491   Int_t pulserBox=-1;
01492 
01493   if (plane>=FIRSTSCINTPLANE && plane<PB2STARTPLANE) pulserBox=0;
01494   else if (plane>=PB2STARTPLANE && plane<PB4STARTPLANE) pulserBox=2;
01495   else if (plane>=PB4STARTPLANE && plane<PB6STARTPLANE) pulserBox=4;
01496   else if (plane>=PB6STARTPLANE && plane<=LASTSM1SCINTPLANE) pulserBox=6;
01497   else if (plane>=PB8STARTPLANE && plane<PB10STARTPLANE) pulserBox=8;
01498   else if (plane>=PB10STARTPLANE && plane<PB12STARTPLANE) pulserBox=10;
01499   else if (plane>=PB12STARTPLANE && plane<PB14STARTPLANE) pulserBox=12;
01500   else if (plane>=PB14STARTPLANE && plane<=LASTSCINTPLANE) pulserBox=14;
01501 
01502   MSG("LILookup",Msg::kDebug) 
01503     <<" ** Finished the Plane2PbEast method **"<<endl;
01504   return pulserBox;
01505 }

Int_t LILookup::Plane2PbWest ( Int_t  plane  ) 

Definition at line 1509 of file LILookup.cxx.

References Msg::kDebug, MSG, NUMPULSERBOXES, and Plane2PbEast().

Referenced by Plane2CrateWest(), and Plane2Pb().

01510 {
01511   MSG("LILookup",Msg::kDebug) 
01512     <<" ** Running the Plane2PbWest method... ** "<<endl;
01513 
01514   Int_t pulserBox=-1;
01515   pulserBox=Plane2PbEast(plane);
01516   if (pulserBox>=0 && pulserBox<NUMPULSERBOXES){
01517     pulserBox++;//west pulser box is always one more than east
01518   }
01519 
01520   MSG("LILookup",Msg::kDebug) 
01521     <<" ** Finished the Plane2PbWest method **"<<endl;
01522   return pulserBox;
01523 }

void LILookup::SetDetector ( Int_t  det  ) 

Definition at line 155 of file LILookup.cxx.

References bfld::AsString(), FIRSTASHTRAY, FIRSTCHIP, FIRSTCRATE, FIRSTEND, FIRSTLED, FIRSTMUX, FIRSTPIXEL, FIRSTPIXELSPOT, FIRSTPLANE, FIRSTPMT, FIRSTPULSERBOX, FIRSTRACK, FIRSTSCINTPLANE, FIRSTSIDE, FIRSTSM2PLANE, FIRSTSM2SCINTPLANE, FIRSTSPECTROMETERPLANE, FIRSTSTRIP, FIRSTVACHANNEL, FIRSTVARC, FIRSTVFB, FIRSTVMM, Detector::kCalDet, Detector::kFar, Msg::kInfo, Detector::kNear, Msg::kWarning, LASTASHTRAY, LASTCHIP, LASTCRATE, LASTEND, LASTLED, LASTMUX, LASTPIXEL, LASTPIXELSPOT, LASTPLANE, LASTPMT, LASTPULSERBOX, LASTRACK, LASTSCINTPLANE, LASTSIDE, LASTSM1SCINTPLANE, LASTSTRIP, LASTVACHANNEL, LASTVARC, LASTVFB, LASTVMM, MSG, NUMASHTRAYS, NUMBOOKENDS, NUMCHADD, NUMCHANNELS, NUMCHIPS, NUMCRATES, NUMENDS, NUMLEDS, NUMLEVELS, NUMMUX, NUMPINGAINS, NUMPIXELS, NUMPIXELSPOTS, NUMPLANES, NUMPMTS, NUMPULSERBOXES, NUMPULSERBOXESCURRENT, NUMRACKLEVELS, NUMRACKS, NUMSIDES, NUMSTRIPS, NUMVACHANNELS, NUMVARCS, NUMVFBS, NUMVMMS, PB0STARTPLANE, PB10STARTPLANE, PB12STARTPLANE, PB14STARTPLANE, PB2STARTPLANE, PB4STARTPLANE, PB6STARTPLANE, PB8STARTPLANE, SECONDEND, SM1BOOKEND, and SM2BOOKEND.

Referenced by LIPlexMaps::CompareStripToStrip(), LIPlexMaps::DriftWithTime(), LIPlexMaps::DumpCalStripAtten(), LIAnalysis::LIAnalysis(), LIPlexMaps::MakeCalStripAtten(), LIPlexMaps::MakeCalStripToStrip(), LIPlexMaps::ReadDbCalStripAtten(), LIPlexMaps::ReadDbCalStripToStrip(), LIPlexMaps::ReadDbGains(), LIPlexMaps::ReadDbPulserDrift(), and LISummarySorter::SetDetector().

00156 {
00157 
00158   MSG("LILookup", Msg::kInfo)
00159     <<"Setting Detector specific variables using detector type: "
00160     <<Detector::AsString(static_cast<Detector::
00161                              Detector_t>(det))<<endl; 
00162 
00163   if (det==Detector::kCalDet){
00167     FIRSTSTRIP=0;
00168     LASTSTRIP=23;
00169     NUMSTRIPS=24;
00170     
00171     FIRSTLED=1;
00172     LASTLED=6;
00173     NUMLEDS=6;
00174 
00175     FIRSTASHTRAY=1;
00176     LASTASHTRAY=3;
00177     NUMASHTRAYS=3;
00178 
00179     FIRSTPULSERBOX=0;
00180     LASTPULSERBOX=0;
00181     NUMPULSERBOXES=1;
00182     NUMPULSERBOXESCURRENT=1;
00183 
00184     FIRSTPMT=0;
00185     LASTPMT=2;
00186     NUMPMTS=3;
00187 
00188     FIRSTPIXEL=0;
00189     LASTPIXEL=15;
00190     NUMPIXELS=16;
00191 
00192     FIRSTPIXELSPOT=0;
00193     LASTPIXELSPOT=7;
00194     NUMPIXELSPOTS=8;
00195 
00196     NUMCHADD=8000;
00197     NUMCHANNELS=8000;
00198 
00199     FIRSTCRATE=0;
00200     LASTCRATE=2;
00201     NUMCRATES=3;
00202 
00203     FIRSTVARC=0;
00204     LASTVARC=3; 
00205     NUMVARCS=4;
00206 
00207     FIRSTVMM=0;
00208     LASTVMM=5;
00209     NUMVMMS=6;
00210 
00211     FIRSTVFB=0;
00212     LASTVFB=1;
00213     NUMVFBS=2;
00214 
00215     FIRSTCHIP=0;
00216     LASTCHIP=2;
00217     NUMCHIPS=3;
00218 
00219     FIRSTVACHANNEL=0;
00220     LASTVACHANNEL=21;
00221     NUMVACHANNELS=22;
00222 
00223     FIRSTSIDE=1;
00224     LASTSIDE=2;
00225     NUMSIDES=2;
00226 
00227     FIRSTEND=1;
00228     LASTEND=2;
00229     SECONDEND=2;
00230     NUMENDS=2;
00231 
00232     NUMRACKLEVELS=2;
00233     NUMLEVELS=3;
00234 
00235     FIRSTRACK=1;
00236     LASTRACK=16;
00237     NUMRACKS=16;
00238 
00239     FIRSTMUX=0;
00240     LASTMUX=7;
00241     NUMMUX=8;
00242 
00243     NUMPINGAINS=2;
00244 
00245     PB0STARTPLANE=0;  //  0- 59 inclusive
00246 
00247     //<Rubbish for CalDet but keep>
00248     PB2STARTPLANE=0; 
00249     PB4STARTPLANE=0; 
00250     PB6STARTPLANE=0; 
00251     PB8STARTPLANE=0; 
00252     PB10STARTPLANE=0;
00253     PB12STARTPLANE=0;
00254     PB14STARTPLANE=0;
00255     //</Rubbish for CalDet but keep>
00256 
00257     FIRSTPLANE=0;
00258     FIRSTSCINTPLANE=0;
00259     LASTSM1SCINTPLANE=59;
00260 
00261     FIRSTSM2PLANE=0;
00262 
00263     //<Rubbish for CalDet but keep>
00264     FIRSTSM2SCINTPLANE=0;
00265     //</Rubbish for CalDet but keep>
00266 
00267     LASTSCINTPLANE=59;
00268     LASTPLANE=59;
00269     NUMPLANES=60;
00270     //the total number of instrumented planes will be 60 since
00271     //there are no bookends at CalDet
00272 
00273     NUMBOOKENDS=0;
00274     SM1BOOKEND=-1;//steel only plane
00275     SM2BOOKEND=-1;//steel only plane
00276 
00277     FIRSTSPECTROMETERPLANE=10000;//nonsense for FD and CD
00278   }
00279   else if (det==Detector::kFar){
00283     FIRSTSTRIP=0;
00284     LASTSTRIP=191;
00285     NUMSTRIPS=192;
00286 
00287     FIRSTLED=1;
00288     LASTLED=20;
00289     NUMLEDS=20;
00290 
00291     FIRSTASHTRAY=1;
00292     LASTASHTRAY=20;
00293     NUMASHTRAYS=20;
00294 
00295     FIRSTPULSERBOX=0;
00296     LASTPULSERBOX=15;
00297     NUMPULSERBOXES=16;
00298     NUMPULSERBOXESCURRENT=14;
00299 
00300     FIRSTPMT=0;
00301     LASTPMT=2;
00302     NUMPMTS=3;
00303 
00304     FIRSTPIXEL=0;
00305     LASTPIXEL=15;
00306     NUMPIXELS=16;
00307 
00308     FIRSTPIXELSPOT=0;
00309     LASTPIXELSPOT=7;
00310     NUMPIXELSPOTS=8;
00311 
00312     NUMCHADD=8000;
00313     NUMCHANNELS=8000;
00314 
00315     FIRSTCRATE=0;
00316     LASTCRATE=15;
00317     NUMCRATES=16;
00318 
00319     FIRSTVARC=0;
00320     LASTVARC=3; 
00321     NUMVARCS=4;
00322 
00323     FIRSTVMM=0;
00324     LASTVMM=5;
00325     NUMVMMS=6;
00326 
00327     FIRSTVFB=0;
00328     LASTVFB=1;
00329     NUMVFBS=2;
00330 
00331     FIRSTCHIP=0;
00332     LASTCHIP=2;
00333     NUMCHIPS=3;
00334 
00335     FIRSTVACHANNEL=0;
00336     LASTVACHANNEL=21;
00337     NUMVACHANNELS=22;
00338 
00339     NUMSIDES=2;
00340     FIRSTSIDE=1;
00341     LASTSIDE=2;
00342 
00343     FIRSTEND=1;
00344     LASTEND=2;
00345     SECONDEND=2;
00346     NUMENDS=2;
00347 
00348     NUMRACKLEVELS=2;
00349     NUMLEVELS=3;
00350     
00351     FIRSTRACK=1;
00352     LASTRACK=16;
00353     NUMRACKS=16;
00354 
00355     FIRSTMUX=0;
00356     LASTMUX=7;
00357     NUMMUX=8;
00358 
00359     NUMPINGAINS=2;
00360 
00361     PB0STARTPLANE=0;  //  0- 64 inclusive
00362     PB2STARTPLANE=65;  // 65-128
00363     PB4STARTPLANE=129; //129-192
00364     PB6STARTPLANE=193; //193-248
00365     PB8STARTPLANE=249; //249-313
00366     PB10STARTPLANE=314;//314-377
00367     PB12STARTPLANE=378;//378-441
00368     PB14STARTPLANE=442;//442-485
00369 
00370     FIRSTPLANE=0;
00371     FIRSTSCINTPLANE=1;
00372     LASTSM1SCINTPLANE=248;
00373 
00374     FIRSTSM2PLANE=249;
00375     FIRSTSM2SCINTPLANE=250;
00376     LASTSCINTPLANE=485;
00377     LASTPLANE=485;
00378     NUMPLANES=486;
00379 
00380     NUMBOOKENDS=2;
00381     SM1BOOKEND=0;//steel only plane
00382     SM2BOOKEND=249;//steel only plane
00383 
00384     FIRSTSPECTROMETERPLANE=10000;//nonsense for FD and CD
00385 
00386     //the total number of instrumented planes will be 484 since
00387     //0 and 249 are bookends
00388   }
00389   else if (det==Detector::kNear){
00393     FIRSTSTRIP=0;
00394     LASTSTRIP=95;
00395     NUMSTRIPS=96;
00396 
00397     FIRSTLED=1;
00398     LASTLED=40;
00399     NUMLEDS=40;
00400 
00401     FIRSTASHTRAY=1;//?
00402     LASTASHTRAY=20;
00403     NUMASHTRAYS=20;
00404 
00405     FIRSTPULSERBOX=0;
00406     LASTPULSERBOX=2;
00407     NUMPULSERBOXES=3;
00408     NUMPULSERBOXESCURRENT=3;
00409 
00410     FIRSTPMT=0;//?
00411     LASTPMT=0;
00412     NUMPMTS=0;
00413 
00414     FIRSTPIXEL=0;
00415     LASTPIXEL=63;
00416     NUMPIXELS=64;
00417 
00418     FIRSTPIXELSPOT=0;
00419     LASTPIXELSPOT=0;
00420     NUMPIXELSPOTS=1;
00421 
00422     NUMCHADD=50000;//?
00423     NUMCHANNELS=50000;
00424 
00425     FIRSTCRATE=0;//?
00426     LASTCRATE=7;
00427     NUMCRATES=8;
00428 
00429     //<Rubbish for NearDet but keep>
00430     FIRSTVARC=0;
00431     LASTVARC=0; 
00432     NUMVARCS=0;
00433 
00434     FIRSTVMM=0;
00435     LASTVMM=0;
00436     NUMVMMS=0;
00437 
00438     FIRSTVFB=0;
00439     LASTVFB=0;
00440     NUMVFBS=0;
00441 
00442     FIRSTCHIP=0;
00443     LASTCHIP=0;
00444     NUMCHIPS=0;
00445 
00446     FIRSTVACHANNEL=0;
00447     LASTVACHANNEL=0;
00448     NUMVACHANNELS=0;
00449     //</Rubbish for NearDet but keep>
00450 
00451     NUMSIDES=1;
00452     FIRSTSIDE=1;//?
00453     LASTSIDE=1;//?
00454 
00455     FIRSTEND=2;//?
00456     LASTEND=2;
00457     SECONDEND=2;
00458     NUMENDS=1;
00459 
00460     NUMRACKLEVELS=2;
00461     NUMLEVELS=2;
00462     
00463     FIRSTRACK=1;//?
00464     LASTRACK=16;
00465     NUMRACKS=16;
00466 
00467     //<Rubbish for NearDet but keep>
00468     FIRSTMUX=0;
00469     LASTMUX=0;
00470     NUMMUX=0;
00471     //</Rubbish for NearDet but keep>
00472 
00473     NUMPINGAINS=2;
00474 
00475     PB0STARTPLANE=0;   //  0-120 inclusive
00476     PB2STARTPLANE=121; //121-281
00477 
00478     //<Rubbish for NearDet but keep>
00479     PB4STARTPLANE=0;
00480     PB6STARTPLANE=0;
00481     PB8STARTPLANE=0;
00482     PB10STARTPLANE=0;
00483     PB12STARTPLANE=0;
00484     PB14STARTPLANE=0;
00485     //<Rubbish for NearDet but keep>
00486 
00487     FIRSTPLANE=0;
00488     FIRSTSCINTPLANE=1;
00489 
00490     LASTSM1SCINTPLANE=120;//end of forward section not SM obviously
00491     FIRSTSM2PLANE=121;
00492     FIRSTSM2SCINTPLANE=121;
00493     LASTSCINTPLANE=281;
00494     LASTPLANE=281;
00495     NUMPLANES=282;
00496 
00497     NUMBOOKENDS=2;
00498     SM1BOOKEND=0;//steel only plane
00499     //consider SM2BE to be first steel-only plane in ND spectrometer
00500     SM2BOOKEND=122;//steel only plane
00501 
00502     //this is ND only
00503     FIRSTSPECTROMETERPLANE=121;
00504 
00505     //the total number of instrumented planes will be 153 since
00506     //0 is a bookend and 32*4=128 are uninstrumented in the spectrometer
00507 
00508     //Different regions in the ND:
00509     //Breakdown of number of planes:
00510     // Veto=21 planes numbered 0-20 (1st is steel bookend)
00511     // Target=40 planes numbered 21-60
00512     // Shower=60 planes numbered 61-120
00513     // Spectrometer=161 planes 121-281
00514     //   First and last are instrumented
00515     //   33 have scintillator, 128 are steel
00516     //   4 steel planes for each one with scintillator,
00517     //   Altogether: 5*32=160, 160+1 at end=161
00518 
00519     //Number of strips:
00520     //Forward section:
00521     //96 planes with 64 strips
00522     //24 planes with 96 strips
00523     //Spectrometer section:
00524     //33 planes with 96 strips
00525     //96+24+33=153 instrumented in total
00526   }
00527   else{
00528     MSG("LILookup",Msg::kWarning)
00529       <<"Detector Type="<<det<<" not supported yet"<<endl;
00530   }
00531 }

void LILookup::SetNewPoint ( std::vector< Double_t > &  v,
Double_t  value,
UInt_t  i 
)

Referenced by LIRun::AddPoint().

void LILookup::SetPbPlanes ( Int_t *  planeMin,
Int_t *  planeMax,
Int_t  detectorType 
)

Definition at line 1037 of file LILookup.cxx.

References FIRSTPLANE, FIRSTPULSERBOX, FIRSTSCINTPLANE, Detector::kCalDet, Msg::kDebug, Detector::kFar, Msg::kInfo, Detector::kNear, Msg::kWarning, LASTPLANE, MSG, NUMCRATES, NUMPULSERBOXES, PB0STARTPLANE, PB10STARTPLANE, PB12STARTPLANE, PB14STARTPLANE, PB2STARTPLANE, PB4STARTPLANE, PB6STARTPLANE, and PB8STARTPLANE.

Referenced by LIAnalysis::AshtrayVsPlane(), LIPlexMaps::MakePlexStripEndToLed(), LIAnalysis::PixelVsPlane(), LIPlexMaps::RatioRawToRefDrift(), LIPlexMaps::ReadDbGains(), LIPlexMaps::ReadDbPulserDrift(), LIPlexMaps::ReadDbPulserRawGain(), LIAnalysis::StripVsPlane(), and LIAnalysis::WriteOldGainsTextFile().

01039 { 
01040   MSG("LILookup",Msg::kDebug) 
01041     <<" ** Running the SetPbPlanes method... ** "<<endl;
01042 
01043   if (detectorType==Detector::kFar){
01044     for (Int_t j=0;j<2;j++){    
01045       planeMin[0+j]=PB0STARTPLANE;
01046       planeMax[0+j]=PB2STARTPLANE;
01047       planeMin[2+j]=PB2STARTPLANE;
01048       planeMax[2+j]=PB4STARTPLANE;
01049       planeMin[4+j]=PB4STARTPLANE;
01050       planeMax[4+j]=PB6STARTPLANE;
01051       planeMin[6+j]=PB6STARTPLANE;
01052       planeMax[6+j]=PB8STARTPLANE;
01053       planeMin[8+j]=PB8STARTPLANE;
01054       planeMax[8+j]=PB10STARTPLANE;
01055       planeMin[10+j]=PB10STARTPLANE;
01056       planeMax[10+j]=PB12STARTPLANE;
01057       planeMin[12+j]=PB12STARTPLANE;
01058       planeMax[12+j]=PB14STARTPLANE;
01059       planeMin[14+j]=PB14STARTPLANE;
01060       planeMax[14+j]=LASTPLANE+1;
01061     }
01062   }
01063   else if (detectorType==Detector::kCalDet){
01064     for (Int_t j=0;j<2;j++){    
01065       planeMin[0+j]=FIRSTPLANE;
01066       planeMax[0+j]=LASTPLANE+1;
01067       
01068       if (NUMCRATES==3){
01069         MSG("LILookup",Msg::kInfo)
01070           <<"Setting 3rd crate plane min and max - hack"<<endl;
01071         planeMin[2]=FIRSTSCINTPLANE;
01072         planeMax[2]=LASTPLANE+1;
01073       }
01074     }
01075   }
01076 
01077   // Near Detector:
01078   // pulser box 0 serves the spectrometer
01079   // pulser boxes 1,2 both serve the whole calorimeter
01080   // 1 the V planes and 2 the U planes
01081 
01082   //  else if (detectorType==Detector::kNear){
01083   //  planeMin[0] = FIRSTSPECTROMETERPLANE;
01084   //  planeMax[0] = LASTPLANE;
01085   //  for (Int_t j=1;j<NUMPULSERBOXES;j++){
01086   //    planeMin[j] = FIRSTSCINTPLANE;
01087   //    planeMax[j] = FIRSTSPECTROMETERPLANE;
01088   //  }
01089   // }
01090   
01091   // At the moment, use whole detector. All the gains will be in the
01092   // crate 0 plot.
01093 
01094   else if (detectorType==Detector::kNear){
01095     for (Int_t j=0;j<NUMCRATES;j++){  
01096       planeMin[j]=FIRSTPLANE;
01097       planeMax[j]=LASTPLANE+1;
01098     }
01099   }
01100   else{
01101     MSG("LILookup",Msg::kWarning)
01102       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01103   }
01104   
01105   for (Int_t j=FIRSTPULSERBOX;j<NUMPULSERBOXES;j++){    
01106     MSG("LILookup",Msg::kInfo) 
01107       <<"PulserBox "<<j<<" has planes "<<planeMin[j]<<" -> " 
01108       <<planeMax[j]-1<<" inclusive"<<endl;
01109   }
01110   
01111   MSG("LILookup",Msg::kDebug) 
01112     <<" ** Finished the SetPbPlanes method **"<<endl;
01113 }

Int_t LILookup::Strip2Ashtray ( Int_t  strip,
Int_t  detectorType 
)

Definition at line 1198 of file LILookup.cxx.

References Msg::kDebug, Detector::kFar, Msg::kWarning, MSG, and NUMSTRIPS.

01199 {
01200   MSG("LILookup",Msg::kDebug) 
01201     <<" ** Running the Strip2Ashtray method... ** "<<endl;
01202 
01203   Int_t ashtray=-1;
01204 
01205   if (detectorType==Detector::kFar){
01206     Int_t strip2Ashtray[192]={ 1,1,1,1,1,1,1,1,
01207                                      2,2,2,2,2,2,2,2,2,2,
01208                                      3,3,3,3,3,3,3,3,3,3,
01209                                      4,4,4,4,4,4,4,4,
01210                                      5,5,5,5,5,5,5,5,5,5,
01211                                      6,6,6,6,6,6,6,6,6,6,
01212                                      7,7,7,7,7,7,7,7,7,7,
01213                                      8,8,8,8,8,8,8,8,8,8,
01214                                      9,9,9,9,9,9,9,9,9,9,
01215                                      10,10,10,10,10,10,10,10,10,10,
01216                                      11,11,11,11,11,11,11,11,11,11,
01217                                      12,12,12,12,12,12,12,12,12,12,
01218                                      13,13,13,13,13,13,13,13,13,13,
01219                                      14,14,14,14,14,14,14,14,14,14,
01220                                      15,15,15,15,15,15,15,15,15,15,
01221                                      16,16,16,16,16,16,16,16,16,16,
01222                                      17,17,17,17,17,17,17,17,
01223                                      18,18,18,18,18,18,18,18,18,18,
01224                                      19,19,19,19,19,19,19,19,19,19,
01225                                      20,20,20,20,20,20,20,20};
01226     if (strip>=0 && strip<NUMSTRIPS){
01227       ashtray=strip2Ashtray[strip];
01228     }
01229   }
01230   else{
01231     MSG("LILookup",Msg::kWarning)
01232       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01233   }
01234   
01235   MSG("LILookup",Msg::kDebug) 
01236     <<" ** Finished the Strip2Ashtray method **"<<endl;
01237   return ashtray;
01238 }

Int_t LILookup::Strip2Led ( Int_t  strip,
Int_t  plane,
Int_t  detectorType,
Int_t  crate = 0 
)

Definition at line 1352 of file LILookup.cxx.

References Detector::kCalDet, Msg::kDebug, Detector::kFar, Msg::kWarning, MSG, and NUMSTRIPS.

Referenced by LIPlexMaps::MakePlexStripEndToLed().

01354 {
01355   MSG("LILookup",Msg::kDebug) 
01356     <<" ** Running the Strip2Led method... ** "<<endl;
01357 
01358   Int_t led=-1;
01359   
01360   if (detectorType==Detector::kFar){
01361     Int_t strip2Led[192]={ 20,20,20,20,20,20,20,20,
01362                            19,19,19,19,19,19,19,19,19,19,
01363                            18,18,18,18,18,18,18,18,18,18,
01364                            17,17,17,17,17,17,17,17,
01365                            16,16,16,16,16,16,16,16,16,16,
01366                            15,15,15,15,15,15,15,15,15,15,
01367                            14,14,14,14,14,14,14,14,14,14,
01368                            13,13,13,13,13,13,13,13,13,13,
01369                            12,12,12,12,12,12,12,12,12,12,
01370                            11,11,11,11,11,11,11,11,11,11,
01371                            10,10,10,10,10,10,10,10,10,10,
01372                            9,9,9,9,9,9,9,9,9,9,
01373                            8,8,8,8,8,8,8,8,8,8,
01374                            7,7,7,7,7,7,7,7,7,7,
01375                            6,6,6,6,6,6,6,6,6,6,
01376                            5,5,5,5,5,5,5,5,5,5,
01377                            4,4,4,4,4,4,4,4,
01378                            3,3,3,3,3,3,3,3,3,3,
01379                            2,2,2,2,2,2,2,2,2,2,
01380                            1,1,1,1,1,1,1,1};
01381     
01382     if (strip>=0 && strip<NUMSTRIPS){
01383       led=strip2Led[strip];
01384 
01385       //due to the strange cyclic permutation caused by a mux box
01386       //numbering scheme cock up and another cock up to do with which
01387       //led was 1 and which was 20 you have the following complicated
01388       //scheme
01389       //SM1
01390       if (plane<249 && plane>0){
01391         if((plane-1)%4>1){
01392           led=led-1;
01393           if(led<1) led=20;
01394         }
01395       }
01396       //SM2
01397       else{
01398         if ((plane%4)<2) {
01399           led=led-1;
01400           if(led<1) led=20;
01401         }
01402       }
01403     }
01404   }
01405   else if (detectorType==Detector::kCalDet){
01406     //Thanks to Ryan for this piece of code
01407 
01408     //On the kPos=kWest=ND side the leds in plane 40 and 50 are switched
01409     //On the kNeg=kEast=FD side the leds in plane 56 and 58 were
01410     //switched but not since March 2003
01411     
01412     if(plane>59 || plane <0) {
01413       return -1;
01414     }
01415     
01416     //for crate 1 and 2
01417     if (crate==1 || crate ==2)
01418       if (strip<4) {
01419         if (plane==40) return 2;
01420         if ((plane%4)==0||(plane%4)==1) return 1;
01421         return 2;
01422       } 
01423       else if (strip<14) {
01424         if (plane==50) return 3;
01425         if (plane==40) return 1;
01426         if ((plane%4)==0||(plane%4)==1) return 2;
01427         return 1;
01428       } 
01429       else {
01430         if (plane==50) return 1;
01431         return 3;
01432       }
01433     //for crate 0
01434     else if (crate==0){
01435       if (strip<10) {
01436         //if (plane==56||plane==58||plane==12 ) return 4;
01437         return 6;
01438       } 
01439       else if (strip<20) {
01440         //if (plane==58) return 6;
01441         if ((plane%4)==0 || (plane%4)==1) return 5;
01442         return 4;
01443       } 
01444       else {
01445         //if(plane==56 || plane==12 ) return 6;
01446         if ((plane%4)==0 || (plane%4)==1) return 4;
01447         return 5;
01448       }
01449     }
01450   }
01451   else{
01452     MSG("LILookup",Msg::kWarning)
01453       <<"Detector Type = "<<detectorType<<" not supported yet"<<endl;
01454   }
01455   
01456   MSG("LILookup",Msg::kDebug) 
01457     <<" ** Finished the Strip2Led method **"<<endl;
01458   return led;
01459 }

TGraphAsymmErrors* LILookup::TGraphAsymmErrorsVectEY ( std::vector< Double_t > &  vX,
std::vector< Double_t > &  vY,
std::vector< Double_t > &  vEX,
std::vector< Double_t > &  vEY 
)
TGraph* LILookup::TGraphVect ( std::vector< Double_t > &  vX,
std::vector< Double_t > &  vY 
)
void LILookup::UnencodePlnStripEndKey ( Int_t  plnStripEndKey,
Detector::Detector_t  det,
Int_t &  plane,
Int_t &  strip,
Int_t &  stripEnd 
)

Definition at line 1708 of file LILookup.cxx.

References Detector::kCalDet, Msg::kDebug, Detector::kFar, Detector::kNear, Msg::kWarning, and MSG.

Referenced by LIPlexMaps::DriftWithTime(), LIPlexMaps::DumpGains(), LIPlexMaps::GainDifference(), LIPlexMaps::GainDifferenceSvP(), LIPlexMaps::RatioRawToRefDrift(), LIPlexMaps::ReadDbGains(), LIPlexMaps::ReadDbPulserDrift(), and LIPlexMaps::ReadDbPulserRawGain().

01712 {
01713   MSG("LILookup",Msg::kDebug) 
01714     <<" ** Running the UnencodePlnStripEndKey method... ** "<<endl;
01715 
01716   //this bit was stolen from the plex
01717   Int_t nStrips = 192;  // need some default
01718   switch (det) {
01719   case Detector::kNear:   nStrips =  96; break;
01720   case Detector::kFar:    nStrips = 192; break;
01721   case Detector::kCalDet: nStrips =  24; break;
01722   default:
01723     MSG("LILookup",Msg::kWarning)
01724       <<"Detector Type is not Near/Far/CalDet"<<endl;
01725   }
01726 
01727   //the strip end is stored as the lowest bit so need to shift 
01728   //that bit off before dividing by nStrips
01729   //kEast is stored as a 0 and kWest as a 1 so need to add one
01730   //to get to their actual values
01731 
01732   //EXCEPT the ND does not have a strip end stored - no point!!!
01733 
01734   //00245    if (det == Detector::kNear) {
01735   //00246       // near detector only has west readout
01736   //00247      if (end != StripEnd::kWest) {
01737   //00248        MAXMSG("Plex",Msg::kWarning,10)
01738   //00249          << "PlexStripEndId " << *this << " has non-West readout" << endl;
01739   //00250      // but do nothing
01740   //00251      }
01741   //00252    }
01742   //00253    else {
01743   //00254       // make room for end bit
01744   //00255       hvalue <<= 1;
01745   //00256       switch (GetEnd()) {
01746   //00257       case StripEnd::kEast: hvalue += 0; break;
01747   //00258       case StripEnd::kWest: hvalue += 1; break;
01748   //0/0259       default:
01749   //00260          MAXMSG("Plex",Msg::kWarning,10)
01750   //00261             << "PlexStripEndId " << *this << " is not East/West" << endl;
01751   //00262       }
01752   //00263    }
01753 
01754   if (det==Detector::kFar || det==Detector::kCalDet){
01755     plane=(plnStripEndKey>>1)/nStrips;
01756     strip=(plnStripEndKey>>1)%nStrips;
01757     //look at only the lowest bit
01758     stripEnd=(plnStripEndKey&0x1)+1;
01759   }
01760   else if (det==Detector::kNear){
01761     plane=plnStripEndKey/nStrips;
01762     strip=plnStripEndKey%nStrips;
01763     stripEnd=2;//because it always is
01764   }
01765   else{
01766     MSG("LILookup",Msg::kWarning)
01767       <<"Detector Type is not Near/Far/CalDet"<<endl;
01768   }
01769 
01770   MSG("LILookup",Msg::kDebug) 
01771     <<" ** Finished the UnencodePlnStripEndKey method **"<<endl;
01772 }


Member Data Documentation

Int_t LILookup::FIRSTASHTRAY = 1 [static]

Definition at line 106 of file LILookup.h.

Referenced by LIAnalysis::AshtrayVsPlane(), and SetDetector().

Int_t LILookup::FIRSTCHIP = 0 [static]

Definition at line 133 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTCRATE = 0 [static]
Int_t LILookup::FIRSTEND = 1 [static]
Int_t LILookup::FIRSTLED = 1 [static]
Int_t LILookup::FIRSTMUX = 0 [static]

Definition at line 169 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTPIXEL = 0 [static]

Definition at line 141 of file LILookup.h.

Referenced by LIAnalysis::PixelVsPlane(), and SetDetector().

Int_t LILookup::FIRSTPIXELSPOT = 0 [static]

Definition at line 145 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTPLANE = 0 [static]
Int_t LILookup::FIRSTPMT = 0 [static]

Definition at line 137 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTPULSERBOX = 0 [static]
Int_t LILookup::FIRSTRACK = 1 [static]

Definition at line 165 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTSCINTPLANE = 1 [static]
Int_t LILookup::FIRSTSIDE = 1 [static]

Definition at line 153 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTSM2PLANE = 249 [static]

Definition at line 187 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTSM2SCINTPLANE = 250 [static]

Definition at line 188 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTSPECTROMETERPLANE = 10000 [static]

Definition at line 197 of file LILookup.h.

Referenced by LISummarySorter::ReconstructStripEnd(), and SetDetector().

Int_t LILookup::FIRSTSTRIP = 0 [static]
Int_t LILookup::FIRSTVACHANNEL = 0 [static]

Definition at line 149 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTVARC = 0 [static]

Definition at line 121 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTVFB = 0 [static]

Definition at line 129 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::FIRSTVMM = 0 [static]

Definition at line 125 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTASHTRAY = 20 [static]

Definition at line 107 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTCHIP = 2 [static]

Definition at line 134 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTCRATE = 15 [static]
Int_t LILookup::LASTEND = 2 [static]

Definition at line 158 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTLED = 20 [static]
Int_t LILookup::LASTMUX = 7 [static]

Definition at line 170 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTPIXEL = 15 [static]

Definition at line 142 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTPIXELSPOT = 7 [static]

Definition at line 146 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTPLANE = 485 [static]
Int_t LILookup::LASTPMT = 2 [static]

Definition at line 138 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTPULSERBOX = 15 [static]
Int_t LILookup::LASTRACK = 16 [static]

Definition at line 166 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTSCINTPLANE = 485 [static]
Int_t LILookup::LASTSIDE = 2 [static]

Definition at line 154 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTSM1SCINTPLANE = 248 [static]

Definition at line 186 of file LILookup.h.

Referenced by Led2Ashtray(), Plane2PbEast(), and SetDetector().

Int_t LILookup::LASTSTRIP = 191 [static]
Int_t LILookup::LASTVACHANNEL = 21 [static]

Definition at line 150 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTVARC = 3 [static]

Definition at line 122 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTVFB = 1 [static]

Definition at line 130 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::LASTVMM = 5 [static]

Definition at line 126 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::NUMASHTRAYS = 20 [static]

Definition at line 108 of file LILookup.h.

Referenced by LIAnalysis::AshtrayVsPlane(), and SetDetector().

Int_t LILookup::NUMBOOKENDS = 2 [static]

Definition at line 193 of file LILookup.h.

Referenced by SetDetector(), and LIAnalysis::WriteGainsTextFile().

Int_t LILookup::NUMCHADD = 8000 [static]

Definition at line 100 of file LILookup.h.

Referenced by LISummarySorter::AddEntry(), SetDetector(), and LISummarySorter::Update().

Int_t LILookup::NUMCHANNELS = 8000 [static]

Definition at line 115 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::NUMCHIPS = 3 [static]

Definition at line 135 of file LILookup.h.

Referenced by LIAnalysis::AdcVsChannel(), LIAnalysis::AdcVsPixel(), and SetDetector().

Int_t LILookup::NUMCRATES = 16 [static]
Int_t LILookup::NUMENDS = 2 [static]
Int_t LILookup::NUMLEDS = 20 [static]
Int_t LILookup::NUMLEVELS = 3 [static]

Definition at line 163 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::NUMMUX = 8 [static]

Definition at line 171 of file LILookup.h.

Referenced by LIAnalysis::PinMap(), and SetDetector().

Int_t LILookup::NUMPINGAINS = 2 [static]

Definition at line 173 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::NUMPIXELS = 16 [static]

Definition at line 143 of file LILookup.h.

Referenced by LIAnalysis::PixelVsPlane(), and SetDetector().

Int_t LILookup::NUMPIXELSPOTS = 8 [static]

Definition at line 147 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::NUMPLANES = 486 [static]
Int_t LILookup::NUMPMTS = 3 [static]

Definition at line 139 of file LILookup.h.

Referenced by LIAnalysis::PixelVsPlane(), and SetDetector().

Int_t LILookup::NUMPULSERBOXES = 16 [static]
Int_t LILookup::NUMPULSERBOXESCURRENT = 14 [static]

Definition at line 113 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::NUMRACKLEVELS = 2 [static]

Definition at line 162 of file LILookup.h.

Referenced by SetDetector().

Int_t LILookup::NUMRACKS = 16 [static]

Definition at line 167 of file LILookup.h.

Referenced by LIAnalysis::PinMap(), and SetDetector().

Int_t LILookup::NUMSIDES = 2 [static]
Int_t LILookup::NUMSTRIPS = 192 [static]
Int_t LILookup::NUMVACHANNELS = 22 [static]

Definition at line 151 of file LILookup.h.

Referenced by GetPinDiodePlanes(), LIAnalysis::IndividualChannels(), and SetDetector().

Int_t LILookup::NUMVARCS = 4 [static]

Definition at line 123 of file LILookup.h.

Referenced by LIAnalysis::IndividualChannels(), and SetDetector().

Int_t LILookup::NUMVFBS = 2 [static]

Definition at line 131 of file LILookup.h.

Referenced by LIAnalysis::IndividualChannels(), and SetDetector().

Int_t LILookup::NUMVMMS = 6 [static]

Definition at line 127 of file LILookup.h.

Referenced by LIAnalysis::IndividualChannels(), and SetDetector().

Int_t LILookup::PB0STARTPLANE = 0 [static]

Definition at line 175 of file LILookup.h.

Referenced by SetDetector(), and SetPbPlanes().

Int_t LILookup::PB10STARTPLANE = 314 [static]

Definition at line 180 of file LILookup.h.

Referenced by Plane2PbEast(), SetDetector(), and SetPbPlanes().

Int_t LILookup::PB12STARTPLANE = 378 [static]

Definition at line 181 of file LILookup.h.

Referenced by Plane2PbEast(), SetDetector(), and SetPbPlanes().

Int_t LILookup::PB14STARTPLANE = 442 [static]

Definition at line 182 of file LILookup.h.

Referenced by Plane2PbEast(), SetDetector(), and SetPbPlanes().

Int_t LILookup::PB2STARTPLANE = 65 [static]

Definition at line 176 of file LILookup.h.

Referenced by Plane2PbEast(), SetDetector(), and SetPbPlanes().

Int_t LILookup::PB4STARTPLANE = 129 [static]

Definition at line 177 of file LILookup.h.

Referenced by Plane2PbEast(), SetDetector(), and SetPbPlanes().

Int_t LILookup::PB6STARTPLANE = 193 [static]

Definition at line 178 of file LILookup.h.

Referenced by Plane2PbEast(), SetDetector(), and SetPbPlanes().

Int_t LILookup::PB8STARTPLANE = 249 [static]

Definition at line 179 of file LILookup.h.

Referenced by Plane2PbEast(), SetDetector(), and SetPbPlanes().

Int_t LILookup::SECONDEND = 2 [static]
Int_t LILookup::SM1BOOKEND = 0 [static]

Definition at line 194 of file LILookup.h.

Referenced by SetDetector(), and LIAnalysis::WriteGainsTextFile().

Int_t LILookup::SM2BOOKEND = 249 [static]

Definition at line 195 of file LILookup.h.

Referenced by SetDetector(), and LIAnalysis::WriteGainsTextFile().


The documentation for this class was generated from the following files:

Generated on 22 Nov 2017 for loon by  doxygen 1.6.1