]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Fixing the detector tags according to the daq logbook
authorpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 May 2007 10:20:34 +0000 (10:20 +0000)
committerpanos <panos@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 May 2007 10:20:34 +0000 (10:20 +0000)
STEER/AliDetectorTag.cxx
STEER/AliDetectorTag.h
STEER/AliRunTag.cxx
STEER/AliRunTag.h

index 0844621d05a3da2474e7a9c5fb86125cfbf0cf24..6a87eba5dd47c9346ce0d9861167bbaf285dfd5b 100644 (file)
 //-----------------------------------------------------------------
 
 #include "AliDetectorTag.h"
+#include "AliLog.h"
 
 ClassImp(AliDetectorTag)
 
 //___________________________________________________________________________
 AliDetectorTag::AliDetectorTag() :
   TObject(),
-  fITS(kFALSE),
+  fMask(0),
+  fITSSPD(kFALSE),
+  fITSSDD(kFALSE),
+  fITSSSD(kFALSE),
   fTPC(kFALSE),
   fTRD(kFALSE),
   fTOF(kFALSE),
   fHMPID(kFALSE),
   fPHOS(kFALSE),
-  fZDC(kFALSE),
-  fMUON(kFALSE),
   fPMD(kFALSE),
-  fEMCAL(kFALSE),
+  fMUON(kFALSE),
+  fFMD(kFALSE),
+  fTZERO(kFALSE),
   fVZERO(kFALSE),
-  fTZERO(kFALSE)
+  fZDC(kFALSE),
+  fEMCAL(kFALSE)
 {
   // Default constructor
+  for(Int_t k = 0; k < 20; k++) fDetectors[k] = 0;
 }
 
 //___________________________________________________________________________
 AliDetectorTag::AliDetectorTag(const AliDetectorTag & detTag) :
   TObject(detTag),
-  fITS(detTag.fITS),
+  fMask(detTag.fMask),
+  fITSSPD(detTag.fITSSPD),
+  fITSSDD(detTag.fITSSDD),
+  fITSSSD(detTag.fITSSSD),
   fTPC(detTag.fTPC),
   fTRD(detTag.fTRD),
   fTOF(detTag.fTOF),
   fHMPID(detTag.fHMPID),
   fPHOS(detTag.fPHOS),
-  fZDC(detTag.fZDC),
-  fMUON(detTag.fMUON),
   fPMD(detTag.fPMD),
-  fEMCAL(detTag.fEMCAL),
+  fMUON(detTag.fMUON),
+  fFMD(detTag.fFMD),
+  fTZERO(detTag.fTZERO),
   fVZERO(detTag.fVZERO),
-  fTZERO(detTag.fTZERO)
+  fZDC(detTag.fZDC),
+  fEMCAL(detTag.fEMCAL)
  {
   // DetectorTag copy constructor
+  for(Int_t k = 0; k < 20; k++) fDetectors[k] = detTag.fDetectors[k];
 }
 
 //___________________________________________________________________________
@@ -69,24 +80,82 @@ AliDetectorTag & AliDetectorTag::operator=(const AliDetectorTag &detTag) {
   if (this != &detTag) {
     TObject::operator=(detTag);
     
-    fITS = detTag.fITS;
+    fMask = detTag.fMask;   
+    fITSSPD = detTag.fITSSPD;
+    fITSSDD = detTag.fITSSDD;
+    fITSSSD = detTag.fITSSSD;
     fTPC = detTag.fTPC;
     fTRD = detTag.fTRD;
     fTOF = detTag.fTOF;
     fHMPID = detTag.fHMPID;
     fPHOS = detTag.fPHOS;
-    fZDC = detTag.fZDC;
-    fMUON = detTag.fMUON;
     fPMD = detTag.fPMD;
-    fEMCAL = detTag.fEMCAL;
-    fVZERO = detTag.fVZERO;
+    fMUON = detTag.fMUON;
+    fFMD = detTag.fFMD;
     fTZERO = detTag.fTZERO;
+    fVZERO = detTag.fVZERO;
+    fZDC = detTag.fZDC;
+    fEMCAL = detTag.fEMCAL;
+    for(Int_t k = 0; k < 20; k++) fDetectors[k] = detTag.fDetectors[k];
   }
   return *this;
 }
 
-
 //___________________________________________________________________________
 AliDetectorTag::~AliDetectorTag() {
   // Destructor
 }
+
+//___________________________________________________________________________
+void AliDetectorTag::Int2Bin() {
+  // Convert the integer into binary
+  Int_t j=0; 
+  UInt_t mask = fMask;
+  for(Int_t k = 0; k < 20; k++) fDetectors[k] = 0;
+  while(mask > 0) {
+   fDetectors[j] = mask%2;
+   mask = mask/2;
+   j++; 
+  }
+  SetDetectorConfiguration();
+}
+
+//___________________________________________________________________________
+void AliDetectorTag::SetDetectorConfiguration() {
+  //sets the detector configuration
+  if(fDetectors[0] == 1) SetITSSPD();
+  if(fDetectors[1] == 1) SetITSSDD();
+  if(fDetectors[2] == 1) SetITSSSD();
+  if(fDetectors[3] == 1) SetTPC();
+  if(fDetectors[4] == 1) SetTRD();
+  if(fDetectors[5] == 1) SetTOF();
+  if(fDetectors[6] == 1) SetHMPID();
+  if(fDetectors[7] == 1) SetPHOS();
+  if(fDetectors[9] == 1) SetPMD();
+  if(fDetectors[10] == 1) SetMUON();
+  if(fDetectors[12] == 1) SetFMD();
+  if(fDetectors[13] == 1) SetTZERO();
+  if(fDetectors[14] == 1) SetVZERO();
+  if(fDetectors[15] == 1) SetZDC();
+  if(fDetectors[18] == 1) SetEMCAL();
+}
+
+//___________________________________________________________________________
+void AliDetectorTag::PrintDetectorMask() {
+  //prints the detector mask
+  AliInfo( Form( "ITS-SPD: %d", GetITSSPD()) );
+  AliInfo( Form( "ITS-SDD: %d", GetITSSDD()) );
+  AliInfo( Form( "ITS-SSD: %d", GetITSSSD()) );
+  AliInfo( Form( "TPC: %d", GetTPC()) );
+  AliInfo( Form( "TRD: %d", GetTRD()) );
+  AliInfo( Form( "TOF: %d", GetTOF()) );
+  AliInfo( Form( "HMPID: %d", GetHMPID()) );
+  AliInfo( Form( "PHOS: %d", GetPHOS()) );
+  AliInfo( Form( "PMD: %d", GetPMD()) );
+  AliInfo( Form( "MUON: %d", GetMUON()) );
+  AliInfo( Form( "FMD: %d", GetFMD()) );
+  AliInfo( Form( "TZERO: %d", GetTZERO()) );
+  AliInfo( Form( "VZERO: %d", GetVZERO()) );
+  AliInfo( Form( "ZDC: %d", GetZDC()) );
+  AliInfo( Form( "EMCAL: %d", GetEMCAL()) );
+}
index 02a8eb7e304698f4300cf87d30ae22c73cbc1764..1ea63b65f3c9cdece9addac5a7c5b5be25d42ee1 100644 (file)
@@ -14,6 +14,7 @@
 //-------------------------------------------------------------------------
 
 #include "TObject.h"
+
 //___________________________________________________________________________
 class AliDetectorTag : public TObject {
  public:
@@ -24,49 +25,67 @@ class AliDetectorTag : public TObject {
   virtual ~AliDetectorTag();
   
   //____________________________________________________//
-  void SetITS() {fITS = kTRUE;}
-  void SetTPC() {fTPC = kTRUE;}
-  void SetTRD() {fTRD = kTRUE;}
-  void SetTOF() {fTOF = kTRUE;}
-  void SetHMPID() {fHMPID = kTRUE;}
-  void SetPHOS() {fPHOS = kTRUE;}
-  void SetZDC() {fZDC = kTRUE;}
-  void SetMUON() {fMUON = kTRUE;}
-  void SetPMD() {fPMD = kTRUE;}
-  void SetEMCAL() {fEMCAL = kTRUE;}
-  void SetVZERO() {fVZERO = kTRUE;}
-  void SetTZERO() {fTZERO = kTRUE;}
-  
+  void AliDetectorTag::SetDetectorMask(UInt_t mask) {fMask = mask; Int2Bin();}
+  void PrintDetectorMask();
+
   //____________________________________________________//
-  Bool_t GetITS() const {return fITS;}
+  Bool_t GetITSSPD() const {return fITSSPD;}
+  Bool_t GetITSSDD() const {return fITSSDD;}
+  Bool_t GetITSSSD() const {return fITSSSD;}
   Bool_t GetTPC() const {return fTPC;}
   Bool_t GetTRD() const {return fTRD;}
   Bool_t GetTOF() const {return fTOF;}
   Bool_t GetHMPID() const {return fHMPID;}
   Bool_t GetPHOS() const {return fPHOS;}
-  Bool_t GetZDC() const {return fZDC;}
-  Bool_t GetMUON() const {return fMUON;}
   Bool_t GetPMD() const {return fPMD;}
-  Bool_t GetEMCAL() const {return fEMCAL;}
-  Bool_t GetVZERO() const {return fVZERO;}
+  Bool_t GetMUON() const {return fMUON;}
+  Bool_t GetFMD() const {return fFMD;}
   Bool_t GetTZERO() const {return fTZERO;}
+  Bool_t GetVZERO() const {return fVZERO;}
+  Bool_t GetZDC() const {return fZDC;}
+  Bool_t GetEMCAL() const {return fEMCAL;}
   
   //____________________________________________________//
  private:
-  Bool_t   fITS;      //ITS 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   fZDC;      //ZDC active = 1
-  Bool_t   fMUON;     //MUON active = 1
-  Bool_t   fPMD;      //PMD active = 1
-  Bool_t   fEMCAL;    //EMCAL active = 1
-  Bool_t   fVZERO;    //VZERO active = 1
-  Bool_t   fTZERO;    //TZERO active = 1
+  void AliDetectorTag::Int2Bin();
+  void AliDetectorTag::SetDetectorConfiguration();
+
+  void SetITSSPD() {fITSSPD = kTRUE;}
+  void SetITSSDD() {fITSSDD = kTRUE;}
+  void SetITSSSD() {fITSSSD = kTRUE;}
+  void SetTPC() {fTPC = kTRUE;}
+  void SetTRD() {fTRD = kTRUE;}
+  void SetTOF() {fTOF = kTRUE;}
+  void SetHMPID() {fHMPID = kTRUE;}
+  void SetPHOS() {fPHOS = kTRUE;}
+  void SetPMD() {fPMD = kTRUE;}
+  void SetMUON() {fMUON = kTRUE;}
+  void SetFMD() {fFMD = kTRUE;}
+  void SetTZERO() {fTZERO = kTRUE;}
+  void SetVZERO() {fVZERO = kTRUE;}
+  void SetZDC() {fZDC = kTRUE;}
+  void SetEMCAL() {fEMCAL = kTRUE;}
+  
+
+  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,2)  //(ClassName, ClassVersion)
+  ClassDef(AliDetectorTag,3)  //(ClassName, ClassVersion)
 };
 //______________________________________________________________________________
 
index d67bcfc06c5f84079a45a0129685ed1aac28efb0..bf1ee72e78730092722095c2d2f7802d9b23779d 100644 (file)
@@ -45,7 +45,7 @@ ClassImp(AliRunTag)
     fNumEvents(0),
     fNumDetectors(0),
     fEventTag("AliEventTag", 1000),
-    fDetectorTag("AliDetectorTag", 1000),
+    fDetectorTag(),
     fLHCTag()
 {
   //Default constructor
@@ -55,19 +55,18 @@ ClassImp(AliRunTag)
 AliRunTag::~AliRunTag() {
   //Destructor
   fEventTag.Delete();
-  fDetectorTag.Delete();
 }
 
 //___________________________________________________________________________
-void AliRunTag::SetLHCTag(Float_t lumin, char *type) {
+void AliRunTag::SetLHCTag(Float_t lumin, TString type) {
   //Setter for the LHC tags
   fLHCTag.SetLHCTag(lumin,type);
 }
 
 //___________________________________________________________________________
-void AliRunTag::SetDetectorTag(const AliDetectorTag &DetTag) {
+void AliRunTag::SetDetectorTag(UInt_t mask) {
   //Setter for the detector tags
-  new(fDetectorTag[fNumDetectors++]) AliDetectorTag(DetTag);
+  fDetectorTag.SetDetectorMask(mask);
 }
 
 //___________________________________________________________________________
index b6e816145e1d0bd85f9ec9cbb14a0427890865d0..881882fb86d722faeb6e6d3ba19e8dd61ad5df21 100644 (file)
 #include <TString.h>
 #include <TClonesArray.h>
 #include "AliLHCTag.h"
+#include "AliDetectorTag.h"
 
 class AliEventTag;
-class AliDetectorTag;
+//class AliDetectorTag;
 
 
 //___________________________________________________________________________
@@ -42,8 +43,8 @@ class AliRunTag : public TObject {
   void SetCalibVersion(Int_t Pn) {fAliceCalibrationVersion = Pn;}
   void SetDataType(Int_t i) {fAliceDataType = i;}
   void SetNEvents(Int_t Pn) { fNumEvents = Pn; }
-  void SetLHCTag(Float_t Plumin, char *type);
-  void SetDetectorTag(const AliDetectorTag &t);
+  void SetLHCTag(Float_t Plumin, TString type);
+  void SetDetectorTag(UInt_t mask);
   void AddEventTag(const AliEventTag &t);
   void Clear(const char * opt = "");
   
@@ -62,8 +63,8 @@ class AliRunTag : public TObject {
   Int_t       GetDataType() const {return fAliceDataType;}
   Int_t       GetNEvents() const {return fNumEvents;}
   AliLHCTag  *GetLHCTag() {return &fLHCTag; } 
+  AliDetectorTag *GetDetectorTags() {return &fDetectorTag;}
   const TClonesArray *GetEventTags() const {return &fEventTag;}
-  const TClonesArray *GetDetectorTags() const {return &fDetectorTag;}
 
   //____________________________________________________//
  private:
@@ -82,7 +83,7 @@ class AliRunTag : public TObject {
   Int_t        fNumEvents;               //number of events per file
   Int_t        fNumDetectors;            //number of detector configs per file
   TClonesArray fEventTag;                //array with all event tags
-  TClonesArray fDetectorTag;             //array with all the detector tags
+  AliDetectorTag fDetectorTag;             //array with all the detector tags
   AliLHCTag    fLHCTag;                  //LHC tag object
   
   ClassDef(AliRunTag,3)  //(ClassName, ClassVersion)