66 if ( gMC->IsTrackEntering() ) {
67 fTrackID = gMC->GetStack()->GetCurrentTrackNumber();
68 TParticle* p = gMC->GetStack()->GetCurrentTrack();
69 Int_t pdgCode = p->GetPdgCode();
70 gMC->TrackMomentum(
fMom);
72 fTime = gMC->TrackTime() * 1.0e09;
74 gMC->TrackPosition(
fPos);
78 0,pdgCode,TVector3(p->Vx(), p->Vy(), p->Vz()),TVector3(p->Px(), p->Py(), p->Pz()) );
80 stack->AddPoint(
kVETO);
90 FairDetector::Initialize();
91 TSeqCollection* fileList=gROOT->GetListOfFiles();
92 fout = ((TFile*)fileList->At(0));
96 TDatabasePDG* PDG = TDatabasePDG::Instance();
97 for(Int_t idnu=11; idnu<26; idnu+=1){
99 for (Int_t idadd=-1; idadd<3; idadd+=2){
101 if (idnu==18){idw=22;}
102 if (idnu==19){idw=111;}
103 if (idnu==20){idw=221;}
104 if (idnu==21){idw=223;}
105 if (idnu==22){idw=331;}
106 if (idnu==23){idw=211;}
107 if (idnu==24){idw=321;}
108 if (idnu==25){idw=2212;}
109 Int_t idhnu=10000+idw;
111 if (idnu>17){
continue;}
115 TString name=PDG->GetParticle(idw)->GetName();
116 TString title = name;title+=
" momentum (GeV)";
117 TString key =
"";key+=idhnu;
118 TH1D* Hidhnu =
new TH1D(key,title,400,0.,400.);
119 title = name;title+=
" log10-p vs log10-pt";
120 key =
"";key+=idhnu+1000;
121 TH2D* Hidhnu100 =
new TH2D(key,title,100,-0.3,1.7,100,-2.,0.5);
122 title = name;title+=
" log10-p vs log10-pt";
123 key =
"";key+=idhnu+2000;
124 TH2D* Hidhnu200 =
new TH2D(key,title,25,-0.3,1.7,100,-2.,0.5);
128 fNtuple =
new TNtuple(
"4DP",
"4DP",
"id:px:py:pz:x:y:z");
140 gMC->TrackMomentum(
fMom);
145 TParticle* p = gMC->GetStack()->GetCurrentTrack();
146 Int_t pdgCode = p->GetPdgCode();
149 Int_t idabs = TMath::Abs(pdgCode);
150 if (idabs<18 || idabs==22 || idabs==111 || idabs==221 || idabs==223 || idabs==331
151 || idabs==211 || idabs==321 || idabs==2212 ){
152 Double_t wspill = p->GetWeight();
153 Int_t idhnu=idabs+10000;
154 if (pdgCode<0){ idhnu+=10000;}
155 Double_t l10ptot = TMath::Min(TMath::Max(TMath::Log10(
fMom.P()),-0.3),1.69999);
156 Double_t l10pt = TMath::Min(TMath::Max(TMath::Log10(
fMom.Pt()),-2.),0.4999);
157 TString key; key+=idhnu;
158 TH1D* h1 = (TH1D*)
fout->Get(key);
159 if (h1){h1->Fill(
fMom.P(),wspill);}
160 key=
"";key+=idhnu+1000;
161 TH2D* h2 = (TH2D*)
fout->Get(key);
162 if (h2){h2->Fill(l10ptot,l10pt,wspill);}
163 key=
"";key+=idhnu+2000;
164 h2 = (TH2D*)
fout->Get(key);
165 if (h2){h2->Fill(l10ptot,l10pt,wspill);}
169 if (
fSkipNeutrinos && (idabs==12 or idabs==14 or idabs == 16 )){gMC->StopTrack();}
174 for(Int_t idnu=11; idnu<23; idnu+=1){
176 for (Int_t idadd=-1; idadd<3; idadd+=2){
178 if (idnu==18){idw=22;}
179 if (idnu==19){idw=111;}
180 if (idnu==20){idw=221;}
181 if (idnu==21){idw=223;}
182 if (idnu==22){idw=331;}
183 Int_t idhnu=10000+idw;
185 if (idnu>17){
continue;}
189 TString key =
"";key+=idhnu;
190 TSeqCollection* fileList=gROOT->GetListOfFiles();
191 ((TFile*)fileList->At(0))->cd();
192 TH1D* Hidhnu = (TH1D*)
fout->Get(key);
194 key=
"";key+=idhnu+1000;
195 TH2D* Hidhnu100 = (TH2D*)
fout->Get(key);
197 key =
"";key+=idhnu+2000;
198 TH2D* Hidhnu200 = (TH2D*)
fout->Get(key);
207 static FairGeoLoader *geoLoad=FairGeoLoader::Instance();
208 static FairGeoInterface *geoFace=geoLoad->getGeoInterface();
209 static FairGeoMedia *media=geoFace->getMedia();
210 static FairGeoBuilder *geoBuild=geoLoad->getGeoBuilder();
212 FairGeoMedium *ShipMedium=media->getMedium(
"vacuums");
213 TGeoMedium* vac=gGeoManager->GetMedium(
"vacuums");
215 geoBuild->createMedium(ShipMedium);
216 vac =gGeoManager->GetMedium(
"vacuums");
217 TGeoVolume *top=gGeoManager->GetTopVolume();
218 TGeoNavigator* nav = gGeoManager->GetCurrentNavigator();
222 Float_t distance = 1.;
223 Double_t local[3]= {0,0,0};
224 if (not nav->cd(
"/MuonShieldArea_1/CoatWall_1")) {
225 nav->cd(
"/MuonShieldArea_1/MagnAbsorb2_MagRetL_1");
227 TGeoBBox* tmp = (TGeoBBox*)(nav->GetCurrentNode()->GetVolume()->GetShape());
228 local[2] = distance * tmp->GetDZ();
229 Double_t global[3] = {0,0,0};
230 nav->LocalToMaster(local,global);
231 zLoc = global[2] + distance * 1.*
cm;
233 TGeoVolume *sensPlane = gGeoManager->MakeBox(
"sensPlane",vac,10.*
m-1.*
mm,10.*
m-1.*
mm,1.*
mm);
234 nav->cd(
"/MuonShieldArea_1/");
235 nav->GetCurrentNode()->GetVolume()->AddNode(sensPlane, 1,
new TGeoTranslation(0, 0, zLoc));
236 AddSensitiveVolume(sensPlane);
240 TVector3 pos, TVector3 mom,
241 Double_t time, Double_t length,
242 Double_t eLoss, Int_t pdgCode,TVector3 Lpos, TVector3 Lmom)
245 Int_t size = clref.GetEntriesFast();
246 return new(clref[size])
vetoPoint(trackID, detID, pos, mom,
247 time, length, eLoss, pdgCode,Lpos,Lmom);
vetoPoint * AddHit(Int_t trackID, Int_t detID, TVector3 pos, TVector3 mom, Double_t time, Double_t length, Double_t eLoss, Int_t pdgcode, TVector3 Lpos, TVector3 Lmom)