// ESAF : Euso Simulation and Analysis Framework // $Id: OAPxPlayer.hh,v 1.6 2005/01/12 18:45:51 thea Exp $ // A.Thea created Apr, 21 2004 #ifndef __OAPXPLAYER_HH_ #define __OAPXPLAYER_HH_ #include "TObject.h" #include "TTree.h" #include "OAPxBunch.hh" #include #include "TH1F.h" #include "TH2F.h" using namespace std; class OAPxPlayer : public TObject { public: // ctor OAPxPlayer( TTree* ); // dtor virtual ~OAPxPlayer(); // make the map void MakeMap(Int_t first = 0, Int_t last = 0, const char* filename=0); // export map to an ascii file void ExportMap(const char*); // load channel data from channel f to channel l Bool_t LoadBuffer(Int_t firstid, Long_t entries = 0); // clears buffer void ClearBuffers(); // fits channel uid Bool_t OldFit(Int_t uid, Option_t* = "WQE0"); // fits channel uid in a new (smarter) way Bool_t Fit(Int_t uid, Option_t* = "WQE0"); // draw uid channel content Bool_t DrawChannel(Int_t uid, Option_t * ="theta"); // load id if it is out of current buffer Bool_t LoadChannel(Int_t uid); //getters Int_t GetBufferSize() {return fBufferSize; } Int_t GetBufferSize(Int_t i) {return fThetaFOVBuffer[i].size(); } Float_t GetNSigma() { return fNSigma; } Int_t GetFirst() { return fFirst; } Int_t GetFitThreshold() { return fFitThreshold; } //setters void SetNSigma(Float_t t) { fNSigma = t; } void SetFitThreshold( Int_t t ) { fFitThreshold = t; } // Draws one of the buffer's histos void DrawHisto(Int_t hid); private: void Init(); // translate uid in buffer index inline Int_t UidToIndex( Int_t uid ) { return uid-1-fFirst; } TTree* fTree; OAPxBunch* fBunch; Int_t fNumPixels; // size of pixelmap // TClonesArray *fPixelMap; TArrayF fTheta; TArrayF fThetaRMS; TArrayF fPhi; TArrayF fPhiRMS; Int_t fBufferSize; // size of the buffers Long_t fMaxSize; // max buffer size vector< vector > fThetaFOVBuffer; //! vector< vector > fPhiFOVBuffer; //! Int_t fFirst; //! first index of the current buffer Float_t fNSigma; // number of sigma to limit fit at Int_t fFitThreshold; // min number of hits per channel Int_t fNBins; // bins of th and ph histos Int_t fNBinsFit; // bins in fDetail TH1F *fH1DistTheta; //! temporary 1D histogram TH1F *fH1DistPhi; //! temporary 1D histogram TH1F *fH1FitTheta; //! temp TH1F *fH1FitPhi; //! temp TH2F *fH2DistXY; //! ClassDef(OAPxPlayer,1) }; #endif /* __OAPXPLAYER_HH_ */