ClassImp(AliCalorimeter) // Class implementation to enable ROOT I/O
-AliCalorimeter::AliCalorimeter() : TObject()
+AliCalorimeter::AliCalorimeter() : TNamed()
{
// Default constructor, all parameters set to 0.
// Create a calorimeter module matrix with fixed row and column size.
fVetos=0;
fAttributes=0;
fPositions=0;
- fName="Unspecified AliCalorimeter";
+ SetName("Unspecified");
+ SetTitle("Unspecified");
}
///////////////////////////////////////////////////////////////////////////
AliCalorimeter::~AliCalorimeter()
}
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter::AliCalorimeter(Int_t nrow,Int_t ncol) : TObject()
+AliCalorimeter::AliCalorimeter(Int_t nrow,Int_t ncol) : TNamed()
{
// Create a calorimeter module matrix with fixed row and column size.
// The modules at the edges are automatically marked as "edge modules".
fVetos=0;
- fName="Unspecified AliCalorimeter";
+ SetName("Unspecified");
+ SetTitle("Unspecified");
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter::AliCalorimeter(AliCalorimeter& c) : TObject(c)
+AliCalorimeter::AliCalorimeter(AliCalorimeter& c) : TNamed(c)
{
// Copy constructor
fClusters=0;
fNrows=c.fNrows;
fNcolumns=c.fNcolumns;
- fName=c.fName;
fSwap=c.fSwap;
if (!m) // initialise for a new module
{
m=new AliCalmodule();
+ m->SetRow(row);
+ m->SetColumn(col);
AliPosition* r=0;
if (fPositions) r=(AliPositionObj*)fPositions->GetObject(row,col);
if (r) m->SetPosition(*r);
fMatrix->EnterObject(row,col,m);
}
- m->SetSignal(row,col,sig);
+ m->SetSignal(sig);
}
///////////////////////////////////////////////////////////////////////////
void AliCalorimeter::AddSignal(Int_t row, Int_t col, Float_t sig)
}
else
{
- m->AddSignal(row,col,sig);
+ m->AddSignal(sig);
}
}
///////////////////////////////////////////////////////////////////////////
}
else
{
- m->AddSignal(row,col,sig);
+ m->AddSignal(sig);
}
}
///////////////////////////////////////////////////////////////////////////
Int_t nmods=GetNsignals();
- Float_t row,col,signal;
+ Int_t row,col;
+ Float_t signal;
Int_t dead;
for (Int_t i=1; i<=nmods; i++)
{
AliCalmodule* m=(AliCalmodule*)fMatrix->GetObject(i);
if (m)
{
- row=float(m->GetRow());
- col=float(m->GetColumn());
+ row=m->GetRow();
+ col=m->GetColumn();
dead=m->GetDeadValue();
signal=0;
if (!dead) signal=GetSignal(row,col,mode);
- if (signal>thresh) fHmodules->Fill(col,row,signal);
+ if (signal>thresh) fHmodules->Fill(float(col),float(row),signal);
}
}
}
AliCalcluster* c;
- Float_t row,col,signal;
+ Int_t row,col;
+ Float_t signal;
for (Int_t i=0; i<GetNclusters(); i++)
{
c=(AliCalcluster*)fClusters->At(i);
if (c)
{
- row=float(c->GetRow());
- col=float(c->GetColumn());
+ row=c->GetRow();
+ col=c->GetColumn();
signal=c->GetSignal();
- if (signal>thresh) fHclusters->Fill(col,row,signal);
+ if (signal>thresh) fHclusters->Fill(float(col),float(row),signal);
}
}
}
}
///////////////////////////////////////////////////////////////////////////
-void AliCalorimeter::SetName(TString name)
-{
-// Set the name of the calorimeter system.
- fName=name;
-}
-///////////////////////////////////////////////////////////////////////////
-TString AliCalorimeter::GetName()
-{
-// Provide the name of the calorimeter system.
- return fName;
-}
-///////////////////////////////////////////////////////////////////////////
void AliCalorimeter::SetSwapMode(Int_t swap)
{
// Set the swap mode for the module and position matrices.
return fSwap;
}
///////////////////////////////////////////////////////////////////////////
-AliCalorimeter* AliCalorimeter::MakeCopy(AliCalorimeter& c)
+TObject* AliCalorimeter::Clone(const char* name)
{
-// Make a deep copy of the input object and provide the pointer to the copy.
+// Make a deep copy of the current object and provide the pointer to the copy.
// This memberfunction enables automatic creation of new objects of the
-// correct type depending on the argument type, a feature which may be very useful
+// correct type depending on the object type, a feature which may be very useful
// for containers like AliEvent when adding objects in case the
// container owns the objects.
- AliCalorimeter* cal=new AliCalorimeter(c);
+ AliCalorimeter* cal=new AliCalorimeter(*this);
+ if (name)
+ {
+ if (strlen(name)) cal->SetName(name);
+ }
return cal;
}
///////////////////////////////////////////////////////////////////////////