CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/Alignment/LaserDQM/plugins/LaserDQMStatistics.cc

Go to the documentation of this file.
00001 
00009 #include "Alignment/LaserDQM/plugins/LaserDQM.h"
00010 #include "FWCore/Framework/interface/Event.h" 
00011 #include "FWCore/ParameterSet/interface/ParameterSet.h" 
00012 
00013 #include "FWCore/Framework/interface/ESHandle.h"
00014 #include "DataFormats/Common/interface/Handle.h"
00015 #include "FWCore/Framework/interface/EventSetup.h"
00016 
00017 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
00018 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
00019 #include "Geometry/TrackerGeometryBuilder/interface/StripGeomDetUnit.h"
00020 #include "DataFormats/DetId/interface/DetId.h"
00021 
00022 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00023 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00024 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00025 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00026 
00027 void LaserDQM::trackerStatistics(edm::Event const& theEvent,edm::EventSetup const& theSetup)
00028 {
00029   // access the tracker
00030   edm::ESHandle<TrackerGeometry> theTrackerGeometry;
00031   theSetup.get<TrackerDigiGeometryRecord>().get(theTrackerGeometry);
00032   const TrackerGeometry& theTracker(*theTrackerGeometry);
00033 
00034   // get the StripDigiCollection
00035   // get the StripDigiCollection
00036   edm::Handle< edm::DetSetVector<SiStripDigi> > theStripDigis;
00037   
00038   for (Parameters::iterator itDigiProducersList = theDigiProducersList.begin(); itDigiProducersList != theDigiProducersList.end(); ++itDigiProducersList)
00039     {
00040       std::string digiProducer = itDigiProducersList->getParameter<std::string>("DigiProducer");
00041       std::string digiLabel = itDigiProducersList->getParameter<std::string>("DigiLabel");
00042 
00043       theEvent.getByLabel(digiProducer, digiLabel, theStripDigis);
00044 
00045       // loop over the entries of theStripDigis, get the DetId to identify the Detunit and find the one which will be hit by the laser beams
00046       for (edm::DetSetVector<SiStripDigi>::const_iterator DSViter = theStripDigis->begin(); DSViter != theStripDigis->end(); DSViter++)
00047         {
00048           DetId theDetUnitID(DSViter->id);
00049 
00050           // get the DetUnit via the DetUnitId and cast it to a StripGeomDetUnit
00051           const StripGeomDetUnit * const theStripDet = dynamic_cast<const StripGeomDetUnit*>(theTracker.idToDet(theDetUnitID));
00052 
00053           // get the Digis in this DetUnit
00054           edm::DetSet<SiStripDigi>::const_iterator theDigiRangeIterator = (*DSViter).data.begin();
00055           edm::DetSet<SiStripDigi>::const_iterator theDigiRangeIteratorEnd = (*DSViter).data.end();
00056       
00057           // some variables we need later on in the program
00058           int theBeam     = 0;
00059           int theRing     = 0;
00060           std::string thePart  = "";
00061           int theTIBLayer = 0;
00062           int theTOBLayer = 0;
00063           int theTECWheel = 0;
00064           int theTOBStereoDet = 0;
00065 
00066           switch (theDetUnitID.subdetId())
00067             {
00068             case StripSubdetector::TIB:
00069               {
00070                 TIBDetId theTIBDetId(theDetUnitID.rawId());
00071                 thePart = "TIB";
00072                 theTIBLayer = theTIBDetId.layer();
00073                 break;
00074               }
00075             case StripSubdetector::TOB:
00076               {
00077                 TOBDetId theTOBDetId(theDetUnitID.rawId());
00078                 thePart = "TOB";
00079                 theTOBLayer = theTOBDetId.layer();
00080                 theTOBStereoDet = theTOBDetId.stereo();
00081                 break;
00082               }
00083             case StripSubdetector::TEC:
00084               {
00085                 TECDetId theTECDetId(theDetUnitID.rawId());
00086             
00087                 // is this module in TEC+ or TEC-?
00088                 if (theTECDetId.side() == 1) { thePart = "TEC-"; }
00089                 else if (theTECDetId.side() == 2) { thePart = "TEC+"; }
00090             
00091                 // in which ring is this module?
00092                 if ( theStripDet->surface().position().perp() > 55.0 && theStripDet->surface().position().perp() < 59.0 )
00093                   { theRing = 4; } // Ring 4
00094                 else if ( theStripDet->surface().position().perp() > 81.0 && theStripDet->surface().position().perp() < 85.0 )
00095                   { theRing = 6; } // Ring 6
00096                 else
00097                   { theRing = -1; } // probably not a Laser Hit!
00098             
00099                 // on which disk is this module
00100                 theTECWheel = theTECDetId.wheel();
00101                 break;
00102               }
00103             }
00104       
00105           // which beam belongs these digis to
00106           if ( thePart == "TIB" && theTIBLayer == 4 )
00107             {
00108               if ( (theStripDet->surface().position().phi() > 0.39 - theSearchPhiTIB) 
00109                    && (theStripDet->surface().position().phi() < 0.39 + theSearchPhiTIB))          { theBeam = 0; } // beam 0 
00110 
00111               else if ( (theStripDet->surface().position().phi() > 1.29 - theSearchPhiTIB) 
00112                         && (theStripDet->surface().position().phi() < 1.29 + theSearchPhiTIB))     { theBeam = 1; } // beam 1
00113 
00114               else if ( (theStripDet->surface().position().phi() > 1.85 - theSearchPhiTIB) 
00115                         && (theStripDet->surface().position().phi() < 1.85 + theSearchPhiTIB))     { theBeam = 2; } // beam 2
00116 
00117               else if ( (theStripDet->surface().position().phi() > 2.75 - theSearchPhiTIB) 
00118                         && (theStripDet->surface().position().phi() < 2.75 + theSearchPhiTIB))     { theBeam = 3; } // beam 3
00119 
00120               else if ( (theStripDet->surface().position().phi() > -2.59 - theSearchPhiTIB) 
00121                         && (theStripDet->surface().position().phi() < -2.59 + theSearchPhiTIB))    { theBeam = 4; } // beam 4
00122 
00123               else if ( (theStripDet->surface().position().phi() > -2.00 - theSearchPhiTIB) 
00124                         && (theStripDet->surface().position().phi() < -2.00 + theSearchPhiTIB))    { theBeam = 5; } // beam 5
00125 
00126               else if ( (theStripDet->surface().position().phi() > -1.10 - theSearchPhiTIB) 
00127                         && (theStripDet->surface().position().phi() < -1.10 + theSearchPhiTIB))    { theBeam = 6; } // beam 6
00128 
00129               else if ( (theStripDet->surface().position().phi() > -0.50 - theSearchPhiTIB) 
00130                         && (theStripDet->surface().position().phi() < -0.50 + theSearchPhiTIB))    { theBeam = 7; } // beam 7
00131               else
00132                 { theBeam = -1; } // probably not a Laser Hit!
00133             }
00134           else if ( thePart == "TOB" && theTOBLayer == 1 )
00135             {
00136               if ( (theStripDet->surface().position().phi() > 0.39 - theSearchPhiTOB) 
00137                    && (theStripDet->surface().position().phi() < 0.39 + theSearchPhiTOB))          { theBeam = 0; } // beam 0 
00138 
00139               else if ( (theStripDet->surface().position().phi() > 1.29 - theSearchPhiTOB) 
00140                         && (theStripDet->surface().position().phi() < 1.29 + theSearchPhiTOB))     { theBeam = 1; } // beam 1
00141 
00142               else if ( (theStripDet->surface().position().phi() > 1.85 - theSearchPhiTOB)
00143                         && (theStripDet->surface().position().phi() < 1.85 + theSearchPhiTOB))     { theBeam = 2; } // beam 2
00144 
00145               else if ( (theStripDet->surface().position().phi() > 2.75 - theSearchPhiTOB)
00146                         && (theStripDet->surface().position().phi() < 2.75 + theSearchPhiTOB))     { theBeam = 3; } // beam 3
00147           
00148               else if ( (theStripDet->surface().position().phi() > -2.59 - theSearchPhiTOB)
00149                         && (theStripDet->surface().position().phi() < -2.59 + theSearchPhiTOB))    { theBeam = 4; } // beam 4
00150 
00151               else if ( (theStripDet->surface().position().phi() > -2.00 - theSearchPhiTOB)
00152                         && (theStripDet->surface().position().phi() < -2.00 + theSearchPhiTOB))    { theBeam = 5; } // beam 5
00153 
00154               else if ( (theStripDet->surface().position().phi() > -1.10 - theSearchPhiTOB)
00155                         && (theStripDet->surface().position().phi() < -1.10 + theSearchPhiTOB))    { theBeam = 6; } // beam 6
00156 
00157               else if ( (theStripDet->surface().position().phi() > -0.50 - theSearchPhiTOB)
00158                         && (theStripDet->surface().position().phi() < -0.50 + theSearchPhiTOB))    { theBeam = 7; } // beam 7
00159               else
00160                 { theBeam = -1; } // probably not a Laser Hit!
00161             }
00162           else if ( thePart == "TEC+" || thePart == "TEC-" )
00163             {
00164               if ( (theStripDet->surface().position().phi() > 0.39 - theSearchPhiTEC)
00165                    && (theStripDet->surface().position().phi() < 0.39 + theSearchPhiTEC))          { theBeam = 0; } // beam 0 
00166 
00167               else if ( (theStripDet->surface().position().phi() > 1.18 - theSearchPhiTEC)
00168                         && (theStripDet->surface().position().phi() < 1.18 + theSearchPhiTEC))     { theBeam = 1; } // beam 1
00169 
00170               else if ( (theStripDet->surface().position().phi() > 1.96 - theSearchPhiTEC)
00171                         && (theStripDet->surface().position().phi() < 1.96 + theSearchPhiTEC))     { theBeam = 2; } // beam 2
00172 
00173               else if ( (theStripDet->surface().position().phi() > 2.74 - theSearchPhiTEC)
00174                         && (theStripDet->surface().position().phi() < 2.74 + theSearchPhiTEC))     { theBeam = 3; } // beam 3
00175 
00176               else if ( (theStripDet->surface().position().phi() > -2.74 - theSearchPhiTEC)
00177                         && (theStripDet->surface().position().phi() < -2.74 + theSearchPhiTEC))    { theBeam = 4; } // beam 4
00178 
00179               else if ( (theStripDet->surface().position().phi() > -1.96 - theSearchPhiTEC)
00180                         && (theStripDet->surface().position().phi() < -1.96 + theSearchPhiTEC))    { theBeam = 5; } // beam 5
00181 
00182               else if ( (theStripDet->surface().position().phi() > -1.18 - theSearchPhiTEC)
00183                         && (theStripDet->surface().position().phi() < -1.18 + theSearchPhiTEC))    { theBeam = 6; } // beam 6
00184 
00185               else if ( (theStripDet->surface().position().phi() > -0.39 - theSearchPhiTEC)
00186                         && (theStripDet->surface().position().phi() < -0.39 + theSearchPhiTEC))    { theBeam = 7; } // beam 7
00187 
00188               else if ( (theStripDet->surface().position().phi() > 1.28 - theSearchPhiTEC)
00189                         && (theStripDet->surface().position().phi() < 1.28 + theSearchPhiTEC))     { theBeam = 21; } // beam 1 TEC2TEC
00190 
00191               else if ( (theStripDet->surface().position().phi() > 1.84 - theSearchPhiTEC)
00192                         && (theStripDet->surface().position().phi() < 1.84 + theSearchPhiTEC))     { theBeam = 22; } // beam 2 TEC2TEC
00193 
00194               else if ( (theStripDet->surface().position().phi() > -2.59 - theSearchPhiTEC)
00195                         && (theStripDet->surface().position().phi() < -2.59 + theSearchPhiTEC))    { theBeam = 24; } // beam 4 TEC2TEC
00196 
00197               else if ( (theStripDet->surface().position().phi() > -1.10 - theSearchPhiTEC)
00198                         && (theStripDet->surface().position().phi() < -1.10 + theSearchPhiTEC))    { theBeam = 26; } // beam 6 TEC2TEC
00199 
00200               else if ( (theStripDet->surface().position().phi() > -0.50 - theSearchPhiTEC)
00201                         && (theStripDet->surface().position().phi() < -0.50 + theSearchPhiTEC))    { theBeam = 27; } // beam 7 TEC2TEC
00202               else 
00203                 { theBeam = -1; } // probably not a Laser Hit!
00204             }
00205 
00206 
00207           //       if ( ( thePart == "TEC+" || thePart == "TEC-" ) && theEvents == 1 )
00208           //    {
00209           //      cout << " theBeam = " << theBeam << " thePart = " << thePart << " theRing = " << theRing << " Disc = " << theTECWheel << endl;
00210           //      cout << " DetUnitId = " << theDetUnitID.rawId() << endl;
00211           //      cout << " Phi of Det = " << theStripDet->surface().position().phi() << endl;
00212           
00213           //    }
00214 
00215           // fill the histograms which will be fitted at the end of the run to reconstruct the laser profile
00216 
00217           /* work with else if ... for all the parts and beams */
00218           // ****** beam 0 in Ring 4
00219           if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 0) )
00220             {
00221               if ( theTECWheel == 1 )
00222                 { 
00223                   fillAdcCounts(theMEBeam0Ring4Disc1PosAdcCounts, 
00224                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00225                 }
00226               else if ( theTECWheel == 2 )
00227                 {
00228                   fillAdcCounts(theMEBeam0Ring4Disc2PosAdcCounts,
00229                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00230                 }
00231               else if ( theTECWheel == 3 )
00232                 {
00233                   fillAdcCounts(theMEBeam0Ring4Disc3PosAdcCounts,
00234                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00235                 }
00236               else if ( theTECWheel == 4 )
00237                 {
00238                   fillAdcCounts(theMEBeam0Ring4Disc4PosAdcCounts,
00239                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00240                 }
00241               else if ( theTECWheel == 5 )
00242                 {
00243                   fillAdcCounts(theMEBeam0Ring4Disc5PosAdcCounts,
00244                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00245                 }
00246               else if ( theTECWheel == 6 )
00247                 {
00248                   fillAdcCounts(theMEBeam0Ring4Disc6PosAdcCounts,
00249                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00250                 }
00251               else if ( theTECWheel == 7 )
00252                 {
00253                   fillAdcCounts(theMEBeam0Ring4Disc7PosAdcCounts,
00254                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00255                 }
00256               else if ( theTECWheel == 8 )
00257                 {
00258                   fillAdcCounts(theMEBeam0Ring4Disc8PosAdcCounts,
00259                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00260                 }
00261               else if ( theTECWheel == 9 )
00262                 { 
00263                   fillAdcCounts(theMEBeam0Ring4Disc9PosAdcCounts,
00264                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00265                 }
00266             }
00267           // **** end of beam 0 in Ring 4 ****
00268 
00269           // **** Beam 1 in Ring 4 ****
00270           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 1) )
00271             {
00272               if ( theTECWheel == 1 )
00273                 { 
00274                   fillAdcCounts(theMEBeam1Ring4Disc1PosAdcCounts,
00275                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00276                 }
00277               else if ( theTECWheel == 2 )
00278                 {
00279                   fillAdcCounts(theMEBeam1Ring4Disc2PosAdcCounts,
00280                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00281                 }
00282               else if ( theTECWheel == 3 )
00283                 {
00284                   fillAdcCounts(theMEBeam1Ring4Disc3PosAdcCounts,
00285                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00286                 }
00287               else if ( theTECWheel == 4 )
00288                 {
00289                   fillAdcCounts(theMEBeam1Ring4Disc4PosAdcCounts,
00290                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00291                 }
00292               else if ( theTECWheel == 5 )
00293                 {
00294                   fillAdcCounts(theMEBeam1Ring4Disc5PosAdcCounts,
00295                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00296                 }
00297               else if ( theTECWheel == 6 )
00298                 {
00299                   fillAdcCounts(theMEBeam1Ring4Disc6PosAdcCounts,
00300                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00301                 }
00302               else if ( theTECWheel == 7 )
00303                 {
00304                   fillAdcCounts(theMEBeam1Ring4Disc7PosAdcCounts,
00305                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00306                 }
00307               else if ( theTECWheel == 8 )
00308                 {
00309                   fillAdcCounts(theMEBeam1Ring4Disc8PosAdcCounts,
00310                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00311                 }
00312               else if ( theTECWheel == 9 )
00313                 { 
00314                   fillAdcCounts(theMEBeam1Ring4Disc9PosAdcCounts,
00315                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00316                 }
00317             }
00318           // **** TEC2TEC
00319           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 21) )
00320             {
00321               if ( theTECWheel == 1 )
00322                 { 
00323                   fillAdcCounts(theMEBeam1Ring4Disc1PosTEC2TECAdcCounts,
00324                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00325                 }
00326               else if ( theTECWheel == 2 )
00327                 {
00328                   fillAdcCounts(theMEBeam1Ring4Disc2PosTEC2TECAdcCounts,
00329                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00330                 }
00331               else if ( theTECWheel == 3 )
00332                 {
00333                   fillAdcCounts(theMEBeam1Ring4Disc3PosTEC2TECAdcCounts,
00334                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00335                 }
00336               else if ( theTECWheel == 4 )
00337                 {
00338                   fillAdcCounts(theMEBeam1Ring4Disc4PosTEC2TECAdcCounts,
00339                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00340                 }
00341               else if ( theTECWheel == 5 )
00342                 {
00343                   fillAdcCounts(theMEBeam1Ring4Disc5PosTEC2TECAdcCounts,
00344                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00345                 }
00346             }
00347           // **** end of beam 1 in Ring 4 ****
00348 
00349           // **** Beam 2 in Ring 4 ****
00350           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 2) )
00351             {
00352               if ( theTECWheel == 1 )
00353                 { 
00354                   fillAdcCounts(theMEBeam2Ring4Disc1PosAdcCounts,
00355                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00356                 }
00357               else if ( theTECWheel == 2 )
00358                 {
00359                   fillAdcCounts(theMEBeam2Ring4Disc2PosAdcCounts,
00360                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00361                 }
00362               else if ( theTECWheel == 3 )
00363                 {
00364                   fillAdcCounts(theMEBeam2Ring4Disc3PosAdcCounts,
00365                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00366                 }
00367               else if ( theTECWheel == 4 )
00368                 {
00369 
00370                   fillAdcCounts(theMEBeam2Ring4Disc4PosAdcCounts,
00371                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00372                 }
00373               else if ( theTECWheel == 5 )
00374                 {
00375                   fillAdcCounts(theMEBeam2Ring4Disc5PosAdcCounts,
00376                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00377                 }
00378               else if ( theTECWheel == 6 )
00379                 {
00380                   fillAdcCounts(theMEBeam2Ring4Disc6PosAdcCounts,
00381                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00382                 }
00383               else if ( theTECWheel == 7 )
00384                 {
00385                   fillAdcCounts(theMEBeam2Ring4Disc7PosAdcCounts,
00386                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00387                 }
00388               else if ( theTECWheel == 8 )
00389                 {
00390                   fillAdcCounts(theMEBeam2Ring4Disc8PosAdcCounts,
00391                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00392                 }
00393               else if ( theTECWheel == 9 )
00394                 { 
00395                   fillAdcCounts(theMEBeam2Ring4Disc9PosAdcCounts,
00396                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00397                 }
00398             }
00399           // TEC2TEC
00400           // **** Beam 2 in Ring 4 ****
00401           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 22) )
00402             {
00403               if ( theTECWheel == 1 )
00404                 { 
00405                   fillAdcCounts(theMEBeam2Ring4Disc1PosTEC2TECAdcCounts,
00406                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00407                 }
00408               else if ( theTECWheel == 2 )
00409                 {
00410                   fillAdcCounts(theMEBeam2Ring4Disc2PosTEC2TECAdcCounts,
00411                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00412                 }
00413               else if ( theTECWheel == 3 )
00414                 {
00415                   fillAdcCounts(theMEBeam2Ring4Disc3PosTEC2TECAdcCounts,
00416                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00417                 }
00418               else if ( theTECWheel == 4 )
00419                 {
00420                   fillAdcCounts(theMEBeam2Ring4Disc4PosTEC2TECAdcCounts,
00421                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00422                 }
00423               else if ( theTECWheel == 5 )
00424                 {
00425                   fillAdcCounts(theMEBeam2Ring4Disc5PosTEC2TECAdcCounts,
00426                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00427                 }
00428             }
00429           // **** end of beam 2 in Ring 4 ****
00430 
00431           // **** Beam 3 in Ring 4 ****
00432           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 3) )
00433             {
00434               if ( theTECWheel == 1 )
00435                 { 
00436                   fillAdcCounts(theMEBeam3Ring4Disc1PosAdcCounts,
00437                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00438                 }
00439               else if ( theTECWheel == 2 )
00440                 {
00441                   fillAdcCounts(theMEBeam3Ring4Disc2PosAdcCounts,
00442                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00443                 }
00444               else if ( theTECWheel == 3 )
00445                 {
00446                   fillAdcCounts(theMEBeam3Ring4Disc3PosAdcCounts, 
00447                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00448                 }
00449               else if ( theTECWheel == 4 )
00450                 {
00451                   fillAdcCounts(theMEBeam3Ring4Disc4PosAdcCounts,
00452                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00453                 }
00454               else if ( theTECWheel == 5 )
00455                 {
00456                   fillAdcCounts(theMEBeam3Ring4Disc5PosAdcCounts,
00457                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00458                 }
00459               else if ( theTECWheel == 6 )
00460                 {
00461                   fillAdcCounts(theMEBeam3Ring4Disc6PosAdcCounts,
00462                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00463                 }
00464               else if ( theTECWheel == 7 )
00465                 {
00466                   fillAdcCounts(theMEBeam3Ring4Disc7PosAdcCounts,
00467                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00468                 }
00469               else if ( theTECWheel == 8 )
00470                 {
00471                   fillAdcCounts(theMEBeam3Ring4Disc8PosAdcCounts,
00472                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00473                 }
00474               else if ( theTECWheel == 9 )
00475                 { 
00476                   fillAdcCounts(theMEBeam3Ring4Disc9PosAdcCounts,
00477                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00478                 }
00479             }
00480           // **** end of beam 3 in Ring 4 ****
00481 
00482           // **** Beam 4 in Ring 4 ****
00483           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 4) )
00484             {
00485               if ( theTECWheel == 1 )
00486                 { 
00487                   fillAdcCounts(theMEBeam4Ring4Disc1PosAdcCounts,
00488                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00489                 }
00490               else if ( theTECWheel == 2 )
00491                 {
00492                   fillAdcCounts(theMEBeam4Ring4Disc2PosAdcCounts,
00493                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00494                 }
00495               else if ( theTECWheel == 3 )
00496                 {
00497                   fillAdcCounts(theMEBeam4Ring4Disc3PosAdcCounts,
00498                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00499                 }
00500               else if ( theTECWheel == 4 )
00501                 {
00502                   fillAdcCounts(theMEBeam4Ring4Disc4PosAdcCounts,
00503                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00504                 }
00505               else if ( theTECWheel == 5 )
00506                 {
00507                   fillAdcCounts(theMEBeam4Ring4Disc5PosAdcCounts,
00508                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00509                 }
00510               else if ( theTECWheel == 6 )
00511                 {
00512                   fillAdcCounts(theMEBeam4Ring4Disc6PosAdcCounts,
00513                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00514                 }
00515               else if ( theTECWheel == 7 )
00516                 {
00517                   fillAdcCounts(theMEBeam4Ring4Disc7PosAdcCounts,
00518                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00519                 }
00520               else if ( theTECWheel == 8 )
00521                 {
00522                   fillAdcCounts(theMEBeam4Ring4Disc8PosAdcCounts,
00523                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00524                 }
00525               else if ( theTECWheel == 9 )
00526                 { 
00527                   fillAdcCounts(theMEBeam4Ring4Disc9PosAdcCounts,
00528                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00529                 }
00530             }
00531           // TEC2TEC
00532           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 24) )
00533             {
00534               if ( theTECWheel == 1 )
00535                 { 
00536                   fillAdcCounts(theMEBeam4Ring4Disc1PosTEC2TECAdcCounts,
00537                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00538                 }
00539               else if ( theTECWheel == 2 )
00540                 {
00541                   fillAdcCounts(theMEBeam4Ring4Disc2PosTEC2TECAdcCounts,
00542                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00543                 }
00544               else if ( theTECWheel == 3 )
00545                 {
00546                   fillAdcCounts(theMEBeam4Ring4Disc3PosTEC2TECAdcCounts,
00547                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00548                 }
00549               else if ( theTECWheel == 4 )
00550                 {
00551                   fillAdcCounts(theMEBeam4Ring4Disc4PosTEC2TECAdcCounts,
00552                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00553                 }
00554               else if ( theTECWheel == 5 )
00555                 {
00556                   fillAdcCounts(theMEBeam4Ring4Disc5PosTEC2TECAdcCounts,
00557                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00558                 }
00559             }
00560           // **** end of beam 4 in Ring 4 ****
00561 
00562           // **** Beam 5 in Ring 4 ****
00563           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 5) )
00564             {
00565               if ( theTECWheel == 1 )
00566                 { 
00567                   fillAdcCounts(theMEBeam5Ring4Disc1PosAdcCounts,
00568                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00569                 }
00570               else if ( theTECWheel == 2 )
00571                 {
00572                   fillAdcCounts(theMEBeam5Ring4Disc2PosAdcCounts,
00573                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00574                 }
00575               else if ( theTECWheel == 3 )
00576                 {
00577                   fillAdcCounts(theMEBeam5Ring4Disc3PosAdcCounts,
00578                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00579                 }
00580               else if ( theTECWheel == 4 )
00581                 {
00582                   fillAdcCounts(theMEBeam5Ring4Disc4PosAdcCounts,
00583                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00584                 }
00585               else if ( theTECWheel == 5 )
00586                 {
00587                   fillAdcCounts(theMEBeam5Ring4Disc5PosAdcCounts,
00588                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00589                 }
00590               else if ( theTECWheel == 6 )
00591                 {
00592                   fillAdcCounts(theMEBeam5Ring4Disc6PosAdcCounts,
00593                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00594                 }
00595               else if ( theTECWheel == 7 )
00596                 {
00597                   fillAdcCounts(theMEBeam5Ring4Disc7PosAdcCounts,
00598                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00599                 }
00600               else if ( theTECWheel == 8 )
00601                 {
00602                   fillAdcCounts(theMEBeam5Ring4Disc8PosAdcCounts,
00603                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00604                 }
00605               else if ( theTECWheel == 9 )
00606                 { 
00607                   fillAdcCounts(theMEBeam5Ring4Disc9PosAdcCounts,
00608                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00609                 }
00610             }
00611           // **** end of beam 5 in Ring 4 ****
00612 
00613           // **** Beam 6 in Ring 4 ****
00614           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 6) )
00615             {
00616               if ( theTECWheel == 1 )
00617                 { 
00618                   fillAdcCounts(theMEBeam6Ring4Disc1PosAdcCounts,
00619                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00620                 }
00621               else if ( theTECWheel == 2 )
00622                 {
00623                   fillAdcCounts(theMEBeam6Ring4Disc2PosAdcCounts,
00624                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00625                 }
00626               else if ( theTECWheel == 3 )
00627                 {
00628                   fillAdcCounts(theMEBeam6Ring4Disc3PosAdcCounts,
00629                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00630                 }
00631               else if ( theTECWheel == 4 )
00632                 {
00633                   fillAdcCounts(theMEBeam6Ring4Disc4PosAdcCounts,
00634                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00635                 }
00636               else if ( theTECWheel == 5 )
00637                 {
00638                   fillAdcCounts(theMEBeam6Ring4Disc5PosAdcCounts,
00639                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00640                 }
00641               else if ( theTECWheel == 6 )
00642                 {
00643                   fillAdcCounts(theMEBeam6Ring4Disc6PosAdcCounts,
00644                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00645                 }
00646               else if ( theTECWheel == 7 )
00647                 {
00648                   fillAdcCounts(theMEBeam6Ring4Disc7PosAdcCounts,
00649                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00650                 }
00651               else if ( theTECWheel == 8 )
00652                 {
00653                   fillAdcCounts(theMEBeam6Ring4Disc8PosAdcCounts,
00654                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00655                 }
00656               else if ( theTECWheel == 9 )
00657                 { 
00658                   fillAdcCounts(theMEBeam6Ring4Disc9PosAdcCounts,
00659                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00660                 }
00661             }
00662           // TEC2TEC
00663           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 26) )
00664             {
00665               if ( theTECWheel == 1 )
00666                 { 
00667                   fillAdcCounts(theMEBeam6Ring4Disc1PosTEC2TECAdcCounts,
00668                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00669                 }
00670               else if ( theTECWheel == 2 )
00671                 {
00672                   fillAdcCounts(theMEBeam6Ring4Disc2PosTEC2TECAdcCounts,
00673                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00674                 }
00675               else if ( theTECWheel == 3 )
00676                 {
00677                   fillAdcCounts(theMEBeam6Ring4Disc3PosTEC2TECAdcCounts,
00678                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00679                 }
00680               else if ( theTECWheel == 4 )
00681                 {
00682                   fillAdcCounts(theMEBeam6Ring4Disc4PosTEC2TECAdcCounts,
00683                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00684                 }
00685               else if ( theTECWheel == 5 )
00686                 {
00687                   fillAdcCounts(theMEBeam6Ring4Disc5PosTEC2TECAdcCounts,
00688                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00689                 }
00690             }
00691           // **** end of beam 6 in Ring 4 ****
00692 
00693           // **** Beam 7 in Ring 4 ****
00694           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 7) )
00695             {
00696               if ( theTECWheel == 1 )
00697                 { 
00698                   fillAdcCounts(theMEBeam7Ring4Disc1PosAdcCounts,
00699                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00700                 }
00701               else if ( theTECWheel == 2 )
00702                 {
00703                   fillAdcCounts(theMEBeam7Ring4Disc2PosAdcCounts,
00704                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00705                 }
00706               else if ( theTECWheel == 3 )
00707                 {
00708                   fillAdcCounts(theMEBeam7Ring4Disc3PosAdcCounts,
00709                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00710                 }
00711               else if ( theTECWheel == 4 )
00712                 {
00713                   fillAdcCounts(theMEBeam7Ring4Disc4PosAdcCounts,
00714                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00715                 }
00716               else if ( theTECWheel == 5 )
00717                 {
00718                   fillAdcCounts(theMEBeam7Ring4Disc5PosAdcCounts,
00719                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00720                 }
00721               else if ( theTECWheel == 6 )
00722                 {
00723                   fillAdcCounts(theMEBeam7Ring4Disc6PosAdcCounts,
00724                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00725                 }
00726               else if ( theTECWheel == 7 )
00727                 {
00728                   fillAdcCounts(theMEBeam7Ring4Disc7PosAdcCounts,
00729                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00730                 }
00731               else if ( theTECWheel == 8 )
00732                 {
00733                   fillAdcCounts(theMEBeam7Ring4Disc8PosAdcCounts,
00734                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00735                 }
00736               else if ( theTECWheel == 9 )
00737                 { 
00738                   fillAdcCounts(theMEBeam7Ring4Disc9PosAdcCounts,
00739                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00740                 }
00741             }
00742           // TEC2TEC
00743           else if ( (thePart == "TEC+") && (theRing == 4) && (theBeam == 27) )
00744             {
00745               if ( theTECWheel == 1 )
00746                 { 
00747                   fillAdcCounts(theMEBeam7Ring4Disc1PosTEC2TECAdcCounts,
00748                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00749                 }
00750               else if ( theTECWheel == 2 )
00751                 {
00752                   fillAdcCounts(theMEBeam7Ring4Disc2PosTEC2TECAdcCounts,
00753                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00754                 }
00755               else if ( theTECWheel == 3 )
00756                 {
00757                   fillAdcCounts(theMEBeam7Ring4Disc3PosTEC2TECAdcCounts,
00758                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00759                 }
00760               else if ( theTECWheel == 4 )
00761                 {
00762                   fillAdcCounts(theMEBeam7Ring4Disc4PosTEC2TECAdcCounts,
00763                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00764                 }
00765               else if ( theTECWheel == 5 )
00766                 {
00767                   fillAdcCounts(theMEBeam7Ring4Disc5PosTEC2TECAdcCounts,
00768                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00769                 }
00770             }
00771           // **** end of beam 7 in Ring 4 ****
00772 
00773           // **** Ring 6
00774           else if ( (thePart == "TEC+") && (theRing == 6) && (theBeam == 0) )
00775             {
00776               if ( theTECWheel == 1 )
00777                 { 
00778                   fillAdcCounts(theMEBeam0Ring6Disc1PosAdcCounts,
00779                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00780                 }
00781               else if ( theTECWheel == 2 )
00782                 {
00783                   fillAdcCounts(theMEBeam0Ring6Disc2PosAdcCounts,
00784                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00785                 }
00786               else if ( theTECWheel == 3 )
00787                 {
00788                   fillAdcCounts(theMEBeam0Ring6Disc3PosAdcCounts,
00789                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00790                 }
00791               else if ( theTECWheel == 4 )
00792                 {
00793                   fillAdcCounts(theMEBeam0Ring6Disc4PosAdcCounts,
00794                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00795                 }
00796               else if ( theTECWheel == 5 )
00797                 {
00798                   fillAdcCounts(theMEBeam0Ring6Disc5PosAdcCounts,
00799                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00800                 }
00801               else if ( theTECWheel == 6 )
00802                 {
00803                   fillAdcCounts(theMEBeam0Ring6Disc6PosAdcCounts,
00804                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00805                 }
00806               else if ( theTECWheel == 7 )
00807                 {
00808                   fillAdcCounts(theMEBeam0Ring6Disc7PosAdcCounts,
00809                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00810                 }
00811               else if ( theTECWheel == 8 )
00812                 {
00813                   fillAdcCounts(theMEBeam0Ring6Disc8PosAdcCounts,
00814                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00815                 }
00816               else if ( theTECWheel == 9 )
00817                 { 
00818                   fillAdcCounts(theMEBeam0Ring6Disc9PosAdcCounts,
00819                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00820                 }
00821             }
00822           // **** end of beam 0 in Ring 6 ****
00823 
00824           // **** Beam 1 in Ring 6 ****
00825           else if ( (thePart == "TEC+") && (theRing == 6) && (theBeam == 1) )
00826             {
00827               if ( theTECWheel == 1 )
00828                 { 
00829                   fillAdcCounts(theMEBeam1Ring6Disc1PosAdcCounts,
00830                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00831                 }
00832               else if ( theTECWheel == 2 )
00833                 {
00834                   fillAdcCounts(theMEBeam1Ring6Disc2PosAdcCounts,
00835                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00836                 }
00837               else if ( theTECWheel == 3 )
00838                 {
00839                   fillAdcCounts(theMEBeam1Ring6Disc3PosAdcCounts,
00840                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00841                 }
00842               else if ( theTECWheel == 4 )
00843                 {
00844                   fillAdcCounts(theMEBeam1Ring6Disc4PosAdcCounts,
00845                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00846                 }
00847               else if ( theTECWheel == 5 )
00848                 {
00849                   fillAdcCounts(theMEBeam1Ring6Disc5PosAdcCounts,
00850                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00851                 }
00852               else if ( theTECWheel == 6 )
00853                 {
00854                   fillAdcCounts(theMEBeam1Ring6Disc6PosAdcCounts,
00855                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00856                 }
00857               else if ( theTECWheel == 7 )
00858                 {
00859                   fillAdcCounts(theMEBeam1Ring6Disc7PosAdcCounts,
00860                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00861                 }
00862               else if ( theTECWheel == 8 )
00863                 {
00864                   fillAdcCounts(theMEBeam1Ring6Disc8PosAdcCounts,
00865                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00866                 }
00867               else if ( theTECWheel == 9 )
00868                 { 
00869                   fillAdcCounts(theMEBeam1Ring6Disc9PosAdcCounts,
00870                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00871                 }
00872             }
00873           // **** end of beam 1 in Ring 6 ****
00874 
00875           // **** Beam 2 in Ring 6 ****
00876           else if ( (thePart == "TEC+") && (theRing == 6) && (theBeam == 2) )
00877             {
00878               if ( theTECWheel == 1 )
00879                 { 
00880                   fillAdcCounts(theMEBeam2Ring6Disc1PosAdcCounts,
00881                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00882                 }
00883               else if ( theTECWheel == 2 )
00884                 {
00885                   fillAdcCounts(theMEBeam2Ring6Disc2PosAdcCounts,
00886                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00887                 }
00888               else if ( theTECWheel == 3 )
00889                 {
00890                   fillAdcCounts(theMEBeam2Ring6Disc3PosAdcCounts,
00891                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00892                 }
00893               else if ( theTECWheel == 4 )
00894                 {
00895                   fillAdcCounts(theMEBeam2Ring6Disc4PosAdcCounts,
00896                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00897                 }
00898               else if ( theTECWheel == 5 )
00899                 {
00900                   fillAdcCounts(theMEBeam2Ring6Disc5PosAdcCounts,
00901                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00902                 }
00903               else if ( theTECWheel == 6 )
00904                 {
00905                   fillAdcCounts(theMEBeam2Ring6Disc6PosAdcCounts,
00906                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00907                 }
00908               else if ( theTECWheel == 7 )
00909                 {
00910                   fillAdcCounts(theMEBeam2Ring6Disc7PosAdcCounts,
00911                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00912                 }
00913               else if ( theTECWheel == 8 )
00914                 {
00915                   fillAdcCounts(theMEBeam2Ring6Disc8PosAdcCounts,
00916                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00917                 }
00918               else if ( theTECWheel == 9 )
00919                 { 
00920                   fillAdcCounts(theMEBeam2Ring6Disc9PosAdcCounts,
00921                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00922                 }
00923             }
00924           // **** end of beam 2 in Ring 6 ****
00925 
00926           // **** Beam 3 in Ring 6 ****
00927           else if ( (thePart == "TEC+") && (theRing == 6) && (theBeam == 3) )
00928             {
00929               if ( theTECWheel == 1 )
00930                 { 
00931                   fillAdcCounts(theMEBeam3Ring6Disc1PosAdcCounts,
00932                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00933                 }
00934               else if ( theTECWheel == 2 )
00935                 {
00936                   fillAdcCounts(theMEBeam3Ring6Disc2PosAdcCounts,
00937                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00938                 }
00939               else if ( theTECWheel == 3 )
00940                 {
00941                   fillAdcCounts(theMEBeam3Ring6Disc3PosAdcCounts,
00942                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00943                 }
00944               else if ( theTECWheel == 4 )
00945                 {
00946                   fillAdcCounts(theMEBeam3Ring6Disc4PosAdcCounts,
00947                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00948                 }
00949               else if ( theTECWheel == 5 )
00950                 {
00951                   fillAdcCounts(theMEBeam3Ring6Disc5PosAdcCounts,
00952                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00953                 }
00954               else if ( theTECWheel == 6 )
00955                 {
00956                   fillAdcCounts(theMEBeam3Ring6Disc6PosAdcCounts,
00957                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00958                 }
00959               else if ( theTECWheel == 7 )
00960                 {
00961                   fillAdcCounts(theMEBeam3Ring6Disc7PosAdcCounts,
00962                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00963                 }
00964               else if ( theTECWheel == 8 )
00965                 {
00966                   fillAdcCounts(theMEBeam3Ring6Disc8PosAdcCounts,
00967                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00968                 }
00969               else if ( theTECWheel == 9 )
00970                 { 
00971                   fillAdcCounts(theMEBeam3Ring6Disc9PosAdcCounts,
00972                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00973                 }
00974             }
00975           // **** end of beam 3 in Ring 6 ****
00976 
00977           // **** Beam 4 in Ring 6 ****
00978           else if ( (thePart == "TEC+") && (theRing == 6) && (theBeam == 4) )
00979             {
00980               if ( theTECWheel == 1 )
00981                 { 
00982                   fillAdcCounts(theMEBeam4Ring6Disc1PosAdcCounts,
00983                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00984                 }
00985               else if ( theTECWheel == 2 )
00986                 {
00987                   fillAdcCounts(theMEBeam4Ring6Disc2PosAdcCounts,
00988                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00989                 }
00990               else if ( theTECWheel == 3 )
00991                 {
00992                   fillAdcCounts(theMEBeam4Ring6Disc3PosAdcCounts,
00993                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00994                 }
00995               else if ( theTECWheel == 4 )
00996                 {
00997                   fillAdcCounts(theMEBeam4Ring6Disc4PosAdcCounts,
00998                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
00999                 }
01000               else if ( theTECWheel == 5 )
01001                 {
01002                   fillAdcCounts(theMEBeam4Ring6Disc5PosAdcCounts,
01003                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01004                 }
01005               else if ( theTECWheel == 6 )
01006                 {
01007                   fillAdcCounts(theMEBeam4Ring6Disc6PosAdcCounts,
01008                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01009                 }
01010               else if ( theTECWheel == 7 )
01011                 {
01012                   fillAdcCounts(theMEBeam4Ring6Disc7PosAdcCounts,
01013                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01014                 }
01015               else if ( theTECWheel == 8 )
01016                 {
01017                   fillAdcCounts(theMEBeam4Ring6Disc8PosAdcCounts,
01018                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01019                 }
01020               else if ( theTECWheel == 9 )
01021                 { 
01022                   fillAdcCounts(theMEBeam4Ring6Disc9PosAdcCounts,
01023                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01024                 }
01025             }
01026           // **** end of beam 4 in Ring 6 ****
01027 
01028           // **** Beam 5 in Ring 6 ****
01029           else if ( (thePart == "TEC+") && (theRing == 6) && (theBeam == 5) )
01030             {
01031               if ( theTECWheel == 1 )
01032                 { 
01033                   fillAdcCounts(theMEBeam5Ring6Disc1PosAdcCounts,
01034                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01035                 }
01036               else if ( theTECWheel == 2 )
01037                 {
01038                   fillAdcCounts(theMEBeam5Ring6Disc2PosAdcCounts,
01039                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01040                 }
01041               else if ( theTECWheel == 3 )
01042                 {
01043                   fillAdcCounts(theMEBeam5Ring6Disc3PosAdcCounts,
01044                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01045                 }
01046               else if ( theTECWheel == 4 )
01047                 {
01048                   fillAdcCounts(theMEBeam5Ring6Disc4PosAdcCounts,
01049                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01050                 }
01051               else if ( theTECWheel == 5 )
01052                 {
01053                   fillAdcCounts(theMEBeam5Ring6Disc5PosAdcCounts,
01054                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01055                 }
01056               else if ( theTECWheel == 6 )
01057                 {
01058                   fillAdcCounts(theMEBeam5Ring6Disc6PosAdcCounts,
01059                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01060                 }
01061               else if ( theTECWheel == 7 )
01062                 {
01063                   fillAdcCounts(theMEBeam5Ring6Disc7PosAdcCounts,
01064                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01065                 }
01066               else if ( theTECWheel == 8 )
01067                 {
01068                   fillAdcCounts(theMEBeam5Ring6Disc8PosAdcCounts,
01069                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01070                 }
01071               else if ( theTECWheel == 9 )
01072                 { 
01073                   fillAdcCounts(theMEBeam5Ring6Disc9PosAdcCounts,
01074                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01075                 }
01076             }
01077           // **** end of beam 5 in Ring 6 ****
01078 
01079           // **** Beam 6 in Ring 6 ****
01080           else if ( (thePart == "TEC+") && (theRing == 6) && (theBeam == 6) )
01081             {
01082               if ( theTECWheel == 1 )
01083                 { 
01084                   fillAdcCounts(theMEBeam6Ring6Disc1PosAdcCounts, 
01085                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01086                 }
01087               else if ( theTECWheel == 2 )
01088                 {
01089                   fillAdcCounts(theMEBeam6Ring6Disc2PosAdcCounts,
01090                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01091                 }
01092               else if ( theTECWheel == 3 )
01093                 {
01094                   fillAdcCounts(theMEBeam6Ring6Disc3PosAdcCounts,
01095                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01096                 }
01097               else if ( theTECWheel == 4 )
01098                 {
01099                   fillAdcCounts(theMEBeam6Ring6Disc4PosAdcCounts,
01100                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01101                 }
01102               else if ( theTECWheel == 5 )
01103                 {
01104                   fillAdcCounts(theMEBeam6Ring6Disc5PosAdcCounts,
01105                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01106                 }
01107               else if ( theTECWheel == 6 )
01108                 {
01109                   fillAdcCounts(theMEBeam6Ring6Disc6PosAdcCounts,
01110                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01111                 }
01112               else if ( theTECWheel == 7 )
01113                 {
01114                   fillAdcCounts(theMEBeam6Ring6Disc7PosAdcCounts,
01115                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01116                 }
01117               else if ( theTECWheel == 8 )
01118                 {
01119                   fillAdcCounts(theMEBeam6Ring6Disc8PosAdcCounts,
01120                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01121                 }
01122               else if ( theTECWheel == 9 )
01123                 { 
01124                   fillAdcCounts(theMEBeam6Ring6Disc9PosAdcCounts,
01125                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01126                 }
01127             }
01128           // **** end of beam 6 in Ring 6 ****
01129 
01130           // **** Beam 7 in Ring 6 ****
01131           else if ( (thePart == "TEC+") && (theRing == 6) && (theBeam == 7) )
01132             {
01133               if ( theTECWheel == 1 )
01134                 { 
01135                   fillAdcCounts(theMEBeam7Ring6Disc1PosAdcCounts,
01136                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01137                 }
01138               else if ( theTECWheel == 2 )
01139                 {
01140                   fillAdcCounts(theMEBeam7Ring6Disc2PosAdcCounts,
01141                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01142                 }
01143               else if ( theTECWheel == 3 )
01144                 {
01145                   fillAdcCounts(theMEBeam7Ring6Disc3PosAdcCounts,
01146                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01147                 }
01148               else if ( theTECWheel == 4 )
01149                 {
01150                   fillAdcCounts(theMEBeam7Ring6Disc4PosAdcCounts,
01151                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01152                 }
01153               else if ( theTECWheel == 5 )
01154                 {
01155                   fillAdcCounts(theMEBeam7Ring6Disc5PosAdcCounts,
01156                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01157                 }
01158               else if ( theTECWheel == 6 )
01159                 {
01160                   fillAdcCounts(theMEBeam7Ring6Disc6PosAdcCounts,
01161                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01162                 }
01163               else if ( theTECWheel == 7 )
01164                 {
01165                   fillAdcCounts(theMEBeam7Ring6Disc7PosAdcCounts,
01166                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01167                 }
01168               else if ( theTECWheel == 8 )
01169                 {
01170                   fillAdcCounts(theMEBeam7Ring6Disc8PosAdcCounts,
01171                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01172                 }
01173               else if ( theTECWheel == 9 )
01174                 { 
01175                   fillAdcCounts(theMEBeam7Ring6Disc9PosAdcCounts,
01176                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01177                 }
01178             }
01179           // **** end of beam 7 in Ring 6 ****
01180 
01181           // ***** TEC- *****
01182           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 0) )
01183             {
01184               if ( theTECWheel == 1 )
01185                 { 
01186                   fillAdcCounts(theMEBeam0Ring4Disc1NegAdcCounts,
01187                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01188                 }
01189               else if ( theTECWheel == 2 )
01190                 {
01191                   fillAdcCounts(theMEBeam0Ring4Disc2NegAdcCounts,
01192                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01193                 }
01194               else if ( theTECWheel == 3 )
01195                 {
01196                   fillAdcCounts(theMEBeam0Ring4Disc3NegAdcCounts,
01197                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01198                 }
01199               else if ( theTECWheel == 4 )
01200                 {
01201                   fillAdcCounts(theMEBeam0Ring4Disc4NegAdcCounts,
01202                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01203                 }
01204               else if ( theTECWheel == 5 )
01205                 {
01206                   fillAdcCounts(theMEBeam0Ring4Disc5NegAdcCounts,
01207                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01208                 }
01209               else if ( theTECWheel == 6 )
01210                 {
01211                   fillAdcCounts(theMEBeam0Ring4Disc6NegAdcCounts,
01212                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01213                 }
01214               else if ( theTECWheel == 7 )
01215                 {
01216                   fillAdcCounts(theMEBeam0Ring4Disc7NegAdcCounts,
01217                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01218                 }
01219               else if ( theTECWheel == 8 )
01220                 {
01221                   fillAdcCounts(theMEBeam0Ring4Disc8NegAdcCounts,
01222                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01223                 }
01224               else if ( theTECWheel == 9 )
01225                 { 
01226                   fillAdcCounts(theMEBeam0Ring4Disc9NegAdcCounts,
01227                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01228                 }
01229             }
01230           // **** end of beam 0 in Ring 4 ****
01231 
01232           // **** Beam 1 in Ring 4 ****
01233           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 1) )
01234             {
01235               if ( theTECWheel == 1 )
01236                 { 
01237                   fillAdcCounts(theMEBeam1Ring4Disc1NegAdcCounts,
01238                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01239                 }
01240               else if ( theTECWheel == 2 )
01241                 {
01242                   fillAdcCounts(theMEBeam1Ring4Disc2NegAdcCounts,
01243                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01244                 }
01245               else if ( theTECWheel == 3 )
01246                 {
01247                   fillAdcCounts(theMEBeam1Ring4Disc3NegAdcCounts,
01248                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01249                 }
01250               else if ( theTECWheel == 4 )
01251                 {
01252                   fillAdcCounts(theMEBeam1Ring4Disc4NegAdcCounts,
01253                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01254                 }
01255               else if ( theTECWheel == 5 )
01256                 {
01257                   fillAdcCounts(theMEBeam1Ring4Disc5NegAdcCounts,
01258                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01259                 }
01260               else if ( theTECWheel == 6 )
01261                 {
01262                   fillAdcCounts(theMEBeam1Ring4Disc6NegAdcCounts,
01263                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01264                 }
01265               else if ( theTECWheel == 7 )
01266                 {
01267                   fillAdcCounts(theMEBeam1Ring4Disc7NegAdcCounts,
01268                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01269                 }
01270               else if ( theTECWheel == 8 )
01271                 {
01272                   fillAdcCounts(theMEBeam1Ring4Disc8NegAdcCounts,
01273                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01274                 }
01275               else if ( theTECWheel == 9 )
01276                 { 
01277                   fillAdcCounts(theMEBeam1Ring4Disc9NegAdcCounts,
01278                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01279                 }
01280             }
01281           // **** TEC2TEC
01282           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 21) )
01283             {
01284               if ( theTECWheel == 1 )
01285                 { 
01286                   fillAdcCounts(theMEBeam1Ring4Disc1NegTEC2TECAdcCounts,
01287                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01288                 }
01289               else if ( theTECWheel == 2 )
01290                 {
01291                   fillAdcCounts(theMEBeam1Ring4Disc2NegTEC2TECAdcCounts,
01292                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01293                 }
01294               else if ( theTECWheel == 3 )
01295                 {
01296                   fillAdcCounts(theMEBeam1Ring4Disc3NegTEC2TECAdcCounts,
01297                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01298                 }
01299               else if ( theTECWheel == 4 )
01300                 {
01301                   fillAdcCounts(theMEBeam1Ring4Disc4NegTEC2TECAdcCounts,
01302                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01303                 }
01304               else if ( theTECWheel == 5 )
01305                 {
01306                   fillAdcCounts(theMEBeam1Ring4Disc5NegTEC2TECAdcCounts,
01307                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01308                 }
01309             }
01310           // **** end of beam 1 in Ring 4 ****
01311 
01312           // **** Beam 2 in Ring 4 ****
01313           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 2) )
01314             {
01315               if ( theTECWheel == 1 )
01316                 { 
01317                   fillAdcCounts(theMEBeam2Ring4Disc1NegAdcCounts,
01318                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01319                 }
01320               else if ( theTECWheel == 2 )
01321                 {
01322                   fillAdcCounts(theMEBeam2Ring4Disc2NegAdcCounts,
01323                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01324                 }
01325               else if ( theTECWheel == 3 )
01326                 {
01327                   fillAdcCounts(theMEBeam2Ring4Disc3NegAdcCounts,
01328                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01329                 }
01330               else if ( theTECWheel == 4 )
01331                 {
01332                   fillAdcCounts(theMEBeam2Ring4Disc4NegAdcCounts,
01333                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01334                 }
01335               else if ( theTECWheel == 5 )
01336                 {
01337                   fillAdcCounts(theMEBeam2Ring4Disc5NegAdcCounts,
01338                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01339                 }
01340               else if ( theTECWheel == 6 )
01341                 {
01342                   fillAdcCounts(theMEBeam2Ring4Disc6NegAdcCounts,
01343                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01344                 }
01345               else if ( theTECWheel == 7 )
01346                 {
01347                   fillAdcCounts(theMEBeam2Ring4Disc7NegAdcCounts,
01348                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01349                 }
01350               else if ( theTECWheel == 8 )
01351                 {
01352                   fillAdcCounts(theMEBeam2Ring4Disc8NegAdcCounts,
01353                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01354                 }
01355               else if ( theTECWheel == 9 )
01356                 { 
01357                   fillAdcCounts(theMEBeam2Ring4Disc9NegAdcCounts,
01358                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01359                 }
01360             }
01361           // TEC2TEC
01362           // **** Beam 2 in Ring 4 ****
01363           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 22) )
01364             {
01365               if ( theTECWheel == 1 )
01366                 { 
01367                   fillAdcCounts(theMEBeam2Ring4Disc1NegTEC2TECAdcCounts,
01368                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01369                 }
01370               else if ( theTECWheel == 2 )
01371                 {
01372                   fillAdcCounts(theMEBeam2Ring4Disc2NegTEC2TECAdcCounts,
01373                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01374                 }
01375               else if ( theTECWheel == 3 )
01376                 {
01377                   fillAdcCounts(theMEBeam2Ring4Disc3NegTEC2TECAdcCounts,
01378                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01379                 }
01380               else if ( theTECWheel == 4 )
01381                 {
01382                   fillAdcCounts(theMEBeam2Ring4Disc4NegTEC2TECAdcCounts,
01383                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01384                 }
01385               else if ( theTECWheel == 5 )
01386                 {
01387                   fillAdcCounts(theMEBeam2Ring4Disc5NegTEC2TECAdcCounts,
01388                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01389                 }
01390             }
01391           // **** end of beam 2 in Ring 4 ****
01392 
01393           // **** Beam 3 in Ring 4 ****
01394           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 3) )
01395             {
01396               if ( theTECWheel == 1 )
01397                 { 
01398                   fillAdcCounts(theMEBeam3Ring4Disc1NegAdcCounts,
01399                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01400                 }
01401               else if ( theTECWheel == 2 )
01402                 {
01403                   fillAdcCounts(theMEBeam3Ring4Disc2NegAdcCounts,
01404                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01405                 }
01406               else if ( theTECWheel == 3 )
01407                 {
01408                   fillAdcCounts(theMEBeam3Ring4Disc3NegAdcCounts,
01409                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01410                 }
01411               else if ( theTECWheel == 4 )
01412                 {
01413                   fillAdcCounts(theMEBeam3Ring4Disc4NegAdcCounts,
01414                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01415                 }
01416               else if ( theTECWheel == 5 )
01417                 {
01418                   fillAdcCounts(theMEBeam3Ring4Disc5NegAdcCounts,
01419                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01420                 }
01421               else if ( theTECWheel == 6 )
01422                 {
01423                   fillAdcCounts(theMEBeam3Ring4Disc6NegAdcCounts,
01424                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01425                 }
01426               else if ( theTECWheel == 7 )
01427                 {
01428                   fillAdcCounts(theMEBeam3Ring4Disc7NegAdcCounts,
01429                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01430                 }
01431               else if ( theTECWheel == 8 )
01432                 {
01433                   fillAdcCounts(theMEBeam3Ring4Disc8NegAdcCounts,
01434                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01435                 }
01436               else if ( theTECWheel == 9 )
01437                 { 
01438                   fillAdcCounts(theMEBeam3Ring4Disc9NegAdcCounts,
01439                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01440                 }
01441             }
01442           // **** end of beam 3 in Ring 4 ****
01443 
01444           // **** Beam 4 in Ring 4 ****
01445           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 4) )
01446             {
01447               if ( theTECWheel == 1 )
01448                 { 
01449                   fillAdcCounts(theMEBeam4Ring4Disc1NegAdcCounts,
01450                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01451                 }
01452               else if ( theTECWheel == 2 )
01453                 {
01454                   fillAdcCounts(theMEBeam4Ring4Disc2NegAdcCounts,
01455                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01456                 }
01457               else if ( theTECWheel == 3 )
01458                 {
01459                   fillAdcCounts(theMEBeam4Ring4Disc3NegAdcCounts,
01460                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01461                 }
01462               else if ( theTECWheel == 4 )
01463                 {
01464                   fillAdcCounts(theMEBeam4Ring4Disc4NegAdcCounts,
01465                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01466                 }
01467               else if ( theTECWheel == 5 )
01468                 {
01469                   fillAdcCounts(theMEBeam4Ring4Disc5NegAdcCounts,
01470                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01471                 }
01472               else if ( theTECWheel == 6 )
01473                 {
01474                   fillAdcCounts(theMEBeam4Ring4Disc6NegAdcCounts,
01475                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01476                 }
01477               else if ( theTECWheel == 7 )
01478                 {
01479                   fillAdcCounts(theMEBeam4Ring4Disc7NegAdcCounts,
01480                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01481                 }
01482               else if ( theTECWheel == 8 )
01483                 {
01484                   fillAdcCounts(theMEBeam4Ring4Disc8NegAdcCounts,
01485                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01486                 }
01487               else if ( theTECWheel == 9 )
01488                 { 
01489                   fillAdcCounts(theMEBeam4Ring4Disc9NegAdcCounts,
01490                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01491                 }
01492             }
01493           // TEC2TEC
01494           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 24) )
01495             {
01496               if ( theTECWheel == 1 )
01497                 { 
01498                   fillAdcCounts(theMEBeam4Ring4Disc1NegTEC2TECAdcCounts,
01499                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01500                 }
01501               else if ( theTECWheel == 2 )
01502                 {
01503                   fillAdcCounts(theMEBeam4Ring4Disc2NegTEC2TECAdcCounts,
01504                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01505                 }
01506               else if ( theTECWheel == 3 )
01507                 {
01508                   fillAdcCounts(theMEBeam4Ring4Disc3NegTEC2TECAdcCounts,
01509                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01510                 }
01511               else if ( theTECWheel == 4 )
01512                 {
01513                   fillAdcCounts(theMEBeam4Ring4Disc4NegTEC2TECAdcCounts,
01514                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01515                 }
01516               else if ( theTECWheel == 5 )
01517                 {
01518                   fillAdcCounts(theMEBeam4Ring4Disc5NegTEC2TECAdcCounts,
01519                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01520                 }
01521             }
01522           // **** end of beam 4 in Ring 4 ****
01523 
01524           // **** Beam 5 in Ring 4 ****
01525           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 5) )
01526             {
01527               if ( theTECWheel == 1 )
01528                 { 
01529                   fillAdcCounts(theMEBeam5Ring4Disc1NegAdcCounts,
01530                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01531                 }
01532               else if ( theTECWheel == 2 )
01533                 {
01534                   fillAdcCounts(theMEBeam5Ring4Disc2NegAdcCounts,
01535                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01536                 }
01537               else if ( theTECWheel == 3 )
01538                 {
01539                   fillAdcCounts(theMEBeam5Ring4Disc3NegAdcCounts,
01540                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01541                 }
01542               else if ( theTECWheel == 4 )
01543                 {
01544                   fillAdcCounts(theMEBeam5Ring4Disc4NegAdcCounts,
01545                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01546                 }
01547               else if ( theTECWheel == 5 )
01548                 {
01549                   fillAdcCounts(theMEBeam5Ring4Disc5NegAdcCounts,
01550                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01551                 }
01552               else if ( theTECWheel == 6 )
01553                 {
01554                   fillAdcCounts(theMEBeam5Ring4Disc6NegAdcCounts,
01555                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01556                 }
01557               else if ( theTECWheel == 7 )
01558                 {
01559                   fillAdcCounts(theMEBeam5Ring4Disc7NegAdcCounts,
01560                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01561                 }
01562               else if ( theTECWheel == 8 )
01563                 {
01564                   fillAdcCounts(theMEBeam5Ring4Disc8NegAdcCounts,
01565                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01566                 }
01567               else if ( theTECWheel == 9 )
01568                 { 
01569                   fillAdcCounts(theMEBeam5Ring4Disc9NegAdcCounts,
01570                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01571                 }
01572             }
01573           // **** end of beam 5 in Ring 4 ****
01574 
01575           // **** Beam 6 in Ring 4 ****
01576           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 6) )
01577             {
01578               if ( theTECWheel == 1 )
01579                 { 
01580                   fillAdcCounts(theMEBeam6Ring4Disc1NegAdcCounts,
01581                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01582                 }
01583               else if ( theTECWheel == 2 )
01584                 {
01585                   fillAdcCounts(theMEBeam6Ring4Disc2NegAdcCounts,
01586                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01587                 }
01588               else if ( theTECWheel == 3 )
01589                 {
01590                   fillAdcCounts(theMEBeam6Ring4Disc3NegAdcCounts,
01591                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01592                 }
01593               else if ( theTECWheel == 4 )
01594                 {
01595                   fillAdcCounts(theMEBeam6Ring4Disc4NegAdcCounts,
01596                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01597                 }
01598               else if ( theTECWheel == 5 )
01599                 {
01600                   fillAdcCounts(theMEBeam6Ring4Disc5NegAdcCounts,
01601                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01602                 }
01603               else if ( theTECWheel == 6 )
01604                 {
01605                   fillAdcCounts(theMEBeam6Ring4Disc6NegAdcCounts,
01606                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01607                 }
01608               else if ( theTECWheel == 7 )
01609                 {
01610                   fillAdcCounts(theMEBeam6Ring4Disc7NegAdcCounts,
01611                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01612                 }
01613               else if ( theTECWheel == 8 )
01614                 {
01615                   fillAdcCounts(theMEBeam6Ring4Disc8NegAdcCounts,
01616                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01617                 }
01618               else if ( theTECWheel == 9 )
01619                 { 
01620                   fillAdcCounts(theMEBeam6Ring4Disc9NegAdcCounts,
01621                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01622                 }
01623             }
01624           // TEC2TEC
01625           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 26) )
01626             {
01627               if ( theTECWheel == 1 )
01628                 { 
01629                   fillAdcCounts(theMEBeam6Ring4Disc1NegTEC2TECAdcCounts,
01630                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01631                 }
01632               else if ( theTECWheel == 2 )
01633                 {
01634                   fillAdcCounts(theMEBeam6Ring4Disc2NegTEC2TECAdcCounts,
01635                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01636                 }
01637               else if ( theTECWheel == 3 )
01638                 {
01639                   fillAdcCounts(theMEBeam6Ring4Disc3NegTEC2TECAdcCounts,
01640                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01641                 }
01642               else if ( theTECWheel == 4 )
01643                 {
01644                   fillAdcCounts(theMEBeam6Ring4Disc4NegTEC2TECAdcCounts,
01645                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01646                 }
01647               else if ( theTECWheel == 5 )
01648                 {
01649                   fillAdcCounts(theMEBeam6Ring4Disc5NegTEC2TECAdcCounts,
01650                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01651                 }
01652             }
01653           // **** end of beam 6 in Ring 4 ****
01654 
01655           // **** Beam 7 in Ring 4 ****
01656           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 7) )
01657             {
01658               if ( theTECWheel == 1 )
01659                 { 
01660                   fillAdcCounts(theMEBeam7Ring4Disc1NegAdcCounts,
01661                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01662                 }
01663               else if ( theTECWheel == 2 )
01664                 {
01665                   fillAdcCounts(theMEBeam7Ring4Disc2NegAdcCounts,
01666                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01667                 }
01668               else if ( theTECWheel == 3 )
01669                 {
01670                   fillAdcCounts(theMEBeam7Ring4Disc3NegAdcCounts,
01671                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01672                 }
01673               else if ( theTECWheel == 4 )
01674                 {
01675                   fillAdcCounts(theMEBeam7Ring4Disc4NegAdcCounts,
01676                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01677                 }
01678               else if ( theTECWheel == 5 )
01679                 {
01680                   fillAdcCounts(theMEBeam7Ring4Disc5NegAdcCounts,
01681                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01682                 }
01683               else if ( theTECWheel == 6 )
01684                 {
01685                   fillAdcCounts(theMEBeam7Ring4Disc6NegAdcCounts,
01686                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01687                 }
01688               else if ( theTECWheel == 7 )
01689                 {
01690                   fillAdcCounts(theMEBeam7Ring4Disc7NegAdcCounts,
01691                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01692                 }
01693               else if ( theTECWheel == 8 )
01694                 {
01695                   fillAdcCounts(theMEBeam7Ring4Disc8NegAdcCounts,
01696                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01697                 }
01698               else if ( theTECWheel == 9 )
01699                 { 
01700                   fillAdcCounts(theMEBeam7Ring4Disc9NegAdcCounts,
01701                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01702                 }
01703             }
01704           // TEC2TEC
01705           else if ( (thePart == "TEC-") && (theRing == 4) && (theBeam == 27) )
01706             {
01707               if ( theTECWheel == 1 )
01708                 { 
01709                   fillAdcCounts(theMEBeam7Ring4Disc1NegTEC2TECAdcCounts,
01710                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01711                 }
01712               else if ( theTECWheel == 2 )
01713                 {
01714                   fillAdcCounts(theMEBeam7Ring4Disc2NegTEC2TECAdcCounts,
01715                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01716                 }
01717               else if ( theTECWheel == 3 )
01718                 {
01719                   fillAdcCounts(theMEBeam7Ring4Disc3NegTEC2TECAdcCounts,
01720                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01721                 }
01722               else if ( theTECWheel == 4 )
01723                 {
01724                   fillAdcCounts(theMEBeam7Ring4Disc4NegTEC2TECAdcCounts,
01725                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01726                 }
01727               else if ( theTECWheel == 5 )
01728                 {
01729                   fillAdcCounts(theMEBeam7Ring4Disc5NegTEC2TECAdcCounts,
01730                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01731                 }
01732             }
01733           // **** end of beam 7 in Ring 4 ****
01734 
01735           // **** Ring 6
01736           else if ( (thePart == "TEC-") && (theRing == 6) && (theBeam == 0) )
01737             {
01738               if ( theTECWheel == 1 )
01739                 { 
01740                   fillAdcCounts(theMEBeam0Ring6Disc1NegAdcCounts,
01741                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01742                 }
01743               else if ( theTECWheel == 2 )
01744                 {
01745                   fillAdcCounts(theMEBeam0Ring6Disc2NegAdcCounts,
01746                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01747                 }
01748               else if ( theTECWheel == 3 )
01749                 {
01750                   fillAdcCounts(theMEBeam0Ring6Disc3NegAdcCounts,
01751                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01752                 }
01753               else if ( theTECWheel == 4 )
01754                 {
01755                   fillAdcCounts(theMEBeam0Ring6Disc4NegAdcCounts,
01756                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01757                 }
01758               else if ( theTECWheel == 5 )
01759                 {
01760                   fillAdcCounts(theMEBeam0Ring6Disc5NegAdcCounts,
01761                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01762                 }
01763               else if ( theTECWheel == 6 )
01764                 {
01765                   fillAdcCounts(theMEBeam0Ring6Disc6NegAdcCounts,
01766                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01767                 }
01768               else if ( theTECWheel == 7 )
01769                 {
01770                   fillAdcCounts(theMEBeam0Ring6Disc7NegAdcCounts,
01771                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01772                 }
01773               else if ( theTECWheel == 8 )
01774                 {
01775                   fillAdcCounts(theMEBeam0Ring6Disc8NegAdcCounts,
01776                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01777                 }
01778               else if ( theTECWheel == 9 )
01779                 { 
01780                   fillAdcCounts(theMEBeam0Ring6Disc9NegAdcCounts,
01781                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01782                 }
01783             }
01784           // **** end of beam 0 in Ring 6 ****
01785 
01786           // **** Beam 1 in Ring 6 ****
01787           else if ( (thePart == "TEC-") && (theRing == 6) && (theBeam == 1) )
01788             {
01789               if ( theTECWheel == 1 )
01790                 { 
01791                   fillAdcCounts(theMEBeam1Ring6Disc1NegAdcCounts,
01792                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01793                 }
01794               else if ( theTECWheel == 2 )
01795                 {
01796                   fillAdcCounts(theMEBeam1Ring6Disc2NegAdcCounts,
01797                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01798                 }
01799               else if ( theTECWheel == 3 )
01800                 {
01801                   fillAdcCounts(theMEBeam1Ring6Disc3NegAdcCounts,
01802                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01803                 }
01804               else if ( theTECWheel == 4 )
01805                 {
01806                   fillAdcCounts(theMEBeam1Ring6Disc4NegAdcCounts,
01807                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01808                 }
01809               else if ( theTECWheel == 5 )
01810                 {
01811                   fillAdcCounts(theMEBeam1Ring6Disc5NegAdcCounts,
01812                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01813                 }
01814               else if ( theTECWheel == 6 )
01815                 {
01816                   fillAdcCounts(theMEBeam1Ring6Disc6NegAdcCounts,
01817                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01818                 }
01819               else if ( theTECWheel == 7 )
01820                 {
01821                   fillAdcCounts(theMEBeam1Ring6Disc7NegAdcCounts,
01822                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01823                 }
01824               else if ( theTECWheel == 8 )
01825                 {
01826                   fillAdcCounts(theMEBeam1Ring6Disc8NegAdcCounts,
01827                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01828                 }
01829               else if ( theTECWheel == 9 )
01830                 { 
01831                   fillAdcCounts(theMEBeam1Ring6Disc9NegAdcCounts,
01832                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01833                 }
01834             }
01835           // **** end of beam 1 in Ring 6 ****
01836 
01837           // **** Beam 2 in Ring 6 ****
01838           else if ( (thePart == "TEC-") && (theRing == 6) && (theBeam == 2) )
01839             {
01840               if ( theTECWheel == 1 )
01841                 { 
01842                   fillAdcCounts(theMEBeam2Ring6Disc1NegAdcCounts,
01843                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01844                 }
01845               else if ( theTECWheel == 2 )
01846                 {
01847                   fillAdcCounts(theMEBeam2Ring6Disc2NegAdcCounts,
01848                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01849                 }
01850               else if ( theTECWheel == 3 )
01851                 {
01852                   fillAdcCounts(theMEBeam2Ring6Disc3NegAdcCounts,
01853                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01854                 }
01855               else if ( theTECWheel == 4 )
01856                 {
01857                   fillAdcCounts(theMEBeam2Ring6Disc4NegAdcCounts,
01858                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01859                 }
01860               else if ( theTECWheel == 5 )
01861                 {
01862                   fillAdcCounts(theMEBeam2Ring6Disc5NegAdcCounts,
01863                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01864                 }
01865               else if ( theTECWheel == 6 )
01866                 {
01867                   fillAdcCounts(theMEBeam2Ring6Disc6NegAdcCounts,
01868                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01869                 }
01870               else if ( theTECWheel == 7 )
01871                 {
01872                   fillAdcCounts(theMEBeam2Ring6Disc7NegAdcCounts,
01873                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01874                 }
01875               else if ( theTECWheel == 8 )
01876                 {
01877                   fillAdcCounts(theMEBeam2Ring6Disc8NegAdcCounts,
01878                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01879                 }
01880               else if ( theTECWheel == 9 )
01881                 { 
01882                   fillAdcCounts(theMEBeam2Ring6Disc9NegAdcCounts,
01883                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01884                 }
01885             }
01886           // **** end of beam 2 in Ring 6 ****
01887 
01888           // **** Beam 3 in Ring 6 ****
01889           else if ( (thePart == "TEC-") && (theRing == 6) && (theBeam == 3) )
01890             {
01891               if ( theTECWheel == 1 )
01892                 { 
01893                   fillAdcCounts(theMEBeam3Ring6Disc1NegAdcCounts,
01894                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01895                 }
01896               else if ( theTECWheel == 2 )
01897                 {
01898                   fillAdcCounts(theMEBeam3Ring6Disc2NegAdcCounts,
01899                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01900                 }
01901               else if ( theTECWheel == 3 )
01902                 {
01903                   fillAdcCounts(theMEBeam3Ring6Disc3NegAdcCounts,
01904                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01905                 }
01906               else if ( theTECWheel == 4 )
01907                 {
01908                   fillAdcCounts(theMEBeam3Ring6Disc4NegAdcCounts,
01909                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01910                 }
01911               else if ( theTECWheel == 5 )
01912                 {
01913                   fillAdcCounts(theMEBeam3Ring6Disc5NegAdcCounts,
01914                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01915                 }
01916               else if ( theTECWheel == 6 )
01917                 {
01918                   fillAdcCounts(theMEBeam3Ring6Disc6NegAdcCounts,
01919                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01920                 }
01921               else if ( theTECWheel == 7 )
01922                 {
01923                   fillAdcCounts(theMEBeam3Ring6Disc7NegAdcCounts,
01924                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01925                 }
01926               else if ( theTECWheel == 8 )
01927                 {
01928                   fillAdcCounts(theMEBeam3Ring6Disc8NegAdcCounts,
01929                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01930                 }
01931               else if ( theTECWheel == 9 )
01932                 { 
01933                   fillAdcCounts(theMEBeam3Ring6Disc9NegAdcCounts,
01934                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01935                 }
01936             }
01937           // **** end of beam 3 in Ring 6 ****
01938 
01939           // **** Beam 4 in Ring 6 ****
01940           else if ( (thePart == "TEC-") && (theRing == 6) && (theBeam == 4) )
01941             {
01942               if ( theTECWheel == 1 )
01943                 { 
01944                   fillAdcCounts(theMEBeam4Ring6Disc1NegAdcCounts,
01945                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01946                 }
01947               else if ( theTECWheel == 2 )
01948                 {
01949                   fillAdcCounts(theMEBeam4Ring6Disc2NegAdcCounts,
01950                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01951                 }
01952               else if ( theTECWheel == 3 )
01953                 {
01954                   fillAdcCounts(theMEBeam4Ring6Disc3NegAdcCounts,
01955                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01956                 }
01957               else if ( theTECWheel == 4 )
01958                 {
01959                   fillAdcCounts(theMEBeam4Ring6Disc4NegAdcCounts,
01960                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01961                 }
01962               else if ( theTECWheel == 5 )
01963                 {
01964                   fillAdcCounts(theMEBeam4Ring6Disc5NegAdcCounts,
01965                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01966                 }
01967               else if ( theTECWheel == 6 )
01968                 {
01969                   fillAdcCounts(theMEBeam4Ring6Disc6NegAdcCounts,
01970                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01971                 }
01972               else if ( theTECWheel == 7 )
01973                 {
01974                   fillAdcCounts(theMEBeam4Ring6Disc7NegAdcCounts,
01975                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01976                 }
01977               else if ( theTECWheel == 8 )
01978                 {
01979                   fillAdcCounts(theMEBeam4Ring6Disc8NegAdcCounts,
01980                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01981                 }
01982               else if ( theTECWheel == 9 )
01983                 { 
01984                   fillAdcCounts(theMEBeam4Ring6Disc9NegAdcCounts,
01985                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01986                 }
01987             }
01988           // **** end of beam 4 in Ring 6 ****
01989 
01990           // **** Beam 5 in Ring 6 ****
01991           else if ( (thePart == "TEC-") && (theRing == 6) && (theBeam == 5) )
01992             {
01993               if ( theTECWheel == 1 )
01994                 { 
01995                   fillAdcCounts(theMEBeam5Ring6Disc1NegAdcCounts,
01996                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
01997                 }
01998               else if ( theTECWheel == 2 )
01999                 {
02000                   fillAdcCounts(theMEBeam5Ring6Disc2NegAdcCounts,
02001                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02002                 }
02003               else if ( theTECWheel == 3 )
02004                 {
02005                   fillAdcCounts(theMEBeam5Ring6Disc3NegAdcCounts,
02006                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02007                 }
02008               else if ( theTECWheel == 4 )
02009                 {
02010                   fillAdcCounts(theMEBeam5Ring6Disc4NegAdcCounts,
02011                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02012                 }
02013               else if ( theTECWheel == 5 )
02014                 {
02015                   fillAdcCounts(theMEBeam5Ring6Disc5NegAdcCounts,
02016                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02017                 }
02018               else if ( theTECWheel == 6 )
02019                 {
02020                   fillAdcCounts(theMEBeam5Ring6Disc6NegAdcCounts,
02021                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02022                 }
02023               else if ( theTECWheel == 7 )
02024                 {
02025                   fillAdcCounts(theMEBeam5Ring6Disc7NegAdcCounts,
02026                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02027                 }
02028               else if ( theTECWheel == 8 )
02029                 {
02030                   fillAdcCounts(theMEBeam5Ring6Disc8NegAdcCounts,
02031                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02032                 }
02033               else if ( theTECWheel == 9 )
02034                 { 
02035                   fillAdcCounts(theMEBeam5Ring6Disc9NegAdcCounts,
02036                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02037                 }
02038             }
02039           // **** end of beam 5 in Ring 6 ****
02040 
02041           // **** Beam 6 in Ring 6 ****
02042           else if ( (thePart == "TEC-") && (theRing == 6) && (theBeam == 6) )
02043             {
02044               if ( theTECWheel == 1 )
02045                 { 
02046                   fillAdcCounts(theMEBeam6Ring6Disc1NegAdcCounts,
02047                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02048                 }
02049               else if ( theTECWheel == 2 )
02050                 {
02051                   fillAdcCounts(theMEBeam6Ring6Disc2NegAdcCounts,
02052                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02053                 }
02054               else if ( theTECWheel == 3 )
02055                 {
02056                   fillAdcCounts(theMEBeam6Ring6Disc3NegAdcCounts,
02057                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02058                 }
02059               else if ( theTECWheel == 4 )
02060                 {
02061                   fillAdcCounts(theMEBeam6Ring6Disc4NegAdcCounts,
02062                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02063                 }
02064               else if ( theTECWheel == 5 )
02065                 {
02066                   fillAdcCounts(theMEBeam6Ring6Disc5NegAdcCounts,
02067                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02068                 }
02069               else if ( theTECWheel == 6 )
02070                 {
02071                   fillAdcCounts(theMEBeam6Ring6Disc6NegAdcCounts,
02072                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02073                 }
02074               else if ( theTECWheel == 7 )
02075                 {
02076                   fillAdcCounts(theMEBeam6Ring6Disc7NegAdcCounts,
02077                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02078                 }
02079               else if ( theTECWheel == 8 )
02080                 {
02081                   fillAdcCounts(theMEBeam6Ring6Disc8NegAdcCounts,
02082                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02083                 }
02084               else if ( theTECWheel == 9 )
02085                 { 
02086                   fillAdcCounts(theMEBeam6Ring6Disc9NegAdcCounts,
02087                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02088                 }
02089             }
02090           // **** end of beam 6 in Ring 6 ****
02091 
02092           // **** Beam 7 in Ring 6 ****
02093           else if ( (thePart == "TEC-") && (theRing == 6) && (theBeam == 7) )
02094             {
02095               if ( theTECWheel == 1 )
02096                 { 
02097                   fillAdcCounts(theMEBeam7Ring6Disc1NegAdcCounts,
02098                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02099                 }
02100               else if ( theTECWheel == 2 )
02101                 {
02102                   fillAdcCounts(theMEBeam7Ring6Disc2NegAdcCounts,
02103                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02104                 }
02105               else if ( theTECWheel == 3 )
02106                 {
02107                   fillAdcCounts(theMEBeam7Ring6Disc3NegAdcCounts,
02108                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02109                 }
02110               else if ( theTECWheel == 4 )
02111                 {
02112                   fillAdcCounts(theMEBeam7Ring6Disc4NegAdcCounts,
02113                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02114                 }
02115               else if ( theTECWheel == 5 )
02116                 {
02117                   fillAdcCounts(theMEBeam7Ring6Disc5NegAdcCounts,
02118                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02119                 }
02120               else if ( theTECWheel == 6 )
02121                 {
02122                   fillAdcCounts(theMEBeam7Ring6Disc6NegAdcCounts,
02123                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02124                 }
02125               else if ( theTECWheel == 7 )
02126                 {
02127                   fillAdcCounts(theMEBeam7Ring6Disc7NegAdcCounts,
02128                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02129                 }
02130               else if ( theTECWheel == 8 )
02131                 {
02132                   fillAdcCounts(theMEBeam7Ring6Disc8NegAdcCounts,
02133                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02134                 }
02135               else if ( theTECWheel == 9 )
02136                 { 
02137                   fillAdcCounts(theMEBeam7Ring6Disc9NegAdcCounts,
02138                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02139                 }
02140             }
02141           // **** end of beam 7 in Ring 6 ****
02142 
02143           // ***** TOB *****
02144           // **** Beam 0 in TOB ****
02145           else if ( (thePart == "TOB") && (theTOBLayer == 1) && (theBeam == 0) && (theTOBStereoDet == 0) && (theStripDet->surface().position().perp() < 58.5) )
02146             {
02147               if ( (theStripDet->surface().position().z() > 99.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 99.0 + theSearchZTOB) )
02148                 { 
02149                   fillAdcCounts(theMEBeam0TOBPosition1AdcCounts,
02150                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02151                 }
02152               else if ( (theStripDet->surface().position().z() > 64.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 64.0 + theSearchZTOB) )
02153                 { 
02154                   fillAdcCounts(theMEBeam0TOBPosition2AdcCounts,
02155                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02156                 }
02157               else if ( (theStripDet->surface().position().z() > 27.5 - theSearchZTOB) && (theStripDet->surface().position().z() < 27.5 + theSearchZTOB) )
02158                 { 
02159                   fillAdcCounts(theMEBeam0TOBPosition3AdcCounts,
02160                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02161                 }
02162               else if ( (theStripDet->surface().position().z() < -10.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -10.0 - theSearchZTOB) )
02163                 { 
02164                   fillAdcCounts(theMEBeam0TOBPosition4AdcCounts,
02165                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02166                 }
02167               else if ( (theStripDet->surface().position().z() < -46.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -46.0 - theSearchZTOB) )
02168                 { 
02169                   fillAdcCounts(theMEBeam0TOBPosition5AdcCounts,
02170                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02171                 }
02172               else if ( (theStripDet->surface().position().z() < -80.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -80.0 - theSearchZTOB) )
02173                 { 
02174                   fillAdcCounts(theMEBeam0TOBPosition6AdcCounts,
02175                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02176                 }
02177             }
02178           // **** end of Beam 0 in TOB ****
02179       
02180           // **** Beam 1 in TOB ****
02181           else if ( (thePart == "TOB") && (theTOBLayer == 1) && (theBeam == 1) && (theTOBStereoDet == 0) && (theStripDet->surface().position().perp() < 58.5) )
02182             {
02183               if ( (theStripDet->surface().position().z() > 99.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 99.0 + theSearchZTOB) )
02184                 { 
02185                   fillAdcCounts(theMEBeam1TOBPosition1AdcCounts,
02186                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02187                 }
02188               else if ( (theStripDet->surface().position().z() > 64.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 64.0 + theSearchZTOB) )
02189                 { 
02190                   fillAdcCounts(theMEBeam1TOBPosition2AdcCounts,
02191                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02192                 }
02193               else if ( (theStripDet->surface().position().z() > 27.5 - theSearchZTOB) && (theStripDet->surface().position().z() < 27.5 + theSearchZTOB) )
02194                 { 
02195                   fillAdcCounts(theMEBeam1TOBPosition3AdcCounts,
02196                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02197                 }
02198               else if ( (theStripDet->surface().position().z() < -10.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -10.0 - theSearchZTOB) )
02199                 { 
02200                   fillAdcCounts(theMEBeam1TOBPosition4AdcCounts,
02201                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02202                 }
02203               else if ( (theStripDet->surface().position().z() < -46.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -46.0 - theSearchZTOB) )
02204                 { 
02205                   fillAdcCounts(theMEBeam1TOBPosition5AdcCounts,
02206                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02207                 }
02208               else if ( (theStripDet->surface().position().z() < -80.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -80.0 - theSearchZTOB) )
02209                 { 
02210                   fillAdcCounts(theMEBeam1TOBPosition6AdcCounts,
02211                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02212                 }
02213             }
02214           // **** end of Beam 1 in TOB ****
02215       
02216           // **** Beam 2 in TOB ****
02217           else if ( (thePart == "TOB") && (theTOBLayer == 1) && (theBeam == 2) && (theTOBStereoDet == 0) && (theStripDet->surface().position().perp() < 58.5) )
02218             {
02219               if ( (theStripDet->surface().position().z() > 99.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 99.0 + theSearchZTOB) )
02220                 { 
02221                   fillAdcCounts(theMEBeam2TOBPosition1AdcCounts,
02222                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02223                 }
02224               else if ( (theStripDet->surface().position().z() > 64.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 64.0 + theSearchZTOB) )
02225                 { 
02226                   fillAdcCounts(theMEBeam2TOBPosition2AdcCounts,
02227                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02228                 }
02229               else if ( (theStripDet->surface().position().z() > 27.5 - theSearchZTOB) && (theStripDet->surface().position().z() < 27.5 + theSearchZTOB) )
02230                 { 
02231                   fillAdcCounts(theMEBeam2TOBPosition3AdcCounts,
02232                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02233                 }
02234               else if ( (theStripDet->surface().position().z() < -10.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -10.0 - theSearchZTOB) )
02235                 { 
02236                   fillAdcCounts(theMEBeam2TOBPosition4AdcCounts,
02237                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02238                 }
02239               else if ( (theStripDet->surface().position().z() < -46.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -46.0 - theSearchZTOB) )
02240                 { 
02241                   fillAdcCounts(theMEBeam2TOBPosition5AdcCounts,
02242                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02243                 }
02244               else if ( (theStripDet->surface().position().z() < -80.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -80.0 - theSearchZTOB) )
02245                 { 
02246                   fillAdcCounts(theMEBeam2TOBPosition6AdcCounts,
02247                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02248                 }
02249             }
02250           // **** end of Beam 2 in TOB ****
02251       
02252           // **** Beam 3 in TOB ****
02253           else if ( (thePart == "TOB") && (theTOBLayer == 1) && (theBeam == 3) && (theTOBStereoDet == 0) && (theStripDet->surface().position().perp() < 58.5) )
02254             {
02255               if ( (theStripDet->surface().position().z() > 99.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 99.0 + theSearchZTOB) )
02256                 { 
02257                   fillAdcCounts(theMEBeam3TOBPosition1AdcCounts,
02258                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02259                 }
02260               else if ( (theStripDet->surface().position().z() > 64.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 64.0 + theSearchZTOB) )
02261                 { 
02262                   fillAdcCounts(theMEBeam3TOBPosition2AdcCounts,
02263                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02264                 }
02265               else if ( (theStripDet->surface().position().z() > 27.5 - theSearchZTOB) && (theStripDet->surface().position().z() < 27.5 + theSearchZTOB) )
02266                 { 
02267                   fillAdcCounts(theMEBeam3TOBPosition3AdcCounts,
02268                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02269                 }
02270               else if ( (theStripDet->surface().position().z() < -10.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -10.0 - theSearchZTOB) )
02271                 { 
02272                   fillAdcCounts(theMEBeam3TOBPosition4AdcCounts,
02273                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02274                 }
02275               else if ( (theStripDet->surface().position().z() < -46.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -46.0 - theSearchZTOB) )
02276                 { 
02277                   fillAdcCounts(theMEBeam3TOBPosition5AdcCounts,
02278                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02279                 }
02280               else if ( (theStripDet->surface().position().z() < -80.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -80.0 - theSearchZTOB) )
02281                 { 
02282                   fillAdcCounts(theMEBeam3TOBPosition6AdcCounts,
02283                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02284                 }
02285             }
02286           // **** end of Beam 3 in TOB ****
02287 
02288           // **** Beam 4 in TOB ****
02289           else if ( (thePart == "TOB") && (theTOBLayer == 1) && (theBeam == 4) && (theTOBStereoDet == 0) && (theStripDet->surface().position().perp() < 58.5) )
02290             {
02291               if ( (theStripDet->surface().position().z() > 99.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 99.0 + theSearchZTOB) )
02292                 { 
02293                   fillAdcCounts(theMEBeam4TOBPosition1AdcCounts,
02294                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02295                 }
02296               else if ( (theStripDet->surface().position().z() > 64.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 64.0 + theSearchZTOB) )
02297                 { 
02298                   fillAdcCounts(theMEBeam4TOBPosition2AdcCounts,
02299                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02300                 }
02301               else if ( (theStripDet->surface().position().z() > 27.5 - theSearchZTOB) && (theStripDet->surface().position().z() < 27.5 + theSearchZTOB) )
02302                 { 
02303                   fillAdcCounts(theMEBeam4TOBPosition3AdcCounts,
02304                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02305                 }
02306               else if ( (theStripDet->surface().position().z() < -10.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -10.0 - theSearchZTOB) )
02307                 { 
02308                   fillAdcCounts(theMEBeam4TOBPosition4AdcCounts,
02309                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02310                 }
02311               else if ( (theStripDet->surface().position().z() < -46.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -46.0 - theSearchZTOB) )
02312                 { 
02313                   fillAdcCounts(theMEBeam4TOBPosition5AdcCounts,
02314                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02315                 }
02316               else if ( (theStripDet->surface().position().z() < -80.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -80.0 - theSearchZTOB) )
02317                 { 
02318                   fillAdcCounts(theMEBeam4TOBPosition6AdcCounts,
02319                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02320                 }
02321             }
02322           // **** end of Beam 4 in TOB ****
02323 
02324           // **** Beam 5 in TOB ****
02325           else if ( (thePart == "TOB") && (theTOBLayer == 1) && (theBeam == 5) && (theTOBStereoDet == 0) && (theStripDet->surface().position().perp() < 58.5) )
02326             {
02327               if ( (theStripDet->surface().position().z() > 99.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 99.0 + theSearchZTOB) )
02328                 { 
02329                   fillAdcCounts(theMEBeam5TOBPosition1AdcCounts,
02330                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02331                 }
02332               else if ( (theStripDet->surface().position().z() > 64.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 64.0 + theSearchZTOB) )
02333                 { 
02334                   fillAdcCounts(theMEBeam5TOBPosition2AdcCounts,
02335                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02336                 }
02337               else if ( (theStripDet->surface().position().z() > 27.5 - theSearchZTOB) && (theStripDet->surface().position().z() < 27.5 + theSearchZTOB) )
02338                 { 
02339                   fillAdcCounts(theMEBeam5TOBPosition3AdcCounts,
02340                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02341                 }
02342               else if ( (theStripDet->surface().position().z() < -10.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -10.0 - theSearchZTOB) )
02343                 { 
02344                   fillAdcCounts(theMEBeam5TOBPosition4AdcCounts,
02345                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02346                 }
02347               else if ( (theStripDet->surface().position().z() < -46.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -46.0 - theSearchZTOB) )
02348                 { 
02349                   fillAdcCounts(theMEBeam5TOBPosition5AdcCounts,
02350                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02351                 }
02352               else if ( (theStripDet->surface().position().z() < -80.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -80.0 - theSearchZTOB) )
02353                 { 
02354                   fillAdcCounts(theMEBeam5TOBPosition6AdcCounts,
02355                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02356                 }
02357             }
02358           // **** end of Beam 5 in TOB ****
02359 
02360           // **** Beam 6 in TOB ****
02361           else if ( (thePart == "TOB") && (theTOBLayer == 1) && (theBeam == 6) && (theTOBStereoDet == 0) && (theStripDet->surface().position().perp() < 58.5) )
02362             {
02363               if ( (theStripDet->surface().position().z() > 99.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 99.0 + theSearchZTOB) )
02364                 { 
02365                   fillAdcCounts(theMEBeam6TOBPosition1AdcCounts,
02366                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02367                 }
02368               else if ( (theStripDet->surface().position().z() > 64.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 64.0 + theSearchZTOB) )
02369                 { 
02370                   fillAdcCounts(theMEBeam6TOBPosition2AdcCounts,
02371                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02372                 }
02373               else if ( (theStripDet->surface().position().z() > 27.5 - theSearchZTOB) && (theStripDet->surface().position().z() < 27.5 + theSearchZTOB) )
02374                 { 
02375                   fillAdcCounts(theMEBeam6TOBPosition3AdcCounts,
02376                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02377                 }
02378               else if ( (theStripDet->surface().position().z() < -10.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -10.0 - theSearchZTOB) )
02379                 { 
02380                   fillAdcCounts(theMEBeam6TOBPosition4AdcCounts,
02381                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02382                 }
02383               else if ( (theStripDet->surface().position().z() < -46.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -46.0 - theSearchZTOB) )
02384                 { 
02385                   fillAdcCounts(theMEBeam6TOBPosition5AdcCounts,
02386                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02387                 }
02388               else if ( (theStripDet->surface().position().z() < -80.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -80.0 - theSearchZTOB) )
02389                 { 
02390                   fillAdcCounts(theMEBeam6TOBPosition6AdcCounts,
02391                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02392                 }
02393             }
02394           // **** end of Beam 6 in TOB ****
02395       
02396           // **** Beam 7 in TOB ****
02397           else if ( (thePart == "TOB") && (theTOBLayer == 1) && (theBeam == 7) && (theTOBStereoDet == 0) && (theStripDet->surface().position().perp() < 58.5) )
02398             {
02399               if ( (theStripDet->surface().position().z() > 99.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 99.0 + theSearchZTOB) )
02400                 { 
02401                   fillAdcCounts(theMEBeam7TOBPosition1AdcCounts,
02402                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02403                 }
02404               else if ( (theStripDet->surface().position().z() > 64.0 - theSearchZTOB) && (theStripDet->surface().position().z() < 64.0 + theSearchZTOB) )
02405                 { 
02406                   fillAdcCounts(theMEBeam7TOBPosition2AdcCounts,
02407                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02408                 }
02409               else if ( (theStripDet->surface().position().z() > 27.5 - theSearchZTOB) && (theStripDet->surface().position().z() < 27.5 + theSearchZTOB) )
02410                 { 
02411                   fillAdcCounts(theMEBeam7TOBPosition3AdcCounts,
02412                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02413                 }
02414               else if ( (theStripDet->surface().position().z() < -10.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -10.0 - theSearchZTOB) )
02415                 { 
02416                   fillAdcCounts(theMEBeam7TOBPosition4AdcCounts,
02417                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02418                 }
02419               else if ( (theStripDet->surface().position().z() < -46.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -46.0 - theSearchZTOB) )
02420                 { 
02421                   fillAdcCounts(theMEBeam7TOBPosition5AdcCounts,
02422                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02423                 }
02424               else if ( (theStripDet->surface().position().z() < -80.0 + theSearchZTOB) && (theStripDet->surface().position().z() > -80.0 - theSearchZTOB) )
02425                 { 
02426                   fillAdcCounts(theMEBeam7TOBPosition6AdcCounts,
02427                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02428                 }
02429             }
02430           // **** end of Beam 7 in TOB ****
02431 
02432           // ***** TIB *****
02433           // **** Beam 0 in TIB ****
02434           else if ( (thePart == "TIB") && (theTIBLayer == 4) && (theBeam == 0) )
02435             {
02436               if ( (theStripDet->surface().position().z() > 60.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 60.5 + theSearchZTIB) )
02437                 { 
02438                   fillAdcCounts(theMEBeam0TIBPosition1AdcCounts,
02439                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02440                 }
02441               else if ( (theStripDet->surface().position().z() > 37.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 37.5 + theSearchZTIB) )
02442                 { 
02443                   fillAdcCounts(theMEBeam0TIBPosition2AdcCounts,
02444                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02445                 }
02446               else if ( (theStripDet->surface().position().z() > 15.0 - theSearchZTIB) && (theStripDet->surface().position().z() < 15.0 + theSearchZTIB) )
02447                 { 
02448                   fillAdcCounts(theMEBeam0TIBPosition3AdcCounts,
02449                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02450                 }
02451               else if ( (theStripDet->surface().position().z() < -7.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -7.5 - theSearchZTIB) )
02452                 { 
02453                   fillAdcCounts(theMEBeam0TIBPosition4AdcCounts,
02454                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02455                 }
02456               else if ( (theStripDet->surface().position().z() < -30.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -30.5 - theSearchZTIB) )
02457                 { 
02458                   fillAdcCounts(theMEBeam0TIBPosition5AdcCounts,
02459                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02460                 }
02461               else if ( (theStripDet->surface().position().z() < -53.0 + theSearchZTIB) && (theStripDet->surface().position().z() > -53.0 - theSearchZTIB) )
02462                 { 
02463                   fillAdcCounts(theMEBeam0TIBPosition6AdcCounts,
02464                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02465                 }
02466             }
02467           // **** end of Beam 0 in TIB ****
02468       
02469           // **** Beam 1 in TIB ****
02470           else if ( (thePart == "TIB") && (theTIBLayer == 4) && (theBeam == 1) ) 
02471             {
02472               if ( (theStripDet->surface().position().z() > 60.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 60.5 + theSearchZTIB) )
02473                 { 
02474                   fillAdcCounts(theMEBeam1TIBPosition1AdcCounts,
02475                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02476                 }
02477               else if ( (theStripDet->surface().position().z() > 37.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 37.5 + theSearchZTIB) )
02478                 { 
02479                   fillAdcCounts(theMEBeam1TIBPosition2AdcCounts,
02480                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02481                 }
02482               else if ( (theStripDet->surface().position().z() > 15.0 - theSearchZTIB) && (theStripDet->surface().position().z() < 15.0 + theSearchZTIB) )
02483                 { 
02484                   fillAdcCounts(theMEBeam1TIBPosition3AdcCounts,
02485                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02486                 }
02487               else if ( (theStripDet->surface().position().z() < -7.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -7.5 - theSearchZTIB) )
02488                 { 
02489                   fillAdcCounts(theMEBeam1TIBPosition4AdcCounts,
02490                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02491                 }
02492               else if ( (theStripDet->surface().position().z() < -30.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -30.5 - theSearchZTIB) )
02493                 { 
02494                   fillAdcCounts(theMEBeam1TIBPosition5AdcCounts,
02495                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02496                 }
02497               else if ( (theStripDet->surface().position().z() < -53.0 + theSearchZTIB) && (theStripDet->surface().position().z() > -53.0 - theSearchZTIB) )
02498                 { 
02499                   fillAdcCounts(theMEBeam1TIBPosition6AdcCounts,
02500                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02501                 }
02502             }
02503           // **** end of Beam 1 in TIB ****
02504       
02505           // **** Beam 2 in TIB ****
02506           else if ( (thePart == "TIB") && (theTIBLayer == 4) && (theBeam == 2) )
02507             {
02508               if ( (theStripDet->surface().position().z() > 60.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 60.5 + theSearchZTIB) )
02509                 { 
02510                   fillAdcCounts(theMEBeam2TIBPosition1AdcCounts,
02511                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02512                 }
02513               else if ( (theStripDet->surface().position().z() > 37.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 37.5 + theSearchZTIB) )
02514                 { 
02515                   fillAdcCounts(theMEBeam2TIBPosition2AdcCounts,
02516                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02517                 }
02518               else if ( (theStripDet->surface().position().z() > 15.0 - theSearchZTIB) && (theStripDet->surface().position().z() < 15.0 + theSearchZTIB) )
02519                 { 
02520                   fillAdcCounts(theMEBeam2TIBPosition3AdcCounts,
02521                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02522                 }
02523               else if ( (theStripDet->surface().position().z() < -7.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -7.5 - theSearchZTIB) )
02524                 { 
02525                   fillAdcCounts(theMEBeam2TIBPosition4AdcCounts,
02526                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02527                 }
02528               else if ( (theStripDet->surface().position().z() < -30.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -30.5 - theSearchZTIB) )
02529                 { 
02530                   fillAdcCounts(theMEBeam2TIBPosition5AdcCounts,
02531                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02532                 }
02533               else if ( (theStripDet->surface().position().z() < -53.0 + theSearchZTIB) && (theStripDet->surface().position().z() > -53.0 - theSearchZTIB) )
02534                 { 
02535                   fillAdcCounts(theMEBeam2TIBPosition6AdcCounts,
02536                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02537                 }
02538             }
02539           // **** end of Beam 2 in TIB ****
02540       
02541           // **** Beam 3 in TIB ****
02542           else if ( (thePart == "TIB") && (theTIBLayer == 4) && (theBeam == 3) )
02543             {
02544               if ( (theStripDet->surface().position().z() > 60.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 60.5 + theSearchZTIB) )
02545                 { 
02546                   fillAdcCounts(theMEBeam3TIBPosition1AdcCounts,
02547                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02548                 }
02549               else if ( (theStripDet->surface().position().z() > 37.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 37.5 + theSearchZTIB) )
02550                 { 
02551                   fillAdcCounts(theMEBeam3TIBPosition2AdcCounts,
02552                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02553                 }
02554               else if ( (theStripDet->surface().position().z() > 15.0 - theSearchZTIB) && (theStripDet->surface().position().z() < 15.0 + theSearchZTIB) )
02555                 { 
02556                   fillAdcCounts(theMEBeam3TIBPosition3AdcCounts,
02557                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02558                 }
02559               else if ( (theStripDet->surface().position().z() < -7.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -7.5 - theSearchZTIB) )
02560                 { 
02561                   fillAdcCounts(theMEBeam3TIBPosition4AdcCounts,
02562                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02563                 }
02564               else if ( (theStripDet->surface().position().z() < -30.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -30.5 - theSearchZTIB) )
02565                 { 
02566                   fillAdcCounts(theMEBeam3TIBPosition5AdcCounts,
02567                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02568                 }
02569               else if ( (theStripDet->surface().position().z() < -53.0 + theSearchZTIB) && (theStripDet->surface().position().z() > -53.0 - theSearchZTIB) )
02570                 { 
02571                   fillAdcCounts(theMEBeam3TIBPosition6AdcCounts,
02572                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02573                 }
02574             }
02575           // **** end of Beam 3 in TIB ****
02576 
02577           // **** Beam 4 in TIB ****
02578           else if ( (thePart == "TIB") && (theTIBLayer == 4) && (theBeam == 4) )
02579             {
02580               if ( (theStripDet->surface().position().z() > 60.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 60.5 + theSearchZTIB) )
02581                 { 
02582                   fillAdcCounts(theMEBeam4TIBPosition1AdcCounts,
02583                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02584                 }
02585               else if ( (theStripDet->surface().position().z() > 37.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 37.5 + theSearchZTIB) )
02586                 { 
02587                   fillAdcCounts(theMEBeam4TIBPosition2AdcCounts,
02588                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02589                 }
02590               else if ( (theStripDet->surface().position().z() > 15.0 - theSearchZTIB) && (theStripDet->surface().position().z() < 15.0 + theSearchZTIB) )
02591                 { 
02592                   fillAdcCounts(theMEBeam4TIBPosition3AdcCounts,
02593                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02594                 }
02595               else if ( (theStripDet->surface().position().z() < -7.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -7.5 - theSearchZTIB) )
02596                 { 
02597                   fillAdcCounts(theMEBeam4TIBPosition4AdcCounts,
02598                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02599                 }
02600               else if ( (theStripDet->surface().position().z() < -30.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -30.5 - theSearchZTIB) )
02601                 { 
02602                   fillAdcCounts(theMEBeam4TIBPosition5AdcCounts,
02603                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02604                 }
02605               else if ( (theStripDet->surface().position().z() < -53.0 + theSearchZTIB) && (theStripDet->surface().position().z() > -53.0 - theSearchZTIB) )
02606                 { 
02607                   fillAdcCounts(theMEBeam4TIBPosition6AdcCounts,
02608                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02609                 }
02610             }
02611           // **** end of Beam 4 in TIB ****
02612       
02613           // **** Beam 5 in TIB ****
02614           else if ( (thePart == "TIB") && (theTIBLayer == 4) && (theBeam == 5) )
02615             {
02616               if ( (theStripDet->surface().position().z() > 60.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 60.5 + theSearchZTIB) )
02617                 { 
02618                   fillAdcCounts(theMEBeam5TIBPosition1AdcCounts,
02619                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02620                 }
02621               else if ( (theStripDet->surface().position().z() > 37.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 37.5 + theSearchZTIB) )
02622                 { 
02623                   fillAdcCounts(theMEBeam5TIBPosition2AdcCounts,
02624                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02625                 }
02626               else if ( (theStripDet->surface().position().z() > 15.0 - theSearchZTIB) && (theStripDet->surface().position().z() < 15.0 + theSearchZTIB) )
02627                 { 
02628                   fillAdcCounts(theMEBeam5TIBPosition3AdcCounts,
02629                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02630                 }
02631               else if ( (theStripDet->surface().position().z() < -7.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -7.5 - theSearchZTIB) )
02632                 { 
02633                   fillAdcCounts(theMEBeam5TIBPosition4AdcCounts,
02634                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02635                 }
02636               else if ( (theStripDet->surface().position().z() < -30.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -30.5 - theSearchZTIB) )
02637                 { 
02638                   fillAdcCounts(theMEBeam5TIBPosition5AdcCounts,
02639                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02640                 }
02641               else if ( (theStripDet->surface().position().z() < -53.0 + theSearchZTIB) && (theStripDet->surface().position().z() > -53.0 - theSearchZTIB) )
02642                 { 
02643                   fillAdcCounts(theMEBeam5TIBPosition6AdcCounts,
02644                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02645                 }
02646             }
02647           // **** end of Beam 5 in TIB ****
02648 
02649           // **** Beam 6 in TIB ****
02650           else if ( (thePart == "TIB") && (theTIBLayer == 4) && (theBeam == 6) )
02651             {
02652               if ( (theStripDet->surface().position().z() > 60.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 60.5 + theSearchZTIB) )
02653                 { 
02654                   fillAdcCounts(theMEBeam6TIBPosition1AdcCounts,
02655                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02656                 }
02657               else if ( (theStripDet->surface().position().z() > 37.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 37.5 + theSearchZTIB) )
02658                 { 
02659                   fillAdcCounts(theMEBeam6TIBPosition2AdcCounts,
02660                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02661                 }
02662               else if ( (theStripDet->surface().position().z() > 15.0 - theSearchZTIB) && (theStripDet->surface().position().z() < 15.0 + theSearchZTIB) )
02663                 { 
02664                   fillAdcCounts(theMEBeam6TIBPosition3AdcCounts,
02665                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02666                 }
02667               else if ( (theStripDet->surface().position().z() < -7.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -7.5 - theSearchZTIB) )
02668                 { 
02669                   fillAdcCounts(theMEBeam6TIBPosition4AdcCounts,
02670                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02671                 }
02672               else if ( (theStripDet->surface().position().z() < -30.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -30.5 - theSearchZTIB) )
02673                 { 
02674                   fillAdcCounts(theMEBeam6TIBPosition5AdcCounts,
02675                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02676                 }
02677               else if ( (theStripDet->surface().position().z() < -53.0 + theSearchZTIB) && (theStripDet->surface().position().z() > -53.0 - theSearchZTIB) )
02678                 { 
02679                   fillAdcCounts(theMEBeam6TIBPosition6AdcCounts,
02680                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02681                 }
02682             }
02683           // **** end of Beam 6 in TIB ****
02684       
02685           // **** Beam 7 in TIB ****
02686           else if ( (thePart == "TIB") && (theTIBLayer == 4) && (theBeam == 7) )
02687             {
02688               if ( (theStripDet->surface().position().z() > 60.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 60.5 + theSearchZTIB) )
02689                 { 
02690                   fillAdcCounts(theMEBeam7TIBPosition1AdcCounts,
02691                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02692                 }
02693               else if ( (theStripDet->surface().position().z() > 37.5 - theSearchZTIB) && (theStripDet->surface().position().z() < 37.5 + theSearchZTIB) )
02694                 { 
02695                   fillAdcCounts(theMEBeam7TIBPosition2AdcCounts,
02696                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02697                 }
02698               else if ( (theStripDet->surface().position().z() > 15.0 - theSearchZTIB) && (theStripDet->surface().position().z() < 15.0 + theSearchZTIB) )
02699                 { 
02700                   fillAdcCounts(theMEBeam7TIBPosition3AdcCounts,
02701                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02702                 }
02703               else if ( (theStripDet->surface().position().z() < -7.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -7.5 - theSearchZTIB) )
02704                 { 
02705                   fillAdcCounts(theMEBeam7TIBPosition4AdcCounts,
02706                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02707                 }
02708               else if ( (theStripDet->surface().position().z() < -30.5 + theSearchZTIB) && (theStripDet->surface().position().z() > -30.5 - theSearchZTIB) )
02709                 { 
02710                   fillAdcCounts(theMEBeam7TIBPosition5AdcCounts,
02711                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02712                 }
02713               else if ( (theStripDet->surface().position().z() < -53.0 + theSearchZTIB) && (theStripDet->surface().position().z() > -53.0 - theSearchZTIB) )
02714                 { 
02715                   fillAdcCounts(theMEBeam7TIBPosition6AdcCounts,
02716                                 theDigiRangeIterator, theDigiRangeIteratorEnd);
02717                 }
02718             }
02719           // **** end of Beam 7 in TIB ****
02720         }
02721     }
02722 }