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

CellListKG Class Reference

#include <CellListKG.h>

List of all members.

Public Member Functions

 CellListKG ()
virtual ~CellListKG ()
void GetCells (std::vector< CellKG > &allcell) const
Bool_t IsNeighbour (Int_t index1, Int_t index2, Int_t plnDistInp, Int_t stpDistInp)
void CreateCells (AlgConfig &ac, StripListKG &v)
UInt_t GetNCells () const
Int_t GetCellIndex (UInt_t index) const
Int_t GetCellPlane (UInt_t index) const
Float_t GetCellU (UInt_t index) const
Float_t GetCellV (UInt_t index) const
Float_t GetCellZ (UInt_t index) const
Int_t GetCellView (UInt_t index) const
UInt_t GetCellElem1 (UInt_t index) const
UInt_t GetCellElem2 (UInt_t index) const

Private Attributes

std::vector< CellKGallcells


Constructor & Destructor Documentation

CellListKG::CellListKG  ) 
 

Definition at line 24 of file CellListKG.cxx.

References MSG.

00024                       {
00025 //
00026 //  Purpose:  Default constructor
00027 //
00028   MSG("Cluster3D", Msg::kDebug)
00029     << "Default constructor " << endl;
00030 }

virtual CellListKG::~CellListKG  )  [inline, virtual]
 

Definition at line 35 of file CellListKG.h.

00035 {}; 


Member Function Documentation

void CellListKG::CreateCells AlgConfig ac,
StripListKG v
 

Definition at line 73 of file CellListKG.cxx.

References abs(), allcells, CellKG::Create(), PlaneKG::Create(), Registry::GetInt(), StripListKG::GetNStrips(), StripListKG::GetStripPlane(), StripListKG::GetStripStrip(), StripListKG::GetStripXTalk(), StripListKG::GetTimePos(), MSG, StripListKG::NbStpInPlane(), and StripListKG::OppViewNeighbours().

Referenced by AlgCluster3DList::RunAlg().

00073                                                             {
00074 //
00075 //  Purpose:  Create cells
00076 //
00077 //  Arguments: 
00078 //              
00079 //  Return:  n/a
00080 //
00081 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00082 //
00083 //
00084 //  Program Notes:-
00085 //  =============
00086 //
00087 
00088 
00089   Int_t cellnb=0;
00090 
00091   Int_t nstrips=all1.GetNStrips();
00092 
00093   vector<PlaneKG> allpl;
00094 
00095   allpl.clear();  
00096 
00097   for(Int_t i=0;i<nstrips;++i){
00098 
00099     Int_t ithPlaneNb=all1.GetStripPlane(i);
00100     
00101     PlaneKG p;
00102 
00103     if(i==0){
00104       p.Create(all1,ithPlaneNb);
00105       allpl.push_back(p);
00106     }
00107     else{
00108        Int_t i1thPlaneNb=all1.GetStripPlane(i-1);
00109        if(ithPlaneNb != i1thPlaneNb){
00110          p.Create(all1,ithPlaneNb);
00111          allpl.push_back(p);
00112        }    
00113     }
00114   }
00115 
00116   const Int_t crosstalk = ac.GetInt("xTalk");
00117   const Int_t cdist = ac.GetInt("maxDist");
00118   const Int_t timing = ac.GetInt("timeInfo");
00119 
00120   Int_t fNbStpInNextPl=0;
00121   Int_t fNbStpInThisPl=0;
00122 
00123   for(Int_t i=0;i<nstrips;++i){
00124 
00125     Int_t ithPlaneNb=all1.GetStripPlane(i);
00126     Int_t ithPlaneXTalk=all1.GetStripXTalk(i);
00127     Int_t ithStripNb=all1.GetStripStrip(i);
00128 
00129     MSG("Cluster3D", Msg::kDebug) << "i= " << i 
00130         << " ithPlaneNb  = " << ithPlaneNb
00131         << " ithStripNb  = " << ithStripNb
00132         << " ithPlaneXTalk  = " << ithPlaneXTalk << endl;
00133 
00134     fNbStpInThisPl=all1.NbStpInPlane(ithPlaneNb,allpl);
00135 
00136     if(crosstalk && ithPlaneXTalk){
00137       continue;
00138     }
00139  
00140     Float_t t1t2,timPos,hBox;
00141     Float_t t1t2f,timPosf,hBoxf;
00142 
00143     Int_t counter=0;
00144 
00145     for(Int_t j=i+1;j<nstrips;++j){
00146 
00147     Int_t jthPlaneNb=all1.GetStripPlane(j);
00148     Int_t jthPlaneXTalk=all1.GetStripXTalk(j);
00149     Int_t jthStripNb=all1.GetStripStrip(j);
00150 
00151      if(crosstalk && jthPlaneXTalk){
00152        continue;
00153      }
00154 
00155      // Strips are sorted wedlug planes
00156 
00157      if( abs(ithPlaneNb-jthPlaneNb) > cdist ){
00158        break;
00159      }
00160 
00161      if(all1.OppViewNeighbours(ithPlaneNb,jthPlaneNb,cdist)){
00162       ++counter;
00163 
00164       fNbStpInNextPl=all1.NbStpInPlane(jthPlaneNb,allpl);
00165 
00166  
00167           Bool_t oneStp; 
00168           // if 1 or 2 strips per plane -> widen the time window 
00169           if(fNbStpInNextPl==1 && timing){
00170              oneStp=true;
00171              all1.GetTimePos(j,ac,oneStp,t1t2, timPos, hBox);
00172           }
00173           else{
00174              oneStp=false;
00175              all1.GetTimePos(j,ac,oneStp,t1t2, timPos, hBox);
00176           }
00177 
00178 
00179           if(fNbStpInThisPl==1 && timing){
00180              oneStp=true;
00181              all1.GetTimePos(i,ac,oneStp,t1t2f, timPosf, hBoxf);
00182           }
00183           else{
00184              oneStp=false;
00185              all1.GetTimePos(i,ac,oneStp,t1t2f, timPosf, hBoxf);
00186           }
00187 
00188 
00189           if( ( ithStripNb < Int_t(timPos+hBox+1) 
00190              && ithStripNb > Int_t(timPos-hBox-1)
00191              && jthStripNb < Int_t(timPosf+hBoxf+1)
00192              && jthStripNb > Int_t(timPosf-hBoxf-1) ) 
00193              ){ 
00194               CellKG c1,c2;
00195 
00196               if(c1.Create(i,j,all1,1,allcells,cellnb)){
00197                 allcells.push_back(c1);
00198               }
00199               if(c2.Create(i,j,all1,2,allcells,cellnb)){
00200                 allcells.push_back(c2);
00201               }                
00202           }              
00203             // Plots
00204 
00205           // All strips from this plane checked
00206           if(counter==fNbStpInNextPl) break; 
00207      }
00208     //else{
00209     //  continue;
00210     //}      
00211 
00212     // End of inner loop
00213     }
00214 
00215     // If no cell was created (no strips in opposite plane/s)
00216     // create one long cell
00217     if(counter==0){
00218       CellKG c;
00219 
00220       if(c.Create(i,all1,allcells,cellnb)){
00221           allcells.push_back(c);
00222       }      
00223     }
00224     
00225   // End of outer loop 
00226   }
00227   for(UInt_t ij=0;ij<allcells.size();++ij){
00228      MSG("Cluster3D", Msg::kDebug)
00229                         << "allcells[ij].index= "
00230                         << allcells[ij].index
00231                         << " allcells[ij].plane= "
00232                         << allcells[ij].plane 
00233                          << " allcells[ij].v= "
00234                         << allcells[ij].v
00235                          << " allcells[ij].u= "
00236                         << allcells[ij].u
00237                         << endl;
00238 
00239   }
00240 }

UInt_t CellListKG::GetCellElem1 UInt_t  index  )  const
 

Definition at line 439 of file CellListKG.cxx.

References allcells.

Referenced by ClusterKG::Create().

00439                                                  {
00440 //
00441 //  Purpose:  Return index of a first strip ehich makes a cell  
00442 //
00443 //  Arguments:
00444 //           index        in  -  index of a cell in STL vector     
00445 //              
00446 //  Return: index of a first strip 
00447 //
00448 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00449 //
00450 //
00451 //  Program Notes:-
00452 //  =============
00453 //
00454 
00455   return allcells[index].elem1;
00456 }

UInt_t CellListKG::GetCellElem2 UInt_t  index  )  const
 

Definition at line 460 of file CellListKG.cxx.

References allcells.

Referenced by ClusterKG::Create().

00460                                                  {
00461 //
00462 //  Purpose:  Return index of a second strip ehich makes a cell  
00463 //
00464 //  Arguments:
00465 //           index        in  -  index of a cell in STL vector     
00466 //              
00467 //  Return: index of a second strip 
00468 //
00469 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00470 //
00471 //
00472 //  Program Notes:-
00473 //  =============
00474 //
00475 
00476   return allcells[index].elem2;
00477 }

Int_t CellListKG::GetCellIndex UInt_t  index  )  const
 

Definition at line 313 of file CellListKG.cxx.

References allcells.

Referenced by ClusterListKG::CreateClusters().

00313                                                 {
00314 //
00315 //  Purpose:  Return cell index  
00316 //
00317 //  Arguments:
00318 //           index        in  -  index of a cell in STL vector     
00319 //              
00320 //  Return: Cell number 
00321 //
00322 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00323 //
00324 //
00325 //  Program Notes:-
00326 //  =============
00327 //
00328 
00329   return allcells[index].index;
00330 }

Int_t CellListKG::GetCellPlane UInt_t  index  )  const
 

Definition at line 334 of file CellListKG.cxx.

References allcells.

Referenced by ClusterListKG::CreateClusters(), and IsNeighbour().

00334                                                 {
00335 //
00336 //  Purpose:  Return plane number of a cell  
00337 //
00338 //  Arguments:
00339 //           index        in  -  index of a cell in STL vector     
00340 //              
00341 //  Return: Plane number
00342 //
00343 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00344 //
00345 //
00346 //  Program Notes:-
00347 //  =============
00348 //
00349 
00350   return allcells[index].plane;
00351 }

void CellListKG::GetCells std::vector< CellKG > &  allcell  )  const
 

Definition at line 34 of file CellListKG.cxx.

Referenced by AlgCluster3DList::RunAlg().

00034                                                       {
00035 //
00036 //  Purpose:  Return STL vector with cells
00037 //
00038 //  Arguments: vector<CellKG> &allcell out - cells
00039 //              
00040 //  Return:  n/a
00041 //
00042 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00043 //
00044 //
00045 //  Program Notes:-
00046 //  =============
00047 //
00048 
00049     allcell=allcells;
00050 }

Float_t CellListKG::GetCellU UInt_t  index  )  const
 

Definition at line 355 of file CellListKG.cxx.

References allcells.

Referenced by IsNeighbour().

00355                                               {
00356 //
00357 //  Purpose:  Return u position of a cell  
00358 //
00359 //  Arguments:
00360 //           index        in  -  index of a cell in STL vector     
00361 //              
00362 //  Return: U coordinate
00363 //
00364 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00365 //
00366 //
00367 //  Program Notes:-
00368 //  =============
00369 //
00370 
00371   return allcells[index].u;
00372 }

Float_t CellListKG::GetCellV UInt_t  index  )  const
 

Definition at line 376 of file CellListKG.cxx.

References allcells.

Referenced by IsNeighbour().

00376                                               {
00377 //
00378 //  Purpose:  Return v position of a cell  
00379 //
00380 //  Arguments:
00381 //           index        in  -  index of a cell in STL vector     
00382 //              
00383 //  Return: V coordinate
00384 //
00385 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00386 //
00387 //
00388 //  Program Notes:-
00389 //  =============
00390 //
00391 
00392   return allcells[index].v;
00393 }

Int_t CellListKG::GetCellView UInt_t  index  )  const
 

Definition at line 418 of file CellListKG.cxx.

References allcells.

00418                                                {
00419 //
00420 //  Purpose:  Return plane view  
00421 //
00422 //  Arguments:
00423 //           index        in  -  index of a cell in STL vector     
00424 //              
00425 //  Return: Plane view
00426 //
00427 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00428 //
00429 //
00430 //  Program Notes:-
00431 //  =============
00432 //
00433 
00434   return allcells[index].planeview;
00435 }

Float_t CellListKG::GetCellZ UInt_t  index  )  const
 

Definition at line 397 of file CellListKG.cxx.

References allcells.

Referenced by IsNeighbour().

00397                                               {
00398 //
00399 //  Purpose:  Return z position of a cell  
00400 //
00401 //  Arguments:
00402 //           index        in  -  index of a cell in STL vector     
00403 //              
00404 //  Return: Z coordinate
00405 //
00406 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00407 //
00408 //
00409 //  Program Notes:-
00410 //  =============
00411 //
00412 
00413   return allcells[index].z;
00414 }

UInt_t CellListKG::GetNCells  )  const
 

Definition at line 54 of file CellListKG.cxx.

References allcells.

Referenced by ClusterListKG::CreateClusters().

00054                                   {
00055 //
00056 //  Purpose:  Returns number of cells 
00057 //
00058 //  Arguments: n/a
00059 //                         
00060 //  Return:  allcells.size()  -  number of cells 
00061 //
00062 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00063 //
00064 //
00065 //  Program Notes:-
00066 //  =============
00067 //
00068   return allcells.size();
00069 }

Bool_t CellListKG::IsNeighbour Int_t  index1,
Int_t  index2,
Int_t  plnDistInp,
Int_t  stpDistInp
 

Definition at line 243 of file CellListKG.cxx.

References GetCellPlane(), GetCellU(), GetCellV(), and GetCellZ().

Referenced by ClusterListKG::CreateClusters().

00243                                                                                             {
00244 //
00245 //  Purpose:  Are c1 and c2 cells neighbours ?
00246 //
00247 //  Arguments: index1      out - STL index of the first cell
00248 //             index2      out - STL index of the second cell
00249 //  Return:  true/false
00250 //
00251 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00252 //
00253 //
00254 //  Program Notes:-
00255 //  =============
00256 //
00257 
00258   const Float_t plnDist = plnDistInp*(5.94*0.01+0.01);
00259   const Float_t stpDist = stpDistInp*(4.1*0.01+0.01);
00260 
00261   Float_t distU = 0.;
00262   if( (fabs(this->GetCellU(index1)) == 9999) || (fabs(this->GetCellU(index2)) == 9999) ){
00263     distU = -9999;
00264   }    
00265   else{  
00266     distU = fabs((this->GetCellU(index1))-(this->GetCellU(index2)));
00267   }
00268 
00269   Float_t distV = 0.;
00270   if( (fabs(this->GetCellV(index1)) == 9999) || (fabs(this->GetCellV(index2)) == 9999) ){
00271     distV = -9999;
00272   }    
00273   else{  
00274     distV = fabs((this->GetCellV(index1))-(this->GetCellV(index2)));
00275   }
00276 
00277   Float_t distZ = fabs((this->GetCellZ(index1))-(this->GetCellZ(index2)));
00278 
00279   // To treat correctly a gap between modules
00280 
00281   Int_t c1pos=this->GetCellPlane(index1);
00282   Int_t c2pos=this->GetCellPlane(index2);
00283 
00284   Bool_t gap = false;
00285 
00286 
00287   if( (c1pos == 248 && c2pos == 250) || (c2pos == 248 && c1pos == 250) ){
00288     gap=true;
00289   } 
00290 
00291 
00292   // Jesli c1=c2. W przyszlosci powinno sie to robic po indeksach celi
00293   if((fabs(distU-stpDist)<0.001) && (fabs(distV-stpDist)<0.001) 
00294      && (fabs(distZ-plnDist)<0.001) ){
00295     return false;
00296   }  
00297 
00298   if( gap && (distU < stpDist) && (distV < stpDist) ){
00299     return true;
00300   }
00301   else{
00302      if((distU < stpDist) && (distV < stpDist) && (distZ < plnDist) ){
00303        return true;
00304      }
00305      else{
00306        return false;
00307      }
00308   }    
00309 }


Member Data Documentation

std::vector<CellKG> CellListKG::allcells [private]
 

Definition at line 51 of file CellListKG.h.

Referenced by CreateCells(), GetCellElem1(), GetCellElem2(), GetCellIndex(), GetCellPlane(), GetCellU(), GetCellV(), GetCellView(), GetCellZ(), and GetNCells().


The documentation for this class was generated from the following files:
Generated on Fri Mar 28 15:57:44 2008 for loon by  doxygen 1.3.9.1