+// $Id$
//
-// Cluster Container
+// Container with name, TClonesArray and cuts for particles
//
// Author: M. Verweij
AliClusterContainer::AliClusterContainer():
AliEmcalContainer("AliClusterContainer"),
fClusPtCut(0.15),
+ fClusECut(0.15),
fClusTimeCutLow(-10),
fClusTimeCutUp(10),
fClusterBitMap(0),
AliClusterContainer::AliClusterContainer(const char *name):
AliEmcalContainer(name),
fClusPtCut(0.15),
+ fClusECut(0.15),
fClusTimeCutLow(-10),
fClusTimeCutUp(10),
fClusterBitMap(0),
}
//________________________________________________________________________
-AliVCluster* AliClusterContainer::GetCluster(Int_t i) const {
-
+AliVCluster* AliClusterContainer::GetCluster(Int_t i) const
+{
//Get i^th cluster in array
if(i<0 || i>fClArray->GetEntriesFast()) return 0;
}
//________________________________________________________________________
-AliVCluster* AliClusterContainer::GetAcceptCluster(Int_t i) const {
- //return pointer to cluster if cluster is accepted
+AliVCluster* AliClusterContainer::GetAcceptCluster(Int_t i) const
+{
+ //Return pointer to cluster if cluster is accepted
AliVCluster *vc = GetCluster(i);
if(!vc) return 0;
}
//________________________________________________________________________
-AliVCluster* AliClusterContainer::GetNextAcceptCluster(Int_t i) {
+AliVCluster* AliClusterContainer::GetClusterWithLabel(Int_t lab) const
+{
+ //Get particle with label lab in array
+
+ Int_t i = GetIndexFromLabel(lab);
+ return GetCluster(i);
+}
- //Get next accepted cluster; if i >= 0 (re)start counter from i; return 0 if no accepted particle could be found
+//________________________________________________________________________
+AliVCluster* AliClusterContainer::GetAcceptClusterWithLabel(Int_t lab) const
+{
+ //Get particle with label lab in array
+
+ Int_t i = GetIndexFromLabel(lab);
+ return GetAcceptCluster(i);
+}
+
+//________________________________________________________________________
+AliVCluster* AliClusterContainer::GetNextAcceptCluster(Int_t i)
+{
+ //Get next accepted cluster; if i >= 0 (re)start counter from i; return 0 if no accepted cluster could be found
if (i>=0) fCurrentID = i;
return c;
}
+//________________________________________________________________________
+AliVCluster* AliClusterContainer::GetNextCluster(Int_t i)
+{
+ //Get next cluster; if i >= 0 (re)start counter from i; return 0 if no cluster could be found
+
+ if (i>=0) fCurrentID = i;
+
+ const Int_t n = GetNEntries();
+ AliVCluster *c = 0;
+ while (fCurrentID < n && !c) {
+ c = GetCluster(fCurrentID);
+ fCurrentID++;
+ }
+
+ return c;
+}
+
//________________________________________________________________________
void AliClusterContainer::GetMomentum(TLorentzVector &mom, Int_t i) const
{
if (clus->GetTOF() > fClusTimeCutUp || clus->GetTOF() < fClusTimeCutLow)
return kFALSE;
+ if (clus->E()<fClusECut)
+ return kFALSE;
+
TLorentzVector nPart;
clus->GetMomentum(nPart, const_cast<Double_t*>(fVertex));
return kFALSE;
return kTRUE;
-
}
//________________________________________________________________________