StripListKG Class Reference

#include <StripListKG.h>

List of all members.

Public Member Functions

 StripListKG ()
virtual ~StripListKG ()
void CreateStrips (AlgConfig &ac, const CandSliceHandle *slice, UgliGeomHandle *ugh)
void GetStrips (std::vector< StripKG > &allstps) const
Int_t NbStpInPlane (Int_t planeNbInp, const std::vector< PlaneKG > &p)
UInt_t GetNStrips () const
void SetEnergy ()
Double_t GetEnergy (Int_t whatKind) const
Bool_t OppViewNeighbours (Int_t planeNbInp1, Int_t planeNbInp2, Int_t cdist)
CandStripHandleGetStripHandle (UInt_t index) const
Int_t GetStripIndex (UInt_t index) const
Int_t GetStripStrip (UInt_t index) const
Int_t GetStripPlane (UInt_t index) const
Int_t GetStripXTalk (UInt_t index) const
Float_t GetStripTPos (UInt_t index) const
Float_t GetStripZPos (UInt_t index) const
Int_t GetStripView (UInt_t index) const
Double_t GetStripRawE (UInt_t index) const
Double_t GetStripRawW (UInt_t index) const
Double_t GetStripPeE (UInt_t index) const
Double_t GetStripPeW (UInt_t index) const
void GetTimePos (UInt_t index, AlgConfig &ac, Bool_t oneStp, Float_t &dt, Float_t &timpos, Float_t &halflength)
Bool_t LastInPlane (UInt_t index)
Bool_t FirstInPlane (UInt_t index)
void SetStripAmbiguity (UInt_t index)
Int_t GetStripAmbiguity (UInt_t index) const

Private Attributes

std::vector< StripKGallstps
std::vector< PlaneKGallpls
Double_t energyRaw
Double_t energyPe
Double_t energyGeV

Detailed Description

Definition at line 32 of file StripListKG.h.


Constructor & Destructor Documentation

StripListKG::StripListKG (  ) 

Definition at line 58 of file StripListKG.cxx.

00058                         :energyRaw(0.),energyPe(0.),energyGeV(0.){
00059 //
00060 //  Purpose:  Default constructor
00061 //
00062 }

virtual StripListKG::~StripListKG (  )  [inline, virtual]

Definition at line 36 of file StripListKG.h.

00036 {}; 


Member Function Documentation

void StripListKG::CreateStrips ( AlgConfig ac,
const CandSliceHandle slice,
UgliGeomHandle ugh 
)

Definition at line 226 of file StripListKG.cxx.

References allstps, FirstInPlane(), CandHandle::GetDaughterIterator(), Registry::GetInt(), CandSliceHandle::GetNStrip(), Msg::kDebug, LastInPlane(), MSG, StripKG::Set(), and StripSortCriterion().

Referenced by AlgCluster3DList::RunAlg().

00226                                                                                               {
00227 //
00228 //  Purpose:  Create strips
00229 //
00230 //  Arguments: 
00231 //              
00232 //  Return:  
00233 //
00234 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00235 //
00236 //
00237 //  Program Notes:-
00238 //  =============
00239 //
00240 
00241   const Int_t xtalkmod = ac.GetInt("xTalkMode");
00242 
00243 
00244   CandStripHandleItr stripItr(slice->GetDaughterIterator());
00245   //while (CandStripHandle *strip = stripItr()) {
00246   Int_t nstrips = slice->GetNStrip();
00247 
00248   MSG("Cluster3D", Msg::kDebug)
00249                         << "Create strip list"
00250                         << "nstrips = " << nstrips 
00251                         << endl;
00252 
00253   Int_t i=0;
00254   StripKG s;
00255   
00256   while (stripItr.IsValid()) {
00257 
00258      CandStripHandle *strip = stripItr.Ptr();
00259 
00260      s.Set(strip,ugh,i);    
00261      allstps.push_back(s); 
00262 
00263      ++i;  
00264      stripItr.Next();  
00265   }
00266   stable_sort(allstps.begin(),allstps.end(),StripSortCriterion);
00267 
00268   for(UInt_t ii=0;ii<allstps.size();++ii){
00269 
00270     if(xtalkmod==1){
00271         allstps[i].XTalk(ac);
00272     }
00273     else{
00274       if(FirstInPlane(ii) && LastInPlane(ii)){
00275          allstps[ii].XTalk(ac);
00276       }
00277       else if(FirstInPlane(ii)){
00278          Int_t dist1 = allstps[ii+1].strip-allstps[ii].strip;
00279          if(dist1>5){
00280             allstps[ii].XTalk(ac);
00281          }         
00282       }
00283       else if(LastInPlane(ii)){
00284          Int_t dist2 = allstps[ii].strip-allstps[ii-1].strip;
00285          if(dist2>5){
00286             allstps[ii].XTalk(ac);
00287          }
00288       }
00289       else{
00290          Int_t dist1 = allstps[ii+1].strip-allstps[ii].strip;
00291          Int_t dist2 = allstps[ii].strip-allstps[ii-1].strip;
00292          if(dist1>5 && dist2>5){
00293             allstps[ii].XTalk(ac);
00294          }
00295       } 
00296       MSG("Cluster3D", Msg::kDebug)
00297                         << " allstps[ii].plane= "
00298                         << allstps[ii].plane 
00299                         << " allstps[ii].strip= "
00300                         << allstps[ii].strip 
00301                         << " allstps[ii].xtalk= "
00302                         << allstps[ii].xtalk 
00303                         << endl;    
00304     }
00305   }
00306 }

Bool_t StripListKG::FirstInPlane ( UInt_t  index  ) 

Definition at line 586 of file StripListKG.cxx.

References allstps.

Referenced by CreateStrips().

00586                                             {
00587 //
00588 //  Purpose:  Is this strip the first in plane ?
00589 //
00590 //  Arguments:
00591 //           index        in  - position in vector allstps     
00592 //              
00593 //  Return:  
00594 //
00595 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00596 //
00597 //
00598 //  Program Notes:-
00599 //  =============
00600 //
00601   if(index==0){
00602     return true;
00603   }
00604   else{
00605     if(allstps[index-1].plane != allstps[index].plane){
00606       return true;  
00607     }
00608     else{
00609       return false;
00610     }
00611   }
00612 }

Double_t StripListKG::GetEnergy ( Int_t  whatKind  )  const

Definition at line 128 of file StripListKG.cxx.

References energyGeV, energyPe, and energyRaw.

00128                                                    {
00129 //
00130 //  Purpose:  Return energy
00131 //
00132 //  Arguments: 
00133 //              
00134 //  Return:  
00135 //
00136 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00137 //
00138 //
00139 //  Program Notes:-
00140 //  =============
00141 //
00142 
00143   if(whatKind==0){
00144     return energyRaw;
00145   }
00146   else if(whatKind==1){
00147     return energyPe;
00148   }
00149   else if(whatKind==2){
00150     return energyGeV;
00151   }
00152   else{
00153     return energyPe;
00154   }
00155 
00156   return energyPe;
00157 }

UInt_t StripListKG::GetNStrips (  )  const

Definition at line 86 of file StripListKG.cxx.

References allstps.

Referenced by PlaneKG::Create(), and CellListKG::CreateCells().

00086                                     {
00087 //
00088 //  Purpose:  Return number of strips
00089 //
00090 //  Arguments: 
00091 //              
00092 //  Return:  
00093 //
00094 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00095 //
00096 //
00097 //  Program Notes:-
00098 //  =============
00099 //
00100 
00101   return allstps.size();
00102 }

Int_t StripListKG::GetStripAmbiguity ( UInt_t  index  )  const

Definition at line 668 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::Create(), and ClusterKG::FindNbOfAmbStrips().

00668                                                       {
00669 //
00670 //  Purpose:  to how many clusters strip belongs
00671 //
00672 //  Arguments:             
00673 //           index        in  -  index of a strip in STL vector     
00674 //              
00675 //  Return:  
00676 //
00677 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00678 //
00679 //
00680 //  Program Notes:-
00681 //  =============
00682 //
00683 
00684   return allstps[index].ambig;  
00685 
00686 }

CandStripHandle * StripListKG::GetStripHandle ( UInt_t  index  )  const

Definition at line 310 of file StripListKG.cxx.

References allstps.

Referenced by AlgCluster3DList::RunAlg().

00310                                                               {
00311 //
00312 //  Purpose:  Return handle to a strip  
00313 //
00314 //  Arguments:
00315 //           index        in  -  index of a strip in STL vector     
00316 //              
00317 //  Return: CandStripHandle* handle
00318 //
00319 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00320 //
00321 //
00322 //  Program Notes:-
00323 //  =============
00324 //
00325 
00326   return allstps[index].handle;
00327 }

Int_t StripListKG::GetStripIndex ( UInt_t  index  )  const

Definition at line 331 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::Create().

00331                                                   {
00332 //
00333 //  Purpose:  Return strip index  
00334 //
00335 //  Arguments:
00336 //           index        in  -  index of a strip in STL vector     
00337 //              
00338 //  Return: Strip number 
00339 //
00340 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00341 //
00342 //
00343 //  Program Notes:-
00344 //  =============
00345 //
00346 
00347   return allstps[index].index;
00348 }

Double_t StripListKG::GetStripPeE ( UInt_t  index  )  const

Definition at line 499 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::SetEnergy().

00499                                                    {
00500 //
00501 //  Purpose:  Return energy in pe 
00502 //
00503 //  Arguments:
00504 //           index        in  -  index of a strip in STL vector     
00505 //              
00506 //  Return: Energy in pe for E end
00507 //
00508 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00509 //
00510 //
00511 //  Program Notes:-
00512 //  =============
00513 //
00514 
00515   return allstps[index].peE;
00516 }

Double_t StripListKG::GetStripPeW ( UInt_t  index  )  const

Definition at line 520 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::SetEnergy().

00520                                                    {
00521 //
00522 //  Purpose:  Return energy in pe 
00523 //
00524 //  Arguments:
00525 //           index        in  -  index of a strip in STL vector     
00526 //              
00527 //  Return: Energy in pe for W end
00528 //
00529 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00530 //
00531 //
00532 //  Program Notes:-
00533 //  =============
00534 //
00535 
00536   return allstps[index].peW;
00537 }

Int_t StripListKG::GetStripPlane ( UInt_t  index  )  const

Definition at line 373 of file StripListKG.cxx.

References allstps.

Referenced by PlaneKG::Create(), ClusterKG::Create(), and CellListKG::CreateCells().

00373                                                   {
00374 //
00375 //  Purpose:  Return plane number of a strip 
00376 //
00377 //  Arguments:
00378 //           index        in  -  index of a strip in STL vector     
00379 //              
00380 //  Return: Plane number 
00381 //
00382 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00383 //
00384 //
00385 //  Program Notes:-
00386 //  =============
00387 //
00388 
00389   return allstps[index].plane;
00390 }

Double_t StripListKG::GetStripRawE ( UInt_t  index  )  const

Definition at line 457 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::SetEnergy().

00457                                                     {
00458 //
00459 //  Purpose:  Return energy in ADC 
00460 //
00461 //  Arguments:
00462 //           index        in  -  index of a strip in STL vector     
00463 //              
00464 //  Return: Energy in ADC for E strip end
00465 //
00466 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00467 //
00468 //
00469 //  Program Notes:-
00470 //  =============
00471 //
00472 
00473   return allstps[index].rawE;
00474 }

Double_t StripListKG::GetStripRawW ( UInt_t  index  )  const

Definition at line 478 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::SetEnergy().

00478                                                     {
00479 //
00480 //  Purpose:  Return energy in ADC 
00481 //
00482 //  Arguments:
00483 //           index        in  -  index of a strip in STL vector     
00484 //              
00485 //  Return: Energy in ADC for W strip end
00486 //
00487 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00488 //
00489 //
00490 //  Program Notes:-
00491 //  =============
00492 //
00493 
00494   return allstps[index].rawW;
00495 }

void StripListKG::GetStrips ( std::vector< StripKG > &  allstps  )  const
Int_t StripListKG::GetStripStrip ( UInt_t  index  )  const

Definition at line 352 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::Create(), and CellListKG::CreateCells().

00352                                                   {
00353 //
00354 //  Purpose:  Return strip number  
00355 //
00356 //  Arguments:
00357 //           index        in  -  index of a strip in STL vector     
00358 //              
00359 //  Return: Strip number 
00360 //
00361 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00362 //
00363 //
00364 //  Program Notes:-
00365 //  =============
00366 //
00367 
00368   return allstps[index].strip;
00369 }

Float_t StripListKG::GetStripTPos ( UInt_t  index  )  const

Definition at line 394 of file StripListKG.cxx.

References allstps.

00394                                                    {
00395 //
00396 //  Purpose:  Return transverse position of a strip 
00397 //
00398 //  Arguments:
00399 //           index        in  -  index of a strip in STL vector     
00400 //              
00401 //  Return: Transverse position  
00402 //
00403 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00404 //
00405 //
00406 //  Program Notes:-
00407 //  =============
00408 //
00409 
00410   return allstps[index].tpos;
00411 }

Int_t StripListKG::GetStripView ( UInt_t  index  )  const

Definition at line 436 of file StripListKG.cxx.

References allstps.

00436                                                  {
00437 //
00438 //  Purpose:  Return plane view 
00439 //
00440 //  Arguments:
00441 //           index        in  -  index of a strip in STL vector     
00442 //              
00443 //  Return: Plane view  
00444 //
00445 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00446 //
00447 //
00448 //  Program Notes:-
00449 //  =============
00450 //
00451 
00452   return allstps[index].planeview;
00453 }

Int_t StripListKG::GetStripXTalk ( UInt_t  index  )  const

Definition at line 541 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::Create(), and CellListKG::CreateCells().

00541                                                   {
00542 //
00543 //  Purpose:  Return crosstalk flag for a strip 
00544 //
00545 //  Arguments:
00546 //           index        in  -  index of a strip in STL vector     
00547 //              
00548 //  Return:  XTalk flag 
00549 //
00550 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00551 //
00552 //
00553 //  Program Notes:-
00554 //  =============
00555 //
00556 
00557   return allstps[index].xtalk;
00558 }

Float_t StripListKG::GetStripZPos ( UInt_t  index  )  const

Definition at line 415 of file StripListKG.cxx.

References allstps.

00415                                                    {
00416 //
00417 //  Purpose:  Return z position of a strip 
00418 //
00419 //  Arguments:
00420 //           index        in  -  index of a strip in STL vector     
00421 //              
00422 //  Return: Z position  
00423 //
00424 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00425 //
00426 //
00427 //  Program Notes:-
00428 //  =============
00429 //
00430 
00431   return allstps[index].zpos;
00432 }

void StripListKG::GetTimePos ( UInt_t  index,
AlgConfig ac,
Bool_t  oneStp,
Float_t &  dt,
Float_t &  timpos,
Float_t &  halflength 
)

Definition at line 562 of file StripListKG.cxx.

References allstps.

Referenced by CellListKG::CreateCells().

00562                                                                                                                          {
00563 //
00564 //  Purpose:  Return hit position from timing information for a strip 
00565 //
00566 //  Arguments:
00567 //           ac           in  -  AlgConfig 
00568 //           index        in  -  index of a strip in STL vector     
00569 //           oneStp       in  -  true = one hit per plane => use timing info
00570 //                               false = more than one hit => do not use timing
00571 //              
00572 //  Return:  
00573 //
00574 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00575 //
00576 //
00577 //  Program Notes:-
00578 //  =============
00579 //
00580 
00581   allstps[index].TimePos(ac, oneStp, dt, timpos, halflength);  
00582 }

Bool_t StripListKG::LastInPlane ( UInt_t  index  ) 

Definition at line 616 of file StripListKG.cxx.

References allstps.

Referenced by CreateStrips().

00616                                            {
00617 //
00618 //  Purpose:  Is this strip the last in plane ?
00619 //
00620 //  Arguments:
00621 //           index        in  - position in vector allstps     
00622 //              
00623 //  Return:  
00624 //
00625 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00626 //
00627 //
00628 //  Program Notes:-
00629 //  =============
00630 //
00631   if(index == allstps.size()-1){
00632      return true; 
00633   }
00634   else{
00635     if(allstps[index].plane != allstps[index+1].plane){
00636       return true;  
00637     }
00638     else{
00639       return false;
00640     }
00641   }
00642 }

Int_t StripListKG::NbStpInPlane ( Int_t  planeNbInp,
const std::vector< PlaneKG > &  p 
)

Definition at line 188 of file StripListKG.cxx.

Referenced by CellListKG::CreateCells().

00188                                                                             {
00189 //
00190 //  Purpose:  Return 
00191 //
00192 //  Arguments: 
00193 //              
00194 //  Return:  
00195 //
00196 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00197 //
00198 //
00199 //  Program Notes:-
00200 //  =============
00201 //
00202 
00203   Int_t flag=0;
00204   Int_t ile=0;
00205   for(UInt_t j=0; j<p.size(); ++j){
00206     if(planeNbInp==p[j].number){
00207       flag=1;
00208       ile = p[j].nstppplane;
00209       break;
00210     }
00211     else{
00212       continue;
00213     }
00214   }
00215   if(flag==1){
00216     return ile;
00217   }
00218   else{
00219     cout << "NbStpInPlane : Strip belongs to an unknown plane " << endl;
00220     return 0;
00221   }
00222 }

Bool_t StripListKG::OppViewNeighbours ( Int_t  planeNbInp1,
Int_t  planeNbInp2,
Int_t  cdist 
)

Definition at line 161 of file StripListKG.cxx.

Referenced by CellListKG::CreateCells().

00161                                                                                       {
00162 //
00163 //  Purpose:  Return 
00164 //
00165 //  Arguments: 
00166 //              
00167 //  Return:  n/a
00168 //
00169 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00170 //
00171 //
00172 //  Program Notes:-
00173 //  =============
00174 //
00175 
00176   Int_t dist = abs(planeNbInp1-planeNbInp2);
00177 
00178   if(dist%2!=0 && dist <= cdist){
00179     return true;
00180   }
00181   else{
00182     return false;
00183   }
00184 }

void StripListKG::SetEnergy (  ) 

Definition at line 106 of file StripListKG.cxx.

References allstps, energyPe, and energyRaw.

00106                            {
00107 //
00108 //  Purpose:  Sets energy
00109 //
00110 //  Arguments: 
00111 //              
00112 //  Return:  n/a
00113 //
00114 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00115 //
00116 //
00117 //  Program Notes:-
00118 //  =============
00119 //
00120   for(UInt_t i=0; i<allstps.size(); ++i){
00121     energyPe=energyPe+allstps[i].peE+allstps[i].peW;
00122     energyRaw=energyRaw+allstps[i].rawE+allstps[i].rawW; 
00123   } 
00124 }

void StripListKG::SetStripAmbiguity ( UInt_t  index  ) 

Definition at line 646 of file StripListKG.cxx.

References allstps.

Referenced by ClusterKG::Create().

00646                                                {
00647 //
00648 //  Purpose:  to how many clusters strip belongs
00649 //
00650 //  Arguments: 
00651 //            index    in  - position in vector allstps     
00652 //              
00653 //  Return:  n/a
00654 //
00655 //  Contact:   K.Grzelak1@physics.ox.ac.uk
00656 //
00657 //
00658 //  Program Notes:-
00659 //  =============
00660 //
00661 
00662   allstps[index].ambig=allstps[index].ambig+1;  
00663 
00664 }


Member Data Documentation

std::vector<PlaneKG> StripListKG::allpls [private]

Definition at line 65 of file StripListKG.h.

std::vector<StripKG> StripListKG::allstps [private]
Double_t StripListKG::energyGeV [private]

Definition at line 69 of file StripListKG.h.

Referenced by GetEnergy().

Double_t StripListKG::energyPe [private]

Definition at line 68 of file StripListKG.h.

Referenced by GetEnergy(), and SetEnergy().

Double_t StripListKG::energyRaw [private]

Definition at line 67 of file StripListKG.h.

Referenced by GetEnergy(), and SetEnergy().


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

Generated on 2 Nov 2017 for loon by  doxygen 1.6.1