Skip to content
Snippets Groups Projects
Commit 7fb70fe2 authored by Mark Jones's avatar Mark Jones Committed by Mark K Jones
Browse files

Modify THcHodoscope

Add ability to cut on number of PE in Cherenkov when dumping events
  for TOF calibration

Add parameter fTOFCalib_cer_lo

Add ability to cut on track beta when dumping events
  for TOF calibration

Add parameter fTOFCalib_beta_lo and fTOFCalib_beta_hi

Parameters are optional. Default set to kBig or -kBig

THere was already a possible cut on Shower energy/momentum
parent 0734d328
No related branches found
No related tags found
No related merge requests found
...@@ -130,6 +130,14 @@ void THcHodoscope::Setup(const char* name, const char* description) ...@@ -130,6 +130,14 @@ void THcHodoscope::Setup(const char* name, const char* description)
fPartMass = app->GetParticleMass(); fPartMass = app->GetParticleMass();
fBetaNominal = app->GetBetaAtPcentral(); fBetaNominal = app->GetBetaAtPcentral();
if (fSHMS) {
fCherenkov = dynamic_cast<THcCherenkov*>(app->GetDetector("hgcer"));
} else {
fCherenkov = dynamic_cast<THcCherenkov*>(app->GetDetector("cer"));
}
delete [] desc; delete [] desc;
} }
...@@ -189,6 +197,9 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date ) ...@@ -189,6 +197,9 @@ THaAnalysisObject::EStatus THcHodoscope::Init( const TDatime& date )
fScinHitPaddle.push_back(std::vector<Int_t>(fNPaddle[ip], 0)); fScinHitPaddle.push_back(std::vector<Int_t>(fNPaddle[ip], 0));
} }
return fStatus = kOK; return fStatus = kOK;
} }
//_____________________________________________________________________________ //_____________________________________________________________________________
...@@ -318,6 +329,9 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) ...@@ -318,6 +329,9 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
{"dumptof", &fDumpTOF, kInt, 0, 1}, {"dumptof", &fDumpTOF, kInt, 0, 1},
{"TOFCalib_shtrk_lo", &fTOFCalib_shtrk_lo, kDouble, 0, 1}, {"TOFCalib_shtrk_lo", &fTOFCalib_shtrk_lo, kDouble, 0, 1},
{"TOFCalib_shtrk_hi", &fTOFCalib_shtrk_hi, kDouble, 0, 1}, {"TOFCalib_shtrk_hi", &fTOFCalib_shtrk_hi, kDouble, 0, 1},
{"TOFCalib_cer_lo", &fTOFCalib_cer_lo, kDouble, 0, 1},
{"TOFCalib_beta_lo", &fTOFCalib_beta_lo, kDouble, 0, 1},
{"TOFCalib_beta_hi", &fTOFCalib_beta_hi, kDouble, 0, 1},
{"dumptof_filename", &fTOFDumpFile, kString, 0, 1}, {"dumptof_filename", &fTOFDumpFile, kString, 0, 1},
{0} {0}
}; };
...@@ -328,7 +342,11 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date ) ...@@ -328,7 +342,11 @@ Int_t THcHodoscope::ReadDatabase( const TDatime& date )
fAdcTimeWindowMin[ip] = 0.; fAdcTimeWindowMin[ip] = 0.;
fAdcTimeWindowMax[ip] = 1000.; fAdcTimeWindowMax[ip] = 1000.;
} }
fTOFCalib_shtrk_lo=-kBig;
fTOFCalib_shtrk_hi= kBig;
fTOFCalib_cer_lo=-kBig;
fTOFCalib_beta_lo=-kBig;
fTOFCalib_beta_hi= kBig;
fdebugprintscinraw=0; fdebugprintscinraw=0;
fDumpTOF = 0; fDumpTOF = 0;
fTOFDumpFile=""; fTOFDumpFile="";
...@@ -1545,7 +1563,10 @@ Int_t THcHodoscope::FineProcess( TClonesArray& tracks ) ...@@ -1545,7 +1563,10 @@ Int_t THcHodoscope::FineProcess( TClonesArray& tracks )
for (Int_t iphit = 0; iphit < fPlanes[ip]->GetNScinHits(); iphit++ ){ for (Int_t iphit = 0; iphit < fPlanes[ip]->GetNScinHits(); iphit++ ){
THcHodoHit *hit = fTOFPInfo[ih].hit; THcHodoHit *hit = fTOFPInfo[ih].hit;
if (fGoodFlags[itrk][ip][iphit].goodScinTime) { if (fGoodFlags[itrk][ip][iphit].goodScinTime) {
if(fDumpTOF && Ntracks==1 && fGoodEventTOFCalib && shower_track_enorm > fTOFCalib_shtrk_lo && shower_track_enorm < fTOFCalib_shtrk_hi ) { Bool_t sh_pid=(shower_track_enorm > fTOFCalib_shtrk_lo && shower_track_enorm < fTOFCalib_shtrk_hi);
Bool_t beta_pid=( fBeta > fTOFCalib_beta_lo && fBeta < fTOFCalib_beta_hi);
Bool_t cer_pid=( fCherenkov->GetCerNPE() > fTOFCalib_cer_lo);
if(fDumpTOF && Ntracks==1 && fGoodEventTOFCalib && sh_pid && beta_pid && cer_pid) {
fDumpOut << fixed << setprecision(2); fDumpOut << fixed << setprecision(2);
fDumpOut << showpoint << " 1" << setw(3) << ip+1 << setw(3) << hit->GetPaddleNumber() << setw(10) << hit->GetPosTDC()*fScinTdcToTime << setw(10) << fTOFPInfo[ih].pathp << setw(10) << fTOFPInfo[ih].zcor << setw(10) << fTOFPInfo[ih].time_pos << setw(10) << hit->GetPosADC() << endl; fDumpOut << showpoint << " 1" << setw(3) << ip+1 << setw(3) << hit->GetPaddleNumber() << setw(10) << hit->GetPosTDC()*fScinTdcToTime << setw(10) << fTOFPInfo[ih].pathp << setw(10) << fTOFPInfo[ih].zcor << setw(10) << fTOFPInfo[ih].time_pos << setw(10) << hit->GetPosADC() << endl;
fDumpOut << showpoint << " 2" << setw(3) << ip+1 << setw(3) << hit->GetPaddleNumber() << setw(10) << hit->GetNegTDC()*fScinTdcToTime << setw(10) << fTOFPInfo[ih].pathn << setw(10) << fTOFPInfo[ih].zcor << setw(10) << fTOFPInfo[ih].time_neg << setw(10) << hit->GetNegADC() << endl; fDumpOut << showpoint << " 2" << setw(3) << ip+1 << setw(3) << hit->GetPaddleNumber() << setw(10) << hit->GetNegTDC()*fScinTdcToTime << setw(10) << fTOFPInfo[ih].pathn << setw(10) << fTOFPInfo[ih].zcor << setw(10) << fTOFPInfo[ih].time_neg << setw(10) << hit->GetNegADC() << endl;
......
...@@ -15,6 +15,7 @@ ...@@ -15,6 +15,7 @@
#include "THcHodoHit.h" #include "THcHodoHit.h"
#include "THcRawHodoHit.h" #include "THcRawHodoHit.h"
#include "THcScintillatorPlane.h" #include "THcScintillatorPlane.h"
#include "THcCherenkov.h"
#include "THaTrackingDetector.h" #include "THaTrackingDetector.h"
#include "THcHitList.h" #include "THcHitList.h"
...@@ -117,6 +118,8 @@ public: ...@@ -117,6 +118,8 @@ public:
THcHodoscope(); // for ROOT I/O THcHodoscope(); // for ROOT I/O
protected: protected:
THcCherenkov* fCherenkov;
Int_t fAnalyzePedestals; Int_t fAnalyzePedestals;
Int_t fNHits; Int_t fNHits;
...@@ -212,6 +215,9 @@ protected: ...@@ -212,6 +215,9 @@ protected:
Double_t fTOFCalib_shtrk_lo; Double_t fTOFCalib_shtrk_lo;
Double_t fTOFCalib_shtrk_hi; Double_t fTOFCalib_shtrk_hi;
Double_t fTOFCalib_cer_lo;
Double_t fTOFCalib_beta_lo;
Double_t fTOFCalib_beta_hi;
Int_t fDumpTOF; Int_t fDumpTOF;
ofstream fDumpOut; ofstream fDumpOut;
string fTOFDumpFile; string fTOFDumpFile;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment