#ifndef TPCPRELIMCLUSTER_HH #define TPCPRELIMCLUSTER_HH #include #include #include #include "TVector3.h" #include "McIdCollection.h" class TpcPadPlane; class TpcDigi; class TpcCluster; class TpcPrelimCluster{ private: void cog(double zJitter); TVector3 fpos; TVector3 ferr; double famp; double fcogT; int fid; double fG; double fC; std::vector fdigis; std::map fdigiShares; std::set fpossiblePads; // pads neighbouring unshared digis std::set fpossiblePadsShared; // pads neighbouring shared digis std::map > fSharedClusters; // clusters to which digis are shared unsigned int fnUnsharedDigis; TpcPadPlane* fpadplane; double ftimeslice; McIdCollection fmcidCol; bool isInTimeWindow(const TpcDigi* const); public: TpcPrelimCluster(TpcPadPlane* p, double t , int id, double G, double C); TpcPrelimCluster(TpcPadPlane* p, int id, double G, double C); virtual ~TpcPrelimCluster(); void addHit(TpcDigi*, bool noXclust=false, double share=1., bool check=false); void addSharedCluster(TpcDigi* d, TpcPrelimCluster* c) {fSharedClusters[d].insert(c);} void removeSharedCluster(TpcDigi* d, TpcPrelimCluster* c) {fSharedClusters[d].erase(fSharedClusters[d].find(c));} unsigned int getNSharedClusters(TpcDigi* d) {return fSharedClusters[d].size();} TpcPrelimCluster* getSharedCluster(TpcDigi* d, unsigned int i); double getCogT(){return fcogT;} double getAmp() {return famp;} TpcDigi* getDigi(unsigned int id){return fdigis[id];} unsigned int getNDigis() const {return fdigis.size();} unsigned int getNUnsharedDigis() const {return fnUnsharedDigis;} int isInCluster(const TpcDigi* const); // 0 = not a neighbor; 1 = neighbour to an unshared digi; 2 = neighbour to a shared digi TpcCluster* convTpcCluster(unsigned int sectorId, double zJitter, bool saveRaw); }; #endif