]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PHOS/AliPHOSConTableDB.cxx
Polishing to fulfill coding conventions
[u/mrichter/AliRoot.git] / PHOS / AliPHOSConTableDB.cxx
index f2dea016a35bdbc0263b505be553b720abdfede7..bbe2f9be97e70effa1b9a0398a5fe1f0435b7564 100644 (file)
 /* $Id$ */
 
 //_________________________________________________________________________
-// Short description  
+// Class provides correspondence between "raw numbers" i.e. number of crustall 
+// in prototype and PHOT AbsId numer, used in reconstruction.
+// First it calculates correspondence automatically, assuming, that 
+// prototype, having N raws and M columns is situated in the center 
+// of middle (third) PHOS module. Then this correspondence can be edited 
+// manually. One can convert Raw->AbsId and visa versa AbsId->RawId.
 //
-//*-- Author :  (SUBATECH
+//*-- Author :  D.Peressounko ("RRC Kurchatov Institute"
 //////////////////////////////////////////////////////////////////////////////
 
 // --- ROOT system ---
@@ -37,6 +42,7 @@ ClassImp(AliPHOSConTableDB)
 //____________________________________________________________________________ 
   AliPHOSConTableDB::AliPHOSConTableDB():TNamed("AliPHOSConTableDB","Beamtest2002") 
 {
+//default constructor, nothing created.
   fNcrInProto = 0 ;
   fProtoRaws = 0 ;
   fProtoColumns = 0 ;
@@ -50,6 +56,7 @@ ClassImp(AliPHOSConTableDB)
 //____________________________________________________________________________ 
   AliPHOSConTableDB::AliPHOSConTableDB(const char * title):TNamed("AliPHOSConTableDB",title) 
 {
+ //Normally used constructor 
   fNcrInProto = 0 ;
   fProtoRaws = 0 ;
   fProtoColumns = 0 ;
@@ -58,10 +65,24 @@ ClassImp(AliPHOSConTableDB)
   fAbsIdMap = 0 ;
   fRawIdMap = 0 ;
 
-  fGeom = AliPHOSGeometry::GetInstance("GPS2","") ;
+  fGeom = AliPHOSGeometry::GetInstance("IHEP","") ;
 
 }
+//____________________________________________________________________________ 
+  AliPHOSConTableDB::AliPHOSConTableDB(const AliPHOSConTableDB* cdb){
+//Copy constructor
+
+  fProtoRaws=cdb->fProtoRaws ;        //  Parameters
+  fProtoColumns=cdb->fProtoColumns ;     //  used to calculate
+  fRawOffset=cdb->fRawOffset ;        //  correspondance
+  fColOffset=cdb->fColOffset ;        //  map
+  fNcrInProto=cdb->fNcrInProto ;       //Number of channels in prototype
+  fMinAbsId=cdb->fMinAbsId ;         //Minimal AbsId, corresponding to some prototype cristall.
+  fMaxAbsId=cdb->fMaxAbsId ;         //Maximal AbsId, corresponding to some prototype cristall
+  fAbsIdMap=new TArrayS(*(cdb->fAbsIdMap)) ;         //Map of correspondance between Raw and PHOS ID
+  fRawIdMap=new TArrayS(*(cdb->fRawIdMap)) ;         //Map of correspondance between AbsId and Raw
 
+}
 //____________________________________________________________________________ 
   AliPHOSConTableDB::~AliPHOSConTableDB()
 {
@@ -148,7 +169,7 @@ void AliPHOSConTableDB::PlotProtoMap(Option_t * opt)
 
 } 
 //____________________________________________________________________________ 
-Int_t AliPHOSConTableDB::AbsId2Raw(Int_t absId){
+Int_t AliPHOSConTableDB::AbsId2Raw(Int_t absId)const{
   //converts numbering of modules in PHOS into
   //numbering in prototype
   if(absId >= fMinAbsId && absId<=fMaxAbsId){    
@@ -158,7 +179,7 @@ Int_t AliPHOSConTableDB::AbsId2Raw(Int_t absId){
     return -1 ;
 }
 //____________________________________________________________________________ 
-Int_t AliPHOSConTableDB::Raw2AbsId(Int_t rawId){
+Int_t AliPHOSConTableDB::Raw2AbsId(Int_t rawId)const{
   //converts numbering of modules in prototipe into
   //numbering in PHOS
   if(rawId >= 0 && rawId<fNcrInProto)
@@ -168,6 +189,7 @@ Int_t AliPHOSConTableDB::Raw2AbsId(Int_t rawId){
 }
 //____________________________________________________________________________ 
 void AliPHOSConTableDB::Print(Option_t * option)const {
+//prints configuraion
 
   TString message ; 
   message  = " %s %s\n" ;
@@ -189,3 +211,21 @@ void AliPHOSConTableDB::Print(Option_t * option)const {
 
   Info("Print", message.Data(), fProtoColumns, fProtoRaws, fRawOffset, fGeom->GetNPhi(), fColOffset,fGeom->GetNZ() );   
 }
+//____________________________________________________________________________
+AliPHOSConTableDB& AliPHOSConTableDB::operator=(const AliPHOSConTableDB& cdb){
+//Operator for coding convetion
+  fGeom=cdb.fGeom ;   //! PHOS geometry class
+  fProtoRaws=cdb.fProtoRaws ;        //  Parameters
+  fProtoColumns=cdb.fProtoColumns ;     //  used to calculate
+  fRawOffset=cdb.fRawOffset ;        //  correspondance
+  fColOffset=cdb.fColOffset ;        //  map
+  fNcrInProto=cdb.fNcrInProto ;       //Number of channels in prototype
+  fMinAbsId=cdb.fMinAbsId ;         //Minimal AbsId, corresponding to some prototype cristall.
+  fMaxAbsId=cdb.fMaxAbsId ;         //Maximal AbsId, corresponding to some prototype cristall
+  fAbsIdMap=new TArrayS(*(cdb.fAbsIdMap)) ;         //Map of correspondance between Raw and PHOS ID
+  fRawIdMap=new TArrayS(*(cdb.fRawIdMap)) ;         //Map of correspondance between AbsId and Raw
+  return *this ;
+}
+
+
+