#ifndef spliTChan_h_seen #define spliTChan_h_seen #include #include #include #include "fiTQun_shared.h" //#define nPMT 11146 // This is in fiTQun_shared.h //#define MAXPMZ 334380 // nPMT*30 #define MAXCAND 100 // SK4 #define nClusterVertexVars 6 class spliTChan { private: static int fMAXPMTZ; static int fNPMT; static int fNMULT; int writeHistos; int nevent; int nhitPMT; //double tstrtwd; //double totchrg; //int flgHit[nPMT]; //int ihitPMT[nPMT]; //double chrg[nPMT]; //double tHit[nPMT]; // For TOF correction int doTOFcorr; double cwt; // This needs to be consolidated with cwt in fiTQun.h double nwtr; // This needs to be consolidated with nwtr in fiTQun.h double q_thresh; // For full timing window //#ifndef NOSKLIBRARIES // std::vector t_ind; //#else // std::vector t_ind;//[MAXPMZ]; // Ordering index for TQ arrays below //#endif int *t_ind; float * t;//[MAXPMZ] float * q;//[MAXPMZ]; // TQ (TOF corrected if applied) corresponding to float* ttc[2]; //[maxpmtz][2] corrected ond tof corrected array amis //float *tRaw; // ordered index array above int GetHitInfo(double *vertex = 0); // Parameters for cluster search // See spliTChan.parameters.dat for more documentation void Cluster_Init(); int Cluster_nBinsScanWin; int Cluster_nHitThr; int Cluster_nHitThrFall; int Cluster_tBinSepThresh; //int Cluster_nHitFrstClstrCut; //float Cluster_tExtendMin; // Following stuff for original APFIT::Muechk routine void Muechk_Init(); // For finding parent peak time int Muechk_GetParentPeakTime(); void Muechk_FindPeakCands(int i_oya); void Muechk_FindPeakCandsFine(int i_oya); float Muechk_TimeWindowCoarse; // ns float Muechk_TimeWindowFine; // ns int Muechk_nThrFrac; // Divides nqisk for finding # of hits threshold (nThr) int Muechk_nThrMin; // Minimum nThr // For finding following peaks int Muechk_fstBin; int Muechk_nBinsScanWin; int Muechk_prntPeakScanEnd; int Muechk_n50Thr; float Muechk_excessThr; float Muechk_signifThr; // h_tdiff histogram parameters in spliTChan::Muechk_FindPeakCands //int nBinMax = 3000; //float binWidth = 10; public: spliTChan(int aWriteHistos=0, int anPMT=11146, int anMult=30); ~spliTChan(); int MAXPMTZ(){ return fMAXPMTZ; } int NPMT(){ return fNPMT; } int fQuiet; int nhitPMTz, nUse; float *chrgz; //[MAXPMZ]; // copy of sktqz_.qiskz float *tHitz; //[MAXPMZ]; // copy of sktqz_.tiskz // TQ For sub-event clusters float * chrg[MAXCAND]; //[MAXCAND][nPMT]; float * tHit[2][MAXCAND]; //[2][MAXCAND][nPMT]; int FillTQbanksAll(); float t0sk; // Attempt at generic cluster separator based on APFIT::muechk_gate void Cluster_Search(double *vertex=0); void FillClusterCommon(); // Cluster search results int Cluster_nCand; //struct Cluster_struct { // float Cluster_tEnd; // float Cluster_tStart; // float Cluster_vertex[3]; //} Cluster_obj[MAXCAND]; float *Cluster_tEnd, *Cluster_tStart; float Cluster_vertex[MAXCAND][nClusterVertexVars]; float Cluster_totQ[MAXCAND]; int Cluster_nHits[MAXCAND]; int Cluster_goodflag[MAXCAND]; // Peak in cluster results //int **Cluster_nPeaks; std::vector > > Cluster_timeOfPeak; std::vector > >Cluster_ipeak; void Cluster_AssociateMuechk(); void FillClusterPeakCommon(); void RemoveNoPeakClusters(int imethod); void Set_fQuiet(int val) {fQuiet=val;}; // Cluster search parameter routines void SetCluster_nBinsScanWin(int val) {Cluster_nBinsScanWin=val;}; void SetCluster_nHitThr(int val) {Cluster_nHitThr=val;}; void SetCluster_nHitThrFall(int val) {Cluster_nHitThrFall=val;}; void SetCluster_tBinSepThresh(int val) {Cluster_tBinSepThresh=val;}; //void SetCluster_nHitFrstClstrCut(int val) {Cluster_nHitFrstClstrCut=val;}; //void SetCluster_tExtendMin(int val) {Cluster_tExtendMin=val;}; void SetClusterVertex(int icluster, double *vtxtmp); void RemoveCluster(int acluster); void RemoveOutGateClusters(); void RemoveLowHitFirstClusters(); void CalcClusterProperties(); // (Decay-e) Peak candidate results int Muechk_nCand; float Muechk_tOya; // Parent peak time int Muechk_bg[MAXCAND]; float Muechk_mean[MAXCAND]; float Muechk_excess[MAXCAND],Muechk_signif[MAXCAND],Muechk_tDiff[MAXCAND]; int Muechk_icluster[MAXCAND]; // APFIT muechk routines and variables // void MuechkWrap(double *vertex=0, int imethod=0); void MuechkSubEvent(); void RemoveMuechk(int amue); void FillMuechkCommon(int imethod); void CopyPeakInfo(int imethod, int npeaks, float *peakt0, float *peakiness); void SetdoTOFcorr(int val) {doTOFcorr=val;}; void SetWaterRefractiveIndex(float val) {nwtr=val;}; void Setq_thresh(float val) {q_thresh=val;}; void SetMuechk_TimeWindowCoarse(float val) {Muechk_TimeWindowCoarse=val;}; void SetMuechk_TimeWindowFine(float val) {Muechk_TimeWindowFine=val;}; void SetMuechk_nThrFrac(int val) {Muechk_nThrFrac=val;}; void SetMuechk_nThrMin(int val) {Muechk_nThrMin=val;}; void SetMuechk_fstBin(int val) {Muechk_fstBin=val;}; void SetMuechk_nBinsScanWin(int val) {Muechk_nBinsScanWin=val;}; void SetMuechk_prntPeakScanEnd(int val) {Muechk_prntPeakScanEnd=val;}; void SetMuechk_n50Thr(int val) {Muechk_n50Thr=val;}; void SetMuechk_excessThr(float val) {Muechk_excessThr=val;}; void SetMuechk_signifThr(float val) {Muechk_signifThr=val;}; // Debugging histograms // TH1F *h_tisk_corr0[MAXCAND]; TH1F *h_tisk_corr1[MAXCAND]; TH1F *h_tiskz; TH2F *h_qiskz_vs_tiskz; TH1F* GetTiskzHisto(); TH2F* GetQiskzVsTiskzHisto(); //merge clusters int mergeClusters(); int checkCluster(int); //p2c double fixedTBeforePk; double fixedTAfterPk; double nHitThreshFact; void SetNHitThreshFact(double a) {nHitThreshFact=a;}; void SetFixedTBeforePk(double t) {fixedTBeforePk=t;}; void SetFixedTAfterPk(double t) {fixedTAfterPk=t;}; void MakeClusters(int npeaks, float* peak_to, double* vertex, int nevent); int isValidHit(float thit, float trange); void SetATMClusters(); protected: }; #endif