ROOT logo
#ifndef HPARTICLESTART2HITF_H
#define HPARTICLESTART2HITF_H

#include "hlocation.h"
#include "hreconstructor.h"

#include "TNtuple.h"
#include "TFile.h"

#include <vector>

using namespace std;

class HCategory;

class HParticleStart2HitF : public HReconstructor {
private:
   HCategory*     fCatTof;      //! pointer to the tof hit data
   HCategory*     fCatTofClu;   //! pointer to the tof cluster data 
   HCategory*     fCatRpc;      //! pointer to the rpc hit data
   HCategory*     fCatRpcClu;   //! pointer to the rpc cluster data
   HCategory*     fCatStartCal; //! pointer to the start cal data
   HCategory*     fCatStartHit; //! pointer to the start hit data

   TNtuple *nt1;                //! Debug ntuple 1 (original tofs)
   TNtuple *nt2;                //! Debug ntuple 2 (start time for both modules)
   TNtuple *nt3;                //! Debug ntuple 3 (recontructed start times)
   TFile *out;                  //! Output file for debug
   
   Bool_t bDebug;               //! Flag to store debug ntuples
   Float_t startTimeOriginal;   //! Start time from original HStart2Hit
   Int_t   startFlag;           //! flag of reconstruction method (-1,0,1,2)

   Float_t timeCutR;             //! cut right time window to search for new hit
   Float_t timeCutL;             //! cut left time window to search for new hit
   vector<Int_t> firstCluster;  // all strips inside 0.5 ns arround best strip
   vector<Int_t> secondCluster; // all other strip not in first cluster
   Float_t       fSecondTime;   // closest second time
   Float_t findMinimumTime(void);      // find the minimum time-of-flight
   Float_t findOriginalStartTime(void);// find start time from HStart2Hit category
   Float_t findStartTime(Float_t tof); // find the proper start time
   void correctTof(Float_t corrTime);  // modify the HTofHit tof
   void correctRpc(Float_t corrTime);  // modify the HRpcHit tof
   void correctStart(Float_t corrTime);// modify the HStart2Hit time

   void setDebug(Bool_t mode = kTRUE) { bDebug = mode; };

public:
   HParticleStart2HitF(void);
   HParticleStart2HitF(const Text_t* name, const Text_t* title, Bool_t skip = kFALSE);
   ~HParticleStart2HitF(void) {}

   Bool_t init(void);
   Int_t  execute(void);
   Bool_t finalize(void);

   void  setTimeCut(Float_t cutL=5,Float_t cutR=15){ timeCutL = cutL; timeCutR = cutR; }

   ClassDef(HParticleStart2HitF, 0) // Hit finder for START2 detector suing META hits
};

#endif /* !HPARTICLESTART2HITF_H */

 hparticlestart2hitf.h:1
 hparticlestart2hitf.h:2
 hparticlestart2hitf.h:3
 hparticlestart2hitf.h:4
 hparticlestart2hitf.h:5
 hparticlestart2hitf.h:6
 hparticlestart2hitf.h:7
 hparticlestart2hitf.h:8
 hparticlestart2hitf.h:9
 hparticlestart2hitf.h:10
 hparticlestart2hitf.h:11
 hparticlestart2hitf.h:12
 hparticlestart2hitf.h:13
 hparticlestart2hitf.h:14
 hparticlestart2hitf.h:15
 hparticlestart2hitf.h:16
 hparticlestart2hitf.h:17
 hparticlestart2hitf.h:18
 hparticlestart2hitf.h:19
 hparticlestart2hitf.h:20
 hparticlestart2hitf.h:21
 hparticlestart2hitf.h:22
 hparticlestart2hitf.h:23
 hparticlestart2hitf.h:24
 hparticlestart2hitf.h:25
 hparticlestart2hitf.h:26
 hparticlestart2hitf.h:27
 hparticlestart2hitf.h:28
 hparticlestart2hitf.h:29
 hparticlestart2hitf.h:30
 hparticlestart2hitf.h:31
 hparticlestart2hitf.h:32
 hparticlestart2hitf.h:33
 hparticlestart2hitf.h:34
 hparticlestart2hitf.h:35
 hparticlestart2hitf.h:36
 hparticlestart2hitf.h:37
 hparticlestart2hitf.h:38
 hparticlestart2hitf.h:39
 hparticlestart2hitf.h:40
 hparticlestart2hitf.h:41
 hparticlestart2hitf.h:42
 hparticlestart2hitf.h:43
 hparticlestart2hitf.h:44
 hparticlestart2hitf.h:45
 hparticlestart2hitf.h:46
 hparticlestart2hitf.h:47
 hparticlestart2hitf.h:48
 hparticlestart2hitf.h:49
 hparticlestart2hitf.h:50
 hparticlestart2hitf.h:51
 hparticlestart2hitf.h:52
 hparticlestart2hitf.h:53
 hparticlestart2hitf.h:54
 hparticlestart2hitf.h:55
 hparticlestart2hitf.h:56
 hparticlestart2hitf.h:57
 hparticlestart2hitf.h:58
 hparticlestart2hitf.h:59
 hparticlestart2hitf.h:60
 hparticlestart2hitf.h:61
 hparticlestart2hitf.h:62
 hparticlestart2hitf.h:63