FairRoot/PandaRoot
Functions | Variables
anaplaneclust.C File Reference

Go to the source code of this file.

Functions

gROOT LoadMacro ("$VMCWORKDIR/gconfig/basiclibs.C")
 
 basiclibs ()
 
gSystem Load ("libGeoBase")
 
gSystem Load ("libParBase")
 
gSystem Load ("libBase")
 
gSystem Load ("libPndData")
 
gSystem Load ("libField")
 
gSystem Load ("libGen")
 
gSystem Load ("libPassive")
 
gSystem Load ("libgenfit")
 
gSystem Load ("libtrackrep")
 
gSystem Load ("libtpc")
 
gSystem Load ("libtpcreco")
 
gSystem Load ("librecotasks")
 
gSystem Load ("libMvd")
 
gSystem Load ("libMvdReco")
 
timer Start ()
 
t SetBranchAddress ("MVDCluster",&hit_array)
 
T SetBranchAddress ("MVDPoint",&mc_array)
 
hisxy SetTitle ("MVD MC Cluster, xy view;x / cm;y / cm")
 
hisrz SetTitle ("MVD MC Cluster, rz view;z / cm;r/ cm")
 
hisDiffXY SetTitle ("(MC - RECO) Hit coordinates xy view;#Deltax / cm;#Deltay / cm")
 
hisDiffRZ SetTitle ("(MC - RECO) Hit coordinates rz view;#Deltaz / cm;#Deltar / cm")
 
hisDiffX SetTitle ("(MC - RECO) Hit coordinate x;#Deltax / cm;")
 
hisDiffY SetTitle ("(MC - RECO) Hit coordinate y;#Deltay / cm;")
 
hisDiffZ SetTitle ("(MC - RECO) Hit coordinate z;#Deltaz / cm;")
 
hisDiffLocalX SetTitle ("(MC - RECO) Local Hit coordinate x;#Deltax_{L} / cm;")
 
hisDiffLocalY SetTitle ("(MC - RECO) Local Hit coordinate y;#Deltay_{L} / cm;")
 
hisDiffLocalZ SetTitle ("(MC - RECO) Local Hit coordinate z;#Deltaz_{L} / cm;")
 
hisDiffLocalXY SetTitle ("(MC - RECO) Local Hit XY;#Deltax_{L} / cm;#Deltay_{L} / cm")
 
hisDiffLocalRZ SetTitle ("(MC - RECO) Local Hit RZ;#Deltaz_{L} / cm;#Deltar_{L} / cm")
 
hisLocalXY SetTitle ("(MC - RECO) Local Hit XY;x_{L} / cm;y_{L} / cm")
 
hisLocalRZ SetTitle ("(MC - RECO) Local Hit RZ;z_{L} / cm;r_{L} / cm")
 
hisLocalYZ SetTitle ("(MC - RECO) Local Hit YZ;z_{L} / cm;y_{L} / cm")
 
hisLocalXZ SetTitle ("(MC - RECO) Local Hit XZ;z_{L} / cm;x_{L} / cm")
 
 for (Int_t j=0;j< nEvents &&j< t->GetEntriesFast();j++)
 
gStyle SetOptFit ()
 
total SetLineColor (kRed)
 
total SetLineWidth (1)
 
hisDiffX Fit (g1,"R")
 
hisDiffX Fit (g2,"R+")
 
total SetParameters (par)
 
hisDiffX Fit (total,"R")
 
hisDiffLocalX Fit ("gaus")
 
hisDiffLocalX GetFunction ("gaus") -> SetLineColor(kRed)
 
can1 Divide (a, b)
 
can1 cd (1)
 
hisxy DrawCopy ("col")
 
can1 cd (2)
 
can1 cd (3)
 
hisSensxy DrawCopy ("BOX")
 
can1 cd (4)
 
can1 cd (5)
 
hisPLUV DrawCopy ()
 
can1 cd (6)
 
hisDiffX DrawCopy ("")
 
can1 cd (7)
 
can1 cd (8)
 
can1 cd (9)
 
can1 cd (10)
 
can1 cd (11)
 
can1 cd (12)
 
can1 cd (13)
 
can1 cd (14)
 
can1 cd (15)
 
can1 cd (16)
 
can1 cd (17)
 
can1 cd (18)
 
can1 cd (19)
 
can1 cd (20)
 
can1 Print ("testoutput.ps")
 
timer Stop ()
 

Variables

bool verbose = false
 
TStopwatch timer
 
TFile * f = new TFile("../data/testMCCluster.root")
 
TTree * t =(TTree *) f->Get("pndsim")
 
TClonesArray * hit_array =new TClonesArray("MvdCluster")
 
TFile * F = new TFile("testMC.root")
 
TTree * T =(TTree *) F->Get("pndsim")
 
TClonesArray * mc_array =new TClonesArray("MvdMCPoint")
 
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.)
 
TH2D * hisSensxy = new TH2D("hisSensxy","",400,-15.,15.,400,-15.,15.)
 
TH2D * hisSensrz = new TH2D("hisSensrz","",400,-20.,20.,400,-15.,25.)
 
TH2D * hisDiffXY = new TH2D("hisdiffxy","",100,-0.05,0.05,100,-0.05,0.05)
 
TH2D * hisDiffRZ = new TH2D("hisdiffrz","",100,-0.05,0.05,100,-0.00,0.10)
 
TH1D * hisDiffX = new TH1D("hisdiffx","",100,-0.05,0.05)
 
TH1D * hisDiffY = new TH1D("hisdiffy","",100,-0.05,0.05)
 
TH1D * hisDiffZ = new TH1D("hisdiffz","",100,-0.05,0.05)
 
TH1D * hisDiffLocalX = new TH1D("hisdiffLocalx","",100,-0.05,0.05)
 
TH1D * hisDiffLocalY = new TH1D("hisdiffLocaly","",100,-0.05,0.05)
 
TH1D * hisDiffLocalZ = new TH1D("hisdiffLocalz","",100,-0.05,0.05)
 
TH2D * hisDiffLocalXY = new TH2D("hisdiffLocalxy","",100,-0.05,0.05,100,-0.05,0.05)
 
TH2D * hisDiffLocalRZ = new TH2D("hisdiffLocalrz","",100,-0.05,0.05,100,-0.00,0.10)
 
TH2D * hisLocalXY = new TH2D("hisLocalxy","",100,-5.,5.,100,-5.,5.)
 
TH2D * hisLocalRZ = new TH2D("hisLocalrz","",100,-5.,5.,100,-0.,10.)
 
TH2D * hisLocalYZ = new TH2D("hisLocalyz","",100,-5.,5.,100,-5.,5.)
 
TH2D * hisLocalXZ = new TH2D("hisLocalxz","",100,-5.,5.,100,-5.,5.)
 
TH1D * hisPLUV = new TH1D("hispluv","sensor unit vectors",100,0.9999,1.0001)
 
TVector3 vecs
 
TVector3 vecmc
 
TVector3 vecdiff
 
Double_t tmpx
 
Double_t tmpy
 
Double_t tmpz
 
TVector2 locals
 
TVector2 localmc
 
TVector2 localdiff
 
Double_t par [6]
 
TF1 * g1 = new TF1("g1","gaus",-0.007,0.007)
 
TF1 * g2 = new TF1("g2","gaus",-0.03,0.03)
 
TF1 * total = new TF1("total","gaus(0)+gaus(3)",-0.03,0.03)
 
Int_t a = 5
 
Int_t b = 4
 
TCanvas * can1 = new TCanvas("MvdTestPlot","MCHit view in MVD",0,0,a*250,b*250)
 
Double_t rtime = timer.RealTime()
 
Double_t ctime = timer.CpuTime()
 

Function Documentation

basiclibs ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( )
can1 cd ( 10  )
can1 cd ( 11  )
can1 cd ( 12  )
can1 cd ( 13  )
can1 cd ( 14  )
can1 cd ( 15  )
can1 cd ( 16  )
can1 cd ( 17  )
can1 cd ( 18  )
can1 cd ( 19  )
can1 cd ( 20  )
can1 Divide ( a  ,
b   
)
hisLocalRZ DrawCopy ( "col"  )
hisSensrz DrawCopy ( "BOX"  )
hisPLUV DrawCopy ( )
hisDiffX DrawCopy ( ""  )
hisDiffX Fit ( g1  ,
"R"   
)
hisDiffX Fit ( g2  ,
"R+"   
)
hisDiffZ Fit ( total  ,
"R"   
)
hisDiffLocalX Fit ( "gaus"  )
for ( )

Definition at line 91 of file anaplaneclust.C.

References hit(), i, mcpdg, point, and vecs.

92  {
93  t->GetEntry(j);
94  T->GetEntry(j);
95  if(verbose) cout<<"Event No "<<j<<endl;
96  for (Int_t i=0; i<hit_array->GetEntriesFast(); i++)
97  {
98  if(verbose) cout<<"Point No "<<i<<endl;
101  int mcpdg = -1;
102 
103  geoMan->cd(point->GetDetName());
104 // currentTransMat = geoMan->GetCurrentMatrix();
105 
106  vecs.SetXYZ(hit->GetX(), hit->GetY(), hit->GetZ());
107  vecmc.SetXYZ(point->GetX(),point->GetY(),point->GetZ());
108  vecdiff = vecmc - vecs;
109 
110  Int_t layer = Int_t(10.*vecs->Mag());
111  if(verbose) cout<<vecs.x()<<"\t"<<vecs.y()<<"\t"<<vecs.z()<<endl;
112  hisxy->Fill(vecs.x(),vecs.y());
113  if(vecs.y() > 0.) hisrz->Fill(vecs.z(),vecs.Perp());
114  else hisrz->Fill(vecs.z(),-1.*vecs.Perp());
115 
116  hisDiffXY->Fill(vecdiff.x(),vecdiff.y());
117  hisDiffRZ->Fill(vecdiff.z(),vecdiff.Perp());
118  hisDiffX->Fill(vecdiff.x());
119  hisDiffY->Fill(vecdiff.y());
120  hisDiffZ->Fill(vecdiff.z());
121 
122  // --- Now move vectors to the local sensor system
123  DetPlane plane = hit->getDetPlane();
124  TVector3 vnorm = plane->getNormal(); //vnorm->SetMag(1.0);
125  TVector3 plO = plane->getO();
126  TVector3 plU = plane->getU(); //plU->SetMag(1.0);
127  TVector3 plV = plane->getV(); //plV->SetMag(1.0);
128  hisSensxy->Fill(plO.x(),plO.y());
129  if(plO.y()>0.)hisSensrz->Fill(plO.z(),plO.Perp());
130  else hisSensrz->Fill(plO.z(),-1.*plO.Perp());
131 
132  vecs -= plO;
133  tmpz = vecs.Dot(plU);
134  tmpx = vecs.Dot(plV);
135  tmpy = vecs.Dot(vnorm);
136  vecs.SetXYZ(tmpx,tmpy,tmpz);
137  hisLocalXY->Fill(vecs.x(),vecs.y());
138  hisLocalXZ->Fill(vecs.z(),vecs.x());
139  hisLocalYZ->Fill(vecs.z(),vecs.y());
140  hisLocalRZ->Fill(vecs.z(),vecs.Perp());
141 
142  vecmc -= plO;
143  tmpz = vecmc.Dot(plU);
144  tmpx = vecmc.Dot(plV);
145  tmpy = vecmc.Dot(vnorm);
146  vecmc.SetXYZ(tmpx,tmpy,tmpz);
147  vecdiff = vecmc - vecs;
148 
149  tmpx = plU.Dot(plU);tmpy = plU.Dot(plV);tmpz = plU.Dot(vnorm);
150  hisPLUV->Fill(tmpx);hisPLUV->Fill(tmpy);hisPLUV->Fill(tmpz);
151 
152  tmpx = plV.Dot(plU);tmpy = plV.Dot(plV);tmpz = plV.Dot(vnorm);
153  hisPLUV->Fill(tmpx);hisPLUV->Fill(tmpy);hisPLUV->Fill(tmpz);
154 
155  tmpx = vnorm.Dot(plU);tmpy = vnorm.Dot(plV);tmpz = vnorm.Dot(vnorm);
156  hisPLUV->Fill(tmpx);hisPLUV->Fill(tmpy);hisPLUV->Fill(tmpz);
157 
158  hisDiffLocalX->Fill(vecdiff.X());
159  hisDiffLocalY->Fill(vecdiff.Y());
160  hisDiffLocalZ->Fill(vecdiff.Z());
161  hisDiffLocalXY->Fill(vecdiff.X(),vecdiff.Y());
162  hisDiffLocalRZ->Fill(vecdiff.Z(),vecdiff.Perp());
163 
164  }//end for i (points in event)
165  }// end for j (events)
Double_t tmpy
Definition: anaplaneclust.C:88
TH2D * hisDiffRZ
Definition: anaplaneclust.C:55
Double_t tmpz
Definition: anaplaneclust.C:88
TClonesArray * mc_array
Definition: anaplaneclust.C:39
Int_t i
Definition: run_full.C:25
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndSdsCluster.h:19
TTree * T
Definition: anaplaneclust.C:38
TH1D * hisDiffY
Definition: anaplaneclust.C:60
TH2D * hisSensxy
Definition: anaplaneclust.C:48
TH1D * hisDiffLocalZ
Definition: anaplaneclust.C:69
TH2D * hisDiffXY
Definition: anaplaneclust.C:53
TH2D * hisDiffLocalXY
Definition: anaplaneclust.C:71
TTree * t
Definition: anaplaneclust.C:33
TH1D * hisDiffLocalX
Definition: anaplaneclust.C:65
TH2D * hisxy
Definition: anaplaneclust.C:44
TH1D * hisDiffZ
Definition: anaplaneclust.C:62
TClonesArray * hit_array
Definition: anaplaneclust.C:34
TH2D * hisLocalRZ
Definition: anaplaneclust.C:78
bool verbose
Definition: anaplaneclust.C:4
TH1D * hisDiffX
Definition: anaplaneclust.C:58
TClonesArray * point
Definition: anaLmdDigi.C:29
TGeoManager * geoMan
Definition: anaplaneclust.C:42
TH2D * hisLocalXZ
Definition: anaplaneclust.C:82
TH2D * hisrz
Definition: anaplaneclust.C:46
TH2D * hisLocalYZ
Definition: anaplaneclust.C:80
TH2D * hisDiffLocalRZ
Definition: anaplaneclust.C:73
int mcpdg
TH1D * hisPLUV
Definition: anaplaneclust.C:85
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
Double_t tmpx
Definition: anaplaneclust.C:88
TH2D * hisSensrz
Definition: anaplaneclust.C:50
TVector3 vecdiff
Definition: anaplaneclust.C:87
TH2D * hisLocalXY
Definition: anaplaneclust.C:76
TVector3 vecmc
Definition: anaplaneclust.C:87
TH1D * hisDiffLocalY
Definition: anaplaneclust.C:67
TVector3 vecs
Definition: anaplaneclust.C:87
hisDiffLocalZ GetFunction ( "gaus"  ) -> SetLineColor(kRed)
gSystem Load ( "libGeoBase"  )
gSystem Load ( "libParBase"  )
gSystem Load ( "libBase"  )
gSystem Load ( "libPndData"  )
gSystem Load ( "libField"  )
gSystem Load ( "libGen"  )
gSystem Load ( "libPassive"  )
gSystem Load ( "libgenfit"  )
gSystem Load ( "libtrackrep"  )
gSystem Load ( "libtpc"  )
gSystem Load ( "libtpcreco"  )
gSystem Load ( "librecotasks"  )
gSystem Load ( "libMvd"  )
gSystem Load ( "libMvdReco"  )
gROOT LoadMacro ( "$VMCWORKDIR/gconfig/basiclibs.C )
can1 Print ( "testoutput.ps"  )
t SetBranchAddress ( "MVDCluster"  ,
hit_array 
)
T SetBranchAddress ( "MVDPoint"  ,
mc_array 
)
total SetLineColor ( kRed  )
total SetLineWidth ( )
gStyle SetOptFit ( )
total SetParameters ( par  )
hisxy SetTitle ( "MVD MC  Cluster,
xy view;x/cm;y/cm  
)
hisrz SetTitle ( "MVD MC  Cluster,
rz view;z/cm;r/cm  
)
hisDiffXY SetTitle ( "(MC - RECO) Hit coordinates xy view;#Deltax / cm;#Deltay / cm )
hisDiffRZ SetTitle ( "(MC - RECO) Hit coordinates rz view;#Deltaz / cm;#Deltar / cm )
hisDiffX SetTitle ( "(MC - RECO) Hit coordinate x;#Deltax / cm;"  )
hisDiffY SetTitle ( "(MC - RECO) Hit coordinate y;#Deltay / cm;"  )
hisDiffZ SetTitle ( "(MC - RECO) Hit coordinate z;#Deltaz / cm;"  )
hisDiffLocalX SetTitle ( "(MC - RECO) Local Hit coordinate x;#Deltax_{L} / cm;"  )
hisDiffLocalY SetTitle ( "(MC - RECO) Local Hit coordinate y;#Deltay_{L} / cm;"  )
hisDiffLocalZ SetTitle ( "(MC - RECO) Local Hit coordinate z;#Deltaz_{L} / cm;"  )
hisDiffLocalXY SetTitle ( "(MC - RECO) Local Hit XY;#Deltax_{L} / cm;#Deltay_{L} / cm )
hisDiffLocalRZ SetTitle ( "(MC - RECO) Local Hit RZ;#Deltaz_{L} / cm;#Deltar_{L} / cm )
hisLocalXY SetTitle ( "(MC - RECO) Local Hit XY;x_{L} / cm;y_{L} / cm )
hisLocalRZ SetTitle ( "(MC - RECO) Local Hit RZ;z_{L} / cm;r_{L} / cm )
hisLocalYZ SetTitle ( "(MC - RECO) Local Hit YZ;z_{L} / cm;y_{L} / cm )
hisLocalXZ SetTitle ( "(MC - RECO) Local Hit XZ;z_{L} / cm;x_{L} / cm )
timer Start ( )
timer Stop ( )

Variable Documentation

Int_t a = 5

Definition at line 213 of file anaplaneclust.C.

Int_t b = 4

Definition at line 213 of file anaplaneclust.C.

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

Definition at line 215 of file anaplaneclust.C.

Double_t ctime = timer.CpuTime()

Definition at line 249 of file anaplaneclust.C.

TFile* f = new TFile("../data/testMCCluster.root")

Definition at line 32 of file anaplaneclust.C.

TFile* F = new TFile("testMC.root")

Definition at line 37 of file anaplaneclust.C.

TF1* g1 = new TF1("g1","gaus",-0.007,0.007)

Definition at line 171 of file anaplaneclust.C.

TF1* g2 = new TF1("g2","gaus",-0.03,0.03)

Definition at line 172 of file anaplaneclust.C.

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

Definition at line 42 of file anaplaneclust.C.

TH2D* hisDiffLocalRZ = new TH2D("hisdiffLocalrz","",100,-0.05,0.05,100,-0.00,0.10)

Definition at line 73 of file anaplaneclust.C.

TH1D* hisDiffLocalX = new TH1D("hisdiffLocalx","",100,-0.05,0.05)

Definition at line 65 of file anaplaneclust.C.

TH2D* hisDiffLocalXY = new TH2D("hisdiffLocalxy","",100,-0.05,0.05,100,-0.05,0.05)

Definition at line 71 of file anaplaneclust.C.

TH1D* hisDiffLocalY = new TH1D("hisdiffLocaly","",100,-0.05,0.05)

Definition at line 67 of file anaplaneclust.C.

TH1D* hisDiffLocalZ = new TH1D("hisdiffLocalz","",100,-0.05,0.05)

Definition at line 69 of file anaplaneclust.C.

TH2D* hisDiffRZ = new TH2D("hisdiffrz","",100,-0.05,0.05,100,-0.00,0.10)

Definition at line 55 of file anaplaneclust.C.

TH1D* hisDiffX = new TH1D("hisdiffx","",100,-0.05,0.05)

Definition at line 58 of file anaplaneclust.C.

TH2D* hisDiffXY = new TH2D("hisdiffxy","",100,-0.05,0.05,100,-0.05,0.05)

Definition at line 53 of file anaplaneclust.C.

TH1D* hisDiffY = new TH1D("hisdiffy","",100,-0.05,0.05)

Definition at line 60 of file anaplaneclust.C.

TH1D* hisDiffZ = new TH1D("hisdiffz","",100,-0.05,0.05)

Definition at line 62 of file anaplaneclust.C.

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

Definition at line 78 of file anaplaneclust.C.

TH2D* hisLocalXY = new TH2D("hisLocalxy","",100,-5.,5.,100,-5.,5.)

Definition at line 76 of file anaplaneclust.C.

Referenced by anaclust().

TH2D* hisLocalXZ = new TH2D("hisLocalxz","",100,-5.,5.,100,-5.,5.)

Definition at line 82 of file anaplaneclust.C.

TH2D* hisLocalYZ = new TH2D("hisLocalyz","",100,-5.,5.,100,-5.,5.)

Definition at line 80 of file anaplaneclust.C.

TH1D* hisPLUV = new TH1D("hispluv","sensor unit vectors",100,0.9999,1.0001)

Definition at line 85 of file anaplaneclust.C.

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

Definition at line 46 of file anaplaneclust.C.

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

Definition at line 50 of file anaplaneclust.C.

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

Definition at line 48 of file anaplaneclust.C.

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

Definition at line 44 of file anaplaneclust.C.

TClonesArray* hit_array =new TClonesArray("MvdCluster")

Definition at line 34 of file anaplaneclust.C.

TVector2 localdiff

Definition at line 89 of file anaplaneclust.C.

TVector2 localmc

Definition at line 89 of file anaplaneclust.C.

TVector2 locals

Definition at line 89 of file anaplaneclust.C.

TClonesArray* mc_array =new TClonesArray("MvdMCPoint")

Definition at line 39 of file anaplaneclust.C.

g2 GetParameters&[3] par

Definition at line 169 of file anaplaneclust.C.

Double_t rtime = timer.RealTime()

Definition at line 248 of file anaplaneclust.C.

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

Definition at line 33 of file anaplaneclust.C.

TTree* T =(TTree *) F->Get("pndsim")

Definition at line 38 of file anaplaneclust.C.

TStopwatch timer

Definition at line 27 of file anaplaneclust.C.

Double_t tmpx

Definition at line 88 of file anaplaneclust.C.

Double_t tmpy

Definition at line 88 of file anaplaneclust.C.

Double_t tmpz

Definition at line 88 of file anaplaneclust.C.

TF1* total = new TF1("total","gaus(0)+gaus(3)",-0.03,0.03)

Definition at line 173 of file anaplaneclust.C.

TVector3 vecdiff

Definition at line 87 of file anaplaneclust.C.

TVector3 vecmc

Definition at line 87 of file anaplaneclust.C.

TVector3 vecs

Definition at line 87 of file anaplaneclust.C.

Referenced by for().

bool verbose = false

Definition at line 4 of file anaplaneclust.C.