FairRoot/PandaRoot
Public Member Functions | Private Attributes | List of all members
MyMainFrame Class Reference
Inheritance diagram for MyMainFrame:

Public Member Functions

 MyMainFrame (const TGWindow *p, UInt_t w, UInt_t h)
 
virtual ~MyMainFrame ()
 
void DoExit ()
 
void DoDraw ()
 
void DoSave ()
 
void DoRecreate ()
 
void SetStatusText (const char *txt, Int_t pi)
 
void EventInfo (Int_t event, Int_t px, Int_t py, TObject *selected)
 
 MyMainFrame (const TGWindow *p, UInt_t w, UInt_t h)
 
virtual ~MyMainFrame ()
 
void DrawPoints ()
 
void DrawDigis ()
 
void DrawHitErrors ()
 
void DrawHits ()
 
void DoDraw ()
 
void ReadParameters ()
 
void SetDigitSchemeToDraw (Int_t itemp)
 
void ReadEvent ()
 
void ChangeBaseString (char *carr)
 
void ChangeParFString (char *carr)
 
void ChangePlotParams ()
 
void ChangePlotSize (char *tempD)
 
void ChangePlotCenterX (char *tempD)
 
void ChangePlotCenterY (char *tempD)
 
void ChangePlotCenterZ (char *tempD)
 
void MoveUP ()
 
void Moveup ()
 
void MoveDOWN ()
 
void Movedown ()
 
void MoveLEFT ()
 
void Moveleft ()
 
void MoveRIGHT ()
 
void Moveright ()
 
void ZoomIn ()
 
void ZoomOut ()
 
void PrevStat ()
 
void NextStat ()
 
void DoInfoStatusBar (Int_t event, Int_t x, Int_t y, TObject *sel)
 
void SaveCanvas ()
 

Private Attributes

TRootEmbeddedCanvas * fEcan
 
TGStatusBar * fStatusBar
 
TGMainFrame * fMain
 
TRootEmbeddedCanvas * fEcanvas
 
TGStatusBar * fInfoStatusBar
 
TGNumberEntryField * fPSizeEntry
 
TGNumberEntryField * fPCenXEntry
 
TGNumberEntryField * fPCenYEntry
 
TGNumberEntryField * fPCenZEntry
 
TGNumberEntryField * fEventToDrawEntry
 
TGNumberEntryField * fPointToDrawEntry
 
TStopwatch fTimer
 
Double_t fPlotSize
 
Double_t fPlotCenterX
 
Double_t fPlotCenterY
 
Double_t fPlotCenterZ
 
Int_t fDrawStation
 
Int_t fNofStations
 
TObjArray * fRealStations
 
TObjArray * fStations
 
Double_t fStationsInnerRadius [10]
 
Double_t fStationsOuterRadius [10]
 
Double_t fStationsZPosition [10]
 
Int_t fDigitSchemeToDraw
 
Int_t fNofGemPoints
 
Int_t fNofMCTracks
 
Int_t fNofGemHits
 
Int_t fNofGemDigis
 
TString fBaseString
 
TString fParFString
 
TFile * fSimFile
 
TTree * fSimTree
 
TClonesArray * fGemPointArray
 
TClonesArray * fMCTrackArray
 
TFile * fDigiFile
 
TTree * fDigiTree
 
TFile * fHitsFile
 
TTree * fHitsTree
 
TClonesArray * fGemHitArray
 
TClonesArray * fGemDigiArray
 
PndGemMCPointfGemPoint
 
Bool_t fSimRecoFilesRead
 

Detailed Description

Definition at line 82 of file structure_analysis_emc.C.

Constructor & Destructor Documentation

MyMainFrame::MyMainFrame ( const TGWindow *  p,
UInt_t  w,
UInt_t  h 
)

Definition at line 212 of file structure_analysis_emc.C.

References exit(), fEcan, and fStatusBar.

212  :
213  TGMainFrame(p, w, h)
214 {
215  // Create the embedded canvas
216  fEcan = new TRootEmbeddedCanvas(0,this,500,400);
217  Int_t wid = fEcan->GetCanvasWindowId();
218  TCanvas *myc = new TCanvas("MyCanvas", 10,10,wid);
219  fEcan->AdoptCanvas(myc);
220  myc->Connect("ProcessedEvent(Int_t,Int_t,Int_t,TObject*)","MyMainFrame",this,
221  "EventInfo(Int_t,Int_t,Int_t,TObject*)");
222 
223  AddFrame(fEcan, new TGLayoutHints(kLHintsTop | kLHintsLeft |
224  kLHintsExpandX | kLHintsExpandY,0,0,1,1));
225  // status bar
226  Int_t parts[] = {34, 33, 33};
227  fStatusBar = new TGStatusBar(this, 50, 10, kVerticalFrame);
228  fStatusBar->SetParts(parts, 3);
229  fStatusBar->Draw3DCorner(kFALSE);
230  AddFrame(fStatusBar, new TGLayoutHints(kLHintsExpandX, 0, 0, 10, 0));
231 
232  // Create a horizontal frame containing two buttons
233  TGHorizontalFrame *hframe = new TGHorizontalFrame(this, 200, 40);
234 
235  TGTextButton *draw = new TGTextButton(hframe, "&Draw");
236  draw->Connect("Clicked()", "MyMainFrame", this, "DoDraw()");
237  hframe->AddFrame(draw, new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
238  TGTextButton *exit = new TGTextButton(hframe, "&Exit ");
239  exit->Connect("Pressed()", "MyMainFrame", this, "DoExit()");
240  hframe->AddFrame(exit, new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
241 
242  TGTextButton *save = new TGTextButton(hframe, "&Save ");
243  save->Connect("Clicked()", "MyMainFrame", this, "DoSave()");
244  hframe->AddFrame(save, new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
245 
246  TGTextButton *recreate = new TGTextButton(hframe, "&Recreate ");
247  recreate->Connect("Clicked()", "MyMainFrame", this, "DoRecreate()");
248  hframe->AddFrame(recreate, new TGLayoutHints(kLHintsCenterX, 5, 5, 3, 4));
249 
250  AddFrame(hframe, new TGLayoutHints(kLHintsCenterX, 2, 2, 2, 2));
251 
252  // Set a name to the main frame
253  SetWindowName("EMC Forward Endcap structure");
254  MapSubwindows();
255 
256  // Initialize the layout algorithm via Resize()
257  Resize(GetDefaultSize());
258 
259  // Map main frame
260  MapWindow();
261 }
exit(0)
TGStatusBar * fStatusBar
TRootEmbeddedCanvas * fEcan
Double_t p
Definition: anasim.C:58
MyMainFrame::~MyMainFrame ( )
virtual

Definition at line 264 of file structure_analysis_emc.C.

References Cleanup(), and fEcan.

265 {
266  // Clean up main frame...
267  Cleanup();
268  delete fEcan;
269 }
TRootEmbeddedCanvas * fEcan
SttMvdTracking Cleanup()
MyMainFrame::MyMainFrame ( const TGWindow *  p,
UInt_t  w,
UInt_t  h 
)
virtual MyMainFrame::~MyMainFrame ( )
virtual

Member Function Documentation

void MyMainFrame::ChangeBaseString ( char *  carr)
inline

Definition at line 93 of file guiEventDisplay.C.

93 { fBaseString = Form("%s",carr); };
TString fBaseString
void MyMainFrame::ChangeParFString ( char *  carr)
inline

Definition at line 94 of file guiEventDisplay.C.

94 { fParFString = Form("%s",carr); };
TString fParFString
void MyMainFrame::ChangePlotCenterX ( char *  tempD)
inline

Definition at line 98 of file guiEventDisplay.C.

98 { fPlotCenterX = atof(tempD); };
Double_t fPlotCenterX
void MyMainFrame::ChangePlotCenterY ( char *  tempD)
inline

Definition at line 99 of file guiEventDisplay.C.

99 { fPlotCenterY = atof(tempD); };
Double_t fPlotCenterY
void MyMainFrame::ChangePlotCenterZ ( char *  tempD)
inline

Definition at line 100 of file guiEventDisplay.C.

100 { fPlotCenterZ = atof(tempD); };
Double_t fPlotCenterZ
void MyMainFrame::ChangePlotParams ( )

Definition at line 709 of file guiEventDisplay.C.

References fDrawStation, fPCenXEntry, fPCenYEntry, fPCenZEntry, fPlotCenterX, fPlotCenterY, fPlotCenterZ, fPSizeEntry, fStationsZPosition, and TString.

Referenced by MoveDOWN(), Movedown(), MoveLEFT(), Moveleft(), MoveRIGHT(), Moveright(), MoveUP(), Moveup(), NextStat(), PrevStat(), ZoomIn(), and ZoomOut().

709  {
710  // cout << "problem here?" << endl;
712  // cout << fPSizeEntry << endl;
713  // cout << "plot size " << fPlotSize << " at " << fPlotCenterX << " " << fPlotCenterY << " " << fPlotCenterZ << endl;
714  TString tempString = Form("%1.3f",(Float_t)fPlotSize);
715  fPSizeEntry->SetText(tempString.Data());
716  tempString = Form("%1.3f",(Float_t)fPlotCenterX);
717  fPCenXEntry->SetText(tempString.Data());
718  tempString = Form("%1.3f",(Float_t)fPlotCenterY);
719  fPCenYEntry->SetText(tempString.Data());
720  tempString = Form("%1.3f",(Float_t)fPlotCenterZ);
721  fPCenZEntry->SetText(tempString.Data());
722  // cout << "seems so" << endl;
723 }
Double_t fPlotCenterZ
TGNumberEntryField * fPCenXEntry
TGNumberEntryField * fPCenZEntry
Double_t fStationsZPosition[10]
Int_t fDrawStation
Double_t fPlotCenterX
TGNumberEntryField * fPCenYEntry
Double_t fPlotCenterY
TGNumberEntryField * fPSizeEntry
Double_t fPlotSize
void MyMainFrame::ChangePlotSize ( char *  tempD)
inline

Definition at line 97 of file guiEventDisplay.C.

97 { fPlotSize = atof(tempD); };
Double_t fPlotSize
void MyMainFrame::DoDraw ( )
void MyMainFrame::DoDraw ( )

Definition at line 102 of file structure_analysis_emc.C.

References c1, Double_t, f, fEcan, name, pt(), tr, TString, x, y, and z.

Referenced by MoveDOWN(), Movedown(), MoveLEFT(), Moveleft(), MoveRIGHT(), Moveright(), MoveUP(), Moveup(), NextStat(), PrevStat(), ReadEvent(), SetDigitSchemeToDraw(), ZoomIn(), and ZoomOut().

103 {
104  TCanvas *c1 = fEcan->GetCanvas();
105  ifstream f;
106  f.open("structure.txt");
107  c1->Range(-120,-120,120,120);
108 
109  Double_t x,y,z;
110  long index;
111  Int_t iX, iY;
112  TPaveLabel *pt[5000];
113  Int_t i_crys=0;
114  Double_t tr = 2.51875; // Size of the Crystal in its center (cm)
115 
116  //Position of the first line with numbers
117  f.seekg(30);
118  while (f>>index>>iX>>iY>>x>>y>>z)
119  {
120  // check if tci belongs to Forward Endcap
121  if ((iX<200)||(iX>300)) continue;
122  if (i_crys%100==0) std::cout<<"Crystal in fwd endcap = "<<i_crys<<std::endl;
123  i_crys++;
124 
125  TString label="";
126  label+=iX;
127  label+=",";
128  label+=iY;
129 
130  TString name="";
131  name+=index;
132 
133  pt[i_crys] = new TPaveLabel(x-tr/2.,y-tr/2., x+tr/2., y+tr/2.,label.Data());
134  pt[i_crys]->SetBorderSize(1);
135  pt[i_crys]->SetName(name);
136  pt[i_crys]->Draw();
137  }
138 
139  // TCanvas::Update() draws the frame, after which it can be changed
140  c1->Update();
141  c1->Modified();
142  c1->Update();
143 }
TRootEmbeddedCanvas * fEcan
TString pt(TString pts, TString exts="px py pz")
Definition: invexp.C:133
Double_t
TFile * f
Definition: bump_analys.C:12
Double_t z
c1
Definition: plot_dirc.C:35
TString name
Double_t x
Double_t y
void MyMainFrame::DoExit ( )

Definition at line 145 of file structure_analysis_emc.C.

References printf().

146 {
147  printf("Exit application...");
148  gApplication->Terminate(0);
149 }
printf("RealTime=%f seconds, CpuTime=%f seconds\n", rtime, ctime)
void MyMainFrame::DoInfoStatusBar ( Int_t  event,
Int_t  x,
Int_t  y,
TObject *  sel 
)

Definition at line 977 of file guiEventDisplay.C.

References Double_t, fDrawStation, fEcanvas, fGemPointArray, fInfoStatusBar, fMCTrackArray, fRealStations, PndGemSensor::GetChannel(), PndMCTrack::GetMomentum(), PndGemStation::GetNSensors(), PndMCTrack::GetPdgCode(), PndGemStation::GetSensorByNr(), PndMCTrack::GetStartVertex(), pz, CAMath::Sqrt(), and TString.

978  {
979  TString selName = sel->GetName();
980  TCanvas *fCanvas = fEcanvas->GetCanvas();
981  // cout << "cursor at " << fCanvas->AbsPixeltoX(x) << " " << fCanvas->AbsPixeltoY(y) << endl;
982 
983  Double_t xReal = fCanvas->AbsPixeltoX(x);
984  Double_t yReal = fCanvas->AbsPixeltoY(y);
985 
986  TString colorName[2][2] = {"blue","red","green","yellow"};
987 
988  if (event == kMouseMotion){
989  // cout << "being at " << selName.Data() << " " << sel->GetUniqueID() << endl;
990  fInfoStatusBar->SetText(Form("%.6f",xReal),1);
991  fInfoStatusBar->SetText(Form("%.6f",yReal),2);
992 
993  // cout << "it is " << selName.Data() << " with id = " << sel->GetUniqueID() << endl;
994 
995  if ( ( selName.Contains("TMarker") || selName.Contains("TPolyLine") ) && sel->GetUniqueID()!= 666666 ) {
996  cout << "it is " << selName.Data() << " with id = " << sel->GetUniqueID() << endl;
997  fInfoStatusBar->SetText(Form("%d",sel->GetUniqueID()),7);
998  PndGemMCPoint* pointSel = (PndGemMCPoint*)fGemPointArray->At(sel->GetUniqueID());
999  cout << "pointSel at " << pointSel->GetX() << " " << pointSel->GetY() << " " << pointSel->GetZ() << endl;
1000  fInfoStatusBar->SetText(Form("pos: (%.4f,%.4f,%.4f)",
1001  pointSel->GetX(),
1002  pointSel->GetY(),
1003  pointSel->GetZ()),8);
1004  Double_t px = pointSel->GetPx();
1005  Double_t py = pointSel->GetPy();
1006  Double_t pz = pointSel->GetPz();
1007  fInfoStatusBar->SetText(Form("mom: (%.4f,%.4f,%.4f) -> %.4f",
1008  px,py,pz,
1009  TMath::Sqrt(px*px+py*py+pz*pz)),9);
1010  PndMCTrack* trackSel = (PndMCTrack*)fMCTrackArray->At(pointSel->GetTrackID());
1011  TVector3 startVertex = trackSel->GetStartVertex();
1012  TVector3 startMomentum = trackSel->GetMomentum();
1013  px = startMomentum.X();
1014  py = startMomentum.Y();
1015  pz = startMomentum.Z();
1016 
1017  fInfoStatusBar->SetText(Form("%d from (%.2f,%.2f,%.2f), mom: (%.2f,%.2f,%.2f)-> %.4f",
1018  trackSel->GetPdgCode(),startVertex.X(),startVertex.Y(),startVertex.Z(),
1019  px,py,pz,
1020  TMath::Sqrt(px*px+py*py+pz*pz)),10);
1021  }
1022  else {
1023  fInfoStatusBar->SetText("",7);
1024  fInfoStatusBar->SetText("",8);
1025  fInfoStatusBar->SetText("",9);
1026  fInfoStatusBar->SetText("",10);
1027  }
1028 
1029  PndGemStation* digiStation;
1030  PndGemSensor* digiSensor;
1031  digiStation = (PndGemStation*)fRealStations->At(fDrawStation);
1032 
1033  for ( Int_t isens = 0 ; isens < digiStation->GetNSensors() ; isens++ ) {
1034  digiSensor = (PndGemSensor*) digiStation->GetSensorByNr(isens+1);
1035  for ( Int_t iside = 0 ; iside < 2 ; iside++ ) {
1036  Int_t channelNumber = digiSensor->GetChannel(xReal,yReal,iside);
1037  fInfoStatusBar->SetText(Form("%d",channelNumber),3+isens*2+iside);
1038  TGCompositeFrame* barPart = fInfoStatusBar->GetBarPart(3+isens*2+iside);
1039 
1040  Pixel_t colorPix;
1041  if ( channelNumber == - 1 ) {
1042  gClient->GetColorByName("grey",colorPix);
1043  barPart->SetBackgroundColor(colorPix);
1044  }
1045  else {
1046  gClient->GetColorByName(colorName[isens][iside].Data(),colorPix);
1047  barPart->SetBackgroundColor(colorPix);
1048 // gClient->GetColorByName("red",colorPix);
1049 // barPart->SetForegroundColor(colorPix);
1050  }
1051  }
1052  }
1053  }
1054 
1055 }
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Int_t GetPdgCode() const
Definition: PndMCTrack.h:73
TVector3 GetMomentum() const
Definition: PndMCTrack.h:78
TObjArray * fRealStations
Int_t fDrawStation
Int_t GetNSensors() const
Definition: PndGemStation.h:60
PndGemSensor * GetSensorByNr(Int_t sensorNr)
Int_t GetChannel(Double_t x, Double_t y, Int_t iSide)
Double_t
TGStatusBar * fInfoStatusBar
Double_t x
Double_t y
TVector3 GetStartVertex() const
Definition: PndMCTrack.h:76
TClonesArray * fMCTrackArray
TRootEmbeddedCanvas * fEcanvas
double pz[39]
Definition: pipisigmas.h:14
TClonesArray * fGemPointArray
void MyMainFrame::DoRecreate ( )

Definition at line 151 of file structure_analysis_emc.C.

References emcMap, file_name, fsim, infile(), PndEmcMapper::Instance(), PndEmcStructure::Instance(), outfile, PndEmcStructure::Print(), and tsim.

152 {
153  std::cout<<"Recreate structure.txt"<<std::endl;
154  TFile* fsim = new TFile(file_name.c_str());
155  TTree *tsim=(TTree *) fsim->Get("pndsim") ;
157  PndEmcStructure::Instance()->Print("structure.txt",2);
158  std::cout<<"File with emc structure is created"<<std::endl;
159 
160  // Delete lines from the file, which are not relatd to forward EMC
161  string line;
162  ifstream infile("structure.txt");
163  ofstream outfile("outfile.txt");
164  //copy first linef
165  getline(infile,line);
166  outfile<<line<<"\n";
167 
168  while (getline(infile,line))
169  {
170  if (line[0]!='3') continue; // Forward endcap start from 3
171  outfile<<line<<"\n";
172  }
173 
174  infile.close();
175  outfile.close();
176  remove("structure.txt");
177  rename("outfile.txt","structure.txt");
178  std::cout<<"All but Forward emc is removed"<<std::endl;
179  std::cout<<"Done"<<std::endl;
180 
181 
182 }
Emc geometry mapper.
Definition: PndEmcMapper.h:22
void Print(string, Int_t option=1) const
PndEmcMapper * emcMap
static PndEmcStructure * Instance()
TFile infile("dedx_out.root","READ")
static PndEmcMapper * Instance()
string file_name
TString outfile
void MyMainFrame::DoSave ( )

Definition at line 184 of file structure_analysis_emc.C.

References c1, and fEcan.

185 {
186 
187  TCanvas *c1 = fEcan->GetCanvas();
188  c1->SaveAs("emc_structure.ps");
189  std::cout<<"Structure is saved to emc_structure.ps"<<std::endl;
190 }
TRootEmbeddedCanvas * fEcan
c1
Definition: plot_dirc.C:35
void MyMainFrame::DrawDigis ( )

Definition at line 499 of file guiEventDisplay.C.

References CAMath::Cos(), Double_t, fDrawStation, fGemDigiArray, fNofGemDigis, fStations, PndGemDigi::GetChannelNr(), PndGemSensor::GetInnerRadius(), PndGemSensor::GetNChannelsBack(), PndGemSensor::GetNChannelsFront(), PndGemSensor::GetOuterRadius(), PndGemSensor::GetPitch(), PndGemStation::GetSensorByNr(), PndGemDigi::GetSensorNr(), PndGemDigi::GetSide(), PndGemDigi::GetStationNr(), PndGemSensor::GetStripAngle(), and CAMath::Sin().

499  {
500  PndGemDigi* digiToDraw;
501  PndGemStation* digiStation;
502  PndGemSensor* digiSensor;
503  Int_t digiStationNr ;
504  Int_t digiSensorNr ;
505  Int_t digiSide ;
506  Int_t channelNumber ;
507 
508  for ( Int_t idigi = 0 ; idigi < fNofGemDigis ; idigi++ ) {
509  // cout << "drawing digi " << idigi << endl;
510 
511  // if ( idigi < fNofGemDigis ) {
512  digiToDraw = (PndGemDigi*)fGemDigiArray->At(idigi);
513  digiStationNr = digiToDraw->GetStationNr();
514  digiSensorNr = digiToDraw->GetSensorNr();
515  digiSide = digiToDraw->GetSide();
516  channelNumber = digiToDraw->GetChannelNr();
517  /* }
518  else {
519  if ( idigi < fNofGemDigis+4 ) {
520  digiStationNr = 1;
521  digiSensorNr = 1+(idigi-fNofGemDigis)/2;
522  digiSide = (idigi-fNofGemDigis)%2;
523  channelNumber = 1;
524  }
525  else {
526  digiStationNr = 1;
527  digiSensorNr = 1+(idigi-4-fNofGemDigis)/2;
528  digiSide = (idigi-4-fNofGemDigis)%2;
529  channelNumber = 1047;
530  }
531  }*/
532 
533  // cout << " digi is in station " << digiStationNr << endl;
534  if ( digiStationNr != fDrawStation+1 ) continue;
535  // cout << " digi is in sensor " << flush << digiSensorNr << endl;
536  digiStation = (PndGemStation*)fStations->At(fDrawStation);
537  digiSensor = (PndGemSensor*) digiStation->GetSensorByNr(digiSensorNr);
538  // digiSensor->Print();
539 
540  if ( digiSensor->GetStripAngle(digiSide) > 89. ) {
541  // cout << "to draw ellipse strip" << endl;
542  Double_t rRadius = digiSensor->GetInnerRadius() + channelNumber*digiSensor->GetPitch(digiSide);
543  TEllipse* rStrip = new TEllipse(0.,0.,rRadius,rRadius);
544  rStrip->SetFillStyle(0);
545  rStrip->SetLineColor(2);
546  rStrip->Draw("");
547  Double_t lRadius = digiSensor->GetInnerRadius() + (channelNumber-1)*digiSensor->GetPitch(digiSide);
548  TEllipse* lStrip = new TEllipse(0.,0.,lRadius,lRadius);
549  lStrip->SetFillStyle(0);
550  lStrip->SetLineColor(2);
551  lStrip->Draw("");
552 
553  }
554  else {
555  // cout << "to draw radial strip" << endl;
556  Double_t deltaTheta = TMath::DegToRad()*digiSensor->GetStripAngle(digiSide);
557  Double_t innerPStripPitch = digiSensor->GetPitch(digiSide);
558 
559  // Double_t innerCirc = digiSensor->GetInnerRadius()*2.*TMath::Pi();
560  Int_t nofStrips = (digiSide?digiSensor->GetNChannelsBack():digiSensor->GetNChannelsFront());
561 
562  // if ( digiSensor->GetStripAngle(digiSide) == 0. ) cout << "channel number = " << channelNumber << endl;
563  Double_t radialStripSpan = TMath::ATan(digiSensor->GetPitch(digiSide)/digiSensor->GetInnerRadius());
564 
565  // Double_t channelTheta = (channelNumber-1) * 2.*TMath::Pi()/((Double_t)(nofStrips));
566  Double_t channelTheta = (channelNumber-1) * radialStripSpan;//2.*TMath::Pi()/((Double_t)(nofStrips));
567  Double_t cosCT = TMath::Cos(channelTheta);
568  Double_t sinCT = TMath::Sin(channelTheta);
569 
570  // Double_t radialStripSpan = 2.*TMath::Pi()/((Double_t)(nofStrips));
571  Double_t cosRSS = TMath::Cos(radialStripSpan);
572  Double_t sinRSS = TMath::Sin(radialStripSpan);
573 
574  Double_t xBot = 0;
575  Double_t xTop = TMath::Sin(deltaTheta)*digiSensor->GetOuterRadius();
576  Double_t yBot = digiSensor->GetInnerRadius();
577  Double_t yTop = TMath::Cos(deltaTheta)*digiSensor->GetOuterRadius();
578 
579  Double_t xpstr[5];
580  Double_t ypstr[5];
581 
582  xpstr[0] = xBot*cosCT+yBot*sinCT;
583  ypstr[0] =-xBot*sinCT+yBot*cosCT;
584  xpstr[1] = xTop*cosCT+yTop*sinCT;
585  ypstr[1] =-xTop*sinCT+yTop*cosCT;
586 
587  xpstr[2] = xpstr[1]*cosRSS+ypstr[1]*sinRSS;
588  ypstr[2] =-xpstr[1]*sinRSS+ypstr[1]*cosRSS;
589  xpstr[3] = xpstr[0]*cosRSS+ypstr[0]*sinRSS;
590  ypstr[3] =-xpstr[0]*sinRSS+ypstr[0]*cosRSS;
591  xpstr[4] = xpstr[0];
592  ypstr[4] = ypstr[0];
593 
594  Int_t colorCode = 4;
595  if ( digiSensor->GetStripAngle(digiSide) > 0. ) {
596  colorCode = 1;
597  }
598  if ( digiSensor->GetStripAngle(digiSide) < 0. ) {
599  colorCode = 6;
600  }
601 
602  TPolyLine* strip = new TPolyLine(5,xpstr,ypstr);
603  strip->SetUniqueID(666666);
604  // cout << "this strip has id = " << strip->GetUniqueID() << endl;
605  strip->SetLineWidth(2);
606  strip->SetLineColor(colorCode);
607  strip->SetFillColor(colorCode);
608  strip->Draw("");
609 
610  }
611  // cout << "done" << endl;
612  }
613 }
Int_t GetStationNr() const
Definition: PndGemDigi.h:84
Double_t GetInnerRadius() const
Definition: PndGemSensor.h:102
static T Sin(const T &x)
Definition: PndCAMath.h:42
Int_t GetNChannelsBack() const
Definition: PndGemSensor.h:112
static T Cos(const T &x)
Definition: PndCAMath.h:43
Int_t GetSensorNr() const
Definition: PndGemDigi.h:86
Int_t fDrawStation
PndGemSensor * GetSensorByNr(Int_t sensorNr)
Int_t fNofGemDigis
TObjArray * fStations
Double_t
Double_t GetChannelNr() const
Definition: PndGemDigi.h:80
Int_t GetNChannelsFront() const
Definition: PndGemSensor.h:111
Double_t GetOuterRadius() const
Definition: PndGemSensor.h:103
Double_t GetPitch(Int_t index) const
Definition: PndGemSensor.h:106
TClonesArray * fGemDigiArray
Int_t GetSide() const
Definition: PndGemDigi.h:88
Double_t GetStripAngle(Int_t index) const
Definition: PndGemSensor.h:105
void MyMainFrame::DrawHitErrors ( )

Definition at line 657 of file guiEventDisplay.C.

References CAMath::Cos(), Double_t, fDrawStation, fGemHitArray, fNofGemHits, PndGemHit::GetDp(), PndGemHit::GetDr(), PndGemHit::GetStationNr(), Pi, CAMath::Sin(), and CAMath::Sqrt().

657  {
658  Double_t markerSize = 2.;
659  if ( fPlotSize > 1.1 ) markerSize = 1.;
660  Int_t markerColor = 13;
661  Int_t markerStyle = 29;
662 
663  PndGemHit* hitToDraw;
664  for ( Int_t ihit = 0 ; ihit < fNofGemHits ; ihit++ ) {
665  markerColor = 11;
666 
667  hitToDraw = (PndGemHit*)fGemHitArray->At(ihit);
668 
669  Int_t hitStationNr = hitToDraw->GetStationNr();
670 
671  if ( hitStationNr != fDrawStation+1 ) continue;
672 
673  Double_t hitX = hitToDraw->GetX();
674  Double_t hitY = hitToDraw->GetY();
675 
676  Double_t errRValue = hitToDraw->GetDr()*TMath::Sqrt(3.);
677  Double_t errPValue = hitToDraw->GetDp()*TMath::Sqrt(3.);
678  // Double_t phiAValue = 0.;
679  Double_t phiAValue = TMath::ATan(hitX/hitY);
680  if ( hitY < 0 ) phiAValue += TMath::Pi();
681  else if ( hitX < 0 ) phiAValue += 2.*TMath::Pi();
682 
683  Double_t cosPhi = TMath::Cos(phiAValue);
684  Double_t sinPhi = TMath::Sin(phiAValue);
685 
686  Double_t xErr[5], yErr[5];
687  xErr[0] = hitX-errPValue*cosPhi+errRValue*sinPhi; yErr[0] = hitY+errPValue*sinPhi+errRValue*cosPhi;
688  xErr[1] = hitX+errPValue*cosPhi+errRValue*sinPhi; yErr[1] = hitY-errPValue*sinPhi+errRValue*cosPhi;
689  xErr[2] = hitX+errPValue*cosPhi-errRValue*sinPhi; yErr[2] = hitY-errPValue*sinPhi-errRValue*cosPhi;
690  xErr[3] = hitX-errPValue*cosPhi-errRValue*sinPhi; yErr[3] = hitY+errPValue*sinPhi-errRValue*cosPhi;
691  xErr[4] = xErr[0]; yErr[4] = yErr[0];
692 
693  TPolyLine* errorBox = new TPolyLine(5,xErr,yErr);
694  if ( hitToDraw->GetRefIndex() > 0 )
695  errorBox->SetUniqueID(hitToDraw->GetRefIndex());
696  else
697  errorBox->SetUniqueID(666666);
698 
699  errorBox->SetLineWidth(0);
700  errorBox->SetLineColor(markerColor);
701  errorBox->SetFillColor(markerColor);
702  errorBox->Draw("");
703 
704  }
705 }
TClonesArray * fGemHitArray
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
static T Sin(const T &x)
Definition: PndCAMath.h:42
static T Cos(const T &x)
Definition: PndCAMath.h:43
Int_t fDrawStation
Double_t
Double_t GetDp() const
Definition: PndGemHit.h:76
Int_t GetStationNr() const
Definition: PndGemHit.h:81
Double_t GetDr() const
Definition: PndGemHit.h:75
Double_t Pi
Double_t fPlotSize
void MyMainFrame::DrawHits ( )

Definition at line 617 of file guiEventDisplay.C.

References Double_t, fDrawStation, fGemHitArray, fNofGemHits, and PndGemHit::GetStationNr().

617  {
618  Double_t markerSize = 2.;
619  if ( fPlotSize > 1.1 ) markerSize = 1.;
620  Int_t markerColor = 1;
621  Int_t markerStyle = 29;
622 
623  PndGemHit* hitToDraw;
624  for ( Int_t ihit = 0 ; ihit < fNofGemHits ; ihit++ ) {
625  markerColor = 1;
626  markerStyle = 29;
627  markerSize = 3.;
628  if ( fPlotSize > 1.1 ) markerSize = 1.5;
629 
630  hitToDraw = (PndGemHit*)fGemHitArray->At(ihit);
631 
632  Int_t hitStationNr = hitToDraw->GetStationNr();
633 
634  if ( hitStationNr != fDrawStation+1 ) continue;
635 
636  Double_t hitX = hitToDraw->GetX();
637  Double_t hitY = hitToDraw->GetY();
638  TMarker* hitCenter = new TMarker(hitX,hitY,markerStyle);
639  if ( hitToDraw->GetRefIndex() >= 0 ) {
640  hitCenter->SetUniqueID(hitToDraw->GetRefIndex());
641  hitCenter->SetMarkerColor(markerColor);
642  hitCenter->SetMarkerSize(markerSize);
643  }
644  else {
645  hitCenter->SetUniqueID(666666);
646  hitCenter->SetMarkerColor(2);
647  hitCenter->SetMarkerSize(markerSize);
648  }
649 
650  hitCenter->Draw();
651 
652  }
653 }
TClonesArray * fGemHitArray
Int_t fDrawStation
Double_t
Int_t GetStationNr() const
Definition: PndGemHit.h:81
Double_t fPlotSize
void MyMainFrame::DrawPoints ( )

Definition at line 430 of file guiEventDisplay.C.

References Double_t, fDrawStation, fGemPointArray, fMCTrackArray, fNofGemPoints, PndMCTrack::GetPdgCode(), PndGemMCPoint::GetSensorId(), and PndMCTrack::GetStartVertex().

430  {
431  Double_t markerSize = 2.;
432  if ( fPlotSize > 1.1 ) markerSize = 1.;
433  Int_t markerColor = 1;
434 
435  PndGemMCPoint* pointToDraw;
436  for ( Int_t ipoint = 0 ; ipoint < fNofGemPoints ; ipoint++ ) {
437  markerColor = 1;
438 
439  pointToDraw = (PndGemMCPoint*)fGemPointArray->At(ipoint);
440 
441  //return stationNr*256+sensorNr*16+segmentNr;
442 
443  // TString stationIdentifier = pointToDraw->GetDetName();
444  Int_t stationNr = pointToDraw->GetSensorId();
445  Int_t segmentNr = stationNr%16;
446  Int_t sensorNr = (stationNr/16)%16;
447  stationNr = stationNr/256;
448  // cout << "point at " << pointToDraw->GetZ() << ", sid = " << pointToDraw->GetSensorId() << " : " << stationNr << " / " << sensorNr << " / " << segmentNr << endl;
449  // if ( !stationIdentifier.Contains(Form("Disk%d",fDrawStation+1)) ) continue;
450  if ( stationNr != fDrawStation+1 ) continue;
451 
452  TMarker* pointCenter = new TMarker(pointToDraw->GetX(),pointToDraw->GetY(),20);
453  pointCenter->SetUniqueID(ipoint);
454  // cout << "set uid to " << ipoint << endl;
455 
456  // if ( stationIdentifier.Contains("Gem1") ) markerColor = 3;
457  // if ( stationIdentifier.Contains("Pad") ) markerColor = 2;
458  // if ( stationIdentifier.Contains("Gem6") ) markerColor = 4;
459  if ( sensorNr == 1 ) markerColor = 3;
460  if ( sensorNr == 2 ) markerColor = 4;
461 
462  pointCenter->SetMarkerColor(markerColor);
463  pointCenter->Draw();
464 
465  // if ( stationIdentifier.Contains("Pad") ) {
466  if ( sensorNr == 2 ) {
467  PndMCTrack* trackSel = (PndMCTrack*)fMCTrackArray->At(pointToDraw->GetTrackID());
468  TVector3 startVertex = trackSel->GetStartVertex();
469 
470  Int_t textColor = 2;
471  if ( startVertex.Mag() < 0.001 ) textColor = 3;
472 
473  TPaveText* trackNoText = new TPaveText(pointToDraw->GetX(),pointToDraw->GetY(),
474  pointToDraw->GetX(),pointToDraw->GetY());
475  TText* textNumber = trackNoText->AddText(Form("%d",pointToDraw->GetTrackID()));
476 
477  // trackNoText->AddText("center");
478  textNumber->SetTextSize(0.05);
479  textNumber->SetTextColor(textColor);
480  trackNoText->Draw();
481 
482  Double_t posY = pointToDraw->GetY();
483 
484  TPaveText* trackPdgText = new TPaveText(pointToDraw->GetX(),posY-fPlotSize/20.,
485  pointToDraw->GetX(),posY-fPlotSize/20.);
486 
487  trackPdgText->AddText(Form("%d",trackSel->GetPdgCode()));
488  trackPdgText->SetTextSize(0.02);
489  trackPdgText->SetTextColor(textColor);
490  trackPdgText->Draw();
491 
492  }
493 
494  }
495 }
Int_t GetPdgCode() const
Definition: PndMCTrack.h:73
Int_t fDrawStation
Int_t fNofGemPoints
Int_t GetSensorId() const
Definition: PndGemMCPoint.h:90
Double_t
TVector3 GetStartVertex() const
Definition: PndMCTrack.h:76
TClonesArray * fMCTrackArray
Double_t fPlotSize
TClonesArray * fGemPointArray
void MyMainFrame::EventInfo ( Int_t  event,
Int_t  px,
Int_t  py,
TObject *  selected 
)

Definition at line 198 of file structure_analysis_emc.C.

References SetStatusText().

199 {
200 // Writes the event status in the status bar parts
201 
202  const char *text2;
203  char text0[50], text1[50];
204  sprintf(text0, "(iX,iY)=%s", selected->GetTitle());
205  SetStatusText(text0,0);
206  sprintf(text1, "detId=%s", selected->GetName());
207  SetStatusText(text1,1);
208  text2 = selected->GetObjectInfo(px,py);
209  SetStatusText(text2,2);
210 }
void SetStatusText(const char *txt, Int_t pi)
void MyMainFrame::MoveDOWN ( )
inline

Definition at line 104 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Double_t fPlotCenterY
void ChangePlotParams()
Double_t fPlotSize
void MyMainFrame::Movedown ( )
inline

Definition at line 105 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Double_t fPlotCenterY
void ChangePlotParams()
Double_t fPlotSize
void MyMainFrame::MoveLEFT ( )
inline

Definition at line 106 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Double_t fPlotCenterX
void ChangePlotParams()
Double_t fPlotSize
void MyMainFrame::Moveleft ( )
inline

Definition at line 107 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Double_t fPlotCenterX
void ChangePlotParams()
Double_t fPlotSize
void MyMainFrame::MoveRIGHT ( )
inline

Definition at line 108 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Double_t fPlotCenterX
void ChangePlotParams()
Double_t fPlotSize
void MyMainFrame::Moveright ( )
inline

Definition at line 109 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Double_t fPlotCenterX
void ChangePlotParams()
Double_t fPlotSize
void MyMainFrame::MoveUP ( )
inline

Definition at line 102 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Double_t fPlotCenterY
void ChangePlotParams()
Double_t fPlotSize
void MyMainFrame::Moveup ( )
inline

Definition at line 103 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Double_t fPlotCenterY
void ChangePlotParams()
Double_t fPlotSize
void MyMainFrame::NextStat ( )
inline

Definition at line 119 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

119  {
121  if ( fDrawStation == fNofStations ) fDrawStation = 0;
123  }
Int_t fDrawStation
Int_t fNofStations
void ChangePlotParams()
void MyMainFrame::PrevStat ( )
inline

Definition at line 114 of file guiEventDisplay.C.

References ChangePlotParams(), DoDraw(), and fNofStations.

114  {
115  if ( fDrawStation == 0 ) fDrawStation = fNofStations;
118  }
Int_t fDrawStation
Int_t fNofStations
void ChangePlotParams()
void MyMainFrame::ReadEvent ( )

Definition at line 776 of file guiEventDisplay.C.

References DoDraw(), fBaseString, fDigiFile, fDigiTree, fEventToDrawEntry, fGemDigiArray, fGemHitArray, fGemPointArray, fHitsFile, fHitsTree, fMCTrackArray, fNofGemDigis, fNofGemHits, fNofGemPoints, fNofMCTracks, fSimFile, fSimRecoFilesRead, fSimTree, and TString.

776  {
777  if ( !fSimRecoFilesRead ) {
778  fSimFile = TFile::Open(Form("%s.root",fBaseString.Data()));
779 
780  if ( !fSimFile )
781  return;
782 
783  cout << "simulation file \"" << fSimFile->GetName() << "\" loaded" << endl;
784  fSimTree = (TTree*) fSimFile->Get("pndsim");
785 
786  fGemPointArray = new TClonesArray("PndGemMCPoint");
787  fSimTree->SetBranchAddress("GEMPoint",&fGemPointArray) ;
788 
789  fMCTrackArray = new TClonesArray("PndMCTrack");
790  fSimTree->SetBranchAddress("MCTrack",&fMCTrackArray) ;
791 
792  fDigiFile = TFile::Open(Form("%s_digi.root",fBaseString.Data()));
793  fHitsFile = TFile::Open(Form("%s_hits.root",fBaseString.Data()));
794 
795  if ( !fDigiFile || !fHitsFile )
796  return;
797 
798  cout << "digi file \"" << fDigiFile->GetName() << "\" loaded" << endl;
799  fDigiTree = (TTree*) fDigiFile->Get("pndsim");
800  fGemDigiArray = new TClonesArray("PndGemDigi");
801  fDigiTree->SetBranchAddress("GEMDigi",&fGemDigiArray) ;
802 
803  cout << "hits file \"" << fHitsFile->GetName() << "\" loaded" << endl;
804  fHitsTree = (TTree*) fHitsFile->Get("pndsim");
805  fGemHitArray = new TClonesArray("PndGemHit");
806  fHitsTree->SetBranchAddress("GEMHit",&fGemHitArray) ;
807 
808  fSimRecoFilesRead = kTRUE;
809  }
810 
811  Int_t iEvent = fEventToDrawEntry->GetIntNumber();
812 
813  fSimTree->GetEntry(iEvent);
814  fDigiTree->GetEntry(iEvent);
815  fHitsTree->GetEntry(iEvent);
816 
817  fNofGemPoints = fGemPointArray->GetEntriesFast();
818  fNofMCTracks = fMCTrackArray ->GetEntriesFast();
819  fNofGemHits = fGemHitArray ->GetEntriesFast();
820  fNofGemDigis = fGemDigiArray ->GetEntriesFast();
821 
822  Int_t falseHits = 0;
823  PndGemHit* hitToDraw;
824  for ( Int_t ihit = 0 ; ihit < fNofGemHits ; ihit++ ) {
825  hitToDraw = (PndGemHit*)fGemHitArray->At(ihit);
826  if ( hitToDraw->GetRefIndex() == -1 )
827  falseHits ++;
828 // cout << "GOT FALSE HIT" << endl;
829  }
830 
831  cout << " --> Event #" << iEvent << ": "
832  << fNofGemPoints << " points, "
833  << fNofMCTracks << " MCtracks, "
834  << fNofGemHits << " hits, "
835  << fNofGemDigis << " digis. # of false hits: " << falseHits << endl;
836 
837 
838  TString tempString = Form("%d",iEvent+1);
839  fEventToDrawEntry->SetText(tempString.Data());
840 
841  DoDraw();
842 }
TClonesArray * fGemHitArray
Bool_t fSimRecoFilesRead
TTree * fSimTree
Int_t fNofGemPoints
Int_t fNofGemDigis
Int_t fNofMCTracks
TFile * fDigiFile
TTree * fDigiTree
TFile * fHitsFile
TTree * fHitsTree
TGNumberEntryField * fEventToDrawEntry
TClonesArray * fMCTrackArray
TFile * fSimFile
TClonesArray * fGemDigiArray
TString fBaseString
TClonesArray * fGemPointArray
void MyMainFrame::ReadParameters ( )

Definition at line 846 of file guiEventDisplay.C.

References CAMath::Abs(), PndGemStation::AddSensor(), b, c, CAMath::Cos(), Double_t, fNofStations, fParFString, fRealStations, fStations, fStationsInnerRadius, fStationsOuterRadius, fStationsZPosition, PndGemStation::GetZ(), i, isec, m, Pi, r, sensor, CAMath::Sqrt(), and TString.

846  {
847  fStations = new TObjArray(10);
848  fRealStations = new TObjArray(10);
849 
850  TString dir = getenv("VMCWORKDIR");
851  TString geoFileName = fParFString.Data();
852  geoFileName.ReplaceAll("$VMCWORKDIR",dir.Data());
853 
854  ifstream fin(geoFileName.Data());
855 
856  string dummyText; //dummy text
857 
858  if(!fin) { cout << "sorry, no file \"" << geoFileName.Data() << "\"" << endl; return; }
859 
860  TString check;
861 
862  do {
863  getline(fin,dummyText);
864  }
865  while ( dummyText.find('#') != -1 );
866  getline(fin,dummyText);
867  // cout << "finished reading the beginning" << endl;
868  Double_t parameters[1000];
869  Int_t nofParameters = 0;
870 
871  TString bufNumber;
872 
873  while ( fin ) {
874  getline(fin,dummyText);
875  if ( dummyText.find("TrackFinder") != -1 ) break;
876  // cout << "reading " << dummyText << endl;
877  dummyText.replace(0,dummyText.find_first_not_of(' '),"");
878  // cout << "now it is " << dummyText << endl;
879  while ( dummyText.find(',') != -1 ) {
880  parameters[nofParameters++] = atof(dummyText.c_str());
881  // cout << "parameter[" << nofParameters-1 << "] = " << parameters[nofParameters-1] << endl;
882  dummyText.replace(0,dummyText.find(',')+1,"");
883  // cout << " and it is " << dummyText << endl;
884  }
885  if ( atof(dummyText.c_str()) != 0. )
886  parameters[nofParameters++] = atof(dummyText.c_str());
887  // cout << " --> " << nofParameters << " parameters" << endl;
888  }
889  //cout << "parameter[" << nofParameters-1 << "] = " << parameters[nofParameters-1] << endl;
890  fin.close();
891 
892  Int_t arrayIndex = 0;
893 
894  Int_t stationNr = 0;
895  TString stationName = "";
896  Int_t nofSensors = 0;
897  Int_t sensorNr = 0;
898  TString sensorName = "";
899  PndGemStation* station = NULL;
900  PndGemSensor* sensor = NULL;
901 
902  PndGemStation* realStation = NULL;
903  PndGemSensor* realSensor = NULL;
904 
905 
906  while ( arrayIndex < nofParameters ) {
907  stationNr = (Int_t)parameters[arrayIndex+0];
908  stationName = Form("Gem_Station_%d",stationNr);
909 
910  station = new PndGemStation(stationName.Data(), stationNr, parameters[arrayIndex+1], TMath::Pi()*parameters[arrayIndex+2]/180. );
911  realStation = new PndGemStation(stationName.Data(), stationNr, parameters[arrayIndex+1], TMath::Pi()*parameters[arrayIndex+2]/180. );
912 
913  fStationsZPosition [stationNr-1] = station->GetZ();
914  cout << "ADDING STATION AT " << station->GetZ() << endl;
915  fStations->Add(station);
916  fRealStations->Add(realStation);
917 
918  arrayIndex += 4;
919 
920  nofSensors = (Int_t)parameters[arrayIndex-1];
921 
922  for ( Int_t isec = 0 ; isec < nofSensors ; isec++ ) {
923  if ( isec == 0 ) {
924  fStationsInnerRadius[stationNr-1] = parameters[arrayIndex+ 6];
925  fStationsOuterRadius[stationNr-1] = parameters[arrayIndex+ 7];
926  }
927 
928  sensorNr = (Int_t)parameters[arrayIndex+0];
929  sensorName = Form("Gem_Disk%d_Gem%s_Sensor_kapton",stationNr,(sensorNr==1?"1":"6"));
930 
931  realSensor = new PndGemSensor(sensorName.Data(), stationNr, sensorNr, (Int_t)parameters[arrayIndex+1],
932  parameters[arrayIndex+ 2], parameters[arrayIndex+ 3], parameters[arrayIndex+ 4],
933  -TMath::Pi()*parameters[arrayIndex+ 5]/180.,
934  parameters[arrayIndex+ 6], parameters[arrayIndex+ 7],
935  parameters[arrayIndex+ 8],
936  parameters[arrayIndex+ 9], parameters[arrayIndex+10],
937  parameters[arrayIndex+11], parameters[arrayIndex+12]);
938 
939  for ( Int_t itemp = 0 ; itemp < 2 ; itemp++ ) {
940  if ( TMath::Abs(parameters[arrayIndex+ 9+itemp]) < 1. ||
941  TMath::Abs(parameters[arrayIndex+ 9+itemp]) > 89. )
942  continue;
943 
944  Double_t c = TMath::Cos((180.-parameters[arrayIndex+ 9+itemp])*TMath::DegToRad());
945  Double_t i = parameters[arrayIndex+ 6];
946  Double_t r = parameters[arrayIndex+ 7];
947  Double_t m = i*c+TMath::Sqrt(i*i*c*c-i*i+r*r);
948 
949  Double_t b = TMath::ACos((i*i+r*r-m*m)/(2.*i*r))*TMath::RadToDeg();
950 
951  if ( parameters[arrayIndex+ 9+itemp] > 0. ) parameters[arrayIndex+ 9+itemp] = b;
952  if ( parameters[arrayIndex+ 9+itemp] < 0. ) parameters[arrayIndex+ 9+itemp] = -b;
953 
954  cout << "angle = " << parameters[arrayIndex+ 9+itemp] << endl;
955  }
956 
957  sensor = new PndGemSensor(sensorName.Data(), stationNr, sensorNr, (Int_t)parameters[arrayIndex+1],
958  parameters[arrayIndex+ 2], parameters[arrayIndex+ 3], parameters[arrayIndex+ 4],
959  -TMath::Pi()*parameters[arrayIndex+ 5]/180.,
960  parameters[arrayIndex+ 6], parameters[arrayIndex+ 7],
961  parameters[arrayIndex+ 8],
962  parameters[arrayIndex+ 9], parameters[arrayIndex+10],
963  parameters[arrayIndex+11], parameters[arrayIndex+12]);
964 
965  station->AddSensor(sensor);
966  realStation->AddSensor(realSensor);
967 
968  arrayIndex+=13;
969  }
970  }
971  fNofStations = fStations->GetEntries();
972  cout << "Made " << fNofStations << " stations." << endl;
973 }
double r
Definition: RiemannTest.C:14
Int_t i
Definition: run_full.C:25
__m128 m
Definition: P4_F32vec4.h:28
TTree * b
static T Sqrt(const T &x)
Definition: PndCAMath.h:37
Double_t GetZ(Int_t it=0)
TGeoVolume * sensor
void AddSensor(PndGemSensor *sensor)
static T Cos(const T &x)
Definition: PndCAMath.h:43
TObjArray * fRealStations
Double_t fStationsZPosition[10]
int isec
Definition: f_Init.h:19
static T Abs(const T &x)
Definition: PndCAMath.h:39
Int_t fNofStations
TObjArray * fStations
Double_t
TString fParFString
Double_t Pi
Double_t fStationsInnerRadius[10]
Double_t fStationsOuterRadius[10]
void MyMainFrame::SaveCanvas ( )

Definition at line 727 of file guiEventDisplay.C.

References fEcanvas, and TString.

727  {
728  TCanvas *fCanvas = fEcanvas->GetCanvas();
729 
730  TString saveToFile = "outputFile.gif";
731  cout << "will save canvas as \"" << saveToFile.Data() << "\"" << endl;
732 
733  fCanvas->SaveAs(saveToFile.Data());
734 }
TRootEmbeddedCanvas * fEcanvas
void MyMainFrame::SetDigitSchemeToDraw ( Int_t  itemp)
inline

Definition at line 90 of file guiEventDisplay.C.

References DoDraw().

90 {fDigitSchemeToDraw = itemp-1; DoDraw(); };
Int_t fDigitSchemeToDraw
void MyMainFrame::SetStatusText ( const char *  txt,
Int_t  pi 
)

Definition at line 192 of file structure_analysis_emc.C.

References fStatusBar.

Referenced by EventInfo().

193 {
194  // Set text in status bar.
195  fStatusBar->SetText(txt,pi);
196 }
TGStatusBar * fStatusBar
#define pi
Definition: createSTT.C:60
void MyMainFrame::ZoomIn ( )
inline

Definition at line 111 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

void MyMainFrame::ZoomOut ( )
inline

Definition at line 112 of file guiEventDisplay.C.

References ChangePlotParams(), and DoDraw().

Member Data Documentation

TString MyMainFrame::fBaseString
private

Definition at line 59 of file guiEventDisplay.C.

Referenced by ReadEvent().

TFile* MyMainFrame::fDigiFile
private

Definition at line 67 of file guiEventDisplay.C.

Referenced by ReadEvent().

TTree* MyMainFrame::fDigiTree
private

Definition at line 68 of file guiEventDisplay.C.

Referenced by ReadEvent().

Int_t MyMainFrame::fDigitSchemeToDraw
private

Definition at line 52 of file guiEventDisplay.C.

Int_t MyMainFrame::fDrawStation
private
TRootEmbeddedCanvas* MyMainFrame::fEcan
private

Definition at line 85 of file structure_analysis_emc.C.

Referenced by DoDraw(), DoSave(), MyMainFrame(), and ~MyMainFrame().

TRootEmbeddedCanvas* MyMainFrame::fEcanvas
private

Definition at line 23 of file guiEventDisplay.C.

Referenced by DoInfoStatusBar(), and SaveCanvas().

TGNumberEntryField* MyMainFrame::fEventToDrawEntry
private

Definition at line 32 of file guiEventDisplay.C.

Referenced by ReadEvent().

TClonesArray* MyMainFrame::fGemDigiArray
private

Definition at line 72 of file guiEventDisplay.C.

Referenced by DrawDigis(), and ReadEvent().

TClonesArray* MyMainFrame::fGemHitArray
private

Definition at line 71 of file guiEventDisplay.C.

Referenced by DrawHitErrors(), DrawHits(), and ReadEvent().

PndGemMCPoint* MyMainFrame::fGemPoint
private

Definition at line 74 of file guiEventDisplay.C.

TClonesArray* MyMainFrame::fGemPointArray
private

Definition at line 64 of file guiEventDisplay.C.

Referenced by DoInfoStatusBar(), DrawPoints(), and ReadEvent().

TFile* MyMainFrame::fHitsFile
private

Definition at line 69 of file guiEventDisplay.C.

Referenced by ReadEvent().

TTree* MyMainFrame::fHitsTree
private

Definition at line 70 of file guiEventDisplay.C.

Referenced by ReadEvent().

TGStatusBar* MyMainFrame::fInfoStatusBar
private

Definition at line 25 of file guiEventDisplay.C.

Referenced by DoInfoStatusBar().

TGMainFrame* MyMainFrame::fMain
private

Definition at line 21 of file guiEventDisplay.C.

TClonesArray* MyMainFrame::fMCTrackArray
private

Definition at line 65 of file guiEventDisplay.C.

Referenced by DoInfoStatusBar(), DrawPoints(), and ReadEvent().

Int_t MyMainFrame::fNofGemDigis
private

Definition at line 57 of file guiEventDisplay.C.

Referenced by DrawDigis(), and ReadEvent().

Int_t MyMainFrame::fNofGemHits
private

Definition at line 56 of file guiEventDisplay.C.

Referenced by DrawHitErrors(), DrawHits(), and ReadEvent().

Int_t MyMainFrame::fNofGemPoints
private

Definition at line 54 of file guiEventDisplay.C.

Referenced by DrawPoints(), and ReadEvent().

Int_t MyMainFrame::fNofMCTracks
private

Definition at line 55 of file guiEventDisplay.C.

Referenced by ReadEvent().

Int_t MyMainFrame::fNofStations
private

Definition at line 43 of file guiEventDisplay.C.

Referenced by PrevStat(), and ReadParameters().

TString MyMainFrame::fParFString
private

Definition at line 60 of file guiEventDisplay.C.

Referenced by ReadParameters().

TGNumberEntryField* MyMainFrame::fPCenXEntry
private

Definition at line 28 of file guiEventDisplay.C.

Referenced by ChangePlotParams().

TGNumberEntryField* MyMainFrame::fPCenYEntry
private

Definition at line 29 of file guiEventDisplay.C.

Referenced by ChangePlotParams().

TGNumberEntryField* MyMainFrame::fPCenZEntry
private

Definition at line 30 of file guiEventDisplay.C.

Referenced by ChangePlotParams().

Double_t MyMainFrame::fPlotCenterX
private

Definition at line 38 of file guiEventDisplay.C.

Referenced by ChangePlotParams().

Double_t MyMainFrame::fPlotCenterY
private

Definition at line 39 of file guiEventDisplay.C.

Referenced by ChangePlotParams().

Double_t MyMainFrame::fPlotCenterZ
private

Definition at line 40 of file guiEventDisplay.C.

Referenced by ChangePlotParams().

Double_t MyMainFrame::fPlotSize
private

Definition at line 37 of file guiEventDisplay.C.

TGNumberEntryField* MyMainFrame::fPointToDrawEntry
private

Definition at line 33 of file guiEventDisplay.C.

TGNumberEntryField* MyMainFrame::fPSizeEntry
private

Definition at line 27 of file guiEventDisplay.C.

Referenced by ChangePlotParams().

TObjArray* MyMainFrame::fRealStations
private

Definition at line 45 of file guiEventDisplay.C.

Referenced by DoInfoStatusBar(), and ReadParameters().

TFile* MyMainFrame::fSimFile
private

Definition at line 62 of file guiEventDisplay.C.

Referenced by ReadEvent().

Bool_t MyMainFrame::fSimRecoFilesRead
private

Definition at line 76 of file guiEventDisplay.C.

Referenced by ReadEvent().

TTree* MyMainFrame::fSimTree
private

Definition at line 63 of file guiEventDisplay.C.

Referenced by ReadEvent().

TObjArray* MyMainFrame::fStations
private

Definition at line 46 of file guiEventDisplay.C.

Referenced by DrawDigis(), and ReadParameters().

Double_t MyMainFrame::fStationsInnerRadius[10]
private

Definition at line 48 of file guiEventDisplay.C.

Referenced by ReadParameters().

Double_t MyMainFrame::fStationsOuterRadius[10]
private

Definition at line 49 of file guiEventDisplay.C.

Referenced by ReadParameters().

Double_t MyMainFrame::fStationsZPosition[10]
private

Definition at line 50 of file guiEventDisplay.C.

Referenced by ChangePlotParams(), and ReadParameters().

TGStatusBar* MyMainFrame::fStatusBar
private

Definition at line 86 of file structure_analysis_emc.C.

Referenced by MyMainFrame(), and SetStatusText().

TStopwatch MyMainFrame::fTimer
private

Definition at line 35 of file guiEventDisplay.C.


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