#include "AliEMCALDigit.h"
#include "AliCaloCalibPedestal.h"
#include "AliEMCALCalibData.h"
+#include "AliEMCALRecoUtils.h"
#include "AliAnalysisTaskEMCALClusterize.h"
, fDigitsArr(0), fClusterArr(0), fCaloClusterArr(0)
, fRecParam(0), fClusterizer(0), fUnfolder(0), fJustUnfold(kFALSE)
, fOutputAODBranch(0), fOutputAODBranchName("newEMCALClusters"), fFillAODFile(kTRUE)
- , fRun(-1)
+ , fRun(-1), fRecoUtils(0)
{
//ctor
fClusterArr = new TObjArray(100);
fCaloClusterArr = new TObjArray(100);
fRecParam = new AliEMCALRecParam;
- fBranchNames="ESD:AliESDHeader.,EMCALCells.";
+ fBranchNames = "ESD:AliESDHeader.,EMCALCells.";
+ fRecoUtils = new AliEMCALRecoUtils();
}
//________________________________________________________________________
, fDigitsArr(0), fClusterArr(0), fCaloClusterArr(0)
, fRecParam(0), fClusterizer(0), fUnfolder(0), fJustUnfold(kFALSE)
, fOutputAODBranch(0), fOutputAODBranchName("newEMCALClusters"), fFillAODFile(kFALSE)
- , fRun(-1)
+ , fRun(-1), fRecoUtils(0)
{
// Constructor
for(Int_t i = 0; i < 10; i++) fGeomMatrix[i] = 0 ;
fClusterArr = new TObjArray(100);
fCaloClusterArr = new TObjArray(100);
fRecParam = new AliEMCALRecParam;
- fBranchNames="ESD:AliESDHeader.,EMCALCells.";
+ fBranchNames = "ESD:AliESDHeader.,EMCALCells.";
+ fRecoUtils = new AliEMCALRecoUtils();
}
//________________________________________________________________________
delete fCaloClusterArr;
}
- if(fClusterizer) {delete fClusterizer;}
- if(fUnfolder) {delete fUnfolder; }
+ if(fClusterizer) delete fClusterizer;
+ if(fUnfolder) delete fUnfolder;
+ if(fRecoUtils) delete fRecoUtils;
+
}
//-------------------------------------------------------------------
//Remove the contents of output list set in the previous event
fOutputAODBranch->Clear("C");
- AliVEvent * event = InputEvent();
+ AliVEvent * event = InputEvent();
+ AliESDEvent * esdevent = dynamic_cast<AliESDEvent*>(InputEvent());
+
if (!event) {
Error("UserExec","Event not available");
return;
digitsTree ->Delete("all");
}
+ //Recalculate track-matching for the new clusters, only with ESDs
+ if(esdevent)fRecoUtils->FindMatches(esdevent,fCaloClusterArr);
+
+
//-------------------------------------------------------------------------------------
//Put the new clusters in the AOD list
//-------------------------------------------------------------------------------------
for(Int_t i = 0; i < kNumberOfCaloClusters; i++){
AliAODCaloCluster *newCluster = (AliAODCaloCluster *) fCaloClusterArr->At(i);
//if(Entry()==0) Info("UserExec","newCluster E %f\n", newCluster->E());
+
+ //Add matched track, if any, only with ESDs
+ if(esdevent){
+ Int_t trackIndex = fRecoUtils->GetMatchedTrackIndex(i);
+ if(trackIndex >= 0){
+ newCluster->AddTrackMatched(event->GetTrack(trackIndex));
+ if(DebugLevel() > 1)
+ Info("UserExec","Matched Track index %d to new cluster %d \n",trackIndex,i);
+ }
+ }
new((*fOutputAODBranch)[i]) AliAODCaloCluster(*newCluster);
}
AliVEvent * event = InputEvent();
if (!event)
{
- Warning("AccessODCD","Event not available!!!");
+ Warning("AccessOCDB","Event not available!!!");
return kFALSE;
}
Info("AccessODCD()"," Begin");
fGeom = AliEMCALGeometry::GetInstance(fGeomName);
+
+
AliCDBManager *cdb = AliCDBManager::Instance();
- if (fOCDBpath.Length())
+
+
+ if (fOCDBpath.Length()){
cdb->SetDefaultStorage(fOCDBpath.Data());
+ Info("AccessOCDB","Default storage %s",fOCDBpath.Data());
+ }
+
cdb->SetRun(event->GetRunNumber());
+
//
// EMCAL from RAW OCDB
if (fOCDBpath.Contains("alien:"))
cdb->SetSpecificStorage("EMCAL/Calib/Data","alien://Folder=/alice/data/2010/OCDB");
cdb->SetSpecificStorage("EMCAL/Calib/Pedestals","alien://Folder=/alice/data/2010/OCDB");
}
+
TString path = cdb->GetDefaultStorage()->GetBaseFolder();
-
+
// init parameters:
+
//Get calibration parameters
if(!fCalibData)
{
AliCDBEntry *entry = (AliCDBEntry*)
AliCDBManager::Instance()->Get("EMCAL/Calib/Data");
+
if (entry) fCalibData = (AliEMCALCalibData*) entry->GetObject();
}
{
AliCDBEntry *entry = (AliCDBEntry*)
AliCDBManager::Instance()->Get("EMCAL/Calib/Pedestals");
+
if (entry) fPedestalData = (AliCaloCalibPedestal*) entry->GetObject();
}
AliFatal("Dead map not found in CDB!");
InitClusterization();
+
return kTRUE;
}
class AliEMCALClusterizer;\r
class AliEMCALAfterBurnerUF;\r
class AliEMCALRecParam;\r
+class AliEMCALRecoUtils;\r
+\r
\r
#include "AliAnalysisTaskSE.h"\r
\r
\r
//Geometry methods\r
void SetGeometryName(TString &name) { fGeomName = name ; }\r
- TString GeometryName() const { return fGeomName ; } \r
+ TString GeometryName() const { return fGeomName ; } \r
void SwitchOnLoadOwnGeometryMatrices() { fLoadGeomMatrices = kTRUE ; }\r
void SwitchOffLoadOwnGeometryMatrices() { fLoadGeomMatrices = kFALSE ; } \r
void SetGeometryMatrixInSM(TGeoHMatrix* m, Int_t i) { fGeomMatrix[i] = m ; }\r
\r
//Algorithms settings\r
void JustUnfold(Bool_t yesno) { fJustUnfold = yesno ; }\r
- AliEMCALRecParam * GetRecParam() const { return fRecParam ; }\r
+ AliEMCALRecParam * GetRecParam() const { return fRecParam ; }\r
void InitClusterization();\r
\r
+ void SetEMCALRecoUtils(AliEMCALRecoUtils * ru) { fRecoUtils = ru ; }\r
+ AliEMCALRecoUtils* GetRecoUtils() const { return fRecoUtils ; }\r
+ \r
private:\r
\r
virtual void RecPoints2Clusters(TClonesArray *fdigitsArr, TObjArray *fRecPoints, TObjArray *clusArray);\r
TString fOutputAODBranchName; // New of output AOD branch\r
Bool_t fFillAODFile; // Fill the output AOD file with the new clusters, \r
// if not they will be only available for the event they were generated\r
- Int_t fRun; //!run number\r
- ClassDef(AliAnalysisTaskEMCALClusterize, 1);\r
+ Int_t fRun; //!run number\r
+ \r
+ AliEMCALRecoUtils* fRecoUtils; // Access to factorized reconstruction algorithms\r
+ \r
+ \r
+ ClassDef(AliAnalysisTaskEMCALClusterize, 2);\r
};\r
\r
#endif //ALIANALYSISTASKEMCALCLUSTERIZE_H\r
}
mgr->SetDebugLevel(1);
+
+ // Create containers for input/output
+ AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
+ AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
//-------------------------------------------------------------------------
//Define task, put here any other task that you want to use.
//-------------------------------------------------------------------------
- AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
- AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
// ESD physics selection task
if(kInputData == "ESD" && kUsePhysSel){
gROOT->LoadMacro("AddTaskPhysicsSelection.C");
AliPhysicsSelectionTask* physSelTask = AddTaskPhysicsSelection();
}
-
- // Create containers for input/output
- AliAnalysisDataContainer *cinput1 = mgr->GetCommonInputContainer();
- AliAnalysisDataContainer *coutput1 = mgr->GetCommonOutputContainer();
AliAnalysisTaskEMCALClusterize * clusterize = new AliAnalysisTaskEMCALClusterize("EMCALClusterize");
if(kUsePhysSel)clusterize->SelectCollisionCandidates();
- //clusterize->SetOCDBPath("local://$ALICE_ROOT/OCDB");
+ //clusterize->SetOCDBPath("local://$ALICE_ROOT/OCDB"); // by default it is raw://
clusterize->FillAODFile(kFALSE); // fill aod.root with clusters?, not really needed for analysis.
clusterize->JustUnfold(kTRUE); // if TRUE, do just unfolding, do not recluster cells
AliEMCALRecParam * params = clusterize->GetRecParam();