FairRoot/PandaRoot
PndMvdMCEventAna.cxx
Go to the documentation of this file.
1 #include "PndMvdMCEventAna.h"
2 #include "PndSdsMCPoint.h"
3 #include "TVector3.h"
4 #include "TH3.h"
5 
7 
9 {
10  Init(fileName);
11  fMCTrackArray = new TClonesArray("PndMCTrack");
12  fTree->SetBranchAddress("MCTrack", &fMCTrackArray);
14 }
15 
17 {
18  fClassName = "PndSdsMCPoint";
19  fBranchName = "MVDPoint";
20 }
21 
23 {
24  if (fHistos["hisxy"]!= 0) delete (fHistos["hisxy"]);
25  fHistos["hisxy"] = new TH2D("hisxy","MVD MC Points, xy view",400,-15.,15.,400,-15.,15.);
26  fDrawOption["hisxy"] = "";
27  if (fHistos["hisrz"]!= 0) delete (fHistos["hisrz"]);
28  fHistos["hisrz"] = new TH2D("hisrz","MVD MC Points, rz view",400,-20.,20.,400,0.,40.);
29  fDrawOption["hisrz"] = "";
30 // if (fHistos["hisxyz"]!= 0) delete (fHistos["hisxyz"]);
31 // fHistos["hisxyz"] = new TH3D("hisxyz","MVD MC Points xyz view",200,-15.,15.,200,-15.,15.,200,-20.,20.);
32 // fDrawOption["hisxyz"] = "";
33  if (fHistos["hisde"] != 0) delete (fHistos["hisde"]);
34  fHistos["hisde"] = new TH1D("hisde","MVD MC Points, Energyloss",500,0.,0.002);
35  fDrawOption["hisde"] = "B";
36 }
37 
39 {
40  TVector3 vecs;
41 
42  fHitArray->Delete();
43  fTree->GetEntry(fActiveEvent);
45  if (hit->GetDetName().Contains(fSelection)){
46  vecs.SetXYZ(hit->GetX(), hit->GetY(), hit->GetZ());
47  fHistos["hisxy"]->Fill(vecs.x(),vecs.y());
48  fHistos["hisrz"]->Fill(vecs.z(),vecs.Perp());
49  fHistos["hisde"]->Fill(hit->GetEnergyLoss());
50  //TH3D* histo3D = (TH3D*)(fHistos["hisxyz"]);
51  //histo3D->Fill(hit->GetX(), hit->GetY(), hit->GetZ());
52  }
53 
54 }
55 
virtual void AnaHitNr(Int_t hitNr)
PndGeoHandling * fGeoH
Definition: anasim.C:34
TString fSelection
std::map< TString, TH1 * > fHistos
TString fBranchName
TVector3 vecs
virtual void InitHistos()
TClonesArray * fHitArray
static PndGeoHandling * Instance()
std::map< TString, TString > fDrawOption
virtual void InitBranch()
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)
Definition: hit.C:1
fRun Init()
Definition: NHitsPerEvent.C:20
TString fClassName
ClassImp(PndMvdMCEventAna) PndMvdMCEventAna