FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
PndMvdAllDataEventAna Class Reference

#include <PndMvdAllDataEventAna.h>

Inheritance diagram for PndMvdAllDataEventAna:
PndMvdEventAna

Public Member Functions

 PndMvdAllDataEventAna ()
 
 PndMvdAllDataEventAna (TString fileName)
 
virtual ~PndMvdAllDataEventAna ()
 
virtual void Init (TString filename)
 
virtual void InitBranch ()
 
virtual void InitHistos ()
 
virtual void AnaHits ()
 
virtual void BeginOfEventAction ()
 
virtual void EndOfEventAction ()
 
virtual void ClearHistos ()
 
void PrintHitArray ()
 
void PrintDigiArray ()
 
void PrintClusterArray ()
 
void PrintRecoArray ()
 
void FillHitHistos ()
 
void FillDigiHistos ()
 
void FillClusterHistos ()
 
void FillRecoHistos ()
 
void FillHitPerClusterHistos ()
 
void FillHitResolutionHistos ()
 
void Fill3DHisto ()
 
void FillHitProjHistos ()
 
void DrawHitHisto (TString detName, TCanvas *extCan=0, Int_t pad=0)
 
void DrawDigiHisto (TString detName, TCanvas *extCan=0, Int_t pad=0)
 
void DrawClusterHisto (TString detName, TCanvas *extCan=0, Int_t pad=0)
 
void DrawRecoHisto (TString detName, TCanvas *extCan=0, Int_t pad=0)
 
void DrawAllHistos (TString detName, TCanvas *extCan=0)
 
void DrawAllHistos (Int_t i, TCanvas *extCan=0)
 
void Draw3D (TString opt="", TCanvas *extCan=0, Int_t pad=0)
 
void DrawAllTracks (TCanvas *extCan=0, Int_t pad=0)
 
void DrawHitTracks (TCanvas *extCan=0, Int_t pad=0)
 
void DrawEvent (bool tracks=false, TCanvas *extCan=0)
 
void DrawTopVolume (TCanvas *extCan=0, Int_t pad=0, const char *opt="")
 
void DrawHisxy (TCanvas *extCan=0, Int_t pad=0)
 
void DrawHisrz (TCanvas *extCan=0, Int_t pad=0)
 
void DrawHistoVec (std::vector< TH1 * > *vec, TCanvas *extCan=0, Int_t pad=0) const
 
void DrawHisto (TH1 *histo, TCanvas *extCan=0, Int_t pad=0) const
 
void DrawHitPerCluster (TCanvas *extCan=0, Int_t pad=0)
 
void DrawResolution (TCanvas *extCan=0, Int_t pad=0)
 
void Create3DGeoHits ()
 
void ClearHistoMaps (std::map< TString, TH1 * > *myHistos) const
 
void ClearAllHMaps ()
 
void ClearHistoVector (std::vector< TH1 * > *myVectors) const
 
void ClearAllVectors ()
 
TVector3 GetLocalHitPoints (TString detName, TVector3 input)
 
std::vector< Int_t > GetHitPerCluster (PndSdsCluster *clusterCand)
 
std::vector< TStringGetModulesHit ()
 
TVector3 CalcMeanHitPos (std::vector< Int_t > points)
 
void InitCanvas ()
 
void AnaEvents (Int_t count)
 
void AnaEventNr (Int_t Nr)
 
void NextEvent ()
 
void DrawHistos ()
 
void DrawHisto (TString path, TString opt="")
 
void SetCanvasColumns (Int_t col)
 
void SetDrawOption (TString histoName, TString option)
 
void SetSelection (TString sel)
 
void FillVector ()
 
void DrawVector (Int_t index, TString opt)
 
Int_t GetEventNr () const
 
TString GetSelection () const
 
TH1 * GetHisto (TString histoName)
 
TH1 * GetHisto (Int_t i)
 
virtual void AnaHitNr (Int_t i)
 

Protected Member Functions

 ClassDef (PndMvdEventAna, 1)
 

Protected Attributes

TClonesArray * fDigiArray
 
TClonesArray * fClusterArray
 
TClonesArray * fRecoArray
 
TClonesArray * fGeoTrackArray
 
TClonesArray * fTrackFArray
 
Int_t fActiveEvent
 
Int_t fAnaEvents
 
TFile * fFile
 
TTree * fTree
 
TClonesArray * fHitArray
 
TString fClassName
 
TString fBranchName
 
TString fSelection
 
TCanvas * fCan
 
std::map< TString, TH1 * > fHistos
 
std::map< TString, TStringfDrawOption
 
std::vector< TH1 * > fHistoVector
 
Int_t fCancol
 
PndGeoHandlingfGeoH
 

Private Member Functions

 ClassDef (PndMvdAllDataEventAna, 1)
 

Private Attributes

std::map< TString, TH1 * > fDigiHistos
 
std::map< TString, TH1 * > fClusterHistos
 
std::map< TString, TH1 * > fRecoHistos
 
std::map< TString, TH1 * > fHitPerClusterHistos
 
std::map< TString, TH1 * > fHitResolutionHistos
 
std::vector< TH1 * > fHitHistoVec
 
std::vector< TH1 * > fDigiHistoVec
 
std::vector< TH1 * > fClusterHistoVec
 
std::vector< TH1 * > fRecoHistoVec
 
TGeoVolume * fMvdTopVolume
 
TGeoVolume * fRecoTopVolume
 
TGeoVolume * fRecoVolume
 
TH1 * fRecoErrorHisto
 
TH1 * fAllHitPerClusterHistos
 
TH1 * fAllHitResolutionHistos
 
TH3D * f3DMCHisto
 
TH3D * f3DRecoHisto
 
std::vector< TH1 * > fSimHisxy
 
std::vector< TH1 * > fSimHisrz
 
std::vector< TH1 * > fRecoHisxy
 
std::vector< TH1 * > fRecoHisrz
 
TCanvas * fCan1
 
TCanvas * fCan2
 
PndSdsCalcFePixelfPixelCon
 
PndEventDisplayfGeoList
 

Detailed Description

PndMvdAllDataEventAna.h

Author
t.stockmanns t.sto.nosp@m.ckma.nosp@m.nns@f.nosp@m.z-ju.nosp@m.elich.nosp@m..de Analysis class which loads in a complete simulation chain

Definition at line 39 of file PndMvdAllDataEventAna.h.

Constructor & Destructor Documentation

PndMvdAllDataEventAna::PndMvdAllDataEventAna ( )
inline

Definition at line 41 of file PndMvdAllDataEventAna.h.

41 {};
PndMvdAllDataEventAna::PndMvdAllDataEventAna ( TString  fileName)

Definition at line 17 of file PndMvdAllDataEventAna.cxx.

References PndEventDisplay::AddNewGroup(), PndMvdEventAna::fGeoH, fGeoList, fMvdTopVolume, fPixelCon, fRecoVolume, gGeoManager, Init(), PndGeoHandling::Instance(), and PndMvdEventAna::SetCanvasColumns().

17  :PndMvdEventAna(fileName)
18 {
19  Init(fileName);
21 
22 
24 
25  fRecoVolume = gGeoManager->MakeSphere("RecoHit",gGeoManager->GetMedium("vacuum"),0,0.1);
26  fRecoVolume->SetLineColor(kRed);
27 
28  TGeoVolume* mcHit = gGeoManager->MakeSphere("MCHit",gGeoManager->GetMedium("vacuum"),0,0.1);
29  mcHit->SetLineColor(kGreen);
30 
31  TGeoShape* stripShape = gGeoManager->GetVolume("StripSensor")->GetShape();
32  TGeoVolume* stripVol = new TGeoVolume("StripSensorRed",stripShape, gGeoManager->GetMedium("vacuum"));
33  stripVol->SetLineColor(kRed);
34  gGeoManager->AddVolume(stripVol);
35  stripVol = gGeoManager->GetVolume("StripSensorRed");
36 
37  TGeoShape* pixShape1 = gGeoManager->GetVolume("SensorActiveAreao[NrFE=8ooE]")->GetShape();
38  TGeoVolume* pixVol1 = new TGeoVolume("PixelSensor8",pixShape1, gGeoManager->GetMedium("vacuum"));
39  pixVol1->SetLineColor(kRed);
40  gGeoManager->AddVolume(pixVol1);
41  pixVol1 = gGeoManager->GetVolume("PixelSensor8");
42 
43  TGeoShape* pixShape2 = gGeoManager->GetVolume("SensorActiveAreao[NrFE=4]")->GetShape();
44  TGeoVolume* pixVol2 = new TGeoVolume("PixelSensor4",pixShape2, gGeoManager->GetMedium("vacuum"));
45  pixVol2->SetLineColor(kRed);
46  gGeoManager->AddVolume(pixVol2);
47  pixVol2 = gGeoManager->GetVolume("PixelSensor4");
48 
49  TGeoShape* pixShape3 = gGeoManager->GetVolume("SensorActiveAreao[NrFE=5]")->GetShape();
50  TGeoVolume* pixVol3 = new TGeoVolume("PixelSensor5",pixShape3, gGeoManager->GetMedium("vacuum"));
51  pixVol3->SetLineColor(kRed);
52  gGeoManager->AddVolume(pixVol3);
53  pixVol3 = gGeoManager->GetVolume("PixelSensor5");
54 
55  TGeoVolume* stripVolG = new TGeoVolume("StripSensorGreen",stripShape, gGeoManager->GetMedium("vacuum"));
56  stripVolG->SetLineColor(kGreen);
57  gGeoManager->AddVolume(stripVolG);
58  stripVolG = gGeoManager->GetVolume("StripSensorGreen");
59 
60  TGeoVolume* pixVolG1 = new TGeoVolume("PixelSensor8Green",pixShape1, gGeoManager->GetMedium("vacuum"));
61  pixVolG1->SetLineColor(kGreen);
62  gGeoManager->AddVolume(pixVolG1);
63  pixVolG1 = gGeoManager->GetVolume("PixelSensor8Green");
64 
65  TGeoVolume* pixVolG2 = new TGeoVolume("PixelSensor4Green",pixShape2, gGeoManager->GetMedium("vacuum"));
66  pixVolG2->SetLineColor(kGreen);
67  gGeoManager->AddVolume(pixVolG2);
68  pixVolG2 = gGeoManager->GetVolume("PixelSensor4Green");
69 
70  TGeoVolume* pixVolG3 = new TGeoVolume("PixelSensor5Green",pixShape3, gGeoManager->GetMedium("vacuum"));
71  pixVolG3->SetLineColor(kGreen);
72  gGeoManager->AddVolume(pixVolG3);
73  pixVolG3 = gGeoManager->GetVolume("PixelSensor5Green");
74 
75  fMvdTopVolume = gGeoManager->GetVolume("MVDoOption1");
76  fGeoList = new PndEventDisplay();
77 
78  fGeoList->AddNewGroup("RecoHits",new PndGeoHitList("RecoHits","MVDoOption1", fRecoVolume));
79  fGeoList->AddNewGroup("MCHits",new PndGeoHitList("MCHits","MVDoOption1", mcHit));
80  fGeoList->AddNewGroup("StripHits", new PndGeoHitList("StripHits","MVDoOption1",stripVol));
81  fGeoList->AddNewGroup("PixHits8", new PndGeoHitList("PixHits8","MVDoOption1",pixVol1));
82  fGeoList->AddNewGroup("PixHits4", new PndGeoHitList("PixHits4","MVDoOption1",pixVol2));
83  fGeoList->AddNewGroup("PixHits5", new PndGeoHitList("PixHits5","MVDoOption1",pixVol3));
84  fGeoList->AddNewGroup("StripHitsGreen", new PndGeoHitList("StripHitsGreen","MVDoOption1",stripVolG));
85  fGeoList->AddNewGroup("PixHits8Green", new PndGeoHitList("PixHits8Green","MVDoOption1",pixVolG1));
86  fGeoList->AddNewGroup("PixHits4Green", new PndGeoHitList("PixHits4Green","MVDoOption1",pixVolG2));
87  fGeoList->AddNewGroup("PixHits5Green", new PndGeoHitList("PixHits5Green","MVDoOption1",pixVolG3));
88 
89  fPixelCon = new PndSdsCalcFePixel(76,84,10);
90 }
PndSdsCalcFePixel * fPixelCon
void SetCanvasColumns(Int_t col)
display of hits inside the gGeoManager
virtual void Init(TString filename)
TGeoManager * gGeoManager
PndGeoHandling * fGeoH
void AddNewGroup(TString groupName, PndGeoHitList *newList)
static PndGeoHandling * Instance()
Class to calculate the position of digis on a front-end from the digis on a sensor.
virtual PndMvdAllDataEventAna::~PndMvdAllDataEventAna ( )
inlinevirtual

Definition at line 43 of file PndMvdAllDataEventAna.h.

43 {};

Member Function Documentation

void PndMvdEventAna::AnaEventNr ( Int_t  Nr)
inherited

Definition at line 28 of file PndMvdEventAna.cxx.

References PndMvdEventAna::AnaHits(), PndMvdEventAna::BeginOfEventAction(), PndMvdEventAna::ClearHistos(), PndMvdEventAna::EndOfEventAction(), PndMvdEventAna::fActiveEvent, PndMvdEventAna::fAnaEvents, PndMvdEventAna::fTree, PndMvdEventAna::InitHistos(), and vecs.

Referenced by PndMvdEventAna::NextEvent().

29 {
30  TVector3 vecs;
32 
33  fAnaEvents = 1;
34  InitHistos();
35  ClearHistos();
36  if (Nr > fTree->GetEntriesFast())
37  return;
38 
39  fActiveEvent = Nr;
40  AnaHits();
42  //InitCanvas();
43  //DrawHistos();
44 }
virtual void ClearHistos()
TVector3 vecs
virtual void BeginOfEventAction()
virtual void InitHistos()=0
virtual void EndOfEventAction()
virtual void AnaHits()
void PndMvdEventAna::AnaEvents ( Int_t  count)
inherited

Definition at line 79 of file PndMvdEventAna.cxx.

References PndMvdEventAna::AnaHits(), count, PndMvdEventAna::fActiveEvent, PndMvdEventAna::fAnaEvents, PndMvdEventAna::fTree, i, and PndMvdEventAna::InitHistos().

80 {
81  fAnaEvents = count;
82  InitHistos();
83  if (count > fTree->GetEntriesFast())
84  count = fTree->GetEntriesFast();
85  for (Int_t i = 0; i < count; i++)
86  {
87  fActiveEvent = i;
88  AnaHits();
89  }
90  //InitCanvas();
91  //DrawHistos();
92 }
Int_t i
Definition: run_full.C:25
virtual void InitHistos()=0
int count
virtual void AnaHits()
virtual void PndMvdEventAna::AnaHitNr ( Int_t  i)
inlinevirtualinherited

Reimplemented in PndMvdDigiEventAna, and PndMvdMCEventAna.

Definition at line 59 of file PndMvdEventAna.h.

Referenced by PndMvdEventAna::AnaHits().

59 {};
void PndMvdAllDataEventAna::AnaHits ( )
virtual

Reimplemented from PndMvdEventAna.

Definition at line 149 of file PndMvdAllDataEventAna.cxx.

References Create3DGeoHits(), PndMvdEventAna::fActiveEvent, fClusterArray, fDigiArray, PndMvdEventAna::fHitArray, Fill3DHisto(), FillClusterHistos(), FillDigiHistos(), FillHitHistos(), FillHitPerClusterHistos(), FillHitProjHistos(), FillHitResolutionHistos(), FillRecoHistos(), fRecoArray, PndMvdEventAna::fTree, PrintClusterArray(), PrintDigiArray(), PrintHitArray(), and PrintRecoArray().

150 {
151  fHitArray->Delete();
152  fDigiArray->Delete();
153  fClusterArray->Delete();
154  fRecoArray->Delete();
155 
156  fTree->GetEntry(fActiveEvent);
157 
158  std::cout << "hitArray: " << fHitArray->GetEntries() << std::endl;
159  std::cout << "digiArray: " << fDigiArray->GetEntries() << std::endl;
160  std::cout << "clusterArray: " << fClusterArray->GetEntries() << std::endl;
161  std::cout << "recoArray: " << fRecoArray->GetEntries() << std::endl;
162 
163  PrintHitArray();
164  PrintDigiArray();
166  PrintRecoArray();
167 
168  FillHitHistos();
169  FillDigiHistos();
171  FillRecoHistos();
174  Fill3DHisto();
176 
177  Create3DGeoHits();
178 }
TClonesArray * fHitArray
virtual void PndMvdAllDataEventAna::BeginOfEventAction ( )
inlinevirtual

Reimplemented from PndMvdEventAna.

Definition at line 49 of file PndMvdAllDataEventAna.h.

References ClearAllVectors().

49  {
51  };
TVector3 PndMvdAllDataEventAna::CalcMeanHitPos ( std::vector< Int_t >  points)

Definition at line 426 of file PndMvdAllDataEventAna.cxx.

References Double_t, energy, PndMvdEventAna::fHitArray, PndSdsMCPoint::GetPosition(), PndSdsMCPoint::GetPositionOut(), and i.

Referenced by FillHitResolutionHistos().

427 {
428  TVector3 result;
429  Double_t energy = 0;
430  for (UInt_t i = 0; i < points.size(); i++){
431  PndSdsMCPoint *myPoint = (PndSdsMCPoint*)fHitArray->At(points[i]);
432  TVector3 posIn = myPoint->GetPosition();
433  std::cout << "posIn: " << posIn.X() << " " << posIn.Y() << " " << posIn.Z() << std::endl;
434  TVector3 posOut = myPoint->GetPositionOut();
435  std::cout << "posOut: " << posOut.X() << " " << posOut.Y() << " " << posOut.Z() << std::endl;
436 
437  TVector3 posHit = posIn + posOut;
438  posHit *= 0.5;
439 
440  std::cout << "posHit: " << posHit.X() << " " << posHit.Y() << " " << posHit.Z() << std::endl;
441  //posHit *= myPoint->GetEnergyLoss();
442  energy += myPoint->GetEnergyLoss();
443  result += posHit;
444  }
445  //Double_t div = 1/energy;
446  Double_t div = 1/(Double_t)points.size();
447  result *= div;
448  return result;
449 }
Int_t i
Definition: run_full.C:25
TVector3 GetPositionOut() const
Definition: PndSdsMCPoint.h:91
Double_t
TClonesArray * fHitArray
TVector3 GetPosition() const
Definition: PndSdsMCPoint.h:90
Double_t energy
Definition: plot_dirc.C:15
PndMvdEventAna::ClassDef ( PndMvdEventAna  ,
 
)
protectedinherited
PndMvdAllDataEventAna::ClassDef ( PndMvdAllDataEventAna  ,
 
)
private
void PndMvdAllDataEventAna::ClearAllHMaps ( )

Definition at line 691 of file PndMvdAllDataEventAna.cxx.

References ClearHistoMaps(), fClusterHistos, fDigiHistos, PndMvdEventAna::fHistos, fHitPerClusterHistos, fHitResolutionHistos, and fRecoHistos.

Referenced by ClearHistos().

692 {
699 }
std::map< TString, TH1 * > fRecoHistos
std::map< TString, TH1 * > fClusterHistos
std::map< TString, TH1 * > fHistos
std::map< TString, TH1 * > fHitPerClusterHistos
std::map< TString, TH1 * > fHitResolutionHistos
std::map< TString, TH1 * > fDigiHistos
void ClearHistoMaps(std::map< TString, TH1 * > *myHistos) const
void PndMvdAllDataEventAna::ClearAllVectors ( )

Definition at line 701 of file PndMvdAllDataEventAna.cxx.

References ClearHistoVector(), fClusterHistoVec, fDigiHistoVec, fHitHistoVec, and fRecoHistoVec.

Referenced by BeginOfEventAction(), and ClearHistos().

702 {
707 }
std::vector< TH1 * > fDigiHistoVec
void ClearHistoVector(std::vector< TH1 * > *myVectors) const
std::vector< TH1 * > fClusterHistoVec
std::vector< TH1 * > fRecoHistoVec
std::vector< TH1 * > fHitHistoVec
void PndMvdAllDataEventAna::ClearHistoMaps ( std::map< TString, TH1 * > *  myHistos) const

Definition at line 681 of file PndMvdAllDataEventAna.cxx.

Referenced by ClearAllHMaps().

682 {
683  for (std::map<TString,TH1*>::const_iterator ki = myMaps->begin(); ki != myMaps->end(); ki++){
684  ki->second->Delete();
685  (*myMaps)[ki->first] = 0;
686  }
687  myMaps->clear();
688  std::cout << " Maps.size: " << myMaps->size() << std::endl;
689 }
void PndMvdAllDataEventAna::ClearHistos ( )
virtual

Reimplemented from PndMvdEventAna.

Definition at line 132 of file PndMvdAllDataEventAna.cxx.

References ClearAllHMaps(), ClearAllVectors(), PndEventDisplay::ClearHits(), and fGeoList.

133 {
134  ClearAllHMaps();
135  ClearAllVectors();
136 
137  fGeoList->ClearHits("RecoHits");
138  fGeoList->ClearHits("MCHits");
139  fGeoList->ClearHits("StripHits");
140  fGeoList->ClearHits("PixHits4");
141  fGeoList->ClearHits("PixHits5");
142  fGeoList->ClearHits("PixHits8");
143  fGeoList->ClearHits("StripHitsGreen");
144  fGeoList->ClearHits("PixHits4Green");
145  fGeoList->ClearHits("PixHits5Green");
146  fGeoList->ClearHits("PixHits8Green");
147 }
void ClearHits(TString groupName)
void PndMvdAllDataEventAna::ClearHistoVector ( std::vector< TH1 * > *  myVectors) const

Definition at line 708 of file PndMvdAllDataEventAna.cxx.

References i.

Referenced by ClearAllVectors(), and FillHitProjHistos().

709 {
710  for (UInt_t i = 0; i < myVectors->size(); i++)
711  {
712  delete ((*myVectors)[i]);
713  }
714  myVectors->clear();
715 }
Int_t i
Definition: run_full.C:25
void PndMvdAllDataEventAna::Create3DGeoHits ( )

Definition at line 652 of file PndMvdAllDataEventAna.cxx.

References PndEventDisplay::AddHit(), PndMvdEventAna::fGeoH, fGeoList, PndMvdEventAna::fHitArray, fRecoArray, PndGeoHandling::GetPath(), gGeoManager, i, and PndEventDisplay::SetHits().

Referenced by AnaHits(), and EndOfEventAction().

653 {
654  fGeoList->SetHits("RecoHits",fRecoArray);
655 
656  for (Int_t i = 0; i < fHitArray->GetEntriesFast(); i++){
657  PndSdsMCPoint* myPoint = (PndSdsMCPoint*)fHitArray->At(i);
658  fGeoList->AddHit("MCHits", myPoint->GetX(), myPoint->GetY(), myPoint->GetZ());
659  std::cout << "gGeoManager cd: " << myPoint->GetDetName() << " " << gGeoManager->cd(fGeoH->GetPath(myPoint->GetDetName())) << std::endl;
660  TGeoHMatrix* mat = gGeoManager->GetCurrentMatrix();
661  mat->Print();
662  if (myPoint->GetDetName().Contains("71")){
663  std::cout << "StripHits added!" << std::endl;
664  fGeoList->AddHit("StripHits", mat);
665  fGeoList->AddHit("StripHitsGreen", mat, kFALSE);
666  }
667  else if (myPoint->GetDetName().Contains("89")){
668  std::cout << "PixHits4 added!" << std::endl;
669  fGeoList->AddHit("PixHits4", mat);
670  fGeoList->AddHit("PixHits4Green", mat, kFALSE);
671  }
672  else if (myPoint->GetDetName().Contains("56")){
673  std::cout << "PixHits8 added!" << std::endl;
674  fGeoList->AddHit("PixHits8", mat);
675  fGeoList->AddHit("PixHits8Green", mat, kFALSE);
676  }
677  }
678 }
void AddHit(TString groupName, FairHit *hit, Bool_t vis=kTRUE)
Int_t i
Definition: run_full.C:25
TGeoManager * gGeoManager
TString GetPath(Int_t shortID)
for a given shortID the path is returned
PndGeoHandling * fGeoH
TClonesArray * fHitArray
void SetHits(TString groupName, TClonesArray *hits, Bool_t vis=kTRUE)
void PndMvdAllDataEventAna::Draw3D ( TString  opt = "",
TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 517 of file PndMvdAllDataEventAna.cxx.

References f3DMCHisto, and f3DRecoHisto.

518 {
519  if (extCan == 0)
520  extCan = new TCanvas();
521  extCan->cd(pad);
522  f3DMCHisto->SetMarkerStyle(8);
523  f3DMCHisto->SetMarkerSize(0.5);
524  f3DMCHisto->SetMarkerColor(2);
525  f3DMCHisto->Draw(opt.Data());
526  f3DRecoHisto->SetMarkerStyle(8);
527  f3DRecoHisto->SetMarkerSize(0.5);
528  f3DRecoHisto->SetMarkerColor(1);
529  f3DRecoHisto->Draw("same");
530 
531 }
void PndMvdAllDataEventAna::DrawAllHistos ( TString  detName,
TCanvas *  extCan = 0 
)

Definition at line 485 of file PndMvdAllDataEventAna.cxx.

References DrawClusterHisto(), DrawDigiHisto(), DrawHitHisto(), DrawRecoHisto(), fCan1, fHitPerClusterHistos, and fHitResolutionHistos.

Referenced by DrawAllHistos().

486 {
487  if (extCan)
488  fCan1 = extCan;
489  if (fCan1 == 0)
490  fCan1 = new TCanvas();
491  DrawHitHisto(detName, fCan1, 1);
492  DrawDigiHisto(detName, fCan1, 2);
493  DrawClusterHisto(detName, fCan1, 3);
494  DrawRecoHisto(detName, fCan1, 4);
495  fCan1->cd(5);
496  fHitPerClusterHistos[detName]->Draw();
497  fCan1->cd(6);
498  fHitResolutionHistos[detName]->Draw();
499  fCan1->Modified(kTRUE);
500  fCan1->Update();
501 }
void DrawRecoHisto(TString detName, TCanvas *extCan=0, Int_t pad=0)
void DrawHitHisto(TString detName, TCanvas *extCan=0, Int_t pad=0)
void DrawDigiHisto(TString detName, TCanvas *extCan=0, Int_t pad=0)
std::map< TString, TH1 * > fHitPerClusterHistos
void DrawClusterHisto(TString detName, TCanvas *extCan=0, Int_t pad=0)
std::map< TString, TH1 * > fHitResolutionHistos
void PndMvdAllDataEventAna::DrawAllHistos ( Int_t  i,
TCanvas *  extCan = 0 
)

Definition at line 503 of file PndMvdAllDataEventAna.cxx.

References DrawAllHistos(), PndMvdEventAna::fHistos, i, and TString.

504 {
505  std::map<TString,TH1*>::const_iterator ki;
506  Int_t histoSize = fHistos.size();
507 
508  if (index >= histoSize) return;
509  ki = fHistos.begin();
510  for (Int_t i = 0; i < index; i++)
511  ki++;
512  TString detName = ki->first;
513  std::cout << "DetName: " << detName.Data() << std::endl;
514  DrawAllHistos(detName, extCan);
515 }
Int_t i
Definition: run_full.C:25
std::map< TString, TH1 * > fHistos
void DrawAllHistos(TString detName, TCanvas *extCan=0)
void PndMvdAllDataEventAna::DrawAllTracks ( TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 533 of file PndMvdAllDataEventAna.cxx.

References fGeoTrackArray, and i.

534 {
535  if (extCan == 0)
536  extCan = new TCanvas();
537  extCan->cd(pad);
538 
539  for (Int_t i = 0; i < fGeoTrackArray->GetEntries(); i++){
540  TGeoTrack* myTrack = (TGeoTrack*) fGeoTrackArray->At(i);
541  myTrack->Print();
542  myTrack->Draw();
543  }
544 }
Int_t i
Definition: run_full.C:25
void PndMvdAllDataEventAna::DrawClusterHisto ( TString  detName,
TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 468 of file PndMvdAllDataEventAna.cxx.

References fClusterHistos.

Referenced by DrawAllHistos().

469 {
470  if (extCan)
471  extCan->cd(pad);
472 
473  if(fClusterHistos[detName] != 0)
474  fClusterHistos[detName]->Draw("colz");
475 }
std::map< TString, TH1 * > fClusterHistos
void PndMvdAllDataEventAna::DrawDigiHisto ( TString  detName,
TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 460 of file PndMvdAllDataEventAna.cxx.

References fDigiHistos.

Referenced by DrawAllHistos().

461 {
462  if (extCan)
463  extCan->cd(pad);
464 
465  if(fDigiHistos[detName] != 0)
466  fDigiHistos[detName]->Draw("colz");
467 }
std::map< TString, TH1 * > fDigiHistos
void PndMvdAllDataEventAna::DrawEvent ( bool  tracks = false,
TCanvas *  extCan = 0 
)

Definition at line 604 of file PndMvdAllDataEventAna.cxx.

References DrawHistoVec(), DrawHitTracks(), DrawTopVolume(), fAllHitResolutionHistos, fCan2, fRecoHisrz, and fRecoHisxy.

605 {
606  if (extCan)
607  fCan2 = extCan;
608  if (fCan2 == 0)
609  fCan2 = new TCanvas();
610 
611  fCan2->Divide(2,2);
612 
613  fCan2->cd(1);
614  DrawTopVolume();
615 
616  if (tracks)
617  DrawHitTracks();
618 
619  fCan2->cd(2);
620  fAllHitResolutionHistos->Draw();
621 
622  fCan2->cd(3);
624 
625  fCan2->cd(4);
627 }
void DrawHitTracks(TCanvas *extCan=0, Int_t pad=0)
void DrawHistoVec(std::vector< TH1 * > *vec, TCanvas *extCan=0, Int_t pad=0) const
std::vector< TH1 * > fRecoHisrz
std::vector< TH1 * > fRecoHisxy
void DrawTopVolume(TCanvas *extCan=0, Int_t pad=0, const char *opt="")
void PndMvdAllDataEventAna::DrawHisrz ( TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 577 of file PndMvdAllDataEventAna.cxx.

References DrawHistoVec(), and fRecoHisxy.

578 {
579  DrawHistoVec(&fRecoHisxy, extCan, pad);
580 }
void DrawHistoVec(std::vector< TH1 * > *vec, TCanvas *extCan=0, Int_t pad=0) const
std::vector< TH1 * > fRecoHisxy
void PndMvdEventAna::DrawHisto ( TString  path,
TString  opt = "" 
)
inherited

Definition at line 74 of file PndMvdEventAna.cxx.

References PndMvdEventAna::fHistos.

75 {
76  fHistos[path]->Draw(opt.Data());
77 }
std::map< TString, TH1 * > fHistos
void PndMvdAllDataEventAna::DrawHisto ( TH1 *  histo,
TCanvas *  extCan = 0,
Int_t  pad = 0 
) const

Definition at line 597 of file PndMvdAllDataEventAna.cxx.

Referenced by DrawHitPerCluster(), and DrawResolution().

598 {
599  if (extCan)
600  extCan->cd(pad);
601  histo->Draw();
602 }
void PndMvdEventAna::DrawHistos ( )
inherited

Definition at line 63 of file PndMvdEventAna.cxx.

References PndMvdEventAna::fCan, PndMvdEventAna::fHistos, and i.

64 {
65  Int_t i = 0;
66  for (std::map<TString, TH1*>::const_iterator ki = fHistos.begin(); ki != fHistos.end(); ki++){
67  i++;
68  fCan->cd(i);
69  std::cout << ki->second << std::endl;
70  ki->second->Draw();//(fDrawOption[ci->second->GetName()]);
71  }
72 }
Int_t i
Definition: run_full.C:25
TCanvas * fCan
std::map< TString, TH1 * > fHistos
void PndMvdAllDataEventAna::DrawHistoVec ( std::vector< TH1 * > *  vec,
TCanvas *  extCan = 0,
Int_t  pad = 0 
) const

Definition at line 587 of file PndMvdAllDataEventAna.cxx.

References i.

Referenced by DrawEvent(), DrawHisrz(), and DrawHisxy().

588 {
589  if (extCan)
590  extCan->cd(pad);
591  if (vec->size() > 0)
592  (*vec)[0]->Draw();
593  for (UInt_t i = 1; i < vec->size(); i++)
594  (*vec)[i]->Draw("same");
595 }
Int_t i
Definition: run_full.C:25
dble_vec_t vec[12]
Definition: ranlxd.cxx:380
void PndMvdAllDataEventAna::DrawHisxy ( TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 582 of file PndMvdAllDataEventAna.cxx.

References DrawHistoVec(), and fRecoHisrz.

583 {
584  DrawHistoVec(&fRecoHisrz, extCan, pad);
585 }
void DrawHistoVec(std::vector< TH1 * > *vec, TCanvas *extCan=0, Int_t pad=0) const
std::vector< TH1 * > fRecoHisrz
void PndMvdAllDataEventAna::DrawHitHisto ( TString  detName,
TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 451 of file PndMvdAllDataEventAna.cxx.

References PndMvdEventAna::fHistos.

Referenced by DrawAllHistos().

452 {
453  if (extCan)
454  extCan->cd(pad);
455 
456  if (fHistos[detName] != 0)
457  fHistos[detName]->Draw();
458 }
std::map< TString, TH1 * > fHistos
void PndMvdAllDataEventAna::DrawHitPerCluster ( TCanvas *  extCan = 0,
Int_t  pad = 0 
)
inline

Definition at line 84 of file PndMvdAllDataEventAna.h.

References DrawHisto(), and fAllHitPerClusterHistos.

84 {DrawHisto(fAllHitPerClusterHistos, extCan, pad);};
void DrawHisto(TH1 *histo, TCanvas *extCan=0, Int_t pad=0) const
void PndMvdAllDataEventAna::DrawHitTracks ( TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 546 of file PndMvdAllDataEventAna.cxx.

References fGeoTrackArray, PndMvdEventAna::fHitArray, and i.

Referenced by DrawEvent().

547 {
548  if (extCan == 0)
549  extCan = new TCanvas();
550  extCan->cd(pad);
551 
552  std::map<Int_t, Int_t> trackUsed;
553  for (Int_t i = 0; i < fHitArray->GetEntries(); i++){
554  PndSdsMCPoint* myPoint = (PndSdsMCPoint*)fHitArray->At(i);
555  std::cout << "Hit " << i << " TrackID " << myPoint->GetTrackID() << std::endl;
556  if (trackUsed[myPoint->GetTrackID()] == 0){
557  for (Int_t j = 0; j < fGeoTrackArray->GetEntries(); j++){
558  TGeoTrack* myTrack = (TGeoTrack*)fGeoTrackArray->At(j);
559  if (myPoint->GetTrackID() == myTrack->GetId()){
560  myTrack->Draw();
561  myTrack->Print();
562  }
563  }
564  trackUsed[myPoint->GetTrackID()] = 1;
565  }
566  }
567 }
Int_t i
Definition: run_full.C:25
TClonesArray * fHitArray
void PndMvdAllDataEventAna::DrawRecoHisto ( TString  detName,
TCanvas *  extCan = 0,
Int_t  pad = 0 
)

Definition at line 476 of file PndMvdAllDataEventAna.cxx.

References fRecoHistos.

Referenced by DrawAllHistos().

477 {
478  if (extCan)
479  extCan->cd(pad);
480 
481  if (fRecoHistos[detName] != 0)
482  fRecoHistos[detName]->Draw();
483 }
std::map< TString, TH1 * > fRecoHistos
void PndMvdAllDataEventAna::DrawResolution ( TCanvas *  extCan = 0,
Int_t  pad = 0 
)
inline

Definition at line 85 of file PndMvdAllDataEventAna.h.

References DrawHisto(), and fAllHitResolutionHistos.

85 {DrawHisto(fAllHitResolutionHistos, extCan, pad);};
void DrawHisto(TH1 *histo, TCanvas *extCan=0, Int_t pad=0) const
void PndMvdAllDataEventAna::DrawTopVolume ( TCanvas *  extCan = 0,
Int_t  pad = 0,
const char *  opt = "" 
)

Definition at line 569 of file PndMvdAllDataEventAna.cxx.

References fMvdTopVolume.

Referenced by DrawEvent().

570 {
571  if (extCan)
572  extCan->cd(pad);
573 // fMvdTopVolume->Draw(""); //ogl for OpenGL Viewer
574  fMvdTopVolume->Draw(opt);
575 }
void PndMvdEventAna::DrawVector ( Int_t  index,
TString  opt 
)
inherited

Definition at line 110 of file PndMvdEventAna.cxx.

References PndMvdEventAna::fHistoVector.

111 {
112  fHistoVector[index]->Draw(opt.Data());
113 }
std::vector< TH1 * > fHistoVector
virtual void PndMvdAllDataEventAna::EndOfEventAction ( )
inlinevirtual

Reimplemented from PndMvdEventAna.

Definition at line 52 of file PndMvdAllDataEventAna.h.

References Create3DGeoHits().

void PndMvdAllDataEventAna::Fill3DHisto ( )

Definition at line 383 of file PndMvdAllDataEventAna.cxx.

References f3DMCHisto, f3DRecoHisto, PndMvdEventAna::fHitArray, fRecoArray, and i.

Referenced by AnaHits().

384 {
385  for (Int_t i = 0; i < fRecoArray->GetEntries(); i++){
386  PndSdsHit* myHit = (PndSdsHit*)fRecoArray->At(i);
387  f3DRecoHisto->Fill(myHit->GetX(), myHit->GetY(), myHit->GetZ());
388  }
389  for (Int_t j = 0; j < fHitArray->GetEntries(); j++){
390  PndSdsMCPoint* myPoint = (PndSdsMCPoint*)fHitArray->At(j);
391  f3DMCHisto->Fill(myPoint->GetX(), myPoint->GetY(), myPoint->GetZ());
392  }
393 
394 }
Int_t i
Definition: run_full.C:25
TClonesArray * fHitArray
void PndMvdAllDataEventAna::FillClusterHistos ( )

Definition at line 292 of file PndMvdAllDataEventAna.cxx.

References fClusterArray, fClusterHistos, fDigiArray, fPixelCon, PndSdsDigi::GetCharge(), PndSdsCluster::GetClusterList(), PndSdsDigi::GetFE(), PndSdsDigiPixel::GetPixelColumn(), PndSdsDigiPixel::GetPixelRow(), PndSdsDigi::GetSensorID(), hit, and i.

Referenced by AnaHits().

293 {
294  for (Int_t i = 0; i < fClusterArray->GetEntries(); i++){
295  PndSdsCluster *cluster = (PndSdsCluster*)fClusterArray->At(i);
296  //if (hit->GetDetName().Contains("119_2")){
297  std::vector<Int_t> clusterList = cluster->GetClusterList();
298  PndSdsDigiPixel* hit = (PndSdsDigiPixel*)fDigiArray->At(clusterList[0]);
299  Int_t sensorID = hit->GetSensorID();
300  if (fClusterHistos[sensorID] == 0){
301  fClusterHistos[sensorID] = new TH2I("clusterHisto",detName.Data(), 1000,0,1000,201,0,200);
302  //fDrawOption[hit->GetDetName()] = "colz";
303  }
304  TH2* tempHisto = (TH2*)(fClusterHistos[detName]);
305  for (Int_t j = 0; j < clusterList.size(); j++){
306  hit = (PndSdsDigiPixel*)fDigiArray->At(clusterList[j]);
307  PndSdsPixel myFePixel(sensorID, hit->GetFE(), hit->GetPixelColumn(), hit->GetPixelRow(), hit->GetCharge());
308  PndSdsPixel mySensorPixel = fPixelCon->CalcSensorHit(myFePixel);
309  tempHisto->Fill(mySensorPixel.GetCol(), mySensorPixel.GetRow());
310  }
311  }
312 }
Int_t GetPixelRow() const
std::vector< Int_t > GetClusterList() const
Definition: PndSdsCluster.h:38
Int_t GetSensorID() const
Definition: PndSdsDigi.h:59
PndSdsCalcFePixel * fPixelCon
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
Int_t GetPixelColumn() const
Double_t GetCharge() const
Definition: PndSdsDigi.h:60
Int_t GetFE() const
Definition: PndSdsDigi.h:57
std::map< TString, TH1 * > fClusterHistos
Data class to store the digi output of a pixel module.
PndSdsMCPoint * hit
Definition: anasim.C:70
void PndMvdAllDataEventAna::FillDigiHistos ( )

Definition at line 277 of file PndMvdAllDataEventAna.cxx.

References fDigiArray, fDigiHistos, fPixelCon, PndSdsDigi::GetCharge(), PndSdsDigi::GetFE(), PndSdsDigiPixel::GetPixelColumn(), PndSdsDigiPixel::GetPixelRow(), PndSdsDigi::GetSensorID(), hit, and i.

Referenced by AnaHits().

278 {
279  for (Int_t i = 0; i < fDigiArray->GetEntries(); i++){
281  //if (hit->GetDetName().Contains("119_2")){
282  if (fDigiHistos[hit->GetDetName()] == 0){
283  fDigiHistos[hit->GetDetName()] = new TH2I("digiHisto",hit->GetDetName().Data(), 1000,0,1000,201,0,200);
284  //fDrawOption[hit->GetDetName()] = "colz";
285  }
286  TH2* tempHisto = (TH2*)(fDigiHistos[hit->GetDetName()]);
287  PndSdsPixel myFePixel(hit->GetSensorID(), hit->GetFE(), hit->GetPixelColumn(), hit->GetPixelRow(), hit->GetCharge());
288  PndSdsPixel mySensorPixel = fPixelCon->CalcSensorHit(myFePixel);
289  tempHisto->Fill(mySensorPixel.GetCol(), mySensorPixel.GetRow(),mySensorPixel.GetCharge());//, (Double_t)(hit->GetCharge()));
290  }
291 }
Int_t GetPixelRow() const
Int_t GetSensorID() const
Definition: PndSdsDigi.h:59
PndSdsCalcFePixel * fPixelCon
Int_t i
Definition: run_full.C:25
Int_t GetPixelColumn() const
Double_t GetCharge() const
Definition: PndSdsDigi.h:60
Int_t GetFE() const
Definition: PndSdsDigi.h:57
std::map< TString, TH1 * > fDigiHistos
Data class to store the digi output of a pixel module.
PndSdsMCPoint * hit
Definition: anasim.C:70
void PndMvdAllDataEventAna::FillHitHistos ( )

Definition at line 247 of file PndMvdAllDataEventAna.cxx.

References PndMvdEventAna::fGeoH, PndMvdEventAna::fHistos, PndMvdEventAna::fHitArray, GetLocalHitPoints(), PndGeoHandling::GetPath(), PndSdsMCPoint::GetXOut(), PndSdsMCPoint::GetYOut(), PndSdsMCPoint::GetZOut(), gGeoManager, i, out, and TString.

Referenced by AnaHits().

248 {
249  for (Int_t i = 0; i < fHitArray->GetEntries(); i++){
250  PndSdsMCPoint *myPoint = (PndSdsMCPoint*)fHitArray->At(i);
251  TString detName = myPoint->GetDetName();
252  //if (hit->GetDetName().Contains("119_2")){
253  if (fHistos[detName] == 0){
254  fHistos[detName] = new TH2I("MCHisto",detName.Data(), 1000,0,1000,201,0,200);
255  //fDrawOption[hit->GetDetName()] = "colz";
256  }
257  //TH2* tempHisto = (TH2*)(fHistos[detName]);
258  gGeoManager->cd(fGeoH->GetPath(detName.Data()));
259  // TGeoHMatrix* transMat = gGeoManager->GetCurrentMatrix();
260 
261  TVector3 in(myPoint->GetX(), myPoint->GetY(), myPoint->GetZ());
262  TVector3 out(myPoint->GetXOut(), myPoint->GetYOut(), myPoint->GetZOut());
263  TVector3 inLocal, outLocal;
264  inLocal = GetLocalHitPoints(detName, in);
265  outLocal = GetLocalHitPoints(detName, out);
266 
267  fHistos[detName]->Fill(inLocal.X()*100, inLocal.Y()*100);
268  fHistos[detName]->Fill(outLocal.X()*100, outLocal.Y()*100);
269 
270 // std::cout << i << ": " << std::endl;
271 // for (Int_t i = 0; i < 3; i++){
272 // std::cout << "posInLocal "<< i << ": " << inLocal(i) << std::endl;
273 // std::cout << "posOutLocal "<< i << ": " << outLocal(i) << std::endl;
274 // }
275  }
276 }
Double_t GetXOut() const
Definition: PndSdsMCPoint.h:81
Int_t i
Definition: run_full.C:25
Double_t GetZOut() const
Definition: PndSdsMCPoint.h:83
TGeoManager * gGeoManager
TString GetPath(Int_t shortID)
for a given shortID the path is returned
PndGeoHandling * fGeoH
std::map< TString, TH1 * > fHistos
TVector3 GetLocalHitPoints(TString detName, TVector3 input)
TClonesArray * fHitArray
TFile * out
Definition: reco_muo.C:20
Double_t GetYOut() const
Definition: PndSdsMCPoint.h:82
void PndMvdAllDataEventAna::FillHitPerClusterHistos ( )

Definition at line 339 of file PndMvdAllDataEventAna.cxx.

References fAllHitPerClusterHistos, fClusterArray, PndMvdEventAna::fHitArray, fHitPerClusterHistos, GetHitPerCluster(), hits, i, point, and TString.

Referenced by AnaHits().

340 {
341  for (Int_t i = 0; i < fClusterArray->GetEntries(); i++){
343  std::vector<Int_t> hits = GetHitPerCluster(cand);
344  PndSdsMCPoint* point = (PndSdsMCPoint*)(fHitArray->At(hits[0]));
345  TString detName = point->GetDetName();
346  if (fHitPerClusterHistos[detName] == 0){
347  fHitPerClusterHistos[detName] = new TH1I("HitPerCluster",detName.Data(), 21,0,20);
348  //fDrawOption[hit->GetDetName()] = "colz";
349  }
350  fHitPerClusterHistos[detName]->Fill(hits.size());
351  fAllHitPerClusterHistos->Fill(hits.size());
352  std::cout << "Hits in Cluster: " << hits.size() << " for Det: " << detName.Data() << std::endl;
353  }
354 }
std::vector< Int_t > GetHitPerCluster(PndSdsCluster *clusterCand)
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
std::map< TString, TH1 * > fHitPerClusterHistos
TClonesArray * fHitArray
CbmHit * hits[nHits]
Definition: RiemannTest.C:19
PndSdsMCPoint * point
Definition: anaLmdCluster.C:72
void PndMvdAllDataEventAna::FillHitProjHistos ( )

Definition at line 396 of file PndMvdAllDataEventAna.cxx.

References ClearHistoVector(), fRecoArray, fRecoHisrz, fRecoHisxy, fTrackFArray, GFTrackCand::getHit(), GFTrackCand::getNHits(), i, and vec.

Referenced by AnaHits().

397 {
400  unsigned int detID, hitID;
401  TVector3 vec;
402 
403  for (Int_t i = 0; i < fTrackFArray->GetEntries(); i++){
404  GFTrackCand* trackC = (GFTrackCand*)fTrackFArray->At(i);
405  TH2D* myHistoXY = new TH2D("recohisxy","MVD Reco Points, xy view",400,-15.,15.,400,-15.,15.);
406  myHistoXY->SetMarkerStyle(7);
407  myHistoXY->SetMarkerColor(i+1);
408 
409  TH2D* myHistoRZ = new TH2D("recohisrz","MVD Reco Points, rz view",400,-20.,20.,400,-20.,20.);
410  myHistoRZ->SetMarkerStyle(7);
411  myHistoRZ->SetMarkerColor(i+1);
412 
413  fRecoHisxy.push_back(myHistoXY);
414  fRecoHisrz.push_back(myHistoRZ);
415  for (UInt_t j = 0; j < trackC->getNHits(); j++){
416  trackC->getHit(j, detID, hitID);
417  PndSdsHit* myHit = (PndSdsHit*)fRecoArray->At(hitID);
418  vec.SetXYZ(myHit->GetX(), myHit->GetY(), myHit->GetZ());
419  myHistoXY->Fill(vec.x(), vec.y());
420  myHistoRZ->Fill(vec.z(), vec.Perp());
421  }
422  }
423 }
Int_t i
Definition: run_full.C:25
unsigned int getNHits() const
Definition: GFTrackCand.h:113
void getHit(unsigned int i, unsigned int &detId, unsigned int &hitId) const
Get detector ID and cluster index (hitId) for hit number i.
Definition: GFTrackCand.h:84
void ClearHistoVector(std::vector< TH1 * > *myVectors) const
Track candidate – a list of cluster indices.
Definition: GFTrackCand.h:55
std::vector< TH1 * > fRecoHisrz
std::vector< TH1 * > fRecoHisxy
dble_vec_t vec[12]
Definition: ranlxd.cxx:380
void PndMvdAllDataEventAna::FillHitResolutionHistos ( )

Definition at line 356 of file PndMvdAllDataEventAna.cxx.

References CalcMeanHitPos(), fAllHitResolutionHistos, fClusterArray, fHitResolutionHistos, fRecoArray, PndSdsHit::GetClusterIndex(), GetHitPerCluster(), PndSdsHit::GetPosition(), i, and TString.

Referenced by AnaHits().

357 {
358  for (Int_t i = 0; i < fRecoArray->GetEntries(); i++){
359  PndSdsHit *myHit = (PndSdsHit*)fRecoArray->At(i);
360  TString detName = myHit->GetDetName();
361  std::cout << "HitResolution for: " << detName << std::endl;
362  TVector3 recoPos = myHit->GetPosition();
363  std::cout << "RecoPos: " << recoPos.X() << " " << recoPos.Y() << " " << recoPos.Z() << std::endl;
364  std::cout << "MC point RefIndex: " << myHit->GetRefIndex() << std::endl;
365  std::cout << "Cluster Index: " << myHit->GetClusterIndex() << std::endl;
366  PndSdsCluster *myCand = (PndSdsCluster*)(fClusterArray->At(myHit->GetClusterIndex()));
367  std::vector<Int_t> points = GetHitPerCluster(myCand);
368  for (UInt_t k = 0; k < points.size(); i++)
369  std::cout << "ClusterPoints: " << points[k] << std::endl;
370  TVector3 hitPos = CalcMeanHitPos(points);
371  std::cout << "HitPos: " << hitPos.X() << " " << hitPos.Y() << " " << hitPos.Z() << std::endl;
372  if (fHitResolutionHistos[detName] == 0){
373  fHitResolutionHistos[detName] = new TH1D("HitRes",detName.Data(), 1000,0,0.01);
374  //fDrawOption[hit->GetDetName()] = "colz";
375  }
376  TVector3 resPos = recoPos - hitPos;
377  fHitResolutionHistos[detName]->Fill(resPos.Mag());
378  fAllHitResolutionHistos->Fill(resPos.Mag());
379  std::cout << "HitRes: " << resPos.Mag() << std::endl;
380  }
381 }
std::vector< Int_t > GetHitPerCluster(PndSdsCluster *clusterCand)
TVector3 CalcMeanHitPos(std::vector< Int_t > points)
Int_t i
Definition: run_full.C:25
TVector3 GetPosition() const
Definition: PndSdsHit.h:93
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndSdsCluster.h:19
std::map< TString, TH1 * > fHitResolutionHistos
Int_t GetClusterIndex() const
Definition: PndSdsHit.h:94
void PndMvdAllDataEventAna::FillRecoHistos ( )

Definition at line 314 of file PndMvdAllDataEventAna.cxx.

References fRecoArray, fRecoHistos, GetLocalHitPoints(), i, and TString.

Referenced by AnaHits().

315 {
316  for (Int_t i = 0; i < fRecoArray->GetEntries(); i++){
317  PndSdsHit *myHit = (PndSdsHit*)fRecoArray->At(i);
318  TString detName = myHit->GetDetName();
319  //if (hit->GetDetName().Contains("119_2")){
320  if (fRecoHistos[detName] == 0){
321  fRecoHistos[detName] = new TH2I("RecoHisto",detName.Data(), 1000,0,1000,201,0,200);
322  //fDrawOption[hit->GetDetName()] = "colz";
323  }
324  //TH2* tempHisto = (TH2*)(fRecoHistos[detName]);
325 
326  TVector3 in(myHit->GetX(), myHit->GetY(), myHit->GetZ());
327  TVector3 inLocal;
328  inLocal = GetLocalHitPoints(detName, in);
329 
330  fRecoHistos[detName]->Fill(inLocal.X()*100, inLocal.Y()*100);
331 
332 // std::cout << i << ": " << std::endl;
333 // for (Int_t i = 0; i < 3; i++){
334 // std::cout << "posInLocal "<< i << ": " << inLocal(i) << std::endl;
335 // }
336  }
337 }
std::map< TString, TH1 * > fRecoHistos
Int_t i
Definition: run_full.C:25
TVector3 GetLocalHitPoints(TString detName, TVector3 input)
void PndMvdEventAna::FillVector ( )
inherited

Definition at line 102 of file PndMvdEventAna.cxx.

References PndMvdEventAna::fHistos, and PndMvdEventAna::fHistoVector.

103 {
104  fHistoVector.clear();
105  for (std::map<TString, TH1*>::const_iterator ki = fHistos.begin(); ki != fHistos.end(); ki++){
106  fHistoVector.push_back(ki->second);
107  }
108 }
std::map< TString, TH1 * > fHistos
std::vector< TH1 * > fHistoVector
Int_t PndMvdEventAna::GetEventNr ( ) const
inlineinherited

Definition at line 52 of file PndMvdEventAna.h.

References PndMvdEventAna::fActiveEvent.

52 {return fActiveEvent;};
TH1* PndMvdEventAna::GetHisto ( TString  histoName)
inlineinherited

Definition at line 54 of file PndMvdEventAna.h.

References PndMvdEventAna::fHistos.

54 {return fHistos[histoName];};
std::map< TString, TH1 * > fHistos
TH1* PndMvdEventAna::GetHisto ( Int_t  i)
inlineinherited

Definition at line 55 of file PndMvdEventAna.h.

References PndMvdEventAna::fHistoVector, and i.

55 {return fHistoVector[i];};
Int_t i
Definition: run_full.C:25
std::vector< TH1 * > fHistoVector
std::vector< Int_t > PndMvdAllDataEventAna::GetHitPerCluster ( PndSdsCluster clusterCand)

Definition at line 629 of file PndMvdAllDataEventAna.cxx.

References fDigiArray, PndSdsCluster::GetClusterList(), PndSdsDigi::GetIndex(), and i.

Referenced by FillHitPerClusterHistos(), and FillHitResolutionHistos().

630 {
631  std::vector<Int_t> result;
632  std::vector<Int_t> digiPos = clusterCand->GetClusterList();
633  bool isInResult = false;
634  for (UInt_t i = 0; i < digiPos.size(); i++){
635  PndSdsDigiPixel* digiHit = (PndSdsDigiPixel*)(fDigiArray->At(digiPos[i]));
636  Int_t mcID = digiHit->GetIndex(0);
637  std::cout << " -I- GetHitPerCluster: mcID: " << mcID << std::endl;
638  for (UInt_t j = 0; j < result.size() && isInResult == false; j++){
639  //std::cout << "Result: " << result[j] << std::endl;
640  if (mcID == result[j])
641  isInResult = true;
642  }
643  if (isInResult == false)
644  result.push_back(mcID);
645  isInResult = false;
646  }
647  for (UInt_t k = 0; k < result.size(); k++)
648  std::cout << " Result: " << k << ": " << result[k] << std::endl;
649  return result;
650 }
std::vector< Int_t > GetClusterList() const
Definition: PndSdsCluster.h:38
Int_t i
Definition: run_full.C:25
Int_t GetIndex(int i=0) const
Definition: PndSdsDigi.h:63
Data class to store the digi output of a pixel module.
TVector3 PndMvdAllDataEventAna::GetLocalHitPoints ( TString  detName,
TVector3  input 
)

Definition at line 222 of file PndMvdAllDataEventAna.cxx.

References Double_t, PndMvdEventAna::fGeoH, PndGeoHandling::GetPath(), and gGeoManager.

Referenced by FillHitHistos(), and FillRecoHistos().

223 {
224  TVector3 result;
225  Double_t in[3];
226  Double_t local[3];
227 
228  in[0] = input.X();
229  in[1] = input.Y();
230  in[2] = input.Z();
231 
232  gGeoManager->cd(fGeoH->GetPath(detName.Data()));
233  TGeoHMatrix* transMat = gGeoManager->GetCurrentMatrix();
234 
235  transMat->MasterToLocal(in, local);
236 
237  TGeoVolume* actVolume = gGeoManager->GetCurrentVolume();
238  TGeoBBox* actBox = (TGeoBBox*)(actVolume->GetShape());
239 
240  result.SetX(local[0] + actBox->GetDX());
241  result.SetY(local[1] + actBox->GetDY());
242  result.SetZ(local[2] + actBox->GetDZ());
243 
244  return result;
245 }
TGeoManager * gGeoManager
TString GetPath(Int_t shortID)
for a given shortID the path is returned
PndGeoHandling * fGeoH
Double_t
std::vector< TString > PndMvdAllDataEventAna::GetModulesHit ( )

Definition at line 717 of file PndMvdAllDataEventAna.cxx.

References PndMvdEventAna::fGeoH, fRecoHistos, and PndGeoHandling::GetPath().

718 {
719  std::vector<TString> result;
720  for(std::map<TString, TH1*>::const_iterator ki= fRecoHistos.begin(); ki != fRecoHistos.end(); ++ki){
721  std::cout << "First: " << ki->first << std::endl;
722  std::cout << "Path: " << fGeoH->GetPath(ki->first) << std::endl;
723  result.push_back(fGeoH->GetPath(ki->first));
724  }
725  return result;
726 }
std::map< TString, TH1 * > fRecoHistos
TString GetPath(Int_t shortID)
for a given shortID the path is returned
PndGeoHandling * fGeoH
TString PndMvdEventAna::GetSelection ( ) const
inlineinherited

Definition at line 53 of file PndMvdEventAna.h.

References PndMvdEventAna::fSelection.

53 {return fSelection;};
TString fSelection
void PndMvdAllDataEventAna::Init ( TString  filename)
virtual

Reimplemented from PndMvdEventAna.

Definition at line 92 of file PndMvdAllDataEventAna.cxx.

References f3DMCHisto, f3DRecoHisto, fAllHitPerClusterHistos, fAllHitResolutionHistos, fClusterArray, fDigiArray, PndMvdEventAna::fFile, fGeoTrackArray, PndMvdEventAna::fHitArray, fRecoArray, fTrackFArray, and PndMvdEventAna::fTree.

Referenced by PndMvdAllDataEventAna().

93 {
94  PndFileNameCreator nameCreator(fileName.Data());
95  fFile = new TFile(fileName.Data());
96  fTree = (TTree*)fFile->Get("pndsim");
97 
98  fTree->AddFriend("digi=pndsim",nameCreator.GetDigiFileName().c_str());
99  fTree->AddFriend("reco=pndsim",nameCreator.GetRecoFileName().c_str());
100  fTree->AddFriend("trackF=pndsim",nameCreator.GetTrackFindingFileName().c_str());
101 
102  fHitArray=new TClonesArray("PndSdsMCPoint");
103  fDigiArray = new TClonesArray("PndSdsDigiPixel");
104  fClusterArray = new TClonesArray("PndSdsCluster");
105  fRecoArray = new TClonesArray("PndSdsHit");
106  fGeoTrackArray = new TClonesArray("TGeoTrack");
107  fTrackFArray = new TClonesArray("GFTrackCand");
108 
109  fTree->SetBranchAddress("MVDPoint",&fHitArray);
110  fTree->SetBranchAddress("MVDPixelDigis",&fDigiArray);
111  fTree->SetBranchAddress("MVDClusterCand",&fClusterArray);
112  fTree->SetBranchAddress("MVDClusterHit",&fRecoArray);
113  fTree->SetBranchAddress("MVDTrackCand",&fTrackFArray);
114  if (fTree->FindBranch("GeoTracks") != 0)
115  fTree->SetBranchAddress("GeoTracks", &fGeoTrackArray);
116 
117  fAllHitPerClusterHistos = new TH1I("hitPerCluster","hitPerCluster",21,0,20);
118  fAllHitResolutionHistos = new TH1D("AllHitResolution","AllHitResolution", 1000,0,0.1);
119  f3DMCHisto = new TH3D("h3D","h3D", 50,-15,15, 50, -15,15, 50, -30,30);
120  f3DRecoHisto = new TH3D("h3D","h3D", 50,-15,15, 50, -15,15, 50, -30,30);
121 
122 }
A simple class which adds the corresponding file extensions to a given base class.
TClonesArray * fHitArray
void PndMvdAllDataEventAna::InitBranch ( )
virtual

Implements PndMvdEventAna.

Definition at line 124 of file PndMvdAllDataEventAna.cxx.

125 {
126 }
void PndMvdEventAna::InitCanvas ( )
inherited

Definition at line 55 of file PndMvdEventAna.cxx.

References Double_t, PndMvdEventAna::fCan, PndMvdEventAna::fCancol, and PndMvdEventAna::fHistos.

56 {
57  if (fCan != 0) delete(fCan);
58  fCan = new TCanvas("can1","MCHit view in MVD",0,0,1000,1000);
59  std::cout << "InitCanvas fHistos.size() " << fHistos.size() << std::endl;
60  fCan->Divide(fCancol, (Int_t)(((Double_t)(fHistos.size())/fCancol) + 0.5));
61 }
TCanvas * fCan
std::map< TString, TH1 * > fHistos
Double_t
void PndMvdAllDataEventAna::InitHistos ( )
virtual

Implements PndMvdEventAna.

Definition at line 128 of file PndMvdAllDataEventAna.cxx.

129 {
130 }
void PndMvdEventAna::NextEvent ( )
inherited

Definition at line 46 of file PndMvdEventAna.cxx.

References PndMvdEventAna::AnaEventNr(), PndMvdEventAna::fActiveEvent, PndMvdEventAna::fAnaEvents, and PndMvdEventAna::fTree.

47 {
48  fAnaEvents = 1;
49  if (fActiveEvent + 1 < fTree->GetEntriesFast()){
50  fActiveEvent++;
52  }
53 }
void AnaEventNr(Int_t Nr)
void PndMvdAllDataEventAna::PrintClusterArray ( )

Definition at line 197 of file PndMvdAllDataEventAna.cxx.

References fClusterArray, fDigiArray, PndSdsCluster::GetClusterList(), and i.

Referenced by AnaHits().

198 {
199  for (Int_t i = 0; i < fClusterArray->GetEntries(); i++){
200  std::cout << "Cluster " << i << ": " << std::endl;
201  PndSdsCluster* myCluster = (PndSdsCluster*)fClusterArray->At(i);
202  //myCluster->Print();
203  std::vector<Int_t> myClusterList = myCluster->GetClusterList();
204  for (UInt_t j = 0; j < myClusterList.size(); j++){
205  PndSdsDigiPixel* myDigi = (PndSdsDigiPixel*)fDigiArray->At(myClusterList[j]);
206  std::cout << myClusterList[j] << ": ";
207  std::cout << *myDigi;
208  }
209  }
210 
211 }
std::vector< Int_t > GetClusterList() const
Definition: PndSdsCluster.h:38
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
Data class to store the digi output of a pixel module.
void PndMvdAllDataEventAna::PrintDigiArray ( )

Definition at line 188 of file PndMvdAllDataEventAna.cxx.

References fDigiArray, and i.

Referenced by AnaHits().

189 {
190  for (Int_t i = 0; i < fDigiArray->GetEntries(); i++){
191  PndSdsDigiPixel* myDigi = (PndSdsDigiPixel*)fDigiArray->At(i);
192  std::cout << i << ": ";
193  //myDigi->Print();
194  std::cout << *myDigi;
195  }
196 }
Int_t i
Definition: run_full.C:25
Data class to store the digi output of a pixel module.
void PndMvdAllDataEventAna::PrintHitArray ( )

Definition at line 180 of file PndMvdAllDataEventAna.cxx.

References PndMvdEventAna::fHitArray, and i.

Referenced by AnaHits().

181 {
182  for (Int_t i = 0; i < fHitArray->GetEntries(); i++){
183  std::cout << i << ": ";
184  PndSdsMCPoint* myPoint = (PndSdsMCPoint*)fHitArray->At(i);
185  std::cout << *myPoint;
186  }
187 }
Int_t i
Definition: run_full.C:25
TClonesArray * fHitArray
void PndMvdAllDataEventAna::PrintRecoArray ( )

Definition at line 212 of file PndMvdAllDataEventAna.cxx.

References fRecoArray, and i.

Referenced by AnaHits().

213 {
214  for (Int_t i = 0; i < fRecoArray->GetEntries(); i++){
215  std::cout << i << ": ";
216  PndSdsHit* myHit = (PndSdsHit*)fRecoArray->At(i);
217  std::cout << *myHit;
218  }
219 }
Int_t i
Definition: run_full.C:25
void PndMvdEventAna::SetCanvasColumns ( Int_t  col)
inlineinherited

Definition at line 47 of file PndMvdEventAna.h.

References col, and PndMvdEventAna::fCancol.

Referenced by PndMvdAllDataEventAna(), and PndMvdDigiEventAna::PndMvdDigiEventAna().

47 {fCancol = col;};
int col
Definition: anaLmdDigi.C:67
void PndMvdEventAna::SetDrawOption ( TString  histoName,
TString  option 
)
inherited

Definition at line 115 of file PndMvdEventAna.cxx.

References PndMvdEventAna::fDrawOption.

116 {
117  fDrawOption[histoName] = option;
118 }
std::map< TString, TString > fDrawOption
void PndMvdEventAna::SetSelection ( TString  sel)
inlineinherited

Definition at line 49 of file PndMvdEventAna.h.

References PndMvdEventAna::fSelection.

49 {fSelection = sel;};
TString fSelection

Member Data Documentation

TH3D* PndMvdAllDataEventAna::f3DMCHisto
private

Definition at line 127 of file PndMvdAllDataEventAna.h.

Referenced by Draw3D(), Fill3DHisto(), and Init().

TH3D* PndMvdAllDataEventAna::f3DRecoHisto
private

Definition at line 128 of file PndMvdAllDataEventAna.h.

Referenced by Draw3D(), Fill3DHisto(), and Init().

Int_t PndMvdEventAna::fActiveEvent
protectedinherited
TH1* PndMvdAllDataEventAna::fAllHitPerClusterHistos
private

Definition at line 125 of file PndMvdAllDataEventAna.h.

Referenced by DrawHitPerCluster(), FillHitPerClusterHistos(), and Init().

TH1* PndMvdAllDataEventAna::fAllHitResolutionHistos
private

Definition at line 126 of file PndMvdAllDataEventAna.h.

Referenced by DrawEvent(), DrawResolution(), FillHitResolutionHistos(), and Init().

Int_t PndMvdEventAna::fAnaEvents
protectedinherited
TString PndMvdEventAna::fBranchName
protectedinherited
TCanvas* PndMvdEventAna::fCan
protectedinherited

Definition at line 73 of file PndMvdEventAna.h.

Referenced by PndMvdEventAna::DrawHistos(), and PndMvdEventAna::InitCanvas().

TCanvas* PndMvdAllDataEventAna::fCan1
private

Definition at line 134 of file PndMvdAllDataEventAna.h.

Referenced by DrawAllHistos().

TCanvas* PndMvdAllDataEventAna::fCan2
private

Definition at line 135 of file PndMvdAllDataEventAna.h.

Referenced by DrawEvent().

Int_t PndMvdEventAna::fCancol
protectedinherited
TString PndMvdEventAna::fClassName
protectedinherited
TClonesArray* PndMvdAllDataEventAna::fClusterArray
protected
std::map<TString, TH1*> PndMvdAllDataEventAna::fClusterHistos
private

Definition at line 110 of file PndMvdAllDataEventAna.h.

Referenced by ClearAllHMaps(), DrawClusterHisto(), and FillClusterHistos().

std::vector<TH1*> PndMvdAllDataEventAna::fClusterHistoVec
private

Definition at line 117 of file PndMvdAllDataEventAna.h.

Referenced by ClearAllVectors().

TClonesArray* PndMvdAllDataEventAna::fDigiArray
protected
std::map<TString, TH1*> PndMvdAllDataEventAna::fDigiHistos
private

Definition at line 109 of file PndMvdAllDataEventAna.h.

Referenced by ClearAllHMaps(), DrawDigiHisto(), and FillDigiHistos().

std::vector<TH1*> PndMvdAllDataEventAna::fDigiHistoVec
private

Definition at line 116 of file PndMvdAllDataEventAna.h.

Referenced by ClearAllVectors().

std::map<TString, TString> PndMvdEventAna::fDrawOption
protectedinherited
TFile* PndMvdEventAna::fFile
protectedinherited

Definition at line 67 of file PndMvdEventAna.h.

Referenced by PndMvdEventAna::Init(), and Init().

PndGeoHandling* PndMvdEventAna::fGeoH
protectedinherited
PndEventDisplay* PndMvdAllDataEventAna::fGeoList
private

Definition at line 138 of file PndMvdAllDataEventAna.h.

Referenced by ClearHistos(), Create3DGeoHits(), and PndMvdAllDataEventAna().

TClonesArray* PndMvdAllDataEventAna::fGeoTrackArray
protected

Definition at line 106 of file PndMvdAllDataEventAna.h.

Referenced by DrawAllTracks(), DrawHitTracks(), and Init().

std::map<TString, TH1*> PndMvdEventAna::fHistos
protectedinherited
std::vector<TH1*> PndMvdEventAna::fHistoVector
protectedinherited
TClonesArray* PndMvdEventAna::fHitArray
protectedinherited
std::vector<TH1*> PndMvdAllDataEventAna::fHitHistoVec
private

Definition at line 115 of file PndMvdAllDataEventAna.h.

Referenced by ClearAllVectors().

std::map<TString, TH1*> PndMvdAllDataEventAna::fHitPerClusterHistos
private

Definition at line 112 of file PndMvdAllDataEventAna.h.

Referenced by ClearAllHMaps(), DrawAllHistos(), and FillHitPerClusterHistos().

std::map<TString, TH1*> PndMvdAllDataEventAna::fHitResolutionHistos
private

Definition at line 113 of file PndMvdAllDataEventAna.h.

Referenced by ClearAllHMaps(), DrawAllHistos(), and FillHitResolutionHistos().

TGeoVolume* PndMvdAllDataEventAna::fMvdTopVolume
private

Definition at line 120 of file PndMvdAllDataEventAna.h.

Referenced by DrawTopVolume(), and PndMvdAllDataEventAna().

PndSdsCalcFePixel* PndMvdAllDataEventAna::fPixelCon
private
TClonesArray* PndMvdAllDataEventAna::fRecoArray
protected
TH1* PndMvdAllDataEventAna::fRecoErrorHisto
private

Definition at line 124 of file PndMvdAllDataEventAna.h.

std::vector<TH1*> PndMvdAllDataEventAna::fRecoHisrz
private

Definition at line 132 of file PndMvdAllDataEventAna.h.

Referenced by DrawEvent(), DrawHisxy(), and FillHitProjHistos().

std::map<TString, TH1*> PndMvdAllDataEventAna::fRecoHistos
private
std::vector<TH1*> PndMvdAllDataEventAna::fRecoHistoVec
private

Definition at line 118 of file PndMvdAllDataEventAna.h.

Referenced by ClearAllVectors().

std::vector<TH1*> PndMvdAllDataEventAna::fRecoHisxy
private

Definition at line 131 of file PndMvdAllDataEventAna.h.

Referenced by DrawEvent(), DrawHisrz(), and FillHitProjHistos().

TGeoVolume* PndMvdAllDataEventAna::fRecoTopVolume
private

Definition at line 121 of file PndMvdAllDataEventAna.h.

TGeoVolume* PndMvdAllDataEventAna::fRecoVolume
private

Definition at line 122 of file PndMvdAllDataEventAna.h.

Referenced by PndMvdAllDataEventAna().

TString PndMvdEventAna::fSelection
protectedinherited
std::vector<TH1*> PndMvdAllDataEventAna::fSimHisrz
private

Definition at line 130 of file PndMvdAllDataEventAna.h.

std::vector<TH1*> PndMvdAllDataEventAna::fSimHisxy
private

Definition at line 129 of file PndMvdAllDataEventAna.h.

TClonesArray* PndMvdAllDataEventAna::fTrackFArray
protected

Definition at line 107 of file PndMvdAllDataEventAna.h.

Referenced by FillHitProjHistos(), and Init().

TTree* PndMvdEventAna::fTree
protectedinherited

The documentation for this class was generated from the following files: