CMS 3D CMS Logo

List of all members | Classes | Public Types | Public Member Functions | Static Public Attributes | Private Member Functions | Static Private Member Functions | Private Attributes
FTLCluster Class Reference

#include <FTLCluster.h>

Classes

class  FTLHit
 
class  FTLHitPos
 
class  Shift
 

Public Types

typedef DetId key_type
 

Public Member Functions

int colSpan () const
 
const DetIddetid () const
 
float energy () const
 
 FTLCluster ()
 
 FTLCluster (DetId id, unsigned int isize, float const *energys, float const *times, float const *time_errors, uint16_t const *xpos, uint16_t const *ypos, uint16_t const xmin, uint16_t const ymin)
 
float getClusterErrorTime () const
 
float getClusterErrorX () const
 
float getClusterErrorY () const
 
FTLHit hit (int i) const
 
const std::vector< float > & hitENERGY () const
 
const std::vector< uint8_t > & hitOffset () const
 
const std::vector< float > & hitTIME () const
 
const std::vector< float > & hitTIME_ERROR () const
 
const DetIdid () const
 
int maxHitCol () const
 
int maxHitRow () const
 
int minHitCol () const
 
int minHitRow () const
 
bool overflow () const
 
bool overflowCol () const
 
bool overflowRow () const
 
void packCol (uint16_t ymin, uint16_t yspan)
 
void packRow (uint16_t xmin, uint16_t xspan)
 
int rowSpan () const
 
FTLHit seed () const
 
void setClusterErrorTime (float errtime)
 
void setClusterErrorX (float errx)
 
void setClusterErrorY (float erry)
 
int size () const
 
int sizeX () const
 
int sizeY () const
 
float time () const
 
float timeError () const
 
float x () const
 
float y () const
 

Static Public Attributes

static constexpr unsigned int MAXPOS =2047
 
static constexpr unsigned int MAXSPAN =255
 

Private Member Functions

float weighted_mean (const std::vector< float > &weights, const std::function< float(unsigned int)> &value) const
 
float weighted_mean_error (const std::vector< float > &weights, const std::function< float(unsigned int)> &err) const
 
float weighted_sum (const std::vector< float > &weights, const std::function< float(unsigned int i)> &sumFunc, const std::function< float(float, float)> &outFunc) const
 

Static Private Member Functions

static int overflow_ (uint16_t span)
 

Private Attributes

float err_time =-99999.9f
 
float err_x =-99999.9f
 
float err_y =-99999.9f
 
uint8_t seed_
 
uint8_t theHitColSpan =0
 
std::vector< float > theHitENERGY
 
std::vector< uint8_t > theHitOffset
 
uint8_t theHitRowSpan =0
 
std::vector< float > theHitTIME
 
std::vector< float > theHitTIME_ERROR
 
DetId theid
 
uint16_t theMinHitCol =MAXPOS
 
uint16_t theMinHitRow =MAXPOS
 

Detailed Description

based on SiPixelCluster

Author
Paolo Meridiani

Definition at line 21 of file FTLCluster.h.

Member Typedef Documentation

Definition at line 24 of file FTLCluster.h.

Constructor & Destructor Documentation

FTLCluster::FTLCluster ( )
inline

Construct from a range of digis that form a cluster and from a DetID. The range is assumed to be non-empty.

Definition at line 77 of file FTLCluster.h.

77 {}
FTLCluster::FTLCluster ( DetId  id,
unsigned int  isize,
float const *  energys,
float const *  times,
float const *  time_errors,
uint16_t const *  xpos,
uint16_t const *  ypos,
uint16_t const  xmin,
uint16_t const  ymin 
)
inline

Definition at line 79 of file FTLCluster.h.

References mps_fire::i, particleFlowClusterECALTimeSelected_cfi::maxEnergy, MTVHistoProducerAlgoForTrackerBlock_cfi::maxHit, min(), packCol(), packRow(), seed_, theHitENERGY, theHitOffset, TrackerOfflineValidation_Dqm_cff::xmin, and Phase2TrackerMonitorDigi_cff::ymin.

81  :
82  theid(id), theHitOffset(2*isize), theHitENERGY(energys,energys+isize), theHitTIME(times,times+isize), theHitTIME_ERROR(time_errors,time_errors+isize) {
83  uint16_t maxCol = 0;
84  uint16_t maxRow = 0;
85  int maxHit=-1;
86  float maxEnergy=-99999;
87  for (unsigned int i=0; i!=isize; ++i) {
88  uint16_t xoffset = xpos[i]-xmin;
89  uint16_t yoffset = ypos[i]-ymin;
90  theHitOffset[i*2] = std::min(uint16_t(MAXSPAN),xoffset);
91  theHitOffset[i*2+1] = std::min(uint16_t(MAXSPAN),yoffset);
92  if (xoffset > maxRow) maxRow = xoffset;
93  if (yoffset > maxCol) maxCol = yoffset;
94  if (theHitENERGY[i]>maxEnergy)
95  {
96  maxHit=i;
97  maxEnergy=theHitENERGY[i];
98  }
99  }
100  packRow(xmin,maxRow);
101  packCol(ymin,maxCol);
102 
103  if (maxHit>=0)
104  seed_=std::min(uint8_t(MAXSPAN),uint8_t(maxHit));
105  }
std::vector< float > theHitTIME_ERROR
Definition: FTLCluster.h:203
static constexpr unsigned int MAXSPAN
Definition: FTLCluster.h:71
void packCol(uint16_t ymin, uint16_t yspan)
Definition: FTLCluster.h:180
std::vector< uint8_t > theHitOffset
Definition: FTLCluster.h:200
std::vector< float > theHitTIME
Definition: FTLCluster.h:202
void packRow(uint16_t xmin, uint16_t xspan)
Definition: FTLCluster.h:184
T min(T a, T b)
Definition: MathUtil.h:58
DetId theid
Definition: FTLCluster.h:198
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
uint8_t seed_
Definition: FTLCluster.h:214

Member Function Documentation

int FTLCluster::colSpan ( ) const
inline

Definition at line 167 of file FTLCluster.h.

References theHitColSpan.

Referenced by maxHitCol(), and sizeY().

167 {return theHitColSpan; }
uint8_t theHitColSpan
Definition: FTLCluster.h:208
const DetId& FTLCluster::detid ( ) const
inline

Definition at line 172 of file FTLCluster.h.

References id().

Referenced by operator<().

172 { return id(); }
const DetId & id() const
Definition: FTLCluster.h:171
float FTLCluster::energy ( ) const
inline

Definition at line 138 of file FTLCluster.h.

References theHitENERGY.

Referenced by MTDThresholdClusterizer::clusterize(), MTDTrackingRecHit::energy(), MTDThresholdClusterizer::make_cluster(), and Jet.Jet::rawEnergy().

138  {
139  return std::accumulate(theHitENERGY.begin(), theHitENERGY.end(),0.f);
140  } // Return total cluster energy.
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
float FTLCluster::getClusterErrorTime ( ) const
inline

Definition at line 194 of file FTLCluster.h.

References err_time.

194 { return err_time; }
float err_time
Definition: FTLCluster.h:212
float FTLCluster::getClusterErrorX ( ) const
inline

Definition at line 192 of file FTLCluster.h.

References err_x.

192 { return err_x; }
float err_x
Definition: FTLCluster.h:210
float FTLCluster::getClusterErrorY ( ) const
inline

Definition at line 193 of file FTLCluster.h.

References err_y.

193 { return err_y; }
float err_y
Definition: FTLCluster.h:211
FTLHit FTLCluster::hit ( int  i) const
inline

Definition at line 153 of file FTLCluster.h.

References FTLCluster::FTLHit::FTLHit(), minHitCol(), minHitRow(), theHitENERGY, theHitOffset, theHitTIME, and theHitTIME_ERROR.

Referenced by seed().

153  {
154  return FTLHit(minHitRow() + theHitOffset[i*2],
155  minHitCol() + theHitOffset[i*2+1],
156  theHitENERGY[i],
157  theHitTIME[i],
159  );
160 
161  }
int minHitRow() const
Definition: FTLCluster.h:142
std::vector< float > theHitTIME_ERROR
Definition: FTLCluster.h:203
std::vector< uint8_t > theHitOffset
Definition: FTLCluster.h:200
std::vector< float > theHitTIME
Definition: FTLCluster.h:202
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
int minHitCol() const
Definition: FTLCluster.h:144
const std::vector<float>& FTLCluster::hitENERGY ( ) const
inline

Definition at line 148 of file FTLCluster.h.

References theHitENERGY.

148 { return theHitENERGY;}
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
const std::vector<uint8_t>& FTLCluster::hitOffset ( ) const
inline

Definition at line 147 of file FTLCluster.h.

References theHitOffset.

147 { return theHitOffset;}
std::vector< uint8_t > theHitOffset
Definition: FTLCluster.h:200
const std::vector<float>& FTLCluster::hitTIME ( ) const
inline

Definition at line 149 of file FTLCluster.h.

References theHitTIME.

149 { return theHitTIME;}
std::vector< float > theHitTIME
Definition: FTLCluster.h:202
const std::vector<float>& FTLCluster::hitTIME_ERROR ( ) const
inline

Definition at line 150 of file FTLCluster.h.

References theHitTIME_ERROR.

150 { return theHitTIME_ERROR;}
std::vector< float > theHitTIME_ERROR
Definition: FTLCluster.h:203
const DetId& FTLCluster::id ( ) const
inline

Definition at line 171 of file FTLCluster.h.

References theid.

Referenced by detid().

171 { return theid; }
DetId theid
Definition: FTLCluster.h:198
int FTLCluster::maxHitCol ( ) const
inline

Definition at line 145 of file FTLCluster.h.

References colSpan(), and minHitCol().

145 { return minHitCol() + colSpan();} // The max y index.
int minHitCol() const
Definition: FTLCluster.h:144
int colSpan() const
Definition: FTLCluster.h:167
int FTLCluster::maxHitRow ( ) const
inline

Definition at line 143 of file FTLCluster.h.

References minHitRow(), and rowSpan().

143 { return minHitRow() + rowSpan();} // The max x index.
int minHitRow() const
Definition: FTLCluster.h:142
int rowSpan() const
Definition: FTLCluster.h:169
int FTLCluster::minHitCol ( ) const
inline

Definition at line 144 of file FTLCluster.h.

References theMinHitCol.

Referenced by hit(), maxHitCol(), operator<(), and y().

144 { return theMinHitCol;} // The min y index.
uint16_t theMinHitCol
Definition: FTLCluster.h:206
int FTLCluster::minHitRow ( ) const
inline

Definition at line 142 of file FTLCluster.h.

References theMinHitRow.

Referenced by hit(), maxHitRow(), operator<(), and x().

142 { return theMinHitRow;} // The min x index.
uint16_t theMinHitRow
Definition: FTLCluster.h:205
bool FTLCluster::overflow ( ) const
inline

Definition at line 178 of file FTLCluster.h.

References overflowCol(), and overflowRow().

178 { return overflowCol() || overflowRow(); }
bool overflowCol() const
Definition: FTLCluster.h:174
bool overflowRow() const
Definition: FTLCluster.h:176
static int FTLCluster::overflow_ ( uint16_t  span)
inlinestaticprivate

Definition at line 242 of file FTLCluster.h.

Referenced by overflowCol(), and overflowRow().

242 { return span==uint16_t(MAXSPAN);}
static constexpr unsigned int MAXSPAN
Definition: FTLCluster.h:71
bool FTLCluster::overflowCol ( ) const
inline

Definition at line 174 of file FTLCluster.h.

References overflow_(), and theHitColSpan.

Referenced by overflow().

174 { return overflow_(theHitColSpan); }
uint8_t theHitColSpan
Definition: FTLCluster.h:208
static int overflow_(uint16_t span)
Definition: FTLCluster.h:242
bool FTLCluster::overflowRow ( ) const
inline

Definition at line 176 of file FTLCluster.h.

References overflow_(), and theHitRowSpan.

Referenced by overflow().

176 { return overflow_(theHitRowSpan); }
uint8_t theHitRowSpan
Definition: FTLCluster.h:207
static int overflow_(uint16_t span)
Definition: FTLCluster.h:242
void FTLCluster::packCol ( uint16_t  ymin,
uint16_t  yspan 
)
inline

Definition at line 180 of file FTLCluster.h.

References min(), theHitColSpan, theMinHitCol, and Phase2TrackerMonitorDigi_cff::ymin.

Referenced by FTLCluster().

180  {
181  theMinHitCol = ymin;
182  theHitColSpan = std::min(yspan, uint16_t(MAXSPAN));
183  }
uint16_t theMinHitCol
Definition: FTLCluster.h:206
uint8_t theHitColSpan
Definition: FTLCluster.h:208
static constexpr unsigned int MAXSPAN
Definition: FTLCluster.h:71
T min(T a, T b)
Definition: MathUtil.h:58
void FTLCluster::packRow ( uint16_t  xmin,
uint16_t  xspan 
)
inline

Definition at line 184 of file FTLCluster.h.

References min(), theHitRowSpan, theMinHitRow, and TrackerOfflineValidation_Dqm_cff::xmin.

Referenced by FTLCluster().

184  {
185  theMinHitRow = xmin;
186  theHitRowSpan = std::min(xspan, uint16_t(MAXSPAN));
187  }
uint8_t theHitRowSpan
Definition: FTLCluster.h:207
static constexpr unsigned int MAXSPAN
Definition: FTLCluster.h:71
uint16_t theMinHitRow
Definition: FTLCluster.h:205
T min(T a, T b)
Definition: MathUtil.h:58
int FTLCluster::rowSpan ( ) const
inline

Definition at line 169 of file FTLCluster.h.

References theHitRowSpan.

Referenced by maxHitRow(), and sizeX().

169 { return theHitRowSpan; }
uint8_t theHitRowSpan
Definition: FTLCluster.h:207
FTLHit FTLCluster::seed ( ) const
inline

Definition at line 163 of file FTLCluster.h.

References hit(), and seed_.

163  {
164  return hit(seed_);
165  }
FTLHit hit(int i) const
Definition: FTLCluster.h:153
uint8_t seed_
Definition: FTLCluster.h:214
void FTLCluster::setClusterErrorTime ( float  errtime)
inline

Definition at line 191 of file FTLCluster.h.

References err_time.

191 { err_time = errtime; }
float err_time
Definition: FTLCluster.h:212
void FTLCluster::setClusterErrorX ( float  errx)
inline

Definition at line 189 of file FTLCluster.h.

References err_x.

189 { err_x = errx; }
float err_x
Definition: FTLCluster.h:210
void FTLCluster::setClusterErrorY ( float  erry)
inline

Definition at line 190 of file FTLCluster.h.

References err_y.

190 { err_y = erry; }
float err_y
Definition: FTLCluster.h:211
int FTLCluster::size ( void  ) const
inline

Definition at line 129 of file FTLCluster.h.

References theHitENERGY.

Referenced by ntupleDataFormat._Collection::__iter__(), ntupleDataFormat._Collection::__len__(), and MTDThresholdClusterizer::clusterize().

129 { return theHitENERGY.size();}
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
int FTLCluster::sizeX ( ) const
inline

Definition at line 132 of file FTLCluster.h.

References rowSpan().

132 { return rowSpan() +1;}
int rowSpan() const
Definition: FTLCluster.h:169
int FTLCluster::sizeY ( ) const
inline

Definition at line 135 of file FTLCluster.h.

References colSpan().

135 { return colSpan() +1;}
int colSpan() const
Definition: FTLCluster.h:167
float FTLCluster::time ( ) const
inline

Definition at line 118 of file FTLCluster.h.

References mps_fire::i, protons_cff::t, theHitENERGY, theHitTIME, and weighted_mean().

Referenced by MTDThresholdClusterizer::clusterize(), MTDCPEBase::clusterTime(), and MTDTrackingRecHit::time().

118  {
119  auto t=[this](unsigned int i) { return this->theHitTIME[i]; };
120  return weighted_mean(this->theHitENERGY,t);
121  }
std::vector< float > theHitTIME
Definition: FTLCluster.h:202
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
float weighted_mean(const std::vector< float > &weights, const std::function< float(unsigned int)> &value) const
Definition: FTLCluster.h:228
float FTLCluster::timeError ( ) const
inline

Definition at line 123 of file FTLCluster.h.

References mps_fire::i, theHitENERGY, theHitTIME_ERROR, and weighted_mean_error().

Referenced by MTDCPEBase::clusterTimeError(), and MTDTrackingRecHit::timeError().

123  {
124  auto t_err=[this](unsigned int i) { return this->theHitTIME_ERROR[i]; };
125  return weighted_mean_error(this->theHitENERGY,t_err);
126  }
std::vector< float > theHitTIME_ERROR
Definition: FTLCluster.h:203
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
float weighted_mean_error(const std::vector< float > &weights, const std::function< float(unsigned int)> &err) const
Definition: FTLCluster.h:235
float FTLCluster::weighted_mean ( const std::vector< float > &  weights,
const std::function< float(unsigned int)> &  value 
) const
inlineprivate

Definition at line 228 of file FTLCluster.h.

References mps_fire::i, relativeConstraints::value, weighted_sum(), HGCalRecHit_cfi::weights, FTLCluster::FTLHit::x(), and FTLCluster::FTLHit::y().

Referenced by time(), x(), and y().

229  {
230  auto sumFunc=[&weights,value](unsigned int i) { return weights[i]*value(i); } ;
231  auto outFunc=[](float x,float y) { if (y>0) return (float)x/y; else return -999.f; };
232  return weighted_sum(weights,sumFunc,outFunc);
233  }
float y() const
Definition: FTLCluster.h:113
float x() const
Definition: FTLCluster.h:108
float weighted_sum(const std::vector< float > &weights, const std::function< float(unsigned int i)> &sumFunc, const std::function< float(float, float)> &outFunc) const
Definition: FTLCluster.h:216
float FTLCluster::weighted_mean_error ( const std::vector< float > &  weights,
const std::function< float(unsigned int)> &  err 
) const
inlineprivate

Definition at line 235 of file FTLCluster.h.

References mps_fire::i, mathSSE::sqrt(), weighted_sum(), HGCalRecHit_cfi::weights, FTLCluster::FTLHit::x(), and FTLCluster::FTLHit::y().

Referenced by timeError().

236  {
237  auto sumFunc=[&weights,err](unsigned int i) { return weights[i]*weights[i]*err(i)*err(i); } ;
238  auto outFunc=[](float x,float y) { if (y>0) return (float)sqrt(x)/y; else return -999.f; };
239  return weighted_sum(weights,sumFunc,outFunc);
240  }
float y() const
Definition: FTLCluster.h:113
float x() const
Definition: FTLCluster.h:108
T sqrt(T t)
Definition: SSEVec.h:18
float weighted_sum(const std::vector< float > &weights, const std::function< float(unsigned int i)> &sumFunc, const std::function< float(float, float)> &outFunc) const
Definition: FTLCluster.h:216
float FTLCluster::weighted_sum ( const std::vector< float > &  weights,
const std::function< float(unsigned int i)> &  sumFunc,
const std::function< float(float, float)> &  outFunc 
) const
inlineprivate

Definition at line 216 of file FTLCluster.h.

References mps_fire::i.

Referenced by weighted_mean(), and weighted_mean_error().

217  {
218  float tot=0;
219  float sumW=0;
220  for (unsigned int i=0; i<weights.size(); ++i)
221  {
222  tot += sumFunc(i);
223  sumW += weights[i];
224  }
225  return outFunc(tot,sumW);
226  }
float FTLCluster::x ( ) const
inline

Definition at line 108 of file FTLCluster.h.

References mps_fire::i, minHitRow(), theHitENERGY, theHitOffset, and weighted_mean().

Referenced by svgfig.Curve.Sample::__repr__(), svgfig.Ellipse::__repr__(), Vispa.Gui.WidgetContainer.WidgetContainer::autosize(), Vispa.Gui.VispaWidget.VispaWidget::boundingRect(), MTDThresholdClusterizer::clusterize(), MTDCPEBase::localError(), MTDCPEBase::localPosition(), geometryXMLparser.Alignable::pos(), Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), ntupleDataFormat._HitObject::r(), and ntupleDataFormat._HitObject::r3D().

108  {
109  auto x_pos=[this](unsigned int i) { return this->theHitOffset[i*2] + minHitRow() + 0.5f; };
110  return weighted_mean(this->theHitENERGY,x_pos);
111  }
int minHitRow() const
Definition: FTLCluster.h:142
std::vector< uint8_t > theHitOffset
Definition: FTLCluster.h:200
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
float weighted_mean(const std::vector< float > &weights, const std::function< float(unsigned int)> &value) const
Definition: FTLCluster.h:228
float FTLCluster::y ( ) const
inline

Definition at line 113 of file FTLCluster.h.

References mps_fire::i, minHitCol(), theHitENERGY, theHitOffset, and weighted_mean().

Referenced by svgfig.Ellipse::__repr__(), Vispa.Gui.WidgetContainer.WidgetContainer::autosize(), Vispa.Gui.VispaWidget.VispaWidget::boundingRect(), MTDThresholdClusterizer::clusterize(), MTDCPEBase::localError(), MTDCPEBase::localPosition(), geometryXMLparser.Alignable::pos(), Vispa.Gui.ConnectableWidget.ConnectableWidget::positionizeMenuWidget(), ntupleDataFormat._HitObject::r(), and ntupleDataFormat._HitObject::r3D().

113  {
114  auto y_pos=[this](unsigned int i) { return this->theHitOffset[i*2+1] + minHitCol() + 0.5f; };
115  return weighted_mean(this->theHitENERGY,y_pos);
116  }
std::vector< uint8_t > theHitOffset
Definition: FTLCluster.h:200
std::vector< float > theHitENERGY
Definition: FTLCluster.h:201
int minHitCol() const
Definition: FTLCluster.h:144
float weighted_mean(const std::vector< float > &weights, const std::function< float(unsigned int)> &value) const
Definition: FTLCluster.h:228

Member Data Documentation

float FTLCluster::err_time =-99999.9f
private

Definition at line 212 of file FTLCluster.h.

Referenced by getClusterErrorTime(), and setClusterErrorTime().

float FTLCluster::err_x =-99999.9f
private

Definition at line 210 of file FTLCluster.h.

Referenced by getClusterErrorX(), and setClusterErrorX().

float FTLCluster::err_y =-99999.9f
private

Definition at line 211 of file FTLCluster.h.

Referenced by getClusterErrorY(), and setClusterErrorY().

constexpr unsigned int FTLCluster::MAXPOS =2047
static

Definition at line 72 of file FTLCluster.h.

constexpr unsigned int FTLCluster::MAXSPAN =255
static

Definition at line 71 of file FTLCluster.h.

uint8_t FTLCluster::seed_
private

Definition at line 214 of file FTLCluster.h.

Referenced by FTLCluster(), and seed().

uint8_t FTLCluster::theHitColSpan =0
private

Definition at line 208 of file FTLCluster.h.

Referenced by colSpan(), overflowCol(), and packCol().

std::vector<float> FTLCluster::theHitENERGY
private

Definition at line 201 of file FTLCluster.h.

Referenced by energy(), FTLCluster(), hit(), hitENERGY(), size(), time(), timeError(), x(), and y().

std::vector<uint8_t> FTLCluster::theHitOffset
private

Definition at line 200 of file FTLCluster.h.

Referenced by FTLCluster(), hit(), hitOffset(), x(), and y().

uint8_t FTLCluster::theHitRowSpan =0
private

Definition at line 207 of file FTLCluster.h.

Referenced by overflowRow(), packRow(), and rowSpan().

std::vector<float> FTLCluster::theHitTIME
private

Definition at line 202 of file FTLCluster.h.

Referenced by hit(), hitTIME(), and time().

std::vector<float> FTLCluster::theHitTIME_ERROR
private

Definition at line 203 of file FTLCluster.h.

Referenced by hit(), hitTIME_ERROR(), and timeError().

DetId FTLCluster::theid
private

Definition at line 198 of file FTLCluster.h.

Referenced by id().

uint16_t FTLCluster::theMinHitCol =MAXPOS
private

Definition at line 206 of file FTLCluster.h.

Referenced by minHitCol(), and packCol().

uint16_t FTLCluster::theMinHitRow =MAXPOS
private

Definition at line 205 of file FTLCluster.h.

Referenced by minHitRow(), and packRow().