15 #include <TSpectrum.h>
25 : FairTask(
"Panda HypGeGammaAna Task")
30 : FairTask(
"Panda HypGeGammaAna Task")
46 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"Starting Init of HypGe Gamma Ana" << endl;
49 FairRootManager* ioman = FairRootManager::Instance();
51 cout <<
"-E- PndEmcHitProducer::Init: "
52 <<
"RootManager not instantiated!" << endl;
57 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"Getting FairRootManager finished" << endl;
60 fMcTr = (TClonesArray*) ioman->GetObject(
"MCTrack");
62 fHypGe = (TClonesArray*) ioman->GetObject(
"HypGePoint");
66 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"Getting input arrays finished" << endl;
69 fName = ioman->GetInFile()->GetName();
72 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"Full input file name with path: " <<
fName << endl;
73 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"Chopping first " <<
fName.Last(
'/')+1 <<
" chars"<< endl;
77 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"File name: " <<
fName<< endl;
80 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"File name extraction finished" << endl;
84 fgeom = (TGeoManager*)gROOT->FindObject(
"FAIRGeom");
86 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"Found GeoManager" << endl;
90 hNHits =
new TH1D(
"hNHits",
"Polar angle of primary neutrons interacting with the crystals",180, 90,180);
91 hNHits->SetXTitle(
"#Theta [#circ]");
92 hNHits->SetYTitle(
"Counts / 0.5 #circ");
95 hCrystalHit =
new TH1D(
"hCrystalHit",
"Hits per Crystal",2,0,2);
98 hCrystalHit->GetXaxis()->SetBinLabel(1,
"Crystal 30 cm");
99 hCrystalHit->GetXaxis()->SetBinLabel(2,
"Crystal 90 cm");
102 hNeutronOrigin =
new TH1D(
"hNeutronOrigin",
"Origin of Neutrons",5,0,5);
112 hCrystalOrigin =
new TH2D(
"hCrystalOrigin",
"Crystal -Neutron Origin - Correlation",2,0,2,5,0,5);
124 hNeutronEkin =
new TH1D(
"hNeutronEkin",
"E_{kin} of neutrons;E_{kin} of neutrons [MeV]; Counts", 200,0,20);
127 hNeutronEkinOrigin =
new TH2D(
"hNeutronEkinOrigin",
"E_{kin} -Neutron Origin - Correlation;E_{kin} of neutrons [MeV]; Neutron Origin",200,0,20,5,0,5);
136 hNeutronEnergyLoss =
new TH1D(
"hNeutronEnergyLoss",
"Energy loss of neutrons inside a crystal;Energy loss of neutrons [MeV]; Counts", 2000,0,2);
141 hAllParticlesGe =
new TH1D(
"hAllParticlesGe",
"Particles interaction in the crystals;PDG Code of particle; Counts", 2e4,-1e4,1e4);
143 hAllParticlesCrystal1 =
new TH1D(
"hAllParticlesCrystal1",
"Particles interaction in the first crystal (30 cm);PDG Code of particle; Counts", 5000,-2500,2500);
145 hAllParticlesCrystal2 =
new TH1D(
"hAllParticlesCrystal2",
"Particles interaction in the second crystal (90 cm);PDG Code of particle; Counts", 5000,-2500,2500);
147 hAllParticlesPiezo =
new TH1D(
"hAllParticlesPiezo",
"Particles interaction in the piezo;PDG Code of particle; Counts", 2e4,-1e4,1e4);
149 hAllParticlesSiPm1 =
new TH1D(
"hAllParticlesSiPm1",
"Particles interaction in the first SiPm (60 cm);PDG Code of particle; Counts", 5000,-2500,2500);
151 hAllParticlesSiPm2 =
new TH1D(
"hAllParticlesSiPm2",
"Particles interaction in the second SiPm (30 cm);PDG Code of particle; Counts", 5000,-2500,2500);
154 hEkinAllParticles =
new TH2D(
"hEkinAllParticles",
"E_{kin} - Particle - Correlation;E_{kin} of particles [MeV]; particle",200,0,200,9,1,10);
166 hEkinAllParticlesCrystal1 =
new TH2D(
"hEkinAllParticlesCrystal1",
"E_{kin} - Particle - Correlation (crystal1);E_{kin} of particles [MeV]; particle",200,0,200,9,1,10);
178 hEkinAllParticlesCrystal2 =
new TH2D(
"hEkinAllParticlesCrystal2",
"E_{kin} - Particle - Correlation (Crystal2);E_{kin} of particles [MeV]; particle",200,0,200,9,1,10);
190 hEkinAllParticlesPiezo =
new TH2D(
"hEkinAllParticlesPiezo",
"E_{kin} - Particle - Correlation (Piezo);E_{kin} of particles [MeV]; particle",200,0,200,9,1,10);
202 hEkinAllParticlesSiPm1 =
new TH2D(
"hEkinAllParticlesSiPm1",
"E_{kin} - Particle - Correlation (SiPm1);E_{kin} of particles [MeV]; particle",200,0,200,9,1,10);
214 hEkinAllParticlesSiPm2 =
new TH2D(
"hEkinAllParticlesSiPm2",
"E_{kin} - Particle - Correlation (SiPm2);E_{kin} of particles [MeV]; particle",200,0,200,9,1,10);
226 hGammaEkinOrigin =
new TH2D(
"hGammaEkinOrigin",
"E_{kin} -#gamma Origin - Correlation;E_{kin} of neutrons [MeV]; Gamma Origin",200,0,20,5,0,5);
236 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"Histogram creation finished" << endl;
245 cout <<
"HypGe COSYBackgroundSim Ana:\tNumber of Events to analyze: "<<
NumberOfEvents << endl;
248 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
"Init of HypGe COSYBackgroundSim Ana finished succesfully" << endl;
253 Double_t NeutronEnergyLossArray[10];
254 for(Int_t
i = 0;
i < 10;
i++)
255 NeutronEnergyLossArray[
i]=0;
256 Int_t nNeutrons = -1;
257 Int_t NeutronTrackID =-1;
258 for (Int_t
i=0;
i <
fHypGe->GetEntriesFast();
i++)
377 NeutronEnergyLossArray[nNeutrons] += hitgam->
GetEnergyLoss()*1000;
438 case -211: ParticleMass = 0.13957; ParticleName =
"#pi^{-}";
break;
439 case -13: ParticleMass = 0.10561; ParticleName =
"#mu^{+}";
break;
440 case -11: ParticleMass = 0.000511; ParticleName =
"e^{+}";
break;
441 case 11: ParticleMass = 0.000511; ParticleName =
"e^{-}";
break;
442 case 13: ParticleMass = 0.10561; ParticleName =
"#mu^{-}";
break;
443 case 22: ParticleMass = 0; ParticleName =
"#gamma";
break;
444 case 211: ParticleMass = 0.13957; ParticleName =
"#pi^{+}";
break;
445 case 2112: ParticleMass = 0.939565; ParticleName =
"neutron";
break;
446 case 2212: ParticleMass = 0.93827; ParticleName =
"proton";
break;
447 default: ParticleMass = -1; std::cout.precision(10); cout <<
"Found new particle:\t" << hitgam->
GetpdgCode() <<
"\t" <<
VertexVolumeName << endl;
break;
449 if(ParticleMass != -1)
512 cout << nNeutrons+1 << endl;
513 for (Int_t
i = 0;
i <= nNeutrons;
i++)
515 cout <<
i <<
"\t\t" << NeutronEnergyLossArray[
i] << endl;
522 cout <<
"HypGe COSYBackgroundSim Ana:\t" <<
EvtCount*100/NumberOfEvents <<
" % done"<< endl;
529 cNHits =
new TCanvas(
"cNHits",
"Neutron Hits",800,600);
530 cCrystalHit =
new TCanvas(
"cCrystalHit",
"Crystal hit", 800,600);
531 cNeutronOrigin =
new TCanvas(
"cNeutronOrigin",
"Origin of Neutrons", 800,600);
532 cCrystalOrigin =
new TCanvas(
"cCrystalOrigin",
"Correlation of Crystal hit and neutron origin", 800, 600);
533 cNeutronEkin =
new TCanvas(
"cNeutronEkin",
"E_{kin} of neutrons", 800, 600);
534 cNeutronEkinOrigin =
new TCanvas(
"cNeutronEkinOrigin",
"E_{kin} - Neutron Origin - Correlation", 800, 600);
535 cNeutronEnergyLoss =
new TCanvas(
"cNeutronEnergyLossn",
"Energy loss of neutrons inside a crystal", 800, 600);
537 cAllParticlesGe =
new TCanvas(
"cAllParticles",
"All particles interacting in the crystal", 800, 600);
538 cAllParticlesCrystal1 =
new TCanvas(
"cAllParticlesCrystal1",
"All particles interacting in the first crystal", 800, 600);
539 cAllParticlesCrystal2 =
new TCanvas(
"cAllParticlesCrystal2",
"All particles interacting in the second crystal", 800, 600);
540 cEkinAllParticles =
new TCanvas(
"cEkinAllParticles",
"Correlation of E_{kin} of Particles and PDG code", 800, 600);
541 cGammaEkinOrigin=
new TCanvas(
"cGammaEkinOrigin",
"E_{kin} - #gamma Origin - Correlation", 800, 600);
543 cAllParticlesPiezo =
new TCanvas(
"cAllParticlesPiazo",
"All particles interacting in the piezo", 800, 600);
544 cAllParticlesSiPm1 =
new TCanvas(
"cAllParticlesSiPm1",
"All particles interacting in the SiPm1", 800, 600);
545 cAllParticlesSiPm2 =
new TCanvas(
"cAllParticlesSiPm2",
"All particles interacting in the SiPm2", 800, 600);
546 cEkinAllParticlesSplit=
new TCanvas(
"cEkinAllParticlesSplit",
"Correlation of E_{kin} of Particles and PDG code", 800, 600);
580 gStyle->SetPalette(1);
634 cout <<
"HypGe COSYBackgroundSim Ana:\tAnalysis finished succesfully" << endl;
TCanvas * cEkinAllParticlesSplit
TH2D * hEkinAllParticlesCrystal1
virtual void Exec(Option_t *opt)
TCanvas * cAllParticlesSiPm1
TVector3 ParticleMomentum
TH1D * hAllParticlesPiezo
TH2D * hEkinAllParticlesPiezo
TH2D * hEkinAllParticlesSiPm1
TH1D * hAllParticlesSiPm1
friend F32vec4 sqrt(const F32vec4 &a)
TH2D * hEkinAllParticlesCrystal2
TH2D * hNeutronEkinOrigin
TCanvas * cAllParticlesCrystal2
PndHypGeCOSYBackgroundAna()
TCanvas * cEkinAllParticles
TH1D * hAllParticlesCrystal2
TCanvas * cNeutronEkinOrigin
TCanvas * cAllParticlesSiPm2
TCanvas * cGammaEkinOrigin
TH2D * hEkinAllParticlesSiPm2
TH1D * hAllParticlesCrystal1
HISThit_ene Fill(sum_hit_ene)
TCanvas * cNeutronEnergyLoss
~PndHypGeCOSYBackgroundAna()
TCanvas * cAllParticlesPiezo
TVector3 GetStartVertex() const
TH1D * hAllParticlesSiPm2
Int_t GetDetectorID() const
TCanvas * cAllParticlesCrystal1
TH1D * hNeutronEnergyLoss
Double_t GetEnergyLoss() const
TCanvas * cAllParticlesGe
virtual InitStatus Init()
Double_t GetpdgCode() const