FairRoot/PandaRoot
Functions | Variables
checkmomentum.C File Reference

Go to the source code of this file.

Functions

timer Start ()
 
gROOT LoadMacro ("$VMCWORKDIR/gconfig/rootlogon.C")
 
 rootlogon ()
 
gSystem Load ("libSttMvdTracking")
 
TFile filereco ("MvdStt_Test_reco.root")
 
treereco SetBranchAddress ("SttMvdTrack",&prefit)
 
treereco SetBranchAddress ("SttMvdKalmanTrack",&kalfit)
 
 if (evt%100==0) cout<< "EVT "<< evt<< endl
 
 if (!kaltrk) continue
 

Variables

TStopwatch timer
 
TTree * treereco = (TTree*) filereco.Get("pndsim")
 
TClonesArray * prefit = new TClonesArray("PndTrack")
 
TClonesArray * kalfit = new TClonesArray("PndTrack")
 
TH1F * hkalmom = new TH1F("hkalmom", "genfit", 100, 0.5, 1.5)
 
TH1F * hpremom = new TH1F("hpremom", "prefit", 100, 0.5, 1.5)
 
Int_t refIndex = kaltrk->GetRefIndex()
 

Function Documentation

TFile filereco ( "MvdStt_Test_reco.root"  )
if ( evt 100 = =0)
if ( kaltrk)

Definition at line 4 of file checktubes.C.

References c, exit(), PndSttMapCreator::FillTubeArray(), geoMan, PndSttTube::GetHalfLength(), PndSttTube::GetNeighborings(), PndSttTube::GetPosition(), PndSttTube::GetWireDirection(), gGeoManager, h2, and PndSttTube::IsParallel().

4  {
5  file->Get("FairBaseParSet");
6  TGeoManager *geoMan = gGeoManager;
7  if(!geoMan) {
8  file->Get("FairGeoParSet");
9  geoMan = gGeoManager;
10  if(!geoMan) {
11  cout << "Could not find valid GeoManager. Abort now!" << endl;
12  exit(1);
13  }
14  }
15 
16  PndGeoSttPar *parameters = file.Get("PndGeoSttPar");
17  PndSttMapCreator *mapper = new PndSttMapCreator(parameters);
18  TClonesArray *fTubeArray = mapper->FillTubeArray();
19 
20  TCanvas *c = new TCanvas("c", "", 400, 0, 900, 900);
21  TH2F *h2 = new TH2F("h2", "", 100, -42, 42, 100, -42, 42);
22  h2->SetStats(kFALSE);
23  h2->Draw();
24 
25  TArc *arc = NULL;
26  TMarker *mrk = NULL;
27  PndSttTube *tube = NULL;
28  int itube = 0;
29  while(itube != -1) {
30  c->Clear();
31  c->Draw();
32  h2->Draw();
33 
34 
35  // draw all the tubes
36  for(itube = 1; itube < fTubeArray->GetEntriesFast(); itube++) {
37  tube = (PndSttTube*) fTubeArray->At(itube);
38  if(tube->IsParallel()) {
39  arc = new TArc(tube->GetPosition().X(), tube->GetPosition().Y(), 0.5);
40  arc->Draw("SAME");
41  }
42  else {
43  mrk = new TMarker(tube->GetPosition().X(), tube->GetPosition().Y(), 6);
44  mrk->Draw("SAME");
45  }
46  }
47  // ............................
48 
49 
50 
51  cout << "WHICH tube do you want to test? [to exit type -1]" << endl;
52  cin >> itube;
53  if(itube == -1) exit(0);
54  cout << "TESTING tube " << itube << endl;
55  tube = (PndSttTube*) fTubeArray.At(itube);
56  if(!tube) {
57  cout << "this tube does not exist" << endl;
58  continue;
59  }
60 
61  TArrayI neighborings = tube->GetNeighborings();
62  cout << "nof neighboring tubes: " << neighborings->GetSize() << endl;
63  arc = new TArc(tube->GetPosition().X(), tube->GetPosition().Y(), 0.5);
64  arc->SetFillColor(kYellow);
65  arc->Draw("SAME");
66 
67  for(int inei = 0; inei < neighborings.GetSize(); inei++) {
68  tube = (PndSttTube*) fTubeArray.At(neighborings.At(inei));
69  TVector3 position = tube->GetPosition();
70  cout << " " << neighborings.At(inei);
71  if(tube->IsParallel()) {
72  arc = new TArc(position.X(), position.Y(), 0.5);
73  arc->SetFillColor(3);
74  arc->Draw("SAME");
75  }
76  else {
77  mrk = new TMarker(position.X(), position.Y(), 6);
78 
79  TVector3 extr1 = position - tube->GetWireDirection() * tube->GetHalfLength();
80  TVector3 extr2 = position + tube->GetWireDirection() * tube->GetHalfLength();
81  // mrk = new TMarker(extr1.X(), extr1.Y(), 6);
82  // mrk = new TMarker(extr2.X(), extr2.Y(), 6);
83 
84  mrk->SetMarkerColor(3);
85  mrk->Draw("SAME");
86  }
87  }
88 
89  cout << endl;
90  c->Update();
91  c->Modified();
92  }
93 
94 }
TFile * file
Double_t GetHalfLength()
Definition: PndSttTube.cxx:99
exit(0)
TGeoManager * geoMan
TGeoManager * gGeoManager
TArrayI GetNeighborings()
Definition: PndSttTube.cxx:137
TVector3 GetPosition()
Definition: PndSttTube.cxx:87
TClonesArray * FillTubeArray()
bool IsParallel()
Definition: PndSttTube.h:66
TVector3 GetWireDirection()
Definition: PndSttTube.cxx:107
gSystem Load ( "libSttMvdTracking"  )
gROOT LoadMacro ( "$VMCWORKDIR/gconfig/rootlogon.C )
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()
treereco SetBranchAddress ( "SttMvdTrack"  ,
prefit 
)
treereco SetBranchAddress ( "SttMvdKalmanTrack"  ,
kalfit 
)
timer Start ( )

Variable Documentation

TH1F* hkalmom = new TH1F("hkalmom", "genfit", 100, 0.5, 1.5)

Definition at line 17 of file checkmomentum.C.

TH1F* hpremom = new TH1F("hpremom", "prefit", 100, 0.5, 1.5)

Definition at line 18 of file checkmomentum.C.

TClonesArray* kalfit = new TClonesArray("PndTrack")

Definition at line 14 of file checkmomentum.C.

TClonesArray* prefit = new TClonesArray("PndTrack")

Definition at line 12 of file checkmomentum.C.

Int_t refIndex = kaltrk->GetRefIndex()
TStopwatch timer
Initial value:
{
gROOT->Reset()

Definition at line 1 of file checkmomentum.C.

TTree* treereco = (TTree*) filereco.Get("pndsim")

Definition at line 11 of file checkmomentum.C.