BmnRoot
Loading...
Searching...
No Matches
BmnTOF1Detector.h
Go to the documentation of this file.
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7/*
8 * File: BmnTOF1Detector.h
9 * Author: mikhail
10 *
11 * Created on March 13, 2017, 4:52 PM
12 */
13
14#ifndef BMNTOF1DETECTOR_H
15#define BMNTOF1DETECTOR_H 1
16
17#include "BmnEnums.h"
18#include "BmnEventHeader.h"
19#include "BmnTOF1Conteiner.h"
20#include "BmnTOF1Point.h"
21#include "BmnTof1Digit.h"
22#include "BmnTof1GeoUtils.h"
23#include "BmnTof701Digit.h"
24#include "BmnTofHit.h"
25#include "BmnTrigDigit.h"
26#include "TClonesArray.h"
27#include "TDirectory.h"
28#include "TF1.h"
29#include "TFile.h"
30#include "TGraphErrors.h"
31#include "TH1I.h"
32#include "TH2I.h"
33#include "TList.h"
34#include "TString.h"
35#include "TSystem.h"
36#include "TTree.h"
37#include "TVector3.h"
38
39#include <RtypesCore.h>
40#include <TGeoManager.h>
41#include <TKey.h>
42#include <cstdio>
43#include <cstdlib>
44#include <deque>
45#include <fstream>
46#include <iostream>
47#include <list>
48#include <map>
49#include <stdio.h>
50#include <stdlib.h>
51#include <vector>
52
53using namespace std;
54
56{
57 private:
58 static const Int_t fHalfMaxInt = kMaxInt * 0.5 - 1;
59 static const Int_t fNStrMax = 48;
60 DetectorId fTofId;
61 Int_t fVerbose;
62 Double_t fStripLength, fSignalVelosity, fSignalVelosityStr[fNStrMax];
63 TString fName;
64 Int_t fNPlane, fNStr;
65 Int_t fFillHist;
66
67 std::vector<std::vector<std::vector<Double_t>>> vHitsL;
68 std::vector<std::vector<std::vector<Double_t>>> vHitsR;
69 // std::vector<std::vector<std::vector<Double_t>>> vHits;
70
71 Short_t fIndexL[fNStrMax], fIndexR[fNStrMax], fIndexLtemp[fNStrMax], fIndexRtemp[fNStrMax];
72 Double_t fTimeL[fNStrMax], fTimeR[fNStrMax], fTimeLtemp[fNStrMax], fTimeRtemp[fNStrMax], fTime[fNStrMax];
73 Double_t fWidthL[fNStrMax], fWidthR[fNStrMax], fWidthLtemp[fNStrMax], fWidthRtemp[fNStrMax], fWidth[fNStrMax];
74 Double_t fTof[fNStrMax];
75 Double_t fDoubleTemp, fMaxDelta;
76 Int_t fHit_Per_Ev, fNEvents, fStrip;
77 Bool_t fFlagHit[fNStrMax], fKilled[fNStrMax];
78 Int_t fKillSide;
79 Double_t fCorrLR[fNStrMax], fCorrTimeShift[fNStrMax];
80 Int_t fDigitL[fNStrMax], fDigitR[fNStrMax], fHit[fNStrMax];
81 Double_t fCommonTimeShift;
82 TVector3 fCentrStrip[fNStrMax], fStripAngle[fNStrMax], fCrossPoint[fNStrMax], fVectorTemp;
83 BmnTrigDigit* fT0;
84
85 TList* fHistListStat;
86 TList* fHistListdt;
87
88 TH2S *hdT_vs_WidthDet[fNStrMax + 1], *hdT_vs_WidthT0[fNStrMax + 1];
89 TH1I* hdT[fNStrMax + 1];
90 TH1I *hHitByCh, *hHitPerEv;
91 TH2I *hHitLR, *hXY;
92 TH1S *hDy_near, *hDtime_near, *hDWidth_near;
93 TH1S *hDy_acros, *hDtime_acros, *hDWidth_acros;
94 TH2S *hTempDtimeDy_near, *hTempDtimeDy_acros;
95
96 TGraphErrors* gSlew[fNStrMax];
97 TF1 *funT0[fNStrMax], *funRPC[fNStrMax];
98
99 void FillHist();
100 Double_t CalculateDt(Int_t Str);
101 Bool_t GetCrossPoint(Int_t NStrip, Double_t tL, Double_t tR);
102 void AddHit(Int_t Str, TClonesArray* TofHit);
103 void AddConteiner(Int_t Str, TClonesArray* TofHit);
104 Int_t FormIndex(Int_t IndL, Int_t IndR);
105
106 public:
108
110 Int_t tofId,
111 Int_t NPlane,
112 Int_t FillHistLevel,
113 Int_t Verbose); // FillHistLevel=0-don"t fill, FillHistLevel=1-fill statistic, FillHistLevel>1-fill all
114
115 virtual ~BmnTOF1Detector() {};
116
117 void Clear();
118 Bool_t SetDigitNew(BmnTof1Digit* TofDigit, Int_t ind = -1);
119 void KillStrip(Int_t NumberOfStrip);
120 void KillSide(Int_t NumberOfSide);
121 void SetStripLength(Double_t l)
122 {
123 fStripLength = l;
124 fMaxDelta = (fStripLength * 0.5 + 3.0) * fSignalVelosity;
125 };
126 Int_t FindHitsNew(BmnTrigDigit* T0, TClonesArray* TofHit, int printnaw);
127 TList* GetList(Int_t n);
128 TString GetName();
129 Bool_t SetCorrLR(TString NameFile);
130 Bool_t SetCorrSlewing(TString NameFile);
131 Bool_t SetCorrTimeShift(TString NameFile);
132 Bool_t SetGeoFile(TString NameFile);
133 Bool_t SetGeo(BmnTof1GeoUtils* pGeoUtils);
134 Bool_t SetSpeedOfSignal(TString NameFile);
135 Bool_t GetXYZTime(Int_t Str, TVector3* XYZ, Double_t* ToF);
136 Bool_t GetLRTime(Int_t Str, Double_t* LMinusRTime);
137 Double_t GetWidth(Int_t Str);
138 Double_t GetWidthL(Int_t Str);
139 Double_t GetWidthR(Int_t Str);
140 Double_t GetTime(Int_t Str);
141 Bool_t SaveHistToFile(TString NameFile);
142
143 Int_t GetFillHistLevel() { return fFillHist; };
144
146};
147
148#endif
DetectorId
Bool_t GetXYZTime(Int_t Str, TVector3 *XYZ, Double_t *ToF)
virtual ~BmnTOF1Detector()
void SetStripLength(Double_t l)
Bool_t SetGeoFile(TString NameFile)
ClassDef(BmnTOF1Detector, 4)
Int_t FindHitsNew(BmnTrigDigit *T0, TClonesArray *TofHit, int printnaw)
Bool_t SetCorrLR(TString NameFile)
void KillSide(Int_t NumberOfSide)
Double_t GetWidth(Int_t Str)
Bool_t GetLRTime(Int_t Str, Double_t *LMinusRTime)
Bool_t SetCorrTimeShift(TString NameFile)
Double_t GetWidthR(Int_t Str)
void KillStrip(Int_t NumberOfStrip)
Bool_t SetDigitNew(BmnTof1Digit *TofDigit, Int_t ind=-1)
Double_t GetTime(Int_t Str)
Double_t GetWidthL(Int_t Str)
Bool_t SetGeo(BmnTof1GeoUtils *pGeoUtils)
Bool_t SetSpeedOfSignal(TString NameFile)
TList * GetList(Int_t n)
Bool_t SetCorrSlewing(TString NameFile)
Bool_t SaveHistToFile(TString NameFile)
STL namespace.