Skip to content

Commit

Permalink
Merge branch 'master' of https://git.cern.ch/reps/AliRoot
Browse files Browse the repository at this point in the history
  • Loading branch information
fnoferin committed Dec 18, 2015
2 parents 5d029f9 + 17be685 commit 732ffb9
Show file tree
Hide file tree
Showing 41 changed files with 1,921 additions and 1,031 deletions.
3 changes: 3 additions & 0 deletions EMCAL/EMCALUtils/AliEMCALGeometry.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,9 @@ class AliEMCALGeometry : public TNamed {
Bool_t GetAbsFastORIndexFromPositionInEMCAL(const Int_t iEta, const Int_t iPhi, Int_t& id) const {
return fTriggerMapping->GetAbsFastORIndexFromPositionInEMCAL(iEta, iPhi, id);
}
Bool_t GetAbsFastORIndexFromPHOSSubregion(const Int_t iPHOS, Int_t& id) const {
return fTriggerMapping->GetAbsFastORIndexFromPHOSSubregion(iPHOS, id);
}
Bool_t GetTRUFromAbsFastORIndex(const Int_t id, Int_t& iTRU, Int_t& iADC) const {
return fTriggerMapping->GetTRUFromAbsFastORIndex(id, iTRU, iADC);
}
Expand Down
1 change: 1 addition & 0 deletions EMCAL/EMCALUtils/AliEMCALTriggerMapping.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class AliEMCALTriggerMapping : public TObject
virtual Bool_t GetAbsFastORIndexFromPositionInTRU(Int_t iTRU, Int_t iEta, Int_t iPhi, Int_t& id) const = 0;
virtual Bool_t GetAbsFastORIndexFromPositionInSM(Int_t iSM, Int_t iEta, Int_t iPhi, Int_t& id) const = 0;
virtual Bool_t GetAbsFastORIndexFromPositionInEMCAL(Int_t iEta, Int_t iPhi, Int_t& id) const = 0;
virtual Bool_t GetAbsFastORIndexFromPHOSSubregion( Int_t iPHOS, Int_t& id) const = 0;
virtual Bool_t GetTRUFromAbsFastORIndex(Int_t id, Int_t& iTRU, Int_t& iADC) const = 0;
virtual Bool_t GetPositionInTRUFromAbsFastORIndex(Int_t id, Int_t& iTRU, Int_t& iEta, Int_t& iPhi) const = 0;
virtual Bool_t GetPositionInSMFromAbsFastORIndex(Int_t id, Int_t& iSM, Int_t& iEta, Int_t& iPhi) const = 0;
Expand Down
1 change: 1 addition & 0 deletions EMCAL/EMCALUtils/AliEMCALTriggerMappingV1.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ class AliEMCALTriggerMappingV1 : public AliEMCALTriggerMapping
Bool_t GetAbsFastORIndexFromPositionInTRU(Int_t iTRU, Int_t iEta, Int_t iPhi, Int_t& id) const;
Bool_t GetAbsFastORIndexFromPositionInSM( Int_t iSM, Int_t iEta, Int_t iPhi, Int_t& id) const;
Bool_t GetAbsFastORIndexFromPositionInEMCAL( Int_t iEta, Int_t iPhi, Int_t& id) const;
Bool_t GetAbsFastORIndexFromPHOSSubregion( Int_t iPHOS, Int_t& id) const {return kFALSE;}
Bool_t GetTRUFromAbsFastORIndex(Int_t id, Int_t& iTRU, Int_t& iADC) const;
Bool_t GetPositionInTRUFromAbsFastORIndex(Int_t id, Int_t& iTRU, Int_t& iEta, Int_t& iPhi) const;
Bool_t GetPositionInSMFromAbsFastORIndex(Int_t id, Int_t& iSM, Int_t& iEta, Int_t& iPhi) const;
Expand Down
12 changes: 12 additions & 0 deletions EMCAL/EMCALUtils/AliEMCALTriggerMappingV2.cxx
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,18 @@ Bool_t AliEMCALTriggerMappingV2::GetAbsFastORIndexFromPositionInEMCAL(Int_t iEta
return kTRUE ;
}

//________________________________________________________________________________________________
Bool_t AliEMCALTriggerMappingV2::GetAbsFastORIndexFromPHOSSubregion( Int_t iPHOS, Int_t& id) const
{
if(iPHOS > 35 || iPHOS < 0){
AliError(Form("Out of range! phos subregion index: %2d ", iPHOS));
return kFALSE;
}
Int_t iEta = 16 + 4 * (Int_t)(iPHOS % 4) ;
Int_t iPhi = 64 + 4 * (Int_t)(iPHOS / 4) ;
return GetAbsFastORIndexFromPositionInEMCAL(iEta,iPhi,id);
}

//________________________________________________________________________________________________
Bool_t AliEMCALTriggerMappingV2::GetTRUFromAbsFastORIndex(Int_t id, Int_t& iTRU, Int_t& iADC) const
{
Expand Down
1 change: 1 addition & 0 deletions EMCAL/EMCALUtils/AliEMCALTriggerMappingV2.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class AliEMCALTriggerMappingV2 : public AliEMCALTriggerMapping
Bool_t GetAbsFastORIndexFromPositionInTRU(Int_t iTRU, Int_t iEta, Int_t iPhi, Int_t& id) const;
Bool_t GetAbsFastORIndexFromPositionInSM( Int_t iSM, Int_t iEta, Int_t iPhi, Int_t& id) const;
Bool_t GetAbsFastORIndexFromPositionInEMCAL( Int_t iEta, Int_t iPhi, Int_t& id) const;
Bool_t GetAbsFastORIndexFromPHOSSubregion( Int_t iPHOS, Int_t& id) const;

//********************************************
//Get TRU/SM/EMCAL Geometry from FastOR index
Expand Down
23 changes: 19 additions & 4 deletions EMCAL/EMCALbase/AliEMCAL.cxx
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@ AliEMCAL::~AliEMCAL()
{
//dtor
delete fgRawUtils;
delete fTriggerData;
delete fTriggerData;
//fTriggerData->Delete(); // RS: if TClonesArray is created, Delete will be called from ~TClonesArray
}

//____________________________________________________________________________
Expand Down Expand Up @@ -297,7 +298,11 @@ void AliEMCAL::Init()
//____________________________________________________________________________
void AliEMCAL::Digits2Raw() {

static AliEMCALRawUtils rawUtils;
// static AliEMCALRawUtils rawUtils;
// RS why this should be static? This makes root to die produce "double delete"
// since the TF1 created in the rawUtils is garbage-collected by root before the
// destructor is called during garbage collecting of the static object
AliEMCALRawUtils rawUtils;
rawUtils.Digits2Raw();

}
Expand Down Expand Up @@ -349,8 +354,18 @@ Bool_t AliEMCAL::Raw2SDigits(AliRawReader* rawReader){
sdigits->Clear("C");

//Trigger sdigits
if(!fTriggerData)fTriggerData = new AliEMCALTriggerData();
fTriggerData->SetMode(1);
if (!fTriggerData) {
int dsize = (GetGeometry()->GetTriggerMappingVersion() == 2) ? 2 : 1;
fTriggerData = new TClonesArray("AliEMCALTriggerData",dsize);
for (int i=0;i<dsize;i++) {
new((*fTriggerData)[i]) AliEMCALTriggerData();
}
}

for (int i=0;i<fTriggerData->GetEntriesFast();i++) {
((AliEMCALTriggerData*)fTriggerData->At(i))->SetMode(1);
}

const Int_t nTRU = GetGeometry()->GetNTotalTRU();
TClonesArray *digitsTrg = new TClonesArray("AliEMCALTriggerRawDigit", nTRU * 96);
Int_t bufsize = 32000;
Expand Down
2 changes: 1 addition & 1 deletion EMCAL/EMCALbase/AliEMCAL.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class AliEMCAL : public AliDetector {

//For embedding
static AliEMCALRawUtils * fgRawUtils; // raw utilities class, for embedding
AliEMCALTriggerData * fTriggerData; // Trigger parameters data container
TClonesArray *fTriggerData; // Trigger parameters data container

private:
AliEMCAL(const AliEMCAL& emcal);
Expand Down
2 changes: 1 addition & 1 deletion EMCAL/EMCALbase/AliEMCALRawUtils.cxx
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ void AliEMCALRawUtils::AddDigit(TClonesArray *digitsArr, Int_t id, Int_t lowGain
/// Conversion of raw data to digits.
///
void AliEMCALRawUtils::Raw2Digits(AliRawReader* reader,TClonesArray *digitsArr, const AliCaloCalibPedestal* pedbadmap,
TClonesArray *digitsTRG, AliEMCALTriggerData* trgData)
TClonesArray *digitsTRG, TClonesArray *trgData)
{
if ( digitsArr) digitsArr->Clear("C");

Expand Down
2 changes: 1 addition & 1 deletion EMCAL/EMCALbase/AliEMCALRawUtils.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class AliEMCALRawUtils : public TObject {
void Digits2Raw();

void Raw2Digits(AliRawReader *reader, TClonesArray *digitsArr, const AliCaloCalibPedestal* pedbadmap,
TClonesArray *digitsTRG=0x0, AliEMCALTriggerData* trgData = 0x0);
TClonesArray *digitsTRG=0x0, TClonesArray *trgData=0x0);

void AddDigit(TClonesArray *digitsArr, Int_t id, Int_t lowGain, Float_t amp, Float_t time, Float_t chi2, Int_t ndf);

Expand Down
5 changes: 3 additions & 2 deletions EMCAL/EMCALbase/AliEMCALTriggerData.cxx
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,16 @@ fL1V0(),
fL1FrameMask(0),
fL1TriggerType(),
fL1DataDecoded(0),
fL1RawData(0)
fL1RawData(0),
fMedian(0)
{
// Ctor

fL1GammaThreshold[0] = fL1GammaThreshold[1] = 0;
fL1JetThreshold[0] = fL1JetThreshold[1] = 0;

fL1V0[0] = fL1V0[1] = 0;
for (Int_t i = 0; i < 15; i++) fL1TriggerType[i] = 0;
for (Int_t i = 0; i < 19; i++) fL1TriggerType[i] = 0;
}

//_____________
Expand Down
15 changes: 9 additions & 6 deletions EMCAL/EMCALbase/AliEMCALTriggerData.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ class AliEMCALTriggerData : public TObject

virtual void SetL1DataDecoded( Int_t v) { fL1DataDecoded = v;}
virtual void SetL1RawData( Int_t v) { fL1RawData = v;}
virtual void SetMedian( Int_t v) { fMedian = v;}

virtual void GetL0Trigger( Int_t i, Int_t j, Int_t& k ) const { k = fL0Trigger[i][j];}
virtual Int_t GetL0Trigger( Int_t i, Int_t j ) const {return fL0Trigger[i][j];}
Expand All @@ -45,7 +46,8 @@ class AliEMCALTriggerData : public TObject
virtual void GetL1TriggerType( Int_t v[]) const {for (int i = 0; i < 15; i++) v[i] = fL1TriggerType[i];}

virtual Int_t GetL1DataDecoded( ) const {return fL1DataDecoded;}
virtual Int_t GetL1RawData( ) const {return fL1RawData;}
virtual Int_t GetL1RawData( ) const {return fL1RawData;}
virtual Int_t GetMedian( ) const {return fMedian;}

virtual Int_t GetMode() const {return fMode;}

Expand All @@ -57,21 +59,22 @@ class AliEMCALTriggerData : public TObject
AliEMCALTriggerData(const AliEMCALTriggerData& rhs); // NOT implemented
AliEMCALTriggerData& operator=(const AliEMCALTriggerData& rhs); // NOT implemented

Int_t fMode; // Simulation/Raw
Int_t fMode; // Simulation/Raw

Int_t fL0Trigger[2][32]; // Triggering TRU
Int_t fL0Trigger[2][52]; // Triggering TRU

Int_t fL1GammaThreshold[2]; // L1-g threshold
Int_t fL1JetThreshold[2]; // L1-j threshold

Int_t fL1V0[2]; // V0 charges
Int_t fL1FrameMask; // Frame mask
Int_t fL1TriggerType[15]; // Trigger type
Int_t fL1TriggerType[19]; // Trigger type

Int_t fL1DataDecoded; // Raw data decoded
Int_t fL1RawData; // Raw data

ClassDef(AliEMCALTriggerData,2)
Int_t fMedian; // Median

ClassDef(AliEMCALTriggerData,3)
};

#endif
6 changes: 4 additions & 2 deletions EMCAL/EMCALbase/AliEMCALTriggerRawDigit.cxx
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ AliEMCALTriggerRawDigit::AliEMCALTriggerRawDigit() : AliEMCALRawDigit(),
fTriggerBits(0),
fNL0Times(0),
fL0Times(),
fL1TimeSum(-1)
fL1TimeSum(-1),
fL1SubRegion(-1)
{
// default ctor
for (Int_t i = 0; i < 10; i++) fL0Times[i] = -1;
Expand All @@ -44,7 +45,8 @@ AliEMCALTriggerRawDigit::AliEMCALTriggerRawDigit(Int_t id, Int_t timeSamples[],
fTriggerBits(0),
fNL0Times(0),
fL0Times(),
fL1TimeSum(-1)
fL1TimeSum(-1),
fL1SubRegion(-1)
{
// Ctor

Expand Down
6 changes: 5 additions & 1 deletion EMCAL/EMCALbase/AliEMCALTriggerRawDigit.h
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ class AliEMCALTriggerRawDigit : public AliEMCALRawDigit

void SetL1TimeSum(Int_t ts) {if (fL1TimeSum >= 0) AliWarning("You're overwriting digit time sum! Please check"); fL1TimeSum = ts;}
Int_t GetL1TimeSum( ) const {return fL1TimeSum;}

void SetL1SubRegion(Int_t sr) {if (fL1SubRegion >= 0) AliWarning("You're overwriting digit subregion! Please check"); fL1SubRegion = sr;}
Int_t GetL1SubRegion( ) const {return fL1SubRegion;}

virtual void Print(const Option_t* opt) const;

Expand All @@ -51,8 +54,9 @@ class AliEMCALTriggerRawDigit : public AliEMCALRawDigit
Int_t fL0Times[10]; // L0 times

Int_t fL1TimeSum; // L1 time sum
Int_t fL1SubRegion; // Subregion

ClassDef(AliEMCALTriggerRawDigit,1)
ClassDef(AliEMCALTriggerRawDigit,2)
};
#endif

Loading

0 comments on commit 732ffb9

Please sign in to comment.