18 #include <TClonesArray.h>
20 #include "AliVEvent.h"
22 #include "AliTLorentzVector.h"
38 fDefaultClusterEnergy(-1)
40 fBaseClassName =
"AliVCluster";
41 SetClassName(
"AliVCluster");
43 for (Int_t i = 0; i <= AliVCluster::kLastUserDefEnergy; i++) {
44 fUserDefEnergyCut[i] = 0.;
57 fDefaultClusterEnergy(-1)
62 for (Int_t i = 0; i <= AliVCluster::kLastUserDefEnergy; i++) {
81 AliVCluster *cluster = 0;
83 if (option.Contains(
"e")) {
85 if (cluster->E() > clusterMax->E()) clusterMax = cluster;
93 cluster->GetMomentum(mom,const_cast<Double_t*>(
fVertex));
114 if(i<0 || i>
fClArray->GetEntriesFast())
return 0;
115 AliVCluster *vp =
static_cast<AliVCluster*
>(
fClArray->At(i));
130 UInt_t rejectionReason = 0;
134 AliDebug(2,
"Cluster not accepted.");
197 if (mass < 0) mass = 0;
208 Double_t p = TMath::Sqrt(energy*energy - mass*mass);
211 vc->GetPosition(pos);
217 Double_t r = TMath::Sqrt(pos[0]*pos[0]+pos[1]*pos[1]+pos[2]*pos[2]) ;
220 mom.SetPxPyPzE( p*pos[0]/r, p*pos[1]/r, p*pos[2]/r, energy) ;
223 AliInfo(
"Null cluster radius, momentum calculation not possible");
243 mom.SetPtEtaPhiM(0, 0, 0, 0.139);
298 if (!r)
return kFALSE;
300 AliTLorentzVector mom;
309 if (!r)
return kFALSE;
311 AliTLorentzVector mom;
329 if (!clus->IsEMCAL()) {
359 for (Int_t i = 0; i <= AliVCluster::kLastUserDefEnergy; i++) {
375 UInt_t rejectionReason = 0;
377 for(
int iclust = 0; iclust < this->
fClArray->GetEntries(); ++iclust){
378 AliVCluster *clust = this->
GetCluster(iclust);
386 if (t >= 0 && t <= AliVCluster::kLastUserDefEnergy){
396 if (t >= 0 && t <= AliVCluster::kLastUserDefEnergy){
406 static TString clusterString;
413 else if (Ecut < 1.0) {
414 clusterString = TString::Format(
"%s_E0%3.0f",
GetArrayName().
Data(), Ecut*1000.0);
417 clusterString = TString::Format(
"%s_E%4.0f",
GetArrayName().
Data(), Ecut*1000.0);
420 return clusterString.Data();
527 UInt_t rejection = 0;
542 fkContainer(other.fkContainer),
543 fAcceptIndices(other.fAcceptIndices),
544 fCurrentPos(other.fCurrentPos),
545 fForward(other.fForward)
633 if(fCurrentPos < 0 || fCurrentPos >= fAcceptIndices.GetSize()){
636 return fkContainer->GetCluster(fAcceptIndices[fCurrentPos]);
663 fCurrentPos(startpos),
674 fkContainer(other.fkContainer),
675 fCurrentPos(other.fCurrentPos),
676 fForward(other.fForward)
763 if(fCurrentPos >= 0 && fCurrentPos < fkContainer->
GetNClusters())
764 return fkContainer->GetCluster(fCurrentPos);
773 std::vector<AliVCluster *> reference, variation;
774 AliVCluster *test = NULL;
775 for(
int iclust = 0; iclust < cont->
GetNClusters(); iclust++){
778 UInt_t rejectionReason = 0;
781 reference.push_back(test);
787 variation.push_back(*iter);
792 variation.push_back(*iter);
798 if(reference.size() < 30){
799 std::cout <<
"Clusters in reference container: " << std::endl;
800 std::cout <<
"===========================================" << std::endl;
801 for(std::vector<AliVCluster *>::iterator refit = reference.begin(); refit != reference.end(); ++refit){
802 std::cout <<
"Address: " << *refit << std::endl;
805 if(variation.size() < 30){
806 std::cout <<
"Clusters in test container: " << std::endl;
807 std::cout <<
"===========================================" << std::endl;
808 for(std::vector<AliVCluster *>::iterator varit = variation.begin(); varit != variation.end(); ++varit){
809 std::cout <<
"Address: " << *varit << std::endl;
816 bool failure =
false;
818 for(std::vector<AliVCluster *>::iterator clit = reference.begin(); clit != reference.end(); ++clit){
819 if(std::find(variation.begin(), variation.end(), *clit) == variation.end()) {
821 std::cout <<
"Could not find cluster with address " << *clit <<
" in test container" << std::endl;
828 for(std::vector<AliVCluster *>::iterator clit = variation.begin(); clit != variation.end(); ++clit){
829 if(std::find(reference.begin(), reference.end(), *clit) == reference.end()) {
831 std::cout <<
"Could not find cluster with address " << *clit <<
" in reference container" << std::endl;
836 if(failure) testresult = 2;
842 std::cout <<
"Unit test cluster container, iterator type " << iteratorType << std::endl;
843 std::cout <<
"Number of expected clusters: " << reference.size() <<
", number of found clusters: " << variation.size() << std::endl;
844 std::cout <<
"Test result: " << testresult << std::endl;
845 std::cout <<
"-----------------------------------------------------------------------" << std::endl;
AliVCluster * GetAcceptClusterWithLabel(Int_t lab) const
bool fForward
Direction, expressed in forward direction.
bool fForward
Direction, expressed in forward direction.
virtual Bool_t ApplyClusterCuts(const AliVCluster *clus, UInt_t &rejectionReason) const
Bool_t GetNextAcceptMomentum(TLorentzVector &mom)
virtual Bool_t ApplyKinematicCuts(const AliTLorentzVector &mom, UInt_t &rejectionReason) const
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
stl iterator over accepted clusters
const char * GetTitle() const
all_iterator begin() const
accept_iterator accept_rbegin() const
Double_t fMinE
Max. cut on particle energy.
Bool_t GetNextMomentum(TLorentzVector &mom)
Int_t GetIndexFromLabel(Int_t lab) const
bool operator!=(const accept_iterator &other) const
all_iterator & operator++()
accept_iterator accept_end() const
UInt_t fBitMap
bitmap mask
Double_t fClusTimeCutLow
low time cut for clusters
Double_t fUserDefEnergyCut[AliVCluster::kLastUserDefEnergy+1]
cut on the energy of the cluster after higher level corrections (see AliVCluster.h) ...
const AliClusterContainer * fkContainer
Container iterated over.
accept_iterator accept_begin() const
int fCurrentPos
Current position inside the container.
void SetClusUserDefEnergyCut(Int_t t, Double_t cut)
AliVCluster * GetLeadingCluster(const char *opt="")
Cell time cut not passed.
accept_iterator & operator++()
Double_t GetClusUserDefEnergyCut(Int_t t) const
Int_t GetDefaultClusterEnergy() const
accept_iterator & operator=(const accept_iterator &other)
enum AliVCluster::VCluUserDefEnergy_t VCluUserDefEnergy_t
all_iterator & operator--()
Cluster is exotic cluster.
stl iterator over all clusters
all_iterator & operator=(const all_iterator &other)
Base class for container structures within the EMCAL framework.
virtual Bool_t AcceptCluster(Int_t i, UInt_t &rejectionReason) const
AliVCluster * GetAcceptCluster(Int_t i) const
Int_t GetNClusters() const
Int_t GetNAcceptedClusters() const
int fCurrentPos
Current position inside the container.
all_iterator rend() const
Double_t fClusTimeCutUp
up time cut for clusters
AliVCluster * GetCluster(Int_t i) const
void SetClassName(const char *clname)
Bool_t fExoticCut
reject clusters marked as "exotic"
AliVCluster * GetNextCluster()
bool operator!=(const all_iterator &other) const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
Int_t fMinMCLabel
minimum MC label
accept_iterator accept_rend() const
const TString & GetArrayName() const
AliVCluster * operator*() const
Double_t fMassHypothesis
if < 0 it will use a PID mass when available
Cluster not in the EMCAL.
Double_t fVertex[3]
! event vertex array
Bool_t GetAcceptMomentum(TLorentzVector &mom, Int_t i) const
AliVCluster * GetClusterWithLabel(Int_t lab) const
int TestClusterContainerIterator(const AliClusterContainer *const cont, int iteratorType, bool verbose)
TArrayI fAcceptIndices
Indices of accepted clusters.
TString fBaseClassName
name of the base class that this container can handle
Bool_t GetMomentum(TLorentzVector &mom, const AliVCluster *vc, Double_t mass) const
Int_t fMaxMCLabel
maximum MC label
TClonesArray * fClArray
! Pointer to array in input event
Int_t GetNEntries() const
Int_t fDefaultClusterEnergy
default cluster energy: -1 for clus->E(); otherwise clus->GetUserDefEnergy(fDefaultClusterEnergy) ...
const AliClusterContainer * fkContainer
Container iterated over.
all_iterator rbegin() const
Int_t fCurrentID
! current ID for automatic loops
accept_iterator & operator--()
Container structure for EMCAL clusters.
AliVCluster * GetNextAcceptCluster()
void ResetCurrentID(Int_t i=-1)
AliVCluster * operator*() const