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

IslMatrix Class Reference

#include <IslMatrix.h>

List of all members.

Public Member Functions

 IslMatrix ()
virtual ~IslMatrix ()
TH2F GetUZ () const
TH2F GetVZ () const
void Fill (const MomNavigator *mom, Float_t ChargeThreshold)

Private Attributes

TH2F fUZ
TH2F fVZ


Constructor & Destructor Documentation

IslMatrix::IslMatrix  ) 
 

Definition at line 26 of file IslMatrix.cxx.

00027     : fUZ(TH2F())
00028     , fVZ(TH2F())
00029 {
00030 }

IslMatrix::~IslMatrix  )  [virtual]
 

Definition at line 32 of file IslMatrix.cxx.

00033 {
00034 }


Member Function Documentation

void IslMatrix::Fill const MomNavigator mom,
Float_t  ChargeThreshold
 

Definition at line 36 of file IslMatrix.cxx.

References fUZ, fVZ, CandDigitHandle::GetCharge(), CandHandle::GetDaughterIterator(), PlexSEIdAltL::GetEnd(), PlexSEIdAltL::GetPlane(), PlexSEIdAltL::GetPlaneView(), CandDigitHandle::GetPlexSEIdAltL(), PlaneView::PlaneView_t, and StripEnd::StripEnd_t.

Referenced by IslElectronModule::Reco().

00037 {
00038     fUZ.Reset();
00039     fVZ.Reset();
00040 
00041     Float_t U0Charge = 0.;
00042     Float_t V0Charge = 0.;
00043     Int_t U0PlaneNo = -1;
00044     Int_t V0PlaneNo = -1;
00045     Int_t peak_plane_num=-1;
00046     PlaneView::PlaneView_t peak_plane_view = PlaneView::kUnknown;
00047     Int_t U0StripNo=-1;
00048     Int_t V0StripNo=-1;
00049 
00050     CandDigitListHandle *cdlh =
00051         DataUtil::GetCandidate<CandDigitListHandle>(mom,
00052                                                     "CandDigitListHandle", 
00053                                                     "canddigitlist");
00054     if (!cdlh) {
00055         cerr << "No CandDigitList" << endl;
00056         return;
00057     }
00058 
00059     // This block finds the stip with the most charge.  It deals with
00060     // demuxing by assuming the two digits on opposite ends with the
00061     // most total charge are from the same strip.
00062 
00063     CandDigitHandleItr cdhItr1(cdlh->GetDaughterIterator());
00064     for (; cdhItr1.IsValid(); cdhItr1.Next()) {
00065         CandDigitHandle channel1 = **cdhItr1;
00066 
00067         Float_t charge1 = channel1.GetCharge()/100.;
00068         StripEnd::StripEnd_t end1 = channel1.GetPlexSEIdAltL().GetEnd();
00069 
00070         if (!(charge1 > ChargeThreshold && end1 == StripEnd::kNegative)) 
00071             continue;
00072 
00073         Int_t PlaneNo1 = channel1.GetPlexSEIdAltL().GetPlane();
00074         PlaneView::PlaneView_t plane_view = channel1.GetPlexSEIdAltL().GetPlaneView();
00075         
00076         CandDigitHandleItr cdhItr2(cdlh->GetDaughterIterator());
00077         for (; cdhItr2.IsValid(); cdhItr2.Next()) {
00078             CandDigitHandle channel2 = **cdhItr2;
00079             
00080             Float_t charge2 = channel2.GetCharge()/100.;
00081             StripEnd::StripEnd_t end2 = channel2.GetPlexSEIdAltL().GetEnd();
00082             Int_t PlaneNo2 = channel2.GetPlexSEIdAltL().GetPlane();
00083             
00084             if (charge2 <= ChargeThreshold || end1 == end2 || PlaneNo1 != PlaneNo2)
00085                 continue;
00086                 
00087             if (!((plane_view == PlaneView::kU && charge1+charge2 > U0Charge) ||
00088                   (plane_view == PlaneView::kV && charge1+charge2 > V0Charge)))
00089                 continue;
00090 
00091             PlexSEIdAltL seidl1 = channel1.GetPlexSEIdAltL();
00092             int siz1 = seidl1.size();
00093             for (int ind1 = 0; ind1 < siz1; ++ind1) {
00094                 Int_t strip_num_1 = seidl1[ind1].GetSEId().GetStrip();
00095                 
00096                 PlexSEIdAltL seidl2 = channel2.GetPlexSEIdAltL();
00097                 int siz2 = seidl2.size();
00098                 for (int ind2 = 0; ind2 < siz2; ++ind2) {
00099                     if (strip_num_1 != seidl2[ind2].GetSEId().GetStrip()) continue;
00100 
00101                     switch (plane_view) {
00102                     case PlaneView::kU:
00103                         U0Charge  = charge1+charge2;
00104                         U0StripNo = strip_num_1;
00105                         U0PlaneNo = PlaneNo1;
00106                         break;
00107                     case PlaneView::kV:
00108                         V0Charge  = charge1+charge2;
00109                         V0StripNo = strip_num_1;
00110                         V0PlaneNo = PlaneNo1;
00111                         break;
00112                     default:
00113                         break;
00114                     }
00115                     
00116                 }
00117             }
00118         }
00119     } // end loop over daughter digits
00120     
00121     if (U0StripNo == -1 || V0PlaneNo == -1) {
00122         cerr << "==> Not enough information to demux." << endl;
00123         return;
00124     }
00125 
00126     if (U0Charge>V0Charge) {
00127         peak_plane_num  = U0PlaneNo;
00128         peak_plane_view = PlaneView::kU;
00129     }
00130     else {
00131         peak_plane_num  = V0PlaneNo;
00132         peak_plane_view = PlaneView::kV;
00133     }
00134         
00135     //  cout << "peak_plane_num:" << peak_plane_num << " U0StripNo:" << U0StripNo << " V0StripNo:" << V0StripNo << " ... ";
00136         
00137     const Int_t NStripsToSides = 10;
00138     const Int_t NPlanesUpStream = 9;
00139     const Int_t NPlanesDownStream = 20;
00140         
00141     if (peak_plane_view == PlaneView::kU) {
00142         fUZ.SetBins((NPlanesUpStream+NPlanesDownStream+1)/2,
00143                     peak_plane_num-NPlanesUpStream,
00144                     peak_plane_num+NPlanesDownStream+1.,
00145                     2*NStripsToSides+1,
00146                     U0StripNo-NStripsToSides-0.5,
00147                     U0StripNo+NStripsToSides+0.5);
00148 
00149         fVZ.SetBins((NPlanesUpStream+NPlanesDownStream+1)/2,
00150                     peak_plane_num-NPlanesUpStream-1.,
00151                     peak_plane_num+NPlanesDownStream,
00152                     2*NStripsToSides+1,
00153                     V0StripNo-NStripsToSides-0.5,
00154                     V0StripNo+NStripsToSides+0.5);
00155     }
00156     else {
00157         fUZ.SetBins((NPlanesUpStream+NPlanesDownStream+1)/2,
00158                     peak_plane_num-NPlanesUpStream-1.,
00159                     peak_plane_num+NPlanesDownStream,
00160                     2*NStripsToSides+1,
00161                     U0StripNo-NStripsToSides-0.5,
00162                     U0StripNo+NStripsToSides+0.5);
00163 
00164         fVZ.SetBins((NPlanesUpStream+NPlanesDownStream+1)/2,
00165                     peak_plane_num-NPlanesUpStream,
00166                     peak_plane_num+NPlanesDownStream+1.,
00167                     2*NStripsToSides+1,
00168                     V0StripNo-NStripsToSides-0.5,
00169                     V0StripNo+NStripsToSides+0.5);
00170     }
00171     
00172     CandDigitHandleItr cdhItr3(cdlh->GetDaughterIterator());
00173     for (; cdhItr3.IsValid(); cdhItr3.Next()) {
00174         CandDigitHandle cdh = **cdhItr3;
00175 
00176         Float_t Charge = cdh.GetCharge()/100.;
00177         if (Charge <= ChargeThreshold) 
00178             continue;
00179 
00180         Int_t PlaneNo = cdh.GetPlexSEIdAltL().GetPlane();
00181         PlaneView::PlaneView_t plane_view = cdh.GetPlexSEIdAltL().GetPlaneView();
00182 
00183         // loop over possible strip ends
00184         Int_t BestStripNo = -1;
00185         if (PlaneNo > peak_plane_num + NPlanesDownStream ||
00186             PlaneNo < peak_plane_num - NPlanesUpStream)
00187             continue;
00188 
00189         PlexSEIdAltL seidl = cdh.GetPlexSEIdAltL();
00190         int siz = seidl.size();
00191         for (int ind = 0; ind < siz; ++ind) {
00192             Int_t TestStripNo = seidl[ind].GetSEId().GetStrip();
00193                 
00194 
00195             if (plane_view == PlaneView::kU &&
00196                 TestStripNo <= U0StripNo + NStripsToSides &&
00197                 TestStripNo >= U0StripNo - NStripsToSides)
00198                 BestStripNo=TestStripNo;
00199             if (plane_view == PlaneView::kV &&
00200                 TestStripNo <= V0StripNo + NStripsToSides &&
00201                 TestStripNo >= V0StripNo - NStripsToSides)
00202                 BestStripNo=TestStripNo;
00203 
00204         } // loop over candidate strips
00205         
00206         if (BestStripNo == -1) continue;
00207 
00208         if (plane_view == PlaneView::kU)
00209             fUZ.Fill((Float_t)PlaneNo,(Float_t)BestStripNo,Charge);
00210         if (plane_view == PlaneView::kV)
00211             fVZ.Fill((Float_t)PlaneNo,(Float_t)BestStripNo,Charge);
00212         
00213     } // loop over channels
00214     
00215     return;
00216 }

TH2F IslMatrix::GetUZ  )  const [inline]
 

Definition at line 21 of file IslMatrix.h.

References fUZ.

Referenced by IslElectronModule::Display(), and IslCluster::FindIslands().

00021 {return fUZ;}

TH2F IslMatrix::GetVZ  )  const [inline]
 

Definition at line 22 of file IslMatrix.h.

References fVZ.

Referenced by IslElectronModule::Display(), and IslCluster::FindIslands().

00022 {return fVZ;}


Member Data Documentation

TH2F IslMatrix::fUZ [private]
 

Definition at line 27 of file IslMatrix.h.

Referenced by Fill(), and GetUZ().

TH2F IslMatrix::fVZ [private]
 

Definition at line 28 of file IslMatrix.h.

Referenced by Fill(), and GetVZ().


The documentation for this class was generated from the following files:
Generated on Wed Jul 25 03:12:54 2007 for loon by doxygen 1.3.5