Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DmxMuonPlane.cxx

Go to the documentation of this file.
00001 
00002 //$Id: DmxMuonPlane.cxx,v 1.52 2007/11/11 07:36:22 rhatcher Exp $
00003 //
00004 //DmxMuonPlane.cxx
00005 //
00006 //DmxMuonPlane 
00007 //
00008 //Author:  B. Rebel 7/2000
00010 
00011 //#include "DeMux/DmxMuonPlane.h"
00012 #include "DeMux/DmxMuonPlane.h"
00013 #include "MessageService/MsgService.h"
00014 #include "Navigation/NavSet.h"
00015 #include "Conventions/PlaneView.h"
00016 #include "Conventions/StripEnd.h"
00017 #include "UgliGeometry/UgliStripHandle.h"
00018 #include "UgliGeometry/UgliScintPlnHandle.h"
00019 #include "Plex/PlexStripEndId.h"
00020 #include "Algorithm/AlgConfig.h"
00021 #include "CandDigit/CandDeMuxDigit.h"
00022 #include "CandDigit/CandDeMuxDigitHandle.h"
00023 #include "TMath.h"
00024 
00025 ClassImp(DmxMuonPlane)
00026 
00027 //______________________________________________________________________
00028 CVSID("$Id: DmxMuonPlane.cxx,v 1.52 2007/11/11 07:36:22 rhatcher Exp $");
00029 
00030 //----------------------------------------------------------------------
00031 DmxMuonPlane::DmxMuonPlane()
00032 {
00033 }
00034 
00035 //----------------------------------------------------------------------
00036 DmxMuonPlane::DmxMuonPlane(AlgConfig & /* acd */, 
00037                            CandDeMuxDigitHandleItr &cdhitr, 
00038                            Int_t planeNumber) :
00039   fCdhit(cdhitr),
00040   fCoG(0.),
00041   fInitialCoG(-1.),
00042   fNumberOfStrips(1), //its a muon plane - can only have one strip hit
00043   fPlaneCharge(0.),
00044   fPlaneNumber(planeNumber),
00045   fPlaneType(DmxPlaneTypes::kMuon),
00046   fPlaneView(PlaneView::kUnknown),
00047   fStripsSet(0),
00048   fIsValid(false),
00049   fIsStray(false),
00050   fIsGolden(false),
00051   fUgh(0)
00052 {
00053   fCdhit.Reset();
00054   
00055   //get the plane orientation
00056   fPlaneView = fCdhit.Ptr()->GetPlexSEIdAltL().GetPlaneView();
00057 
00058   //get the ugli geometry handle from a cand digit
00059   fUgh = new UgliGeomHandle(*fCdhit.Ptr()->GetVldContext());
00060 
00061   Int_t numDigits = 0;
00062   while( fCdhit.IsValid() ){
00063       if( fCdhit.Ptr()->GetDeMuxDigitFlagWord() == 0) ++numDigits;
00064       fCdhit.Next();
00065   }
00066   fCdhit.Reset();
00067   
00068   //MSG("Dmx", Msg::kDebug) << "Number of digits for plane " 
00069   //             << fPlaneNumber << " = " << numDigits << endl;
00070   
00071   if( numDigits == 2){
00072     //check to see that you have one from each side
00073     Int_t west = 0;
00074     Int_t east = 0;
00075     CandDeMuxDigitHandle *westDigit = fCdhit.Ptr();
00076     CandDeMuxDigitHandle *eastDigit = fCdhit.Ptr();
00077     
00078     while( fCdhit.IsValid() ){
00079       fCdhit.Ptr()->GetPlexSEIdAltLWritable().ClearWeights();
00080       fCdhit.Ptr()->GetPlexSEIdAltL().SetFirst();
00081       
00082       if( fCdhit.Ptr()->GetPlexSEIdAltL().GetEnd() == StripEnd::kEast 
00083           && fCdhit.Ptr()->GetDeMuxDigitFlagWord() == 0){
00084         east = 1; 
00085         eastDigit = fCdhit.Ptr();
00086       }
00087       else if( fCdhit.Ptr()->GetPlexSEIdAltL().GetEnd() == StripEnd::kWest 
00088                && fCdhit.Ptr()->GetDeMuxDigitFlagWord() == 0){
00089         west = 1; 
00090         westDigit = fCdhit.Ptr();
00091       }
00092       
00093       fCdhit.Next();
00094     }
00095     if(west + east == 2){
00096       //loop over the strip possibilities to see if they match up on each side
00097       Int_t westStrip = -1;
00098       Int_t eastStrip = -2;
00099       
00100       //reset the SEId alt lists
00101       westDigit->GetPlexSEIdAltL().SetFirst();
00102       
00103       while( westDigit->GetPlexSEIdAltL().IsValid() ){
00104         westStrip = westDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip();
00105         //MSG("Dmx", Msg::kDebug) << fPlaneNumber << " west strip = " 
00106         //             << westStrip << endl;
00107         
00108         eastDigit->GetPlexSEIdAltL().SetFirst();
00109       
00110         while( eastDigit->GetPlexSEIdAltL().IsValid() ){
00111           eastStrip = eastDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip();
00112           //MSG("Dmx", Msg::kDebug) << "\teast strip = " << eastStrip << endl;
00113           
00114           if(eastStrip == westStrip){
00115             westDigit->GetPlexSEIdAltLWritable().SetCurrentWeight(1.0);
00116             eastDigit->GetPlexSEIdAltLWritable().SetCurrentWeight(1.0);
00117 
00118             //set the veto flags to 0
00119             westDigit->GetPlexSEIdAltLWritable().SetDemuxVetoFlag(0);
00120             eastDigit->GetPlexSEIdAltLWritable().SetDemuxVetoFlag(0);
00121             
00122             //print the association
00123             // MSG("Dmx", Msg::kDebug) << "west strip = " 
00124 //                                  << westDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip() 
00125 //                                  << "\tsignal = " << westDigit->GetCharge() << endl;
00126 //          MSG("Dmx", Msg::kDebug) << "east strip = " 
00127 //                                 << eastDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip() 
00128 //                                 << "\tsignal = " << eastDigit->GetCharge() << endl;
00129             
00130             //set the center of gravity
00131             fCoG = westDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip();
00132             fInitialCoG = fCoG;
00133             
00134             //set the true muon plane flag but be careful - there could be 
00135             //multiple solutions for this plane so if the is valid has been
00136             //set to true before, then you have multiple solutions and should 
00137             //set it to false
00138             if(!fIsValid){
00139               fIsValid = true;
00140               fIsGolden = true;
00141             }
00142             else{
00143               fIsValid = false;
00144               fIsGolden = false;
00145             }
00146             //set the strips set flag
00147             fStripsSet = 1;
00148           }
00149           eastDigit->GetPlexSEIdAltL().Next();
00150         }
00151 
00152         westDigit->GetPlexSEIdAltL().Next();
00153       }
00154     }
00155   }
00156  
00157   MSG("DmxMuonPlane", Msg::kDebug) << "plane = " << fPlaneNumber 
00158                                                                   << " initial muon cog = " << fInitialCoG << "/" << fCoG << endl;
00159   
00160   //if this is a golden plane, set any digits that might not be set because
00161   //of cross talk or low signal
00162   if(fIsGolden) SetStrips();
00163 
00164   //get the charge for the plane
00165   fCdhit.ResetFirst();
00166   while(fCdhit.IsValid()){
00167     //if(fCdhit.GetSet()->GetMasks().GetMask(fCdhit.Ptr())){fPlaneCharge += fCdhit.Ptr()->GetCharge();}
00168     if( fCdhit.Ptr()->GetDeMuxDigitFlagWord() == 0) 
00169       fPlaneCharge += fCdhit.Ptr()->GetCharge();
00170     fCdhit.Next();
00171   }
00172   fCdhit.Reset();
00173   return;
00174 }
00175 
00176 //----------------------------------------------------------------------
00177 DmxMuonPlane::~DmxMuonPlane()
00178 {
00179   delete fUgh;
00180   //  MSG("Dmx", Msg::kDebug) << "deleting Muon Plane for plane " 
00181   //              << fPlaneNumber << endl;  
00182 }
00183 
00184 //----------------------------------------------------------------------
00185 Int_t DmxMuonPlane::GetNumberOfStrips() const
00186 {
00187         return fNumberOfStrips;
00188 }
00189 //----------------------------------------------------------------------
00190 Float_t DmxMuonPlane::GetCoG() const
00191 {
00192   //get the strip end id for the center of gravity for this hypothesis
00193   PlexStripEndId seid(Detector::kFar,fPlaneNumber,TMath::Nint(fCoG));
00194   UgliStripHandle ush = fUgh->GetStripHandle(seid);
00195 
00196   return ush.GetTPos();
00197   //return fCoG;
00198 }
00199 
00200 //----------------------------------------------------------------------
00201 Float_t DmxMuonPlane::GetInitialCoG() const
00202 {
00203         
00204         MSG("DmxMuonPlane", Msg::kDebug) << "plane = " << fPlaneNumber 
00205                                                                         << " initial muon cog = " << fInitialCoG << "/" << fCoG << endl;
00206                 
00207         //get the strip end id for the center of gravity for this hypothesis
00208         PlexStripEndId seid(Detector::kFar,fPlaneNumber,TMath::Nint(fInitialCoG));
00209         UgliStripHandle ush = fUgh->GetStripHandle(seid);
00210 
00211         return ush.GetTPos();
00212         //return fCoG;
00213 }
00214 
00215 //----------------------------------------------------------------------
00216 Int_t DmxMuonPlane::GetHypothesisLowerBound(Float_t tPos) const
00217 {
00218   //change the transverse position for the fit into a strip number
00219   PlexStripEndId seid(Detector::kFar, fPlaneNumber, 1);
00220   UgliScintPlnHandle usph = fUgh->GetScintPlnHandle(seid);
00221   UgliStripHandle ush = usph.GetClosestStrip(tPos);
00222   Float_t fitCoG = 1.*ush.GetSEId().GetStrip();
00223   
00224   Int_t hypLowerBound = 0;
00225   if(fitCoG >= 11.5 && fitCoG <= 179.5){hypLowerBound = TMath::Nint(fitCoG-11.5);}
00226   else if(fitCoG < 11.5){hypLowerBound = 0;}
00227   else if(fitCoG > 179.5){hypLowerBound = 168;}
00228   
00229   return hypLowerBound;
00230 }
00231 
00232 //----------------------------------------------------------------------
00233 Float_t DmxMuonPlane::GetStripCoG() const
00234 {
00235   return fCoG;
00236 }
00237 
00238 //----------------------------------------------------------------------
00239 Float_t DmxMuonPlane::GetInitialStripCoG() const
00240 {
00241   return fInitialCoG;
00242 }
00243 
00244 //----------------------------------------------------------------------
00245 Float_t DmxMuonPlane::GetPlaneCharge() const
00246 {
00247   return fPlaneCharge;
00248 }
00249 
00250 //----------------------------------------------------------------------
00251 Int_t DmxMuonPlane::GetPlaneNumber() const  
00252 {
00253   return fPlaneNumber;
00254 }
00255 
00256 //----------------------------------------------------------------------
00257 Float_t DmxMuonPlane::GetZPosition() const  
00258 {
00259   PlexStripEndId seid(Detector::kFar, fPlaneNumber, 1);
00260   UgliScintPlnHandle usph = fUgh->GetScintPlnHandle(seid);
00261   return usph.GetZ0();
00262   //return 1.*fPlaneNumber;
00263 }
00264 
00265 //----------------------------------------------------------------------
00266 DmxPlaneTypes::PlaneType_t DmxMuonPlane::GetPlaneType() const
00267 {
00268   return fPlaneType;
00269 }
00270 
00271 //----------------------------------------------------------------------
00272 PlaneView::PlaneView_t DmxMuonPlane::GetPlaneView() const 
00273 {
00274   return fPlaneView;
00275 }
00276 
00277 //----------------------------------------------------------------------
00278 Bool_t DmxMuonPlane::GetStripsSetFlag() const
00279 {
00280   return fStripsSet>0;
00281 }
00282 
00283 //----------------------------------------------------------------------
00284 Bool_t DmxMuonPlane::IsValid() const
00285 {
00286   return fIsValid;
00287 }
00288 
00289 //----------------------------------------------------------------------
00290 Bool_t DmxMuonPlane::IsStray() const
00291 {
00292   return fIsStray;
00293 }
00294 
00295 //----------------------------------------------------------------------
00296 Bool_t DmxMuonPlane::IsGolden() const
00297 {
00298   return fIsGolden;
00299 }
00300 
00301 //-----------------------------------------------------------------------
00302 void DmxMuonPlane::PrintRecon()
00303 {
00304   fCdhit.Reset();
00305   MSG("Dmx", Msg::kInfo) << "Plane = " << fPlaneNumber 
00306                          << "\tIsValid = " << (Int_t)fIsValid << endl;
00307   while( fCdhit.IsValid() ){
00308     CandDeMuxDigitHandle *currentDigit = fCdhit.Ptr();
00309     
00310     if(currentDigit->GetPlexSEIdAltL().GetEnd() == StripEnd::kWest){
00311       MSG("Dmx", Msg::kInfo) << "\tWest\t" ;
00312     }
00313     else if(currentDigit->GetPlexSEIdAltL().GetEnd() == StripEnd::kEast){
00314       MSG("Dmx", Msg::kInfo) << "\tEast\t" ;
00315     }
00316     MSG("Dmx", Msg::kInfo) << currentDigit->GetPlexSEIdAltL().GetBestSEId().GetStrip() << "\t";
00317     MSG("Dmx", Msg::kInfo) << currentDigit->GetCharge() << endl;
00318     
00319     fCdhit.Next();
00320   }
00321   return;
00322 }
00323 //----------------------------------------------------------------------
00324 void DmxMuonPlane::SetStrips()
00325 {
00326   Float_t fitCoG = fInitialCoG;
00327   Int_t hypLower = 0;
00328   if(fitCoG >= 11.5 && fitCoG <= 179.5){hypLower = TMath::Nint(fitCoG-11.5);}
00329   else if(fitCoG < 11.5){hypLower = 0;}
00330   else if(fitCoG > 179.5){hypLower = 168;}
00331   
00332   fStripsSet = 1;
00333   fCdhit.Reset();
00334   
00335   Double_t cogNum = 0.;
00336   Double_t cogDenom = 0.;
00337   
00338   while( fCdhit.IsValid() ){
00339       
00340     //get the next CandDigitHandle object
00341     CandDeMuxDigitHandle *currentDigit = fCdhit.Ptr();
00342     
00343     //clear all weights for the digit
00344     currentDigit->GetPlexSEIdAltLWritable().ClearWeights();
00345     
00346     //set the alternatives list to the first one
00347     currentDigit->GetPlexSEIdAltL().SetFirst();
00348 
00349     //set veto flag to nonzero, if there is a SEId in this hypothesis set it to
00350     //0
00351     currentDigit->GetPlexSEIdAltLWritable().SetDemuxVetoFlag(1);
00352     
00353     //loop through the Strip End Alternative list and see which one is
00354     //in the current hypothesis
00355     while( currentDigit->GetPlexSEIdAltL().IsValid() ){
00356       
00357       if( currentDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip() 
00358           >= hypLower && currentDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip() 
00359           <= (hypLower+23)){
00360         
00361         //set the Strip weight to 1 if it is the first choice above the 
00362         //lowerbound and set veto flag to 0
00363         currentDigit->GetPlexSEIdAltLWritable().SetCurrentWeight(1.0);
00364         currentDigit->GetPlexSEIdAltLWritable().SetDemuxVetoFlag(0);
00365 
00366         //print the association
00367         //MSG("Dmx", Msg::kVerbose) << "strip = " 
00368         //                << currentDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip() 
00369         //                << "\tside = " 
00370         //                << (Int_t)currentDigit->GetPlexSEIdAltL().GetCurrentSEId().GetEnd() 
00371         //                << "\tsignal = " << currentDigit->GetCharge() << endl;
00372         
00373         //set the cog to this strip, if it isnt a cross talk digit
00374         if(currentDigit->GetDeMuxDigitFlagWord() == 0){
00375           //if(fCdhit.GetSet()->GetMasks().GetMask(fCdhit.Ptr())){
00376           cogNum += currentDigit->GetCharge()*currentDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip();
00377           cogDenom += currentDigit->GetCharge();
00378         }
00379                 
00380         //you found the Strip End Id so quit looking
00381         break;
00382       }
00383       //if that Strip End Id wasnt in the hypothesis go to the next one
00384       currentDigit->GetPlexSEIdAltL().Next();
00385     }
00386 
00387     fCdhit.Next();
00388   }
00389    
00390   if(cogDenom >0.) fCoG = cogNum/cogDenom;
00391 
00392   return;
00393 }
00394 
00395 //----------------------------------------------------------------------
00396 void DmxMuonPlane::SetStrips(Float_t tPos)
00397 {
00398         //change the transverse position for the fit into a strip number
00399         PlexStripEndId seid(Detector::kFar, fPlaneNumber, 1);
00400         UgliScintPlnHandle usph = fUgh->GetScintPlnHandle(seid);
00401         UgliStripHandle ush = usph.GetClosestStrip(tPos);
00402         Float_t fitCoG = 1.*ush.GetSEId().GetStrip();
00403         //Float_t fitCoG = tPos;
00404   
00405         Int_t hypLower = 0;
00406         if(fitCoG >= 11.5 && fitCoG <= 179.5) hypLower = TMath::Nint(fitCoG-11.5);
00407         else if(fitCoG < 11.5) hypLower = 0;
00408         else if(fitCoG > 179.5) hypLower = 168;
00409   
00410         MSG("DmxMuonPlane", Msg::kDebug) << "\tfit in strip vs plane space " << fPlaneNumber 
00411                                                                          << "\t" << fitCoG << " " << hypLower << endl; 
00412         MSG("DmxMuonPlane", Msg::kDebug) << "\tfit in tpos vs z space " << GetZPosition() 
00413                                                                          << "\t" << tPos << endl; 
00414   
00415         fStripsSet = 1;
00416         fCdhit.Reset();
00417   
00418         Double_t cogNum = 0.;
00419         Double_t cogDenom = 0.;
00420   
00421         while( fCdhit.IsValid() ){
00422       
00423                 //get the next CandDigitHandle object
00424                 CandDeMuxDigitHandle *currentDigit = fCdhit.Ptr();
00425     
00426                 //clear all weights for the digit
00427                 currentDigit->GetPlexSEIdAltLWritable().ClearWeights();
00428     
00429                 //set the alternatives list to the first one
00430                 currentDigit->GetPlexSEIdAltLWritable().SetFirst();
00431 
00432                 //set veto flag to nonzero, if there is a SEId in this hypothesis set it to
00433                 //0
00434                 currentDigit->GetPlexSEIdAltLWritable().SetDemuxVetoFlag(1);
00435     
00436                 //loop through the Strip End Alternative list and see which one is
00437                 //in the current hypothesis
00438                 while( currentDigit->GetPlexSEIdAltLWritable().IsValid() ){
00439                 
00440                         MSG("DmxMuonPlane", Msg::kDebug) << "plane = " 
00441                                                                                          << currentDigit->GetPlexSEIdAltLWritable().GetPlane()
00442                                                                                          << " strip alt = " 
00443                                                                                          << currentDigit->GetPlexSEIdAltLWritable().GetCurrentSEId().GetStrip() 
00444                                                                                          << endl;
00445       
00446                         if( currentDigit->GetPlexSEIdAltLWritable().GetCurrentSEId().GetStrip() 
00447                                 >= hypLower && currentDigit->GetPlexSEIdAltLWritable().GetCurrentSEId().GetStrip() 
00448                                 <= (hypLower+23)){
00449         
00450                                 //set the Strip weight to 1 if it is the first choice above the 
00451                                 //lowerbound and set veto flag to 0
00452                                 currentDigit->GetPlexSEIdAltLWritable().SetCurrentWeight(1.0);
00453                                 currentDigit->GetPlexSEIdAltLWritable().SetDemuxVetoFlag(0);
00454                                 
00455                                 MSG("DmxMuonPlane", Msg::kDebug) << "strip = " 
00456                                                                                                  << currentDigit->GetPlexSEIdAltLWritable().GetCurrentSEId().GetStrip() 
00457                                                                                                  << " " << currentDigit->GetPlexSEIdAltLWritable().GetCurrentWeight() 
00458                                                                                                  << endl;
00459                                 
00460                                 //print the association
00461                                 //MSG("Dmx", Msg::kVerbose) << "strip = " 
00462                                 //                << currentDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip() 
00463                                 //                << "\tside = " 
00464                                 //                << (Int_t)currentDigit->GetPlexSEIdAltL().GetCurrentSEId().GetEnd() 
00465                                 //                << "\tsignal = " << currentDigit->GetCharge() << endl;
00466         
00467                                 //set the cog to this strip, if it isnt a cross talk digit
00468                                 if(currentDigit->GetDeMuxDigitFlagWord() == 0){
00469                                         cogNum += currentDigit->GetCharge()*currentDigit->GetPlexSEIdAltL().GetCurrentSEId().GetStrip();
00470                                         cogDenom += currentDigit->GetCharge();
00471                                 }
00472                 
00473                                 //you found the Strip End Id so quit looking
00474                                 break;
00475                         }
00476                         //if that Strip End Id wasnt in the hypothesis go to the next one
00477                         currentDigit->GetPlexSEIdAltL().Next();
00478                 }
00479 
00480                 fCdhit.Next();
00481         }
00482    
00483         if(cogDenom >0.) fCoG = cogNum/cogDenom;
00484 
00485         return;
00486 }
00487 
00488 //----------------------------------------------------------------------
00489 void DmxMuonPlane::SetStray(bool stray)
00490 {
00491   fIsStray = stray;
00492   return;
00493 }
00494 
00495 //----------------------------------------------------------------------
00496 void DmxMuonPlane::SetGolden(bool golden)
00497 {
00498   fIsGolden = golden;
00499   return;
00500 }
00501 
00502 //------------------------------------------------------------------------
00503 Float_t DmxMuonPlane::GetTimingOffset()
00504 {
00505 //make arrays to hold the clear fiber + wls pigtail lengths for each digit
00506   Float_t westFiber[192];
00507   Float_t eastFiber[192];
00508   Float_t eastTime[192];
00509   Float_t westTime[192];
00510 
00511   //reset the arrays
00512   for(Int_t i = 0; i<192; i++){
00513     westFiber[i] = -1.;
00514     eastFiber[i] = -1.;
00515     eastTime[i] = -1.;
00516     westTime[i] = -1.;
00517   }
00518     
00519   fCdhit.Reset();
00520 
00521   while(fCdhit.IsValid()){
00522     
00523     CandDeMuxDigitHandle *digit = fCdhit.Ptr();
00524     
00525     if(digit->GetPlexSEIdAltL().GetDemuxVetoFlag() == 0 && digit->GetDeMuxDigitFlagWord() == 0){
00526       
00527       Int_t strip = digit->GetPlexSEIdAltL().GetBestSEId().GetStrip();
00528       
00529       //get the side for this digit and fill the array
00530       UgliStripHandle ush = fUgh->GetStripHandle(digit->GetPlexSEIdAltL().GetBestSEId());
00531       
00532       if( digit->GetPlexSEIdAltL().GetEnd() == StripEnd::kEast ){
00533         eastFiber[strip] = ush.ClearFiber(StripEnd::kEast) + ush.WlsPigtail(StripEnd::kEast);
00534         eastTime[strip] = 1e9*digit->GetTime(CalTimeType::kT0) - 2093./(102.+TMath::Power(1.*digit->GetCharge(),1.2));
00535       }
00536       else if( digit->GetPlexSEIdAltL().GetEnd() == StripEnd::kWest ){
00537         westFiber[strip] = ush.ClearFiber(StripEnd::kWest) + ush.WlsPigtail(StripEnd::kWest);
00538         westTime[strip] = 1e9*digit->GetTime(CalTimeType::kT0) - 2093./(102.+TMath::Power(1.*digit->GetCharge(),1.2));
00539       }
00540       
00541     }
00542     fCdhit.Next();
00543   }
00544   
00545   //find the average offset from center for this plane based on timing and fill the array
00546   Float_t avTimeNum = 0.;
00547   Float_t avTimeDenom = 0.;
00548   Float_t offset = -10.;
00549   for(Int_t k=0; k<192; k++){
00550     
00551     //if the strip has doubled sided readout, then use it
00552     if(westTime[k] != -1.&& eastTime[k] != -1.){
00553       offset = (0.0825*(eastTime[k] - westTime[k]) + (westFiber[k]-eastFiber[k])/2.);
00554       //MSG("DmxTim", Msg::kInfo) << fPlaneNumber << " offset = " << offset << endl;
00555       avTimeNum += offset;
00556       avTimeDenom += 1.;
00557     }
00558   }
00559         
00560   if(avTimeDenom>0) offset = avTimeNum/avTimeDenom;
00561 
00562   //MSG("DmxTim", Msg::kDebug) << fPlaneNumber << " av offset = " << offset << endl;
00563   
00564   //clear the digit slice
00565   fCdhit.Reset();
00566 
00567   return offset;
00568 } 
00569 
00570 
00571 
00572 

Generated on Mon Feb 15 11:06:38 2010 for loon by  doxygen 1.3.9.1