CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
CACell Class Reference

#include <CACell.h>

Public Types

using CAntuplet = std::vector< CACell * >
 
using Hit = RecHitsSortedInPhi::Hit
 

Public Member Functions

bool areAlignedRZ (const CACell *otherCell, const float ptmin, const float thetaCut) const
 
 CACell (const HitDoublets *doublets, int doubletId, const unsigned int cellId, const int innerHitId, const int outerHitId)
 
void checkAlignmentAndPushTriplet (CACell *innerCell, std::vector< CACell::CAntuplet > &foundTriplets, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const float thetaCut, const float phiCut, const float hardPtCut)
 
void checkAlignmentAndTag (CACell *innerCell, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const float thetaCut, const float phiCut, const float hardPtCut)
 
void evolve ()
 
void findNtuplets (std::vector< CAntuplet > &foundNtuplets, CAntuplet &tmpNtuplet, const unsigned int minHitsPerNtuplet) const
 
unsigned int getCAState () const
 
unsigned int getCellId () const
 
Hit const & getInnerHit () const
 
unsigned int getInnerHitId () const
 
float getInnerPhi () const
 
float getInnerR () const
 
float getInnerX () const
 
float getInnerY () const
 
float getInnerZ () const
 
Hit const & getOuterHit () const
 
unsigned int getOuterHitId () const
 
float getOuterPhi () const
 
float getOuterR () const
 
float getOuterX () const
 
float getOuterY () const
 
float getOuterZ () const
 
bool haveSimilarCurvature (const CACell *otherCell, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const float phiCut, const float hardPtCut) const
 
bool isRootCell (const unsigned int minimumCAState) const
 
void tagAsInnerNeighbor (CACell *otherCell)
 
void tagAsOuterNeighbor (CACell *otherCell)
 
void updateState ()
 

Private Attributes

unsigned int hasSameStateNeighbors
 
unsigned int theCAState
 
const unsigned int theCellId
 
const int theDoubletId
 
const HitDoubletstheDoublets
 
const unsigned int theInnerHitId
 
std::vector< CACell * > theInnerNeighbors
 
const float theInnerR
 
const float theInnerZ
 
const unsigned int theOuterHitId
 
std::vector< CACell * > theOuterNeighbors
 
const float theOuterR
 
const float theOuterZ
 

Detailed Description

Definition at line 13 of file CACell.h.

Member Typedef Documentation

using CACell::CAntuplet = std::vector<CACell*>

Definition at line 16 of file CACell.h.

Definition at line 15 of file CACell.h.

Constructor & Destructor Documentation

CACell::CACell ( const HitDoublets doublets,
int  doubletId,
const unsigned int  cellId,
const int  innerHitId,
const int  outerHitId 
)
inline

Definition at line 18 of file CACell.h.

18  :
19  theCAState(0), theInnerHitId(innerHitId), theOuterHitId(outerHitId), theCellId(cellId), hasSameStateNeighbors(0), theDoublets(doublets), theDoubletId(doubletId),
20  theInnerR(doublets->r(doubletId, HitDoublets::inner)), theOuterR(doublets->r(doubletId, HitDoublets::outer)),
21  theInnerZ(doublets->z(doubletId, HitDoublets::inner)), theOuterZ(doublets->z(doubletId, HitDoublets::outer)) {
22  }
const float theInnerZ
Definition: CACell.h:290
const HitDoublets * theDoublets
Definition: CACell.h:285
const unsigned int theInnerHitId
Definition: CACell.h:280
const int theDoubletId
Definition: CACell.h:286
float z(int i, layer l) const
const float theOuterR
Definition: CACell.h:289
const float theInnerR
Definition: CACell.h:288
float r(int i, layer l) const
const unsigned int theCellId
Definition: CACell.h:282
const float theOuterZ
Definition: CACell.h:291
unsigned int theCAState
Definition: CACell.h:278
unsigned int hasSameStateNeighbors
Definition: CACell.h:283
const unsigned int theOuterHitId
Definition: CACell.h:281

Member Function Documentation

bool CACell::areAlignedRZ ( const CACell otherCell,
const float  ptmin,
const float  thetaCut 
) const
inline

Definition at line 129 of file CACell.h.

References funct::abs(), getInnerR(), getInnerZ(), HLT_FULL_cff::pMin, diffTwoXMLs::r1, mathSSE::sqrt(), theInnerR, theInnerZ, theOuterR, and theOuterZ.

Referenced by checkAlignmentAndPushTriplet(), and checkAlignmentAndTag().

130  {
131 
132  float r1 = otherCell->getInnerR();
133  float z1 = otherCell->getInnerZ();
134  float radius_diff = std::abs(r1 - theOuterR);
135  float distance_13_squared = radius_diff*radius_diff + (z1 - theOuterZ)*(z1 - theOuterZ);
136 
137  float pMin = ptmin*std::sqrt(distance_13_squared); //this needs to be divided by radius_diff later
138 
139  float tan_12_13_half_mul_distance_13_squared = fabs(z1 * (theInnerR - theOuterR) + theInnerZ * (theOuterR - r1) + theOuterZ * (r1 - theInnerR)) ;
140  return tan_12_13_half_mul_distance_13_squared * pMin <= thetaCut * distance_13_squared * radius_diff;
141  }
const float theInnerZ
Definition: CACell.h:290
float getInnerZ() const
Definition: CACell.h:52
const float theOuterR
Definition: CACell.h:289
T sqrt(T t)
Definition: SSEVec.h:18
const float theInnerR
Definition: CACell.h:288
float getInnerR() const
Definition: CACell.h:60
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double ptmin
Definition: HydjetWrapper.h:90
const float theOuterZ
Definition: CACell.h:291
void CACell::checkAlignmentAndPushTriplet ( CACell innerCell,
std::vector< CACell::CAntuplet > &  foundTriplets,
const float  ptmin,
const float  region_origin_x,
const float  region_origin_y,
const float  region_origin_radius,
const float  thetaCut,
const float  phiCut,
const float  hardPtCut 
)
inline

Definition at line 114 of file CACell.h.

References areAlignedRZ(), and haveSimilarCurvature().

117  {
118 
119  if (areAlignedRZ(innerCell, ptmin, thetaCut) &&
120  haveSimilarCurvature(innerCell,ptmin, region_origin_x, region_origin_y,
121  region_origin_radius, phiCut, hardPtCut)) {
122  foundTriplets.emplace_back(CACell::CAntuplet{innerCell,this});
123 
124  }
125  }
bool areAlignedRZ(const CACell *otherCell, const float ptmin, const float thetaCut) const
Definition: CACell.h:129
bool haveSimilarCurvature(const CACell *otherCell, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const float phiCut, const float hardPtCut) const
Definition: CACell.h:153
double ptmin
Definition: HydjetWrapper.h:90
std::vector< CACell * > CAntuplet
Definition: CACell.h:16
void CACell::checkAlignmentAndTag ( CACell innerCell,
const float  ptmin,
const float  region_origin_x,
const float  region_origin_y,
const float  region_origin_radius,
const float  thetaCut,
const float  phiCut,
const float  hardPtCut 
)
inline

Definition at line 102 of file CACell.h.

References areAlignedRZ(), haveSimilarCurvature(), tagAsInnerNeighbor(), and tagAsOuterNeighbor().

104  {
105 
106  if (areAlignedRZ(innerCell, ptmin, thetaCut) &&
107  haveSimilarCurvature(innerCell,ptmin, region_origin_x, region_origin_y,
108  region_origin_radius, phiCut, hardPtCut)) {
109  tagAsInnerNeighbor(innerCell);
110  innerCell->tagAsOuterNeighbor(this);
111  }
112  }
void tagAsOuterNeighbor(CACell *otherCell)
Definition: CACell.h:143
bool areAlignedRZ(const CACell *otherCell, const float ptmin, const float thetaCut) const
Definition: CACell.h:129
bool haveSimilarCurvature(const CACell *otherCell, const float ptmin, const float region_origin_x, const float region_origin_y, const float region_origin_radius, const float phiCut, const float hardPtCut) const
Definition: CACell.h:153
void tagAsInnerNeighbor(CACell *otherCell)
Definition: CACell.h:148
double ptmin
Definition: HydjetWrapper.h:90
void CACell::evolve ( )
inline

Definition at line 84 of file CACell.h.

References getCAState(), hasSameStateNeighbors, i, theCAState, and theOuterNeighbors.

84  {
85 
87  unsigned int numberOfNeighbors = theOuterNeighbors.size();
88 
89  for (unsigned int i = 0; i < numberOfNeighbors; ++i) {
90 
92 
94 
95  break;
96  }
97  }
98 
99  }
int i
Definition: DBlmapReader.cc:9
unsigned int getCAState() const
Definition: CACell.h:226
unsigned int theCAState
Definition: CACell.h:278
unsigned int hasSameStateNeighbors
Definition: CACell.h:283
std::vector< CACell * > theOuterNeighbors
Definition: CACell.h:276
void CACell::findNtuplets ( std::vector< CAntuplet > &  foundNtuplets,
CAntuplet tmpNtuplet,
const unsigned int  minHitsPerNtuplet 
) const
inline

Definition at line 242 of file CACell.h.

References i, and theOuterNeighbors.

242  {
243 
244  // the building process for a track ends if:
245  // it has no outer neighbor
246  // it has no compatible neighbor
247  // the ntuplets is then saved if the number of hits it contains is greater than a threshold
248 
249  if (tmpNtuplet.size() == minHitsPerNtuplet - 1)
250  {
251  foundNtuplets.push_back(tmpNtuplet);
252  }
253  else
254  {
255  if(theOuterNeighbors.size() == 0)
256  {
257  return;
258  }
259  else
260  {
261  unsigned int numberOfOuterNeighbors = theOuterNeighbors.size();
262  for (unsigned int i = 0; i < numberOfOuterNeighbors; ++i) {
263  tmpNtuplet.push_back((theOuterNeighbors[i]));
264  theOuterNeighbors[i]->findNtuplets(foundNtuplets, tmpNtuplet, minHitsPerNtuplet);
265  tmpNtuplet.pop_back();
266  }
267  }
268 
269  }
270 
271  }
int i
Definition: DBlmapReader.cc:9
std::vector< CACell * > theOuterNeighbors
Definition: CACell.h:276
unsigned int CACell::getCAState ( ) const
inline

Definition at line 226 of file CACell.h.

References theCAState.

Referenced by evolve().

226  {
227  return theCAState;
228  }
unsigned int theCAState
Definition: CACell.h:278
unsigned int CACell::getCellId ( ) const
inline

Definition at line 24 of file CACell.h.

References theCellId.

24  {
25  return theCellId;
26  }
const unsigned int theCellId
Definition: CACell.h:282
Hit const& CACell::getInnerHit ( ) const
inline

Definition at line 28 of file CACell.h.

References HitDoublets::hit(), HitDoublets::inner, theDoubletId, and theDoublets.

28  {
30  }
const HitDoublets * theDoublets
Definition: CACell.h:285
const int theDoubletId
Definition: CACell.h:286
Hit const & hit(int i, layer l) const
unsigned int CACell::getInnerHitId ( ) const
inline

Definition at line 76 of file CACell.h.

References theInnerHitId.

76  {
77  return theInnerHitId;
78  }
const unsigned int theInnerHitId
Definition: CACell.h:280
float CACell::getInnerPhi ( ) const
inline

Definition at line 68 of file CACell.h.

References HitDoublets::inner, HitDoublets::phi(), theDoubletId, and theDoublets.

68  {
70  }
const HitDoublets * theDoublets
Definition: CACell.h:285
const int theDoubletId
Definition: CACell.h:286
float phi(int i, layer l) const
float CACell::getInnerR ( ) const
inline

Definition at line 60 of file CACell.h.

References theInnerR.

Referenced by areAlignedRZ().

60  {
61  return theInnerR;
62  }
const float theInnerR
Definition: CACell.h:288
float CACell::getInnerX ( ) const
inline

Definition at line 36 of file CACell.h.

References HitDoublets::inner, theDoubletId, theDoublets, and HitDoublets::x().

Referenced by haveSimilarCurvature().

36  {
38  }
const HitDoublets * theDoublets
Definition: CACell.h:285
float x(int i, layer l) const
const int theDoubletId
Definition: CACell.h:286
float CACell::getInnerY ( ) const
inline

Definition at line 44 of file CACell.h.

References HitDoublets::inner, theDoubletId, theDoublets, and HitDoublets::y().

Referenced by haveSimilarCurvature().

44  {
46  }
const HitDoublets * theDoublets
Definition: CACell.h:285
const int theDoubletId
Definition: CACell.h:286
float y(int i, layer l) const
float CACell::getInnerZ ( ) const
inline

Definition at line 52 of file CACell.h.

References theInnerZ.

Referenced by areAlignedRZ().

52  {
53  return theInnerZ;
54  }
const float theInnerZ
Definition: CACell.h:290
Hit const& CACell::getOuterHit ( ) const
inline

Definition at line 32 of file CACell.h.

References HitDoublets::hit(), HitDoublets::outer, theDoubletId, and theDoublets.

32  {
34  }
const HitDoublets * theDoublets
Definition: CACell.h:285
const int theDoubletId
Definition: CACell.h:286
Hit const & hit(int i, layer l) const
unsigned int CACell::getOuterHitId ( ) const
inline

Definition at line 80 of file CACell.h.

References theOuterHitId.

80  {
81  return theOuterHitId;
82  }
const unsigned int theOuterHitId
Definition: CACell.h:281
float CACell::getOuterPhi ( ) const
inline

Definition at line 72 of file CACell.h.

References HitDoublets::outer, HitDoublets::phi(), theDoubletId, and theDoublets.

72  {
74  }
const HitDoublets * theDoublets
Definition: CACell.h:285
const int theDoubletId
Definition: CACell.h:286
float phi(int i, layer l) const
float CACell::getOuterR ( ) const
inline

Definition at line 64 of file CACell.h.

References theOuterR.

64  {
65  return theOuterR;
66  }
const float theOuterR
Definition: CACell.h:289
float CACell::getOuterX ( ) const
inline

Definition at line 40 of file CACell.h.

References HitDoublets::outer, theDoubletId, theDoublets, and HitDoublets::x().

Referenced by haveSimilarCurvature().

40  {
42  }
const HitDoublets * theDoublets
Definition: CACell.h:285
float x(int i, layer l) const
const int theDoubletId
Definition: CACell.h:286
float CACell::getOuterY ( ) const
inline

Definition at line 48 of file CACell.h.

References HitDoublets::outer, theDoubletId, theDoublets, and HitDoublets::y().

Referenced by haveSimilarCurvature().

48  {
50  }
const HitDoublets * theDoublets
Definition: CACell.h:285
const int theDoubletId
Definition: CACell.h:286
float y(int i, layer l) const
float CACell::getOuterZ ( ) const
inline

Definition at line 56 of file CACell.h.

References theOuterZ.

56  {
57  return theOuterZ;
58  }
const float theOuterZ
Definition: CACell.h:291
bool CACell::haveSimilarCurvature ( const CACell otherCell,
const float  ptmin,
const float  region_origin_x,
const float  region_origin_y,
const float  region_origin_radius,
const float  phiCut,
const float  hardPtCut 
) const
inline

Definition at line 153 of file CACell.h.

References funct::abs(), alignCSCRings::e, f, getInnerX(), getInnerY(), getOuterX(), getOuterY(), hltrates_dqm_sourceclient-live_cfg::offset, CosmicsPD_Skims::radius, and mathSSE::sqrt().

Referenced by checkAlignmentAndPushTriplet(), and checkAlignmentAndTag().

155  {
156 
157 
158  auto x1 = otherCell->getInnerX();
159  auto y1 = otherCell->getInnerY();
160 
161  auto x2 = getInnerX();
162  auto y2 = getInnerY();
163 
164  auto x3 = getOuterX();
165  auto y3 = getOuterY();
166 
167  float distance_13_squared = (x1 - x3)*(x1 - x3) + (y1 - y3)*(y1 - y3);
168  float tan_12_13_half_mul_distance_13_squared = std::abs(y1 * (x2 - x3) + y2 * (x3 - x1) + y3 * (x1 - x2)) ;
169  if(tan_12_13_half_mul_distance_13_squared * ptmin <= 1.0e-4f*distance_13_squared)
170  {
171 
172  float distance_3_beamspot_squared = (x3-region_origin_x) * (x3-region_origin_x) + (y3-region_origin_y) * (y3-region_origin_y);
173 
174  float dot_bs3_13 = ((x1 - x3)*( region_origin_x - x3) + (y1 - y3) * (region_origin_y-y3));
175  float proj_bs3_on_13_squared = dot_bs3_13*dot_bs3_13/distance_13_squared;
176 
177  float distance_13_beamspot_squared = distance_3_beamspot_squared - proj_bs3_on_13_squared;
178 
179  if(distance_13_beamspot_squared > (region_origin_radius+phiCut)*(region_origin_radius+phiCut) )
180  {
181  return false;
182  }
183  return true;
184  }
185 
186  //87 cm/GeV = 1/(3.8T * 0.3)
187 
188  //take less than radius given by the hardPtCut and reject everything below
189  float minRadius = hardPtCut*87.f;
190 
191  auto det = (x1 - x2) * (y2 - y3) - (x2 - x3) * (y1 - y2);
192 
193 
194  auto offset = x2 * x2 + y2*y2;
195 
196  auto bc = (x1 * x1 + y1 * y1 - offset)*0.5f;
197 
198  auto cd = (offset - x3 * x3 - y3 * y3)*0.5f;
199 
200 
201 
202  auto idet = 1.f / det;
203 
204  auto x_center = (bc * (y2 - y3) - cd * (y1 - y2)) * idet;
205  auto y_center = (cd * (x1 - x2) - bc * (x2 - x3)) * idet;
206 
207  auto radius = std::sqrt((x2 - x_center)*(x2 - x_center) + (y2 - y_center)*(y2 - y_center));
208 
209  if(radius < minRadius)
210  return false;
211  auto centers_distance_squared = (x_center - region_origin_x)*(x_center - region_origin_x) + (y_center - region_origin_y)*(y_center - region_origin_y);
212  auto region_origin_radius_plus_tolerance = region_origin_radius + phiCut;
213  auto minimumOfIntersectionRange = (radius - region_origin_radius_plus_tolerance)*(radius - region_origin_radius_plus_tolerance);
214 
215  if (centers_distance_squared >= minimumOfIntersectionRange) {
216  auto maximumOfIntersectionRange = (radius + region_origin_radius_plus_tolerance)*(radius + region_origin_radius_plus_tolerance);
217  return centers_distance_squared <= maximumOfIntersectionRange;
218  }
219 
220  return false;
221 
222 
223 
224  }
float getInnerY() const
Definition: CACell.h:44
T sqrt(T t)
Definition: SSEVec.h:18
float getOuterX() const
Definition: CACell.h:40
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
double f[11][100]
float getInnerX() const
Definition: CACell.h:36
float getOuterY() const
Definition: CACell.h:48
double ptmin
Definition: HydjetWrapper.h:90
bool CACell::isRootCell ( const unsigned int  minimumCAState) const
inline

Definition at line 235 of file CACell.h.

References theCAState.

235  {
236  return (theCAState >= minimumCAState);
237  }
unsigned int theCAState
Definition: CACell.h:278
void CACell::tagAsInnerNeighbor ( CACell otherCell)
inline

Definition at line 148 of file CACell.h.

References theInnerNeighbors.

Referenced by checkAlignmentAndTag().

149  {
150  theInnerNeighbors.push_back(otherCell);
151  }
std::vector< CACell * > theInnerNeighbors
Definition: CACell.h:275
void CACell::tagAsOuterNeighbor ( CACell otherCell)
inline

Definition at line 143 of file CACell.h.

References theOuterNeighbors.

Referenced by checkAlignmentAndTag().

144  {
145  theOuterNeighbors.push_back(otherCell);
146  }
std::vector< CACell * > theOuterNeighbors
Definition: CACell.h:276
void CACell::updateState ( )
inline

Definition at line 231 of file CACell.h.

References hasSameStateNeighbors, and theCAState.

231  {
233  }
unsigned int theCAState
Definition: CACell.h:278
unsigned int hasSameStateNeighbors
Definition: CACell.h:283

Member Data Documentation

unsigned int CACell::hasSameStateNeighbors
private

Definition at line 283 of file CACell.h.

Referenced by evolve(), and updateState().

unsigned int CACell::theCAState
private

Definition at line 278 of file CACell.h.

Referenced by evolve(), getCAState(), isRootCell(), and updateState().

const unsigned int CACell::theCellId
private

Definition at line 282 of file CACell.h.

Referenced by getCellId().

const int CACell::theDoubletId
private
const HitDoublets* CACell::theDoublets
private
const unsigned int CACell::theInnerHitId
private

Definition at line 280 of file CACell.h.

Referenced by getInnerHitId().

std::vector<CACell*> CACell::theInnerNeighbors
private

Definition at line 275 of file CACell.h.

Referenced by tagAsInnerNeighbor().

const float CACell::theInnerR
private

Definition at line 288 of file CACell.h.

Referenced by areAlignedRZ(), and getInnerR().

const float CACell::theInnerZ
private

Definition at line 290 of file CACell.h.

Referenced by areAlignedRZ(), and getInnerZ().

const unsigned int CACell::theOuterHitId
private

Definition at line 281 of file CACell.h.

Referenced by getOuterHitId().

std::vector<CACell*> CACell::theOuterNeighbors
private

Definition at line 276 of file CACell.h.

Referenced by evolve(), findNtuplets(), and tagAsOuterNeighbor().

const float CACell::theOuterR
private

Definition at line 289 of file CACell.h.

Referenced by areAlignedRZ(), and getOuterR().

const float CACell::theOuterZ
private

Definition at line 291 of file CACell.h.

Referenced by areAlignedRZ(), and getOuterZ().