10 fTofId = (DetectorId)tofId;
51 Name =
Form(
"Hist_HitByCh_%s",
fName.Data());
57 Name =
Form(
"Hist_HitPerEv_%s",
fName.Data());
63 Name =
Form(
"Hist_HitLR_%s",
fName.Data());
70 hXY =
new TH2I(Name, Name, 400, -250, 250, 120, -75, 75);
86 Form(
"hTempDtimeDy_near_%s",
fName.Data()), 400, -10, 10, 200, -10, 10);
101 Form(
"hTempDtimeDy_acros_%s",
fName.Data()), 400, -10, 10, 200, -10, 10);
117 Form(
"dt_vs_WidthDet_str_%d_%s",
i,
fName.Data()), 1024, 0, 50, 1024, -12, 12);
124 Form(
"dt_vs_WidthT0_str_%d_%s",
i,
fName.Data()), 1024, 0, 50, 1024, -12, 12);
131 hdT[
i]->SetDirectory(0);
213 <<
" Plane = " << TofDigit->
GetPlane() <<
"; Strip " << TofDigit->
GetStrip() <<
"; Side "
224 cout <<
"Setting Shift: strip # " <<
fStrip <<
" shift val " <<
fCorrLR[
fStrip] <<
"; shifted timeL "
231 std::vector<Double_t> tempVector;
232 tempVector.reserve(3);
235 tempVector.push_back(ind);
237 if (TofDigit->
GetSide() == 0) {
286 cout << endl <<
" Plane " <<
fNPlane << endl;
291 cout <<
" Strip " <<
i << endl;
294 for (
Int_t iR = 0; iR < (int)
vHitsR.at(
i).size(); iR++) {
306 cout <<
"iL = " << iL <<
": time = " <<
fTimeL[
i] <<
"; amp = " <<
fWidthL[
i]
307 <<
"; ind = " <<
fIndexL[
i] << endl;
308 cout <<
"iR = " << iR <<
": time = " <<
fTimeR[
i] <<
"; amp = " <<
fWidthR[
i]
309 <<
"; ind = " <<
fIndexR[
i] << endl;
326 printf(
"Hit on Plane#%d Strip#%d\n\tTime = %.3f; (X,Y,Z) = %.3f, %.3f, %.3f\n",
fNPlane,
i,
330 if (
i > 2 &&
fTof[
i - 1] != -1000) {
336 if (
i > 3 &&
fTof[
i - 1] != -1000) {
352 if (TofHit !=
nullptr) {
356 if (TofCont !=
nullptr) {
386 pHit->SetTimeStamp(
fTof[Str]);
387 pHit->AddLink(FairLink(0x1, -1));
388 pHit->AddLink(FairLink(0x2, -1));
389 pHit->AddLink(FairLink(0x4, UID));
435 printf(
"Calculate dt\n raw dt = %.3f\n", dt);
436 T0Amp =
fT0->GetAmp();
442 if (
funT0[Str] != NULL)
443 dt = dt -
funT0[Str]->Eval(T0Amp);
445 printf(
"After T0 corr dt = %.3f\t", dt);
447 if (
gSlew[Str] != NULL) {
450 printf(
"After RPC corr dt = %.3f\t", dt);
453 if (
funRPC[Str] != NULL) {
456 printf(
"After RPC corr dt = %.3f\t", dt);
461 printf(
"After Shift on Proton mass dt = %.3f\n", dt);
496 TString dir =
Form(
"%s%s%s", getenv(
"VMCWORKDIR"),
"/input/", NameFile.
Data());
499 f_corr.getline(line, 256);
500 f_corr.getline(line, 256);
501 if (f_corr.is_open() ==
kTRUE) {
502 while (!f_corr.eof()) {
504 f_corr >> Pl >> St >> CorrFit >> CorrMean;
506 f_corr >> Pl >> St >> CorrMean;
516 cout <<
"File " << NameFile.
Data() <<
" for LR correction is not found" << endl;
517 cout <<
"Check " << dir.
Data() <<
" folder for file" << endl;
527 TString PathToFile =
Form(
"%s%s%s", getenv(
"VMCWORKDIR"),
"/input/", NameFile.
Data());
533 f_corr->
cd(dirname.
Data());
539 printf(
"funT0[%d] is NULL\n",
i);
543 printf(
"gSlew[%d] is NULL\n",
i);
546 cout <<
"File " << NameFile.
Data() <<
" for Slewing correction is not found" << endl;
547 cout <<
"Check " << PathToFile.
Data() <<
" folder for file" << endl;
561 TString dir =
Form(
"%s%s%s", getenv(
"VMCWORKDIR"),
"/input/", NameFile.
Data());
563 f_corr.getline(line, 256);
566 f_corr.getline(line, 256);
571 f_corr.getline(line, 256);
577 if (f_corr.is_open() ==
kTRUE) {
578 while (!f_corr.eof()) {
579 f_corr >> Pl >> St >> Temp;
586 cout <<
"File " << NameFile.
Data() <<
" for TimeShift correction is not found" << endl;
587 cout <<
"Check " << dir.
Data() <<
" folder for file" << endl;
601 double dtt = (tL - tR) * 0.5;
628 TString PathToFile =
Form(
"%s%s%s", getenv(
"VMCWORKDIR"),
"/macro/run/geometry_run/", NameFile.
Data());
629 TFile* geoFile =
new TFile(PathToFile,
"READ");
631 cout <<
"Error: could not open ROOT file with geometry: " + NameFile << endl;
637 TString className(key->GetClassName());
641 cout <<
"Error: TGeoManager isn't top element in geometry file " + NameFile << endl;
656 pGeoUtils->~BmnTof1GeoUtils();
672 if (pStrip == NULL) {
681 fVectorTemp = (pStrip->
C + pStrip->
D) * 0.5 - (pStrip->
A + pStrip->
B) * 0.5;
683 fVectorTemp = (pStrip->
B + pStrip->
C) * 0.5 - (pStrip->
A + pStrip->
D) * 0.5;
705 if (Str < 0 || Str >
fNStr)
721 if (NULL == LMinusRTime)
766 Dir = fileout->
mkdir(Name.Data());
771 DirStat = Dir->
mkdir(
"Statistic");
779 DirdT = Dir->
mkdir(
"dt");
800 Index = (IndL << 16) + IndR;
812 TString dir =
Form(
"%s%s%s", getenv(
"VMCWORKDIR"),
"/input/", NameFile.
Data());
814 f_corr.getline(line, 256);
817 if (f_corr.is_open() ==
kTRUE) {
818 while (!f_corr.eof()) {
819 f_corr >> Pl >> St >> Temp;
831 cout <<
"File " << NameFile.
Data() <<
" for TimeShift correction is not found" << endl;
832 cout <<
"Check " << dir.
Data() <<
" folder for file" << endl;
void memset(T *dest, T i, size_t num)
Copy to memory block [@dest, @dest+@num] num number of times the value of i of type @T with size @typ...
char * Form(const char *fmt,...)
void SetModule(Int_t mod)
void SetUpperClusterIndex(Int_t idx)
void SetDetId(DetectorId det)
void SetStation(Short_t st)
void SetLowerClusterIndex(Int_t idx)
Short_t fIndexL[fNStrMax]
Double_t fCorrTimeShift[fNStrMax]
TH2S * hdT_vs_WidthT0[fNStrMax+1]
Int_t FormIndex(Int_t IndL, Int_t IndR)
Bool_t GetXYZTime(Int_t Str, TVector3 *XYZ, Double_t *ToF)
static const Int_t fHalfMaxInt
void SetStripLength(Double_t l)
Double_t fTimeLtemp[fNStrMax]
Double_t fWidthL[fNStrMax]
Bool_t SetGeoFile(TString NameFile)
TVector3 fCentrStrip[fNStrMax]
Bool_t SetCorrLR(TString NameFile)
Double_t fTimeR[fNStrMax]
void KillSide(Int_t NumberOfSide)
TVector3 fStripAngle[fNStrMax]
Double_t GetWidth(Int_t Str)
std::vector< std::vector< std::vector< Double_t > > > vHitsL
Short_t fIndexR[fNStrMax]
Int_t FindHitsNew(BmnTrigDigit *T0, TClonesArray *TofHit, TClonesArray *TofCont, int printnaw)
Bool_t GetLRTime(Int_t Str, Double_t *LMinusRTime)
Double_t fTimeL[fNStrMax]
Bool_t SetCorrTimeShift(TString NameFile)
static const Int_t fNStrMax
Double_t GetWidthR(Int_t Str)
Double_t fWidthRtemp[fNStrMax]
Double_t fWidthR[fNStrMax]
void KillStrip(Int_t NumberOfStrip)
Double_t fWidth[fNStrMax]
TH2S * hdT_vs_WidthDet[fNStrMax+1]
Bool_t SetDigitNew(BmnTof1Digit *TofDigit, Int_t ind=-1)
Double_t GetTime(Int_t Str)
Bool_t fFlagHit[fNStrMax]
Double_t fSignalVelosityStr[fNStrMax]
Double_t GetWidthL(Int_t Str)
TVector3 fCrossPoint[fNStrMax]
Bool_t SetGeo(BmnTof1GeoUtils *pGeoUtils)
TH2S * hTempDtimeDy_acros
Bool_t GetCrossPoint(Int_t NStrip, Double_t tL, Double_t tR)
Short_t fIndexRtemp[fNStrMax]
Double_t fCorrLR[fNStrMax]
Double_t CalculateDt(Int_t Str)
void AddConteiner(Int_t Str, TClonesArray *TofHit)
Bool_t SetSpeedOfSignal(TString NameFile)
Double_t fTimeRtemp[fNStrMax]
Double_t fCommonTimeShift
std::vector< std::vector< std::vector< Double_t > > > vHitsR
void AddHit(Int_t Str, TClonesArray *TofHit)
Bool_t SetCorrSlewing(TString NameFile)
Double_t fWidthLtemp[fNStrMax]
Short_t fIndexLtemp[fNStrMax]
Bool_t SaveHistToFile(TString NameFile)
TGraphErrors * gSlew[fNStrMax]
Int_t GetVolumeUID() const
Float_t GetAmplitude() const
const LStrip1 * FindStrip(Int_t UID)
Int_t ParseTGeoManager701(bool useMCinput, bool forced=false, Int_t verbose=0)
Int_t ParseTGeoManager(bool useMCinput, bool forced=false, Int_t verbose=0)
Double_t GetLength() const
TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE) override
TList * GetListOfKeys() const override
virtual TObject * Get(const char *namecycle)
virtual TDirectory * mkdir(const char *name, const char *title="", Bool_t returnExistingDirectory=kFALSE)
static std::atomic< TDirectory * > & CurrentDirectory()
virtual Bool_t IsOpen() const
void Close(Option_t *option="") override
Int_t GetEntriesFast() const
const char * Data() const
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
void SetXYZ(Double_t x, Double_t y, Double_t z)
*brief user defined string literal for JSON values *sa std::size_t n