Newer
Older
TB_Chris / TbUT / scripts / .svn / text-base / AnalysisBase.h.svn-base
  1. //////////////////////////////////////////////////////////
  2. // This class has been automatically generated on
  3. // Thu Oct 1 20:13:36 2015 by ROOT version 5.34/10
  4. // from TTree Clusters/TbUT nTuple
  5. // found on file: /data2/pmmannin/BoardA6/Run_Bias_Scan-B6-A-212-8358_Tuple_tracks.root
  6. //////////////////////////////////////////////////////////
  7.  
  8. #ifndef AnalysisBase_h
  9. #define AnalysisBase_h
  10.  
  11. #include <TROOT.h>
  12. #include <iostream>
  13. #include <TChain.h>
  14. #include <TTree.h>
  15. #include <TMath.h>
  16. #include <TFile.h>
  17. #include <TH2.h>
  18. #include <TF1.h>
  19. #include <TProfile.h>
  20. #include <TString.h>
  21. #include <TGraph.h>
  22. #include <TGraphErrors.h>
  23. //#include "myInputs.h"
  24. #include "AnalysisBase_Inputs.h"
  25.  
  26. // Header file for the classes stored in the TTree if any.
  27. #include <vector>
  28.  
  29.  
  30.  
  31. // Fixed size dimensions of array or collections stored in the TTree if any.
  32.  
  33. class AnalysisBase {
  34. public :
  35. TTree *fChain; //!pointer to the analyzed TTree or TChain
  36. Int_t fCurrent; //!current Tree number in a TChain
  37. // Declaration of leaf types
  38.  
  39. Int_t clusterNumberPerEvent;
  40. UInt_t clustersTDC;
  41. ULong64_t timestamps;
  42. Double_t clustersPosition[10];
  43. Int_t clustersSeedPosition[10];
  44. Double_t clustersCharge[10];
  45. Int_t clustersSize[10];
  46. Double_t clustersSeedCharge[10];
  47. Double_t clustersCharge2StripLeft[10];
  48. Double_t clustersCharge1StripLeft[10];
  49. Double_t clustersCharge1StripRight[10];
  50. Double_t clustersCharge2StripRight[10];
  51. Double_t dtime;
  52. Int_t n_tp3_tracks;
  53. vector<double> *vec_trk_x;
  54. vector<double> *vec_trk_y;
  55. vector<double> *vec_trk_tx;
  56. vector<double> *vec_trk_ty;
  57. vector<double> *vec_trk_chi2ndf;
  58.  
  59. // List of branches
  60. TBranch *b_clusterNumberPerEvent; //!
  61. TBranch *b_clustersTDC; //!
  62. TBranch *b_timestamps; //!
  63. TBranch *b_clustersPosition; //!
  64. TBranch *b_clustersSeedPosition; //!
  65. TBranch *b_clustersCharge; //!
  66. TBranch *b_clustersSize; //!
  67. TBranch *b_clustersSeedCharge; //!
  68. TBranch *b_clustersCharge2StripLeft; //!
  69. TBranch *b_clustersCharge1StripLeft; //!
  70. TBranch *b_clustersCharge1StripRight; //!
  71. TBranch *b_clustersCharge2StripRight; //!
  72. TBranch *b_n_tp3_tracks; //!
  73. TBranch *b_vec_trk_x; //!
  74. TBranch *b_vec_trk_y; //!
  75. TBranch *b_vec_trk_tx; //!
  76. TBranch *b_vec_trk_ty; //!
  77. TBranch *b_vec_trk_chi2ndf; //!
  78. TBranch *b_dtime; //!
  79.  
  80. double stripPitch;
  81. double z_DUT;
  82. double Rz;
  83. double Ry;
  84. double dxWin;
  85. double xGloOff;
  86. double yGloOff;
  87. double xOff;
  88.  
  89. float iLo, iHi;
  90. float tdcLo, tdcHi;
  91. float yMin,yMax;
  92. float xMin,xMax;
  93. float yMid, yHi2;
  94. float tyMin,tyMax;
  95. float txMin,txMax;
  96. Int_t skipChannel[512];
  97. double xLeftHole;
  98. double xRightHole;
  99. Int_t lowEdge, hiEdge;
  100. Double_t stripGap[4];
  101. Double_t deadRegionLo[20];
  102. Double_t deadRegionHi[20];
  103. Int_t nDeadRegion;
  104.  
  105. double yInt1[2];
  106. double yInt2[2];
  107. double yInt3[2];
  108.  
  109. float polarity;
  110.  
  111. TH1F *hMeanNoise;
  112. TH1F *hWidthNoise;
  113.  
  114. double holeQuadPar[3];
  115. bool removeTracksInHole;
  116. double minDistFromHole;
  117. bool holeSector;
  118. bool correctForZRotation;
  119.  
  120. double chargeCorrSlopeOdd;
  121. double chargeCorrSlopeEven;
  122. double noise[512];
  123.  
  124. double channelOffset;
  125.  
  126. AnalysisBase(TTree *tree=0);
  127. virtual ~AnalysisBase();
  128. //virtual Int_t Cut(Long64_t entry);
  129. virtual Int_t GetEntry(Long64_t entry);
  130. virtual Long64_t LoadTree(Long64_t entry);
  131. virtual void Init(TTree *tree);
  132. virtual void Loop() = 0; //make it pure virtual!
  133. virtual Bool_t Notify();
  134. virtual void Show(Long64_t entry = -1);
  135. virtual void getRange(TH1 *h, float &lo, float& hi, float thresh = 0.25, int nSkipMax=5);
  136. virtual void getTDCBins(TProfile* h, float& lo, float& hi);
  137. virtual void getBeamLocation(TH1F *h, float &lo, float& hi);
  138. virtual double getXOffset(TH1F *h1w);
  139. virtual void getBeamLoc();
  140. virtual void getTDC();
  141. virtual void findBeamRegionAndAlign(int iPass = 1);
  142. virtual Double_t getCorrChannel(double ch);
  143. virtual void findChipBoundary();
  144. virtual void setCrossTalkCorr();
  145.  
  146. virtual void findDeadRegions();
  147. virtual void transformTrackToDUTFrame(int k, double& x_trk, double& y_trk, double& nomStrip, double& detStrip);
  148. virtual void PrepareDUT();
  149. virtual Double_t getDUTHitPosition(int j);
  150. virtual void findCutoutRegion(TH2F* h);
  151. virtual bool isInCutoutRegion(double xtrk, double ytrk);
  152. virtual double DistToCutoutRegion(double xtrk, double ytrk);
  153. virtual void correctForStripGaps();
  154.  
  155. };
  156.  
  157. #endif