FairRoot/PandaRoot
Functions | Variables
outreadMvdDigi.C File Reference

Go to the source code of this file.

Functions

gROOT Macro ("$VMCWORKDIR/gconfig/rootlogon.C")
 
gROOT LoadMacro ("../Tools.C")
 
 LoadPandaStyle ()
 
timer Start ()
 
picture ReplaceAll (".root",".ps")
 
t AddFriend ("pndsim", digiFile.c_str())
 
t SetBranchAddress ("MVDPoint",&mc_array)
 
t SetBranchAddress ("MVDStripDigis",&digiStrip_array)
 
std::ofstream Outfile ("../data/Lars/0999_1001_85.hit", ios_base::app)
 
std::ofstream Outrealfile ("../data/Lars/0999_1001_85.real", ios_base::app)
 
hisxy SetTitle ("MVD MC Point, xy view;x / cm;y / cm")
 
hisrz SetTitle ("MVD MC Point, rz view;z / cm;r/ cm")
 
hisStripChargeTop SetLineColor (kBlue)
 
hisStripChargeBot SetLineColor (kRed)
 
 for (Int_t j=0;j< nEvents &&j< t->GetEntriesFast();j++)
 
Outrealfile close ()
 
can1 Divide (a, b)
 
can1 cd (1)
 
mypad Divide (2, 2)
 
 DrawNice2DHisto (hisxy)
 
mypad cd (2)
 
 DrawNice2DHisto (hisrz)
 
mypad cd (3)
 
gPad SetLogy ()
 
hisde DrawCopy ()
 
mypad cd (4)
 
 DrawNice2DHisto (hisStripTop)
 
 DrawNice2DHisto (hisStripBot)
 
hisStripChargeTop DrawCopy ("sames")
 
can1 Update ()
 
 BetterStatBox (mypad)
 
timer Stop ()
 

Variables

bool verbose = false
 
TStopwatch timer
 
PndFileNameCreator namecreator ("../data/Lars/MvdDtsSim.root")
 
std::string inFile = namecreator.GetSimFileName(false)
 
std::string digiFile = namecreator.GetDigiFileName(false)
 
std::string parfile = "../data/Lars/MvdDtsParams.root"
 
TString picture = namecreator.GetDigiFileName(false)
 
TFile * f = new TFile(inFile.c_str())
 
TTree * t =(TTree *) f->Get("pndsim")
 
TClonesArray * mc_array =new TClonesArray("PndSdsMCPoint")
 
TClonesArray * digiStrip_array =new TClonesArray("PndSdsDigiStrip")
 
TGeoManager * geoMan = (TGeoManager*) gDirectory->Get("FAIRGeom")
 
TH2D * hisxy = new TH2D("hisxy","",100,-1.1,1.1,100,-1.1,1.1)
 
TH2D * hisrz = new TH2D("hisrz","",100,0.,10.,100,-5.,5.)
 
TH1D * hisde = new TH1D("hisde","MVD MC Points, Energyloss",100,0.,0.002)
 
TH1D * hismom = new TH1D("hismom","MVD MC Points, momentum",100,0.,1.5)
 
int n = 100
 
int low = 0
 
TH2I * hisStripTop = new TH2I("hisstriptop","Strip Top channel&fe numbers",5,0,4,130,0,130)
 
TH2I * hisStripBot = new TH2I("hisstripbot","Strip Bot channel&fe numbers",5,0,4,130,0,130)
 
TH1I * hisStripStrip = new TH1I("hisstripstrip","Strip numbers",3*128,0,3*128)
 
TH1D * hisStripCharge = new TH1D("hisstripcharge","Strip Charge content",100,0.,1e5)
 
TH1D * hisStripChargeTop = new TH1D("hisstripchargetop","Strip Charge content",100,0.,1e5)
 
TH1D * hisStripChargeBot = new TH1D("hisstripchargebot","Strip Charge content",100,0.,1e5)
 
TVector3 vecmc
 
TVector3 mommc
 
Double_t tmpx
 
Double_t tmpy
 
Double_t tmpz
 
TVector2 locals
 
TVector2 localmc
 
TVector2 localdiff
 
int col
 
int row
 
int fe
 
double x
 
double y
 
TFile * parDB = new TFile(parfile.c_str())
 
PndMvdStripDigiPar * par = (PndMvdStripDigiPar*)gROOT->FindObject("MVDStripDigiParRect")
 
int nrFeChannels =par->GetNrFECh()
 
int nrStrips =par->GetNrTopFE()*nrFeChannels
 
int evID =0
 
Int_t a = 2
 
Int_t b = 2
 
TCanvas * can1 = new TCanvas("MvdTestPlot","MCHit view in MVD",0,0,a*400,b*400)
 
TPad * mypad =0
 
Double_t rtime = timer.RealTime()
 
Double_t ctime = timer.CpuTime()
 

Function Documentation

t AddFriend ( "pndsim"  ,
digiFile.  c_str() 
)
BetterStatBox ( mypad  )
can1 cd ( )
mypad cd ( )
mypad cd ( )
mypad cd ( )
Outrealfile close ( )
can1 Divide ( a  ,
b   
)
mypad Divide ( ,
 
)
hisde DrawCopy ( )
hisStripChargeTop DrawCopy ( "sames"  )
DrawNice2DHisto ( hisxy  )
DrawNice2DHisto ( hisrz  )
DrawNice2DHisto ( hisStripTop  )
DrawNice2DHisto ( hisStripBot  )
for ( )

Definition at line 82 of file outreadMvdDigi.C.

References col, PndSdsDigiStrip::GetChannel(), PndSdsDigi::GetCharge(), PndSdsDigi::GetFE(), PndSdsMCPoint::GetPosition(), PndSdsMCPoint::GetPositionOut(), i, Outfile(), Outrealfile(), point, x, y, and z.

83  {
84  evID++;
85  t->GetEntry(j);
86  if(verbose) cout<<"Event No "<<j<<endl;
87 
88  double x,y,z,Eloss;
89 
90  // ----- MC Points -----
91  for (Int_t i=0; i<mc_array->GetEntriesFast(); i++)
92  {
93  if(verbose) cout<<"Point No "<<i<<endl;
95  vecmc = 0.5*(point->GetPosition() + point->GetPositionOut());
96 // vecmc.SetXYZ(point->GetX(),point->GetY(),point->GetZ());
97  mommc.SetXYZ(point->GetPx(),point->GetPy(),point->GetPz());
98  hisxy->Fill(vecmc.x(),vecmc.y());
99  if(vecmc.y() > 0.) hisrz->Fill(vecmc.z(),vecmc.Perp());
100  else hisrz->Fill(vecmc.z(),-1.*vecmc.Perp());
101  hisde->Fill(point->GetEnergyLoss());
102  hismom->Fill(mommc.Mag());
103  x=point->GetX();
104  y=point->GetY();
105  z=point->GetZ();
106  Eloss=point->GetEnergyLoss();
107  Outrealfile<<evID<<" "<<x<<" "<<y<<" "<<z<<" "<<Eloss<<" "<<point->GetPx()<<" "<<point->GetPy()<<" "<<point->GetPz()<<endl;
108  }
109 
110  // ----- STRIP DIGIS -----
111  if(0==digiStrip_array->GetEntriesFast()) Outfile<<evID<<" "<<0<<" "<<0<<" "<<0.<<endl;
112  for (Int_t i=0; i<digiStrip_array->GetEntriesFast(); i++)
113  {
114  PndSdsDigiStrip *stripdigi = digiStrip_array->At(i);
115  fe = stripdigi->GetFE();
116  col = stripdigi->GetChannel();
117  int strip = fe * nrFeChannels + col;
118  hisStripStrip->Fill(strip);
119  hisStripCharge->Fill(stripdigi->GetCharge());
120  if (strip <= nrStrips)
121  {
122  hisStripTop->Fill(fe,col);
123  hisStripChargeTop->Fill(stripdigi->GetCharge());
124  } else {
125  hisStripBot->Fill(fe,col);
126  hisStripChargeBot->Fill(stripdigi->GetCharge());
127  }
128  Outfile<<evID<<" "<<fe<<" "<<col<<" "<<stripdigi->GetCharge()<<endl;
129  }
130  }// end for j (events)
double y
TClonesArray * digiStrip_array
TVector3 mommc
Int_t i
Definition: run_full.C:25
TH1D * hismom
TH1D * hisStripChargeBot
Class for digitised strip hits.
Double_t GetCharge() const
Definition: PndSdsDigi.h:60
std::ofstream Outrealfile("../data/Lars/0999_1001_85.real", ios_base::app)
TVector3 GetPositionOut() const
Definition: PndSdsMCPoint.h:91
Int_t GetFE() const
Definition: PndSdsDigi.h:57
bool verbose
Definition: outreadMvdDigi.C:4
double x
TH1D * hisde
TH1I * hisStripStrip
int nrFeChannels
std::ofstream Outfile("../data/Lars/0999_1001_85.hit", ios_base::app)
TH2D * hisxy
int col
TClonesArray * point
Definition: anaLmdDigi.C:29
int evID
TClonesArray * mc_array
int nrStrips
Double_t z
TVector3 vecmc
int fe
TH1D * hisStripChargeTop
TVector3 GetPosition() const
Definition: PndSdsMCPoint.h:90
TH2D * hisrz
TH2I * hisStripBot
Int_t GetChannel() const
TH1D * hisStripCharge
TTree * t
TH2I * hisStripTop
gROOT LoadMacro ( "../Tools.C"  )
LoadPandaStyle ( )
gROOT Macro ( "$VMCWORKDIR/gconfig/rootlogon.C )
std::ofstream Outfile ( "../data/Lars/0999_1001_85.hit"  ,
ios_base::app   
)
std::ofstream Outrealfile ( "../data/Lars/0999_1001_85.real"  ,
ios_base::app   
)

Referenced by for().

picture ReplaceAll ( ".root"  ,
".ps"   
)
t SetBranchAddress ( "MVDPoint"  ,
mc_array 
)
t SetBranchAddress ( "MVDStripDigis"  ,
digiStrip_array 
)
hisStripChargeTop SetLineColor ( kBlue  )
hisStripChargeBot SetLineColor ( kRed  )
gPad SetLogy ( )
hisxy SetTitle ( "MVD MC  Point,
xy view;x/cm;y/cm  
)
hisrz SetTitle ( "MVD MC  Point,
rz view;z/cm;r/cm  
)
timer Start ( )
timer Stop ( )
can1 Update ( )

Variable Documentation

Int_t a = 2

Definition at line 132 of file outreadMvdDigi.C.

Int_t b = 2

Definition at line 132 of file outreadMvdDigi.C.

TCanvas* can1 = new TCanvas("MvdTestPlot","MCHit view in MVD",0,0,a*400,b*400)

Definition at line 135 of file outreadMvdDigi.C.

int col

Definition at line 72 of file outreadMvdDigi.C.

Referenced by for().

Double_t ctime = timer.CpuTime()

Definition at line 173 of file outreadMvdDigi.C.

std::string digiFile = namecreator.GetDigiFileName(false)

Definition at line 19 of file outreadMvdDigi.C.

TClonesArray* digiStrip_array =new TClonesArray("PndSdsDigiStrip")

Definition at line 31 of file outreadMvdDigi.C.

int evID =0

Definition at line 81 of file outreadMvdDigi.C.

TFile* f = new TFile(inFile.c_str())

Definition at line 24 of file outreadMvdDigi.C.

int fe

Definition at line 72 of file outreadMvdDigi.C.

TGeoManager* geoMan = (TGeoManager*) gDirectory->Get("FAIRGeom")

Definition at line 34 of file outreadMvdDigi.C.

TH1D* hisde = new TH1D("hisde","MVD MC Points, Energyloss",100,0.,0.002)

Definition at line 47 of file outreadMvdDigi.C.

TH1D* hismom = new TH1D("hismom","MVD MC Points, momentum",100,0.,1.5)

Definition at line 49 of file outreadMvdDigi.C.

TH2D* hisrz = new TH2D("hisrz","",100,0.,10.,100,-5.,5.)

Definition at line 44 of file outreadMvdDigi.C.

TH2I* hisStripBot = new TH2I("hisstripbot","Strip Bot channel&fe numbers",5,0,4,130,0,130)

Definition at line 55 of file outreadMvdDigi.C.

TH1D* hisStripCharge = new TH1D("hisstripcharge","Strip Charge content",100,0.,1e5)

Definition at line 59 of file outreadMvdDigi.C.

TH1D* hisStripChargeBot = new TH1D("hisstripchargebot","Strip Charge content",100,0.,1e5)

Definition at line 64 of file outreadMvdDigi.C.

TH1D* hisStripChargeTop = new TH1D("hisstripchargetop","Strip Charge content",100,0.,1e5)

Definition at line 61 of file outreadMvdDigi.C.

TH1I* hisStripStrip = new TH1I("hisstripstrip","Strip numbers",3*128,0,3*128)

Definition at line 57 of file outreadMvdDigi.C.

TH2I* hisStripTop = new TH2I("hisstriptop","Strip Top channel&fe numbers",5,0,4,130,0,130)

Definition at line 53 of file outreadMvdDigi.C.

TH2D* hisxy = new TH2D("hisxy","",100,-1.1,1.1,100,-1.1,1.1)

Definition at line 41 of file outreadMvdDigi.C.

std::string inFile = namecreator.GetSimFileName(false)

Definition at line 18 of file outreadMvdDigi.C.

TVector2 localdiff

Definition at line 71 of file outreadMvdDigi.C.

TVector2 localmc

Definition at line 71 of file outreadMvdDigi.C.

TVector2 locals

Definition at line 71 of file outreadMvdDigi.C.

int low = 0

Definition at line 51 of file outreadMvdDigi.C.

TClonesArray* mc_array =new TClonesArray("PndSdsMCPoint")

Definition at line 28 of file outreadMvdDigi.C.

TVector3 mommc

Definition at line 69 of file outreadMvdDigi.C.

mypad =0

Definition at line 137 of file outreadMvdDigi.C.

int n = 100

Definition at line 51 of file outreadMvdDigi.C.

PndFileNameCreator namecreator("../data/Lars/MvdDtsSim.root")
int nrFeChannels =par->GetNrFECh()

Definition at line 78 of file outreadMvdDigi.C.

int nrStrips =par->GetNrTopFE()*nrFeChannels

Definition at line 79 of file outreadMvdDigi.C.

PndMvdStripDigiPar* par = (PndMvdStripDigiPar*)gROOT->FindObject("MVDStripDigiParRect")

Definition at line 76 of file outreadMvdDigi.C.

TFile* parDB = new TFile(parfile.c_str())

Definition at line 75 of file outreadMvdDigi.C.

std::string parfile = "../data/Lars/MvdDtsParams.root"

Definition at line 20 of file outreadMvdDigi.C.

TString picture = namecreator.GetDigiFileName(false)

Definition at line 21 of file outreadMvdDigi.C.

int row

Definition at line 72 of file outreadMvdDigi.C.

Double_t rtime = timer.RealTime()

Definition at line 172 of file outreadMvdDigi.C.

TTree* t =(TTree *) f->Get("pndsim")

Definition at line 25 of file outreadMvdDigi.C.

TStopwatch timer

Definition at line 12 of file outreadMvdDigi.C.

Double_t tmpx

Definition at line 70 of file outreadMvdDigi.C.

Double_t tmpy

Definition at line 70 of file outreadMvdDigi.C.

Double_t tmpz

Definition at line 70 of file outreadMvdDigi.C.

TVector3 vecmc

Definition at line 69 of file outreadMvdDigi.C.

bool verbose = false

Definition at line 4 of file outreadMvdDigi.C.

double x

Definition at line 73 of file outreadMvdDigi.C.

Referenced by for().

double y

Definition at line 73 of file outreadMvdDigi.C.

Referenced by for().