Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
437 changes: 436 additions & 1 deletion DataModel/RecoCluster.cpp

Large diffs are not rendered by default.

57 changes: 57 additions & 0 deletions DataModel/RecoCluster.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#ifndef RECOCLUSTER_H
#define RECOCLUSTER_H
#include "RecoDigit.h"
#include "Position.h"
#include<SerialisableObject.h>

class RecoCluster : public SerialisableObject {
Expand All @@ -19,16 +20,72 @@ class RecoCluster : public SerialisableObject {
void AddDigit(RecoDigit* digit);

RecoDigit* GetDigit(int n);

void SetClusterMode(int cmode);

int GetClusterMode();

std::vector<RecoDigit*> GetDigitList() {return this->fDigitList;}

int GetNDigits();

bool Print() {
cout<<"Number of digits in this cluster : "<<GetNDigits()<<endl;
cout<<"Clustering mode : "<<GetNDigits()<<endl;
return true;
}

inline double GetTime() { return clusterTime; }
inline double GetCharge() { return clusterCharge; }

void CalcTime();
void CalcCharge();

inline double GetCB() { return clusterCB; }
inline Position GetCV() {return ChargeVector; }

void CalcCB();
void CalcAS();
void CalcCV();
void CalcAMD();
void CalcSA();
void CalcCA();
void CalcParameters();
int calcBestParent();
double GetAS(int mode);
inline double GetASC(){return ASC;}
inline double GetAMD(){return AMD;}
inline Position GetSA(){return SpatialAverage;}
inline double GetCA(){return ContainingAngle;}
std::vector<RecoDigit*> convexHull();

void SetParticle(int pID,int pPDG, double eff, double pur);
inline int GetBestParent(){return bestParticleID;}
inline void SetPDG(int pPDG) {bestParticlePDG=pPDG;}
inline int GetPDG(){return bestParticlePDG;}
inline double Efficiency(){return efficiency;}
inline double Purity(){return purity;}

private:
double clusterTime;
double clusterCharge;
double clusterCB;
double AS0, AS1, ASC;
double AMD;
Position ChargeVector;
Position SpatialAverage;
double ContainingAngle;
int bestParticleID;
int bestParticlePDG;
double efficiency;
double purity;


int fClusterMode = -999;
std::vector<RecoDigit*> fDigitList;
std::vector<RecoDigit*> hullDigits;
Position TwoDCenter;


protected:
template<class Archive> void serialize(Archive & ar, const unsigned int version){
Expand Down
7 changes: 7 additions & 0 deletions DataModel/RecoDigit.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,18 @@ class RecoDigit : public SerialisableObject{
}
~RecoDigit() {/*ANNIERecoObjectTable::Instance()->DeleteDigit();*/}

bool operator<(const RecoDigit other) const {
return (fPosition.X() == other.GetPosition().X()) ? fPosition.Y() < other.GetPosition().Y() : fPosition.X() < other.GetPosition().X();
}

inline int GetRegion() const {return fRegion;}
inline Position GetPosition() const {return fPosition;}
inline double GetCalTime() const {return fCalTime;}
inline double GetCalCharge() const {return fCalCharge;}
inline bool GetFilterStatus() const {return fIsFiltered;}
inline int GetDigitType() const {return fDigitType;}
inline int GetDetectorID() const {return fDetectorID;}
inline std::vector<int> GetParents() const {return Parents;}

inline void SetRegion(int reg) {fRegion = reg;}
inline void SetPosition(Position pos){fPosition = pos;}
Expand All @@ -52,6 +57,7 @@ class RecoDigit : public SerialisableObject{
inline void SetFilter(bool pass = 1) { fIsFiltered = pass;}
inline void ResetFilter() {SetFilter(0);}
inline void PassFilter() {SetFilter(1);}
inline void SetParents(std::vector<int> parentsin) { Parents = parentsin; }

bool Print() {
cout<<"Region : "<<fRegion<<endl;
Expand All @@ -72,6 +78,7 @@ class RecoDigit : public SerialisableObject{
bool fIsFiltered;
int fDigitType;
int fDetectorID;
std::vector<int> Parents;

template<class Archive> void serialize(Archive & ar, const unsigned int version){
if(serialise){
Expand Down
Loading