#ifndef __EEezCluster_h__ #define __EEezCluster_h__ #include "EEezTower.h" #include #include #include #include // Forward declarations class EEezCluster; class EEmcGeomSimple; class EEmcSmdGeom; // Typedefs typedef std::vector EEezClusterPtrVec_t; typedef EEezClusterPtrVec_t::iterator EEezClusterPtrVecIter_t; typedef std::vector EEezClusterVec_t; typedef EEezClusterVec_t::iterator EEezClusterVecIter_t; class EEezCluster : public TObject { public: EEezCluster(); ~EEezCluster() { /* nada */ }; // Preliminary construction of the cluster using // towers only. SMD information will be applied // by a later "Maker" void buildCluster( EEezTower *seed ); void setEnergyCut( Float_t e ) { m_EnergyCut = e; } // Accessor methods Float_t getEnergy() { return m_ClusterEnergy; } TVector3 getMomentum() { return m_ClusterMomentum; } Float_t getEta() { return m_ClusterMomentum.PseudoRapidity(); } Float_t getPhi() { return m_ClusterMomentum.Phi(); } // returns true if tower is in cluster, false otherwise Int_t hasTower( EEezTower *tower ); void clear(); // clears the data structures // Method which takes a pointer to a specified cluster // and adds that cluster to itself. The user should // delete the cluster in the arguement list from any // lists he/she is maintaing. void Consume( EEezCluster *cluster ); // Rebuilds clusters based on a vector of clusters, which // may represent a randomized cluster sample or random // clusters from previous events. // EEezClusterPtrVec_t rebuildClusters ( EEezClusterPtrVec_t *old_clusters ); // Methods intended to be used by later analysis // "makers" (declared as friend classes), which // will be used to further refine the cluster // once SMD information is available. EEezTower *getSeedTower() { return m_SeedTower; } void setEnergy( Float_t e ) { m_ClusterEnergy = e; } void setMomentum( TVector3 p ) { m_ClusterMomentum = p; } void setMomentum( Float_t e, Float_t eta, Float_t phi ) { assert(0); /* write it or pass be a TVector3 */ } void setSeedTower( EEezTower *t ); // Copied over from EEezTower.h ... consider inheritance Int_t getIndex() { return m_Index; } void setIndex( Int_t i ) { m_Index = i; } void setIndex( Int_t phibin, Int_t etabin ) { m_Index = 12 * phibin + etabin; } Int_t getEtabin() { return m_Index % 12; } Int_t getPhibin() { return m_Index / 12; } Int_t getSubSector() { return getPhibin() % 5; } Int_t getSector() { return getPhibin() / 5; } // Hash() function for storing in hash tables TString Hash() { return TString( m_SeedTower -> getName() ); } enum EEezClusterType { kEEezClusterSingle, kEEezClusterDouble, kEEezClusterDiagonal, kEEezClusterOther }; void setType ( EEezClusterType type );// { mType = type; } Int_t getType();// { return mType; } private: // EEmc Geometries EEmcGeomSimple *m_EETowGeom; EEmcSmdGeom *m_EESmdGeom; // Pointer to the identified seed tower EEezTower *m_SeedTower; // Energy of the cluster Float_t m_ClusterEnergy; // Reconstructed Eta and phi of the cluster, // and its momentum vector. TVector3 m_ClusterMomentum; // Number of hit towers in this cluster, and // the number of seed towers in this cluster. Int_t m_NumTowers; Int_t m_NumSeeds; EEezStrip *m_UFirst[2]; // First and last U and V strips which EEezStrip *m_ULast[2]; // fall within the 9-towers which comprise EEezStrip *m_VFirst[2]; // this cluster. index=1 gives strips in EEezStrip *m_VLast[2]; // neighboring sectors, if applicable. // A user-specified energy theshold for adding // towers to the cluster. Float_t m_EnergyCut; // A privately held index, which may or maynot be // equal to the index of the seed tower. Int_t m_Index; // Containers for all towers and for seed towers EEezTowerPtrVec_t m_Towers; EEezTowerPtrVec_t m_SeedTowers; // Define the type of the cluster EEezClusterType mType; protected: ClassDef(EEezCluster,1); // EEMC cluster representation class }; #endif