#include "AliEMCALCalibData.h"
#include "AliESDCaloCluster.h"
#include "AliEMCALUnfolding.h"
-#include "AliEMCALFixedWindowClusterInfo.h"
#include "AliEMCALClusterizerFixedWindow.h"
fShiftPhi(2),
fShiftEta(2),
fTRUshift(0),
- fClustersInfo(new AliEMCALFixedWindowClusterInfo("clustersInfo")),
fClustersArray(0)
{
// Constructor
fShiftPhi(2),
fShiftEta(2),
fTRUshift(0),
- fClustersInfo(new AliEMCALFixedWindowClusterInfo("clustersInfo")),
fClustersArray(0)
{
// Constructor
fShiftPhi(2),
fShiftEta(2),
fTRUshift(0),
- fClustersInfo(new AliEMCALFixedWindowClusterInfo("clustersInfo")),
fClustersArray(0)
{
// Constructor
{
// Destructor
- delete fClustersInfo;
delete fClustersArray;
}
rp->EvalDistanceToBadChannels(fCaloPed);
}
}
+
+ fRecPoints->Sort();
- for (Int_t index = 0; index < fRecPoints->GetEntries(); index++) {
- AliEMCALRecPoint *rp = dynamic_cast<AliEMCALRecPoint *>(fRecPoints->At(index));
- if (rp) {
- rp->SetIndexInList(index);
- }
- else AliFatal("RecPoint NULL!!");
- }
+ // Constantin To Do
+ //for (Int_t index = 0; index < fRecPoints->GetEntries(); index++) {
+ // AliEMCALRecPoint *rp = dynamic_cast<AliEMCALRecPoint *>(fRecPoints->At(index));
+ // if (rp) {
+ // rp->SetIndexInList(index);
+ // }
+ // else AliFatal("RecPoint NULL!!");
+ //}
if (fTreeR)
fTreeR->Fill();
fNumberOfECAClusters = 0;
fRecPoints->Delete();
-
- if (fClustersInfo->GetLastElementPosition() > 0)
- fClustersInfo->Clear();
Int_t nSupMod=0, nModule=0, nIphi=0, nIeta=0, iphi=0, ieta=0;
for (Int_t i = 0; i < nDigitsCluster; i++){
fClustersArray[iCluster][i] = NULL;
}
-
- fClustersInfo->Add(iCluster, -1, iClusEta, iClusPhi);
}
if (fClustersArray[iCluster][iDigit] != NULL){
AliEMCALRecPoint *recPoint = dynamic_cast<AliEMCALRecPoint*> (fRecPoints->At(iRecPoint));
if (recPoint) {
- if (fClustersInfo->ContainsIndex(iRecPoint))
- AliFatal(Form("ERROR: index present already, %d", iRecPoint));
-
- fClustersInfo->SetIndexFromId(iCluster, iRecPoint);
-
iRecPoint++;
recPoint->SetClusterType(AliVCluster::kEMCALClusterv1);
+ recPoint->SetIndexInList(iCluster);
for (Int_t iDigit = 0; iDigit < nDigitsCluster; iDigit++){
if (fClustersArray[iCluster][iDigit] == NULL) continue;
class AliEMCALRecPoint;
class AliEMCALDigit;
-class AliEMCALFixedWindowClusterInfo;
class AliEMCALClusterizerFixedWindow : public AliEMCALClusterizer {
public:
public:
virtual void Digits2Clusters(Option_t *option);
virtual const char *Version() const { return "clu-FixedWindow"; }
-
- AliEMCALFixedWindowClusterInfo* GetClustersInfo() const { return fClustersInfo; }
+
Int_t GetNphi () const { return fNphi; }
Int_t GetNeta () const { return fNeta; }
Int_t GetShiftPhi () const { return fShiftPhi; }
Int_t GetShiftEta () const { return fShiftEta; }
Bool_t GetTRUshift() const { return fTRUshift; }
- void SetClustersInfo(AliEMCALFixedWindowClusterInfo *ClusInfo) { fClustersInfo = ClusInfo; }
void SetNphi (Int_t n);
void SetNeta (Int_t n);
void SetShiftPhi (Int_t s);
Int_t fShiftPhi; // Shifting number of cells in phi direction
Int_t fShiftEta; // Shifting number of cells in eta direction
Bool_t fTRUshift; // Allows shifting inside a TRU (true) of through the whole calorimeter (false)
- AliEMCALFixedWindowClusterInfo *fClustersInfo; //!Point to an object where additional information are stored
AliEMCALDigit ***fClustersArray; //!Temporary array that contains clusters
private:
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-// --- Root ---
-#include <TNamed.h>
-#include <TArrayI.h>
-
-#include "AliEMCALFixedWindowClusterInfo.h"
-
-ClassImp(AliEMCALFixedWindowClusterInfo)
-
-//___________________________________________________________________________________________________________
-AliEMCALFixedWindowClusterInfo::AliEMCALFixedWindowClusterInfo()
- : TNamed(),
- fLastPos(0),
- fIds(new TArrayI()),
- fIndexes(new TArrayI()),
- fPhi(new TArrayI()),
- fEta(new TArrayI())
-{
- // Constructor
-}
-
-//___________________________________________________________________________________________________________
-AliEMCALFixedWindowClusterInfo::AliEMCALFixedWindowClusterInfo(const char* name, Int_t size)
- : TNamed(name, name),
- fLastPos(0),
- fIds(new TArrayI(size)),
- fIndexes(new TArrayI(size)),
- fPhi(new TArrayI(size)),
- fEta(new TArrayI(size))
-{
- // Constructor
-
- fIds->Reset(-1);
- fIndexes->Reset(-1);
- fPhi->Reset(-1);
- fEta->Reset(-1);
-}
-
-//___________________________________________________________________________________________________________
-AliEMCALFixedWindowClusterInfo::AliEMCALFixedWindowClusterInfo(const TString& name, Int_t size)
- : TNamed(name, name),
- fLastPos(0),
- fIds(new TArrayI(size)),
- fIndexes(new TArrayI(size)),
- fPhi(new TArrayI(size)),
- fEta(new TArrayI(size))
-{
- // Constructor
-
- fIds->Reset(-1);
- fIndexes->Reset(-1);
- fPhi->Reset(-1);
- fEta->Reset(-1);
-}
-
-//___________________________________________________________________________________________________________
-AliEMCALFixedWindowClusterInfo::~AliEMCALFixedWindowClusterInfo()
-{
- // Destructor
-
- delete fIds;
- delete fIndexes;
- delete fPhi;
- delete fEta;
-}
-
-//___________________________________________________________________________________________________________
-Bool_t AliEMCALFixedWindowClusterInfo::GetInfoFromId(Int_t idclus, Int_t &index, Int_t &eta, Int_t &phi) const
-{
- // Search for the unique ID and return index, eta and phi
-
- Int_t i = GetPositionFromId(idclus);
- if (i > -1){
- index = fIndexes->At(i);
- eta = fEta->At(i);
- phi = fPhi->At(i);
- return kTRUE;
- }
- return kFALSE;
-}
-
-//___________________________________________________________________________________________________________
-Bool_t AliEMCALFixedWindowClusterInfo::GetInfoFromIndex(Int_t index, Int_t &idclus, Int_t &eta, Int_t &phi) const
-{
- // Search for the index and return unique ID, eta and phi
-
- Int_t i = GetPositionFromIndex(index);
- if (i > -1){
- idclus = fIds->At(i);
- eta = fEta->At(i);
- phi = fPhi->At(i);
- return kTRUE;
- }
- return kFALSE;
-}
-
-//___________________________________________________________________________________________________________
-Bool_t AliEMCALFixedWindowClusterInfo::SetIndexFromId(Int_t idclus, Int_t index)
-{
- // Search for the unique ID and set index
-
- Int_t i = GetPositionFromId(idclus);
- if (i > -1){
- fIndexes->AddAt(index, i);
- return kTRUE;
- }
- return kFALSE;
-}
-
-//___________________________________________________________________________________________________________
-void AliEMCALFixedWindowClusterInfo::Add(Int_t idclus, Int_t index, Int_t eta, Int_t phi)
-{
- // Add a new element to the arrays; if necessary expand the arrays
-
- if (fLastPos >= fIds->GetSize())
- Expand(fIds->GetSize() * 2 + 1);
-
- fIds->AddAt(idclus, fLastPos);
- fIndexes->AddAt(index, fLastPos);
- fPhi->AddAt(phi, fLastPos);
- fEta->AddAt(eta, fLastPos);
- fLastPos++;
-}
-
-//___________________________________________________________________________________________________________
-Bool_t AliEMCALFixedWindowClusterInfo::RemoveId(Int_t idclus)
-{
- // Search for the unique ID and remove the corresponding element from the arrays
-
- Int_t i = GetPositionFromId(idclus);
- if (i > -1){
- fIds->AddAt(-1, i);
- fIndexes->AddAt(-1, i);
- fPhi->AddAt(-1, i);
- fEta->AddAt(-1, i);
- return kTRUE;
- }
- return kFALSE;
-}
-
-//___________________________________________________________________________________________________________
-Bool_t AliEMCALFixedWindowClusterInfo::RemoveIndex(Int_t index)
-{
- // Search for and index and remove the corresponding element from the arrays
-
- Int_t i = GetPositionFromIndex(index);
- if (i > -1){
- fIds->AddAt(-1, i);
- fIndexes->AddAt(-1, i);
- fPhi->AddAt(-1, i);
- fEta->AddAt(-1, i);
- return kTRUE;
- }
- return kFALSE;
-}
-
-//___________________________________________________________________________________________________________
-void AliEMCALFixedWindowClusterInfo::Expand(Int_t size)
-{
- // Expand the arrays
-
- Int_t oldsize = fIds->GetSize();
-
- fIds->Set(size);
- fIndexes->Set(size);
- fPhi->Set(size);
- fEta->Set(size);
-
- for (Int_t i = oldsize; i < size; i++){
- fIds->AddAt(-1, i);
- fIndexes->AddAt(-1, i);
- fPhi->AddAt(-1, i);
- fEta->AddAt(-1, i);
- }
-}
-
-//___________________________________________________________________________________________________________
-void AliEMCALFixedWindowClusterInfo::Clear(Option_t* /*option*/)
-{
- // Clear the arrays
-
- fIds->Reset(-1);
- fIndexes->Reset(-1);
- fPhi->Reset(-1);
- fEta->Reset(-1);
- fLastPos = 0;
-}
-
-//___________________________________________________________________________________________________________
-Int_t AliEMCALFixedWindowClusterInfo::GetSize() const
-{
- // Return the size of the arrays
-
- return fIds->GetSize();
-}
-
-//___________________________________________________________________________________________________________
-Bool_t AliEMCALFixedWindowClusterInfo::ContainsId(Int_t idclus) const
-{
- // Search for the unique ID and return whether or not it exists
-
- if(GetPositionFromId(idclus) > -1)
- return kTRUE;
- else
- return kFALSE;
-}
-
-//___________________________________________________________________________________________________________
-Bool_t AliEMCALFixedWindowClusterInfo::ContainsIndex(Int_t index) const
-{
- // Search for the index and return whether or not it exists
-
- if(GetPositionFromIndex(index) > -1)
- return kTRUE;
- else
- return kFALSE;
-}
-
-//___________________________________________________________________________________________________________
-Int_t AliEMCALFixedWindowClusterInfo::GetPositionFromId(Int_t idclus) const
-{
- // Return the the position corresponding to a given unique ID
-
- for (Int_t i = 0; i < fLastPos; i++){
- if (fIds->At(i) == idclus)
- return i;
- }
- return -1;
-}
-
-//___________________________________________________________________________________________________________
-Int_t AliEMCALFixedWindowClusterInfo::GetPositionFromIndex(Int_t index) const
-{
- // Return the the position corresponding to a given index
-
- for (Int_t i = 0; i < fLastPos; i++){
- if (fIndexes->At(i) == index)
- return i;
- }
- return -1;
-}
-
-//___________________________________________________________________________________________________________
-Int_t AliEMCALFixedWindowClusterInfo::GetLastElementPosition() const
-{
- // Return the position of the last non-empty element in the arrays
-
- return fLastPos;
-}
+++ /dev/null
-#ifndef ALIEMCALFIXEDWINDOWCLUSTERINFO_H
-#define ALIEMCALFIXEDWINDOWCLUSTERINFO_H
-
-// $Id$
-
-#include <TNamed.h>
-
-class TArrayI;
-
-class AliEMCALFixedWindowClusterInfo : public TNamed {
-
-public:
- AliEMCALFixedWindowClusterInfo();
- AliEMCALFixedWindowClusterInfo(const char* name, Int_t size = 1000);
- AliEMCALFixedWindowClusterInfo(const TString& name, Int_t size = 1000);
- virtual ~AliEMCALFixedWindowClusterInfo();
-
-public:
- Bool_t GetInfoFromId(Int_t idclus, Int_t &index, Int_t &eta, Int_t &phi) const;
- Bool_t GetInfoFromIndex(Int_t index, Int_t &idclus, Int_t &eta, Int_t &phi) const;
- Int_t GetSize() const;
- Bool_t ContainsId(Int_t idclus) const;
- Bool_t ContainsIndex(Int_t index) const;
- Int_t GetLastElementPosition() const;
- void Add(Int_t idclus, Int_t index, Int_t eta, Int_t phi);
- Bool_t SetIndexFromId(Int_t idclus, Int_t index);
- Bool_t RemoveId(Int_t idclus);
- Bool_t RemoveIndex(Int_t index);
- void Expand(Int_t size);
-
- virtual void Clear(Option_t* option = "");
-
-protected:
- Int_t GetPositionFromId(Int_t idclus) const;
- Int_t GetPositionFromIndex(Int_t index) const;
-
- Int_t fLastPos; // Last non-empty position in the arrays
- TArrayI *fIds; // Array containing unique IDs of clusters
- TArrayI *fIndexes; // Array containing corresponding indexes in the cluster collection (usually a TClonesObject)
- TArrayI *fPhi; // Array containing corresponding Phi index
- TArrayI *fEta; // Array containing corresponding Eta index
-
-private:
- AliEMCALFixedWindowClusterInfo(const AliEMCALFixedWindowClusterInfo&); // not implemented
- AliEMCALFixedWindowClusterInfo &operator=(const AliEMCALFixedWindowClusterInfo&); // not implemented
-
- ClassDef(AliEMCALFixedWindowClusterInfo, 1);
-};
-#endif //ALIEMCALFIXEDWINDOWCLUSTERINFO_H
set ( SRCS
AliEMCALReconstructor.cxx
- AliEMCALFixedWindowClusterInfo.cxx
AliEMCALClusterizer.cxx
AliEMCALClusterizerv1.cxx
AliEMCALClusterizerv2.cxx
#ifdef __CINT__
-// for libEMCALrec.pkg
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class AliEMCALReconstructor+;
-#pragma link C++ class AliEMCALFixedWindowClusterInfo+;
#pragma link C++ class AliEMCALClusterizer+;
#pragma link C++ class AliEMCALClusterizerv1+;
#pragma link C++ class AliEMCALClusterizerv2+;
#pragma link C++ class AliEMCALPID+;
#pragma link C++ class AliEMCALQADataMakerRec+;
#pragma link C++ class AliEMCALAfterBurnerUF+;
-
-
#endif
CaloCalib/AliAnalysisTaskEMCALClusterize.cxx
CaloCalib/AliAnalysisTaskEMCALClusterizeFast.cxx
CaloCalib/AliAnalysisTaskEMCALPi0PbPb.cxx
- CaloCalib/AliAnalysisTaskEMCALFastOR2Trigger.cxx
- CaloCalib/AliEMCALFastORPatch.cxx
)
string ( REPLACE ".cxx" ".h" HDRS "${SRCS}" )
#include "AliEMCALClusterizerv1.h"
#include "AliEMCALClusterizerv2.h"
#include "AliEMCALClusterizerFixedWindow.h"
-#include "AliEMCALFixedWindowClusterInfo.h"
#include "AliEMCALDigit.h"
#include "AliEMCALGeometry.h"
#include "AliEMCALRecParam.h"
fShiftPhi(2),
fShiftEta(2),
fTRUShift(0),
- fStoreAdditionalInformation(0)
+ fClusterizeFastORs(0)
{
// Constructor
}
fShiftPhi(2),
fShiftEta(2),
fTRUShift(0),
- fStoreAdditionalInformation(0)
+ fClusterizeFastORs(0)
{
// Constructor
Clusterize();
UpdateCells();
UpdateClusters();
-
- if (fStoreAdditionalInformation)
- StoreAdditionalInformation();
if (fOutputAODBranch)
RecPoints2Clusters(fOutputAODBranch);
}
-//________________________________________________________________________
-void AliAnalysisTaskEMCALClusterizeFast::StoreAdditionalInformation()
-{
- if (fClusterizer->ClassName() != TString("AliEMCALClusterizerFixedWindow"))
- return;
-
- TString addInfoName(fNewClusterArrayName);
- addInfoName.Append("_AbsIds");
-
- AliEMCALFixedWindowClusterInfo *clusInfo = dynamic_cast<AliEMCALFixedWindowClusterInfo*>(InputEvent()->FindListObject(addInfoName));
-
- if(!clusInfo)
- {
- AliEMCALClusterizerFixedWindow *clusterizer = dynamic_cast<AliEMCALClusterizerFixedWindow*> (fClusterizer);
- if (!clusterizer)
- return;
- clusInfo = clusterizer->GetClustersInfo();
- if (!clusInfo)
- return;
- clusInfo->SetName(addInfoName);
- InputEvent()->AddObject(clusInfo);
- }
-}
-
//________________________________________________________________________
void AliAnalysisTaskEMCALClusterizeFast::Clusterize()
{
//________________________________________________________________________
void AliAnalysisTaskEMCALClusterizeFast::FillDigitsArray()
{
- if (fCreatePattern)
- {
+ // Fill digits array
+
+ fDigitsArr->Clear("C");
+
+ if (fCreatePattern){
AliEMCALGeometry *fGeom = AliEMCALGeometry::GetInstance(fGeomName);
-
- fDigitsArr->Clear("C");
+
Int_t maxd = fGeom->GetNCells() / 4;
- for (Int_t idigit = 0; idigit < maxd; idigit++)
- {
+ for (Int_t idigit = 0; idigit < maxd; idigit++){
if (idigit % 24 == 12) idigit += 12;
AliEMCALDigit *digit = static_cast<AliEMCALDigit*>(fDigitsArr->New(idigit));
digit->SetId(idigit * 4);
}
}
- else
- {
+ else if (fClusterizeFastORs){
+
+ AliEMCALGeometry *fGeom = AliEMCALGeometry::GetInstance(fGeomName);
+
+ AliESDEvent* esd = dynamic_cast<AliESDEvent*>(InputEvent());
+ if (!esd){
+ AliError("Cannot get the ESD event");
+ return;
+ }
+
+ AliESDCaloTrigger *triggers = esd->GetCaloTrigger("EMCAL");
+
+ if (!triggers || !(triggers->GetEntries() > 0))
+ return;
+
+ Int_t idigit = 0;
+ triggers->Reset();
+
+ while ((triggers->Next())){
+ Float_t triggerAmplitude = 0;
+ triggers->GetAmplitude(triggerAmplitude);
+ if (triggerAmplitude <= 0)
+ continue;
+
+ Int_t triggerTime = 0;
+ Int_t ntimes = 0;
+ triggers->GetNL0Times(ntimes);
+ if (ntimes > 0){
+ Int_t trgtimes[25];
+ triggers->GetL0Times(trgtimes);
+ triggerTime = trgtimes[0];
+ }
+
+ Int_t triggerCol = 0, triggerRow = 0;
+ triggers->GetPosition(triggerCol, triggerRow);
+
+ Int_t find = -1;
+ fGeom->GetAbsFastORIndexFromPositionInEMCAL(triggerCol, triggerRow, find);
+
+ if (find<0)
+ continue;
+
+ Int_t cidx[4] = {-1};
+ Bool_t ret = fGeom->GetCellIndexFromFastORIndex(find, cidx);
+
+ if (!ret)
+ continue;
+
+ for (Int_t idxpos = 0; idxpos < 4; idxpos++){
+ Int_t triggerNumber = cidx[idxpos];
+ AliEMCALDigit *digit = static_cast<AliEMCALDigit*>(fDigitsArr->New(idigit));
+ digit->SetId(triggerNumber);
+ digit->SetTime(triggerTime);
+ digit->SetTimeR(triggerTime);
+ digit->SetIndexInList(idigit);
+ digit->SetType(AliEMCALDigit::kHG);
+ digit->SetAmplitude(triggerAmplitude);
+ idigit++;
+ }
+ }
+ }
+ else{
// Fill digits from cells.
- fDigitsArr->Clear("C");
AliVCaloCells *cells = InputEvent()->GetEMCALCells();
Double_t avgE = 0; // for background subtraction
Int_t ncells = cells->GetNumberOfCells();
c->SetDispersion(recpoint->GetDispersion());
c->SetEmcCpvDistance(-1); //not yet implemented
c->SetChi2(-1); //not yet implemented
+ recpoint->EvalAll(1, fDigitsArr, kTRUE);
c->SetTOF(recpoint->GetTime()) ; //time-of-flight
c->SetNExMax(recpoint->GetNExMax()); //number of local maxima
Float_t elipAxis[2];
AliESDCaloCluster *cesd = static_cast<AliESDCaloCluster*>(c);
cesd->SetCellsAbsId(absIds);
cesd->SetCellsAmplitudeFraction(ratios);
+ cesd->SetID(recpoint->GetIndexInList());
} else {
AliAODCaloCluster *caod = static_cast<AliAODCaloCluster*>(c);
caod->SetCellsAbsId(absIds);
} else {
fClusterizer->SetInputCalibrated(kTRUE);
}
- fClusterizer->SetCaloCalibPedestal(fPedestalData);
+ if(fRecParam->GetClusterizerFlag() != AliEMCALRecParam::kClusterizerFW)
+ fClusterizer->SetCaloCalibPedestal(fPedestalData);
fClusterizer->SetJustClusters(kTRUE);
fClusterizer->SetDigitsArr(fDigitsArr);
fClusterizer->SetOutput(0);
void SetShiftPhi(Int_t n) { fShiftPhi = n ; }
void SetShiftEta(Int_t n) { fShiftEta = n ; }
void SetTRUShift(Bool_t yes) { fTRUShift = yes ; }
- void SetStoreAdditionalInformation(Bool_t yes) { fStoreAdditionalInformation = yes ; }
+ void SetClusterizeFastORs(Bool_t yes) { fClusterizeFastORs = yes ; if (yes) fOverwrite = kFALSE; }
protected:
virtual void Clusterize();
virtual void RecPoints2Clusters(TClonesArray *clus);
virtual void UpdateCells();
virtual void UpdateClusters();
- virtual void StoreAdditionalInformation();
Int_t fRun; //!run number
TClonesArray *fDigitsArr; //!digits array
Int_t fShiftPhi; // ShiftPhi (for FixedWindowsClusterizer)
Int_t fShiftEta; // ShiftEta (for FixedWindowsClusterizer)
Bool_t fTRUShift; // Shifting inside a TRU (true) or through the whole calorimeter (false) (for FixedWindowsClusterizer)
- Bool_t fStoreAdditionalInformation; // Store additional information (for FixedWindowsClusterizer)
+ Bool_t fClusterizeFastORs; // If true, clusterize FastORs instead of cells
private:
AliAnalysisTaskEMCALClusterizeFast(const AliAnalysisTaskEMCALClusterizeFast&); // not implemented
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-// --- Root ---
-#include <Riostream.h>
-#include <TChain.h>
-#include <TTree.h>
-#include <TFile.h>
-#include <TList.h>
-
-// --- AliRoot ---
-#include "AliAnalysisTaskSE.h"
-#include "AliAnalysisManager.h"
-#include "AliStack.h"
-#include "AliESDEvent.h"
-#include "AliESDInputHandler.h"
-#include "AliAODEvent.h"
-#include "AliMCEvent.h"
-#include "AliEMCALGeometry.h"
-#include "AliCaloCalibPedestal.h"
-#include "AliEMCALFastORPatch.h"
-
-#include "AliAnalysisTaskEMCALFastOR2Trigger.h"
-
-ClassImp(AliAnalysisTaskEMCALFastOR2Trigger)
-
-//________________________________________________________________________
-AliAnalysisTaskEMCALFastOR2Trigger::AliAnalysisTaskEMCALFastOR2Trigger()
- : AliAnalysisTaskSE(),
- fNcol(2),
- fNrow(2),
- fShiftCol(1),
- fShiftRow(1),
- fTriggerClustersName("triggerClusters"),
- fTimeCutOn(1),
- fMinL0Time(7),
- fMaxL0Time(9),
- fCheckDeadClusters(0),
- fPedestal(0)
-{
- // Constructor
-}
-
-//________________________________________________________________________
-AliAnalysisTaskEMCALFastOR2Trigger::AliAnalysisTaskEMCALFastOR2Trigger(const char *name)
- : AliAnalysisTaskSE(name),
- fNcol(2),
- fNrow(2),
- fShiftCol(1),
- fShiftRow(1),
- fTriggerClustersName("triggerClusters"),
- fTimeCutOn(1),
- fMinL0Time(7),
- fMaxL0Time(9),
- fCheckDeadClusters(0),
- fPedestal(0)
-{
- // Constructor
-
-}
-
-//________________________________________________________________________
-AliAnalysisTaskEMCALFastOR2Trigger::~AliAnalysisTaskEMCALFastOR2Trigger()
-{
- // Destructor
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskEMCALFastOR2Trigger::UserCreateOutputObjects()
-{
- // Create output objects
-}
-
-//________________________________________________________________________
-void AliAnalysisTaskEMCALFastOR2Trigger::UserExec(Option_t *)
-{
- // Main loop, called for each event
-
- // Create pointer to reconstructed event
- AliVEvent *event = InputEvent();
- if (!event) {
- AliWarning("Could not retrieve event");
- return;
- }
-
- // create pointer to event
- AliESDEvent* esd = dynamic_cast<AliESDEvent*>(event);
- if (!esd) {
- AliError("Cannot get the ESD event");
- return;
- }
-
- AliESDCaloTrigger *triggers = esd->GetCaloTrigger("EMCAL");
-
- if (!triggers || !(triggers->GetEntries() > 0))
- return;
-
- AliEMCALGeometry *fGeom = AliEMCALGeometry::GetInstance(AliEMCALGeometry::GetDefaultGeometryName());
- Int_t nSupMod = 0, nModule = 0, nIphi = 0, nIeta = 0, iphi = 0, ieta = 0;
-
- // -------------------------------
- // Trigger clusterizer parameters
-
- Int_t totalCols = 48;
- Int_t totalRows = 60;
- Int_t nTRURow = 15;
- Int_t nTRUCol = 2;
- Int_t nColFastOR = totalCols / nTRUCol;
- Int_t nRowFastOR = totalRows / nTRURow;
- Int_t maxiShiftRow = fNrow / fShiftRow;
- Int_t maxiShiftCol = fNcol / fShiftCol;
- Int_t nFastORCluster = fNcol * fNrow;
- Int_t nTriggerClusters = totalRows * totalCols / fNcol / fNrow;
- Int_t nTotalClus = nTriggerClusters * maxiShiftCol * maxiShiftRow;
- Int_t nClusRowNoShift = nRowFastOR / fNrow;
- //Int_t nClusColNoShift = nColFastOR / fNcol;
-
- // -------------------------------
-
- TClonesArray *triggers_array = dynamic_cast<TClonesArray*>(InputEvent()->FindListObject(fTriggerClustersName));
- if(!triggers_array){
- triggers_array = new TClonesArray("AliESDCaloTrigger", nTotalClus);
- triggers_array->SetName(fTriggerClustersName);
- InputEvent()->AddObject(triggers_array);
- }
- else {
- triggers_array->Delete();
- }
-
- Bool_t *dead_clusters = new Bool_t[nTotalClus];
- for (Int_t i = 0; i < nTotalClus; i++){
- dead_clusters[i] = kFALSE;
- }
-
- triggers->Reset();
-
- while (triggers->Next()) {
- Float_t L0FastORamp = 0;
-
- triggers->GetAmplitude(L0FastORamp);
-
- if (L0FastORamp < 0)
- continue;
-
- if (fTimeCutOn){
- Int_t ntimes = 0;
- triggers->GetNL0Times(ntimes);
-
- if (ntimes < 1)
- continue;
-
- Int_t trgtimes[25];
- triggers->GetL0Times(trgtimes);
-
- Bool_t trgInTimeWindow = 0;
- for (Int_t i = 0; i < ntimes; i++) {
- if ((fMaxL0Time >= trgtimes[i]) && (fMinL0Time <= trgtimes[i]))
- trgInTimeWindow = 1;
- }
-
- if (!trgInTimeWindow)
- continue;
- }
-
- Int_t gCol = 0, gRow = 0;
-
- triggers->GetPosition(gCol, gRow);
-
- Int_t find = -1;
- fGeom->GetAbsFastORIndexFromPositionInEMCAL(gCol, gRow, find);
-
- if (find<0)
- continue;
-
- Int_t cidx[4] = {-1};
- Bool_t ret = fGeom->GetCellIndexFromFastORIndex(find, cidx);
-
- if (!ret)
- continue;
-
- Bool_t deadCluster = kFALSE;
-
- if (fCheckDeadClusters && fPedestal){
- for (Int_t i = 0; i < 4; i++){
- fGeom->GetCellIndex (cidx[i], nSupMod, nModule, nIphi, nIeta);
- fGeom->GetCellPhiEtaIndexInSModule (nSupMod, nModule, nIphi, nIeta, iphi, ieta);
-
- Double_t d = fPedestal->GetDeadMap(nSupMod)->GetBinContent(ieta,iphi);
- if (d == AliCaloCalibPedestal::kDead || d == AliCaloCalibPedestal::kHot){
- deadCluster = kTRUE;
- }
- }
- }
-
- // --------------------------
- // Trigger clusterizer
-
- for (Int_t ishiftRow = 0; ishiftRow < maxiShiftRow; ishiftRow++){
- Int_t nClusRow = (nRowFastOR - fShiftRow * ishiftRow) / fNrow;
-
- for (Int_t ishiftCol = 0; ishiftCol < maxiShiftCol; ishiftCol++){
- Int_t iTotalClus = nTriggerClusters * (ishiftRow * maxiShiftCol + ishiftCol);
-
- Int_t nClusCol = (nColFastOR - fShiftCol * ishiftCol) / fNcol;
-
- Int_t irow_eff = gRow - fShiftRow * ishiftRow;
- Int_t iTRUrow = irow_eff / nRowFastOR;
- irow_eff -= iTRUrow * nRowFastOR;
- Int_t iClusRow = irow_eff / fNrow;
-
- if (irow_eff < 0 || iClusRow >= nClusRow)
- continue;
-
- Int_t icol_eff = gCol - fShiftCol * ishiftCol;
- Int_t iTRUcol = icol_eff / nColFastOR;
- icol_eff -= iTRUcol * nColFastOR;
- Int_t iClusCol = icol_eff / fNcol;
-
- if (icol_eff < 0 || iClusCol >= nClusCol)
- continue;
-
- irow_eff += iTRUrow * nRowFastOR;
- iClusRow = irow_eff / fNrow;
-
- icol_eff += iTRUcol * nColFastOR;
- iClusCol = icol_eff / fNcol;
-
- Int_t iTriggerCluster = iClusRow + iClusCol * nClusRowNoShift * nTRURow + iTotalClus;
- Int_t iTriggerDigit = irow_eff % fNrow + (icol_eff % fNcol) * fNrow;
-
- if (dead_clusters[iTriggerCluster] && fCheckDeadClusters) deadCluster = kTRUE;
-
- if (deadCluster){
- dead_clusters[iTriggerCluster] = kTRUE;
- if (triggers_array->At(iTriggerCluster)){
- triggers_array->RemoveAt(iTriggerCluster);
- }
- continue;
- }
-
- if (!triggers_array->At(iTriggerCluster)){
- (*triggers_array)[iTriggerCluster] = new AliEMCALFastORPatch(iTriggerCluster, nFastORCluster);
- }
-
- AliEMCALFastORPatch *triggerCluster = dynamic_cast<AliEMCALFastORPatch*>(triggers_array->At(iTriggerCluster));
-
- if (triggerCluster->GetFastORamplitude(iTriggerDigit) > -1){
- AliWarning("FastOR already added!");
- return;
- }
-
- triggerCluster->AddFastORat(L0FastORamp, gCol, gRow, iTriggerDigit);
-
- } // loop on col shift
-
- } // loop on row shift
-
- // ------------------------------
-
- } // loop on L0 FastOR triggers
-
- delete[] dead_clusters;
-
- triggers_array->Compress();
-}
+++ /dev/null
-/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * See cxx source for full Copyright notice */
-
-/* $Id$ */
-
-
-#ifndef ALIANALYSISTASKEMCALFASTOR2TRIGGER_H
-#define ALIANALYSISTASKEMCALFASTOR2TRIGGER_H
-
-class TList;
-class TTree;
-class AliEMCALFastORPatch;
-class AliCaloCalibPedestal;
-
-#include "AliAnalysisTaskSE.h"
-
-class AliAnalysisTaskEMCALFastOR2Trigger : public AliAnalysisTaskSE {
-public:
- AliAnalysisTaskEMCALFastOR2Trigger();
- AliAnalysisTaskEMCALFastOR2Trigger(const char *name);
- virtual ~AliAnalysisTaskEMCALFastOR2Trigger();
-
-public:
- virtual void UserCreateOutputObjects();
- virtual void UserExec(Option_t *option);
-
- Bool_t GetCheckDeadClusters() const { return fCheckDeadClusters; }
- AliCaloCalibPedestal* GetPedestal() const { return fPedestal; }
- Int_t GetnCol() const { return fNcol; }
- Int_t GetnRow() const { return fNrow; }
- Int_t GetshiftCol() const { return fShiftCol; }
- Int_t GetshiftRow() const { return fShiftRow; }
- Int_t GetMinL0Time() const { return fMinL0Time; }
- Int_t GetMaxL0Time() const { return fMaxL0Time; }
- Bool_t GetTimeCutOn() const { return fTimeCutOn; }
- void SetCheckDeadClusters(Bool_t c) { fCheckDeadClusters = c; }
- void SetPedestal(AliCaloCalibPedestal *pds) { fPedestal = pds; }
- void SetnCol(Int_t n) { fNcol = n; }
- void SetnRow(Int_t n) { fNrow = n; }
- void SetshiftCol(Int_t n) { fShiftCol = n; }
- void SetshiftRow(Int_t n) { fShiftRow = n; }
- void SetTriggerClustersName(const TString &name) { fTriggerClustersName = name; }
- void SetMinL0Time(Int_t t) { fMinL0Time = t; }
- void SetMaxL0Time(Int_t t) { fMaxL0Time = t; }
- void SetTimeCutOn(Bool_t yes) { fTimeCutOn = yes; }
-
-protected:
- Int_t fNcol; // Fixed window number of cells in phi direction
- Int_t fNrow; // Fixed window number of cells in eta direction
- Int_t fShiftCol; // Shifting number of cells in phi direction
- Int_t fShiftRow; // Shifting number of cells in eta direction
- TString fTriggerClustersName; // Name of the TClonesObject that will contain the computed triggers
- Bool_t fTimeCutOn; // Determines whether or not apply time cuts
- Int_t fMinL0Time; // Minimum L0 time cut
- Int_t fMaxL0Time; // Maximum L0 time cut
- Bool_t fCheckDeadClusters; // Determines whether or not check for dead clusters
- AliCaloCalibPedestal *fPedestal; //!Pointer to an object containing information about dead clusters
-
-private:
- AliAnalysisTaskEMCALFastOR2Trigger (const AliAnalysisTaskEMCALFastOR2Trigger&); // not implemented
- AliAnalysisTaskEMCALFastOR2Trigger operator=(const AliAnalysisTaskEMCALFastOR2Trigger&); // not implemented
-
- ClassDef(AliAnalysisTaskEMCALFastOR2Trigger, 1);
-};
-
-#endif
-
+++ /dev/null
-/**************************************************************************
- * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
- * *
- * Author: The ALICE Off-line Project. *
- * Contributors are mentioned in the code where appropriate. *
- * *
- * Permission to use, copy, modify and distribute this software and its *
- * documentation strictly for non-commercial purposes is hereby granted *
- * without fee, provided that the above copyright notice appears in all *
- * copies and that both the copyright notice and this permission notice *
- * appear in the supporting documentation. The authors make no claims *
- * about the suitability of this software for any purpose. It is *
- * provided "as is" without express or implied warranty. *
- **************************************************************************/
-
-/* $Id$ */
-
-// --- Root ---
-#include <TObject.h>
-#include <TArrayI.h>
-#include <TArrayF.h>
-
-// --- AliRoot ---
-#include "AliESDCaloTrigger.h"
-
-#include "AliEMCALFastORPatch.h"
-
-ClassImp(AliEMCALFastORPatch)
-
-//________________________________________________________________________
-AliEMCALFastORPatch::AliEMCALFastORPatch()
- : TObject(),
- fAbsId(-1),
- fFastORamplitudes(new TArrayF(0)),
- fFastORcolumns(new TArrayI(0)),
- fFastORrows(new TArrayI(0))
-{
- // Constructor
-}
-
-//________________________________________________________________________
-AliEMCALFastORPatch::AliEMCALFastORPatch(Int_t aid, Int_t size)
- : TObject(),
- fAbsId(aid),
- fFastORamplitudes(new TArrayF(size)),
- fFastORcolumns(new TArrayI(size)),
- fFastORrows(new TArrayI(size))
-{
- // Constructor
-
- fFastORamplitudes->Reset(-1);
- fFastORrows->Reset(-1);
- fFastORcolumns->Reset(-1);
-}
-
-//________________________________________________________________________
-AliEMCALFastORPatch::~AliEMCALFastORPatch()
-{
- // Destructor
- delete fFastORamplitudes;
- delete fFastORcolumns;
- delete fFastORrows;
-}
-
-//________________________________________________________________________
-Float_t AliEMCALFastORPatch::GetTotalAmplitude() const
-{
- // Return total amplitude of the patch
-
- Float_t total = 0;
- for (Int_t i = 0; i < GetNumberOfFastOR(); i++){
- Float_t amp = GetFastORamplitude(i);
- if (amp > 0)
- total += amp;
- }
- return total;
-}
-
-//________________________________________________________________________
-Float_t AliEMCALFastORPatch::GetFastORamplitude(Int_t i) const
-{
- // Return amplitude of FastOR at position i
-
- if (i < 0 || i > GetNumberOfFastOR()) return -1;
- return fFastORamplitudes->At(i);
-}
-
-//________________________________________________________________________
-Int_t AliEMCALFastORPatch::GetFastORrow(Int_t i) const
-{
- // Return row number of FastOR at position i
-
- if (i < 0 || i > GetNumberOfFastOR()) return -1;
- return fFastORrows->At(i);
-}
-
-//________________________________________________________________________
-Int_t AliEMCALFastORPatch::GetFastORcolumn(Int_t i) const
-{
- // Return column number of FastOR at position i
-
- if (i < 0 || i > GetNumberOfFastOR()) return -1;
- return fFastORcolumns->At(i);
-}
-
-//________________________________________________________________________
-Int_t AliEMCALFastORPatch::GetNumberOfFastOR() const
-{
- // Return total number of FastORs
-
- return fFastORamplitudes->GetSize();
-}
-
-//________________________________________________________________________
-Bool_t AliEMCALFastORPatch::AddFastORat(AliESDCaloTrigger* f, Int_t i)
-{
- // Add a FastOR to the patch and return true if done
-
- Float_t amp = 0;
- Int_t gCol = 0, gRow = 0;
- f->GetAmplitude(amp);
- f->GetPosition(gCol, gRow);
-
- return AddFastORat(amp, gCol, gRow, i);
-}
-
-//________________________________________________________________________
-Bool_t AliEMCALFastORPatch::AddFastORat(Float_t amp, Int_t gCol, Int_t gRow, Int_t i)
-{
- // Add a FastOR to the patch and return true if done
-
- if (i < 0) return kFALSE;
-
- if (i > GetNumberOfFastOR()) Expand(i + 1);
-
- fFastORamplitudes->AddAt(amp, i);
- fFastORrows->AddAt(gRow, i);
- fFastORcolumns->AddAt(gCol, i);
-
- return kTRUE;
-}
-
-//________________________________________________________________________
-void AliEMCALFastORPatch::RemoveFastORat(Int_t i)
-{
- // Remove a FastOR from the patch
-
- fFastORamplitudes->AddAt(-1, i);
- fFastORrows->AddAt(-1, i);
- fFastORcolumns->AddAt(-1, i);
-}
-
-//________________________________________________________________________
-void AliEMCALFastORPatch::Expand(Int_t size)
-{
- // Expand the arrays
-
- fFastORamplitudes->Set(size);
- fFastORcolumns->Set(size);
- fFastORrows->Set(size);
-}
-
-//________________________________________________________________________
-Bool_t AliEMCALFastORPatch::Contains(Int_t row, Int_t col) const
-{
- // Check if a col, row FastOR is present in the arrays
-
- for (Int_t i = 0; i < GetNumberOfFastOR(); i++){
- if (col == fFastORcolumns->At(i) && row == fFastORrows->At(i))
- return kTRUE;
- }
- return kFALSE;
-}
+++ /dev/null
-#ifndef ALIEMCALFASTORPATCH_H
-#define ALIEMCALFASTORPATCH_H
-
-// $Id$
-
-class TArrayF;
-class TArrayI;
-class AliESDCaloTrigger;
-
-#include <TObject.h>
-
-class AliEMCALFastORPatch : public TObject {
-
-public:
- AliEMCALFastORPatch();
- AliEMCALFastORPatch(Int_t aid, Int_t size = 4);
- virtual ~AliEMCALFastORPatch();
-
-public:
- Int_t GetAbsId() const { return fAbsId; }
- void SetAbsId(Int_t aid) { fAbsId = aid; }
-
- Float_t GetTotalAmplitude() const;
- Float_t GetFastORamplitude(Int_t i) const;
- Int_t GetNumberOfFastOR() const;
- Int_t GetFastORrow(Int_t i) const;
- Int_t GetFastORcolumn(Int_t i) const;
- Bool_t Contains(Int_t row, Int_t col) const;
- Bool_t AddFastORat(AliESDCaloTrigger* f, Int_t i);
- Bool_t AddFastORat(Float_t amp, Int_t gCol, Int_t gRow, Int_t i);
- void RemoveFastORat(Int_t i);
- void Expand(Int_t size);
-
-protected:
- Int_t fAbsId; // Unique ID of the FastOR patch (trigger)
- TArrayF *fFastORamplitudes; // Array containing amplitudes of the FastORs
- TArrayI *fFastORcolumns; // Array containing column position of the FastORs
- TArrayI *fFastORrows; // Array containing row position of the FastORs
-
-private:
- AliEMCALFastORPatch(const AliEMCALFastORPatch&); // not implemented
- AliEMCALFastORPatch &operator=(const AliEMCALFastORPatch&); // not implemented
-
- ClassDef(AliEMCALFastORPatch, 1);
-};
-#endif //ALIEMCALFASTORPATCH_H