* provided "as is" without express or implied warranty. *
**************************************************************************/
-/* $Id$ */
+//_________________________________________________________________________
+// This analysis provides a new list of clusters to be used in other analysis
+//
+// Author: Constantin Loizides, Salvatore Aiola
+// Adapted from analysis class from Deepa Thomas
+//
+// $Id$
+//_________________________________________________________________________
// --- Root ---
#include <TClonesArray.h>
fShiftEta(2),
fTRUShift(0),
fClusterizeFastORs(0),
- fTrackName()
+ fTrackName(),
+ fCutL0Times(kTRUE)
{
// Constructor
fShiftEta(2),
fTRUShift(0),
fClusterizeFastORs(0),
- fTrackName()
+ fTrackName(),
+ fCutL0Times(kTRUE)
{
// Constructor
{
// Destructor.
- //delete fDigitsArr;
delete fClusterizer;
delete fUnfolder;
delete fRecoUtils;
} else if (fClusterizeFastORs) { // Fill digits from FastORs
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");
+ AliVCaloTrigger *triggers = InputEvent()->GetCaloTrigger("EMCAL");
if (!triggers || !(triggers->GetEntries() > 0))
return;
Int_t triggerTime = 0;
Int_t ntimes = 0;
triggers->GetNL0Times(ntimes);
- if (ntimes > 0) {
- Int_t trgtimes[25];
- triggers->GetL0Times(trgtimes);
- triggerTime = trgtimes[0];
- }
-
+ if (!(ntimes > 0) && fCutL0Times)
+ continue;
+
+ Int_t trgtimes[25];
+ triggers->GetL0Times(trgtimes);
+ triggerTime = trgtimes[0];
+
Int_t triggerCol = 0, triggerRow = 0;
triggers->GetPosition(triggerCol, triggerRow);
Double_t avgE = 0; // for background subtraction
const Int_t ncells = cells->GetNumberOfCells();
for (Int_t icell = 0, idigit = 0; icell < ncells; ++icell) {
- Double_t cellAmplitude=0, cellTime=0;
- Short_t cellNumber=0;
- if (cells->GetCell(icell, cellNumber, cellAmplitude, cellTime) != kTRUE)
+ Double_t cellAmplitude=0, cellTime=0, cellEFrac = 0;
+ Short_t cellNumber=0, cellMCLabel=-1;
+ if (cells->GetCell(icell, cellNumber, cellAmplitude, cellTime, cellMCLabel, cellEFrac) != kTRUE)
break;
AliEMCALDigit *digit = static_cast<AliEMCALDigit*>(fDigitsArr->New(idigit));
digit->SetId(cellNumber);
AliVCaloCells *cells = InputEvent()->GetEMCALCells();
AliEMCALGeometry *geom = AliEMCALGeometry::GetInstance(fGeomName);
- AliESDEvent *esdevent = dynamic_cast<AliESDEvent*>(InputEvent());
+ AliVEvent *event = InputEvent();
+ if (!event) {
+ AliError("Cannot get the event");
+ return;
+ }
// tracks array for track/cluster matching
TClonesArray *tarr = 0;
if (!fTrackName.IsNull()) {
- tarr = dynamic_cast<TClonesArray*>(esdevent->FindListObject(fTrackName));
+ tarr = dynamic_cast<TClonesArray*>(event->FindListObject(fTrackName));
if (!tarr) {
AliError(Form("Cannot get tracks named %s", fTrackName.Data()));
}
}
- const Int_t Ncls = fClusterArr->GetEntriesFast();
+ const Int_t Ncls = fClusterArr->GetEntries();
AliDebug(1, Form("total no of clusters %d", Ncls));
for(Int_t i=0, nout=clus->GetEntries(); i < Ncls; ++i) {
AliEMCALRecPoint *recpoint = static_cast<AliEMCALRecPoint*>(fClusterArr->At(i));
c->SetE(recpoint->GetEnergy());
c->SetPosition(g);
c->SetNCells(ncells_true);
+ if (esdobjects) {
+ AliESDCaloCluster *cesd = static_cast<AliESDCaloCluster*>(c);
+ cesd->SetCellsAbsId(absIds);
+ cesd->SetCellsAmplitudeFraction(ratios);
+ cesd->SetID(recpoint->GetUniqueID());
+ } else {
+ AliAODCaloCluster *caod = static_cast<AliAODCaloCluster*>(c);
+ caod->SetCellsAbsId(absIds);
+ caod->SetCellsAmplitudeFraction(ratios);
+ }
c->SetDispersion(recpoint->GetDispersion());
c->SetEmcCpvDistance(-1);
c->SetChi2(-1);
c->SetM20(elipAxis[1]*elipAxis[1]);
if (fPedestalData) {
c->SetDistanceToBadChannel(recpoint->GetDistanceToBadTower());
- }
- else {
+ } else {
if (fRecoUtils && fRecoUtils->IsBadChannelsRemovalSwitchedOn()) {
fRecoUtils->RecalculateClusterDistanceToBadChannel(geom, cells, c);
}
imin = t;
}
}
-
- if (esdobjects) {
- AliESDCaloCluster *cesd = static_cast<AliESDCaloCluster*>(c);
- cesd->SetCellsAbsId(absIds);
- cesd->SetCellsAmplitudeFraction(ratios);
- cesd->SetID(recpoint->GetUniqueID());
- cesd->SetEmcCpvDistance(imin);
- cesd->SetTrackDistance(dPhiMin, dEtaMin);
- } else {
- AliAODCaloCluster *caod = static_cast<AliAODCaloCluster*>(c);
- caod->SetCellsAbsId(absIds);
- caod->SetCellsAmplitudeFraction(ratios);
- caod->SetEmcCpvDistance(imin);
- caod->SetTrackDistance(dPhiMin, dEtaMin);
- }
+ c->SetEmcCpvDistance(imin);
+ c->SetTrackDistance(dPhiMin, dEtaMin);
}
}
}