//-----------------------------------------------------------------
#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];
}
//___________________________________________________________________________
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()) );
+}
//-------------------------------------------------------------------------
#include "TObject.h"
+
//___________________________________________________________________________
class AliDetectorTag : public TObject {
public:
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)
};
//______________________________________________________________________________
fNumEvents(0),
fNumDetectors(0),
fEventTag("AliEventTag", 1000),
- fDetectorTag("AliDetectorTag", 1000),
+ fDetectorTag(),
fLHCTag()
{
//Default constructor
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);
}
//___________________________________________________________________________
#include <TString.h>
#include <TClonesArray.h>
#include "AliLHCTag.h"
+#include "AliDetectorTag.h"
class AliEventTag;
-class AliDetectorTag;
+//class AliDetectorTag;
//___________________________________________________________________________
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 = "");
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:
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)