FairRoot/PandaRoot
Functions | Variables
anadigi.C File Reference

Go to the source code of this file.

Functions

gROOT LoadMacro ("$VMCWORKDIR/gconfig/rootlogon.C")
 
 rootlogon ()
 
gROOT LoadMacro ("../Tools.C")
 
 LoadPandaStyle ()
 
timer Start ()
 
picture ReplaceAll (".root",".ps")
 
t AddFriend ("pndsim", digiFile.c_str())
 
t SetBranchAddress ("MVDPoint",&mc_array)
 
t SetBranchAddress ("MVDPixelDigis",&digiPixel_array)
 
t SetBranchAddress ("MVDStripDigis",&digiStrip_array)
 
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)
 
PndMvdCalcFePixel pixelcalc (100, 100, 10)
 
 for (Int_t j=0;j< nEvents &&j< t->GetEntriesFast();j++)
 
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)
 
fHChgMC DrawCopy ("same")
 
fHChgMCPix SetLineColor (6)
 
fHChgFakePix SetLineColor (30)
 
 DrawNice2DHisto (hisStripTop)
 
 DrawNice2DHisto (hisStripBot)
 
hisStripChargeTop DrawCopy ("sames")
 
can1 Update ()
 
 BetterStatBox (mypad)
 
mypad Divide (2, 3)
 
mypad cd (5)
 
mypad cd (6)
 
can1 Print (picture.Data())
 
timer Stop ()
 

Variables

bool verbose = false
 
TStopwatch timer
 
PndFileNameCreator namecreator ("../data/mvddpm6GeV.root")
 
std::string inFile = namecreator.GetSimFileName(false)
 
std::string digiFile = namecreator.GetDigiFileName(false)
 
std::string parfile = "../data/mvddpm6GeV_digipar.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 * digiPixel_array =new TClonesArray("PndSdsDigiPixel")
 
TClonesArray * digiStrip_array =new TClonesArray("PndSdsDigiStrip")
 
TGeoManager * geoMan = (TGeoManager*) gDirectory->Get("FAIRGeom")
 
TH2D * hisxy = new TH2D("hisxy","",400,-15.,15.,400,-15.,15.)
 
TH2D * hisrz = new TH2D("hisrz","",400,-20.,20.,400,-15.,25.)
 
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
 
TH1I * hisPixelCol = new TH1I("hispixelcol","Pixel column channel number on FE",n,low,low+n)
 
TH1I * hisPixelRow = new TH1I("hispixelrow","Pixel row channel number on FE",n,low,low+n)
 
TH1I * hisPixelFE = new TH1I("hispixelfe","Pixel FE number",n,low,low+n)
 
TH1I * hisCol = new TH1I("hiscol","column number",1200,0,1200)
 
TH1I * hisRow = new TH1I("hisrow","row number",1200,0,1200)
 
TH1D * hisPixelCharge = new TH1D("hispixelcharge","Pixel Charge content",100,0.,1e5)
 
TH2I * hisStripTop = new TH2I("hisstriptop","Strip Top channel&fe numbers",20,0,20,130,0,130)
 
TH2I * hisStripBot = new TH2I("hisstripbot","Strip Bot channel&fe numbers",20,0,20,130,0,130)
 
TH1I * hisStripStrip = new TH1I("hisstripstrip","Strip numbers",15*128,0,15*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)
 
TH1F * fHChgDiff
 
TH1F * fHChgMC = new TH1F("hchgmc",";#DeltaC/e^{-} MC;",150,0.,1e4)
 
TH1F * fHChgFake = new TH1F("hchgfake",";#DeltaC/e^{-} fake;",150,0.,1e4)
 
TH1F * fHChgMCPix = new TH1F("hchgmcPix",";#DeltaC/e^{-} MC;",150,0.,1e4)
 
TH1F * fHChgFakePix = new TH1F("hchgfakePix",";#DeltaC/e^{-} fake;",150,0.,1e4)
 
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_t a = 2
 
Int_t b = 2
 
Int_t res =475
 
TCanvas * can1 = new TCanvas("MvdTestPlot","MCHit view in MVD",0,0,a*res,b*res)
 
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 ( )
mypad cd ( )
mypad cd ( )
can1 Divide ( a  ,
b   
)
mypad Divide ( ,
 
)
mypad Divide ( ,
 
)
hisde DrawCopy ( )
fHChgFakePix DrawCopy ( "same"  )
hisStripChargeTop DrawCopy ( "sames"  )
DrawNice2DHisto ( hisxy  )
DrawNice2DHisto ( hisrz  )
DrawNice2DHisto ( hisStripTop  )
DrawNice2DHisto ( hisStripBot  )
for ( )

Definition at line 103 of file anadigi.C.

References col, PndSdsDigiStrip::GetChannel(), PndSdsDigi::GetCharge(), PndSdsDigi::GetFE(), PndSdsDigi::GetIndex(), PndSdsDigiPixel::GetPixelColumn(), PndSdsDigiPixel::GetPixelRow(), i, pixelcalc(), and point.

104  {
105  t->GetEntry(j);
106  if(verbose) cout<<"Event No "<<j<<endl;
107 
108  // ----- MC Points -----
109  for (Int_t i=0; i<mc_array->GetEntriesFast(); i++)
110  {
111  if(verbose) cout<<"Point No "<<i<<endl;
113  vecmc.SetXYZ(point->GetX(),point->GetY(),point->GetZ());
114  mommc.SetXYZ(point->GetPx(),point->GetPy(),point->GetPz());
115  hisxy->Fill(vecmc.x(),vecmc.y());
116  if(vecmc.y() > 0.) hisrz->Fill(vecmc.z(),vecmc.Perp());
117  else hisrz->Fill(vecmc.z(),-1.*vecmc.Perp());
118  hisde->Fill(point->GetEnergyLoss());
119  hismom->Fill(mommc.Mag());
120  }
121 
122  // ----- PIXEL DIGIS -----
123  for (Int_t i=0; i<digiPixel_array->GetEntriesFast(); i++)
124  {
125  PndSdsDigiPixel *pixeldigi = digiPixel_array->At(i);
126  fe = pixeldigi->GetFE();
127  col = pixeldigi->GetPixelColumn();
128  row = pixeldigi->GetPixelRow();
129  hisPixelCol->Fill(col);
130  hisPixelRow->Fill(row);
131  hisPixelFE->Fill(fe);
132  hisPixelCharge->Fill(pixeldigi->GetCharge());
133  pixelcalc.CalcSensorColRow(col,row,fe);
134  hisCol->Fill(col);
135  hisRow->Fill(row);
136  fHChgDiff->Fill(pixeldigi->GetCharge());
137  if( pixeldigi->GetIndex() == -1 ) fHChgFakePix->Fill(pixeldigi->GetCharge());
138  else fHChgMCPix->Fill(pixeldigi->GetCharge());
139  }
140 
141  // ----- STRIP DIGIS -----
142  for (Int_t i=0; i<digiStrip_array->GetEntriesFast(); i++)
143  {
144  PndSdsDigiStrip *stripdigi = digiStrip_array->At(i);
145  fe = stripdigi->GetFE();
146  col = stripdigi->GetChannel();
147  int strip = fe * nrFeChannels + col;
148  hisStripStrip->Fill(strip);
149  hisStripCharge->Fill(stripdigi->GetCharge());
150  if (strip <= nrStrips)
151  {
152  hisStripTop->Fill(fe,col);
153  hisStripChargeTop->Fill(stripdigi->GetCharge());
154  } else {
155  hisStripBot->Fill(fe,col);
156  hisStripChargeBot->Fill(stripdigi->GetCharge());
157  }
158  fHChgDiff->Fill(stripdigi->GetCharge());
159  if( stripdigi->GetIndex() == -1 ) fHChgFake->Fill(stripdigi->GetCharge());
160  else fHChgMC->Fill(stripdigi->GetCharge());
161  }
162 
163  }// end for j (events)
Int_t GetPixelRow() const
TH1D * hisStripChargeBot
Definition: anadigi.C:77
int nrFeChannels
Definition: anadigi.C:100
Int_t i
Definition: run_full.C:25
int nrStrips
Definition: anadigi.C:101
Int_t GetIndex(int i=0) const
Definition: PndSdsDigi.h:63
TH1F * fHChgMCPix
Definition: anadigi.C:83
Int_t GetPixelColumn() const
TH2D * hisxy
Definition: anadigi.C:42
Class for digitised strip hits.
Double_t GetCharge() const
Definition: PndSdsDigi.h:60
TH2I * hisStripTop
Definition: anadigi.C:66
TH1I * hisStripStrip
Definition: anadigi.C:70
Int_t GetFE() const
Definition: PndSdsDigi.h:57
TH1F * fHChgMC
Definition: anadigi.C:81
TH1I * hisPixelFE
Definition: anadigi.C:58
TVector3 vecmc
Definition: anadigi.C:90
TH1D * hisStripChargeTop
Definition: anadigi.C:74
TVector3 mommc
Definition: anadigi.C:90
TH2D * hisrz
Definition: anadigi.C:45
TClonesArray * digiStrip_array
Definition: anadigi.C:35
TH1D * hisStripCharge
Definition: anadigi.C:72
TH1F * fHChgFake
Definition: anadigi.C:82
int row
Definition: anadigi.C:93
TClonesArray * point
Definition: anaLmdDigi.C:29
TH1D * hisde
Definition: anadigi.C:48
TH1F * fHChgFakePix
Definition: anadigi.C:84
TH1I * hisPixelRow
Definition: anadigi.C:56
TH1D * hisPixelCharge
Definition: anadigi.C:64
TTree * t
Definition: anadigi.C:26
TH2I * hisStripBot
Definition: anadigi.C:68
PndMvdCalcFePixel pixelcalc(100, 100, 10)
TH1F * fHChgDiff
Definition: anadigi.C:79
int fe
Definition: anadigi.C:93
TH1I * hisCol
Definition: anadigi.C:60
TH1D * hismom
Definition: anadigi.C:50
int col
Definition: anadigi.C:93
TH1I * hisRow
Definition: anadigi.C:62
Data class to store the digi output of a pixel module.
TClonesArray * digiPixel_array
Definition: anadigi.C:32
Int_t GetChannel() const
bool verbose
Definition: anadigi.C:4
TClonesArray * mc_array
Definition: anadigi.C:29
TH1I * hisPixelCol
Definition: anadigi.C:54
gROOT LoadMacro ( "$VMCWORKDIR/gconfig/rootlogon.C )
gROOT LoadMacro ( "../Tools.C"  )
LoadPandaStyle ( )
PndMvdCalcFePixel pixelcalc ( 100  ,
100  ,
10   
)

Referenced by for().

can1 Print ( picture.  Data())
picture ReplaceAll ( ".root"  ,
".ps"   
)
rootlogon ( )

Definition at line 1 of file outdated/mpiTools/macros/emc/rootlogon.C.

2 {
3  gSystem->AddIncludePath("-I$VMCWORKDIR/emc");
4  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcDigi");
5  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcMC");
6  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcTools");
7  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcReco");
8  gSystem->AddIncludePath("-I$VMCWORKDIR/emc/EmcData");
9  gSystem->AddIncludePath("-I$VMCWORKDIR/pnddata");
10  gSystem->AddIncludePath("-I$VMCWORKDIR/base");
11  gROOT->LoadMacro("$VMCWORKDIR/gconfig/basiclibs.C");
12  basiclibs();
13 
14  gSystem->Load("libDpmEvtGen.so");
15  gSystem->Load("libGeoBase");
16  gSystem->Load("libParBase");
17  gSystem->Load("libBase");
18  gSystem->Load("libTrkBase");
19  gSystem->Load("libPndData");
20  gSystem->Load("libField");
21  gSystem->Load("libPassive");
22  gSystem->Load("libGen");
23  gSystem->Load("libPGen");
24  gSystem->Load("libEmc");
25 
26  delete gRandom;
27  gRandom=new TRandom3(0);
28 }
basiclibs()
t SetBranchAddress ( "MVDPoint"  ,
mc_array 
)
t SetBranchAddress ( "MVDPixelDigis"  ,
digiPixel_array 
)
t SetBranchAddress ( "MVDStripDigis"  ,
digiStrip_array 
)
hisStripChargeTop SetLineColor ( kBlue  )
hisStripChargeBot SetLineColor ( kRed  )
fHChgMCPix SetLineColor ( )
fHChgFakePix SetLineColor ( 30  )
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 166 of file anadigi.C.

Int_t b = 2

Definition at line 166 of file anadigi.C.

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

Definition at line 167 of file anadigi.C.

int col

Definition at line 93 of file anadigi.C.

Referenced by for().

Double_t ctime = timer.CpuTime()

Definition at line 221 of file anadigi.C.

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

Definition at line 20 of file anadigi.C.

TClonesArray* digiPixel_array =new TClonesArray("PndSdsDigiPixel")

Definition at line 32 of file anadigi.C.

TClonesArray* digiStrip_array =new TClonesArray("PndSdsDigiStrip")

Definition at line 35 of file anadigi.C.

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

Definition at line 25 of file anadigi.C.

int fe

Definition at line 93 of file anadigi.C.

TH1F* fHChgDiff
Initial value:
= new TH1F("hchgdiff","#color[2]{StripMC}, #color[6]{PixelMC},\
#color[4]{StripNoise}, #color[30]{PixelNoise}, #color[1]{All};C/e^{-};",150,0.,1e4)

Definition at line 79 of file anadigi.C.

TH1F* fHChgFake = new TH1F("hchgfake",";#DeltaC/e^{-} fake;",150,0.,1e4)

Definition at line 82 of file anadigi.C.

TH1F* fHChgFakePix = new TH1F("hchgfakePix",";#DeltaC/e^{-} fake;",150,0.,1e4)

Definition at line 84 of file anadigi.C.

TH1F* fHChgMC = new TH1F("hchgmc",";#DeltaC/e^{-} MC;",150,0.,1e4)

Definition at line 81 of file anadigi.C.

TH1F* fHChgMCPix = new TH1F("hchgmcPix",";#DeltaC/e^{-} MC;",150,0.,1e4)

Definition at line 83 of file anadigi.C.

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

Definition at line 38 of file anadigi.C.

TH1I* hisCol = new TH1I("hiscol","column number",1200,0,1200)

Definition at line 60 of file anadigi.C.

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

Definition at line 48 of file anadigi.C.

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

Definition at line 50 of file anadigi.C.

TH1D* hisPixelCharge = new TH1D("hispixelcharge","Pixel Charge content",100,0.,1e5)

Definition at line 64 of file anadigi.C.

TH1I* hisPixelCol = new TH1I("hispixelcol","Pixel column channel number on FE",n,low,low+n)

Definition at line 54 of file anadigi.C.

TH1I* hisPixelFE = new TH1I("hispixelfe","Pixel FE number",n,low,low+n)

Definition at line 58 of file anadigi.C.

TH1I* hisPixelRow = new TH1I("hispixelrow","Pixel row channel number on FE",n,low,low+n)

Definition at line 56 of file anadigi.C.

TH1I* hisRow = new TH1I("hisrow","row number",1200,0,1200)

Definition at line 62 of file anadigi.C.

TH2D* hisrz = new TH2D("hisrz","",400,-20.,20.,400,-15.,25.)

Definition at line 45 of file anadigi.C.

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

Definition at line 68 of file anadigi.C.

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

Definition at line 72 of file anadigi.C.

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

Definition at line 77 of file anadigi.C.

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

Definition at line 74 of file anadigi.C.

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

Definition at line 70 of file anadigi.C.

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

Definition at line 66 of file anadigi.C.

TH2D* hisxy = new TH2D("hisxy","",400,-15.,15.,400,-15.,15.)

Definition at line 42 of file anadigi.C.

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

Definition at line 19 of file anadigi.C.

TVector2 localdiff

Definition at line 92 of file anadigi.C.

TVector2 localmc

Definition at line 92 of file anadigi.C.

TVector2 locals

Definition at line 92 of file anadigi.C.

int low = 0

Definition at line 52 of file anadigi.C.

TClonesArray* mc_array =new TClonesArray("PndSdsMCPoint")

Definition at line 29 of file anadigi.C.

TVector3 mommc

Definition at line 90 of file anadigi.C.

mypad =0

Definition at line 169 of file anadigi.C.

int n = 100

Definition at line 52 of file anadigi.C.

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

Definition at line 100 of file anadigi.C.

int nrStrips =par->GetNrTopFE()*nrFeChannels

Definition at line 101 of file anadigi.C.

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

Definition at line 97 of file anadigi.C.

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

Definition at line 96 of file anadigi.C.

std::string parfile = "../data/mvddpm6GeV_digipar.root"

Definition at line 21 of file anadigi.C.

TString picture = namecreator.GetDigiFileName(false)

Definition at line 22 of file anadigi.C.

Int_t res =475
int row

Definition at line 93 of file anadigi.C.

Double_t rtime = timer.RealTime()

Definition at line 220 of file anadigi.C.

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

Definition at line 26 of file anadigi.C.

TStopwatch timer

Definition at line 13 of file anadigi.C.

Double_t tmpx

Definition at line 91 of file anadigi.C.

Double_t tmpy

Definition at line 91 of file anadigi.C.

Double_t tmpz

Definition at line 91 of file anadigi.C.

TVector3 vecmc

Definition at line 90 of file anadigi.C.

bool verbose = false

Definition at line 4 of file anadigi.C.

double x

Definition at line 94 of file anadigi.C.

double y

Definition at line 94 of file anadigi.C.