FairRoot/PandaRoot
Public Member Functions | Private Member Functions | Private Attributes | List of all members
PndDrcLutReco Class Reference

#include <PndDrcLutReco.h>

Inheritance diagram for PndDrcLutReco:

Public Member Functions

 PndDrcLutReco ()
 
 PndDrcLutReco (Int_t verbose)
 
 PndDrcLutReco (Int_t verbose, TString infilename)
 
virtual ~PndDrcLutReco ()
 
virtual InitStatus Init ()
 
virtual void Exec (Option_t *option)
 
virtual void Finish ()
 
void SetOutputFile (TString infilename="luttab.root")
 

Private Member Functions

void LoopOverMcTracks ()
 
void FillAmbiguities (PndDrcPhotonInfo *photoninfo, Int_t barId, Int_t recalculatedSensorId, Double_t directz, Double_t barHitTime)
 
void DetermineCherenkov (PndDrcTrackInfo *trackinfo, Int_t boxId)
 
void DetermineBarId (Double_t phi, Double_t &boxPhi, Int_t &boxId, Int_t &barId)
 
Double_t FindPeak ()
 
Int_t FindPdg (Double_t mom, Double_t cangle)
 
void SetDefaultParameters ()
 

Private Attributes

PndGeoDrcfGeo
 
Int_t fDetectorID
 
Double_t fBboxNum
 
Double_t fPipehAngle
 
Double_t fDphi
 
Double_t fBarPhi
 
TClonesArray * fMCArray
 
TClonesArray * fBarPointArray
 
TClonesArray * fEVPointArray
 
TClonesArray * fPDPointArray
 
TClonesArray * fDigiArray
 
TClonesArray * fPDHitArray
 
TClonesArray * fLut [5]
 
TClonesArray * fDrcTrackInfoArray
 
TFile * fFile
 
TTree * fTree
 
PndMCTrackfMCTrack
 
PndDrcBarPointfBarPoint
 
PndDrcEVPointfEVPoint
 
PndDrcPDPointfPDPoint
 
PndDrcDigifDigi
 
PndDrcPDHitfPDHit
 
Int_t fVerbose
 
Int_t nevents
 
TString fInputFile
 
Int_t fEvType
 
Int_t fRadType
 
Int_t fLensType
 
TH1F * fHist
 
TH1F * fHist2
 
TF1 * fFit
 
TSpectrum * fSpect
 

Detailed Description

Definition at line 34 of file PndDrcLutReco.h.

Constructor & Destructor Documentation

PndDrcLutReco::PndDrcLutReco ( )

Definition at line 27 of file PndDrcLutReco.cxx.

References fInputFile.

27  : FairTask("PndDrcLutReco"){
28  fInputFile = "luttab.root";
29 }
TString fInputFile
Definition: PndDrcLutReco.h:95
PndDrcLutReco::PndDrcLutReco ( Int_t  verbose)

Definition at line 32 of file PndDrcLutReco.cxx.

References fInputFile, fVerbose, and verbose.

33  :FairTask("PndDrcLutReco",verbose){
34  fVerbose = verbose;
35  fInputFile = "luttab.root";
36 }
#define verbose
TString fInputFile
Definition: PndDrcLutReco.h:95
PndDrcLutReco::PndDrcLutReco ( Int_t  verbose,
TString  infilename 
)

Definition at line 38 of file PndDrcLutReco.cxx.

References fInputFile, fVerbose, and verbose.

39  :FairTask("PndDrcLutReco",verbose){
40  fVerbose = verbose;
41  fInputFile = infilename;
42 }
#define verbose
TString fInputFile
Definition: PndDrcLutReco.h:95
PndDrcLutReco::~PndDrcLutReco ( )
virtual

Definition at line 45 of file PndDrcLutReco.cxx.

45  {
46 
47 }

Member Function Documentation

void PndDrcLutReco::DetermineBarId ( Double_t  phi,
Double_t boxPhi,
Int_t &  boxId,
Int_t &  barId 
)
private

Definition at line 312 of file PndDrcLutReco.cxx.

References Double_t, fBarPhi, fDphi, fPipehAngle, fRadType, and Pi.

Referenced by DetermineCherenkov().

312  { // boxId //[R.K.03/2017] unused variable(s)
313  Double_t startPhi = phi/TMath::Pi()*180;
314  if(startPhi < 0) startPhi = 360 + startPhi;
315  if(startPhi >= 0 && startPhi < 90) boxPhi = TMath::Floor(startPhi/fDphi) *fDphi + fDphi/2.;
316  if(startPhi >= 90 && startPhi < 270) boxPhi = 90 + fPipehAngle + TMath::Floor((startPhi-90-fPipehAngle)/fDphi) *fDphi + fDphi/2.;
317  if(startPhi >= 270 && startPhi < 360) boxPhi = 270 + fPipehAngle + TMath::Floor((startPhi-270-fPipehAngle)/fDphi) *fDphi + fDphi/2.;
318 
319  if(fRadType==5) barId = (int) (2.5 + (boxPhi-startPhi)/fBarPhi);
320  if(fRadType==3) barId = (int) (1.5 + (boxPhi-startPhi)/fBarPhi);
321  if(barId>4 || barId<0){
322  std::cout<<"Error in PndDrcLutReco: Bar Id is wrong. barId = "<< barId <<std::endl;
323  barId = -1;
324  }
325  std::cout<<"phi="<<phi<<" boxPhi "<<boxPhi<<" startPhi " <<startPhi<<" 8235fBarPhi "<<fBarPhi<<std::endl;
326 
327 }
Double_t fBarPhi
Definition: PndDrcLutReco.h:68
Double_t
Double_t fDphi
Definition: PndDrcLutReco.h:68
Double_t fPipehAngle
Definition: PndDrcLutReco.h:68
Double_t Pi
void PndDrcLutReco::DetermineCherenkov ( PndDrcTrackInfo trackinfo,
Int_t  boxId 
)
private

Definition at line 188 of file PndDrcLutReco.cxx.

References PndDrcTrackInfo::AddPhoton(), Bool_t, DetermineBarId(), Double_t, fEVPoint, fEVPointArray, fEvType, FillAmbiguities(), FindPdg(), FindPeak(), fMCArray, fPDHit, fPDHitArray, fPDPoint, fPDPointArray, PndDrcTrackInfo::GetMcMomentumInBar(), PndDrcTrackInfo::GetMcPositionInBar(), PndDrcTrackInfo::GetMcTimeInBar(), PndDrcPDHit::GetSensorId(), PndDrcPDHit::GetTime(), i, nevents, Pi, PndDrcTrackInfo::SetCherenkov(), PndDrcPhotonInfo::SetEvReflections(), PndDrcPhotonInfo::SetHitTime(), PndDrcPhotonInfo::SetMcPrimeMomentumInBar(), PndDrcTrackInfo::SetPdg(), and PndDrcPhotonInfo::SetReflected().

Referenced by LoopOverMcTracks().

188  {
189 
190  TVector3 momInBar = trackinfo->GetMcMomentumInBar();
191  TVector3 posInBar = trackinfo->GetMcPositionInBar();
192  Double_t barHitTime = trackinfo->GetMcTimeInBar();
193  Double_t boxPhi;//, cangle, bartime, lutboxPhi=10.825, window1, window2, angdiv; //[R.K. 01/2017] unused variable?
194  Int_t lutboxId(3), barId(-1), evpointcount(0);
195  Bool_t reflected;
196  Int_t boxId1;
197 
198  DetermineBarId(posInBar.Phi(),boxPhi, boxId1, barId);
199 
200  if(barId<0) return;
201  momInBar.RotateZ(-boxPhi/180.*TMath::Pi());
202 
203 
204  // window1 = (mcboxId)*17-17;
205  // window2 = (mcboxId+1)*17+17;
206 
207  // Loop over PndDrcPDHits
208  for(Int_t ihit=0; ihit<fPDHitArray->GetEntriesFast(); ihit++) {
209  fPDHit = (PndDrcPDHit*)fPDHitArray->At(ihit);
210  //Int_t wsensorId = fPDHit->GetSensorId()/100; //[R.K. 01/2017] unused variable?
211  // if(wsensorId < window1 || wsensorId > window2) continue;
212 
213  Int_t sensorId = fPDHit->GetSensorId();
214  Double_t pdHitTime = fPDHit->GetTime();
215 
216  //((FairMultiLinkedData*)fPDHit)->Print();
217  Int_t pointID = fPDHit->GetLink(1).GetIndex();
218  Int_t eventID = fPDHit->GetLink(1).GetEntry();
219 
220  if(eventID != nevents) continue;
221  if( fPDPointArray->GetEntriesFast()<= pointID ){
222  std::cout<<" name "<< FairRootManager::Instance()->GetBranchName(fPDHit->GetLink(1).GetType()) <<std::endl;
223  std::cout<<"ERROR 83 " << pointID <<" out of " <<fPDPointArray->GetEntriesFast() <<" "<< eventID<<"/"<<nevents<<std::endl;
224  continue;
225  }
226 
227  fPDPoint = (PndDrcPDPoint*)fPDPointArray->At(pointID);
228 
229  Int_t trackID = fPDPoint->GetTrackID();
230  evpointcount = 0;
231  for(int i=0; i<fEVPointArray->GetEntriesFast(); i++){
233  if(trackID == fEVPoint->GetTrackID()) evpointcount++;
234  }
235  if(((PndMCTrack*)fMCArray->At(trackID))->GetMomentum().Z()>0) reflected = kTRUE;
236  else reflected = kFALSE;
237 
238  Int_t recalculatedSensorId = sensorId;
239  if(fEvType<3) recalculatedSensorId = (sensorId/100 - (boxId - lutboxId)*17)*100 + sensorId%100; // for tank EV
240 
241  if(sensorId>27200 || recalculatedSensorId>27200 || recalculatedSensorId <0) {
242  std::cout<<"LUT reco: ignore vertical MCPblock for now. sensorId = "<<sensorId
243  << " recalculatedSensorId = "<< recalculatedSensorId <<std::endl;
244  continue;
245  }
246 
247  PndDrcPhotonInfo photoninfo;
248  photoninfo.SetMcPrimeMomentumInBar(momInBar);
249  photoninfo.SetHitTime(pdHitTime);
250  photoninfo.SetReflected(reflected);
251  photoninfo.SetEvReflections(evpointcount);
252  FillAmbiguities(&photoninfo, barId, recalculatedSensorId, posInBar.Z()+119, barHitTime);
253  trackinfo->AddPhoton(photoninfo);
254  }
255 
256  Double_t cherenkovreco = FindPeak();
257  Int_t pdgreco = FindPdg(momInBar.Mag(), cherenkovreco);
258 
259  trackinfo->SetPdg(pdgreco);
260  trackinfo->SetCherenkov(cherenkovreco);
261 }
void SetPdg(Int_t val)
void SetEvReflections(Int_t val)
TClonesArray * fEVPointArray
Definition: PndDrcLutReco.h:72
Int_t i
Definition: run_full.C:25
Int_t GetSensorId()
Definition: PndDrcPDHit.h:59
void DetermineBarId(Double_t phi, Double_t &boxPhi, Int_t &boxId, Int_t &barId)
TClonesArray * fPDHitArray
Definition: PndDrcLutReco.h:75
TClonesArray * fMCArray
Definition: PndDrcLutReco.h:70
PndDrcPDHit * fPDHit
Definition: PndDrcLutReco.h:87
virtual Double_t GetTime()
Definition: PndDrcPDHit.h:55
TClonesArray * fPDPointArray
Definition: PndDrcLutReco.h:73
PndDrcEVPoint * fEVPoint
Definition: PndDrcLutReco.h:84
void SetReflected(Bool_t val)
Double_t
void FillAmbiguities(PndDrcPhotonInfo *photoninfo, Int_t barId, Int_t recalculatedSensorId, Double_t directz, Double_t barHitTime)
Double_t GetMcTimeInBar()
TVector3 GetMcPositionInBar()
Int_t FindPdg(Double_t mom, Double_t cangle)
void AddPhoton(PndDrcPhotonInfo photon)
TVector3 GetMcMomentumInBar()
void SetMcPrimeMomentumInBar(TVector3 val)
void SetCherenkov(Double_t val)
void SetHitTime(Double_t val)
Double_t Pi
PndDrcPDPoint * fPDPoint
Definition: PndDrcLutReco.h:85
Double_t FindPeak()
void PndDrcLutReco::Exec ( Option_t *  option)
virtual

Definition at line 135 of file PndDrcLutReco.cxx.

References fDetectorID, fDrcTrackInfoArray, fPDHitArray, fVerbose, LoopOverMcTracks(), nevents, and nHits.

135  {
136  nevents++;
137  fDetectorID = 0;
138  if ( ! fDrcTrackInfoArray ) Fatal("Exec", "No fDrcTrackInfoArray");
139  fDrcTrackInfoArray->Clear();
140  Int_t nHits = fPDHitArray->GetEntriesFast();
141  if(fVerbose>1) std::cout<<"Event # "<< nevents<<" has "<<nHits<<" hits."<< std::endl;
142  else if(fVerbose==1 && nevents%100==0) std::cout<<"Event # "<< nevents<<" has "<<nHits<<" hits."<< std::endl;
143 
145 }
TClonesArray * fDrcTrackInfoArray
Definition: PndDrcLutReco.h:77
TClonesArray * fPDHitArray
Definition: PndDrcLutReco.h:75
void LoopOverMcTracks()
int nHits
Definition: RiemannTest.C:16
void PndDrcLutReco::FillAmbiguities ( PndDrcPhotonInfo photoninfo,
Int_t  barId,
Int_t  recalculatedSensorId,
Double_t  directz,
Double_t  barHitTime 
)
private

Definition at line 263 of file PndDrcLutReco.cxx.

References PndDrcPhotonInfo::AddAmbiguity(), At, cos(), Double_t, PndDrcLutNode::Entries(), fabs(), fGeo, fHist, fLut, PndDrcLutNode::GetEntry(), PndDrcPhotonInfo::GetHitTime(), PndDrcPhotonInfo::GetMcPrimeMomentumInBar(), PndDrcPhotonInfo::GetReflected(), PndDrcLutNode::GetTime(), i, PndGeoDrc::nQuartz(), Pi, PndDrcAmbiguityInfo::SetBarTime(), PndDrcAmbiguityInfo::SetCherencov(), and PndDrcAmbiguityInfo::SetEvTime().

Referenced by DetermineCherenkov().

263  {
264  TVector3 dird, dir,
265  fnX1 = TVector3(1,0,0),
266  fnY1 = TVector3(0,1,0),
267  momInBar = photoninfo->GetMcPrimeMomentumInBar();
268 
269  Double_t evtime, bartime, luttheta, tangle;
270  Double_t reflected = photoninfo->GetReflected();
271  Double_t pdHitTime = photoninfo->GetHitTime();
272  Double_t criticalAngle = asin(1.00028/fGeo->nQuartz());
273  if(reflected) lenz = 2*240 - lenz;
274 
275  PndDrcLutNode *node = (PndDrcLutNode*) fLut[barId]->At(recalculatedSensorId);
276  Int_t size = node->Entries();
277 
278  for(int i=0; i<size; i++){
279  dird = node->GetEntry(i);
280 
281  //dird.RotateZ(-lutboxPhi/180.*TMath::Pi());
282 
283  evtime = node->GetTime(i);
284  for(int u=0; u<4; u++){
285  if(u == 0) dir = dird;
286  if(u == 1) dir.SetXYZ(-dird.X(), dird.Y(), dird.Z());
287  if(u == 2) dir.SetXYZ( dird.X(),-dird.Y(), dird.Z());
288  if(u == 3) dir.SetXYZ(-dird.X(),-dird.Y(), dird.Z());
289  if(reflected) dir.SetXYZ( dir.X(), dir.Y(),-dir.Z());
290 
291  if(dir.Angle(fnX1) < criticalAngle || dir.Angle(fnY1) < criticalAngle) continue;
292 
293  luttheta = dir.Theta();
294  if(luttheta > TMath::Pi()/2.) luttheta = TMath::Pi()-luttheta;
295  bartime = lenz/cos(luttheta)/19.8;
296 
297  if(fabs((bartime + evtime)-(pdHitTime-barHitTime))>1.5) continue;
298  tangle = momInBar.Angle(dir);
299  //if(tangle>TMath::Pi()/2.) tangle = TMath::Pi()-tangle;
300 
301  PndDrcAmbiguityInfo ambinfo;
302  ambinfo.SetBarTime(bartime);
303  ambinfo.SetEvTime(evtime);
304  ambinfo.SetCherencov(tangle);
305 
306  photoninfo->AddAmbiguity(ambinfo);
307  if(tangle > 0.4 && tangle < 0.9) fHist->Fill(tangle);
308  }
309  }
310 }
friend F32vec4 cos(const F32vec4 &a)
Definition: P4_F32vec4.h:112
Int_t i
Definition: run_full.C:25
void SetEvTime(Double_t val)
Double_t
void SetBarTime(Double_t val)
Double_t nQuartz()
Definition: PndGeoDrc.h:70
void AddAmbiguity(PndDrcAmbiguityInfo ambiguity)
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
TVector3 GetEntry(Int_t entry)
Definition: PndDrcLutNode.h:39
TClonesArray * fLut[5]
Definition: PndDrcLutReco.h:76
Double_t GetTime(Int_t entry)
Definition: PndDrcLutNode.h:42
Int_t Entries()
Definition: PndDrcLutNode.h:36
Double_t GetHitTime()
PndGeoDrc * fGeo
Definition: PndDrcLutReco.h:66
void SetCherencov(Double_t val)
Double_t Pi
cout<<"the Event No is "<< i<< endl;{{if(hit_array->GetEntriesFast()!=mc_array->GetEntriesFast()) continue;PndSdsHit *hit=(PndSdsHit *) hit_array-> At(j)
Definition: anaLmdCluster.C:71
TVector3 GetMcPrimeMomentumInBar()
Int_t PndDrcLutReco::FindPdg ( Double_t  mom,
Double_t  cangle 
)
private

Definition at line 364 of file PndDrcLutReco.cxx.

References acos(), Double_t, fabs(), i, and sqrt().

Referenced by DetermineCherenkov().

364  {
365  Int_t pdg[]={11,13,211,321,2212};
366  Double_t mass[] = {0.000511,0.1056584,0.139570,0.49368,0.9382723};
367  Double_t tdiff, diff=100;
368  Int_t minid=0;
369  for(Int_t i=0; i<5; i++){
370  tdiff = fabs(cangle - acos(sqrt(mom*mom + mass[i]*mass[i])/mom/1.46907)); //1.46907 - fused silica
371  if(tdiff<diff){
372  diff = tdiff;
373  minid = i;
374  }
375  }
376  return pdg[minid];
377 }
friend F32vec4 acos(const F32vec4 &a)
Definition: P4_F32vec4.h:113
Int_t i
Definition: run_full.C:25
friend F32vec4 sqrt(const F32vec4 &a)
Definition: P4_F32vec4.h:29
Double_t mom
Definition: plot_dirc.C:14
Double_t
friend F32vec4 fabs(const F32vec4 &a)
Definition: P4_F32vec4.h:47
Double_t PndDrcLutReco::FindPeak ( )
private

Definition at line 330 of file PndDrcLutReco.cxx.

References c, Double_t, fFit, fHist, fHist2, fSpect, and fVerbose.

Referenced by DetermineCherenkov().

330  {
331  Double_t cherenkovreco = -1;
332 
333  if(fHist->GetEntries()>20 ){
334  TCanvas* c = new TCanvas("c","c",0,0,800,600);
335  Int_t nfound = fSpect->Search(fHist,1,"",0.6);
336  Float_t *xpeaks = (Float_t*)fSpect->GetPositionX();
337  if(nfound>0) cherenkovreco = xpeaks[0];
338  fFit->SetParameter(1,cherenkovreco); // peak
339  fFit->SetParameter(2,0.01); // width
340  fHist->Fit("fgaus","Q","",cherenkovreco-0.02,cherenkovreco+0.02);
341  cherenkovreco = fFit->GetParameter(1);
342  std::cout<<"sigma "<< fFit->GetParameter(2) <<std::endl;
343 
344  if(cherenkovreco<0 || cherenkovreco>1 ) cherenkovreco = 0;
345 
346  if(fVerbose>1){
347  fHist->GetXaxis()->SetTitle("#theta_{C}, [rad]");
348  fHist->GetYaxis()->SetTitle("Entries, [#]");
349  fHist->Draw();
350  // fHist2->SetLineColor(4);
351  // fHist2->Draw("same");
352  c->Modified();
353  c->Update();
354  c->WaitPrimitive();
355  // c->Print(Form("pic/animpid/animpid_%d.png",g_num++));
356  }
357  }
358  fHist2->Reset();
359  fHist->Reset();
360 
361  return cherenkovreco;
362 }
TSpectrum * fSpect
Double_t
void PndDrcLutReco::Finish ( )
virtual

Definition at line 380 of file PndDrcLutReco.cxx.

References fLut.

380  {
381  for(Int_t l=0; l<5; l++){
382  fLut[l]->Clear();
383  }
384  cout << "-I- PndDrcLutReco: Finish" << endl;
385 }
TClonesArray * fLut[5]
Definition: PndDrcLutReco.h:76
InitStatus PndDrcLutReco::Init ( )
virtual

Definition at line 50 of file PndDrcLutReco.cxx.

References PndGeoDrc::barhGap(), PndGeoDrc::BarWidth(), PndGeoDrc::BBoxNum(), Double_t, fBarPhi, fBarPointArray, fBboxNum, fDphi, fDrcTrackInfoArray, fEVPointArray, fEvType, fFile, fFit, fGeo, fHist, fHist2, fInputFile, fLensType, fLut, fMCArray, fPDHitArray, fPDPointArray, fPipehAngle, fRadType, fSpect, fTree, name, nevents, Pi, PndGeoDrc::PipehAngle(), PndGeoDrc::radius(), and TString.

50  {
51  cout << " ---------- INITIALIZATION ------------" << endl;
52  nevents = -1;
53  // Get RootManager
54  FairRootManager* ioman = FairRootManager::Instance();
55  if ( ! ioman ) {
56  cout << "-E- PndDrcLutReco::Init: " << "RootManager not instantiated!" << endl;
57  return kFATAL;
58  }
59 
60  // Get input array
61  fMCArray = (TClonesArray*) ioman->GetObject("MCTrack");
62  if ( ! fMCArray ) {
63  cout << "-W- PndDrcLutReco::Init: " << "No MCTrack array!" << endl;
64  return kERROR;
65  }
66 
67  // Get bar points array
68  fBarPointArray = (TClonesArray*) ioman->GetObject("DrcBarPoint");
69  if ( ! fBarPointArray ) {
70  cout << "-W- PndDrcLutReco::Init: " << "No DrcBarPoint array!" << endl;
71  return kERROR;
72  }
73 
74  // Get ev points array
75  fEVPointArray = (TClonesArray*) ioman->GetObject("DrcEVPoint");
76  if ( ! fEVPointArray ) {
77  cout << "-W- PndDrcLutReco::Init: " << "No DrcEVPoint array!" << endl;
78  return kERROR;
79  }
80 
81  // Get Photon point array
82  fPDPointArray = (TClonesArray*) ioman->GetObject("DrcPDPoint");
83  if ( ! fPDPointArray ) {
84  cout << "-W- PndDrcLutReco::Init: " << "No DrcPDPoint array!" << endl;
85  return kERROR;
86  }
87  // // Get digi array
88  // fDigiArray = (TClonesArray*) ioman->GetObject("DrcDigi");
89  // if ( ! fDigiArray ) {
90  // cout << "-W- PndDrcLutReco::Init: " << "No DrcDigi array!" << endl;
91  // return kERROR;
92  // }
93  // Get input array
94  fPDHitArray = (TClonesArray*) ioman->GetObject("DrcPDHit");
95  if ( ! fPDHitArray ) {
96  cout << "-W- PndDrcLutReco::Init: " << "No DrcPDHit array!" << endl;
97  return kERROR;
98  }
99 
101  name.Remove(0,name.Last('/')+1);
102  sscanf(name, "lut_e%d_b%d_l%d", &fEvType,&fRadType,&fLensType);
103 
104  fFile = new TFile(fInputFile);
105  fTree=(TTree *) fFile->Get("dircsim") ;
106  for(Int_t l=0; l<5; l++){
107  fLut[l] = new TClonesArray("PndDrcLutNode");
108  fTree->SetBranchAddress(Form("LUT%d",l),&fLut[l]);
109  }
110  fTree->GetEntry(0);
111 
112  // Create and register output array
113  fDrcTrackInfoArray = new TClonesArray("PndDrcTrackInfo");
114  ioman->Register("DrcTrackInfo","Drc",fDrcTrackInfoArray, kTRUE);
115 
116  fGeo = new PndGeoDrc();
117  fBboxNum = fGeo->BBoxNum();
119  Double_t barwidth = fGeo->BarWidth();
120  if(fRadType==3) barwidth = 5.41333;
121  fBarPhi = 2*atan(((barwidth + fGeo->barhGap())/2.)/fGeo->radius())*180/TMath::Pi();
122  fDphi = 2.*(180. - 2*fPipehAngle)/(Double_t)fGeo->BBoxNum();
123 
124  fHist = new TH1F("chrenkov_angle_hist","chrenkov_angle_hist", 100,0.4,0.9);
125  // fHist2 = new TH1F("chrenkov_angle_hist2","chrenkov_angle_hist2", 100,0.35,0.85);
126  fHist2 = new TH1F("chrenkov_angle_hist2","", 400,-30,30);
127  fFit = new TF1("fgaus","[0]*exp(-0.5*((x-[1])/[2])*(x-[1])/[2])",0.35,0.85);
128  fSpect = new TSpectrum(10);
129 
130  cout << "-I- PndDrcLutReco: Intialization successfull" << endl;
131  return kSUCCESS;
132 }
TClonesArray * fDrcTrackInfoArray
Definition: PndDrcLutReco.h:77
TClonesArray * fEVPointArray
Definition: PndDrcLutReco.h:72
Double_t fBboxNum
Definition: PndDrcLutReco.h:68
Double_t BBoxNum()
Definition: PndGeoDrc.h:136
TSpectrum * fSpect
Double_t BarWidth()
Definition: PndGeoDrc.h:100
TClonesArray * fPDHitArray
Definition: PndDrcLutReco.h:75
TClonesArray * fMCArray
Definition: PndDrcLutReco.h:70
Double_t fBarPhi
Definition: PndDrcLutReco.h:68
TClonesArray * fPDPointArray
Definition: PndDrcLutReco.h:73
Double_t PipehAngle()
Definition: PndGeoDrc.h:139
Double_t
TClonesArray * fBarPointArray
Definition: PndDrcLutReco.h:71
TString fInputFile
Definition: PndDrcLutReco.h:95
TString name
Double_t fDphi
Definition: PndDrcLutReco.h:68
Double_t barhGap()
Definition: PndGeoDrc.h:112
Double_t fPipehAngle
Definition: PndDrcLutReco.h:68
TClonesArray * fLut[5]
Definition: PndDrcLutReco.h:76
PndGeoDrc * fGeo
Definition: PndDrcLutReco.h:66
Double_t Pi
Double_t radius()
Definition: PndGeoDrc.h:92
void PndDrcLutReco::LoopOverMcTracks ( )
private

Definition at line 147 of file PndDrcLutReco.cxx.

References DetermineCherenkov(), fBarPoint, fBarPointArray, fDrcTrackInfoArray, fMCArray, fMCTrack, fVerbose, PndDrcBarPoint::GetBoxId(), PndMCTrack::GetMomentum(), PndMCTrack::GetMotherID(), PndMCTrack::GetPdgCode(), PndDrcBarPoint::GetThetaC(), i, PndDrcTrackInfo::SetMcCherenkov(), PndDrcTrackInfo::SetMcMomentum(), PndDrcTrackInfo::SetMcMomentumInBar(), PndDrcTrackInfo::SetMcPdg(), PndDrcTrackInfo::SetMcPositionInBar(), and PndDrcTrackInfo::SetMcTimeInBar().

Referenced by Exec().

147  {
148  TVector3 momInBar, posInBar;
149 
150  for(Int_t itrack=0; itrack<fMCArray->GetEntriesFast(); itrack++){
151  fMCTrack = (PndMCTrack*)fMCArray->At(itrack);
152  if( fMCTrack->GetMotherID() != -1) continue;
153 
154  Int_t mcBoxId(-1); //mcBarId, //[R.K.03/2017] unused variable
155  for(int i=0; i<fBarPointArray->GetEntriesFast(); i++){
157  if(itrack == fBarPoint->GetTrackID()){
158  mcBoxId = fBarPoint->GetBoxId();
159  break;
160  }
161  }
162  if(mcBoxId == -1) {
163  std::cout<<"mcBoxId "<<mcBoxId <<std::endl;
164  continue;
165  }
166  fBarPoint->Momentum(momInBar);
167  fBarPoint->Position(posInBar);
168  //mcBarId = fBarPoint->GetBarId(); //[R.K.03/2017] unused variable
169 
170  PndDrcTrackInfo trackinfo;
171  trackinfo.SetMcMomentum(fMCTrack->GetMomentum());
172  trackinfo.SetMcPdg(fMCTrack->GetPdgCode());
173  trackinfo.SetMcCherenkov( fBarPoint->GetThetaC());
174  trackinfo.SetMcMomentumInBar(momInBar);
175  trackinfo.SetMcPositionInBar(posInBar);
176  trackinfo.SetMcTimeInBar(fBarPoint->GetTime());
177 
178  if(fVerbose<2) gROOT->SetBatch(kTRUE);
179  DetermineCherenkov(&trackinfo,mcBoxId);
180  if(fVerbose<2) gROOT->SetBatch(kFALSE);
181  // std::cout<<"dCh = "<< trackinfo.GetMcCherenkov()-trackinfo.GetCherenkov()
182  // << " pdg = "<< trackinfo.GetPdg()<<std::endl;
183 
184  new ((*fDrcTrackInfoArray)[fDrcTrackInfoArray->GetEntriesFast()]) PndDrcTrackInfo(trackinfo);
185  }
186 }
void SetMcCherenkov(Double_t val)
TClonesArray * fDrcTrackInfoArray
Definition: PndDrcLutReco.h:77
Int_t i
Definition: run_full.C:25
Int_t GetPdgCode() const
Definition: PndMCTrack.h:73
TVector3 GetMomentum() const
Definition: PndMCTrack.h:78
void SetMcMomentum(TVector3 val)
TClonesArray * fMCArray
Definition: PndDrcLutReco.h:70
Double_t GetThetaC() const
Int_t GetBoxId() const
TClonesArray * fBarPointArray
Definition: PndDrcLutReco.h:71
PndMCTrack * fMCTrack
Definition: PndDrcLutReco.h:82
void SetMcPositionInBar(TVector3 val)
PndDrcBarPoint * fBarPoint
Definition: PndDrcLutReco.h:83
void SetMcTimeInBar(Double_t val)
void SetMcMomentumInBar(TVector3 val)
Int_t GetMotherID() const
Definition: PndMCTrack.h:74
void SetMcPdg(Int_t val)
void DetermineCherenkov(PndDrcTrackInfo *trackinfo, Int_t boxId)
void PndDrcLutReco::SetDefaultParameters ( )
private
void PndDrcLutReco::SetOutputFile ( TString  infilename = "luttab.root")
inline

Definition at line 56 of file PndDrcLutReco.h.

References fInputFile.

56 {fInputFile = infilename;}
TString fInputFile
Definition: PndDrcLutReco.h:95

Member Data Documentation

Double_t PndDrcLutReco::fBarPhi
private

Definition at line 68 of file PndDrcLutReco.h.

Referenced by DetermineBarId(), and Init().

PndDrcBarPoint* PndDrcLutReco::fBarPoint
private

Definition at line 83 of file PndDrcLutReco.h.

Referenced by LoopOverMcTracks().

TClonesArray* PndDrcLutReco::fBarPointArray
private

Definition at line 71 of file PndDrcLutReco.h.

Referenced by Init(), and LoopOverMcTracks().

Double_t PndDrcLutReco::fBboxNum
private

Definition at line 68 of file PndDrcLutReco.h.

Referenced by Init().

Int_t PndDrcLutReco::fDetectorID
private

Definition at line 67 of file PndDrcLutReco.h.

Referenced by Exec().

PndDrcDigi* PndDrcLutReco::fDigi
private

Definition at line 86 of file PndDrcLutReco.h.

TClonesArray* PndDrcLutReco::fDigiArray
private

Definition at line 74 of file PndDrcLutReco.h.

Double_t PndDrcLutReco::fDphi
private

Definition at line 68 of file PndDrcLutReco.h.

Referenced by DetermineBarId(), and Init().

TClonesArray* PndDrcLutReco::fDrcTrackInfoArray
private

Definition at line 77 of file PndDrcLutReco.h.

Referenced by Exec(), Init(), and LoopOverMcTracks().

PndDrcEVPoint* PndDrcLutReco::fEVPoint
private

Definition at line 84 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov().

TClonesArray* PndDrcLutReco::fEVPointArray
private

Definition at line 72 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov(), and Init().

Int_t PndDrcLutReco::fEvType
private

Definition at line 96 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov(), and Init().

TFile* PndDrcLutReco::fFile
private

Definition at line 79 of file PndDrcLutReco.h.

Referenced by Init().

TF1* PndDrcLutReco::fFit
private

Definition at line 99 of file PndDrcLutReco.h.

Referenced by FindPeak(), and Init().

PndGeoDrc* PndDrcLutReco::fGeo
private

Definition at line 66 of file PndDrcLutReco.h.

Referenced by FillAmbiguities(), and Init().

TH1F* PndDrcLutReco::fHist
private

Definition at line 97 of file PndDrcLutReco.h.

Referenced by FillAmbiguities(), FindPeak(), and Init().

TH1F* PndDrcLutReco::fHist2
private

Definition at line 98 of file PndDrcLutReco.h.

Referenced by FindPeak(), and Init().

TString PndDrcLutReco::fInputFile
private

Definition at line 95 of file PndDrcLutReco.h.

Referenced by Init(), PndDrcLutReco(), and SetOutputFile().

Int_t PndDrcLutReco::fLensType
private

Definition at line 96 of file PndDrcLutReco.h.

Referenced by Init().

TClonesArray* PndDrcLutReco::fLut[5]
private

Definition at line 76 of file PndDrcLutReco.h.

Referenced by FillAmbiguities(), Finish(), and Init().

TClonesArray* PndDrcLutReco::fMCArray
private

Definition at line 70 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov(), Init(), and LoopOverMcTracks().

PndMCTrack* PndDrcLutReco::fMCTrack
private

Definition at line 82 of file PndDrcLutReco.h.

Referenced by LoopOverMcTracks().

PndDrcPDHit* PndDrcLutReco::fPDHit
private

Definition at line 87 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov().

TClonesArray* PndDrcLutReco::fPDHitArray
private

Definition at line 75 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov(), Exec(), and Init().

PndDrcPDPoint* PndDrcLutReco::fPDPoint
private

Definition at line 85 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov().

TClonesArray* PndDrcLutReco::fPDPointArray
private

Definition at line 73 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov(), and Init().

Double_t PndDrcLutReco::fPipehAngle
private

Definition at line 68 of file PndDrcLutReco.h.

Referenced by DetermineBarId(), and Init().

Int_t PndDrcLutReco::fRadType
private

Definition at line 96 of file PndDrcLutReco.h.

Referenced by DetermineBarId(), and Init().

TSpectrum* PndDrcLutReco::fSpect
private

Definition at line 100 of file PndDrcLutReco.h.

Referenced by FindPeak(), and Init().

TTree* PndDrcLutReco::fTree
private

Definition at line 80 of file PndDrcLutReco.h.

Referenced by Init().

Int_t PndDrcLutReco::fVerbose
private

Definition at line 93 of file PndDrcLutReco.h.

Referenced by Exec(), FindPeak(), LoopOverMcTracks(), and PndDrcLutReco().

Int_t PndDrcLutReco::nevents
private

Definition at line 94 of file PndDrcLutReco.h.

Referenced by DetermineCherenkov(), Exec(), and Init().


The documentation for this class was generated from the following files: