]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
GetDetectorMask returns a TObjArray of TObjStrings
authorpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 08:19:15 +0000 (08:19 +0000)
committerpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 4 May 2007 08:19:15 +0000 (08:19 +0000)
STEER/AliDetectorTag.cxx
STEER/AliDetectorTag.h

index f080c4dd0dca55ade43563f81bf0a3cde32fd2f8..f497408f54ae59ee4f98d1dc29be21ccee5808f5 100644 (file)
 
 #include "AliDetectorTag.h"
 #include "AliLog.h"
+#include "TObjString.h"
 
 ClassImp(AliDetectorTag)
 
 //___________________________________________________________________________
 AliDetectorTag::AliDetectorTag() :
   TObject(),
-  fDetectorString(0),
+  fDetectorArray(new TObjArray()),
   fMask(0),
   fITSSPD(kFALSE),
   fITSSDD(kFALSE),
@@ -54,7 +55,7 @@ AliDetectorTag::AliDetectorTag() :
 //___________________________________________________________________________
 AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) :
   TObject(detTag),
-  fDetectorString(detTag.fDetectorString),
+  fDetectorArray(detTag.fDetectorArray),
   fMask(detTag.fMask),
   fITSSPD(detTag.fITSSPD),
   fITSSDD(detTag.fITSSDD),
@@ -82,7 +83,7 @@ AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
   if (this != &detTag) {
     TObject::operator=(detTag);
     
-    fDetectorString = detTag.fDetectorString;
+    fDetectorArray = detTag.fDetectorArray;
     fMask = detTag.fMask;   
     fITSSPD = detTag.fITSSPD;
     fITSSDD = detTag.fITSSDD;
@@ -107,6 +108,7 @@ AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
 //___________________________________________________________________________
 AliDetectorTag::~AliDetectorTag() {
   // Destructor
+  delete fDetectorArray;
 }
 
 //___________________________________________________________________________
@@ -126,21 +128,36 @@ void AliDetectorTag::Int2Bin() {
 //___________________________________________________________________________
 void AliDetectorTag::SetDetectorConfiguration() {
   //sets the detector configuration
-  if(fDetectors[0] == 1) {SetITSSPD(); fDetectorString += "SPD ";}
-  if(fDetectors[1] == 1) {SetITSSDD(); fDetectorString += "SDD ";}
-  if(fDetectors[2] == 1) {SetITSSSD(); fDetectorString += "SSD ";}
-  if(fDetectors[3] == 1) {SetTPC(); fDetectorString += "TPC ";}
-  if(fDetectors[4] == 1) {SetTRD(); fDetectorString += "TRD ";}
-  if(fDetectors[5] == 1) {SetTOF(); fDetectorString += "TOF ";}
-  if(fDetectors[6] == 1) {SetHMPID(); fDetectorString += "HMPID ";}
-  if(fDetectors[7] == 1) {SetPHOS(); fDetectorString += "PHOS ";}
-  if(fDetectors[9] == 1) {SetPMD(); fDetectorString += "PMD ";}
-  if(fDetectors[10] == 1) {SetMUON(); fDetectorString += "MUON ";}
-  if(fDetectors[12] == 1) {SetFMD(); fDetectorString += "FMD ";}
-  if(fDetectors[13] == 1) {SetTZERO(); fDetectorString += "T0 ";}
-  if(fDetectors[14] == 1) {SetVZERO(); fDetectorString += "VZERO ";}
-  if(fDetectors[15] == 1) {SetZDC(); fDetectorString += "ZDC ";}
-  if(fDetectors[18] == 1) {SetEMCAL(); fDetectorString += "EMCAL";}
+  if(fDetectors[0] == 1) {
+    SetITSSPD(); fDetectorArray->Add(new TObjString("SPD"));}
+  if(fDetectors[1] == 1) {
+    SetITSSDD(); fDetectorArray->Add(new TObjString("SDD"));}
+  if(fDetectors[2] == 1) {
+    SetITSSSD(); fDetectorArray->Add(new TObjString("SSD"));}
+  if(fDetectors[3] == 1) {
+    SetTPC(); fDetectorArray->Add(new TObjString("TPC"));}
+  if(fDetectors[4] == 1) {
+    SetTRD(); fDetectorArray->Add(new TObjString("TRD"));}
+  if(fDetectors[5] == 1) {
+    SetTOF(); fDetectorArray->Add(new TObjString("TOF"));}
+  if(fDetectors[6] == 1) {
+    SetHMPID();fDetectorArray->Add(new TObjString("HMPID"));}
+  if(fDetectors[7] == 1) {
+    SetPHOS(); fDetectorArray->Add(new TObjString("PHOS"));}
+  if(fDetectors[9] == 1) {
+    SetPMD(); fDetectorArray->Add(new TObjString("PMD"));}
+  if(fDetectors[10] == 1) {
+    SetMUON(); fDetectorArray->Add(new TObjString("MUON"));}
+  if(fDetectors[12] == 1) {
+    SetFMD(); fDetectorArray->Add(new TObjString("FMD"));}
+  if(fDetectors[13] == 1) {
+    SetTZERO(); fDetectorArray->Add(new TObjString("T0"));}
+  if(fDetectors[14] == 1) {
+    SetVZERO(); fDetectorArray->Add(new TObjString("VZERO"));}
+  if(fDetectors[15] == 1) {
+    SetZDC(); fDetectorArray->Add(new TObjString("ZDC"));}
+  if(fDetectors[18] == 1) {
+    SetEMCAL(); fDetectorArray->Add(new TObjString("EMCAL"));}
 }
 
 //___________________________________________________________________________
index 7557d9a48f4c4213bd02e6a4124f51f924bbad74..74f5a2988a8b7ab11cc4aa4ad049afdb6b18b5e6 100644 (file)
@@ -14,7 +14,7 @@
 //-------------------------------------------------------------------------
 
 #include "TObject.h"
-#include "TString.h"
+#include "TObjArray.h"
 
 //___________________________________________________________________________
 class AliDetectorTag : public TObject {
@@ -27,7 +27,7 @@ class AliDetectorTag : public TObject {
   
   //____________________________________________________//
   void SetDetectorMask(UInt_t mask) {fMask = mask; Int2Bin();}
-  const char *GetDetectorMask() {return fDetectorString.Data();}
+  TObjArray *GetDetectorMask() {return fDetectorArray;}
   void PrintDetectorMask();
 
   //____________________________________________________//
@@ -68,24 +68,24 @@ class AliDetectorTag : public TObject {
   void SetZDC() {fZDC = kTRUE;}
   void SetEMCAL() {fEMCAL = kTRUE;}
   
-  TString  fDetectorString;//detectors' names - active
-  UInt_t   fMask;          //detector mask
-  UInt_t   fDetectors[20]; //detector mask
-  Bool_t   fITSSPD;        //ITS-SPD active = 1
-  Bool_t   fITSSDD;        //ITS-SDD active = 1
-  Bool_t   fITSSSD;        //ITS-SSD active = 1
-  Bool_t   fTPC;           //TPC active = 1
-  Bool_t   fTRD;           //TRD active = 1
-  Bool_t   fTOF;           //TOF active = 1
-  Bool_t   fHMPID;         //HMPID active = 1
-  Bool_t   fPHOS;          //PHOS active = 1
-  Bool_t   fPMD;           //PMD active = 1
-  Bool_t   fMUON;          //MUON active = 1
-  Bool_t   fFMD;           //FMD active = 1
-  Bool_t   fTZERO;         //TZERO active = 1
-  Bool_t   fVZERO;         //VZERO active = 1
-  Bool_t   fZDC;           //ZDC active = 1
-  Bool_t   fEMCAL;         //EMCAL active = 1
+  TObjArray *fDetectorArray; //detectors' names - active
+  UInt_t     fMask;          //detector mask
+  UInt_t     fDetectors[20]; //detector mask
+  Bool_t     fITSSPD;        //ITS-SPD active = 1
+  Bool_t     fITSSDD;        //ITS-SDD active = 1
+  Bool_t     fITSSSD;        //ITS-SSD active = 1
+  Bool_t     fTPC;           //TPC active = 1
+  Bool_t     fTRD;           //TRD active = 1
+  Bool_t     fTOF;           //TOF active = 1
+  Bool_t     fHMPID;         //HMPID active = 1
+  Bool_t     fPHOS;          //PHOS active = 1
+  Bool_t     fPMD;           //PMD active = 1
+  Bool_t     fMUON;          //MUON active = 1
+  Bool_t     fFMD;           //FMD active = 1
+  Bool_t     fTZERO;         //TZERO active = 1
+  Bool_t     fVZERO;         //VZERO active = 1
+  Bool_t     fZDC;           //ZDC active = 1
+  Bool_t     fEMCAL;         //EMCAL active = 1
 
   ClassDef(AliDetectorTag,3)  //(ClassName, ClassVersion)
 };