8 gROOT->LoadMacro(
"$VMCWORKDIR/gconfig/basiclibs.C");
10 gSystem->Load(
"libGeoBase");
11 gSystem->Load(
"libParBase");
12 gSystem->Load(
"libBase");
13 gSystem->Load(
"libPndData");
14 gSystem->Load(
"libField");
15 gSystem->Load(
"libGen");
16 gSystem->Load(
"libPassive");
17 gSystem->Load(
"libMvd");
19 gStyle->SetPalette(1);
34 TFile*
f =
new TFile(inFile.c_str());
35 TTree *
t=(TTree *) f->Get(
"pndsim") ;
37 TClonesArray*
hit_array=
new TClonesArray(
"PndSdsMCPoint");
38 t->SetBranchAddress(
"MVDPoint",&hit_array);
41 t->SetBranchAddress(
"RadLen", &radlen_array);
43 TClonesArray*
mc_array=
new TClonesArray(
"PndMCTrack");
44 t->SetBranchAddress(
"MCTrack",&mc_array);
46 TH1D*
hisRadLen =
new TH1D(
"hisRadLen",
"Radiation Length", 1000,0,100);
50 TH1D*
hisTrackP =
new TH1D(
"hisTrackP",
"Hits per Track", 51,-0.5,50.5);
65 cout<<
">>>> Event No "<<j<<endl;
66 std::vector<double> RadLengthOnTrack (10000,0.0);
68 for (Int_t
i=0;
i<radlen_array->GetEntriesFast();
i++)
70 if(verbose) cout<<
"Point No "<<
i<<endl;
71 FairRadLenPoint *
point=(FairRadLenPoint*)radlen_array->At(
i);
72 if (verbose) cout <<
"Track ID: " << point->GetTrackID() << std::endl;
74 pos = point->GetPosition();
75 posOut = point->GetPositionOut();
80 std::cout <<
"Time: " << point->GetTime() <<
" Length: " << point->GetLength() << std::endl;
81 std::cout <<
"Pos: " << pos.x() <<
"/" << pos.y() <<
"/" << pos.z();
82 std::cout <<
" OutPos: " << posOut.x() <<
"/" << posOut.y() <<
"/" << posOut.z() << std::endl;
83 std::cout <<
"TrackLength: " << res.Mag() <<
" RadLength: " << point->GetRadLength() <<
" Res: " << res.Mag() / point->GetRadLength() << std::endl;
85 if (point->GetTrackID() > 0 && point->GetTrackID() < 10000 &&
fabs(posOut.x()) < 15 &&
fabs(posOut.y()) < 15 &&
fabs(posOut.z()) < 20)
86 RadLengthOnTrack[point->GetTrackID()] += res.Mag()/point->GetRadLength()*100;
89 for (
int k = 0; k < RadLengthOnTrack.size(); k++){
90 if (RadLengthOnTrack[k] > 0){
91 if (verbose) std::cout <<
"Full TrackLength: " << RadLengthOnTrack[k] << std::endl;
93 hisRadLen->Fill(RadLengthOnTrack[k]);
100 for (
int k = 0; k < hit_array->GetEntriesFast(); k++){
102 trackHitMap[myHit->GetTrackID()]++;
105 for (map<int,int>::const_iterator ci = trackHitMap.begin(); ci != trackHitMap.end(); ci++){
107 hisTrackP->Fill(ci->second);
113 hisRadLen2D->Divide(hisRadLenCount);
114 hisTrackP2D->Divide(hisTrackPCount);
118 gStyle->SetPalette(1);
120 hisRadLen->DrawCopy();
122 hisRadLen2D->DrawCopy(
"colz");
124 hisTrackP->DrawCopy();
126 hisTrackP2D->DrawCopy(
"colz");
132 cout << endl << endl;
133 cout <<
"Macro finished succesfully." << endl;
136 cout <<
"Real time " << rtime <<
" s, CPU time " << ctime <<
" s" << endl;
std::map< int, int > trackHitMap
TVector3 GetMomentum() const
cout<< "POINTs for new FwEndCap == "<< tsim-> GetEntriesFast()
std::string GetSimFileName(std::string addon="", bool cut=false)
A simple class which adds the corresponding file extensions to a given base class.
friend F32vec4 fabs(const F32vec4 &a)
PndFileNameCreator namecreator("../data/Lars/MvdDtsSim.root")
Int_t GetMotherID() const
TClonesArray * radlen_array