8 #include "TClonesArray.h"
10 #include "FairRootManager.h"
11 #include "FairRunAna.h"
12 #include "FairRuntimeDb.h"
18 #include "../../hypGe/PndHypGePoint.h"
27 #include "FairRuntimeDb.h"
33 #include "LSLTrackRep.h"
58 FairTask(
"Panda HypFullAna Task") {
78 FairRootManager* ioman = FairRootManager::Instance();
80 cout <<
"-E- PndEmcHitProducer::Init: "
81 <<
"RootManager not instantiated!" << endl;
87 fMcTr = (TClonesArray*) ioman->GetObject(
"MCTrack");
88 fMcCands = (TClonesArray*) ioman->GetObject(
"HypHit");
89 fMc = (TClonesArray*) ioman->GetObject(
"HypPoint");
90 fGe = (TClonesArray*) ioman->GetObject(
"HypGePoint");
92 fChargedArray = (TClonesArray*) ioman->GetObject(
"PndChargedCandidates");
93 fMicroArray = (TClonesArray*) ioman->GetObject(
"PndPidCandidates");
96 cout <<
"-W- PndHypFullAna ::Init: "
97 <<
"No PndChargedCandidates && PndNeutralCandidates array!" << endl;
102 cout <<
"-I- PndHypFullAna : Intialization successfull" << endl;
104 ppi2mass =
new TH1F(
"ppimass",
"p pi cands",200,0.05,0.3);
105 ppi2 =
new TH1F(
"ppion",
"p pion cands",200,0.05,1.7);
106 e =
new TH1F(
"evenet",
"p event",200,10000,50000);
108 pid =
new TH2F(
"pid",
"cands",200,0,16,200,0,16);
109 pidh =
new TH2F(
"pidh",
"candsh",200,0,16,200,0,16);
110 ximass =
new TH1F(
"ximass",
"xi cands",200,0.05,2);
111 Lamb =
new TH1F(
"lamb mass",
"lamb cands",200,0.05,2);
114 spectra[0] =
new TH1F(
"spectra01",
"cluster 1",200,0.0,0.01);
115 spectra[1] =
new TH1F(
"spectra02",
"cluster 2",200,0.0,0.01);
116 spectra[2] =
new TH1F(
"spectra03",
"cluster 3",200,0.0,0.01);
117 spectra[3] =
new TH1F(
"spectra04",
"cluster 4",200,0.0,0.01);
118 spectra[4] =
new TH1F(
"spectra05",
"cluster 5",200,0.0,0.01);
119 spectra[5] =
new TH1F(
"spectra06",
"cluster 6",200,0.0,0.01);
120 spectra[6] =
new TH1F(
"spectra07",
"cluster 7",200,0.0,0.01);
121 spectra[7] =
new TH1F(
"spectra08",
"cluster 8",200,0.0,0.01);
122 spectra[8] =
new TH1F(
"spectra09",
"cluster 9",200,0.0,0.01);
123 spectra[9] =
new TH1F(
"spectra10",
"cluster 9",200,0.0,0.01);
127 hvtx2[0]=
new TH2F(
"hvtx201",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
128 hvtx2[1]=
new TH2F(
"hvtx202",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
129 hvtx2[2]=
new TH2F(
"hvtx203",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
130 hvtx2[3]=
new TH2F(
"hvtx204",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
131 hvtx2[4]=
new TH2F(
"hvtx205",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
132 hvtx2[5]=
new TH2F(
"hvtx206",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
133 hvtx2[6]=
new TH2F(
"hvtx207",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
134 hvtx2[7]=
new TH2F(
"hvtx208",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
135 hvtx2[8]=
new TH2F(
"hvtx209",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
136 hvtx2[9]=
new TH2F(
"hvtx210",
"vertex positions (x,z)",100,0.03,0.15,100,0.03,0.15);
166 FairRunAna*
run = FairRunAna::Instance();
167 if ( ! run ) Fatal(
"SetParContainers",
"No analysis run");
188 RhoCandList neutralCands,chargedCands, plusCands,minusCands;
192 RhoCandList xiCands,nonOvCands,dsCands,ds0Cands,ppCands;
193 std::map<Int_t,Float_t > mapp;
203 for (Int_t i1=0; i1<
fMicroArray->GetEntriesFast(); i1++){
206 TLorentzVector l=tc.
P4();
210 chargedCands.
Add(&tc);
231 ppiCands.
Combine(minusCands,plusCands);
235 for (
int la=0;la<ppiCands.
GetLength();la++)
237 Lamb->Fill((ppiCands.
Get(la)->
P4()).M());
241 xiCands.
Combine(ppiCands,minusCands);
245 while (t4=itX.
Next())
274 while (t2=iterP.
Next())
278 TLorentzVector l=t2->
P4();
280 TVector3 pim = l.Vect();
300 for (
int k=0;k<
npi;k++)
320 while (t3=itP.
Next())
324 TLorentzVector v4=t3->
P4();
326 TVector3 v3 = v4.Vect();
329 ppi2->Fill(v3.Mag());
384 TLorentzVector vpim=pi->
P4();
385 TVector3 pi3v = vpim.Vect();
388 if(pi3v.Mag()<0.2)
hvtx2[0]->Fill(pi3v.Mag(),0.);
395 for (ii=0;ii<dsi-1;ii++)
401 TLorentzVector vpim=pi->
P4();
402 TVector3 pi3v = vpim.Vect();
404 for (jj=ii+1;jj<dsi;jj++)
409 TLorentzVector vpp=pp->
P4();
410 TVector3 pp3v = vpp.Vect();
421 if (MotherId==-1)Motherpdg = mc->
GetPdgCode();
438 cout<<
" Motherpdg "<<Motherpdg<<
" "<<mc->
GetPdgCode()<<endl;
452 if(pi3v.Mag()>pp3v.Mag())
455 hvtx2[0]->Fill(pi3v.Mag(),pp3v.Mag());
457 if((pi3v.Mag()>0.12&&pi3v.Mag()<0.14)&&(pp3v.Mag()>0.065&&pp3v.Mag()<0.08)) {
462 hvtx2[1]->Fill(pi3v.Mag(),pp3v.Mag());
474 if(Motherpdg==1020040110||Motherpdg==1010050110){
478 if(Motherpdg==1020030090||(Motherpdg==1010040090 && MotherId!=-1)){
489 if((pi3v.Mag()>0.112&&pi3v.Mag()<0.126)&&(pp3v.Mag()>0.09&&pp3v.Mag()<0.103)){
490 hvtx2[2]->Fill(pi3v.Mag(),pp3v.Mag());
498 if((pi3v.Mag()>0.128&&pi3v.Mag()<0.147)&&(pp3v.Mag()>0.0898&&pp3v.Mag()<0.109)){
499 hvtx2[9]->Fill(pi3v.Mag(),pp3v.Mag());
513 if(Motherpdg==1020040100||Motherpdg==1010050100){
520 if((pi3v.Mag()>0.097&&pi3v.Mag()<0.106)&&(pp3v.Mag()>0.094&&pp3v.Mag()<0.103)) {
524 hvtx2[3]->Fill(pi3v.Mag(),pp3v.Mag());
538 if(Motherpdg==1020040120||Motherpdg==1010050120){
546 if((pi3v.Mag()>0.128&&pi3v.Mag()<0.147)&&(pp3v.Mag()>0.110&&pp3v.Mag()<0.124)) {
551 hvtx2[4]->Fill(pi3v.Mag(),pp3v.Mag());
562 if(Motherpdg==1020020060||Motherpdg==1010030060){
570 if((pi3v.Mag()>0.128&&pi3v.Mag()<0.147)&&(pp3v.Mag()>0.124&&pp3v.Mag()<0.143)) {
575 hvtx2[5]->Fill(pi3v.Mag(),pp3v.Mag());
594 if(pi3v.Mag()<pp3v.Mag()) {
597 hvtx2[0]->Fill(pp3v.Mag(),pi3v.Mag());
600 if(Motherpdg==1020040110||Motherpdg==1010050110){
606 if((pp3v.Mag()>0.12&&pp3v.Mag()<0.14)&&(pi3v.Mag()>0.065&&pi3v.Mag()<0.08)) {
609 hvtx2[1]->Fill(pp3v.Mag(),pi3v.Mag());
620 if(Motherpdg==1020030090||(Motherpdg==1010040090&& MotherId!=-1)){
625 if((pp3v.Mag()>0.112&&pp3v.Mag()<0.126)&&(pi3v.Mag()>0.09&&pi3v.Mag()<0.103))
629 hvtx2[2]->Fill(pp3v.Mag(),pi3v.Mag());
640 if((pp3v.Mag()>0.128&&pp3v.Mag()<0.147)&&(pi3v.Mag()>0.0898&&pi3v.Mag()<0.109))
642 hvtx2[9]->Fill(pp3v.Mag(),pi3v.Mag());
653 if(Motherpdg==1020040100||Motherpdg==1010050100){
659 if((pp3v.Mag()>0.097&&pp3v.Mag()<0.106)&&(pi3v.Mag()>0.094&&pi3v.Mag()<0.103)) {
662 hvtx2[3]->Fill(pp3v.Mag(),pi3v.Mag());
672 if(Motherpdg==1020040120||Motherpdg==1010050120){
678 if((pp3v.Mag()>0.128&&pp3v.Mag()<0.147)&&(pi3v.Mag()>0.110&&pi3v.Mag()<0.124)) {
681 hvtx2[4]->Fill(pp3v.Mag(),pi3v.Mag());
693 if(Motherpdg==1020020060||Motherpdg==1010030060){
701 if((pp3v.Mag()>0.128&&pp3v.Mag()<0.147)&&(pi3v.Mag()>0.124&&pi3v.Mag()<0.143)) {
706 hvtx2[5]->Fill(pp3v.Mag(),pi3v.Mag());
746 if(
fGe->GetEntriesFast()!=0)
753 cout<<
" event "<<
event<<
" is correlated "<<evCheck->
GetEventID()<<endl;
755 for(
int entries=0;entries<
fGe->GetEntriesFast();entries++)
767 if(E>0.&&E<0.010)
spectra[cluster]->Fill(E);
774 if(
fGe->GetEntriesFast()!=0)
777 for(
int entries=0;entries<
fGe->GetEntriesFast();entries++)
789 if(E>0.&&E<0.010)
spectra[clus]->Fill(E);
795 if(ion>1000000000&&(ion<1010000000))
807 if((ion>1010000000||ion>1020000000))
824 TFile*
file = FairRootManager::Instance()->GetOutFile();
856 for(
int i=0;
i<10;
i++){
void Add(const RhoCandidate *c)
RhoMinusParticleSelector * minusSel
RhoPlusParticleSelector * plusSel
TClonesArray * fChargedArray
RhoSimpleProtonSelector * pSel
PndPidCandidate * GetRecoCandidate() const
virtual void SetParContainers()
RhoMassParticleSelector * LambMSel
Int_t GetIonCharge(Int_t Z, Int_t &mass, Int_t &str)
void SetEnergySpectra(int event, int cluster)
void Combine(RhoCandList &l1, RhoCandList &l2)
TClonesArray * fMicroArray
void Select(RhoParticleSelectorBase *pidmgr)
TLorentzVector P4() const
static RhoFactory * Instance()
virtual void Exec(Option_t *opt)
virtual void SetCriterion(const char *crit)
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)
void SetTotESpectra(int clus)
TVector3 GetStartVertex() const
Int_t GetMotherID() const
RhoSimplePionSelector * piSel
Double_t GetEnergyLoss() const
RhoCandidate * Get(Int_t)
virtual InitStatus Init()