175 for (Int_t row=1; row<=nrow; row++)
178 if (row==1 || row==nrow)
180 for (Int_t col=1; col<=ncol; col++)
225 Int_t nrows=(c.fPositions)->GetMaxRow();
226 Int_t ncols=(c.fPositions)->GetMaxColumn();
227 for (Int_t irow=1; irow<=nrows; irow++)
229 for (Int_t icol=1; icol<=ncols; icol++)
231 NcPosition* p=(NcPosition*)(c.fPositions->GetObject(irow,icol));
232 if (p) SetPosition(irow,icol,*p);
238 if (c.fAttributes) size=c.fAttributes->GetSize();
241 fAttributes=
new TObjArray(size);
242 fAttributes->SetOwner();
243 for (Int_t ia=0; ia<size; ia++)
254 fClusters=
new TObjArray();
255 fClusters->SetOwner();
256 for (Int_t icl=1; icl<=n; icl++)
264 for (Int_t iv=1; iv<=n; iv++)
267 if (s) AddVetoSignal(s);
310 cout <<
" *NcCalorimeter::SetSignal* row,col : " << row <<
"," << col
311 <<
" out of range." << endl;
366 cout <<
" *NcCalorimeter::AddSignal* row,col : " << row <<
"," << col
367 <<
" out of range." << endl;
408 cout <<
" *NcCalorimeter::AddSignal* row,col : " << row <<
"," << col
409 <<
" out of range." << endl;
466 cout <<
" *NcCalorimeter::Reset* row,col : " << row <<
"," << col
467 <<
" out of range." << endl;
476 fMatrix->RemoveObject(row,col);
499 if (mode<0 || mode>1)
501 cout <<
" *NcCalorimeter::Reset* Wrong argument. mode = " << mode << endl;
582 cout <<
" *NcCalorimeter::GetSignal* row,col : " << row <<
"," << col
583 <<
" out of range." << endl;
597 if (mode==0 || dead)
return signal;
620 signal=(signal/gain)-offset;
641 cout <<
" *NcCalorimeter::SetEdgeOn* row,col : " << row <<
"," << col
642 <<
" out of range." << endl;
684 cout <<
" *NcCalorimeter::SetEdgeOff* row,col : " << row <<
"," << col
685 <<
" out of range." << endl;
694 if (row <= fAttributes->GetSize())
716 cout <<
" *NcCalorimeter::SetDead* row,col : " << row <<
"," << col
717 <<
" out of range." << endl;
756 if (rlow < 1) rlow=row;
757 if (clow < 1) clow=col;
759 for (Int_t i=rlow; i<=rup; i++)
761 for (Int_t j=clow; j<=cup; j++)
763 if (i!=row || j!=col)
795 cout <<
" *NcCalorimeter::SetAlive* row,col : " << row <<
"," << col
796 <<
" out of range." << endl;
805 if (row <= fAttributes->GetSize())
821 if (rlow < 1) rlow=row;
822 if (clow < 1) clow=col;
824 for (Int_t i=rlow; i<=rup; i++)
826 for (Int_t j=clow; j<=cup; j++)
828 if (i!=row || j!=col)
830 if (i <= fAttributes->GetSize())
854 cout <<
" *NcCalorimeter::SetGain* row,col : " << row <<
"," << col
855 <<
" out of range." << endl;
898 cout <<
" *NcCalorimeter::SetOffset* row,col : " << row <<
"," << col
899 <<
" out of range." << endl;
954 cout <<
" *NcCalorimeter::SetPosition* row,col : " << row <<
"," << col
955 <<
" out of range." << endl;
996 cout <<
" *NcCalorimeter::GetEdgeValue* row,col : " << row <<
"," << col
997 <<
" out of range." << endl;
1006 if (row <= fAttributes->GetSize())
1036 cout <<
" *NcCalorimeter::GetDeadValue* row,col : " << row <<
"," << col
1037 <<
" out of range." << endl;
1046 if (row <= fAttributes->GetSize())
1076 cout <<
" *NcCalorimeter::GetGainFlag* row,col : " << row <<
"," << col
1077 <<
" out of range." << endl;
1086 if (row <= fAttributes->GetSize())
1116 cout <<
" *NcCalorimeter::GetOffsetFlag* row,col : " << row <<
"," << col
1117 <<
" out of range." << endl;
1126 if (row <= fAttributes->GetSize())
1159 cout <<
" *NcCalorimeter::GetGain* row,col : " << row <<
"," << col
1160 <<
" out of range." << endl;
1169 if (row <= fAttributes->GetSize())
1211 cout <<
" *NcCalorimeter::GetOffset* row,col : " << row <<
"," << col
1212 <<
" out of range." << endl;
1221 if (row <= fAttributes->GetSize())
1276 cout <<
" *NcCalorimeter::GetPosition* row,col : " << row <<
"," << col
1277 <<
" out of range." << endl;
1301 cout <<
" *NcCalorimeter::GetClusteredSignal* row,col : " << row <<
"," << col
1302 <<
" out of range." << endl;
1348 if (mode<1 || mode>2)
1350 cout <<
" *NcCalorimeter::Group* Invalid mode : " << mode << endl;
1351 cout <<
" Default value mode=1 will be used." << endl;
1371 if (mode==1)
SortM();
1372 if (mode==2)
SortA();
1383 for (Int_t i=0; i<nord; i++)
1396 if (!edge) c->
Start(*m);
1450 Int_t nrows=
fMatrix->GetMaxRow();
1451 Int_t ncols=
fMatrix->GetMaxColumn();
1455 for (Int_t irow=1; irow<=nrows; irow++)
1457 for (Int_t icol=1; icol<=ncols; icol++)
1463 if (signal <= 0.)
continue;
1477 for (Int_t j=0; j<=nord; j++)
1489 for (Int_t k=nord-1; k>j; k--)
1548 Int_t nrows=
fMatrix->GetMaxRow();
1549 Int_t ncols=
fMatrix->GetMaxColumn();
1555 Int_t lrow=row-1;
if (lrow < 1) lrow=1;
1556 Int_t urow=row+1;
if (urow > nrows) urow=nrows;
1557 Int_t lcol=col-1;
if (lcol < 1) lcol=1;
1558 Int_t ucol=col+1;
if (ucol > ncols) ucol=ncols;
1560 for (Int_t i=lrow; i<=urow; i++)
1562 for (Int_t j=lcol; j<=ucol; j++)
1606 cout <<
" *NcCalorimeter::GetCluster* cluster number : " << j
1607 <<
" out of range ==> 0 returned." << endl;
1657 if (
fMatrix && !nrows && !ncols)
1660 ncols=
fMatrix->GetMaxColumn();
1669 fHmodules=
new TH2F(
"fHmodules",
"Module signals",
1670 ncols,0.5,
float(ncols)+0.5,nrows,0.5,
float(nrows)+0.5);
1680 for (Int_t i=1; i<=nmods; i++)
1689 if (!dead) signal=
GetSignal(row,col,mode);
1690 if (signal>thresh)
fHmodules->Fill(
float(col),
float(row),signal);
1713 if (
fMatrix && !nrows && !ncols)
1716 ncols=
fMatrix->GetMaxColumn();
1725 fHclusters=
new TH2F(
"fHclusters",
"Cluster signals",
1726 ncols,0.5,
float(ncols)+0.5,nrows,0.5,
float(nrows)+0.5);
1742 if (signal>thresh)
fHclusters->Fill(
float(col),
float(row),signal);
1765 for (Int_t j=1; j<=nsig; j++)
1823 cout <<
" *NcCalorimeter::GetVetoSignal* Signal number " << i
1824 <<
" out of range ==> 0 returned." << endl;
1839 if (swap==0 || swap==1)
1845 cout <<
" *NcCalorimeter::SetMatrixSwapMode* Invalid argument : swap = " << swap << endl;
1878 for (Int_t i=1; i<=nhits; i++)
1885 fMatrix->EnterObject(row,col,m);
1905 if (strlen(name)) cal->SetName(name);
Handling of 3-vectors in various reference frames.
void SetVector(Double_t *v, TString f, TString u="rad")
virtual void Load(Nc3Vector &q)
void GetVector(Double_t *v, TString f, TString u="rad") const
Float_t GetGain(Int_t j=1) const
Int_t GetNcalflags() const
void DecreaseEdgeValue(Int_t j=1)
void SetEdgeOn(Int_t j=1)
Int_t GetGainFlag(Int_t j=1) const
Int_t GetDeadValue(Int_t j=1) const
void SetOffset(Double_t off, Int_t j=1)
Float_t GetOffset(Int_t j=1) const
void SetEdgeOff(Int_t j=1)
void SetEdgeValue(Int_t val, Int_t j=1)
Int_t GetOffsetFlag(Int_t j=1) const
void IncreaseEdgeValue(Int_t j=1)
void SetGain(Double_t gain, Int_t j=1)
Int_t GetEdgeValue(Int_t j=1) const
Generic handling of detector signal (calibration) attributes.
Description of a cluster of calorimeter modules.
Int_t GetNmodules() const
void Start(NcCalmodule &m)
Description of a module in a calorimeter system.
Float_t GetClusteredSignal() const
virtual void AddSignal(Double_t sig, Int_t j=1)
virtual void SetSignal(Double_t sig, Int_t j=1)
void SetClusteredSignal(Double_t val)
Description of a modular calorimeter system.
void SetAlive(Int_t row, Int_t col)
TH2F * fHmodules
! The module 2-D histogram for event display
void SetDead(Int_t row, Int_t col)
TH2F * fHclusters
! The cluster 2-D histogram for event display
Float_t GetGain(Int_t row, Int_t col)
void SetEdgeOn(Int_t row, Int_t col)
void SetSignal(Int_t row, Int_t col, Float_t s)
void SetEdgeOff(Int_t row, Int_t col)
NcCalcluster * GetCluster(Int_t j) const
TH2F * DrawClusters(Float_t thresh=0.)
Int_t GetNclusters() const
Float_t GetClusteredSignal(Int_t row, Int_t col)
void SetMatrixSwapMode(Int_t swap=1)
Float_t GetOffset(Int_t row, Int_t col)
void SetOffset(Int_t row, Int_t col, Float_t o)
Int_t GetNsignals() const
TH2F * DrawModules(Float_t thresh=0., Int_t mode=0)
TObjArray * fAttributes
! Matrix dbase with module attributes (e.g. gain, offset etc...)
Int_t GetGainFlag(Int_t row, Int_t col)
NcCalmodule * GetModule(Int_t j) const
void SetGain(Int_t row, Int_t col, Float_t g)
void SetPosition(Int_t row, Int_t col, Float_t *r, TString f)
void AddVetoSignal(NcSignal &s)
Int_t GetOffsetFlag(Int_t row, Int_t col)
Int_t GetMatrixSwapMode() const
virtual Float_t GetSignal(Int_t row, Int_t col=0)
Int_t GetEdgeValue(Int_t row, Int_t col)
void AddSignal(Int_t row, Int_t col, Float_t s)
virtual TObject * Clone(const char *name="") const
void Group(Int_t n=1, Int_t mode=1)
NcObjMatrix * fPositions
! Matrix dbase of module position pointers
NcSignal * GetVetoSignal(Int_t j) const
void AddRing(Int_t row, Int_t col, Int_t n)
Int_t GetDeadValue(Int_t row, Int_t col)
NcObjMatrix * fMatrix
! Matrix lookup table of module pointers
void Reset(Int_t row, Int_t col)
void RemoveHit(NcSignal &s)
NcDevice(const char *name="", const char *title="")
TObjArray * fOrdered
! Temp. array to hold the ordered hits
NcSignal * GetHit(Int_t j) const
virtual void Reset(Int_t mode=0)
TObjArray * SortHits(TString name, Int_t mode=-1, TObjArray *hits=0, Int_t mcal=1, Int_t deadcheck=1, TObjArray *ordered=0)
Handling of a matrix structure of objects.
NcPosition & GetPosition()
void SetPosition(Double_t *r, TString f, TString u="rad")
Handling of positions in various reference frames.
Generic handling of (extrapolated) detector signals.
virtual Float_t GetSignal(Int_t j=1, Int_t mode=0) const
NcSignal(const char *name="", const char *title="")