13 #include "FairRootManager.h"
20 #include "TPolyLine.h"
24 #include "FairRunAna.h"
25 #include "FairRuntimeDb.h"
26 #include "FairBaseParSet.h"
27 #include "FairGeoVolume.h"
29 #include "FairGeoTransform.h"
30 #include "FairGeoVector.h"
31 #include "FairGeoMedium.h"
32 #include "FairGeoNode.h"
36 #include "TParticlePDG.h"
37 #include "TDatabasePDG.h"
39 #include "TGeoManager.h"
72 cout <<
" ---------- INITIALIZATION ------------" << endl;
75 FairRootManager* ioman = FairRootManager::Instance();
77 cout <<
"-E- DrawHits::Init: "
78 <<
"RootManager not instantiated!" << endl;
83 fMCArray = (TClonesArray*) ioman->GetObject(
"MCTrack");
85 cout <<
"-W- DrawHits::Init: "
86 <<
"No MCTrack array!" << endl;
92 cout <<
"-W- DrawHits::Init: "
93 <<
"No DrcBarPoint array!" << endl;
97 fPDPointArray = (TClonesArray*) ioman->GetObject(
"DrcPDPoint");
99 cout <<
"-W- DrawHits::Init: "
100 <<
"No DrcPDPoint array!" << endl;
104 fHitArray = (TClonesArray*) ioman->GetObject(
"DrcHit");
106 cout <<
"-W- DrawHits::Init: "
107 <<
"No DrcHit array!" << endl;
111 fPDHitArray = (TClonesArray*) ioman->GetObject(
"DrcPDHit");
113 cout <<
"-W- DrawHits::Init: "
114 <<
"No DrcPDHit array!" << endl;
118 cout <<
"-I- DrawHits: Intialization successfull" << endl;
145 for(Int_t j=0; j<
fHitArray->GetEntriesFast(); j++) {
158 Int_t chtrID= pt->GetTrackID();
181 pt->Momentum(barmom);
194 cout<<
"ang = "<<angDeg<<
", mom = "<<trP<<endl;
212 Int_t trID= Ppt->GetTrackID();
250 fhCHlamMC->Fill(lambda,mother.Angle(photon));
264 cout <<
" Number of Detected Photon Hits : "<<
fPDHitArray->GetEntries()<<endl;
268 for(Int_t k=0; k<
fPDHitArray->GetEntriesFast(); k++) {
275 Int_t trID= Ppt->GetTrackID();
341 fhCHreal->Fill(photon1.Angle(mother1));
342 fhCHlam->Fill(lambdah, photon1.Angle(mother1));
384 fhThetaC =
new TH1D(
"fhThetaC",
"Cherenkov Angle", 100, 0, 1);
385 fhThetaCMass =
new TH2D(
"fhThetaCMass",
" ThetaC vs. Mass", 100, 0, 1, 100, 0, 0.6);
386 fhThetaCMomK =
new TH2D(
"fhThetaCMomK",
" ThetaC vs. Mom", 100, 0, 8.0, 100, 0, 1.);
387 fhThetaCMomP =
new TH2D(
"fhThetaCMomP",
" ThetaC vs. Mom", 100, 0, 8.0, 100, 0, 1.);
388 fhThetaCMomM =
new TH2D(
"fhThetaCMomM",
" ThetaC vs. Mom", 100, 0, 8.0, 100, 0, 1.);
389 fhThetaCMomE =
new TH2D(
"fhThetaCMomE",
" ThetaC vs. Mom", 100, 0, 8.0, 100, 0, 1.);
390 fhMomAng =
new TH2D(
"fhMomAng",
" Mom vs. Angle", 100, 0, 140.0, 100, 0.0,8.0);
391 fhPhoTheta =
new TH1F(
"fhPhoTheta",
"Number of photons as a function of initial track theta", 150, 0., 150.);
392 fhPDPlane =
new TH2F(
"fhPDPlane",
"pixels hit by photons", 338,-109.85,109.85, 338,-109.85,109.85);
396 fhLambda =
new TH1D(
"fhLambda",
"No of Photons vs. Lambda", 200, 100, 1000);
397 fhPDTime =
new TH1D(
"fhPDTime",
"Time in ns", 100, 0, 500);
398 fhXYPDHit =
new TH2D(
"fhXYPDHit",
"XY distribution of Photon Hits", 1000, -110, 110, 1000, -110, 110);
400 fhCHreal =
new TH1D(
"fhCHreal",
"Generated Cherenkov angle, hits", 100, 0.78, 0.88);
401 fhCHlam =
new TH2D(
"fhCHlam",
"Cherenkov angle as a function of lambda", 1000,0.,1000.,100,0.7,0.9);
404 fhXYPDMCPt =
new TH2D(
"fhXYPDMCpt",
"XY distribution of Photon MCPt", 1000, -110, 110, 1000, -110, 110);
405 fhLambdaMC =
new TH1D(
"fhLambdaMC",
"No of Photons vs. Lambda", 200, 100, 1000);
407 fhCHrealMC =
new TH1D(
"fhCHrealMC",
"Generated Cherenkov angle, MC",100, 0.78, 0.88);
408 fhCHlamMC =
new TH2D(
"fhCHlamMC",
"Cherenkov angle as a function of lambda", 1000,0.,1000.,100,0.7,0.9);
410 fhCHlamE =
new TH2D(
"fhCHlamE",
"CHerenkov angle as a function of lambda", 1000,0.,1000.,100,0.7,0.9);
413 fhXYPDMCPtKp =
new TH2D(
"fhXYPDMCptKp",
"XY distribution of Photon MCPt", 1000, -110, 110, 1000, -110, 110);
414 fhXYPDMCPtKn =
new TH2D(
"fhXYPDMCptKn",
"XY distribution of Photon MCPt", 1000, -110, 110, 1000, -110, 110);
415 fhXYPDMCPtpip =
new TH2D(
"fhXYPDMCptpip",
"XY distribution of Photon MCPt", 1000, -110, 110, 1000, -110, 110);
416 fhXYPDMCPtpin =
new TH2D(
"fhXYPDMCptpin",
"XY distribution of Photon MCPt", 1000, -110, 110, 1000, -110, 110);
417 fhXYPDMCPtmp =
new TH2D(
"fhXYPDMCptmp",
"XY distribution of Photon MCPt", 1000, -110, 110, 1000, -110, 110);
418 fhXYPDMCPtmn =
new TH2D(
"fhXYPDMCptmn",
"XY distribution of Photon MCPt", 1000, -110, 110, 1000, -110, 110);
420 fhXYPDHitKp =
new TH2D(
"fhXYPDHitKp",
"XY distribution of Photon Hit", 1000, -110, 110, 1000, -110, 110);
421 fhXYPDHitKn =
new TH2D(
"fhXYPDHitKn",
"XY distribution of Photon Hit", 1000, -110, 110, 1000, -110, 110);
422 fhXYPDHitpip =
new TH2D(
"fhXYPDHitpip",
"XY distribution of Photon Hit", 1000, -110, 110, 1000, -110, 110);
423 fhXYPDHitpin =
new TH2D(
"fhXYPDHitpin",
"XY distribution of Photon Hit", 1000, -110, 110, 1000, -110, 110);
424 fhXYPDHitmp =
new TH2D(
"fhXYPDHitmp",
"XY distribution of Photon Hit", 1000, -110, 110, 1000, -110, 110);
425 fhXYPDHitmn =
new TH2D(
"fhXYPDHitmn",
"XY distribution of Photon Hit", 1000, -110, 110, 1000, -110, 110);
454 while ( TH1* histo = ((TH1*)
next()) ) histo->Write();
459 cout <<
"-I- DrawHits: Finish" << endl;
468 TCanvas *C1=
new TCanvas(
"C1",
"Cherenkov Angle vs. Mass ",500,500);
482 TCanvas *C1A=
new TCanvas(
"C1A",
" Mom vs. Cherenkov angle",500,500);
509 TCanvas *C1B=
new TCanvas(
"C1B",
" Momentum vs. track angle",500,500);
515 fhMomAng->GetXaxis()->SetTitle(
"#theta (deg)");
516 fhMomAng->GetYaxis()->SetTitleOffset(1.0);
517 fhMomAng->GetYaxis()->SetTitle(
"p (GeV/c)");
522 TCanvas *C2=
new TCanvas(
"C2",
"Photon Distribution" ,700,700);
528 fhXYPDHit->GetXaxis()->SetTitle(
"x_{Hit} (cm)");
529 fhXYPDHit->GetXaxis()->SetTitleOffset(1.0);
530 fhXYPDHit->GetYaxis()->SetTitle(
"y_{Hit} (cm)");
537 fhXYPDMCPt->GetXaxis()->SetTitle(
"x_{MC} (cm)");
539 fhXYPDMCPt->GetYaxis()->SetTitle(
"y_{MC} (cm)");
546 fhLambdaMC->GetXaxis()->SetTitle(
"#lambda_{MC} (nm)");
556 fhLambda->GetXaxis()->SetTitle(
"#lambda_{Hit} (nm)");
557 fhLambda->GetXaxis()->SetTitleOffset(1.0);
558 fhLambda->GetYaxis()->SetTitle(
"Counts");
569 TCanvas *C3=
new TCanvas(
"C3",
"Time ",900,500);
576 fhPDTime->GetXaxis()->SetTitle(
"Time (ns)");
577 fhPDTime->GetXaxis()->SetTitleOffset(1.0);
578 fhPDTime->GetYaxis()->SetTitle(
"Counts");
582 TCanvas *C4=
new TCanvas(
"C4",
" ",500,500);
614 Double_t xout[17], yout[17], xin[17], yin[17];
615 for(Int_t
i=0;
i<16;
i++){
616 xout[
i]=rp_out*
cos(2.0*
i*theta);
617 yout[
i]=rp_out*
sin(2.0*
i*theta);
618 xin[
i]=rp_in*
cos(2.0*
i*theta);
619 yin[
i]=rp_in*
sin(2.0*
i*theta);
620 TLine *l1 =
new TLine(xout[
i],yout[i],xin[i],yin[i]);
627 TPolyLine *
p1 =
new TPolyLine(17,xout,yout);
628 p1->SetFillColor(kYellow);
630 TPolyLine *
p2 =
new TPolyLine(17,xin,yin);
634 TCanvas *C5=
new TCanvas(
"C5",
" ",500,500);
665 for(Int_t
i=0;
i<16;
i++){
666 TLine *l2 =
new TLine(xout[
i],yout[i],xin[i],yin[i]);
674 new TCanvas(
"C7",
"Full sim study",500,500);
680 for(Int_t
i=0;
i<16;
i++){
681 TLine *l2 =
new TLine(xout[
i],yout[i],xin[i],yin[i]);
686 TLegend*
leg =
new TLegend(0.5,0.5,0.75,0.6);
687 leg->AddEntry(
fhPDPlane,
"other photons",
"p");
688 leg->SetTextSize(0.03);
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
friend F32vec4 cos(const F32vec4 &a)
TClonesArray * fBarPointArray
virtual InitStatus Init()
Double_t lambda(Double_t x, Double_t y, Double_t z)
friend F32vec4 sqrt(const F32vec4 &a)
friend F32vec4 sin(const F32vec4 &a)
TVector3 GetMomentum() const
Double_t GetThetaC() const
TClonesArray * fPDHitArray
virtual Double_t GetTime()
TString pt(TString pts, TString exts="px py pz")
virtual Int_t GetRefIndex()
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
PndGeoDrc * fGeo
Basic geometry data of barrel DRC.
virtual void Exec(Option_t *option)
virtual Int_t GetRefIndex()
TClonesArray * fPDPointArray
TVector3 GetStartVertex() const
Int_t GetMotherID() const